@mastra/deployer-cloud 1.31.0-alpha.5 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/studio/assets/{index-BX2WRjBO.js → index-7ieOcYNR.js} +1 -1
  3. package/dist/studio/assets/{index-Qfb-TMU9.js → index-8WbdDFad.js} +1 -1
  4. package/dist/studio/assets/{index-DpADPRJ2.js → index-BRChO8Yu.js} +1 -1
  5. package/dist/studio/assets/{index-CRm8MYVP.js → index-BbA95K4k.js} +1 -1
  6. package/dist/studio/assets/{index-BzLOh-7D.js → index-BpIdOhgx.js} +1 -1
  7. package/dist/studio/assets/{index-OQGxFc6Q.js → index-BqLrs_D6.js} +1 -1
  8. package/dist/studio/assets/{index-BOJsjpUj.js → index-BwD1O97j.js} +1 -1
  9. package/dist/studio/assets/{index-DmYrqjBS.js → index-C8DbVZr9.js} +1 -1
  10. package/dist/studio/assets/{index-DyfYKArn.js → index-CAJhefpS.js} +1 -1
  11. package/dist/studio/assets/{index--SlVHfqJ.js → index-CE9g4tqB.js} +1 -1
  12. package/dist/studio/assets/{index-DbfXFhuJ.js → index-D0O42cyD.js} +1 -1
  13. package/dist/studio/assets/{index-DN4iI_FZ.js → index-DzbjqZuh.js} +1 -1
  14. package/dist/studio/assets/{index-DjnpXhnk.js → index-JM8kh28x.js} +1 -1
  15. package/dist/studio/assets/{index-BoCBXeII.js → index-i0aoSioD.js} +1 -1
  16. package/dist/studio/assets/{index-Bqb6E-Ls.js → index-jLLY5crc.js} +1 -1
  17. package/dist/studio/assets/{index-CmxmGF_j.js → index-lVi8ohSV.js} +1 -1
  18. package/dist/studio/assets/{index-aVJP9avi.js → index-xQ6MkQZY.js} +1 -1
  19. package/dist/studio/assets/{index-CI8kfc4F.js → index-xwFYAMf_.js} +1 -1
  20. package/dist/studio/assets/{main-CoXGuatO.js → main-C3JY-giB.js} +5 -5
  21. package/dist/studio/index.html +1 -1
  22. package/package.json +7 -7
  23. package/versions.json +1 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index--SlVHfqJ.js","./index-OQGxFc6Q.js","./index-DpADPRJ2.js","./index-DbfXFhuJ.js","./index-CRm8MYVP.js","./index-CI8kfc4F.js","./index-BX2WRjBO.js","./index-aVJP9avi.js","./index-DmYrqjBS.js","./index-Bqb6E-Ls.js","./index-BOJsjpUj.js","./index-DyfYKArn.js","./index-BzLOh-7D.js","./index-Qfb-TMU9.js","./index-DjnpXhnk.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-BoCBXeII.js","./index-DN4iI_FZ.js","./index-CmxmGF_j.js"])))=>i.map(i=>d[i]);
2
- import{_ as Ke}from"./index-OQGxFc6Q.js";function t7e(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Y$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oU={exports:{}},bj={};var hwe;function g_t(){if(hwe)return bj;hwe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return bj.Fragment=t,bj.jsx=r,bj.jsxs=r,bj}var pwe;function y_t(){return pwe||(pwe=1,oU.exports=g_t()),oU.exports}var o=y_t(),lU={exports:{}},gn={},mwe;function v_t(){if(mwe)return gn;mwe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=p&&V[p]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(V,M,W){this.props=V,this.context=M,this.refs=x,this.updater=W||g}w.prototype.isReactComponent={},w.prototype.setState=function(V,M){if(typeof V!="object"&&typeof V!="function"&&V!=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,V,M,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(V,M,W){this.props=V,this.context=M,this.refs=x,this.updater=W||g}var _=k.prototype=new S;_.constructor=k,y(_,w.prototype),_.isPureReactComponent=!0;var E=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(V,M,W){var G=W.ref;return{$$typeof:t,type:V,key:M,ref:G!==void 0?G:null,props:W}}function P(V,M){return I(V.type,M,V.props)}function R(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var M={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return M[W]})}var D=/\/+/g;function $(V,M){return typeof V=="object"&&V!==null&&V.key!=null?B(""+V.key):M.toString(36)}function U(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(T,T):(V.status="pending",V.then(function(M){V.status==="pending"&&(V.status="fulfilled",V.value=M)},function(M){V.status==="pending"&&(V.status="rejected",V.reason=M)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,M,W,G,J){var ae=typeof V;(ae==="undefined"||ae==="boolean")&&(V=null);var te=!1;if(V===null)te=!0;else switch(ae){case"bigint":case"string":case"number":te=!0;break;case"object":switch(V.$$typeof){case t:case r:te=!0;break;case f:return te=V._init,z(te(V._payload),M,W,G,J)}}if(te)return J=J(V),te=G===""?"."+$(V,0):G,E(J)?(W="",te!=null&&(W=te.replace(D,"$&/")+"/"),z(J,M,W,"",function(he){return he})):J!=null&&(R(J)&&(J=P(J,W+(J.key==null||V&&V.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+te)),M.push(J)),1;te=0;var re=G===""?".":G+":";if(E(V))for(var ie=0;ie<V.length;ie++)G=V[ie],ae=re+$(G,ie),te+=z(G,M,W,ae,J);else if(ie=m(V),typeof ie=="function")for(V=ie.call(V),ie=0;!(G=V.next()).done;)G=G.value,ae=re+$(G,ie++),te+=z(G,M,W,ae,J);else if(ae==="object"){if(typeof V.then=="function")return z(U(V),M,W,G,J);throw M=String(V),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return te}function H(V,M,W){if(V==null)return V;var G=[],J=0;return z(V,G,"","",function(ae){return M.call(W,ae,J++)}),G}function Q(V){if(V._status===-1){var M=V._result;M=M(),M.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=M)}if(V._status===1)return V._result.default;throw V._result}var L=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(M))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},Z={map:H,forEach:function(V,M,W){H(V,function(){M.apply(this,arguments)},W)},count:function(V){var M=0;return H(V,function(){M++}),M},toArray:function(V){return H(V,function(M){return M})||[]},only:function(V){if(!R(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return gn.Activity=h,gn.Children=Z,gn.Component=w,gn.Fragment=n,gn.Profiler=a,gn.PureComponent=k,gn.StrictMode=s,gn.Suspense=u,gn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,gn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},gn.cache=function(V){return function(){return V.apply(null,arguments)}},gn.cacheSignal=function(){return null},gn.cloneElement=function(V,M,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var G=y({},V.props),J=V.key;if(M!=null)for(ae in M.key!==void 0&&(J=""+M.key),M)!N.call(M,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&M.ref===void 0||(G[ae]=M[ae]);var ae=arguments.length-2;if(ae===1)G.children=W;else if(1<ae){for(var te=Array(ae),re=0;re<ae;re++)te[re]=arguments[re+2];G.children=te}return I(V.type,J,G)},gn.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},gn.createElement=function(V,M,W){var G,J={},ae=null;if(M!=null)for(G in M.key!==void 0&&(ae=""+M.key),M)N.call(M,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=M[G]);var te=arguments.length-2;if(te===1)J.children=W;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];J.children=re}if(V&&V.defaultProps)for(G in te=V.defaultProps,te)J[G]===void 0&&(J[G]=te[G]);return I(V,ae,J)},gn.createRef=function(){return{current:null}},gn.forwardRef=function(V){return{$$typeof:c,render:V}},gn.isValidElement=R,gn.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Q}},gn.memo=function(V,M){return{$$typeof:d,type:V,compare:M===void 0?null:M}},gn.startTransition=function(V){var M=j.T,W={};j.T=W;try{var G=V(),J=j.S;J!==null&&J(W,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(ae){L(ae)}finally{M!==null&&W.types!==null&&(M.types=W.types),j.T=M}},gn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},gn.use=function(V){return j.H.use(V)},gn.useActionState=function(V,M,W){return j.H.useActionState(V,M,W)},gn.useCallback=function(V,M){return j.H.useCallback(V,M)},gn.useContext=function(V){return j.H.useContext(V)},gn.useDebugValue=function(){},gn.useDeferredValue=function(V,M){return j.H.useDeferredValue(V,M)},gn.useEffect=function(V,M){return j.H.useEffect(V,M)},gn.useEffectEvent=function(V){return j.H.useEffectEvent(V)},gn.useId=function(){return j.H.useId()},gn.useImperativeHandle=function(V,M,W){return j.H.useImperativeHandle(V,M,W)},gn.useInsertionEffect=function(V,M){return j.H.useInsertionEffect(V,M)},gn.useLayoutEffect=function(V,M){return j.H.useLayoutEffect(V,M)},gn.useMemo=function(V,M){return j.H.useMemo(V,M)},gn.useOptimistic=function(V,M){return j.H.useOptimistic(V,M)},gn.useReducer=function(V,M,W){return j.H.useReducer(V,M,W)},gn.useRef=function(V){return j.H.useRef(V)},gn.useState=function(V){return j.H.useState(V)},gn.useSyncExternalStore=function(V,M,W){return j.H.useSyncExternalStore(V,M,W)},gn.useTransition=function(){return j.H.useTransition()},gn.version="19.2.5",gn}var gwe;function _E(){return gwe||(gwe=1,lU.exports=v_t()),lU.exports}var b=_E();const je=Uo(b),Y1=t7e({__proto__:null,default:je},[b]);var cU={exports:{}},xj={},uU={exports:{}},dU={};var ywe;function b_t(){return ywe||(ywe=1,(function(e){function t(U,z){var H=U.length;U.push(z);e:for(;0<H;){var Q=H-1>>>1,L=U[Q];if(0<s(L,z))U[Q]=z,U[H]=L,H=Q;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var z=U[0],H=U.pop();if(H!==z){U[0]=H;e:for(var Q=0,L=U.length,Z=L>>>1;Q<Z;){var V=2*(Q+1)-1,M=U[V],W=V+1,G=U[W];if(0>s(M,H))W<L&&0>s(G,M)?(U[Q]=G,U[W]=H,Q=W):(U[Q]=M,U[V]=H,Q=V);else if(W<L&&0>s(G,H))U[Q]=G,U[W]=H,Q=W;else break e}}return z}function s(U,z){var H=U.sortIndex-z.sortIndex;return H!==0?H:U.id-z.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 i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(U){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=U)n(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=r(u)}}function _(U){if(g=!1,k(U),!m)if(r(c)!==null)m=!0,E||(E=!0,R());else{var z=r(u);z!==null&&$(_,z.startTime-U)}}var E=!1,T=-1,j=5,N=-1;function I(){return y?!0:!(e.unstable_now()-N<j)}function P(){if(y=!1,E){var U=e.unstable_now();N=U;var z=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),p=!0;var H=h;try{t:{for(k(U),f=r(c);f!==null&&!(f.expirationTime>U&&I());){var Q=f.callback;if(typeof Q=="function"){f.callback=null,h=f.priorityLevel;var L=Q(f.expirationTime<=U);if(U=e.unstable_now(),typeof L=="function"){f.callback=L,k(U),z=!0;break t}f===r(c)&&n(c),k(U)}else n(c);f=r(c)}if(f!==null)z=!0;else{var Z=r(u);Z!==null&&$(_,Z.startTime-U),z=!1}}break e}finally{f=null,h=H,p=!1}z=void 0}}finally{z?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=P,R=function(){D.postMessage(null)}}else R=function(){x(P,0)};function $(U,z){T=x(function(){U(e.unstable_now())},z)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(U){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var H=h;h=z;try{return U()}finally{h=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var H=h;h=U;try{return z()}finally{h=H}},e.unstable_scheduleCallback=function(U,z,H){var Q=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Q+H:Q):H=Q,U){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=H+L,U={id:d++,callback:z,priorityLevel:U,startTime:H,expirationTime:L,sortIndex:-1},H>Q?(U.sortIndex=H,t(u,U),r(c)===null&&U===r(u)&&(g?(w(T),T=-1):g=!0,$(_,H-Q))):(U.sortIndex=L,t(c,U),m||p||(m=!0,E||(E=!0,R()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var z=h;return function(){var H=h;h=z;try{return U.apply(this,arguments)}finally{h=H}}}})(dU)),dU}var vwe;function x_t(){return vwe||(vwe=1,uU.exports=b_t()),uU.exports}var fU={exports:{}},Kl={};var bwe;function w_t(){if(bwe)return Kl;bwe=1;var e=_E();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Kl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Kl.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return a(c,u,null,d)},Kl.flushSync=function(c){var u=i.T,d=n.p;try{if(i.T=null,n.p=2,c)return c()}finally{i.T=u,n.p=d,n.d.f()}},Kl.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},Kl.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},Kl.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin),h=typeof u.integrity=="string"?u.integrity:void 0,p=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:h,fetchPriority:p}):d==="script"&&n.d.X(c,{crossOrigin:f,integrity:h,fetchPriority:p,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Kl.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},Kl.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Kl.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},Kl.requestFormReset=function(c){n.d.r(c)},Kl.unstable_batchedUpdates=function(c,u){return c(u)},Kl.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Kl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Kl.version="19.2.5",Kl}var xwe;function r7e(){if(xwe)return fU.exports;xwe=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(),fU.exports=w_t(),fU.exports}var wwe;function S_t(){if(wwe)return xj;wwe=1;var e={env:{}};var t=x_t(),r=_E(),n=r7e();function s(v){var O="https://react.dev/errors/"+v;if(1<arguments.length){O+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)O+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+v+"; visit "+O+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(v){return!(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)}function i(v){var O=v,C=v;if(v.alternate)for(;O.return;)O=O.return;else{v=O;do O=v,(O.flags&4098)!==0&&(C=O.return),v=O.return;while(v)}return O.tag===3?C:null}function l(v){if(v.tag===13){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function c(v){if(v.tag===31){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function u(v){if(i(v)!==v)throw Error(s(188))}function d(v){var O=v.alternate;if(!O){if(O=i(v),O===null)throw Error(s(188));return O!==v?null:v}for(var C=v,A=O;;){var F=C.return;if(F===null)break;var q=F.alternate;if(q===null){if(A=F.return,A!==null){C=A;continue}break}if(F.child===q.child){for(q=F.child;q;){if(q===C)return u(F),v;if(q===A)return u(F),O;q=q.sibling}throw Error(s(188))}if(C.return!==A.return)C=F,A=q;else{for(var ee=!1,fe=F.child;fe;){if(fe===C){ee=!0,C=F,A=q;break}if(fe===A){ee=!0,A=F,C=q;break}fe=fe.sibling}if(!ee){for(fe=q.child;fe;){if(fe===C){ee=!0,C=q,A=F;break}if(fe===A){ee=!0,A=q,C=F;break}fe=fe.sibling}if(!ee)throw Error(s(189))}}if(C.alternate!==A)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?v:O}function f(v){var O=v.tag;if(O===5||O===26||O===27||O===6)return v;for(v=v.child;v!==null;){if(O=f(v),O!==null)return O;v=v.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(v){return v===null||typeof v!="object"?null:(v=R&&v[R]||v["@@iterator"],typeof v=="function"?v:null)}var D=Symbol.for("react.client.reference");function $(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===D?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof v=="object")switch(v.$$typeof){case g:return"Portal";case k:return v.displayName||"Context";case S:return(v._context.displayName||"Context")+".Consumer";case _:var O=v.render;return v=v.displayName,v||(v=O.displayName||O.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case j:return O=v.displayName||null,O!==null?O:$(v.type)||"Memo";case N:O=v._payload,v=v._init;try{return $(v(O))}catch{}}return null}var U=Array.isArray,z=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function V(v){return{current:v}}function M(v){0>Z||(v.current=L[Z],L[Z]=null,Z--)}function W(v,O){Z++,L[Z]=v.current,v.current=O}var G=V(null),J=V(null),ae=V(null),te=V(null);function re(v,O){switch(W(ae,O),W(J,v),W(G,null),O.nodeType){case 9:case 11:v=(v=O.documentElement)&&(v=v.namespaceURI)?D0e(v):0;break;default:if(v=O.tagName,O=O.namespaceURI)O=D0e(O),v=L0e(O,v);else switch(v){case"svg":v=1;break;case"math":v=2;break;default:v=0}}M(G),W(G,v)}function ie(){M(G),M(J),M(ae)}function he(v){v.memoizedState!==null&&W(te,v);var O=G.current,C=L0e(O,v.type);O!==C&&(W(J,v),W(G,C))}function X(v){J.current===v&&(M(G),M(J)),te.current===v&&(M(te),mj._currentValue=Q)}var se,le;function xe(v){if(se===void 0)try{throw Error()}catch(C){var O=C.stack.trim().match(/\n( *(at )?)/);se=O&&O[1]||"",le=-1<C.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CE9g4tqB.js","./index-BqLrs_D6.js","./index-BRChO8Yu.js","./index-D0O42cyD.js","./index-BbA95K4k.js","./index-xwFYAMf_.js","./index-7ieOcYNR.js","./index-xQ6MkQZY.js","./index-C8DbVZr9.js","./index-jLLY5crc.js","./index-BwD1O97j.js","./index-CAJhefpS.js","./index-BpIdOhgx.js","./index-8WbdDFad.js","./index-JM8kh28x.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-i0aoSioD.js","./index-DzbjqZuh.js","./index-lVi8ohSV.js"])))=>i.map(i=>d[i]);
2
+ import{_ as Ke}from"./index-BqLrs_D6.js";function t7e(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Y$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oU={exports:{}},bj={};var hwe;function g_t(){if(hwe)return bj;hwe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return bj.Fragment=t,bj.jsx=r,bj.jsxs=r,bj}var pwe;function y_t(){return pwe||(pwe=1,oU.exports=g_t()),oU.exports}var o=y_t(),lU={exports:{}},gn={},mwe;function v_t(){if(mwe)return gn;mwe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=p&&V[p]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(V,M,W){this.props=V,this.context=M,this.refs=x,this.updater=W||g}w.prototype.isReactComponent={},w.prototype.setState=function(V,M){if(typeof V!="object"&&typeof V!="function"&&V!=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,V,M,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(V,M,W){this.props=V,this.context=M,this.refs=x,this.updater=W||g}var _=k.prototype=new S;_.constructor=k,y(_,w.prototype),_.isPureReactComponent=!0;var E=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(V,M,W){var G=W.ref;return{$$typeof:t,type:V,key:M,ref:G!==void 0?G:null,props:W}}function P(V,M){return I(V.type,M,V.props)}function R(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var M={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return M[W]})}var D=/\/+/g;function $(V,M){return typeof V=="object"&&V!==null&&V.key!=null?B(""+V.key):M.toString(36)}function U(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(T,T):(V.status="pending",V.then(function(M){V.status==="pending"&&(V.status="fulfilled",V.value=M)},function(M){V.status==="pending"&&(V.status="rejected",V.reason=M)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,M,W,G,J){var ae=typeof V;(ae==="undefined"||ae==="boolean")&&(V=null);var te=!1;if(V===null)te=!0;else switch(ae){case"bigint":case"string":case"number":te=!0;break;case"object":switch(V.$$typeof){case t:case r:te=!0;break;case f:return te=V._init,z(te(V._payload),M,W,G,J)}}if(te)return J=J(V),te=G===""?"."+$(V,0):G,E(J)?(W="",te!=null&&(W=te.replace(D,"$&/")+"/"),z(J,M,W,"",function(he){return he})):J!=null&&(R(J)&&(J=P(J,W+(J.key==null||V&&V.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+te)),M.push(J)),1;te=0;var re=G===""?".":G+":";if(E(V))for(var ie=0;ie<V.length;ie++)G=V[ie],ae=re+$(G,ie),te+=z(G,M,W,ae,J);else if(ie=m(V),typeof ie=="function")for(V=ie.call(V),ie=0;!(G=V.next()).done;)G=G.value,ae=re+$(G,ie++),te+=z(G,M,W,ae,J);else if(ae==="object"){if(typeof V.then=="function")return z(U(V),M,W,G,J);throw M=String(V),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return te}function H(V,M,W){if(V==null)return V;var G=[],J=0;return z(V,G,"","",function(ae){return M.call(W,ae,J++)}),G}function Q(V){if(V._status===-1){var M=V._result;M=M(),M.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=M)}if(V._status===1)return V._result.default;throw V._result}var L=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent(M))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},Z={map:H,forEach:function(V,M,W){H(V,function(){M.apply(this,arguments)},W)},count:function(V){var M=0;return H(V,function(){M++}),M},toArray:function(V){return H(V,function(M){return M})||[]},only:function(V){if(!R(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return gn.Activity=h,gn.Children=Z,gn.Component=w,gn.Fragment=n,gn.Profiler=a,gn.PureComponent=k,gn.StrictMode=s,gn.Suspense=u,gn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,gn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},gn.cache=function(V){return function(){return V.apply(null,arguments)}},gn.cacheSignal=function(){return null},gn.cloneElement=function(V,M,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var G=y({},V.props),J=V.key;if(M!=null)for(ae in M.key!==void 0&&(J=""+M.key),M)!N.call(M,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&M.ref===void 0||(G[ae]=M[ae]);var ae=arguments.length-2;if(ae===1)G.children=W;else if(1<ae){for(var te=Array(ae),re=0;re<ae;re++)te[re]=arguments[re+2];G.children=te}return I(V.type,J,G)},gn.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},gn.createElement=function(V,M,W){var G,J={},ae=null;if(M!=null)for(G in M.key!==void 0&&(ae=""+M.key),M)N.call(M,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=M[G]);var te=arguments.length-2;if(te===1)J.children=W;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];J.children=re}if(V&&V.defaultProps)for(G in te=V.defaultProps,te)J[G]===void 0&&(J[G]=te[G]);return I(V,ae,J)},gn.createRef=function(){return{current:null}},gn.forwardRef=function(V){return{$$typeof:c,render:V}},gn.isValidElement=R,gn.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Q}},gn.memo=function(V,M){return{$$typeof:d,type:V,compare:M===void 0?null:M}},gn.startTransition=function(V){var M=j.T,W={};j.T=W;try{var G=V(),J=j.S;J!==null&&J(W,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(ae){L(ae)}finally{M!==null&&W.types!==null&&(M.types=W.types),j.T=M}},gn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},gn.use=function(V){return j.H.use(V)},gn.useActionState=function(V,M,W){return j.H.useActionState(V,M,W)},gn.useCallback=function(V,M){return j.H.useCallback(V,M)},gn.useContext=function(V){return j.H.useContext(V)},gn.useDebugValue=function(){},gn.useDeferredValue=function(V,M){return j.H.useDeferredValue(V,M)},gn.useEffect=function(V,M){return j.H.useEffect(V,M)},gn.useEffectEvent=function(V){return j.H.useEffectEvent(V)},gn.useId=function(){return j.H.useId()},gn.useImperativeHandle=function(V,M,W){return j.H.useImperativeHandle(V,M,W)},gn.useInsertionEffect=function(V,M){return j.H.useInsertionEffect(V,M)},gn.useLayoutEffect=function(V,M){return j.H.useLayoutEffect(V,M)},gn.useMemo=function(V,M){return j.H.useMemo(V,M)},gn.useOptimistic=function(V,M){return j.H.useOptimistic(V,M)},gn.useReducer=function(V,M,W){return j.H.useReducer(V,M,W)},gn.useRef=function(V){return j.H.useRef(V)},gn.useState=function(V){return j.H.useState(V)},gn.useSyncExternalStore=function(V,M,W){return j.H.useSyncExternalStore(V,M,W)},gn.useTransition=function(){return j.H.useTransition()},gn.version="19.2.5",gn}var gwe;function _E(){return gwe||(gwe=1,lU.exports=v_t()),lU.exports}var b=_E();const je=Uo(b),Y1=t7e({__proto__:null,default:je},[b]);var cU={exports:{}},xj={},uU={exports:{}},dU={};var ywe;function b_t(){return ywe||(ywe=1,(function(e){function t(U,z){var H=U.length;U.push(z);e:for(;0<H;){var Q=H-1>>>1,L=U[Q];if(0<s(L,z))U[Q]=z,U[H]=L,H=Q;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var z=U[0],H=U.pop();if(H!==z){U[0]=H;e:for(var Q=0,L=U.length,Z=L>>>1;Q<Z;){var V=2*(Q+1)-1,M=U[V],W=V+1,G=U[W];if(0>s(M,H))W<L&&0>s(G,M)?(U[Q]=G,U[W]=H,Q=W):(U[Q]=M,U[V]=H,Q=V);else if(W<L&&0>s(G,H))U[Q]=G,U[W]=H,Q=W;else break e}}return z}function s(U,z){var H=U.sortIndex-z.sortIndex;return H!==0?H:U.id-z.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 i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(U){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=U)n(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=r(u)}}function _(U){if(g=!1,k(U),!m)if(r(c)!==null)m=!0,E||(E=!0,R());else{var z=r(u);z!==null&&$(_,z.startTime-U)}}var E=!1,T=-1,j=5,N=-1;function I(){return y?!0:!(e.unstable_now()-N<j)}function P(){if(y=!1,E){var U=e.unstable_now();N=U;var z=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),p=!0;var H=h;try{t:{for(k(U),f=r(c);f!==null&&!(f.expirationTime>U&&I());){var Q=f.callback;if(typeof Q=="function"){f.callback=null,h=f.priorityLevel;var L=Q(f.expirationTime<=U);if(U=e.unstable_now(),typeof L=="function"){f.callback=L,k(U),z=!0;break t}f===r(c)&&n(c),k(U)}else n(c);f=r(c)}if(f!==null)z=!0;else{var Z=r(u);Z!==null&&$(_,Z.startTime-U),z=!1}}break e}finally{f=null,h=H,p=!1}z=void 0}}finally{z?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=P,R=function(){D.postMessage(null)}}else R=function(){x(P,0)};function $(U,z){T=x(function(){U(e.unstable_now())},z)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(U){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var H=h;h=z;try{return U()}finally{h=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var H=h;h=U;try{return z()}finally{h=H}},e.unstable_scheduleCallback=function(U,z,H){var Q=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Q+H:Q):H=Q,U){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=H+L,U={id:d++,callback:z,priorityLevel:U,startTime:H,expirationTime:L,sortIndex:-1},H>Q?(U.sortIndex=H,t(u,U),r(c)===null&&U===r(u)&&(g?(w(T),T=-1):g=!0,$(_,H-Q))):(U.sortIndex=L,t(c,U),m||p||(m=!0,E||(E=!0,R()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var z=h;return function(){var H=h;h=z;try{return U.apply(this,arguments)}finally{h=H}}}})(dU)),dU}var vwe;function x_t(){return vwe||(vwe=1,uU.exports=b_t()),uU.exports}var fU={exports:{}},Kl={};var bwe;function w_t(){if(bwe)return Kl;bwe=1;var e=_E();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Kl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Kl.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return a(c,u,null,d)},Kl.flushSync=function(c){var u=i.T,d=n.p;try{if(i.T=null,n.p=2,c)return c()}finally{i.T=u,n.p=d,n.d.f()}},Kl.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},Kl.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},Kl.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin),h=typeof u.integrity=="string"?u.integrity:void 0,p=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:h,fetchPriority:p}):d==="script"&&n.d.X(c,{crossOrigin:f,integrity:h,fetchPriority:p,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Kl.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},Kl.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Kl.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},Kl.requestFormReset=function(c){n.d.r(c)},Kl.unstable_batchedUpdates=function(c,u){return c(u)},Kl.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Kl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Kl.version="19.2.5",Kl}var xwe;function r7e(){if(xwe)return fU.exports;xwe=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(),fU.exports=w_t(),fU.exports}var wwe;function S_t(){if(wwe)return xj;wwe=1;var e={env:{}};var t=x_t(),r=_E(),n=r7e();function s(v){var O="https://react.dev/errors/"+v;if(1<arguments.length){O+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)O+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+v+"; visit "+O+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(v){return!(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)}function i(v){var O=v,C=v;if(v.alternate)for(;O.return;)O=O.return;else{v=O;do O=v,(O.flags&4098)!==0&&(C=O.return),v=O.return;while(v)}return O.tag===3?C:null}function l(v){if(v.tag===13){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function c(v){if(v.tag===31){var O=v.memoizedState;if(O===null&&(v=v.alternate,v!==null&&(O=v.memoizedState)),O!==null)return O.dehydrated}return null}function u(v){if(i(v)!==v)throw Error(s(188))}function d(v){var O=v.alternate;if(!O){if(O=i(v),O===null)throw Error(s(188));return O!==v?null:v}for(var C=v,A=O;;){var F=C.return;if(F===null)break;var q=F.alternate;if(q===null){if(A=F.return,A!==null){C=A;continue}break}if(F.child===q.child){for(q=F.child;q;){if(q===C)return u(F),v;if(q===A)return u(F),O;q=q.sibling}throw Error(s(188))}if(C.return!==A.return)C=F,A=q;else{for(var ee=!1,fe=F.child;fe;){if(fe===C){ee=!0,C=F,A=q;break}if(fe===A){ee=!0,A=F,C=q;break}fe=fe.sibling}if(!ee){for(fe=q.child;fe;){if(fe===C){ee=!0,C=q,A=F;break}if(fe===A){ee=!0,A=q,C=F;break}fe=fe.sibling}if(!ee)throw Error(s(189))}}if(C.alternate!==A)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?v:O}function f(v){var O=v.tag;if(O===5||O===26||O===27||O===6)return v;for(v=v.child;v!==null;){if(O=f(v),O!==null)return O;v=v.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),k=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(v){return v===null||typeof v!="object"?null:(v=R&&v[R]||v["@@iterator"],typeof v=="function"?v:null)}var D=Symbol.for("react.client.reference");function $(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===D?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof v=="object")switch(v.$$typeof){case g:return"Portal";case k:return v.displayName||"Context";case S:return(v._context.displayName||"Context")+".Consumer";case _:var O=v.render;return v=v.displayName,v||(v=O.displayName||O.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case j:return O=v.displayName||null,O!==null?O:$(v.type)||"Memo";case N:O=v._payload,v=v._init;try{return $(v(O))}catch{}}return null}var U=Array.isArray,z=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function V(v){return{current:v}}function M(v){0>Z||(v.current=L[Z],L[Z]=null,Z--)}function W(v,O){Z++,L[Z]=v.current,v.current=O}var G=V(null),J=V(null),ae=V(null),te=V(null);function re(v,O){switch(W(ae,O),W(J,v),W(G,null),O.nodeType){case 9:case 11:v=(v=O.documentElement)&&(v=v.namespaceURI)?D0e(v):0;break;default:if(v=O.tagName,O=O.namespaceURI)O=D0e(O),v=L0e(O,v);else switch(v){case"svg":v=1;break;case"math":v=2;break;default:v=0}}M(G),W(G,v)}function ie(){M(G),M(J),M(ae)}function he(v){v.memoizedState!==null&&W(te,v);var O=G.current,C=L0e(O,v.type);O!==C&&(W(J,v),W(G,C))}function X(v){J.current===v&&(M(G),M(J)),te.current===v&&(M(te),mj._currentValue=Q)}var se,le;function xe(v){if(se===void 0)try{throw Error()}catch(C){var O=C.stack.trim().match(/\n( *(at )?)/);se=O&&O[1]||"",le=-1<C.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+se+v+le}var de=!1;function ue(v,O){if(!v||de)return"";de=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var A={DetermineComponentFrameRoot:function(){try{if(O){var ut=function(){throw Error()};if(Object.defineProperty(ut.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ut,[])}catch(et){var Ze=et}Reflect.construct(v,[],ut)}else{try{ut.call()}catch(et){Ze=et}v.call(ut.prototype)}}else{try{throw Error()}catch(et){Ze=et}(ut=v())&&typeof ut.catch=="function"&&ut.catch(function(){})}}catch(et){if(et&&Ze&&typeof et.stack=="string")return[et.stack,Ze.stack]}return[null,null]}};A.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var F=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");F&&F.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var q=A.DetermineComponentFrameRoot(),ee=q[0],fe=q[1];if(ee&&fe){var Te=ee.split(`
5
5
  `),Ge=fe.split(`
@@ -112,7 +112,7 @@ Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}
112
112
  constructor(\${params}) {
113
113
  \${}
114
114
  }
115
- }`,{label:"class",detail:"definition",type:"keyword"}),ku('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ku('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],BGe=$ue.concat([ku("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ku("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ku("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Ake=new BHe,UGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Pj(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const tWt=["FunctionDeclaration"],rWt={FunctionDeclaration:Pj("function"),ClassDeclaration:Pj("class"),ClassExpression:()=>!0,EnumDeclaration:Pj("constant"),TypeAliasDeclaration:Pj("type"),NamespaceDeclaration:Pj("namespace"),VariableDefinition(e,t){e.matchContext(tWt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function VGe(e,t){let r=Ake.get(t);if(r)return r;let n=[],s=!0;function a(i,l){let c=e.sliceString(i.from,i.to);n.push({label:c,type:l})}return t.cursor(ea.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=rWt[i.name];if(l&&l(i,a)||UGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of VGe(e,i.node))n.push(l);return!1}}),Ake.set(t,n),n}const G3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Fue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function qGe(e){let t=Ra(e.state).resolveInner(e.pos,-1);if(Fue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&G3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)UGe.has(s.name)&&(n=n.concat(VGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:G3}}function pV(e,t,r){var n;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:r};if(a?.name=="MemberExpression"&&((n=i=a.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function HGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ra(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?pV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?pV(t,r.parent,""):Fue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&G3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?pV(t,r,""):e.explicit?{path:[],name:""}:null}function nWt(e,t){let r=e,n=[],s=new Set;for(let a=0;;a++){for(let l of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||s.has(l))continue;s.add(l);let c;try{c=r[l]}catch{continue}n.push({label:l,type:typeof c=="function"?/^[A-Z]/.test(l)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return n;e=i}}function sWt(e){let t=new Map;return r=>{let n=HGe(r);if(!n)return null;let s=e;for(let i of n.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=nWt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:G3}}}const ph=i1.define({name:"javascript",parser:eWt.configure({props:[iS.add({IfStatement:zk({except:/^\s*({|else\b)/}),TryStatement:zk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:eVt,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:JUt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":zk({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),oS.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":vue,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let r=e.lastChild;return{from:t.to,to:r.type.isError?e.to:r.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let r=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,n=e.lastChild;return!r||r.type.isError?null:{from:r.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),QGe={test:e=>/^JSX/.test(e.name),facet:LF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},zue=ph.configure({dialect:"ts"},"typescript"),Bue=ph.configure({dialect:"jsx",props:[mue.add(e=>e.isTop?[QGe]:void 0)]}),Uue=ph.configure({dialect:"jsx ts",props:[mue.add(e=>e.isTop?[QGe]:void 0)]},"typescript");let WGe=e=>({label:e,type:"keyword"});const GGe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(WGe),aWt=GGe.concat(["declare","implements","private","protected","public"].map(WGe));function Z3(e={}){let t=e.jsx?e.typescript?Uue:Bue:e.typescript?zue:ph,r=e.typescript?BGe.concat(aWt):$ue.concat(GGe);return new l1(t,[ph.data.of({autocomplete:FVt(Fue,VWe(r))}),ph.data.of({autocomplete:qGe}),e.jsx?ZGe:[]])}function iWt(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Ike(e,t,r=e.length){for(let n=t?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return e.sliceString(n.from,Math.min(n.to,r));return""}const oWt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),ZGe=ft.inputHandler.of((e,t,r,n,s)=>{if((oWt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!ph.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=Ra(i).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=n||f.name=="JSXAttributeValue"&&f.to>d)){if(n==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=Ike(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:nt.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(n==">"){let p=iWt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=Ike(i.doc,p,d)))return{range:c,changes:{from:d,insert:`</${h}>`}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function lWt(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((r,n)=>{var s;!((s=r.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[n]=2)})),r=>{let{state:n}=r,s=[];for(let{from:a,to:i}of ph.findRegions(n)){let l=n.doc.lineAt(a),c={line:l.number-1,col:a-l.from,pos:a};for(let u of e.verify(n.sliceDoc(a,i),t))s.push(cWt(u,n.doc,c))}return s}}function Rke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function cWt(e,t,r){let n=Rke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?Rke(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,l=a[0]+r.pos-n,c=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const rD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:ZGe,completionPath:HGe,esLint:lWt,javascript:Z3,javascriptLanguage:ph,jsxLanguage:Bue,localCompletionSource:qGe,scopeCompletionSource:sWt,snippets:$ue,tsxLanguage:Uue,typescriptLanguage:zue,typescriptSnippets:BGe},Symbol.toStringTag,{value:"Module"})),Mj=["_blank","_self","_top","_parent"],mV=["ascii","utf-8","utf-16","latin1","latin1"],gV=["get","post","put","delete"],yV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],bd=["true","false"],Dr={},uWt={a:{attrs:{href:null,ping:null,type:null,media:null,target:Mj,hreflang:null}},abbr:Dr,address:Dr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Dr,aside:Dr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Dr,base:{attrs:{href:null,target:Mj}},bdi:Dr,bdo:Dr,blockquote:{attrs:{cite:null}},body:Dr,br:Dr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:Mj,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Dr,center:Dr,cite:Dr,code:Dr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Dr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Dr,div:Dr,dl:Dr,dt:Dr,em:Dr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Dr,figure:Dr,footer:Dr,form:{attrs:{action:null,name:null,"accept-charset":mV,autocomplete:["on","off"],enctype:yV,method:gV,novalidate:["novalidate"],target:Mj}},h1:Dr,h2:Dr,h3:Dr,h4:Dr,h5:Dr,h6:Dr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Dr,hgroup:Dr,hr:Dr,html:{attrs:{manifest:null}},i:Dr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:Mj,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Dr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Dr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Dr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mV,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Dr,noscript:Dr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Dr,param:{attrs:{name:null,value:null}},pre:Dr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Dr,rt:Dr,ruby:Dr,samp:Dr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mV}},section:Dr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Dr,source:{attrs:{src:null,type:null,media:null}},span:Dr,strong:Dr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Dr,summary:Dr,sup:Dr,table:Dr,tbody:Dr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Dr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Dr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Dr,time:{attrs:{datetime:null}},title:Dr,tr:Dr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Dr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Dr},YGe={accesskey:null,class:null,contenteditable:bd,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:bd,autocorrect:bd,autocapitalize:bd,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":bd,"aria-autocomplete":["inline","list","both","none"],"aria-busy":bd,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":bd,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":bd,"aria-hidden":bd,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":bd,"aria-multiselectable":bd,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":bd,"aria-relevant":null,"aria-required":bd,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},XGe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of XGe)YGe[e]=null;let NA=class{constructor(t,r){this.tags={...uWt,...t},this.globalAttrs={...YGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};NA.default=new NA;function N_(e,t,r=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,r)):""}function A_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function KGe(e,t,r){let n=r.tags[N_(e,A_(t))];return n?.children||r.allTags}function Vue(e,t){let r=[];for(let n=A_(t);n&&!n.type.isTop;n=A_(n.parent)){let s=N_(e,n);if(s&&n.lastChild.name=="CloseTag")break;s&&r.indexOf(s)<0&&(t.name=="EndTag"||t.from>=n.firstChild.to)&&r.push(s)}return r}const JGe=/^[:\-\.\w\u00b7-\uffff]*$/;function Pke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=A_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:KGe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Vue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Mke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Vue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:JGe}}function dWt(e,t,r,n){let s=[],a=0;for(let i of KGe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Vue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function fWt(e,t,r,n,s){let a=A_(r),i=a?t.tags[N_(e.doc,a)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:n,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:JGe}}function hWt(e,t,r,n,s){var a;let i=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),l=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=A_(r),h=f?t.tags[N_(e.doc,f)]:null;d=h?.attrs&&h.attrs[u]}if(d){let f=e.sliceDoc(n,s).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),n++):c=/^[^\s<>='"]*$/;for(let m of d)l.push({label:m,apply:h+m+p,type:"constant"})}}return{from:n,to:s,options:l,validFor:c}}function eZe(e,t){let{state:r,pos:n}=t,s=Ra(r).resolveInner(n,-1),a=s.resolve(n);for(let i=n,l;a==s&&(l=s.childBefore(i));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=l,i=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Mke(r,s,s.from,n):Pke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?Pke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Mke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?fWt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?hWt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?dWt(r,e,s,n):null}function tZe(e){return eZe(NA.default,e)}function rZe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new NA(t,r):NA.default;return s=>eZe(n,s)}const pWt=ph.parser.configure({top:"SingleExpression"}),nZe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:zue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Bue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Uue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:pWt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:ph.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:TA.parser}],sZe=[{name:"style",parser:TA.parser.configure({top:"Styles"})}].concat(XGe.map(e=>({name:e,parser:ph.parser}))),aZe=i1.define({name:"html",parser:VHt.configure({props:[iS.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,r;for(let n=e.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;t=n=s}return t&&!((r=t.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),oS.add({Element(e){let t=e.firstChild,r=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:r.name=="CloseTag"?r.from:e.to}}}),DWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),xN=aZe.configure({wrap:AGe(nZe,sZe)});function iZe(e={}){let t="",r;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=AGe((e.nestedLanguages||[]).concat(nZe),(e.nestedAttributes||[]).concat(sZe)));let n=r?aZe.configure({wrap:r,dialect:t}):t?xN.configure({dialect:t}):xN;return new l1(n,[xN.data.of({autocomplete:rZe(e)}),e.autoCloseTags!==!1?oZe:[],Z3().support,FGe().support])}const Dke=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),oZe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!xN.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u,d,f;let h=i.doc.sliceString(c.from-1,c.to)==n,{head:p}=c,m=Ra(i).resolveInner(p,-1),g;if(h&&n==">"&&m.name=="EndTag"){let y=m.parent;if(((d=(u=y.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=N_(i.doc,y.parent,p))&&!Dke.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`</${g}>`;return{range:c,changes:{from:p,to:x,insert:w}}}}else if(h&&n=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==p-2&&((f=y.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=N_(i.doc,y,p))&&!Dke.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`${g}>`;return{range:nt.cursor(p+w.length,-1),changes:{from:p,to:x,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),mWt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:oZe,html:iZe,htmlCompletionSource:tZe,htmlCompletionSourceWith:rZe,htmlLanguage:xN},Symbol.toStringTag,{value:"Module"})),lZe=LF({commentTokens:{block:{open:"<!--",close:"-->"}}}),cZe=new pn,uZe=Hqt.configure({props:[oS.add(e=>!e.is("Block")||e.is("Document")||nse(e)!=null||gWt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),cZe.add(nse),iS.add({Document:()=>null}),Pb.add({Document:lZe})]});function nse(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function gWt(e){return e.name=="OrderedList"||e.name=="BulletList"}function yWt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=nse(n.type))!=null&&s<=t)break;r=n}return r.to}const vWt=kWe.of((e,t,r)=>{for(let n=Ra(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(cZe);if(s==null)continue;let a=yWt(n,s);if(a>r)return{from:r,to:a}}return null});function que(e){return new Bd(lZe,e,[],"markdown")}const dZe=que(uZe),bWt=uZe.configure([rHt,sHt,nHt,aHt,{props:[oS.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),d1=que(bWt);function xWt(e,t){return r=>{if(r&&e){let n=null;if(r=/\S*/.exec(r)[0],typeof e=="function"?n=e(r):n=Ye.matchLanguageName(e,r,!0),n instanceof Ye)return n.support?n.support.language.parser:o1.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class vV{constructor(t,r,n,s,a,i,l){this.node=t,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=l}blank(t,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;n.length<t;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(t,r){let n=this.node.name=="OrderedList"?String(+hZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function fZe(e,t){let r=[],n=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let a=r[s],i,l=t.lineAt(a.from),c=a.from-l.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new vV(a,c,c+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new vV(a.parent,c,c+d,i[1],u,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),n.push(new vV(a.parent,c,c+d,i[1],u,f,a))}}return n}function hZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=hZe(a,t),c=+l[2];if(s>=0){if(c!=s+1)return;r.push({from:a.from+l[1].length,to:a.from+l[0].length,insert:String(s+2+n)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function Hue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(UE)!=" ")return e;let n=Sp(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const pZe=(e={})=>({state:t,dispatch:r})=>{let n=Ra(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!d1.isActiveAt(t,l.from,-1)&&!d1.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=fZe(n.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let x=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(x.to>=c||w&&w.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let S=d.length>1?d[d.length-2]:null,k,_="";S&&S.item?(k=u.from+S.from,_=S.marker(s,1)):k=u.from+(S?S.to:0);let E=[{from:k,to:c,insert:_}];return f.node.name=="OrderedList"&&bV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&bV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=$ke(d,t,u);return{range:nt.cursor(c+S.length+1),changes:{from:u.from,insert:S+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let x=s.lineAt(u.from-1),w=/>\s*$/.exec(x.text);if(w&&w.index==f.from){let S=t.changes([{from:x.from+w.index,to:x.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(S),changes:S}}}let p=[];f.node.name=="OrderedList"&&bV(f.item,s,p);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let x=0,w=d.length-1;x<=w;x++)g+=x==w&&!m?d[x].marker(s,1):d[x].blank(x<w?Sp(u.text,4,d[x+1].from)-g.length:null);let y=c;for(;y>u.from&&/\s/.test(u.text.charAt(y-u.from-1));)y--;return g=Hue(g,t),wWt(f.node,t.doc)&&(g=$ke(d,t,u)+t.lineBreak+g),p.push({from:y,to:c,insert:t.lineBreak+g}),{range:nt.cursor(y+g.length+1),changes:p}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},mZe=pZe();function Lke(e){return e.name=="QuoteMark"||e.name=="ListMark"}function wWt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let r=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(r.to),a=t.lineAt(n.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function $ke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Sp(r.text,4,e[s+1].from)-n.length:null,s<a);return Hue(n,t)}function SWt(e,t){let r=e.resolveInner(t,-1),n=t;Lke(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Lke(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const gZe=({state:e,dispatch:t})=>{let r=Ra(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&d1.isActiveAt(e,a.from)){let c=l.lineAt(i),u=fZe(SWt(r,i),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:nt.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let p=d.blank(Sp(c.text,4,d.to)-Sp(c.text,4,d.from));return h==c.from&&(p=Hue(p,e)),{range:nt.cursor(h+p.length),changes:{from:h,to:c.from+d.to,insert:p}}}if(h<i)return{range:nt.cursor(h),changes:{from:h,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},yZe=[{key:"Enter",run:mZe},{key:"Backspace",run:gZe}],vZe=iZe({matchClosingTags:!1});function Que(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=dZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=vZe}=e;if(!(s instanceof BF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,vWt],d;i&&u.push(bZe),r instanceof l1?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?xWt(t,d):void 0;c.push(Wqt({codeParser:f,htmlParser:l.language.parser})),n&&u.push(Rp.high(BE.of(yZe)));let h=que(s.configure(c));return a&&u.push(h.data.of({autocomplete:OWt})),new l1(h,u)}function OWt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Ra(t).resolveInner(r,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:r-n[0].length,to:r,options:kWt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xV=null;function kWt(){if(xV)return xV;let e=tZe(new Sue(zn.create({extensions:vZe}),0,!0));return xV=e?e.options:[]}const _Wt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,bZe=ft.domEventHandlers({paste:(e,t)=>{var r;let{main:n}=t.state.selection;if(n.empty)return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!d1.isActiveAt(t.state,n.from,1)))return!1;let a=Ra(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||_Wt.test(l.name))&&(i=!0)},leave:l=>{l.to<n.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),EWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:dZe,deleteMarkupBackward:gZe,insertNewlineContinueMarkup:mZe,insertNewlineContinueMarkupCommand:pZe,markdown:Que,markdownKeymap:yZe,markdownLanguage:d1,pasteURLAsLink:bZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new l1(bue.define(e))}function Jv(e){return Ke(()=>import("./index--SlVHfqJ.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const xZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-DpADPRJ2.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ke(()=>import("./index-DpADPRJ2.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Jv("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>OQt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-DbfXFhuJ.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Ye.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ke(()=>Promise.resolve().then(()=>mWt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-CRm8MYVP.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-CI8kfc4F.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Ye.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ke(()=>Promise.resolve().then(()=>LVt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-BX2WRjBO.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-aVJP9avi.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return Jv("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>EWt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return Jv("MSSQL")}}),Ye.of({name:"MySQL",load(){return Jv("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-DmYrqjBS.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return Jv("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return Jv("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-Bqb6E-Ls.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-BOJsjpUj.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-DyfYKArn.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Ye.of({name:"SCSS",extensions:["scss"],load(){return Ke(()=>import("./index-DyfYKArn.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return Jv("StandardSQL")}}),Ye.of({name:"SQLite",load(){return Jv("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-BzLOh-7D.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Ye.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ke(()=>import("./index-Qfb-TMU9.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Ye.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ke(()=>import("./index-DjnpXhnk.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Ye.of({name:"APL",extensions:["dyalog","apl"],load(){return Ke(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>pt(e.apl))}}),Ye.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ke(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>pt(e.asciiArmor))}}),Ye.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ke(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>pt(e.asn1({})))}}),Ye.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ke(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>pt(e.asterisk))}}),Ye.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ke(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>pt(e.brainfuck))}}),Ye.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ke(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>pt(e.cobol))}}),Ye.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.csharp))}}),Ye.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"ClojureScript",extensions:["cljs"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ke(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>pt(e.gss))}}),Ye.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ke(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>pt(e.cmake))}}),Ye.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ke(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>pt(e.coffeeScript))}}),Ye.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ke(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>pt(e.commonLisp))}}),Ye.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ke(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>pt(e.cypher))}}),Ye.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ke(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>pt(e.cython))}}),Ye.of({name:"Crystal",extensions:["cr"],load(){return Ke(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>pt(e.crystal))}}),Ye.of({name:"D",extensions:["d"],load(){return Ke(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>pt(e.d))}}),Ye.of({name:"Dart",extensions:["dart"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.dart))}}),Ye.of({name:"diff",extensions:["diff","patch"],load(){return Ke(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>pt(e.diff))}}),Ye.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ke(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>pt(e.dockerFile))}}),Ye.of({name:"DTD",extensions:["dtd"],load(){return Ke(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>pt(e.dtd))}}),Ye.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ke(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>pt(e.dylan))}}),Ye.of({name:"EBNF",load(){return Ke(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>pt(e.ebnf))}}),Ye.of({name:"ECL",extensions:["ecl"],load(){return Ke(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>pt(e.ecl))}}),Ye.of({name:"edn",extensions:["edn"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Eiffel",extensions:["e"],load(){return Ke(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>pt(e.eiffel))}}),Ye.of({name:"Elm",extensions:["elm"],load(){return Ke(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>pt(e.elm))}}),Ye.of({name:"Erlang",extensions:["erl"],load(){return Ke(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>pt(e.erlang))}}),Ye.of({name:"Esper",load(){return Ke(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>pt(e.esper))}}),Ye.of({name:"Factor",extensions:["factor"],load(){return Ke(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>pt(e.factor))}}),Ye.of({name:"FCL",load(){return Ke(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>pt(e.fcl))}}),Ye.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ke(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>pt(e.forth))}}),Ye.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ke(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>pt(e.fortran))}}),Ye.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.fSharp))}}),Ye.of({name:"Gas",extensions:["s"],load(){return Ke(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>pt(e.gas))}}),Ye.of({name:"Gherkin",extensions:["feature"],load(){return Ke(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>pt(e.gherkin))}}),Ye.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ke(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>pt(e.groovy))}}),Ye.of({name:"Haskell",extensions:["hs"],load(){return Ke(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>pt(e.haskell))}}),Ye.of({name:"Haxe",extensions:["hx"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.haxe))}}),Ye.of({name:"HXML",extensions:["hxml"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.hxml))}}),Ye.of({name:"HTTP",load(){return Ke(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>pt(e.http))}}),Ye.of({name:"IDL",extensions:["pro"],load(){return Ke(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>pt(e.idl))}}),Ye.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ke(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>pt(e.jsonld))}}),Ye.of({name:"Julia",extensions:["jl"],load(){return Ke(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>pt(e.julia))}}),Ye.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.kotlin))}}),Ye.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ke(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>pt(e.liveScript))}}),Ye.of({name:"Lua",extensions:["lua"],load(){return Ke(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>pt(e.lua))}}),Ye.of({name:"mIRC",extensions:["mrc"],load(){return Ke(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>pt(e.mirc))}}),Ye.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ke(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>pt(e.mathematica))}}),Ye.of({name:"Modelica",extensions:["mo"],load(){return Ke(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>pt(e.modelica))}}),Ye.of({name:"MUMPS",extensions:["mps"],load(){return Ke(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>pt(e.mumps))}}),Ye.of({name:"Mbox",extensions:["mbox"],load(){return Ke(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>pt(e.mbox))}}),Ye.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ke(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>pt(e.nginx))}}),Ye.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ke(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>pt(e.nsis))}}),Ye.of({name:"NTriples",extensions:["nt","nq"],load(){return Ke(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>pt(e.ntriples))}}),Ye.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveC))}}),Ye.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveCpp))}}),Ye.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.oCaml))}}),Ye.of({name:"Octave",extensions:["m"],load(){return Ke(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>pt(e.octave))}}),Ye.of({name:"Oz",extensions:["oz"],load(){return Ke(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>pt(e.oz))}}),Ye.of({name:"Pascal",extensions:["p","pas"],load(){return Ke(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>pt(e.pascal))}}),Ye.of({name:"Perl",extensions:["pl","pm"],load(){return Ke(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>pt(e.perl))}}),Ye.of({name:"Pig",extensions:["pig"],load(){return Ke(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>pt(e.pig))}}),Ye.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ke(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>pt(e.powerShell))}}),Ye.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ke(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>pt(e.properties))}}),Ye.of({name:"ProtoBuf",extensions:["proto"],load(){return Ke(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>pt(e.protobuf))}}),Ye.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ke(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>pt(e.pug))}}),Ye.of({name:"Puppet",extensions:["pp"],load(){return Ke(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>pt(e.puppet))}}),Ye.of({name:"Q",extensions:["q"],load(){return Ke(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>pt(e.q))}}),Ye.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ke(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>pt(e.r))}}),Ye.of({name:"RPM Changes",load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmChanges))}}),Ye.of({name:"RPM Spec",extensions:["spec"],load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmSpec))}}),Ye.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ke(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>pt(e.ruby))}}),Ye.of({name:"SAS",extensions:["sas"],load(){return Ke(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>pt(e.sas))}}),Ye.of({name:"Scala",extensions:["scala"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.scala))}}),Ye.of({name:"Scheme",extensions:["scm","ss"],load(){return Ke(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>pt(e.scheme))}}),Ye.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ke(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>pt(e.shell))}}),Ye.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ke(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>pt(e.sieve))}}),Ye.of({name:"Smalltalk",extensions:["st"],load(){return Ke(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>pt(e.smalltalk))}}),Ye.of({name:"Solr",load(){return Ke(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>pt(e.solr))}}),Ye.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.sml))}}),Ye.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ke(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>pt(e.sparql))}}),Ye.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ke(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>pt(e.spreadsheet))}}),Ye.of({name:"Squirrel",extensions:["nut"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.squirrel))}}),Ye.of({name:"Stylus",extensions:["styl"],load(){return Ke(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>pt(e.stylus))}}),Ye.of({name:"Swift",extensions:["swift"],load(){return Ke(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>pt(e.swift))}}),Ye.of({name:"sTeX",load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"Tcl",extensions:["tcl"],load(){return Ke(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>pt(e.tcl))}}),Ye.of({name:"Textile",extensions:["textile"],load(){return Ke(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>pt(e.textile))}}),Ye.of({name:"TiddlyWiki",load(){return Ke(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>pt(e.tiddlyWiki))}}),Ye.of({name:"Tiki wiki",load(){return Ke(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>pt(e.tiki))}}),Ye.of({name:"TOML",extensions:["toml"],load(){return Ke(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>pt(e.toml))}}),Ye.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ke(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>pt(e.troff))}}),Ye.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ke(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>pt(e.ttcn))}}),Ye.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ke(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>pt(e.ttcnCfg))}}),Ye.of({name:"Turtle",extensions:["ttl"],load(){return Ke(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>pt(e.turtle))}}),Ye.of({name:"Web IDL",extensions:["webidl"],load(){return Ke(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>pt(e.webIDL))}}),Ye.of({name:"VB.NET",extensions:["vb"],load(){return Ke(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>pt(e.vb))}}),Ye.of({name:"VBScript",extensions:["vbs"],load(){return Ke(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>pt(e.vbScript))}}),Ye.of({name:"Velocity",extensions:["vtl"],load(){return Ke(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>pt(e.velocity))}}),Ye.of({name:"Verilog",extensions:["v"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ke(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>pt(e.vhdl))}}),Ye.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ke(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>pt(e.xQuery))}}),Ye.of({name:"Yacas",extensions:["ys"],load(){return Ke(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>pt(e.yacas))}}),Ye.of({name:"Z80",extensions:["z80"],load(){return Ke(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>pt(e.z80))}}),Ye.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.mscgen))}}),Ye.of({name:"Xù",extensions:["xu"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.xu))}}),Ye.of({name:"MsGenny",extensions:["msgenny"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.msgenny))}}),Ye.of({name:"Vue",extensions:["vue"],load(){return Ke(()=>import("./index-BoCBXeII.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-DN4iI_FZ.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vx.apply(null,arguments)}var CWt=e=>{var{theme:t,settings:r={},styles:n=[]}=e,s={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=a),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var i={};r.gutterActiveForeground&&(i.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},i.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=i,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var l=ft.theme(s,{dark:t==="dark"}),c=Pp.define(n),u=[l,Wx(c)];return u},jWt={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},TWt=[{tag:ne.comment,color:"#6272a4"},{tag:ne.string,color:"#f1fa8c"},{tag:ne.atom,color:"#bd93f9"},{tag:ne.meta,color:"#f8f8f2"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"#ff79c6"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"#66d9ef"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"#50fa7b"},{tag:ne.atom,color:"#bd93f9"}],qE=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return CWt({theme:t,settings:vx({},jWt,r),styles:[...TWt,...n]})};qE();function Wue(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const NWt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Zue(e.state,r.from);return n.line?AWt(e):n.block?RWt(e):!1};function Gue(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let s=e(t,r);return s?(n(r.update(s)),!0):!1}}const AWt=Gue(DWt,0),IWt=Gue(wZe,0),RWt=Gue((e,t)=>wZe(e,t,MWt(t)),0);function Zue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Dj=50;function PWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Dj,n),i=e.sliceDoc(s,s+Dj),l=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(i)[0].length,u=a.length-l;if(a.slice(u-t.length,u)==t&&i.slice(c,c+r.length)==r)return{open:{pos:n-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-n<=2*Dj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Dj),f=e.sliceDoc(s-Dj,s));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-r.length;return d.slice(h,h+t.length)==t&&f.slice(m,m+r.length)==r?{open:{pos:n+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:s-p-r.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function MWt(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),s=r.to<=n.to?n:e.doc.lineAt(r.to);s.from>n.from&&s.from==r.to&&(s=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let a=t.length-1;a>=0&&t[a].to>n.from?t[a].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}function wZe(e,t,r=t.selection.ranges){let n=r.map(a=>Zue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>PWt(t,n[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(r.map((a,i)=>s[i]?[]:[{from:a.from,insert:n[i].open+" "},{from:a.to,insert:" "+n[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,l;i<s.length;i++)if(l=s[i]){let c=n[i],{open:u,close:d}=l;a.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:a}}return null}function DWt(e,t,r=t.selection.ranges){let n=[],s=-1;e:for(let{from:a,to:i}of r){let l=n.length,c=1e9,u;for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(u==null&&(u=Zue(t,f.from).line,!u))continue e;if(f.from>s&&(a==i||i>f.from)){s=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<c&&(c=h),n.push({line:f,comment:m,token:u,indent:h,empty:p,single:!1})}d=f.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(e!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of n)(f||!d)&&a.push({from:l.from+u,insert:c+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:l,token:c}of n)if(l>=0){let u=i.from+l,d=u+c.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const sse=pg.define(),LWt=pg.define(),$Wt=Kt.define(),SZe=Kt.define({combine(e){return mg(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,s)=>t(n,s)||r(n,s)})}}),OZe=Oo.define({create(){return Nm.empty},update(e,t){let r=t.state.facet(SZe),n=t.annotation(sse);if(n){let c=Lu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=Y3(d,d.length,r.minDepth,c):d=EZe(d,t.startState.selection),new Nm(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(LWt);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(Mo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Lu.fromTransaction(t),i=t.annotation(Mo.time),l=t.annotation(Mo.userEvent);return a?e=e.addChanges(a,i,l,r,t):t.selection&&(e=e.addSelection(t.startState.selection,i,l,r.newGroupDelay)),(s=="full"||s=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Nm(e.done.map(Lu.fromJSON),e.undone.map(Lu.fromJSON))}});function FWt(e={}){return[OZe,SZe.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?kZe:t.inputType=="historyRedo"?ase:null;return n?(t.preventDefault(),n(r)):!1}})]}function UF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(OZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const kZe=UF(0,!1),ase=UF(1,!1),zWt=UF(0,!0),BWt=UF(1,!0);class Lu{constructor(t,r,n,s,a){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new Lu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new Lu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Vm.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,r){let n=oh;for(let s of t.startState.facet($Wt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new Lu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,oh)}static selection(t){return new Lu(void 0,oh,void 0,void 0,t)}}function Y3(e,t,r,n){let s=t+1>r+20?t-r-1:0,a=e.slice(s,t);return a.push(n),a}function UWt(e,t){let r=[],n=!1;return e.iterChangedRanges((s,a)=>r.push(s,a)),t.iterChangedRanges((s,a,i,l)=>{for(let c=0;c<r.length;){let u=r[c++],d=r[c++];l>=u&&i<=d&&(n=!0)}}),n}function VWt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function _Ze(e,t){return e.length?t.length?e.concat(t):e:t}const oh=[],qWt=200;function EZe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-qWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),Y3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[Lu.selection([t])]}function HWt(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function wV(e,t){if(!e.length)return e;let r=e.length,n=oh;for(;r;){let s=QWt(e[r-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,r);return a[r-1]=s,a}else t=s.mapped,r--,n=s.selectionsAfter}return n.length?[Lu.selection(n)]:oh}function QWt(e,t,r){let n=_Ze(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):oh,r);if(!e.changes)return Lu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Lu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const WWt=/^(input\.type|delete)($|\.)/;class Nm{constructor(t,r,n=0,s=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new Nm(this.done,this.undone):this}addChanges(t,r,n,s,a){let i=this.done,l=i[i.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!n||WWt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,UWt(l.changes,t.changes))||n=="input.type.compose")?i=Y3(i,i.length-1,s.minDepth,new Lu(t.changes.compose(l.changes),_Ze(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,oh)):i=Y3(i,i.length,s.minDepth,t),new Nm(i,oh,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:oh;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&VWt(a[a.length-1],t)?this:new Nm(EZe(this.done,t),this.undone,r,n)}addMapping(t){return new Nm(wV(this.done,t),wV(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):r.selection);if(n&&a.selectionsAfter.length)return r.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:sse.of({side:t,rest:HWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?oh:s.slice(0,s.length-1);return a.mapped&&(l=wV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:sse.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Nm.empty=new Nm(oh,oh);const GWt=[{key:"Mod-z",run:kZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ase,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ase,preventDefault:!0},{key:"Mod-u",run:zWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:BWt,preventDefault:!0}];function HE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function Mp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Dp({state:e,dispatch:t},r){let n=HE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Mp(e,n)),!0)}function VF(e,t){return nt.cursor(t?e.to:e.from)}function CZe(e,t){return Dp(e,r=>r.empty?e.moveByChar(r,t):VF(r,t))}function kc(e){return e.textDirectionAt(e.state.selection.main.head)==$a.LTR}const jZe=e=>CZe(e,!kc(e)),TZe=e=>CZe(e,kc(e));function NZe(e,t){return Dp(e,r=>r.empty?e.moveByGroup(r,t):VF(r,t))}const ZWt=e=>NZe(e,!kc(e)),YWt=e=>NZe(e,kc(e));function XWt(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function qF(e,t,r){let n=Ra(e).resolveInner(t.head),s=r?pn.closedBy:pn.openedBy;for(let c=t.head;;){let u=r?n.childAfter(c):n.childBefore(c);if(!u)break;XWt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Tm(e,n.from,1):Tm(e,n.to,-1))&&i.matched?l=r?i.end.to:i.end.from:l=r?n.to:n.from,nt.cursor(l,r?-1:1)}const KWt=e=>Dp(e,t=>qF(e.state,t,!kc(e))),JWt=e=>Dp(e,t=>qF(e.state,t,kc(e)));function AZe(e,t){return Dp(e,r=>{if(!r.empty)return VF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const IZe=e=>AZe(e,!1),RZe=e=>AZe(e,!0);function PZe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(ft.scrollMargins)){let i=a(e);i?.top&&(r=Math.max(i?.top,r)),i?.bottom&&(n=Math.max(i?.bottom,n))}s=e.scrollDOM.clientHeight-r-n}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function MZe(e,t){let r=PZe(e),{state:n}=e,s=HE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):VF(i,t));if(s.eq(n.selection))return!1;let a;if(r.selfScroll){let i=e.coordsAtPos(n.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+r.marginTop,u=l.bottom-r.marginBottom;i&&i.top>c&&i.bottom<u&&(a=ft.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Mp(n,s),{effects:a}),!0}const Fke=e=>MZe(e,!1),ise=e=>MZe(e,!0);function Gx(e,t,r){let n=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,r);if(s.head==t.head&&s.head!=(r?n.to:n.from)&&(s=e.moveToLineBoundary(t,r,!1)),!r&&s.head==n.from&&n.length){let a=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&t.head!=n.from+a&&(s=nt.cursor(n.from+a))}return s}const eGt=e=>Dp(e,t=>Gx(e,t,!0)),tGt=e=>Dp(e,t=>Gx(e,t,!1)),rGt=e=>Dp(e,t=>Gx(e,t,!kc(e))),nGt=e=>Dp(e,t=>Gx(e,t,kc(e))),sGt=e=>Dp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),aGt=e=>Dp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function iGt(e,t,r){let n=!1,s=HE(e.selection,a=>{let i=Tm(e,a.head,-1)||Tm(e,a.head,1)||a.head>0&&Tm(e,a.head-1,1)||a.head<e.doc.length&&Tm(e,a.head+1,-1);if(!i||!i.end)return a;n=!0;let l=i.start.from==a.head?i.end.to:i.end.from;return nt.cursor(l)});return n?(t(Mp(e,s)),!0):!1}const oGt=({state:e,dispatch:t})=>iGt(e,t);function Ph(e,t){let r=HE(e.state.selection,n=>{let s=t(n);return nt.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(Mp(e.state,r)),!0)}function DZe(e,t){return Ph(e,r=>e.moveByChar(r,t))}const LZe=e=>DZe(e,!kc(e)),$Ze=e=>DZe(e,kc(e));function FZe(e,t){return Ph(e,r=>e.moveByGroup(r,t))}const lGt=e=>FZe(e,!kc(e)),cGt=e=>FZe(e,kc(e)),uGt=e=>Ph(e,t=>qF(e.state,t,!kc(e))),dGt=e=>Ph(e,t=>qF(e.state,t,kc(e)));function zZe(e,t){return Ph(e,r=>e.moveVertically(r,t))}const BZe=e=>zZe(e,!1),UZe=e=>zZe(e,!0);function VZe(e,t){return Ph(e,r=>e.moveVertically(r,t,PZe(e).height))}const zke=e=>VZe(e,!1),Bke=e=>VZe(e,!0),fGt=e=>Ph(e,t=>Gx(e,t,!0)),hGt=e=>Ph(e,t=>Gx(e,t,!1)),pGt=e=>Ph(e,t=>Gx(e,t,!kc(e))),mGt=e=>Ph(e,t=>Gx(e,t,kc(e))),gGt=e=>Ph(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),yGt=e=>Ph(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),Uke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:0})),!0),Vke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.doc.length})),!0),qke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.selection.main.anchor,head:0})),!0),Hke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),vGt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),bGt=({state:e,dispatch:t})=>{let r=HF(e).map(({from:n,to:s})=>nt.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:nt.create(r),userEvent:"select"})),!0},xGt=({state:e,dispatch:t})=>{let r=HE(e.selection,n=>{let s=Ra(e),a=s.resolveStack(n.from,1);if(n.empty){let i=s.resolveStack(n.from,-1);i.node.from>=a.node.from&&i.node.to<=a.node.to&&(a=i)}for(let i=a;i;i=i.next){let{node:l}=i;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&i.next)return nt.range(l.to,l.from)}return n});return r.eq(e.selection)?!1:(t(Mp(e,r)),!0)};function qZe(e,t){let{state:r}=e,n=r.selection,s=r.selection.ranges.slice();for(let a of r.selection.ranges){let i=r.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let l=a;;){let c=e.moveVertically(l,t);if(c.head<i.from||c.head>i.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==n.ranges.length?!1:(e.dispatch(Mp(r,nt.create(s,s.length-1))),!0)}const wGt=e=>qZe(e,!1),SGt=e=>qZe(e,!0),OGt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=nt.create([r.main]):r.main.empty||(n=nt.create([nt.cursor(r.main.head)])),n?(t(Mp(e,n)),!0):!1};function HR(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(r="delete.backward",c=nD(e,c,!1)):c>i&&(r="delete.forward",c=nD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=nD(e,i,!1),l=nD(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:nt.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ft.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function nD(e,t,r){if(e instanceof ft)for(let n of e.state.facet(ft.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const HZe=(e,t,r)=>HR(e,n=>{let s=n.from,{state:a}=e,i=a.doc.lineAt(s),l,c;if(r&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(l=i.text.slice(0,s-i.from))){if(l[l.length-1]==" ")return s-1;let u=Sp(l,a.tabSize),d=u%c1(a)||c1(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=yl(i.text,s-i.from,t,t)+i.from,c==s&&i.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,s-i.from))&&(c=yl(i.text,c-i.from,!1,!1)+i.from);return c}),ose=e=>HZe(e,!1,!0),QZe=e=>HZe(e,!0,!1),WZe=(e,t)=>HR(e,r=>{let n=r.head,{state:s}=e,a=s.doc.lineAt(n),i=s.charCategorizer(n);for(let l=null;;){if(n==(t?a.to:a.from)){n==r.head&&a.number!=(t?s.doc.lines:1)&&(n+=t?1:-1);break}let c=yl(a.text,n-a.from,t)+a.from,u=a.text.slice(Math.min(n,c)-a.from,Math.max(n,c)-a.from),d=i(u);if(l!=null&&d!=l)break;(u!=" "||n!=r.head)&&(l=d),n=c}return n}),GZe=e=>WZe(e,!1),kGt=e=>WZe(e,!0),_Gt=e=>HR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),EGt=e=>HR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),CGt=e=>HR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),jGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Fs.of(["",""])},range:nt.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},TGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let s=n.from,a=e.doc.lineAt(s),i=s==a.from?s-1:yl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:yl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:l,insert:e.doc.slice(s,l).append(e.doc.slice(i,s))},range:nt.cursor(l)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function HF(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function ZZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of HF(e)){if(r?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(r?a.to+1:a.from-1),l=i.length+1;if(r){n.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(nt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{n.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(nt.range(c.anchor-l,c.head-l))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:nt.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const NGt=({state:e,dispatch:t})=>ZZe(e,t,!1),AGt=({state:e,dispatch:t})=>ZZe(e,t,!0);function YZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of HF(e))r?n.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):n.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const IGt=({state:e,dispatch:t})=>YZe(e,t,!1),RGt=({state:e,dispatch:t})=>YZe(e,t,!0),PGt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(HF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=HE(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),l=e.coordsAtPos(s.head,s.assoc||1);l&&(a=i.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function MGt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Ra(e).resolveInner(t),n=r.childBefore(t),s=r.childAfter(t),a;return n&&s&&n.to<=t&&s.from>=t&&(a=n.type.prop(pn.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const Qke=XZe(!1),DGt=XZe(!0);function XZe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(s=>{let{from:a,to:i}=s,l=t.doc.lineAt(a),c=!e&&a==i&&MGt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new $F(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=gue(u,a);for(d==null&&(d=Sp(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<l.to&&/\s/.test(l.text[i-l.from]);)i++;c?{from:a,to:i}=c:a>l.from&&a<l.from+100&&!/\S/.test(l.text.slice(0,a))&&(a=l.from);let f=["",wA(t,d)];return c&&f.push(wA(t,u.lineIndent(l.from,-1))),{changes:{from:a,to:i,insert:Fs.of(f)},range:nt.cursor(a+1+f[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Yue(e,t){let r=-1;return e.changeByRange(n=>{let s=[];for(let i=n.from;i<=n.to;){let l=e.doc.lineAt(i);l.number>r&&(n.empty||n.to>l.from)&&(t(l,s,n),r=l.number),i=l.to+1}let a=e.changes(s);return{changes:s,range:nt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const LGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new $F(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=Yue(e,(a,i,l)=>{let c=gue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=wA(e,c);(u!=d||l.from<a.from+u.length)&&(r[a.from]=c,i.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},KZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(UE)})}),{userEvent:"input.indent"})),!0),JZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Sp(s,e.tabSize),i=0,l=wA(e,Math.max(0,a-c1(e)));for(;i<s.length&&i<l.length&&s.charCodeAt(i)==l.charCodeAt(i);)i++;n.push({from:r.from+i,to:r.from+s.length,insert:l.slice(i)})}),{userEvent:"delete.dedent"})),!0),$Gt=e=>(e.setTabFocusMode(),!0),FGt=[{key:"Ctrl-b",run:jZe,shift:LZe,preventDefault:!0},{key:"Ctrl-f",run:TZe,shift:$Ze},{key:"Ctrl-p",run:IZe,shift:BZe},{key:"Ctrl-n",run:RZe,shift:UZe},{key:"Ctrl-a",run:sGt,shift:gGt},{key:"Ctrl-e",run:aGt,shift:yGt},{key:"Ctrl-d",run:QZe},{key:"Ctrl-h",run:ose},{key:"Ctrl-k",run:_Gt},{key:"Ctrl-Alt-h",run:GZe},{key:"Ctrl-o",run:jGt},{key:"Ctrl-t",run:TGt},{key:"Ctrl-v",run:ise}],zGt=[{key:"ArrowLeft",run:jZe,shift:LZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ZWt,shift:lGt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:rGt,shift:pGt,preventDefault:!0},{key:"ArrowRight",run:TZe,shift:$Ze,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:YWt,shift:cGt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:nGt,shift:mGt,preventDefault:!0},{key:"ArrowUp",run:IZe,shift:BZe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Uke,shift:qke},{mac:"Ctrl-ArrowUp",run:Fke,shift:zke},{key:"ArrowDown",run:RZe,shift:UZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Vke,shift:Hke},{mac:"Ctrl-ArrowDown",run:ise,shift:Bke},{key:"PageUp",run:Fke,shift:zke},{key:"PageDown",run:ise,shift:Bke},{key:"Home",run:tGt,shift:hGt,preventDefault:!0},{key:"Mod-Home",run:Uke,shift:qke},{key:"End",run:eGt,shift:fGt,preventDefault:!0},{key:"Mod-End",run:Vke,shift:Hke},{key:"Enter",run:Qke,shift:Qke},{key:"Mod-a",run:vGt},{key:"Backspace",run:ose,shift:ose,preventDefault:!0},{key:"Delete",run:QZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:GZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:kGt,preventDefault:!0},{mac:"Mod-Backspace",run:EGt,preventDefault:!0},{mac:"Mod-Delete",run:CGt,preventDefault:!0}].concat(FGt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),BGt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:KWt,shift:uGt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:JWt,shift:dGt},{key:"Alt-ArrowUp",run:NGt},{key:"Shift-Alt-ArrowUp",run:IGt},{key:"Alt-ArrowDown",run:AGt},{key:"Shift-Alt-ArrowDown",run:RGt},{key:"Mod-Alt-ArrowUp",run:wGt},{key:"Mod-Alt-ArrowDown",run:SGt},{key:"Escape",run:OGt},{key:"Mod-Enter",run:DGt},{key:"Alt-l",mac:"Ctrl-l",run:bGt},{key:"Mod-i",run:xGt,preventDefault:!0},{key:"Mod-[",run:JZe},{key:"Mod-]",run:KZe},{key:"Mod-Alt-\\",run:LGt},{key:"Shift-Mod-k",run:PGt},{key:"Shift-Mod-\\",run:oGt},{key:"Mod-/",run:NWt},{key:"Alt-A",run:IWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:$Gt}].concat(zGt),UGt={key:"Tab",run:KZe,shift:JZe},Wke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class qy{constructor(t,r,n=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,s),this.bufferStart=n,this.normalize=a?l=>a(Wke(l)):Wke,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Nu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=Xce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=vm(t);let s=this.normalize(r);if(s.length)for(let a=0,i=n;;a++){let l=s.charCodeAt(a),c=this.match(l,i,this.bufferPos+this.bufferStart);if(a==s.length-1){if(c)return this.value=c,this;break}i==n&&a<r.length&&r.charCodeAt(a)==l&&i++}}}match(t,r,n){let s=null;for(let a=0;a<this.matches.length;a+=2){let i=this.matches[a],l=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?s={from:this.matches[a+1],to:n}:(this.matches[a]++,l=!0)),l||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:r,to:n}:this.matches.push(1,r)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(qy.prototype[Symbol.iterator]=function(){return this});const eYe={from:-1,to:-1,match:/.*/.exec("")},Xue="gm"+(/x/.unicode==null?"":"u");class tYe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=eYe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new rYe(t,r,n,s,a);this.re=new RegExp(r,Xue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=X3(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=X3(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const SV=new WeakMap;class Uk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=SV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Uk(r,t.sliceString(r,n));return SV.set(t,l),l}if(s.from==r&&s.to==n)return s;let{text:a,from:i}=s;return i>r&&(a=t.sliceString(r,i)+a,i=r),s.to<n&&(a+=t.sliceString(s.to,n)),SV.set(t,new Uk(i,a)),new Uk(r,a.slice(r-i,n-i))}}class rYe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=eYe,this.matchPos=X3(t,s),this.re=new RegExp(r,Xue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Uk.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=X3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Uk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(tYe.prototype[Symbol.iterator]=rYe.prototype[Symbol.iterator]=function(){return this});function VGt(e){try{return new RegExp(e,Xue),!0}catch{return!1}}function X3(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}const qGt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=NUt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:t.phrase("go")});return s.then(a=>{let i=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!i){e.dispatch({effects:n});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,h=d?+d.slice(1):0,p=u?+u:l.number;if(u&&f){let y=p/100;c&&(y=y*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*y)}else u&&c&&(p=p*(c=="-"?-1:1)+l.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,p))),g=nt.cursor(m.from+Math.max(0,Math.min(h,m.length)));e.dispatch({effects:[n,ft.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},HGt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},QGt=Kt.define({combine(e){return mg(e,HGt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function WGt(e){return[KGt,XGt]}const GGt=er.mark({class:"cm-selectionMatch"}),ZGt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Gke(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=xi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=xi.Word)}function YGt(e,t,r,n){return e(t.sliceDoc(r,r+1))==xi.Word&&e(t.sliceDoc(n-1,n))==xi.Word}const XGt=Oi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(QGt),{state:r}=e,n=r.selection;if(n.ranges.length>1)return er.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return er.none;let c=r.wordAt(s.head);if(!c)return er.none;i=r.charCategorizer(s.head),a=r.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return er.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(Gke(i,r,s.from,s.to)&&YGt(i,r,s.from,s.to)))return er.none}else if(a=r.sliceDoc(s.from,s.to),!a)return er.none}let l=[];for(let c of e.visibleRanges){let u=new qy(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Gke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(ZGt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(GGt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),KGt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),JGt=({state:e,dispatch:t})=>{let{selection:r}=e,n=nt.create(r.ranges.map(s=>e.wordAt(s.head)||nt.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function eZt(e,t){let{main:r,ranges:n}=e.selection,s=e.wordAt(r.head),a=s&&s.from==r.from&&s.to==r.to;for(let i=!1,l=new qy(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new qy(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}else{if(i&&n.some(c=>c.from==l.value.from))continue;if(a){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const tZt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return JGt({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=n))return!1;let s=eZt(e,n);return s?(t(e.update({selection:e.selection.addRange(nt.range(s.from,s.to),!1),effects:ft.scrollIntoView(s.to)})),!0):!1},QE=Kt.define({combine(e){return mg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new mZt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class nYe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||VGt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
115
+ }`,{label:"class",detail:"definition",type:"keyword"}),ku('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ku('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],BGe=$ue.concat([ku("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ku("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ku("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Ake=new BHe,UGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Pj(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const tWt=["FunctionDeclaration"],rWt={FunctionDeclaration:Pj("function"),ClassDeclaration:Pj("class"),ClassExpression:()=>!0,EnumDeclaration:Pj("constant"),TypeAliasDeclaration:Pj("type"),NamespaceDeclaration:Pj("namespace"),VariableDefinition(e,t){e.matchContext(tWt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function VGe(e,t){let r=Ake.get(t);if(r)return r;let n=[],s=!0;function a(i,l){let c=e.sliceString(i.from,i.to);n.push({label:c,type:l})}return t.cursor(ea.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=rWt[i.name];if(l&&l(i,a)||UGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of VGe(e,i.node))n.push(l);return!1}}),Ake.set(t,n),n}const G3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Fue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function qGe(e){let t=Ra(e.state).resolveInner(e.pos,-1);if(Fue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&G3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)UGe.has(s.name)&&(n=n.concat(VGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:G3}}function pV(e,t,r){var n;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:r};if(a?.name=="MemberExpression"&&((n=i=a.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function HGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ra(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?pV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?pV(t,r.parent,""):Fue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&G3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?pV(t,r,""):e.explicit?{path:[],name:""}:null}function nWt(e,t){let r=e,n=[],s=new Set;for(let a=0;;a++){for(let l of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||s.has(l))continue;s.add(l);let c;try{c=r[l]}catch{continue}n.push({label:l,type:typeof c=="function"?/^[A-Z]/.test(l)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return n;e=i}}function sWt(e){let t=new Map;return r=>{let n=HGe(r);if(!n)return null;let s=e;for(let i of n.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=nWt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:G3}}}const ph=i1.define({name:"javascript",parser:eWt.configure({props:[iS.add({IfStatement:zk({except:/^\s*({|else\b)/}),TryStatement:zk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:eVt,SwitchBody:e=>{let t=e.textAfter,r=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(r?0:n?1:2)*e.unit},Block:JUt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":zk({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),oS.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":vue,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let r=e.lastChild;return{from:t.to,to:r.type.isError?e.to:r.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let r=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,n=e.lastChild;return!r||r.type.isError?null:{from:r.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),QGe={test:e=>/^JSX/.test(e.name),facet:LF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},zue=ph.configure({dialect:"ts"},"typescript"),Bue=ph.configure({dialect:"jsx",props:[mue.add(e=>e.isTop?[QGe]:void 0)]}),Uue=ph.configure({dialect:"jsx ts",props:[mue.add(e=>e.isTop?[QGe]:void 0)]},"typescript");let WGe=e=>({label:e,type:"keyword"});const GGe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(WGe),aWt=GGe.concat(["declare","implements","private","protected","public"].map(WGe));function Z3(e={}){let t=e.jsx?e.typescript?Uue:Bue:e.typescript?zue:ph,r=e.typescript?BGe.concat(aWt):$ue.concat(GGe);return new l1(t,[ph.data.of({autocomplete:FVt(Fue,VWe(r))}),ph.data.of({autocomplete:qGe}),e.jsx?ZGe:[]])}function iWt(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Ike(e,t,r=e.length){for(let n=t?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return e.sliceString(n.from,Math.min(n.to,r));return""}const oWt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),ZGe=ft.inputHandler.of((e,t,r,n,s)=>{if((oWt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!ph.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=Ra(i).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=n||f.name=="JSXAttributeValue"&&f.to>d)){if(n==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=Ike(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:nt.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(n==">"){let p=iWt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=Ike(i.doc,p,d)))return{range:c,changes:{from:d,insert:`</${h}>`}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function lWt(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((r,n)=>{var s;!((s=r.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[n]=2)})),r=>{let{state:n}=r,s=[];for(let{from:a,to:i}of ph.findRegions(n)){let l=n.doc.lineAt(a),c={line:l.number-1,col:a-l.from,pos:a};for(let u of e.verify(n.sliceDoc(a,i),t))s.push(cWt(u,n.doc,c))}return s}}function Rke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function cWt(e,t,r){let n=Rke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?Rke(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,l=a[0]+r.pos-n,c=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const rD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:ZGe,completionPath:HGe,esLint:lWt,javascript:Z3,javascriptLanguage:ph,jsxLanguage:Bue,localCompletionSource:qGe,scopeCompletionSource:sWt,snippets:$ue,tsxLanguage:Uue,typescriptLanguage:zue,typescriptSnippets:BGe},Symbol.toStringTag,{value:"Module"})),Mj=["_blank","_self","_top","_parent"],mV=["ascii","utf-8","utf-16","latin1","latin1"],gV=["get","post","put","delete"],yV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],bd=["true","false"],Dr={},uWt={a:{attrs:{href:null,ping:null,type:null,media:null,target:Mj,hreflang:null}},abbr:Dr,address:Dr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Dr,aside:Dr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Dr,base:{attrs:{href:null,target:Mj}},bdi:Dr,bdo:Dr,blockquote:{attrs:{cite:null}},body:Dr,br:Dr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:Mj,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Dr,center:Dr,cite:Dr,code:Dr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Dr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Dr,div:Dr,dl:Dr,dt:Dr,em:Dr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Dr,figure:Dr,footer:Dr,form:{attrs:{action:null,name:null,"accept-charset":mV,autocomplete:["on","off"],enctype:yV,method:gV,novalidate:["novalidate"],target:Mj}},h1:Dr,h2:Dr,h3:Dr,h4:Dr,h5:Dr,h6:Dr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Dr,hgroup:Dr,hr:Dr,html:{attrs:{manifest:null}},i:Dr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:yV,formmethod:gV,formnovalidate:["novalidate"],formtarget:Mj,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Dr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Dr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Dr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mV,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Dr,noscript:Dr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Dr,param:{attrs:{name:null,value:null}},pre:Dr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Dr,rt:Dr,ruby:Dr,samp:Dr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mV}},section:Dr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Dr,source:{attrs:{src:null,type:null,media:null}},span:Dr,strong:Dr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Dr,summary:Dr,sup:Dr,table:Dr,tbody:Dr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Dr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Dr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Dr,time:{attrs:{datetime:null}},title:Dr,tr:Dr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Dr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Dr},YGe={accesskey:null,class:null,contenteditable:bd,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:bd,autocorrect:bd,autocapitalize:bd,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":bd,"aria-autocomplete":["inline","list","both","none"],"aria-busy":bd,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":bd,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":bd,"aria-hidden":bd,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":bd,"aria-multiselectable":bd,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":bd,"aria-relevant":null,"aria-required":bd,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},XGe="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of XGe)YGe[e]=null;let NA=class{constructor(t,r){this.tags={...uWt,...t},this.globalAttrs={...YGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};NA.default=new NA;function N_(e,t,r=e.length){if(!t)return"";let n=t.firstChild,s=n&&n.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,r)):""}function A_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function KGe(e,t,r){let n=r.tags[N_(e,A_(t))];return n?.children||r.allTags}function Vue(e,t){let r=[];for(let n=A_(t);n&&!n.type.isTop;n=A_(n.parent)){let s=N_(e,n);if(s&&n.lastChild.name=="CloseTag")break;s&&r.indexOf(s)<0&&(t.name=="EndTag"||t.from>=n.firstChild.to)&&r.push(s)}return r}const JGe=/^[:\-\.\w\u00b7-\uffff]*$/;function Pke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=A_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:KGe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Vue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Mke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Vue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:JGe}}function dWt(e,t,r,n){let s=[],a=0;for(let i of KGe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Vue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function fWt(e,t,r,n,s){let a=A_(r),i=a?t.tags[N_(e.doc,a)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:n,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:JGe}}function hWt(e,t,r,n,s){var a;let i=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),l=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=A_(r),h=f?t.tags[N_(e.doc,f)]:null;d=h?.attrs&&h.attrs[u]}if(d){let f=e.sliceDoc(n,s).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),n++):c=/^[^\s<>='"]*$/;for(let m of d)l.push({label:m,apply:h+m+p,type:"constant"})}}return{from:n,to:s,options:l,validFor:c}}function eZe(e,t){let{state:r,pos:n}=t,s=Ra(r).resolveInner(n,-1),a=s.resolve(n);for(let i=n,l;a==s&&(l=s.childBefore(i));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=l,i=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Mke(r,s,s.from,n):Pke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?Pke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Mke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?fWt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?hWt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?dWt(r,e,s,n):null}function tZe(e){return eZe(NA.default,e)}function rZe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new NA(t,r):NA.default;return s=>eZe(n,s)}const pWt=ph.parser.configure({top:"SingleExpression"}),nZe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:zue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Bue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Uue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:pWt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:ph.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:TA.parser}],sZe=[{name:"style",parser:TA.parser.configure({top:"Styles"})}].concat(XGe.map(e=>({name:e,parser:ph.parser}))),aZe=i1.define({name:"html",parser:VHt.configure({props:[iS.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,r;for(let n=e.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;t=n=s}return t&&!((r=t.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),oS.add({Element(e){let t=e.firstChild,r=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:r.name=="CloseTag"?r.from:e.to}}}),DWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),xN=aZe.configure({wrap:AGe(nZe,sZe)});function iZe(e={}){let t="",r;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=AGe((e.nestedLanguages||[]).concat(nZe),(e.nestedAttributes||[]).concat(sZe)));let n=r?aZe.configure({wrap:r,dialect:t}):t?xN.configure({dialect:t}):xN;return new l1(n,[xN.data.of({autocomplete:rZe(e)}),e.autoCloseTags!==!1?oZe:[],Z3().support,FGe().support])}const Dke=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),oZe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!xN.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u,d,f;let h=i.doc.sliceString(c.from-1,c.to)==n,{head:p}=c,m=Ra(i).resolveInner(p,-1),g;if(h&&n==">"&&m.name=="EndTag"){let y=m.parent;if(((d=(u=y.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=N_(i.doc,y.parent,p))&&!Dke.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`</${g}>`;return{range:c,changes:{from:p,to:x,insert:w}}}}else if(h&&n=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==p-2&&((f=y.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=N_(i.doc,y,p))&&!Dke.has(g)){let x=p+(i.doc.sliceString(p,p+1)===">"?1:0),w=`${g}>`;return{range:nt.cursor(p+w.length,-1),changes:{from:p,to:x,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),mWt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:oZe,html:iZe,htmlCompletionSource:tZe,htmlCompletionSourceWith:rZe,htmlLanguage:xN},Symbol.toStringTag,{value:"Module"})),lZe=LF({commentTokens:{block:{open:"<!--",close:"-->"}}}),cZe=new pn,uZe=Hqt.configure({props:[oS.add(e=>!e.is("Block")||e.is("Document")||nse(e)!=null||gWt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),cZe.add(nse),iS.add({Document:()=>null}),Pb.add({Document:lZe})]});function nse(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function gWt(e){return e.name=="OrderedList"||e.name=="BulletList"}function yWt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=nse(n.type))!=null&&s<=t)break;r=n}return r.to}const vWt=kWe.of((e,t,r)=>{for(let n=Ra(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(cZe);if(s==null)continue;let a=yWt(n,s);if(a>r)return{from:r,to:a}}return null});function que(e){return new Bd(lZe,e,[],"markdown")}const dZe=que(uZe),bWt=uZe.configure([rHt,sHt,nHt,aHt,{props:[oS.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),d1=que(bWt);function xWt(e,t){return r=>{if(r&&e){let n=null;if(r=/\S*/.exec(r)[0],typeof e=="function"?n=e(r):n=Ye.matchLanguageName(e,r,!0),n instanceof Ye)return n.support?n.support.language.parser:o1.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class vV{constructor(t,r,n,s,a,i,l){this.node=t,this.from=r,this.to=n,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=l}blank(t,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;n.length<t;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(t,r){let n=this.node.name=="OrderedList"?String(+hZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function fZe(e,t){let r=[],n=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&r.push(s)}for(let s=r.length-1;s>=0;s--){let a=r[s],i,l=t.lineAt(a.from),c=a.from-l.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new vV(a,c,c+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new vV(a.parent,c,c+d,i[1],u,i[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),n.push(new vV(a.parent,c,c+d,i[1],u,f,a))}}return n}function hZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=hZe(a,t),c=+l[2];if(s>=0){if(c!=s+1)return;r.push({from:a.from+l[1].length,to:a.from+l[0].length,insert:String(s+2+n)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function Hue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(UE)!=" ")return e;let n=Sp(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const pZe=(e={})=>({state:t,dispatch:r})=>{let n=Ra(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!d1.isActiveAt(t,l.from,-1)&&!d1.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=fZe(n.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let x=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(x.to>=c||w&&w.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let S=d.length>1?d[d.length-2]:null,k,_="";S&&S.item?(k=u.from+S.from,_=S.marker(s,1)):k=u.from+(S?S.to:0);let E=[{from:k,to:c,insert:_}];return f.node.name=="OrderedList"&&bV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&bV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=$ke(d,t,u);return{range:nt.cursor(c+S.length+1),changes:{from:u.from,insert:S+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let x=s.lineAt(u.from-1),w=/>\s*$/.exec(x.text);if(w&&w.index==f.from){let S=t.changes([{from:x.from+w.index,to:x.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(S),changes:S}}}let p=[];f.node.name=="OrderedList"&&bV(f.item,s,p);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let x=0,w=d.length-1;x<=w;x++)g+=x==w&&!m?d[x].marker(s,1):d[x].blank(x<w?Sp(u.text,4,d[x+1].from)-g.length:null);let y=c;for(;y>u.from&&/\s/.test(u.text.charAt(y-u.from-1));)y--;return g=Hue(g,t),wWt(f.node,t.doc)&&(g=$ke(d,t,u)+t.lineBreak+g),p.push({from:y,to:c,insert:t.lineBreak+g}),{range:nt.cursor(y+g.length+1),changes:p}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},mZe=pZe();function Lke(e){return e.name=="QuoteMark"||e.name=="ListMark"}function wWt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let r=e.firstChild,n=e.getChild("ListItem","ListItem");if(!n)return!1;let s=t.lineAt(r.to),a=t.lineAt(n.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function $ke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Sp(r.text,4,e[s+1].from)-n.length:null,s<a);return Hue(n,t)}function SWt(e,t){let r=e.resolveInner(t,-1),n=t;Lke(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Lke(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const gZe=({state:e,dispatch:t})=>{let r=Ra(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&d1.isActiveAt(e,a.from)){let c=l.lineAt(i),u=fZe(SWt(r,i),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:nt.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let p=d.blank(Sp(c.text,4,d.to)-Sp(c.text,4,d.from));return h==c.from&&(p=Hue(p,e)),{range:nt.cursor(h+p.length),changes:{from:h,to:c.from+d.to,insert:p}}}if(h<i)return{range:nt.cursor(h),changes:{from:h,to:i}}}}}return n={range:a}});return n?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},yZe=[{key:"Enter",run:mZe},{key:"Backspace",run:gZe}],vZe=iZe({matchClosingTags:!1});function Que(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=dZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=vZe}=e;if(!(s instanceof BF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,vWt],d;i&&u.push(bZe),r instanceof l1?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?xWt(t,d):void 0;c.push(Wqt({codeParser:f,htmlParser:l.language.parser})),n&&u.push(Rp.high(BE.of(yZe)));let h=que(s.configure(c));return a&&u.push(h.data.of({autocomplete:OWt})),new l1(h,u)}function OWt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Ra(t).resolveInner(r,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:r-n[0].length,to:r,options:kWt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xV=null;function kWt(){if(xV)return xV;let e=tZe(new Sue(zn.create({extensions:vZe}),0,!0));return xV=e?e.options:[]}const _Wt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,bZe=ft.domEventHandlers({paste:(e,t)=>{var r;let{main:n}=t.state.selection;if(n.empty)return!1;let s=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!d1.isActiveAt(t.state,n.from,1)))return!1;let a=Ra(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||_Wt.test(l.name))&&(i=!0)},leave:l=>{l.to<n.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),EWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:dZe,deleteMarkupBackward:gZe,insertNewlineContinueMarkup:mZe,insertNewlineContinueMarkupCommand:pZe,markdown:Que,markdownKeymap:yZe,markdownLanguage:d1,pasteURLAsLink:bZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new l1(bue.define(e))}function Jv(e){return Ke(()=>import("./index-CE9g4tqB.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const xZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-BRChO8Yu.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Ke(()=>import("./index-BRChO8Yu.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Jv("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>OQt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-D0O42cyD.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Ye.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Ke(()=>Promise.resolve().then(()=>mWt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-BbA95K4k.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-xwFYAMf_.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Ye.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Ke(()=>Promise.resolve().then(()=>LVt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-7ieOcYNR.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-xQ6MkQZY.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return Jv("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>EWt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return Jv("MSSQL")}}),Ye.of({name:"MySQL",load(){return Jv("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-C8DbVZr9.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return Jv("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return Jv("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-jLLY5crc.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-BwD1O97j.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-CAJhefpS.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Ye.of({name:"SCSS",extensions:["scss"],load(){return Ke(()=>import("./index-CAJhefpS.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return Jv("StandardSQL")}}),Ye.of({name:"SQLite",load(){return Jv("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-BpIdOhgx.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Ye.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Ke(()=>import("./index-8WbdDFad.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Ye.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Ke(()=>import("./index-JM8kh28x.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Ye.of({name:"APL",extensions:["dyalog","apl"],load(){return Ke(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>pt(e.apl))}}),Ye.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Ke(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>pt(e.asciiArmor))}}),Ye.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Ke(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>pt(e.asn1({})))}}),Ye.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Ke(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>pt(e.asterisk))}}),Ye.of({name:"Brainfuck",extensions:["b","bf"],load(){return Ke(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>pt(e.brainfuck))}}),Ye.of({name:"Cobol",extensions:["cob","cpy"],load(){return Ke(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>pt(e.cobol))}}),Ye.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.csharp))}}),Ye.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"ClojureScript",extensions:["cljs"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Ke(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>pt(e.gss))}}),Ye.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Ke(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>pt(e.cmake))}}),Ye.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Ke(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>pt(e.coffeeScript))}}),Ye.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Ke(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>pt(e.commonLisp))}}),Ye.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Ke(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>pt(e.cypher))}}),Ye.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Ke(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>pt(e.cython))}}),Ye.of({name:"Crystal",extensions:["cr"],load(){return Ke(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>pt(e.crystal))}}),Ye.of({name:"D",extensions:["d"],load(){return Ke(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>pt(e.d))}}),Ye.of({name:"Dart",extensions:["dart"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.dart))}}),Ye.of({name:"diff",extensions:["diff","patch"],load(){return Ke(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>pt(e.diff))}}),Ye.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Ke(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>pt(e.dockerFile))}}),Ye.of({name:"DTD",extensions:["dtd"],load(){return Ke(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>pt(e.dtd))}}),Ye.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Ke(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>pt(e.dylan))}}),Ye.of({name:"EBNF",load(){return Ke(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>pt(e.ebnf))}}),Ye.of({name:"ECL",extensions:["ecl"],load(){return Ke(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>pt(e.ecl))}}),Ye.of({name:"edn",extensions:["edn"],load(){return Ke(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>pt(e.clojure))}}),Ye.of({name:"Eiffel",extensions:["e"],load(){return Ke(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>pt(e.eiffel))}}),Ye.of({name:"Elm",extensions:["elm"],load(){return Ke(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>pt(e.elm))}}),Ye.of({name:"Erlang",extensions:["erl"],load(){return Ke(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>pt(e.erlang))}}),Ye.of({name:"Esper",load(){return Ke(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>pt(e.esper))}}),Ye.of({name:"Factor",extensions:["factor"],load(){return Ke(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>pt(e.factor))}}),Ye.of({name:"FCL",load(){return Ke(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>pt(e.fcl))}}),Ye.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Ke(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>pt(e.forth))}}),Ye.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Ke(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>pt(e.fortran))}}),Ye.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.fSharp))}}),Ye.of({name:"Gas",extensions:["s"],load(){return Ke(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>pt(e.gas))}}),Ye.of({name:"Gherkin",extensions:["feature"],load(){return Ke(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>pt(e.gherkin))}}),Ye.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Ke(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>pt(e.groovy))}}),Ye.of({name:"Haskell",extensions:["hs"],load(){return Ke(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>pt(e.haskell))}}),Ye.of({name:"Haxe",extensions:["hx"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.haxe))}}),Ye.of({name:"HXML",extensions:["hxml"],load(){return Ke(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>pt(e.hxml))}}),Ye.of({name:"HTTP",load(){return Ke(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>pt(e.http))}}),Ye.of({name:"IDL",extensions:["pro"],load(){return Ke(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>pt(e.idl))}}),Ye.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Ke(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>pt(e.jsonld))}}),Ye.of({name:"Julia",extensions:["jl"],load(){return Ke(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>pt(e.julia))}}),Ye.of({name:"Kotlin",extensions:["kt","kts"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.kotlin))}}),Ye.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Ke(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>pt(e.liveScript))}}),Ye.of({name:"Lua",extensions:["lua"],load(){return Ke(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>pt(e.lua))}}),Ye.of({name:"mIRC",extensions:["mrc"],load(){return Ke(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>pt(e.mirc))}}),Ye.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Ke(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>pt(e.mathematica))}}),Ye.of({name:"Modelica",extensions:["mo"],load(){return Ke(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>pt(e.modelica))}}),Ye.of({name:"MUMPS",extensions:["mps"],load(){return Ke(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>pt(e.mumps))}}),Ye.of({name:"Mbox",extensions:["mbox"],load(){return Ke(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>pt(e.mbox))}}),Ye.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Ke(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>pt(e.nginx))}}),Ye.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Ke(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>pt(e.nsis))}}),Ye.of({name:"NTriples",extensions:["nt","nq"],load(){return Ke(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>pt(e.ntriples))}}),Ye.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveC))}}),Ye.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.objectiveCpp))}}),Ye.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.oCaml))}}),Ye.of({name:"Octave",extensions:["m"],load(){return Ke(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>pt(e.octave))}}),Ye.of({name:"Oz",extensions:["oz"],load(){return Ke(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>pt(e.oz))}}),Ye.of({name:"Pascal",extensions:["p","pas"],load(){return Ke(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>pt(e.pascal))}}),Ye.of({name:"Perl",extensions:["pl","pm"],load(){return Ke(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>pt(e.perl))}}),Ye.of({name:"Pig",extensions:["pig"],load(){return Ke(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>pt(e.pig))}}),Ye.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Ke(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>pt(e.powerShell))}}),Ye.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Ke(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>pt(e.properties))}}),Ye.of({name:"ProtoBuf",extensions:["proto"],load(){return Ke(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>pt(e.protobuf))}}),Ye.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Ke(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>pt(e.pug))}}),Ye.of({name:"Puppet",extensions:["pp"],load(){return Ke(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>pt(e.puppet))}}),Ye.of({name:"Q",extensions:["q"],load(){return Ke(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>pt(e.q))}}),Ye.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Ke(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>pt(e.r))}}),Ye.of({name:"RPM Changes",load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmChanges))}}),Ye.of({name:"RPM Spec",extensions:["spec"],load(){return Ke(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>pt(e.rpmSpec))}}),Ye.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Ke(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>pt(e.ruby))}}),Ye.of({name:"SAS",extensions:["sas"],load(){return Ke(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>pt(e.sas))}}),Ye.of({name:"Scala",extensions:["scala"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.scala))}}),Ye.of({name:"Scheme",extensions:["scm","ss"],load(){return Ke(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>pt(e.scheme))}}),Ye.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Ke(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>pt(e.shell))}}),Ye.of({name:"Sieve",extensions:["siv","sieve"],load(){return Ke(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>pt(e.sieve))}}),Ye.of({name:"Smalltalk",extensions:["st"],load(){return Ke(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>pt(e.smalltalk))}}),Ye.of({name:"Solr",load(){return Ke(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>pt(e.solr))}}),Ye.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Ke(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>pt(e.sml))}}),Ye.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Ke(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>pt(e.sparql))}}),Ye.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Ke(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>pt(e.spreadsheet))}}),Ye.of({name:"Squirrel",extensions:["nut"],load(){return Ke(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>pt(e.squirrel))}}),Ye.of({name:"Stylus",extensions:["styl"],load(){return Ke(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>pt(e.stylus))}}),Ye.of({name:"Swift",extensions:["swift"],load(){return Ke(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>pt(e.swift))}}),Ye.of({name:"sTeX",load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Ke(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>pt(e.stex))}}),Ye.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"Tcl",extensions:["tcl"],load(){return Ke(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>pt(e.tcl))}}),Ye.of({name:"Textile",extensions:["textile"],load(){return Ke(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>pt(e.textile))}}),Ye.of({name:"TiddlyWiki",load(){return Ke(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>pt(e.tiddlyWiki))}}),Ye.of({name:"Tiki wiki",load(){return Ke(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>pt(e.tiki))}}),Ye.of({name:"TOML",extensions:["toml"],load(){return Ke(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>pt(e.toml))}}),Ye.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Ke(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>pt(e.troff))}}),Ye.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Ke(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>pt(e.ttcn))}}),Ye.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Ke(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>pt(e.ttcnCfg))}}),Ye.of({name:"Turtle",extensions:["ttl"],load(){return Ke(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>pt(e.turtle))}}),Ye.of({name:"Web IDL",extensions:["webidl"],load(){return Ke(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>pt(e.webIDL))}}),Ye.of({name:"VB.NET",extensions:["vb"],load(){return Ke(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>pt(e.vb))}}),Ye.of({name:"VBScript",extensions:["vbs"],load(){return Ke(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>pt(e.vbScript))}}),Ye.of({name:"Velocity",extensions:["vtl"],load(){return Ke(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>pt(e.velocity))}}),Ye.of({name:"Verilog",extensions:["v"],load(){return Ke(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>pt(e.verilog))}}),Ye.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Ke(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>pt(e.vhdl))}}),Ye.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Ke(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>pt(e.xQuery))}}),Ye.of({name:"Yacas",extensions:["ys"],load(){return Ke(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>pt(e.yacas))}}),Ye.of({name:"Z80",extensions:["z80"],load(){return Ke(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>pt(e.z80))}}),Ye.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.mscgen))}}),Ye.of({name:"Xù",extensions:["xu"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.xu))}}),Ye.of({name:"MsGenny",extensions:["msgenny"],load(){return Ke(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>pt(e.msgenny))}}),Ye.of({name:"Vue",extensions:["vue"],load(){return Ke(()=>import("./index-i0aoSioD.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-DzbjqZuh.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vx.apply(null,arguments)}var CWt=e=>{var{theme:t,settings:r={},styles:n=[]}=e,s={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=a),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var i={};r.gutterActiveForeground&&(i.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},i.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=i,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var l=ft.theme(s,{dark:t==="dark"}),c=Pp.define(n),u=[l,Wx(c)];return u},jWt={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},TWt=[{tag:ne.comment,color:"#6272a4"},{tag:ne.string,color:"#f1fa8c"},{tag:ne.atom,color:"#bd93f9"},{tag:ne.meta,color:"#f8f8f2"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"#ff79c6"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"#66d9ef"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"#50fa7b"},{tag:ne.atom,color:"#bd93f9"}],qE=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return CWt({theme:t,settings:vx({},jWt,r),styles:[...TWt,...n]})};qE();function Wue(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}const NWt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Zue(e.state,r.from);return n.line?AWt(e):n.block?RWt(e):!1};function Gue(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let s=e(t,r);return s?(n(r.update(s)),!0):!1}}const AWt=Gue(DWt,0),IWt=Gue(wZe,0),RWt=Gue((e,t)=>wZe(e,t,MWt(t)),0);function Zue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Dj=50;function PWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Dj,n),i=e.sliceDoc(s,s+Dj),l=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(i)[0].length,u=a.length-l;if(a.slice(u-t.length,u)==t&&i.slice(c,c+r.length)==r)return{open:{pos:n-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-n<=2*Dj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Dj),f=e.sliceDoc(s-Dj,s));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-r.length;return d.slice(h,h+t.length)==t&&f.slice(m,m+r.length)==r?{open:{pos:n+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:s-p-r.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function MWt(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),s=r.to<=n.to?n:e.doc.lineAt(r.to);s.from>n.from&&s.from==r.to&&(s=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let a=t.length-1;a>=0&&t[a].to>n.from?t[a].to=s.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return t}function wZe(e,t,r=t.selection.ranges){let n=r.map(a=>Zue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>PWt(t,n[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(r.map((a,i)=>s[i]?[]:[{from:a.from,insert:n[i].open+" "},{from:a.to,insert:" "+n[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,l;i<s.length;i++)if(l=s[i]){let c=n[i],{open:u,close:d}=l;a.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:a}}return null}function DWt(e,t,r=t.selection.ranges){let n=[],s=-1;e:for(let{from:a,to:i}of r){let l=n.length,c=1e9,u;for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(u==null&&(u=Zue(t,f.from).line,!u))continue e;if(f.from>s&&(a==i||i>f.from)){s=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<c&&(c=h),n.push({line:f,comment:m,token:u,indent:h,empty:p,single:!1})}d=f.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(e!=2&&n.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of n)(f||!d)&&a.push({from:l.from+u,insert:c+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:l,token:c}of n)if(l>=0){let u=i.from+l,d=u+c.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const sse=pg.define(),LWt=pg.define(),$Wt=Kt.define(),SZe=Kt.define({combine(e){return mg(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,s)=>t(n,s)||r(n,s)})}}),OZe=Oo.define({create(){return Nm.empty},update(e,t){let r=t.state.facet(SZe),n=t.annotation(sse);if(n){let c=Lu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=Y3(d,d.length,r.minDepth,c):d=EZe(d,t.startState.selection),new Nm(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(LWt);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(Mo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Lu.fromTransaction(t),i=t.annotation(Mo.time),l=t.annotation(Mo.userEvent);return a?e=e.addChanges(a,i,l,r,t):t.selection&&(e=e.addSelection(t.startState.selection,i,l,r.newGroupDelay)),(s=="full"||s=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Nm(e.done.map(Lu.fromJSON),e.undone.map(Lu.fromJSON))}});function FWt(e={}){return[OZe,SZe.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?kZe:t.inputType=="historyRedo"?ase:null;return n?(t.preventDefault(),n(r)):!1}})]}function UF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(OZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const kZe=UF(0,!1),ase=UF(1,!1),zWt=UF(0,!0),BWt=UF(1,!0);class Lu{constructor(t,r,n,s,a){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new Lu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new Lu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Vm.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,r){let n=oh;for(let s of t.startState.facet($Wt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new Lu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,oh)}static selection(t){return new Lu(void 0,oh,void 0,void 0,t)}}function Y3(e,t,r,n){let s=t+1>r+20?t-r-1:0,a=e.slice(s,t);return a.push(n),a}function UWt(e,t){let r=[],n=!1;return e.iterChangedRanges((s,a)=>r.push(s,a)),t.iterChangedRanges((s,a,i,l)=>{for(let c=0;c<r.length;){let u=r[c++],d=r[c++];l>=u&&i<=d&&(n=!0)}}),n}function VWt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function _Ze(e,t){return e.length?t.length?e.concat(t):e:t}const oh=[],qWt=200;function EZe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-qWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),Y3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[Lu.selection([t])]}function HWt(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function wV(e,t){if(!e.length)return e;let r=e.length,n=oh;for(;r;){let s=QWt(e[r-1],t,n);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,r);return a[r-1]=s,a}else t=s.mapped,r--,n=s.selectionsAfter}return n.length?[Lu.selection(n)]:oh}function QWt(e,t,r){let n=_Ze(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):oh,r);if(!e.changes)return Lu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Lu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const WWt=/^(input\.type|delete)($|\.)/;class Nm{constructor(t,r,n=0,s=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new Nm(this.done,this.undone):this}addChanges(t,r,n,s,a){let i=this.done,l=i[i.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!n||WWt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,UWt(l.changes,t.changes))||n=="input.type.compose")?i=Y3(i,i.length-1,s.minDepth,new Lu(t.changes.compose(l.changes),_Ze(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,oh)):i=Y3(i,i.length,s.minDepth,t),new Nm(i,oh,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:oh;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&VWt(a[a.length-1],t)?this:new Nm(EZe(this.done,t),this.undone,r,n)}addMapping(t){return new Nm(wV(this.done,t),wV(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):r.selection);if(n&&a.selectionsAfter.length)return r.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:sse.of({side:t,rest:HWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?oh:s.slice(0,s.length-1);return a.mapped&&(l=wV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:sse.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Nm.empty=new Nm(oh,oh);const GWt=[{key:"Mod-z",run:kZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ase,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ase,preventDefault:!0},{key:"Mod-u",run:zWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:BWt,preventDefault:!0}];function HE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function Mp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Dp({state:e,dispatch:t},r){let n=HE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(Mp(e,n)),!0)}function VF(e,t){return nt.cursor(t?e.to:e.from)}function CZe(e,t){return Dp(e,r=>r.empty?e.moveByChar(r,t):VF(r,t))}function kc(e){return e.textDirectionAt(e.state.selection.main.head)==$a.LTR}const jZe=e=>CZe(e,!kc(e)),TZe=e=>CZe(e,kc(e));function NZe(e,t){return Dp(e,r=>r.empty?e.moveByGroup(r,t):VF(r,t))}const ZWt=e=>NZe(e,!kc(e)),YWt=e=>NZe(e,kc(e));function XWt(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function qF(e,t,r){let n=Ra(e).resolveInner(t.head),s=r?pn.closedBy:pn.openedBy;for(let c=t.head;;){let u=r?n.childAfter(c):n.childBefore(c);if(!u)break;XWt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Tm(e,n.from,1):Tm(e,n.to,-1))&&i.matched?l=r?i.end.to:i.end.from:l=r?n.to:n.from,nt.cursor(l,r?-1:1)}const KWt=e=>Dp(e,t=>qF(e.state,t,!kc(e))),JWt=e=>Dp(e,t=>qF(e.state,t,kc(e)));function AZe(e,t){return Dp(e,r=>{if(!r.empty)return VF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const IZe=e=>AZe(e,!1),RZe=e=>AZe(e,!0);function PZe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,s;if(t){for(let a of e.state.facet(ft.scrollMargins)){let i=a(e);i?.top&&(r=Math.max(i?.top,r)),i?.bottom&&(n=Math.max(i?.bottom,n))}s=e.scrollDOM.clientHeight-r-n}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function MZe(e,t){let r=PZe(e),{state:n}=e,s=HE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):VF(i,t));if(s.eq(n.selection))return!1;let a;if(r.selfScroll){let i=e.coordsAtPos(n.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+r.marginTop,u=l.bottom-r.marginBottom;i&&i.top>c&&i.bottom<u&&(a=ft.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Mp(n,s),{effects:a}),!0}const Fke=e=>MZe(e,!1),ise=e=>MZe(e,!0);function Gx(e,t,r){let n=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,r);if(s.head==t.head&&s.head!=(r?n.to:n.from)&&(s=e.moveToLineBoundary(t,r,!1)),!r&&s.head==n.from&&n.length){let a=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&t.head!=n.from+a&&(s=nt.cursor(n.from+a))}return s}const eGt=e=>Dp(e,t=>Gx(e,t,!0)),tGt=e=>Dp(e,t=>Gx(e,t,!1)),rGt=e=>Dp(e,t=>Gx(e,t,!kc(e))),nGt=e=>Dp(e,t=>Gx(e,t,kc(e))),sGt=e=>Dp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),aGt=e=>Dp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function iGt(e,t,r){let n=!1,s=HE(e.selection,a=>{let i=Tm(e,a.head,-1)||Tm(e,a.head,1)||a.head>0&&Tm(e,a.head-1,1)||a.head<e.doc.length&&Tm(e,a.head+1,-1);if(!i||!i.end)return a;n=!0;let l=i.start.from==a.head?i.end.to:i.end.from;return nt.cursor(l)});return n?(t(Mp(e,s)),!0):!1}const oGt=({state:e,dispatch:t})=>iGt(e,t);function Ph(e,t){let r=HE(e.state.selection,n=>{let s=t(n);return nt.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(Mp(e.state,r)),!0)}function DZe(e,t){return Ph(e,r=>e.moveByChar(r,t))}const LZe=e=>DZe(e,!kc(e)),$Ze=e=>DZe(e,kc(e));function FZe(e,t){return Ph(e,r=>e.moveByGroup(r,t))}const lGt=e=>FZe(e,!kc(e)),cGt=e=>FZe(e,kc(e)),uGt=e=>Ph(e,t=>qF(e.state,t,!kc(e))),dGt=e=>Ph(e,t=>qF(e.state,t,kc(e)));function zZe(e,t){return Ph(e,r=>e.moveVertically(r,t))}const BZe=e=>zZe(e,!1),UZe=e=>zZe(e,!0);function VZe(e,t){return Ph(e,r=>e.moveVertically(r,t,PZe(e).height))}const zke=e=>VZe(e,!1),Bke=e=>VZe(e,!0),fGt=e=>Ph(e,t=>Gx(e,t,!0)),hGt=e=>Ph(e,t=>Gx(e,t,!1)),pGt=e=>Ph(e,t=>Gx(e,t,!kc(e))),mGt=e=>Ph(e,t=>Gx(e,t,kc(e))),gGt=e=>Ph(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),yGt=e=>Ph(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),Uke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:0})),!0),Vke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.doc.length})),!0),qke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.selection.main.anchor,head:0})),!0),Hke=({state:e,dispatch:t})=>(t(Mp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),vGt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),bGt=({state:e,dispatch:t})=>{let r=HF(e).map(({from:n,to:s})=>nt.range(n,Math.min(s+1,e.doc.length)));return t(e.update({selection:nt.create(r),userEvent:"select"})),!0},xGt=({state:e,dispatch:t})=>{let r=HE(e.selection,n=>{let s=Ra(e),a=s.resolveStack(n.from,1);if(n.empty){let i=s.resolveStack(n.from,-1);i.node.from>=a.node.from&&i.node.to<=a.node.to&&(a=i)}for(let i=a;i;i=i.next){let{node:l}=i;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&i.next)return nt.range(l.to,l.from)}return n});return r.eq(e.selection)?!1:(t(Mp(e,r)),!0)};function qZe(e,t){let{state:r}=e,n=r.selection,s=r.selection.ranges.slice();for(let a of r.selection.ranges){let i=r.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let l=a;;){let c=e.moveVertically(l,t);if(c.head<i.from||c.head>i.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==n.ranges.length?!1:(e.dispatch(Mp(r,nt.create(s,s.length-1))),!0)}const wGt=e=>qZe(e,!1),SGt=e=>qZe(e,!0),OGt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=nt.create([r.main]):r.main.empty||(n=nt.create([nt.cursor(r.main.head)])),n?(t(Mp(e,n)),!0):!1};function HR(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(r="delete.backward",c=nD(e,c,!1)):c>i&&(r="delete.forward",c=nD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=nD(e,i,!1),l=nD(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:nt.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ft.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function nD(e,t,r){if(e instanceof ft)for(let n of e.state.facet(ft.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const HZe=(e,t,r)=>HR(e,n=>{let s=n.from,{state:a}=e,i=a.doc.lineAt(s),l,c;if(r&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(l=i.text.slice(0,s-i.from))){if(l[l.length-1]==" ")return s-1;let u=Sp(l,a.tabSize),d=u%c1(a)||c1(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=yl(i.text,s-i.from,t,t)+i.from,c==s&&i.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,s-i.from))&&(c=yl(i.text,c-i.from,!1,!1)+i.from);return c}),ose=e=>HZe(e,!1,!0),QZe=e=>HZe(e,!0,!1),WZe=(e,t)=>HR(e,r=>{let n=r.head,{state:s}=e,a=s.doc.lineAt(n),i=s.charCategorizer(n);for(let l=null;;){if(n==(t?a.to:a.from)){n==r.head&&a.number!=(t?s.doc.lines:1)&&(n+=t?1:-1);break}let c=yl(a.text,n-a.from,t)+a.from,u=a.text.slice(Math.min(n,c)-a.from,Math.max(n,c)-a.from),d=i(u);if(l!=null&&d!=l)break;(u!=" "||n!=r.head)&&(l=d),n=c}return n}),GZe=e=>WZe(e,!1),kGt=e=>WZe(e,!0),_Gt=e=>HR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),EGt=e=>HR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),CGt=e=>HR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),jGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Fs.of(["",""])},range:nt.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},TGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let s=n.from,a=e.doc.lineAt(s),i=s==a.from?s-1:yl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:yl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:l,insert:e.doc.slice(s,l).append(e.doc.slice(i,s))},range:nt.cursor(l)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function HF(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function ZZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of HF(e)){if(r?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(r?a.to+1:a.from-1),l=i.length+1;if(r){n.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(nt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{n.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(nt.range(c.anchor-l,c.head-l))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:nt.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const NGt=({state:e,dispatch:t})=>ZZe(e,t,!1),AGt=({state:e,dispatch:t})=>ZZe(e,t,!0);function YZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of HF(e))r?n.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):n.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(n);return t(e.update({changes:s,selection:e.selection.map(s,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const IGt=({state:e,dispatch:t})=>YZe(e,t,!1),RGt=({state:e,dispatch:t})=>YZe(e,t,!0),PGt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(HF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=HE(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),l=e.coordsAtPos(s.head,s.assoc||1);l&&(a=i.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function MGt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Ra(e).resolveInner(t),n=r.childBefore(t),s=r.childAfter(t),a;return n&&s&&n.to<=t&&s.from>=t&&(a=n.type.prop(pn.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const Qke=XZe(!1),DGt=XZe(!0);function XZe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(s=>{let{from:a,to:i}=s,l=t.doc.lineAt(a),c=!e&&a==i&&MGt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new $F(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=gue(u,a);for(d==null&&(d=Sp(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<l.to&&/\s/.test(l.text[i-l.from]);)i++;c?{from:a,to:i}=c:a>l.from&&a<l.from+100&&!/\S/.test(l.text.slice(0,a))&&(a=l.from);let f=["",wA(t,d)];return c&&f.push(wA(t,u.lineIndent(l.from,-1))),{changes:{from:a,to:i,insert:Fs.of(f)},range:nt.cursor(a+1+f[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Yue(e,t){let r=-1;return e.changeByRange(n=>{let s=[];for(let i=n.from;i<=n.to;){let l=e.doc.lineAt(i);l.number>r&&(n.empty||n.to>l.from)&&(t(l,s,n),r=l.number),i=l.to+1}let a=e.changes(s);return{changes:s,range:nt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const LGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new $F(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=Yue(e,(a,i,l)=>{let c=gue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=wA(e,c);(u!=d||l.from<a.from+u.length)&&(r[a.from]=c,i.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},KZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(UE)})}),{userEvent:"input.indent"})),!0),JZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Sp(s,e.tabSize),i=0,l=wA(e,Math.max(0,a-c1(e)));for(;i<s.length&&i<l.length&&s.charCodeAt(i)==l.charCodeAt(i);)i++;n.push({from:r.from+i,to:r.from+s.length,insert:l.slice(i)})}),{userEvent:"delete.dedent"})),!0),$Gt=e=>(e.setTabFocusMode(),!0),FGt=[{key:"Ctrl-b",run:jZe,shift:LZe,preventDefault:!0},{key:"Ctrl-f",run:TZe,shift:$Ze},{key:"Ctrl-p",run:IZe,shift:BZe},{key:"Ctrl-n",run:RZe,shift:UZe},{key:"Ctrl-a",run:sGt,shift:gGt},{key:"Ctrl-e",run:aGt,shift:yGt},{key:"Ctrl-d",run:QZe},{key:"Ctrl-h",run:ose},{key:"Ctrl-k",run:_Gt},{key:"Ctrl-Alt-h",run:GZe},{key:"Ctrl-o",run:jGt},{key:"Ctrl-t",run:TGt},{key:"Ctrl-v",run:ise}],zGt=[{key:"ArrowLeft",run:jZe,shift:LZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ZWt,shift:lGt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:rGt,shift:pGt,preventDefault:!0},{key:"ArrowRight",run:TZe,shift:$Ze,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:YWt,shift:cGt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:nGt,shift:mGt,preventDefault:!0},{key:"ArrowUp",run:IZe,shift:BZe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Uke,shift:qke},{mac:"Ctrl-ArrowUp",run:Fke,shift:zke},{key:"ArrowDown",run:RZe,shift:UZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Vke,shift:Hke},{mac:"Ctrl-ArrowDown",run:ise,shift:Bke},{key:"PageUp",run:Fke,shift:zke},{key:"PageDown",run:ise,shift:Bke},{key:"Home",run:tGt,shift:hGt,preventDefault:!0},{key:"Mod-Home",run:Uke,shift:qke},{key:"End",run:eGt,shift:fGt,preventDefault:!0},{key:"Mod-End",run:Vke,shift:Hke},{key:"Enter",run:Qke,shift:Qke},{key:"Mod-a",run:vGt},{key:"Backspace",run:ose,shift:ose,preventDefault:!0},{key:"Delete",run:QZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:GZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:kGt,preventDefault:!0},{mac:"Mod-Backspace",run:EGt,preventDefault:!0},{mac:"Mod-Delete",run:CGt,preventDefault:!0}].concat(FGt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),BGt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:KWt,shift:uGt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:JWt,shift:dGt},{key:"Alt-ArrowUp",run:NGt},{key:"Shift-Alt-ArrowUp",run:IGt},{key:"Alt-ArrowDown",run:AGt},{key:"Shift-Alt-ArrowDown",run:RGt},{key:"Mod-Alt-ArrowUp",run:wGt},{key:"Mod-Alt-ArrowDown",run:SGt},{key:"Escape",run:OGt},{key:"Mod-Enter",run:DGt},{key:"Alt-l",mac:"Ctrl-l",run:bGt},{key:"Mod-i",run:xGt,preventDefault:!0},{key:"Mod-[",run:JZe},{key:"Mod-]",run:KZe},{key:"Mod-Alt-\\",run:LGt},{key:"Shift-Mod-k",run:PGt},{key:"Shift-Mod-\\",run:oGt},{key:"Mod-/",run:NWt},{key:"Alt-A",run:IWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:$Gt}].concat(zGt),UGt={key:"Tab",run:KZe,shift:JZe},Wke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class qy{constructor(t,r,n=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(n,s),this.bufferStart=n,this.normalize=a?l=>a(Wke(l)):Wke,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Nu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=Xce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=vm(t);let s=this.normalize(r);if(s.length)for(let a=0,i=n;;a++){let l=s.charCodeAt(a),c=this.match(l,i,this.bufferPos+this.bufferStart);if(a==s.length-1){if(c)return this.value=c,this;break}i==n&&a<r.length&&r.charCodeAt(a)==l&&i++}}}match(t,r,n){let s=null;for(let a=0;a<this.matches.length;a+=2){let i=this.matches[a],l=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?s={from:this.matches[a+1],to:n}:(this.matches[a]++,l=!0)),l||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:r,to:n}:this.matches.push(1,r)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(qy.prototype[Symbol.iterator]=function(){return this});const eYe={from:-1,to:-1,match:/.*/.exec("")},Xue="gm"+(/x/.unicode==null?"":"u");class tYe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=eYe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new rYe(t,r,n,s,a);this.re=new RegExp(r,Xue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=X3(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,s=n+r[0].length;if(this.matchPos=X3(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const SV=new WeakMap;class Uk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=SV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Uk(r,t.sliceString(r,n));return SV.set(t,l),l}if(s.from==r&&s.to==n)return s;let{text:a,from:i}=s;return i>r&&(a=t.sliceString(r,i)+a,i=r),s.to<n&&(a+=t.sliceString(s.to,n)),SV.set(t,new Uk(i,a)),new Uk(r,a.slice(r-i,n-i))}}class rYe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=eYe,this.matchPos=X3(t,s),this.re=new RegExp(r,Xue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Uk.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=X3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Uk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(tYe.prototype[Symbol.iterator]=rYe.prototype[Symbol.iterator]=function(){return this});function VGt(e){try{return new RegExp(e,Xue),!0}catch{return!1}}function X3(e,t){if(t>=e.length)return t;let r=e.lineAt(t),n;for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}const qGt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=NUt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:t.phrase("go")});return s.then(a=>{let i=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!i){e.dispatch({effects:n});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,h=d?+d.slice(1):0,p=u?+u:l.number;if(u&&f){let y=p/100;c&&(y=y*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*y)}else u&&c&&(p=p*(c=="-"?-1:1)+l.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,p))),g=nt.cursor(m.from+Math.max(0,Math.min(h,m.length)));e.dispatch({effects:[n,ft.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},HGt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},QGt=Kt.define({combine(e){return mg(e,HGt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function WGt(e){return[KGt,XGt]}const GGt=er.mark({class:"cm-selectionMatch"}),ZGt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Gke(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=xi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=xi.Word)}function YGt(e,t,r,n){return e(t.sliceDoc(r,r+1))==xi.Word&&e(t.sliceDoc(n-1,n))==xi.Word}const XGt=Oi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(QGt),{state:r}=e,n=r.selection;if(n.ranges.length>1)return er.none;let s=n.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return er.none;let c=r.wordAt(s.head);if(!c)return er.none;i=r.charCategorizer(s.head),a=r.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return er.none;if(t.wholeWords){if(a=r.sliceDoc(s.from,s.to),i=r.charCategorizer(s.head),!(Gke(i,r,s.from,s.to)&&YGt(i,r,s.from,s.to)))return er.none}else if(a=r.sliceDoc(s.from,s.to),!a)return er.none}let l=[];for(let c of e.visibleRanges){let u=new qy(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Gke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(ZGt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(GGt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),KGt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),JGt=({state:e,dispatch:t})=>{let{selection:r}=e,n=nt.create(r.ranges.map(s=>e.wordAt(s.head)||nt.cursor(s.head)),r.mainIndex);return n.eq(r)?!1:(t(e.update({selection:n})),!0)};function eZt(e,t){let{main:r,ranges:n}=e.selection,s=e.wordAt(r.head),a=s&&s.from==r.from&&s.to==r.to;for(let i=!1,l=new qy(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new qy(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}else{if(i&&n.some(c=>c.from==l.value.from))continue;if(a){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const tZt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return JGt({state:e,dispatch:t});let n=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=n))return!1;let s=eZt(e,n);return s?(t(e.update({selection:e.selection.addRange(nt.range(s.from,s.to),!1),effects:ft.scrollIntoView(s.to)})),!0):!1},QE=Kt.define({combine(e){return mg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new mZt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class nYe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||VGt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
116
116
  `:n=="r"?"\r":n=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new oZt(this):new sZt(this)}getCursor(t,r=0,n){let s=t.doc?t:zn.create({doc:t});return n==null&&(n=s.doc.length),this.regexp?UO(this,s,r,n):BO(this,s,r,n)}}class sYe{constructor(t){this.spec=t}}function rZt(e,t,r){return(n,s,a,i)=>{if(r&&!r(n,s,a,i))return!1;let l=n>=i&&s<=i+a.length?a.slice(n-i,s-i):t.doc.sliceString(n,s);return e(l,t,n,s)}}function BO(e,t,r,n){let s;return e.wholeWord&&(s=nZt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(s=rZt(e.test,t,s)),new qy(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:a=>a.toLowerCase(),s)}function nZt(e,t){return(r,n,s,a)=>((a>r||a+s.length<n)&&(a=Math.max(0,r-2),s=e.sliceString(a,Math.min(e.length,n+2))),(t(K3(s,r-a))!=xi.Word||t(J3(s,r-a))!=xi.Word)&&(t(J3(s,n-a))!=xi.Word||t(K3(s,n-a))!=xi.Word))}class sZt extends sYe{constructor(t){super(t)}nextMatch(t,r,n){let s=BO(this.spec,t,n,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,r+this.spec.unquoted.length);s=BO(this.spec,t,0,a).nextOverlapping()}return s.done||s.value.from==r&&s.value.to==n?null:s.value}prevMatchInRange(t,r,n){for(let s=n;;){let a=Math.max(r,s-1e4-this.spec.unquoted.length),i=BO(this.spec,t,a,s),l=null;for(;!i.nextOverlapping().done;)l=i.value;if(l)return l;if(a==r)return null;s-=1e4}}prevMatch(t,r,n){let s=this.prevMatchInRange(t,0,r);return s||(s=this.prevMatchInRange(t,Math.max(0,n-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=r||s.to!=n)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,r){let n=BO(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=BO(this.spec,t,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}function aZt(e,t,r){return(n,s,a)=>(!r||r(n,s,a))&&e(a[0],t,n,s)}function UO(e,t,r,n){let s;return e.wholeWord&&(s=iZt(t.charCategorizer(t.selection.main.head))),e.test&&(s=aZt(e.test,t,s)),new tYe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},r,n)}function K3(e,t){return e.slice(yl(e,t,!1),t)}function J3(e,t){return e.slice(t,yl(e,t))}function iZt(e){return(t,r,n)=>!n[0].length||(e(K3(n.input,n.index))!=xi.Word||e(J3(n.input,n.index))!=xi.Word)&&(e(J3(n.input,n.index+n[0].length))!=xi.Word||e(K3(n.input,n.index+n[0].length))!=xi.Word)}class oZt extends sYe{nextMatch(t,r,n){let s=UO(this.spec,t,n,t.doc.length).next();return s.done&&(s=UO(this.spec,t,0,r).next()),s.done?null:s.value}prevMatchInRange(t,r,n){for(let s=1;;s++){let a=Math.max(r,n-s*1e4),i=UO(this.spec,t,a,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(a==r||l.from>a+10))return l;if(a==r)return null}}prevMatch(t,r,n){return this.prevMatchInRange(t,0,r)||this.prevMatchInRange(t,n,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return t.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let a=+n.slice(0,s);if(a>0&&a<t.match.length)return t.match[a]+n.slice(s)}return r})}matchAll(t,r){let n=UO(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=UO(this.spec,t,Math.max(0,r-250),Math.min(n+250,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}const AA=rn.define(),Kue=rn.define(),zb=Oo.define({create(e){return new OV(lse(e).create(),null)},update(e,t){for(let r of t.effects)r.is(AA)?e=new OV(r.value.create(),e.panel):r.is(Kue)&&(e=new OV(e.query,r.value?Jue:null));return e},provide:e=>xA.from(e,t=>t.panel)});class OV{constructor(t,r){this.query=t,this.panel=r}}const lZt=er.mark({class:"cm-searchMatch"}),cZt=er.mark({class:"cm-searchMatch cm-searchMatch-selected"}),uZt=Oi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(zb))}update(e){let t=e.state.field(zb);(t!=e.startState.field(zb)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return er.none;let{view:r}=this,n=new nu;for(let s=0,a=r.visibleRanges,i=a.length;s<i;s++){let{from:l,to:c}=a[s];for(;s<i-1&&c>a[s+1].from-500;)c=a[++s].to;e.highlight(r.state,l,c,(u,d)=>{let f=r.state.selection.ranges.some(h=>h.from==u&&h.to==d);n.add(u,d,f?cZt:lZt)})}return n.finish()}},{decorations:e=>e.decorations});function QR(e){return t=>{let r=t.state.field(zb,!1);return r&&r.query.spec.valid?e(t,r):oYe(t)}}const e5=QR((e,{query:t})=>{let{to:r}=e.state.selection.main,n=t.nextMatch(e.state,r,r);if(!n)return!1;let s=nt.single(n.from,n.to),a=e.state.facet(QE);return e.dispatch({selection:s,effects:[ede(e,n),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),iYe(e),!0}),t5=QR((e,{query:t})=>{let{state:r}=e,{from:n}=r.selection.main,s=t.prevMatch(r,n,n);if(!s)return!1;let a=nt.single(s.from,s.to),i=e.state.facet(QE);return e.dispatch({selection:a,effects:[ede(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),iYe(e),!0}),dZt=QR((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!r||!r.length?!1:(e.dispatch({selection:nt.create(r.map(n=>nt.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),fZt=({state:e,dispatch:t})=>{let r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:s}=r.main,a=[],i=0;for(let l=new qy(e.doc,e.sliceDoc(n,s));!l.next().done;){if(a.length>1e3)return!1;l.value.from==n&&(i=a.length),a.push(nt.range(l.value.from,l.value.to))}return t(e.update({selection:nt.create(a,i),userEvent:"select.search.matches"})),!0},Zke=QR((e,{query:t})=>{let{state:r}=e,{from:n,to:s}=r.selection.main;if(r.readOnly)return!1;let a=t.nextMatch(r,n,n);if(!a)return!1;let i=a,l=[],c,u,d=[];i.from==n&&i.to==s&&(u=r.toText(t.getReplacement(i)),l.push({from:i.from,to:i.to,insert:u}),i=t.nextMatch(r,i.from,i.to),d.push(ft.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+".")));let f=e.state.changes(l);return i&&(c=nt.single(i.from,i.to).map(f),d.push(ede(e,i)),d.push(r.facet(QE).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),hZt=QR((e,{query:t})=>{if(e.state.readOnly)return!1;let r=t.matchAll(e.state,1e9).map(s=>{let{from:a,to:i}=s;return{from:a,to:i,insert:t.getReplacement(s)}});if(!r.length)return!1;let n=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:ft.announce.of(n),userEvent:"input.replace.all"}),!0});function Jue(e){return e.state.facet(QE).createPanel(e)}function lse(e,t){var r,n,s,a,i;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(QE);return new nYe({search:((r=t?.literal)!==null&&r!==void 0?r:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(n=t?.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(s=t?.literal)!==null&&s!==void 0?s:u.literal,regexp:(a=t?.regexp)!==null&&a!==void 0?a:u.regexp,wholeWord:(i=t?.wholeWord)!==null&&i!==void 0?i:u.wholeWord})}function aYe(e){let t=pue(e,Jue);return t&&t.dom.querySelector("[main-field]")}function iYe(e){let t=aYe(e);t&&t==e.root.activeElement&&t.select()}const oYe=e=>{let t=e.state.field(zb,!1);if(t&&t.panel){let r=aYe(e);if(r&&r!=e.root.activeElement){let n=lse(e.state,t.query.spec);n.valid&&e.dispatch({effects:AA.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[Kue.of(!0),t?AA.of(lse(e.state,t.query.spec)):rn.appendConfig.of(yZt)]});return!0},lYe=e=>{let t=e.state.field(zb,!1);if(!t||!t.panel)return!1;let r=pue(e,Jue);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Kue.of(!1)}),!0},pZt=[{key:"Mod-f",run:oYe,scope:"editor search-panel"},{key:"F3",run:e5,shift:t5,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:e5,shift:t5,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:lYe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:fZt},{key:"Mod-Alt-g",run:qGt},{key:"Mod-d",run:tZt,preventDefault:!0}];class mZt{constructor(t){this.view=t;let r=this.query=t.state.field(zb).query.spec;this.commit=this.commit.bind(this),this.searchField=Ca("input",{value:r.search,placeholder:xd(t,"Find"),"aria-label":xd(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ca("input",{value:r.replace,placeholder:xd(t,"Replace"),"aria-label":xd(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ca("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=Ca("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=Ca("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(s,a,i){return Ca("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=Ca("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>e5(t),[xd(t,"next")]),n("prev",()=>t5(t),[xd(t,"previous")]),n("select",()=>dZt(t),[xd(t,"all")]),Ca("label",null,[this.caseField,xd(t,"match case")]),Ca("label",null,[this.reField,xd(t,"regexp")]),Ca("label",null,[this.wordField,xd(t,"by word")]),...t.state.readOnly?[]:[Ca("br"),this.replaceField,n("replace",()=>Zke(t),[xd(t,"replace")]),n("replaceAll",()=>hZt(t),[xd(t,"replace all")])],Ca("button",{name:"close",onclick:()=>lYe(t),"aria-label":xd(t,"close"),type:"button"},["×"])])}commit(){let t=new nYe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:AA.of(t)}))}keydown(t){B7t(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?t5:e5)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Zke(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(AA)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(QE).top}}function xd(e,t){return e.state.phrase(t)}const sD=30,aD=/[\s\.,:;?!]/;function ede(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),s=e.state.doc.lineAt(r).to,a=Math.max(n.from,t-sD),i=Math.min(s,r+sD),l=e.state.sliceDoc(a,i);if(a!=n.from){for(let c=0;c<sD;c++)if(!aD.test(l[c+1])&&aD.test(l[c])){l=l.slice(c);break}}if(i!=s){for(let c=l.length-1;c>l.length-sD;c--)if(!aD.test(l[c-1])&&aD.test(l[c])){l=l.slice(0,c);break}}return ft.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${n.number}.`)}const gZt=ft.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),yZt=[zb,Rp.low(uZt),gZt];class Yke{constructor(t,r,n){this.from=t,this.to=r,this.diagnostic=n}}class pw{constructor(t,r,n){this.diagnostics=t,this.panel=r,this.selected=n}static init(t,r,n){let s=n.facet(IA).markerFilter;s&&(t=s(t,n));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new nu,l=[],c=0;for(let d=0;;){let f=d==a.length?null:a[d];if(!f&&!l.length)break;let h,p;for(l.length?(h=c,p=l.reduce((g,y)=>Math.min(g,y.to),f&&f.from>h?f.from:1e8)):(h=f.from,p=f.to,l.push(f),d++);d<a.length;){let g=a[d];if(g.from==h&&(g.to>g.from||g.to==h))l.push(g),d++,p=Math.min(g.to,p);else{p=Math.min(g.from,p);break}}let m=NZt(l);if(l.some(g=>g.from==g.to||g.from==g.to-1&&n.doc.lineAt(g.from).to==g.from))i.add(h,h,er.widget({widget:new EZt(m),diagnostics:l.slice()}));else{let g=l.reduce((y,x)=>x.markClass?y+" "+x.markClass:y,"");i.add(h,p,er.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:l.slice(),inclusiveEnd:l.some(y=>y.to>p)}))}c=p;for(let g=0;g<l.length;g++)l[g].to<=c&&l.splice(g--,1)}let u=i.finish();return new pw(u,r,I_(u))}}function I_(e,t=null,r=0){let n=null;return e.between(r,1e9,(s,a,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!n)n=new Yke(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new Yke(n.from,a,n.diagnostic)}}),n}function vZt(e,t){let r=t.pos,n=t.end||r,s=e.state.facet(IA).hideOn(e,r,n);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(cYe))||e.changes.touchesRange(a.from,Math.max(a.to,n)))}function bZt(e,t){return e.field(Ud,!1)?t:t.concat(rn.appendConfig.of(AZt))}const cYe=rn.define(),tde=rn.define(),uYe=rn.define(),Ud=Oo.define({create(){return new pw(er.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let r=e.diagnostics.map(t.changes),n=null,s=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);n=I_(r,e.selected.diagnostic,a)||I_(r,null,a)}!r.size&&s&&t.state.facet(IA).autoPanel&&(s=null),e=new pw(r,s,n)}for(let r of t.effects)if(r.is(cYe)){let n=t.state.facet(IA).autoPanel?r.value.length?RA.open:null:e.panel;e=pw.init(r.value,n,t.state)}else r.is(tde)?e=new pw(e.diagnostics,r.value?RA.open:null,e.selected):r.is(uYe)&&(e=new pw(e.diagnostics,e.panel,r.value));return e},provide:e=>[xA.from(e,t=>t.panel),ft.decorations.from(e,t=>t.diagnostics)]}),xZt=er.mark({class:"cm-lintRange cm-lintRange-active"});function wZt(e,t,r){let{diagnostics:n}=e.state.field(Ud),s,a=-1,i=-1;n.between(t-(r<0?1:0),t+(r>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||r>0)&&(t<u||r<0)))return s=d.diagnostics,a=c,i=u,!1});let l=e.state.facet(IA).tooltipFilter;return s&&l&&(s=l(s,e.state)),s?{pos:a,end:i,above:e.state.doc.lineAt(a).to<i,create(){return{dom:SZt(e,s)}}}:null}function SZt(e,t){return Ca("ul",{class:"cm-tooltip-lint"},t.map(r=>fYe(e,r,!1)))}const OZt=e=>{let t=e.state.field(Ud,!1);(!t||!t.panel)&&e.dispatch({effects:bZt(e.state,[tde.of(!0)])});let r=pue(e,RA.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},Xke=e=>{let t=e.state.field(Ud,!1);return!t||!t.panel?!1:(e.dispatch({effects:tde.of(!1)}),!0)},kZt=e=>{let t=e.state.field(Ud,!1);if(!t)return!1;let r=e.state.selection.main,n=t.diagnostics.iter(r.to+1);return!n.value&&(n=t.diagnostics.iter(0),!n.value||n.from==r.from&&n.to==r.to)?!1:(e.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},_Zt=[{key:"Mod-Shift-m",run:OZt,preventDefault:!0},{key:"F8",run:kZt}],IA=Kt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...mg(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Kke,tooltipFilter:Kke,needsRefresh:(t,r)=>t?r?n=>t(n)||r(n):t:r,hideOn:(t,r)=>t?r?(n,s,a)=>t(n,s,a)||r(n,s,a):t:r,autoPanel:(t,r)=>t||r})}}});function Kke(e,t){return e?t?(r,n)=>t(e(r,n),n):e:t}function dYe(e){let t=[];if(e)e:for(let{name:r}of e){for(let n=0;n<r.length;n++){let s=r[n];if(/[a-zA-Z]/.test(s)&&!t.some(a=>a.toLowerCase()==s.toLowerCase())){t.push(s);continue e}}t.push("")}return t}function fYe(e,t,r){var n;let s=r?dYe(t.actions):[];return Ca("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ca("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(n=t.actions)===null||n===void 0?void 0:n.map((a,i)=>{let l=!1,c=p=>{if(p.preventDefault(),l)return;l=!0;let m=I_(e.state.field(Ud).diagnostics,t);m&&a.apply(e,m.from,m.to)},{name:u}=a,d=s[i]?u.indexOf(s[i]):-1,f=d<0?u:[u.slice(0,d),Ca("u",u.slice(d,d+1)),u.slice(d+1)],h=a.markClass?" "+a.markClass:"";return Ca("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[i]})"`}.`},f)}),t.source&&Ca("div",{class:"cm-diagnosticSource"},t.source))}class EZt extends xf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ca("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Jke{constructor(t,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=fYe(t,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class RA{constructor(t){this.view=t,this.items=[];let r=s=>{if(s.keyCode==27)Xke(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],i=dYe(a.actions);for(let l=0;l<i.length;l++)if(i[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=I_(this.view.state.field(Ud).diagnostics,a);c&&a.actions[l].apply(t,c.from,c.to)}}else return;s.preventDefault()},n=s=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(s.target)&&this.moveSelection(a)};this.list=Ca("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:r,onclick:n}),this.dom=Ca("div",{class:"cm-panel-lint"},this.list,Ca("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Xke(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Ud).selected;if(!t)return-1;for(let r=0;r<this.items.length;r++)if(this.items[r].diagnostic==t.diagnostic)return r;return-1}update(){let{diagnostics:t,selected:r}=this.view.state.field(Ud),n=0,s=!1,a=null,i=new Set;for(t.between(0,this.view.state.doc.length,(l,c,{spec:u})=>{for(let d of u.diagnostics){if(i.has(d))continue;i.add(d);let f=-1,h;for(let p=n;p<this.items.length;p++)if(this.items[p].diagnostic==d){f=p;break}f<0?(h=new Jke(this.view,d),this.items.splice(n,0,h),s=!0):(h=this.items[f],f>n&&(this.items.splice(n,f-n),s=!0)),r&&h.diagnostic==r.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),a=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new Jke(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/u:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let t=this.list.firstChild;function r(){let n=t;t=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;t!=n.dom;)r();t=n.dom.nextSibling}else this.list.insertBefore(n.dom,t);for(;t;)r()}moveSelection(t){if(this.selectedIndex<0)return;let r=this.view.state.field(Ud),n=I_(r.diagnostics,this.items[t].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:uYe.of(n)})}static open(t){return new RA(t)}}function CZt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function iD(e){return CZt(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const jZt=ft.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:iD("#d11")},".cm-lintRange-warning":{backgroundImage:iD("orange")},".cm-lintRange-info":{backgroundImage:iD("#999")},".cm-lintRange-hint":{backgroundImage:iD("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function TZt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function NZt(e){let t="hint",r=1;for(let n of e){let s=TZt(n.severity);s>r&&(r=s,t=n.severity)}return t}const AZt=[Ud,ft.decorations.compute([Ud],e=>{let{selected:t,panel:r}=e.field(Ud);return!t||!r||t.from==t.to?er.none:er.set([xZt.range(t.from,t.to)])}),jUt(wZt,{hideOn:vZt}),jZt];var e_e=function(t){t===void 0&&(t={});var{crosshairCursor:r=!1}=t,n=[];t.closeBracketsKeymap!==!1&&(n=n.concat(_qt)),t.defaultKeymap!==!1&&(n=n.concat(BGt)),t.searchKeymap!==!1&&(n=n.concat(pZt)),t.historyKeymap!==!1&&(n=n.concat(GWt)),t.foldKeymap!==!1&&(n=n.concat(uVt)),t.completionKeymap!==!1&&(n=n.concat(JWe)),t.lintKeymap!==!1&&(n=n.concat(_Zt));var s=[];return t.lineNumbers!==!1&&s.push(zUt()),t.highlightActiveLineGutter!==!1&&s.push(VUt()),t.highlightSpecialChars!==!1&&s.push(nUt()),t.history!==!1&&s.push(FWt()),t.foldGutter!==!1&&s.push(pVt()),t.drawSelection!==!1&&s.push(W7t()),t.dropCursor!==!1&&s.push(K7t()),t.allowMultipleSelections!==!1&&s.push(zn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(rVt()),t.syntaxHighlighting!==!1&&s.push(Wx(vVt,{fallback:!0})),t.bracketMatching!==!1&&s.push(_Vt()),t.closeBrackets!==!1&&s.push(wqt()),t.autocompletion!==!1&&s.push(KWe()),t.rectangularSelection!==!1&&s.push(yUt()),r!==!1&&s.push(xUt()),t.highlightActiveLine!==!1&&s.push(cUt()),t.highlightSelectionMatches!==!1&&s.push(WGt()),t.tabSize&&typeof t.tabSize=="number"&&s.push(UE.of(" ".repeat(t.tabSize))),s.concat([BE.of(n.flat())]).filter(Boolean)};const IZt="#e5c07b",t_e="#e06c75",RZt="#56b6c2",PZt="#ffffff",d$="#abb2bf",cse="#7d8799",MZt="#61afef",DZt="#98c379",r_e="#d19a66",LZt="#c678dd",$Zt="#21252b",n_e="#2c313a",s_e="#282c34",kV="#353a42",FZt="#3E4451",a_e="#528bff",zZt=ft.theme({"&":{color:d$,backgroundColor:s_e},".cm-content":{caretColor:a_e},".cm-cursor, .cm-dropCursor":{borderLeftColor:a_e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:FZt},".cm-panels":{backgroundColor:$Zt,color:d$},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:s_e,color:cse,border:"none"},".cm-activeLineGutter":{backgroundColor:n_e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:kV},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:kV,borderBottomColor:kV},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:n_e,color:d$}}},{dark:!0}),BZt=Pp.define([{tag:ne.keyword,color:LZt},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:t_e},{tag:[ne.function(ne.variableName),ne.labelName],color:MZt},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:r_e},{tag:[ne.definition(ne.name),ne.separator],color:d$},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:IZt},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:RZt},{tag:[ne.meta,ne.comment],color:cse},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:cse,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:t_e},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:r_e},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:DZt},{tag:ne.invalid,color:PZt}]),UZt=[zZt,Wx(BZt)];var VZt=ft.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),qZt=function(t){t===void 0&&(t={});var{indentWithTab:r=!0,editable:n=!0,readOnly:s=!1,theme:a="light",placeholder:i="",basicSetup:l=!0}=t,c=[];switch(r&&c.unshift(BE.of([UGt])),l&&(typeof l=="boolean"?c.unshift(e_e()):c.unshift(e_e(l))),i&&c.unshift(hUt(i)),a){case"light":c.push(VZt);break;case"dark":c.push(UZt);break;case"none":break;default:c.push(a);break}return n===!1&&c.push(ft.editable.of(!1)),s&&c.push(zn.readOnly.of(!0)),[...c]},HZt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class QZt{constructor(t,r){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=r,this.timeoutMS=r,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(r=>{try{r()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}let i_e=class{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}};var _V=null,WZt=()=>typeof window>"u"?new i_e:(_V||(_V=new i_e),_V),o_e=pg.define(),GZt=200,ZZt=[];function YZt(e){var{value:t,selection:r,onChange:n,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:l=ZZt,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:h=null,width:p=null,minWidth:m=null,maxWidth:g=null,placeholder:y="",editable:x=!0,readOnly:w=!1,indentWithTab:S=!0,basicSetup:k=!0,root:_,initialState:E}=e,[T,j]=b.useState(),[N,I]=b.useState(),[P,R]=b.useState(),B=b.useState(()=>({current:null}))[0],D=b.useState(()=>({current:null}))[0],$=ft.theme({"&":{height:d,minHeight:f,maxHeight:h,width:p,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),U=ft.updateListener.of(Q=>{if(Q.docChanged&&typeof n=="function"&&!Q.transactions.some(V=>V.annotation(o_e))){B.current?B.current.reset():(B.current=new QZt(()=>{if(D.current){var V=D.current;D.current=null,V()}B.current=null},GZt),WZt().add(B.current));var L=Q.state.doc,Z=L.toString();n(Z,Q)}s&&s(HZt(Q))}),z=qZt({theme:u,editable:x,readOnly:w,placeholder:y,indentWithTab:S,basicSetup:k}),H=[U,$,...z];return i&&typeof i=="function"&&H.push(ft.updateListener.of(i)),H=H.concat(l),b.useLayoutEffect(()=>{if(T&&!P){var Q={doc:t,selection:r,extensions:H},L=E?zn.fromJSON(E.json,Q,E.fields):zn.create(Q);if(R(L),!N){var Z=new ft({state:L,parent:T,root:_});I(Z),a&&a(Z,L)}}return()=>{N&&(R(void 0),I(void 0))}},[T,P]),b.useEffect(()=>{e.container&&j(e.container)},[e.container]),b.useEffect(()=>()=>{N&&(N.destroy(),I(void 0)),B.current&&(B.current.cancel(),B.current=null)},[N]),b.useEffect(()=>{c&&N&&N.focus()},[c,N]),b.useEffect(()=>{N&&N.dispatch({effects:rn.reconfigure.of(H)})},[u,l,d,f,h,p,m,g,y,x,w,S,k,n,i]),b.useEffect(()=>{if(t!==void 0){var Q=N?N.state.doc.toString():"";if(N&&t!==Q){var L=B.current&&!B.current.isDone,Z=()=>{N&&t!==N.state.doc.toString()&&N.dispatch({changes:{from:0,to:N.state.doc.toString().length,insert:t||""},annotations:[o_e.of(!0)]})};L?D.current=Z:Z()}}},[t,N]),{state:P,setState:R,view:N,setView:I,container:T,setContainer:j}}var XZt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vc=b.forwardRef((e,t)=>{var{className:r,value:n="",selection:s,extensions:a=[],onChange:i,onStatistics:l,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:f="light",height:h,minHeight:p,maxHeight:m,width:g,minWidth:y,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:k,editable:_,readOnly:E,root:T,initialState:j}=e,N=Wue(e,XZt),I=b.useRef(null),{state:P,view:R,container:B,setContainer:D}=YZt({root:T,value:n,autoFocus:d,theme:f,height:h,minHeight:p,maxHeight:m,width:g,minWidth:y,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:k,editable:_,readOnly:E,selection:s,onChange:i,onStatistics:l,onCreateEditor:c,onUpdate:u,extensions:a,initialState:j});b.useImperativeHandle(t,()=>({editor:I.current,state:P,view:R}),[I,B,P,R]);var $=b.useCallback(z=>{I.current=z,D(z)},[D]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var U=typeof f=="string"?"cm-theme-"+f:"cm-theme";return o.jsx("div",vx({ref:$,className:""+U+(r?" "+r:"")},N))});vc.displayName="CodeMirror";function KZt(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const JZt=e=>{switch(e){case"success":return rYt;case"info":return sYt;case"warning":return nYt;case"error":return aYt;default:return null}},eYt=Array(12).fill(0),tYt=({visible:e,className:t})=>je.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},je.createElement("div",{className:"sonner-spinner"},eYt.map((r,n)=>je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),rYt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.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"})),nYt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},je.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"})),sYt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.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"})),aYt=je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},je.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"})),iYt=je.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"},je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),oYt=()=>{const[e,t]=je.useState(document.hidden);return je.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let use=1;class lYt{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,a=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:use++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const l=s.then(async u=>{if(i=["resolve",u],je.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(uYt(u)&&!u.ok){a=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,h=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...m})}else if(u instanceof Error){a=!1;const f=typeof r.error=="function"?await r.error(u):r.error,h=typeof r.description=="function"?await r.description(u):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...m})}else if(r.success!==void 0){a=!1;const f=typeof r.success=="function"?await r.success(u):r.success,h=typeof r.description=="function"?await r.description(u):r.description,m=typeof f=="object"&&!je.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:h,...m})}}).catch(async u=>{if(i=["reject",u],r.error!==void 0){a=!1;const d=typeof r.error=="function"?await r.error(u):r.error,f=typeof r.description=="function"?await r.description(u):r.description,p=typeof d=="object"&&!je.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:f,...p})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((u,d)=>l.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=r?.id||use++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Eu=new lYt,cYt=(e,t)=>{const r=t?.id||use++;return Eu.addToast({title:e,...t,id:r}),r},uYt=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",dYt=cYt,fYt=()=>Eu.toasts,hYt=()=>Eu.getActiveToasts(),mc=Object.assign(dYt,{success:Eu.success,info:Eu.info,warning:Eu.warning,error:Eu.error,custom:Eu.custom,message:Eu.message,promise:Eu.promise,dismiss:Eu.dismiss,loading:Eu.loading},{getHistory:fYt,getToasts:hYt});KZt("[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 oD(e){return e.label!==void 0}const pYt=3,mYt="24px",gYt="16px",l_e=4e3,yYt=356,vYt=14,bYt=45,xYt=200;function em(...e){return e.filter(Boolean).join(" ")}function wYt(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const SYt=e=>{var t,r,n,s,a,i,l,c,u;const{invert:d,toast:f,unstyled:h,interacting:p,setHeights:m,visibleToasts:g,heights:y,index:x,toasts:w,expanded:S,removeToast:k,defaultRichColors:_,closeButton:E,style:T,cancelButtonStyle:j,actionButtonStyle:N,className:I="",descriptionClassName:P="",duration:R,position:B,gap:D,expandByDefault:$,classNames:U,icons:z,closeButtonAriaLabel:H="Close toast"}=e,[Q,L]=je.useState(null),[Z,V]=je.useState(null),[M,W]=je.useState(!1),[G,J]=je.useState(!1),[ae,te]=je.useState(!1),[re,ie]=je.useState(!1),[he,X]=je.useState(!1),[se,le]=je.useState(0),[xe,de]=je.useState(0),ue=je.useRef(f.duration||R||l_e),ve=je.useRef(null),we=je.useRef(null),Ne=x===0,K=x+1<=g,oe=f.type,be=f.dismissible!==!1,Ae=f.className||"",$e=f.descriptionClassName||"",ye=je.useMemo(()=>y.findIndex(tt=>tt.toastId===f.id)||0,[y,f.id]),ke=je.useMemo(()=>{var tt;return(tt=f.closeButton)!=null?tt:E},[f.closeButton,E]),ge=je.useMemo(()=>f.duration||R||l_e,[f.duration,R]),Ee=je.useRef(0),Fe=je.useRef(0),ct=je.useRef(0),wt=je.useRef(null),[lr,Ve]=B.split("-"),qe=je.useMemo(()=>y.reduce((tt,Jt,Tr)=>Tr>=ye?tt:tt+Jt.height,0),[y,ye]),Ie=oYt(),Le=f.invert||d,Re=oe==="loading";Fe.current=je.useMemo(()=>ye*D+qe,[ye,qe]),je.useEffect(()=>{ue.current=ge},[ge]),je.useEffect(()=>{W(!0)},[]),je.useEffect(()=>{const tt=we.current;if(tt){const Jt=tt.getBoundingClientRect().height;return de(Jt),m(Tr=>[{toastId:f.id,height:Jt,position:f.position},...Tr]),()=>m(Tr=>Tr.filter(ir=>ir.toastId!==f.id))}},[m,f.id]),je.useLayoutEffect(()=>{if(!M)return;const tt=we.current,Jt=tt.style.height;tt.style.height="auto";const Tr=tt.getBoundingClientRect().height;tt.style.height=Jt,de(Tr),m(ir=>ir.find(Ur=>Ur.toastId===f.id)?ir.map(Ur=>Ur.toastId===f.id?{...Ur,height:Tr}:Ur):[{toastId:f.id,height:Tr,position:f.position},...ir])},[M,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const it=je.useCallback(()=>{J(!0),le(Fe.current),m(tt=>tt.filter(Jt=>Jt.toastId!==f.id)),setTimeout(()=>{k(f)},xYt)},[f,k,m,Fe]);je.useEffect(()=>{if(f.promise&&oe==="loading"||f.duration===1/0||f.type==="loading")return;let tt;return S||p||Ie?(()=>{if(ct.current<Ee.current){const ir=new Date().getTime()-Ee.current;ue.current=ue.current-ir}ct.current=new Date().getTime()})():ue.current!==1/0&&(Ee.current=new Date().getTime(),tt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),it()},ue.current)),()=>clearTimeout(tt)},[S,p,f,oe,Ie,it]),je.useEffect(()=>{f.delete&&(it(),f.onDismiss==null||f.onDismiss.call(f,f))},[it,f.delete]);function rt(){var tt;if(z?.loading){var Jt;return je.createElement("div",{className:em(U?.loader,f==null||(Jt=f.classNames)==null?void 0:Jt.loader,"sonner-loader"),"data-visible":oe==="loading"},z.loading)}return je.createElement(tYt,{className:em(U?.loader,f==null||(tt=f.classNames)==null?void 0:tt.loader),visible:oe==="loading"})}const ht=f.icon||z?.[oe]||JZt(oe);var Ut,$r;return je.createElement("li",{tabIndex:0,ref:we,className:em(I,Ae,U?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,U?.default,U?.[oe],f==null||(r=f.classNames)==null?void 0:r[oe]),"data-sonner-toast":"","data-rich-colors":(Ut=f.richColors)!=null?Ut:_,"data-styled":!(f.jsx||f.unstyled||h),"data-mounted":M,"data-promise":!!f.promise,"data-swiped":he,"data-removed":G,"data-visible":K,"data-y-position":lr,"data-x-position":Ve,"data-index":x,"data-front":Ne,"data-swiping":ae,"data-dismissible":be,"data-type":oe,"data-invert":Le,"data-swipe-out":re,"data-swipe-direction":Z,"data-expanded":!!(S||$&&M),"data-testid":f.testId,style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${G?se:Fe.current}px`,"--initial-height":$?"auto":`${xe}px`,...T,...f.style},onDragEnd:()=>{te(!1),L(null),wt.current=null},onPointerDown:tt=>{tt.button!==2&&(Re||!be||(ve.current=new Date,le(Fe.current),tt.target.setPointerCapture(tt.pointerId),tt.target.tagName!=="BUTTON"&&(te(!0),wt.current={x:tt.clientX,y:tt.clientY})))},onPointerUp:()=>{var tt,Jt,Tr;if(re||!be)return;wt.current=null;const ir=Number(((tt=we.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((Jt=we.current)==null?void 0:Jt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ur=new Date().getTime()-((Tr=ve.current)==null?void 0:Tr.getTime()),It=Q==="x"?ir:$n,wn=Math.abs(It)/Ur;if(Math.abs(It)>=bYt||wn>.11){le(Fe.current),f.onDismiss==null||f.onDismiss.call(f,f),V(Q==="x"?ir>0?"right":"left":$n>0?"down":"up"),it(),ie(!0);return}else{var Er,Oe;(Er=we.current)==null||Er.style.setProperty("--swipe-amount-x","0px"),(Oe=we.current)==null||Oe.style.setProperty("--swipe-amount-y","0px")}X(!1),te(!1),L(null)},onPointerMove:tt=>{var Jt,Tr,ir;if(!wt.current||!be||((Jt=window.getSelection())==null?void 0:Jt.toString().length)>0)return;const Ur=tt.clientY-wt.current.y,It=tt.clientX-wt.current.x;var wn;const Er=(wn=e.swipeDirections)!=null?wn:wYt(B);!Q&&(Math.abs(It)>1||Math.abs(Ur)>1)&&L(Math.abs(It)>Math.abs(Ur)?"x":"y");let Oe={x:0,y:0};const Me=Ue=>1/(1.5+Math.abs(Ue)/20);if(Q==="y"){if(Er.includes("top")||Er.includes("bottom"))if(Er.includes("top")&&Ur<0||Er.includes("bottom")&&Ur>0)Oe.y=Ur;else{const Ue=Ur*Me(Ur);Oe.y=Math.abs(Ue)<Math.abs(Ur)?Ue:Ur}}else if(Q==="x"&&(Er.includes("left")||Er.includes("right")))if(Er.includes("left")&&It<0||Er.includes("right")&&It>0)Oe.x=It;else{const Ue=It*Me(It);Oe.x=Math.abs(Ue)<Math.abs(It)?Ue:It}(Math.abs(Oe.x)>0||Math.abs(Oe.y)>0)&&X(!0),(Tr=we.current)==null||Tr.style.setProperty("--swipe-amount-x",`${Oe.x}px`),(ir=we.current)==null||ir.style.setProperty("--swipe-amount-y",`${Oe.y}px`)}},ke&&!f.jsx&&oe!=="loading"?je.createElement("button",{"aria-label":H,"data-disabled":Re,"data-close-button":!0,onClick:Re||!be?()=>{}:()=>{it(),f.onDismiss==null||f.onDismiss.call(f,f)},className:em(U?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},($r=z?.close)!=null?$r:iYt):null,(oe||f.icon||f.promise)&&f.icon!==null&&(z?.[oe]!==null||f.icon)?je.createElement("div",{"data-icon":"",className:em(U?.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||rt():null,f.type!=="loading"?ht:null):null,je.createElement("div",{"data-content":"",className:em(U?.content,f==null||(a=f.classNames)==null?void 0:a.content)},je.createElement("div",{"data-title":"",className:em(U?.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?je.createElement("div",{"data-description":"",className:em(P,$e,U?.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),je.isValidElement(f.cancel)?f.cancel:f.cancel&&oD(f.cancel)?je.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:tt=>{oD(f.cancel)&&be&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,tt),it())},className:em(U?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,je.isValidElement(f.action)?f.action:f.action&&oD(f.action)?je.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||N,onClick:tt=>{oD(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,tt),!tt.defaultPrevented&&it())},className:em(U?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function c_e(){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 OYt(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?gYt:mYt;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=l:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}const hYe=je.forwardRef(function(t,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:m,style:g,visibleToasts:y=pYt,toastOptions:x,dir:w=c_e(),gap:S=vYt,icons:k,containerAriaLabel:_="Notifications"}=t,[E,T]=je.useState([]),j=je.useMemo(()=>n?E.filter(M=>M.toasterId===n):E.filter(M=>!M.toasterId),[E,n]),N=je.useMemo(()=>Array.from(new Set([a].concat(j.filter(M=>M.position).map(M=>M.position)))),[j,a]),[I,P]=je.useState([]),[R,B]=je.useState(!1),[D,$]=je.useState(!1),[U,z]=je.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=je.useRef(null),Q=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=je.useRef(null),Z=je.useRef(!1),V=je.useCallback(M=>{T(W=>{var G;return(G=W.find(J=>J.id===M.id))!=null&&G.delete||Eu.dismiss(M.id),W.filter(({id:J})=>J!==M.id)})},[]);return je.useEffect(()=>Eu.subscribe(M=>{if(M.dismiss){requestAnimationFrame(()=>{T(W=>W.map(G=>G.id===M.id?{...G,delete:!0}:G))});return}setTimeout(()=>{hce.flushSync(()=>{T(W=>{const G=W.findIndex(J=>J.id===M.id);return G!==-1?[...W.slice(0,G),{...W[G],...M},...W.slice(G+1)]:[M,...W]})})})}),[E]),je.useEffect(()=>{if(h!=="system"){z(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:W})=>{z(W?"dark":"light")})}catch{M.addListener(({matches:G})=>{try{z(G?"dark":"light")}catch(J){console.error(J)}})}},[h]),je.useEffect(()=>{E.length<=1&&B(!1)},[E]),je.useEffect(()=>{const M=W=>{var G;if(i.every(te=>W[te]||W.code===te)){var ae;B(!0),(ae=H.current)==null||ae.focus()}W.code==="Escape"&&(document.activeElement===H.current||(G=H.current)!=null&&G.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i]),je.useEffect(()=>{if(H.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Z.current=!1)}},[H.current]),je.createElement("section",{ref:r,"aria-label":`${_} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((M,W)=>{var G;const[J,ae]=M.split("-");return j.length?je.createElement("ol",{key:M,dir:w==="auto"?c_e():w,tabIndex:-1,ref:H,className:u,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":J,"data-x-position":ae,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${yYt}px`,"--gap":`${S}px`,...g,...OYt(d,f)},onBlur:te=>{Z.current&&!te.currentTarget.contains(te.relatedTarget)&&(Z.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,L.current=te.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{D||B(!1)},onDragEnd:()=>B(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},j.filter(te=>!te.position&&W===0||te.position===M).map((te,re)=>{var ie,he;return je.createElement(SYt,{key:te.id,icons:k,index:re,toast:te,defaultRichColors:p,duration:(ie=x?.duration)!=null?ie:m,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:s,visibleToasts:y,closeButton:(he=x?.closeButton)!=null?he:c,interacting:D,position:M,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:V,toasts:j.filter(X=>X.position==te.position),heights:I.filter(X=>X.position==te.position),setHeights:P,expandByDefault:l,gap:S,expanded:R,swipeDirections:t.swipeDirections})})):null}))});var EV="focusScope.autoFocusOnMount",CV="focusScope.autoFocusOnUnmount",u_e={bubbles:!1,cancelable:!0},kYt="FocusScope",WR=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=e,[l,c]=b.useState(null),u=bi(s),d=bi(a),f=b.useRef(null),h=Br(t,g=>c(g)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let g=function(S){if(p.paused||!l)return;const k=S.target;l.contains(k)?f.current=k:db(f.current,{select:!0})},y=function(S){if(p.paused||!l)return;const k=S.relatedTarget;k!==null&&(l.contains(k)||db(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const _ of S)_.removedNodes.length>0&&db(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(x);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[n,l,p.paused]),b.useEffect(()=>{if(l){f_e.add(p);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(EV,u_e);l.addEventListener(EV,u),l.dispatchEvent(x),x.defaultPrevented||(_Yt(NYt(pYe(l)),{select:!0}),document.activeElement===g&&db(l))}return()=>{l.removeEventListener(EV,u),setTimeout(()=>{const x=new CustomEvent(CV,u_e);l.addEventListener(CV,d),l.dispatchEvent(x),x.defaultPrevented||db(g??document.body,{select:!0}),l.removeEventListener(CV,d),f_e.remove(p)},0)}}},[l,u,d,p]);const m=b.useCallback(g=>{if(!r&&!n||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const w=g.currentTarget,[S,k]=EYt(w);S&&k?!g.shiftKey&&x===k?(g.preventDefault(),r&&db(S,{select:!0})):g.shiftKey&&x===S&&(g.preventDefault(),r&&db(k,{select:!0})):x===w&&g.preventDefault()}},[r,n,p.paused]);return o.jsx(wr.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});WR.displayName=kYt;function _Yt(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(db(n,{select:t}),document.activeElement!==r)return}function EYt(e){const t=pYe(e),r=d_e(t,e),n=d_e(t.reverse(),e);return[r,n]}function pYe(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function d_e(e,t){for(const r of e)if(!CYt(r,{upTo:t}))return r}function CYt(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 jYt(e){return e instanceof HTMLInputElement&&"select"in e}function db(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&jYt(e)&&t&&e.select()}}var f_e=TYt();function TYt(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=h_e(e,t),e.unshift(t)},remove(t){e=h_e(e,t),e[0]?.resume()}}}function h_e(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function NYt(e){return e.filter(t=>t.tagName!=="A")}var jV=0;function QF(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??p_e()),document.body.insertAdjacentElement("beforeend",e[1]??p_e()),jV++,()=>{jV===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jV--}},[])}function p_e(){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 xm=function(){return xm=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xm.apply(this,arguments)};function mYe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function AYt(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,a;n<s;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var f$="right-scroll-bar-position",h$="width-before-scroll-bar",IYt="with-scroll-bars-hidden",RYt="--removed-body-scroll-bar-size";function TV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function PYt(e,t){var r=b.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var MYt=typeof window<"u"?b.useLayoutEffect:b.useEffect,m_e=new WeakMap;function DYt(e,t){var r=PYt(null,function(n){return e.forEach(function(s){return TV(s,n)})});return MYt(function(){var n=m_e.get(r);if(n){var s=new Set(n),a=new Set(e),i=r.current;s.forEach(function(l){a.has(l)||TV(l,null)}),a.forEach(function(l){s.has(l)||TV(l,i)})}m_e.set(r,e)},[e]),r}function LYt(e){return e}function $Yt(e,t){t===void 0&&(t=LYt);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(a),i=r}var c=function(){var d=i;i=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),r}}}};return s}function FYt(e){e===void 0&&(e={});var t=$Yt(null);return t.options=xm({async:!0,ssr:!1},e),t}var gYe=function(e){var t=e.sideCar,r=mYe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,xm({},r))};gYe.isSideCarExport=!0;function zYt(e,t){return e.useMedium(t),gYe}var yYe=FYt(),NV=function(){},WF=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:NV,onWheelCapture:NV,onTouchMoveCapture:NV}),s=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,k=mYe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,E=DYt([r,t]),T=xm(xm({},k),s);return b.createElement(b.Fragment,null,d&&b.createElement(_,{sideCar:yYe,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:S}),i?b.cloneElement(b.Children.only(l),xm(xm({},T),{ref:E})):b.createElement(w,xm({},T,{className:c,ref:E}),l))});WF.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};WF.classNames={fullWidth:h$,zeroRight:f$};var BYt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UYt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=BYt();return t&&e.setAttribute("nonce",t),e}function VYt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qYt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var HYt=function(){var e=0,t=null;return{add:function(r){e==0&&(t=UYt())&&(VYt(t,r),qYt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QYt=function(){var e=HYt();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},vYe=function(){var e=QYt(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},WYt={left:0,top:0,right:0,gap:0},AV=function(e){return parseInt(e||"",10)||0},GYt=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[AV(r),AV(n),AV(s)]},ZYt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return WYt;var t=GYt(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},YYt=vYe(),Vk="data-scroll-locked",XYt=function(e,t,r,n){var s=e.left,a=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
117
117
  .`.concat(IYt,` {
118
118
  overflow: hidden `).concat(n,`;
@@ -290,7 +290,7 @@ ${J.current.stack}
290
290
  A`,",",",0,",",",",",",",`
291
291
  A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(d<0),E.x,E.y,n,n,+(N>180),+(d>0),S.x,S.y,a,a,+(d<0),k.x,k.y)}else w+=Qi(aNe||(aNe=Ow(["L",",","Z"])),t,r);return w},OOr={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},wit=e=>{var t=nd(e,OOr),{cx:r,cy:n,innerRadius:s,outerRadius:a,cornerRadius:i,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(a<s||u===d)return null;var h=wa("recharts-sector",f),p=a-s,m=wx(i,p,0,!0),g;return m>0&&Math.abs(u-d)<360?g=SOr({cx:r,cy:n,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=xit({cx:r,cy:n,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d}),b.createElement("path",Iae({},su(t),{className:h,d:g}))};function kOr(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(aat(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:a,outerRadius:i,angle:l}=t,c=Ul(n,s,a,l),u=Ul(n,s,i,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return bit(t)}}var RH={},PH={},MH={},iNe;function _Or(){return iNe||(iNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mat();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(MH)),MH}var oNe;function EOr(){return oNe||(oNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_Or();function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(PH)),PH}var lNe;function COr(){return lNe||(lNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gat(),r=EOr();function n(s,a,i){i&&typeof i!="number"&&t.isIterateeCall(s,a,i)&&(a=i=void 0),s=r.toFinite(s),a===void 0?(a=s,s=0):a=r.toFinite(a),i=i===void 0?s<a?1:-1:r.toFinite(i);const l=Math.max(Math.ceil((a-s)/(i||1)),0),c=new Array(l);for(let u=0;u<l;u++)c[u]=s,s+=i;return c}e.range=n})(RH)),RH}var DH,cNe;function jOr(){return cNe||(cNe=1,DH=COr().range),DH}var TOr=jOr();const Sit=Uo(TOr);var t0=e=>e.chartData,NOr=Xe([t0],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),jhe=(e,t,r,n)=>n?NOr(e):t0(e);function qm(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(zs(t)&&zs(r))return!0}return!1}function uNe(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function Oit(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,s,a;if(zs(r))s=r;else if(typeof r=="function")return;if(zs(n))a=n;else if(typeof n=="function")return;var i=[s,a];if(qm(i))return i}}function AOr(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(qm(n))return uNe(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[s,a]=e,i,l;if(s==="auto")t!=null&&(i=Math.min(...t));else if(qr(s))i=s;else if(typeof s=="function")try{t!=null&&(i=s(t?.[0]))}catch{}else if(typeof s=="string"&&aTe.test(s)){var c=aTe.exec(s);if(c==null||c[1]==null||t==null)i=void 0;else{var u=+c[1];i=t[0]-u}}else i=t?.[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(qr(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t?.[1]))}catch{}else if(typeof a=="string"&&iTe.test(a)){var d=iTe.exec(a);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[1]+f}}else l=t?.[1];var h=[i,l];if(qm(h))return t==null?h:uNe(h,t,r)}}}var rC=1e9,IOr={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Nhe,wi=!0,kh="[DecimalError] ",Bw=kh+"Invalid argument: ",The=kh+"Exponent out of range: ",nC=Math.floor,aw=Math.pow,ROr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$d,fl=1e7,ui=7,kit=9007199254740991,a4=nC(kit/ui),hr={};hr.absoluteValue=hr.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};hr.comparedTo=hr.cmp=function(e){var t,r,n,s,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(n=a.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===s?0:n>s^a.s<0?1:-1};hr.decimalPlaces=hr.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ui;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};hr.dividedBy=hr.div=function(e){return Py(this,new this.constructor(e))};hr.dividedToIntegerBy=hr.idiv=function(e){var t=this,r=t.constructor;return Fa(Py(t,new r(e),0,1),r.precision)};hr.equals=hr.eq=function(e){return!this.cmp(e)};hr.exponent=function(){return Lo(this)};hr.greaterThan=hr.gt=function(e){return this.cmp(e)>0};hr.greaterThanOrEqualTo=hr.gte=function(e){return this.cmp(e)>=0};hr.isInteger=hr.isint=function(){return this.e>this.d.length-2};hr.isNegative=hr.isneg=function(){return this.s<0};hr.isPositive=hr.ispos=function(){return this.s>0};hr.isZero=function(){return this.s===0};hr.lessThan=hr.lt=function(e){return this.cmp(e)<0};hr.lessThanOrEqualTo=hr.lte=function(e){return this.cmp(e)<1};hr.logarithm=hr.log=function(e){var t,r=this,n=r.constructor,s=n.precision,a=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($d))throw Error(kh+"NaN");if(r.s<1)throw Error(kh+(r.s?"NaN":"-Infinity"));return r.eq($d)?new n(0):(wi=!1,t=Py(rI(r,a),rI(e,a),a),wi=!0,Fa(t,s))};hr.minus=hr.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Cit(t,e):_it(t,(e.s=-e.s,e))};hr.modulo=hr.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(kh+"NaN");return r.s?(wi=!1,t=Py(r,e,0,1).times(e),wi=!0,r.minus(t)):Fa(new n(r),s)};hr.naturalExponential=hr.exp=function(){return Eit(this)};hr.naturalLogarithm=hr.ln=function(){return rI(this)};hr.negated=hr.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};hr.plus=hr.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_it(t,e):Cit(t,(e.s=-e.s,e))};hr.precision=hr.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Bw+e);if(t=Lo(s)+1,n=s.d.length-1,r=n*ui+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};hr.squareRoot=hr.sqrt=function(){var e,t,r,n,s,a,i,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(kh+"NaN")}for(e=Lo(l),wi=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Rm(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=nC((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=i=r+3;;)if(a=n,n=a.plus(Py(l,a,i+2)).times(.5),Rm(a.d).slice(0,i)===(t=Rm(n.d)).slice(0,i)){if(t=t.slice(i-3,i+1),s==i&&t=="4999"){if(Fa(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(t!="9999")break;i+=4}return wi=!0,Fa(n,r)};hr.times=hr.mul=function(e){var t,r,n,s,a,i,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=p.length,c<u&&(a=h,h=p,p=a,i=c,c=u,u=i),a=[],i=c+u,n=i;n--;)a.push(0);for(n=u;--n>=0;){for(t=0,s=c+n;s>n;)l=a[s]+p[n]*h[s-n-1]+t,a[s--]=l%fl|0,t=l/fl|0;a[s]=(a[s]+t)%fl|0}for(;!a[--i];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,wi?Fa(e,f.precision):e};hr.toDecimalPlaces=hr.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(rg(e,0,rC),t===void 0?t=n.rounding:rg(t,0,8),Fa(r,e+Lo(r)+1,t))};hr.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=C1(n,!0):(rg(e,0,rC),t===void 0?t=s.rounding:rg(t,0,8),n=Fa(new s(n),e+1,t),r=C1(n,!0,e+1)),r};hr.toFixed=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?C1(s):(rg(e,0,rC),t===void 0?t=a.rounding:rg(t,0,8),n=Fa(new a(s),e+Lo(s)+1,t),r=C1(n.abs(),!1,e+Lo(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};hr.toInteger=hr.toint=function(){var e=this,t=e.constructor;return Fa(new t(e),Lo(e)+1,t.rounding)};hr.toNumber=function(){return+this};hr.toPower=hr.pow=function(e){var t,r,n,s,a,i,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c($d);if(l=new c(l),!l.s){if(e.s<1)throw Error(kh+"Infinity");return l}if(l.eq($d))return l;if(n=c.precision,e.eq($d))return Fa(l,n);if(t=e.e,r=e.d.length-1,i=t>=r,a=l.s,i){if((r=d<0?-d:d)<=kit){for(s=new c($d),t=Math.ceil(n/ui+4),wi=!1;r%2&&(s=s.times(l),fNe(s.d,t)),r=nC(r/2),r!==0;)l=l.times(l),fNe(l.d,t);return wi=!0,e.s<0?new c($d).div(s):Fa(s,n)}}else if(a<0)throw Error(kh+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,wi=!1,s=e.times(rI(l,n+u)),wi=!0,s=Eit(s),s.s=a,s};hr.toPrecision=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?(r=Lo(s),n=C1(s,r<=a.toExpNeg||r>=a.toExpPos)):(rg(e,1,rC),t===void 0?t=a.rounding:rg(t,0,8),s=Fa(new a(s),e,t),r=Lo(s),n=C1(s,e<=r||r<=a.toExpNeg,e)),n};hr.toSignificantDigits=hr.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(rg(e,1,rC),t===void 0?t=n.rounding:rg(t,0,8)),Fa(new n(r),e,t)};hr.toString=hr.valueOf=hr.val=hr.toJSON=hr[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Lo(e),r=e.constructor;return C1(e,t<=r.toExpNeg||t>=r.toExpPos)};function _it(e,t){var r,n,s,a,i,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),wi?Fa(t,f):t;if(c=e.d,u=t.d,i=e.e,s=t.e,c=c.slice(),a=i-s,a){for(a<0?(n=c,a=-a,l=u.length):(n=u,s=i,l=c.length),i=Math.ceil(f/ui),l=i>l?i+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,n=u,u=c,c=n),r=0;a;)r=(c[--a]=c[a]+u[a]+r)/fl|0,c[a]%=fl;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,wi?Fa(t,f):t}function rg(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Bw+e)}function Rm(e){var t,r,n,s=e.length-1,a="",i=e[0];if(s>0){for(a+=i,t=1;t<s;t++)n=e[t]+"",r=ui-n.length,r&&(a+=vb(r)),a+=n;i=e[t],n=i+"",r=ui-n.length,r&&(a+=vb(r))}else if(i===0)return"0";for(;i%10===0;)i/=10;return a+i}var Py=(function(){function e(n,s){var a,i=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+i,n[l]=a%fl|0,i=a/fl|0;return i&&n.unshift(i),n}function t(n,s,a,i){var l,c;if(a!=i)c=a>i?1:-1;else for(l=c=0;l<a;l++)if(n[l]!=s[l]){c=n[l]>s[l]?1:-1;break}return c}function r(n,s,a){for(var i=0;a--;)n[a]-=i,i=n[a]<s[a]?1:0,n[a]=i*fl+n[a]-s[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,a,i){var l,c,u,d,f,h,p,m,g,y,x,w,S,k,_,E,T,j,N=n.constructor,I=n.s==s.s?1:-1,P=n.d,R=s.d;if(!n.s)return new N(n);if(!s.s)throw Error(kh+"Division by zero");for(c=n.e-s.e,T=R.length,_=P.length,p=new N(I),m=p.d=[],u=0;R[u]==(P[u]||0);)++u;if(R[u]>(P[u]||0)&&--c,a==null?w=a=N.precision:i?w=a+(Lo(n)-Lo(s))+1:w=a,w<0)return new N(0);if(w=w/ui+2|0,u=0,T==1)for(d=0,R=R[0],w++;(u<_||d)&&w--;u++)S=d*fl+(P[u]||0),m[u]=S/R|0,d=S%R|0;else{for(d=fl/(R[0]+1)|0,d>1&&(R=e(R,d),P=e(P,d),T=R.length,_=P.length),k=T,g=P.slice(0,T),y=g.length;y<T;)g[y++]=0;j=R.slice(),j.unshift(0),E=R[0],R[1]>=fl/2&&++E;do d=0,l=t(R,g,T,y),l<0?(x=g[0],T!=y&&(x=x*fl+(g[1]||0)),d=x/E|0,d>1?(d>=fl&&(d=fl-1),f=e(R,d),h=f.length,y=g.length,l=t(f,g,h,y),l==1&&(d--,r(f,T<h?j:R,h))):(d==0&&(l=d=1),f=R.slice()),h=f.length,h<y&&f.unshift(0),r(g,f,y),l==-1&&(y=g.length,l=t(R,g,T,y),l<1&&(d++,r(g,T<y?j:R,y))),y=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[y++]=P[k]||0:(g=[P[k]],y=1);while((k++<_||g[0]!==void 0)&&w--)}return m[0]||m.shift(),p.e=c,Fa(p,i?a+Lo(p)+1:a)}})();function Eit(e,t){var r,n,s,a,i,l,c=0,u=0,d=e.constructor,f=d.precision;if(Lo(e)>16)throw Error(The+Lo(e));if(!e.s)return new d($d);for(wi=!1,l=f,i=new d(.03125);e.abs().gte(.1);)e=e.times(i),u+=5;for(n=Math.log(aw(2,u))/Math.LN10*2+5|0,l+=n,r=s=a=new d($d),d.precision=l;;){if(s=Fa(s.times(e),l),r=r.times(++c),i=a.plus(Py(s,r,l)),Rm(i.d).slice(0,l)===Rm(a.d).slice(0,l)){for(;u--;)a=Fa(a.times(a),l);return d.precision=f,t==null?(wi=!0,Fa(a,f)):a}a=i}}function Lo(e){for(var t=e.e*ui,r=e.d[0];r>=10;r/=10)t++;return t}function LH(e,t,r){if(t>e.LN10.sd())throw wi=!0,r&&(e.precision=r),Error(kh+"LN10 precision limit exceeded");return Fa(new e(e.LN10),t)}function vb(e){for(var t="";e--;)t+="0";return t}function rI(e,t){var r,n,s,a,i,l,c,u,d,f=1,h=10,p=e,m=p.d,g=p.constructor,y=g.precision;if(p.s<1)throw Error(kh+(p.s?"NaN":"-Infinity"));if(p.eq($d))return new g(0);if(t==null?(wi=!1,u=y):u=t,p.eq(10))return t==null&&(wi=!0),LH(g,u);if(u+=h,g.precision=u,r=Rm(m),n=r.charAt(0),a=Lo(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Rm(p.d),n=r.charAt(0),f++;a=Lo(p),n>1?(p=new g("0."+r),a++):p=new g(n+"."+r.slice(1))}else return c=LH(g,u+2,y).times(a+""),p=rI(new g(n+"."+r.slice(1)),u-h).plus(c),g.precision=y,t==null?(wi=!0,Fa(p,y)):p;for(l=i=p=Py(p.minus($d),p.plus($d),u),d=Fa(p.times(p),u),s=3;;){if(i=Fa(i.times(d),u),c=l.plus(Py(i,new g(s),u)),Rm(c.d).slice(0,u)===Rm(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(LH(g,u+2,y).times(a+""))),l=Py(l,new g(f),u),g.precision=y,t==null?(wi=!0,Fa(l,y)):l;l=c,s+=2}}function dNe(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=nC(r/ui),e.d=[],n=(r+1)%ui,r<0&&(n+=ui),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=ui;n<s;)e.d.push(+t.slice(n,n+=ui));t=t.slice(n),n=ui-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),wi&&(e.e>a4||e.e<-a4))throw Error(The+r)}else e.s=0,e.e=0,e.d=[0];return e}function Fa(e,t,r){var n,s,a,i,l,c,u,d,f=e.d;for(i=1,a=f[0];a>=10;a/=10)i++;if(n=t-i,n<0)n+=ui,s=t,u=f[d=0];else{if(d=Math.ceil((n+1)/ui),a=f.length,d>=a)return e;for(u=a=f[d],i=1;a>=10;a/=10)i++;n%=ui,s=n-ui+i}if(r!==void 0&&(a=aw(10,i-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?s>0?u/aw(10,i-s):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(a=Lo(e),f.length=1,t=t-a-1,f[0]=aw(10,(ui-t%ui)%ui),e.e=nC(-t/ui)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,a=1,d--):(f.length=d+1,a=aw(10,ui-n),f[d]=s>0?(u/aw(10,i-s)%aw(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==fl&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=fl)break;f[d--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(wi&&(e.e>a4||e.e<-a4))throw Error(The+Lo(e));return e}function Cit(e,t){var r,n,s,a,i,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),wi?Fa(t,p):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),i=u-n,i){for(d=i<0,d?(r=c,i=-i,l=f.length):(r=f,n=u,l=c.length),s=Math.max(Math.ceil(p/ui),l)+2,i>s&&(i=s,r.length=1),r.reverse(),s=i;s--;)r.push(0);r.reverse()}else{for(s=c.length,l=f.length,d=s<l,d&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){d=c[s]<f[s];break}i=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>i;){if(c[--s]<f[s]){for(a=s;a&&c[--a]===0;)c[a]=fl-1;--c[a],c[s]+=fl}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,wi?Fa(t,p):t):new h(0)}function C1(e,t,r){var n,s=Lo(e),a=Rm(e.d),i=a.length;return t?(r&&(n=r-i)>0?a=a.charAt(0)+"."+a.slice(1)+vb(n):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+vb(-s-1)+a,r&&(n=r-i)>0&&(a+=vb(n))):s>=i?(a+=vb(s+1-i),r&&(n=r-s-1)>0&&(a=a+"."+vb(n))):((n=s+1)<i&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-i)>0&&(s+1===i&&(a+="."),a+=vb(n))),e.s<0?"-"+a:a}function fNe(e,t){if(e.length>t)return e.length=t,!0}function jit(e){var t,r,n;function s(a){var i=this;if(!(i instanceof s))return new s(a);if(i.constructor=s,a instanceof s){i.s=a.s,i.e=a.e,i.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Bw+a);if(a>0)i.s=1;else if(a<0)a=-a,i.s=-1;else{i.s=0,i.e=0,i.d=[0];return}if(a===~~a&&a<1e7){i.e=0,i.d=[a];return}return dNe(i,a.toString())}else if(typeof a!="string")throw Error(Bw+a);if(a.charCodeAt(0)===45?(a=a.slice(1),i.s=-1):i.s=1,ROr.test(a))dNe(i,a);else throw Error(Bw+a)}if(s.prototype=hr,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=jit,s.config=s.set=POr,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function POr(e){if(!e||typeof e!="object")throw Error(kh+"Object expected");var t,r,n,s=["precision",1,rC,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(nC(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Bw+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Bw+r+": "+n);return this}var Nhe=jit(IOr);$d=new Nhe(1);const bs=Nhe;function Tit(e){var t;return e===0?t=1:t=Math.floor(new bs(e).abs().log(10).toNumber())+1,t}function Nit(e,t,r){for(var n=new bs(e),s=0,a=[];n.lt(t)&&s<1e5;)a.push(n.toNumber()),n=n.add(r),s++;return a}var Ait=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},Ahe=(e,t,r)=>{if(e.lte(0))return new bs(0);var n=Tit(e.toNumber()),s=new bs(10).pow(n),a=e.div(s),i=n!==1?.05:.1,l=new bs(Math.ceil(a.div(i).toNumber())).add(r).mul(i),c=l.mul(s);return t?new bs(c.toNumber()):new bs(Math.ceil(c.toNumber()))},Iit=(e,t,r)=>{var n;if(e.lte(0))return new bs(0);var s=[1,2,2.5,5],a=e.toNumber(),i=Math.floor(new bs(a).abs().log(10).toNumber()),l=new bs(10).pow(i),c=e.div(l).toNumber(),u=s.findIndex(p=>p>=c-1e-10);if(u===-1&&(l=l.mul(10),u=0),u+=r,u>=s.length){var d=Math.floor(u/s.length);u%=s.length,l=l.mul(new bs(10).pow(d))}var f=(n=s[u])!==null&&n!==void 0?n:1,h=new bs(f).mul(l);return t?h:new bs(Math.ceil(h.toNumber()))},MOr=(e,t,r)=>{var n=new bs(1),s=new bs(e);if(!s.isint()&&r){var a=Math.abs(e);a<1?(n=new bs(10).pow(Tit(e)-1),s=new bs(Math.floor(s.div(n).toNumber())).mul(n)):a>1&&(s=new bs(Math.floor(e)))}else e===0?s=new bs(Math.floor((t-1)/2)):r||(s=new bs(Math.floor(e)));for(var i=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new bs(c-i).mul(n)).toNumber());return l},Rit=function(t,r,n,s){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Ahe;if(!Number.isFinite((r-t)/(n-1)))return{step:new bs(0),tickMin:new bs(0),tickMax:new bs(0)};var l=i(new bs(r).sub(t).div(n-1),s,a),c;t<=0&&r>=0?c=new bs(0):(c=new bs(t).add(r).div(2),c=c.sub(new bs(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),d=Math.ceil(new bs(r).sub(c).div(l).toNumber()),f=u+d+1;return f>n?Rit(t,r,n,s,a+1,i):(f<n&&(d=r>0?d+(n-f):d,u=r>0?u:u+(n-f)),{step:l,tickMin:c.sub(new bs(u).mul(l)),tickMax:c.add(new bs(d).mul(l))})},hNe=function(t){var[r,n]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(s,2),[c,u]=Ait([r,n]);if(c===-1/0||u===1/0){var d=u===1/0?[c,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),u];return r>n?d.reverse():d}if(c===u)return MOr(c,s,a);var f=i==="snap125"?Iit:Ahe,{step:h,tickMin:p,tickMax:m}=Rit(c,u,l,a,0,f),g=Nit(p,m.add(new bs(.1).mul(h)),h);return r>n?g.reverse():g},pNe=function(t,r){var[n,s]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[l,c]=Ait([n,s]);if(l===-1/0||c===1/0)return[n,s];if(l===c)return[l];var u=i==="snap125"?Iit:Ahe,d=Math.max(r,2),f=u(new bs(c).sub(l).div(d-1),a,0),h=[...Nit(new bs(l),new bs(c),f),c];return a===!1&&(h=h.map(p=>Math.round(p))),n>s?h.reverse():h},DOr=e=>e.rootProps.barCategoryGap,u9=e=>e.rootProps.stackOffset,Pit=e=>e.rootProps.reverseStackOrder,Ihe=e=>e.options.chartName,Rhe=e=>e.rootProps.syncId,Mit=e=>e.rootProps.syncMethod,Phe=e=>e.options.eventEmitter,Zc={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},$0={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},rm={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},d9=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function f9(e,t,r){if(r!=="auto")return r;if(e!=null)return hv(e,t)?"category":"number"}function mNe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function i4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mNe(Object(r),!0).forEach(function(n){LOr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LOr(e,t,r){return(t=$Or(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Or(e){var t=FOr(e,"string");return typeof t=="symbol"?t:t+""}function FOr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gNe={allowDataOverflow:$0.allowDataOverflow,allowDecimals:$0.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:$0.angleAxisId,includeHidden:!1,name:void 0,reversed:$0.reversed,scale:$0.scale,tick:$0.tick,tickCount:void 0,ticks:void 0,type:$0.type,unit:void 0,niceTicks:"auto"},yNe={allowDataOverflow:rm.allowDataOverflow,allowDecimals:rm.allowDecimals,allowDuplicatedCategory:rm.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:rm.radiusAxisId,includeHidden:rm.includeHidden,name:void 0,reversed:rm.reversed,scale:rm.scale,tick:rm.tick,tickCount:rm.tickCount,ticks:void 0,type:rm.type,unit:void 0,niceTicks:"auto"},zOr=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Mhe=Xe([zOr,nit],(e,t)=>{var r;if(e!=null)return e;var n=(r=f9(t,"angleAxis",gNe.type))!==null&&r!==void 0?r:"category";return i4(i4({},gNe),{},{type:n})}),BOr=(e,t)=>e.polarAxis.radiusAxis[t],Dhe=Xe([BOr,nit],(e,t)=>{var r;if(e!=null)return e;var n=(r=f9(t,"radiusAxis",yNe.type))!==null&&r!==void 0?r:"category";return i4(i4({},yNe),{},{type:n})}),h9=e=>e.polarOptions,Lhe=Xe([pv,mv,Yl],mOr),Dit=Xe([h9,Lhe],(e,t)=>{if(e!=null)return wx(e.innerRadius,t,0)}),Lit=Xe([h9,Lhe],(e,t)=>{if(e!=null)return wx(e.outerRadius,t,t*.8)}),UOr=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},$it=Xe([h9],UOr);Xe([Mhe,$it],d9);var Fit=Xe([Lhe,Dit,Lit],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Xe([Dhe,Fit],d9);var zit=Xe([Fi,h9,Dit,Lit,pv,mv],(e,t,r,n,s,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:i,cy:l,startAngle:c,endAngle:u}=t;return{cx:wx(i,s,s/2),cy:wx(l,a,a/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:u,clockWise:!1}}}),kl=(e,t)=>t,p9=(e,t,r)=>r;function Bit(e){return e?.id}function Uit(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:s,dataKey:a}=r,i=new Map;return e.forEach(l=>{var c,u=(c=l.data)!==null&&c!==void 0?c:n;if(!(u==null||u.length===0)){var d=Bit(l);u.forEach((f,h)=>{var p=a==null||s?h:String(Ql(f,a,null)),m=Ql(f,l.dataKey,0),g;i.has(p)?g=i.get(p):g={},Object.assign(g,{[d]:m}),i.set(p,g)})}}),Array.from(i.values())}function $he(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var m9=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function g9(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function VOr(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var _l=e=>{var t=Fi(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},sC=e=>e.tooltip.settings.axisId;function Fhe(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),s=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(a){function i(){return a.apply(this,arguments)}return i.toString=function(){return a.toString()},i})(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(a){var i=s[0],l=s[1];return i<=l?a>=i&&a<=l:a>=l&&a<=i},bandwidth:r?()=>r.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,i)=>{var l=e(a);if(l!=null){if(e.bandwidth&&i!==null&&i!==void 0&&i.position){var c=e.bandwidth();switch(i.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var qOr=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!qm(t)){for(var r,n,s=0;s<t.length;s++){var a=t[s];zs(a)&&((r===void 0||a<r)&&(r=a),(n===void 0||a>n)&&(n=a))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function Qb(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function HOr(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zhe(e){let t,r,n;e.length!==2?(t=Qb,r=(l,c)=>Qb(e(l),c),n=(l,c)=>e(l)-c):(t=e===Qb||e===HOr?e:QOr,r=e,n=e);function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){const f=s(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:s,center:i,right:a}}function QOr(){return 0}function Vit(e){return e===null?NaN:+e}function*WOr(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const GOr=zhe(Qb),SP=GOr.right;zhe(Vit).center;class vNe extends Map{constructor(t,r=XOr){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,s]of t)this.set(n,s)}get(t){return super.get(bNe(this,t))}has(t){return super.has(bNe(this,t))}set(t,r){return super.set(ZOr(this,t),r)}delete(t){return super.delete(YOr(this,t))}}function bNe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function ZOr({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function YOr({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function XOr(e){return e!==null&&typeof e=="object"?e.valueOf():e}function KOr(e=Qb){if(e===Qb)return qit;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function qit(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const JOr=Math.sqrt(50),ekr=Math.sqrt(10),tkr=Math.sqrt(2);function o4(e,t,r){const n=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(n)),a=n/Math.pow(10,s),i=a>=JOr?10:a>=ekr?5:a>=tkr?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/i,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,s)*i,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?o4(e,t,r*2):[l,c,u]}function Rae(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[s,a,i]=n?o4(t,e,r):o4(e,t,r);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(n)if(i<0)for(let u=0;u<l;++u)c[u]=(a-u)/-i;else for(let u=0;u<l;++u)c[u]=(a-u)*i;else if(i<0)for(let u=0;u<l;++u)c[u]=(s+u)/-i;else for(let u=0;u<l;++u)c[u]=(s+u)*i;return c}function Pae(e,t,r){return t=+t,e=+e,r=+r,o4(e,t,r)[2]}function Mae(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?Pae(t,e,r):Pae(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function xNe(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function wNe(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Hit(e,t,r=0,n=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(s=s===void 0?qit:KOr(s);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*f/c+h)),m=Math.min(n,Math.floor(t+(c-u)*f/c+h));Hit(e,t,p,m,s)}const a=e[t];let i=r,l=n;for(Jj(e,r,t),s(e[n],a)>0&&Jj(e,r,n);i<l;){for(Jj(e,i,l),++i,--l;s(e[i],a)<0;)++i;for(;s(e[l],a)>0;)--l}s(e[r],a)===0?Jj(e,r,l):(++l,Jj(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Jj(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function rkr(e,t,r){if(e=Float64Array.from(WOr(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return wNe(e);if(t>=1)return xNe(e);var n,s=(n-1)*t,a=Math.floor(s),i=xNe(Hit(e,a).subarray(0,a+1)),l=wNe(e.subarray(a+1));return i+(l-i)*(s-a)}}function nkr(e,t,r=Vit){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,s=(n-1)*t,a=Math.floor(s),i=+r(e[a],a,e),l=+r(e[a+1],a+1,e);return i+(l-i)*(s-a)}}function skr(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(s);++n<s;)a[n]=e+n*r;return a}function Dh(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function gv(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 Dae=Symbol("implicit");function Bhe(){var e=new vNe,t=[],r=[],n=Dae;function s(a){let i=e.get(a);if(i===void 0){if(n!==Dae)return n;e.set(a,i=t.push(a)-1)}return r[i%r.length]}return s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new vNe;for(const i of a)e.has(i)||e.set(i,t.push(i)-1);return s},s.range=function(a){return arguments.length?(r=Array.from(a),s):r.slice()},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return Bhe(t,r).unknown(n)},Dh.apply(s,arguments),s}function Uhe(){var e=Bhe().unknown(void 0),t=e.domain,r=e.range,n=0,s=1,a,i,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=s<n,m=p?s:n,g=p?n:s;a=(g-m)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),m+=(g-m-a*(h-c))*d,i=a*(1-c),l&&(m=Math.round(m),i=Math.round(i));var y=skr(h).map(function(x){return m+a*x});return r(p?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,s]=h,n=+n,s=+s,f()):[n,s]},e.rangeRound=function(h){return[n,s]=h,n=+n,s=+s,l=!0,f()},e.bandwidth=function(){return i},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return Uhe(t(),[n,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},Dh.apply(f(),arguments)}function Qit(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Qit(t())},e}function akr(){return Qit(Uhe.apply(null,arguments).paddingInner(1))}function Vhe(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Wit(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function OP(){}var nI=.7,l4=1/nI,Yk="\\s*([+-]?\\d+)\\s*",sI="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ikr=/^#([0-9a-f]{3,8})$/,okr=new RegExp(`^rgb\\(${Yk},${Yk},${Yk}\\)$`),lkr=new RegExp(`^rgb\\(${Hm},${Hm},${Hm}\\)$`),ckr=new RegExp(`^rgba\\(${Yk},${Yk},${Yk},${sI}\\)$`),ukr=new RegExp(`^rgba\\(${Hm},${Hm},${Hm},${sI}\\)$`),dkr=new RegExp(`^hsl\\(${sI},${Hm},${Hm}\\)$`),fkr=new RegExp(`^hsla\\(${sI},${Hm},${Hm},${sI}\\)$`),SNe={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};Vhe(OP,j1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ONe,formatHex:ONe,formatHex8:hkr,formatHsl:pkr,formatRgb:kNe,toString:kNe});function ONe(){return this.rgb().formatHex()}function hkr(){return this.rgb().formatHex8()}function pkr(){return Git(this).formatHsl()}function kNe(){return this.rgb().formatRgb()}function j1(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=ikr.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_Ne(t):r===3?new Fu(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?zD(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?zD(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=okr.exec(e))?new Fu(t[1],t[2],t[3],1):(t=lkr.exec(e))?new Fu(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ckr.exec(e))?zD(t[1],t[2],t[3],t[4]):(t=ukr.exec(e))?zD(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dkr.exec(e))?jNe(t[1],t[2]/100,t[3]/100,1):(t=fkr.exec(e))?jNe(t[1],t[2]/100,t[3]/100,t[4]):SNe.hasOwnProperty(e)?_Ne(SNe[e]):e==="transparent"?new Fu(NaN,NaN,NaN,0):null}function _Ne(e){return new Fu(e>>16&255,e>>8&255,e&255,1)}function zD(e,t,r,n){return n<=0&&(e=t=r=NaN),new Fu(e,t,r,n)}function mkr(e){return e instanceof OP||(e=j1(e)),e?(e=e.rgb(),new Fu(e.r,e.g,e.b,e.opacity)):new Fu}function Lae(e,t,r,n){return arguments.length===1?mkr(e):new Fu(e,t,r,n??1)}function Fu(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Vhe(Fu,Lae,Wit(OP,{brighter(e){return e=e==null?l4:Math.pow(l4,e),new Fu(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nI:Math.pow(nI,e),new Fu(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fu(Uw(this.r),Uw(this.g),Uw(this.b),c4(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:ENe,formatHex:ENe,formatHex8:gkr,formatRgb:CNe,toString:CNe}));function ENe(){return`#${kw(this.r)}${kw(this.g)}${kw(this.b)}`}function gkr(){return`#${kw(this.r)}${kw(this.g)}${kw(this.b)}${kw((isNaN(this.opacity)?1:this.opacity)*255)}`}function CNe(){const e=c4(this.opacity);return`${e===1?"rgb(":"rgba("}${Uw(this.r)}, ${Uw(this.g)}, ${Uw(this.b)}${e===1?")":`, ${e})`}`}function c4(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kw(e){return e=Uw(e),(e<16?"0":"")+e.toString(16)}function jNe(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new op(e,t,r,n)}function Git(e){if(e instanceof op)return new op(e.h,e.s,e.l,e.opacity);if(e instanceof OP||(e=j1(e)),!e)return new op;if(e instanceof op)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),a=Math.max(t,r,n),i=NaN,l=a-s,c=(a+s)/2;return l?(t===a?i=(r-n)/l+(r<n)*6:r===a?i=(n-t)/l+2:i=(t-r)/l+4,l/=c<.5?a+s:2-a-s,i*=60):l=c>0&&c<1?0:i,new op(i,l,c,e.opacity)}function ykr(e,t,r,n){return arguments.length===1?Git(e):new op(e,t,r,n??1)}function op(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Vhe(op,ykr,Wit(OP,{brighter(e){return e=e==null?l4:Math.pow(l4,e),new op(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nI:Math.pow(nI,e),new op(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,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new Fu($H(e>=240?e-240:e+120,s,n),$H(e,s,n),$H(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new op(TNe(this.h),BD(this.s),BD(this.l),c4(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=c4(this.opacity);return`${e===1?"hsl(":"hsla("}${TNe(this.h)}, ${BD(this.s)*100}%, ${BD(this.l)*100}%${e===1?")":`, ${e})`}`}}));function TNe(e){return e=(e||0)%360,e<0?e+360:e}function BD(e){return Math.max(0,Math.min(1,e||0))}function $H(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const qhe=e=>()=>e;function vkr(e,t){return function(r){return e+r*t}}function bkr(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function xkr(e){return(e=+e)==1?Zit:function(t,r){return r-t?bkr(t,r,e):qhe(isNaN(t)?r:t)}}function Zit(e,t){var r=t-e;return r?vkr(e,r):qhe(isNaN(e)?t:e)}const u4=(function e(t){var r=xkr(t);function n(s,a){var i=r((s=Lae(s)).r,(a=Lae(a)).r),l=r(s.g,a.g),c=r(s.b,a.b),u=Zit(s.opacity,a.opacity);return function(d){return s.r=i(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return n.gamma=e,n})(1);function wkr(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),s;return function(a){for(s=0;s<r;++s)n[s]=e[s]*(1-a)+t[s]*a;return n}}function Skr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Okr(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,s=new Array(n),a=new Array(r),i;for(i=0;i<n;++i)s[i]=My(e[i],t[i]);for(;i<r;++i)a[i]=t[i];return function(l){for(i=0;i<n;++i)a[i]=s[i](l);return a}}function kkr(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function np(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function _kr(e,t){var r={},n={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=My(e[s],t[s]):n[s]=t[s];return function(a){for(s in r)n[s]=r[s](a);return n}}var $ae=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,FH=new RegExp($ae.source,"g");function Ekr(e){return function(){return e}}function Ckr(e){return function(t){return e(t)+""}}function Yit(e,t){var r=$ae.lastIndex=FH.lastIndex=0,n,s,a,i=-1,l=[],c=[];for(e=e+"",t=t+"";(n=$ae.exec(e))&&(s=FH.exec(t));)(a=s.index)>r&&(a=t.slice(r,a),l[i]?l[i]+=a:l[++i]=a),(n=n[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,c.push({i,x:np(n,s)})),r=FH.lastIndex;return r<t.length&&(a=t.slice(r),l[i]?l[i]+=a:l[++i]=a),l.length<2?c[0]?Ckr(c[0].x):Ekr(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function My(e,t){var r=typeof t,n;return t==null||r==="boolean"?qhe(t):(r==="number"?np:r==="string"?(n=j1(t))?(t=n,u4):Yit:t instanceof j1?u4:t instanceof Date?kkr:Skr(t)?wkr:Array.isArray(t)?Okr:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?_kr:np)(e,t)}function Hhe(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var NNe=180/Math.PI,Fae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xit(e,t,r,n,s,a){var i,l,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(c=e*r+t*n)&&(r-=e*c,n-=t*c),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,c/=l),e*n<t*r&&(e=-e,t=-t,c=-c,i=-i),{translateX:s,translateY:a,rotate:Math.atan2(t,e)*NNe,skewX:Math.atan(c)*NNe,scaleX:i,scaleY:l}}var UD;function jkr(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fae:Xit(t.a,t.b,t.c,t.d,t.e,t.f)}function Tkr(e){return e==null||(UD||(UD=document.createElementNS("http://www.w3.org/2000/svg","g")),UD.setAttribute("transform",e),!(e=UD.transform.baseVal.consolidate()))?Fae:(e=e.matrix,Xit(e.a,e.b,e.c,e.d,e.e,e.f))}function Kit(e,t,r,n){function s(u){return u.length?u.pop()+" ":""}function a(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push("translate(",null,t,null,r);m.push({i:g-4,x:np(u,f)},{i:g-2,x:np(d,h)})}else(f||h)&&p.push("translate("+f+t+h+r)}function i(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,n)-2,x:np(u,d)})):d&&f.push(s(f)+"rotate("+d+n)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,n)-2,x:np(u,d)}):d&&f.push(s(f)+"skewX("+d+n)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:np(u,f)},{i:g-2,x:np(d,h)})}else(f!==1||h!==1)&&p.push(s(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),a(u.translateX,u.translateY,d.translateX,d.translateY,f,h),i(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,g=h.length,y;++m<g;)f[(y=h[m]).i]=y.x(p);return f.join("")}}}var Nkr=Kit(jkr,"px, ","px)","deg)"),Akr=Kit(Tkr,", ",")",")"),Ikr=1e-12;function ANe(e){return((e=Math.exp(e))+1/e)/2}function Rkr(e){return((e=Math.exp(e))-1/e)/2}function Pkr(e){return((e=Math.exp(2*e))-1)/(e+1)}const k$=(function e(t,r,n){function s(a,i){var l=a[0],c=a[1],u=a[2],d=i[0],f=i[1],h=i[2],p=d-l,m=f-c,g=p*p+m*m,y,x;if(g<Ikr)x=Math.log(h/u)/t,y=function(T){return[l+T*p,c+T*m,u*Math.exp(t*T*x)]};else{var w=Math.sqrt(g),S=(h*h-u*u+n*g)/(2*u*r*w),k=(h*h-u*u-n*g)/(2*h*r*w),_=Math.log(Math.sqrt(S*S+1)-S),E=Math.log(Math.sqrt(k*k+1)-k);x=(E-_)/t,y=function(T){var j=T*x,N=ANe(_),I=u/(r*w)*(N*Pkr(t*j+_)-Rkr(_));return[l+I*p,c+I*m,u*N/ANe(t*j+_)]}}return y.duration=x*1e3*t/Math.SQRT2,y}return s.rho=function(a){var i=Math.max(.001,+a),l=i*i,c=l*l;return e(i,l,c)},s})(Math.SQRT2,2,4);function Mkr(e,t){t===void 0&&(t=e,e=My);for(var r=0,n=t.length-1,s=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(s,s=t[++r]);return function(i){var l=Math.max(0,Math.min(n-1,Math.floor(i*=n)));return a[l](i-l)}}function Dkr(e){return function(){return e}}function d4(e){return+e}var INe=[0,1];function Yc(e){return e}function zae(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Dkr(isNaN(t)?NaN:.5)}function Lkr(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function $kr(e,t,r){var n=e[0],s=e[1],a=t[0],i=t[1];return s<n?(n=zae(s,n),a=r(i,a)):(n=zae(n,s),a=r(a,i)),function(l){return a(n(l))}}function Fkr(e,t,r){var n=Math.min(e.length,t.length)-1,s=new Array(n),a=new Array(n),i=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<n;)s[i]=zae(e[i],e[i+1]),a[i]=r(t[i],t[i+1]);return function(l){var c=SP(e,l,1,n)-1;return a[c](s[c](l))}}function kP(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function y9(){var e=INe,t=INe,r=My,n,s,a,i=Yc,l,c,u;function d(){var h=Math.min(e.length,t.length);return i!==Yc&&(i=Lkr(e[0],e[h-1])),l=h>2?Fkr:$kr,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(n),t,r)))(n(i(h)))}return f.invert=function(h){return i(s((u||(u=l(t,e.map(n),np)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,d4),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=Hhe,d()},f.clamp=function(h){return arguments.length?(i=h?!0:Yc,d()):i!==Yc},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return n=h,s=p,d()}}function Qhe(){return y9()(Yc,Yc)}function zkr(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function f4(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function W_(e){return e=f4(Math.abs(e)),e?e[1]:NaN}function Bkr(e,t){return function(r,n){for(var s=r.length,a=[],i=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),a.push(r.substring(s-=l,s+l)),!((c+=l+1)>n));)l=e[i=(i+1)%e.length];return a.reverse().join(t)}}function Ukr(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Vkr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function aI(e){if(!(t=Vkr.exec(e)))throw new Error("invalid format: "+e);var t;return new Whe({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]})}aI.prototype=Whe.prototype;function Whe(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+""}Whe.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 qkr(e){e:for(var t=e.length,r=1,n=-1,s;r<t;++r)switch(e[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(s+1):e}var h4;function Hkr(e,t){var r=f4(e,t);if(!r)return h4=void 0,e.toPrecision(t);var n=r[0],s=r[1],a=s-(h4=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,i=n.length;return a===i?n:a>i?n+new Array(a-i+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+f4(e,Math.max(0,t+a-1))[0]}function RNe(e,t){var r=f4(e,t);if(!r)return e+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const PNe={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:zkr,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)=>RNe(e*100,t),r:RNe,s:Hkr,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function MNe(e){return e}var DNe=Array.prototype.map,LNe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Qkr(e){var t=e.grouping===void 0||e.thousands===void 0?MNe:Bkr(DNe.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?MNe:Ukr(DNe.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=aI(f);var p=f.fill,m=f.align,g=f.sign,y=f.symbol,x=f.zero,w=f.width,S=f.comma,k=f.precision,_=f.trim,E=f.type;E==="n"?(S=!0,E="g"):PNe[E]||(k===void 0&&(k=12),_=!0,E="g"),(x||p==="0"&&m==="=")&&(x=!0,p="0",m="=");var T=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),j=(y==="$"?n:/[%p]/.test(E)?i:"")+(h&&h.suffix!==void 0?h.suffix:""),N=PNe[E],I=/[defgprs%]/.test(E);k=k===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function P(R){var B=T,D=j,$,U,z;if(E==="c")D=N(R)+D,R="";else{R=+R;var H=R<0||1/R<0;if(R=isNaN(R)?c:N(Math.abs(R),k),_&&(R=qkr(R)),H&&+R==0&&g!=="+"&&(H=!1),B=(H?g==="("?g:l:g==="-"||g==="("?"":g)+B,D=(E==="s"&&!isNaN(R)&&h4!==void 0?LNe[8+h4/3]:"")+D+(H&&g==="("?")":""),I){for($=-1,U=R.length;++$<U;)if(z=R.charCodeAt($),48>z||z>57){D=(z===46?s+R.slice($+1):R.slice($))+D,R=R.slice(0,$);break}}}S&&!x&&(R=t(R,1/0));var Q=B.length+R.length+D.length,L=Q<w?new Array(w-Q+1).join(p):"";switch(S&&x&&(R=t(L+R,L.length?w-D.length:1/0),L=""),m){case"<":R=B+R+D+L;break;case"=":R=B+L+R+D;break;case"^":R=L.slice(0,Q=L.length>>1)+B+R+D+L.slice(Q);break;default:R=L+B+R+D;break}return a(R)}return P.toString=function(){return f+""},P}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(W_(h)/3)))*3,m=Math.pow(10,-p),g=u((f=aI(f),f.type="f",f),{suffix:LNe[8+p/3]});return function(y){return g(m*y)}}return{format:u,formatPrefix:d}}var VD,Ghe,Jit;Wkr({thousands:",",grouping:[3],currency:["$",""]});function Wkr(e){return VD=Qkr(e),Ghe=VD.format,Jit=VD.formatPrefix,VD}function Gkr(e){return Math.max(0,-W_(Math.abs(e)))}function Zkr(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(W_(t)/3)))*3-W_(Math.abs(e)))}function Ykr(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,W_(t)-W_(e))+1}function eot(e,t,r,n){var s=Mae(e,t,r),a;switch(n=aI(n??",f"),n.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Zkr(s,i))&&(n.precision=a),Jit(n,i)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Ykr(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Gkr(s))&&(n.precision=a-(n.type==="%")*2);break}}return Ghe(n)}function r0(e){var t=e.domain;return e.ticks=function(r){var n=t();return Rae(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return eot(s[0],s[s.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),s=0,a=n.length-1,i=n[s],l=n[a],c,u,d=10;for(l<i&&(u=i,i=l,l=u,u=s,s=a,a=u);d-- >0;){if(u=Pae(i,l,r),u===c)return n[s]=i,n[a]=l,t(n);if(u>0)i=Math.floor(i/u)*u,l=Math.ceil(l/u)*u;else if(u<0)i=Math.ceil(i*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function tot(){var e=Qhe();return e.copy=function(){return kP(e,tot())},Dh.apply(e,arguments),r0(e)}function rot(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,d4),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return rot(e).unknown(t)},e=arguments.length?Array.from(e,d4):[0,1],r0(r)}function not(e,t){e=e.slice();var r=0,n=e.length-1,s=e[r],a=e[n],i;return a<s&&(i=r,r=n,n=i,i=s,s=a,a=i),e[r]=t.floor(s),e[n]=t.ceil(a),e}function $Ne(e){return Math.log(e)}function FNe(e){return Math.exp(e)}function Xkr(e){return-Math.log(-e)}function Kkr(e){return-Math.exp(-e)}function Jkr(e){return isFinite(e)?+("1e"+e):e<0?0:e}function e_r(e){return e===10?Jkr:e===Math.E?Math.exp:t=>Math.pow(e,t)}function t_r(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 zNe(e){return(t,r)=>-e(-t,r)}function Zhe(e){const t=e($Ne,FNe),r=t.domain;let n=10,s,a;function i(){return s=t_r(n),a=e_r(n),r()[0]<0?(s=zNe(s),a=zNe(a),e(Xkr,Kkr)):e($Ne,FNe),t}return t.base=function(l){return arguments.length?(n=+l,i()):n},t.domain=function(l){return arguments.length?(r(l),i()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=s(u),p=s(d),m,g;const y=l==null?10:+l;let x=[];if(!(n%1)&&p-h<y){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(m=1;m<n;++m)if(g=h<0?m/a(-h):m*a(h),!(g<u)){if(g>d)break;x.push(g)}}else for(;h<=p;++h)for(m=n-1;m>=1;--m)if(g=h>0?m/a(-h):m*a(h),!(g<u)){if(g>d)break;x.push(g)}x.length*2<y&&(x=Rae(u,d,y))}else x=Rae(h,p,Math.min(p-h,y)).map(a);return f?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=aI(c)).precision==null&&(c.trim=!0),c=Ghe(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(not(r(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function sot(){const e=Zhe(y9()).domain([1,10]);return e.copy=()=>kP(e,sot()).base(e.base()),Dh.apply(e,arguments),e}function BNe(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function UNe(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Yhe(e){var t=1,r=e(BNe(t),UNe(t));return r.constant=function(n){return arguments.length?e(BNe(t=+n),UNe(t)):t},r0(r)}function aot(){var e=Yhe(y9());return e.copy=function(){return kP(e,aot()).constant(e.constant())},Dh.apply(e,arguments)}function VNe(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function r_r(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function n_r(e){return e<0?-e*e:e*e}function Xhe(e){var t=e(Yc,Yc),r=1;function n(){return r===1?e(Yc,Yc):r===.5?e(r_r,n_r):e(VNe(r),VNe(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},r0(t)}function Khe(){var e=Xhe(y9());return e.copy=function(){return kP(e,Khe()).exponent(e.exponent())},Dh.apply(e,arguments),e}function s_r(){return Khe.apply(null,arguments).exponent(.5)}function qNe(e){return Math.sign(e)*e*e}function a_r(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function iot(){var e=Qhe(),t=[0,1],r=!1,n;function s(a){var i=a_r(e(a));return isNaN(i)?n:r?Math.round(i):i}return s.invert=function(a){return e.invert(qNe(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,d4)).map(qNe)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(r=!!a,s):r},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return iot(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Dh.apply(s,arguments),r0(s)}function oot(){var e=[],t=[],r=[],n;function s(){var i=0,l=Math.max(1,t.length);for(r=new Array(l-1);++i<l;)r[i-1]=nkr(e,i/l);return a}function a(i){return i==null||isNaN(i=+i)?n:t[SP(r,i)]}return a.invertExtent=function(i){var l=t.indexOf(i);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},a.domain=function(i){if(!arguments.length)return e.slice();e=[];for(let l of i)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Qb),s()},a.range=function(i){return arguments.length?(t=Array.from(i),s()):t.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return oot().domain(e).range(t).unknown(n)},Dh.apply(a,arguments)}function lot(){var e=0,t=1,r=1,n=[.5],s=[0,1],a;function i(c){return c!=null&&c<=c?s[SP(n,c,0,r)]:a}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return i}return i.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},i.range=function(c){return arguments.length?(r=(s=Array.from(c)).length-1,l()):s.slice()},i.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},i.unknown=function(c){return arguments.length&&(a=c),i},i.thresholds=function(){return n.slice()},i.copy=function(){return lot().domain([e,t]).range(s).unknown(a)},Dh.apply(r0(i),arguments)}function cot(){var e=[.5],t=[0,1],r,n=1;function s(a){return a!=null&&a<=a?t[SP(e,a,0,n)]:r}return s.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var i=t.indexOf(a);return[e[i-1],e[i]]},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return cot().domain(e).range(t).unknown(r)},Dh.apply(s,arguments)}const zH=new Date,BH=new Date;function sl(e,t,r,n){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const i=s(a),l=s.ceil(a);return a-i<l-a?i:l},s.offset=(a,i)=>(t(a=new Date(+a),i==null?1:Math.floor(i)),a),s.range=(a,i,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<i)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<i);return c},s.filter=a=>sl(i=>{if(i>=i)for(;e(i),!a(i);)i.setTime(i-1)},(i,l)=>{if(i>=i)if(l<0)for(;++l<=0;)for(;t(i,-1),!a(i););else for(;--l>=0;)for(;t(i,1),!a(i););}),r&&(s.count=(a,i)=>(zH.setTime(+a),BH.setTime(+i),e(zH),e(BH),Math.floor(r(zH,BH))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(n?i=>n(i)%a===0:i=>s.count(0,i)%a===0):s)),s}const p4=sl(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);p4.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?sl(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):p4);p4.range;const Ey=1e3,dh=Ey*60,Cy=dh*60,Zy=Cy*24,Jhe=Zy*7,HNe=Zy*30,UH=Zy*365,_w=sl(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ey)},(e,t)=>(t-e)/Ey,e=>e.getUTCSeconds());_w.range;const epe=sl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ey)},(e,t)=>{e.setTime(+e+t*dh)},(e,t)=>(t-e)/dh,e=>e.getMinutes());epe.range;const tpe=sl(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*dh)},(e,t)=>(t-e)/dh,e=>e.getUTCMinutes());tpe.range;const rpe=sl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ey-e.getMinutes()*dh)},(e,t)=>{e.setTime(+e+t*Cy)},(e,t)=>(t-e)/Cy,e=>e.getHours());rpe.range;const npe=sl(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cy)},(e,t)=>(t-e)/Cy,e=>e.getUTCHours());npe.range;const _P=sl(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*dh)/Zy,e=>e.getDate()-1);_P.range;const v9=sl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Zy,e=>e.getUTCDate()-1);v9.range;const uot=sl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Zy,e=>Math.floor(e/Zy));uot.range;function pS(e){return sl(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*dh)/Jhe)}const b9=pS(0),m4=pS(1),i_r=pS(2),o_r=pS(3),G_=pS(4),l_r=pS(5),c_r=pS(6);b9.range;m4.range;i_r.range;o_r.range;G_.range;l_r.range;c_r.range;function mS(e){return sl(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Jhe)}const x9=mS(0),g4=mS(1),u_r=mS(2),d_r=mS(3),Z_=mS(4),f_r=mS(5),h_r=mS(6);x9.range;g4.range;u_r.range;d_r.range;Z_.range;f_r.range;h_r.range;const spe=sl(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());spe.range;const ape=sl(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());ape.range;const Yy=sl(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());Yy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sl(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Yy.range;const Xy=sl(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());Xy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sl(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Xy.range;function dot(e,t,r,n,s,a){const i=[[_w,1,Ey],[_w,5,5*Ey],[_w,15,15*Ey],[_w,30,30*Ey],[a,1,dh],[a,5,5*dh],[a,15,15*dh],[a,30,30*dh],[s,1,Cy],[s,3,3*Cy],[s,6,6*Cy],[s,12,12*Cy],[n,1,Zy],[n,2,2*Zy],[r,1,Jhe],[t,1,HNe],[t,3,3*HNe],[e,1,UH]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),m=p?p.range(u,+d+1):[];return h?m.reverse():m}function c(u,d,f){const h=Math.abs(d-u)/f,p=zhe(([,,y])=>y).right(i,h);if(p===i.length)return e.every(Mae(u/UH,d/UH,f));if(p===0)return p4.every(Math.max(Mae(u,d,f),1));const[m,g]=i[h/i[p-1][2]<i[p][2]/h?p-1:p];return m.every(g)}return[l,c]}const[p_r,m_r]=dot(Xy,ape,x9,uot,npe,tpe),[g_r,y_r]=dot(Yy,spe,b9,_P,rpe,epe);function VH(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 qH(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 eT(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function v_r(e){var t=e.dateTime,r=e.date,n=e.time,s=e.periods,a=e.days,i=e.shortDays,l=e.months,c=e.shortMonths,u=tT(s),d=rT(s),f=tT(a),h=rT(a),p=tT(i),m=rT(i),g=tT(l),y=rT(l),x=tT(c),w=rT(c),S={a:z,A:H,b:Q,B:L,c:null,d:XNe,e:XNe,f:B_r,g:X_r,G:J_r,H:$_r,I:F_r,j:z_r,L:fot,m:U_r,M:V_r,p:Z,q:V,Q:eAe,s:tAe,S:q_r,u:H_r,U:Q_r,V:W_r,w:G_r,W:Z_r,x:null,X:null,y:Y_r,Y:K_r,Z:eEr,"%":JNe},k={a:M,A:W,b:G,B:J,c:null,d:KNe,e:KNe,f:sEr,g:pEr,G:gEr,H:tEr,I:rEr,j:nEr,L:pot,m:aEr,M:iEr,p:ae,q:te,Q:eAe,s:tAe,S:oEr,u:lEr,U:cEr,V:uEr,w:dEr,W:fEr,x:null,X:null,y:hEr,Y:mEr,Z:yEr,"%":JNe},_={a:I,A:P,b:R,B,c:D,d:ZNe,e:ZNe,f:P_r,g:GNe,G:WNe,H:YNe,I:YNe,j:N_r,L:R_r,m:T_r,M:A_r,p:N,q:j_r,Q:D_r,s:L_r,S:I_r,u:O_r,U:k_r,V:__r,w:S_r,W:E_r,x:$,X:U,y:GNe,Y:WNe,Z:C_r,"%":M_r};S.x=E(r,S),S.X=E(n,S),S.c=E(t,S),k.x=E(r,k),k.X=E(n,k),k.c=E(t,k);function E(re,ie){return function(he){var X=[],se=-1,le=0,xe=re.length,de,ue,ve;for(he instanceof Date||(he=new Date(+he));++se<xe;)re.charCodeAt(se)===37&&(X.push(re.slice(le,se)),(ue=QNe[de=re.charAt(++se)])!=null?de=re.charAt(++se):ue=de==="e"?" ":"0",(ve=ie[de])&&(de=ve(he,ue)),X.push(de),le=se+1);return X.push(re.slice(le,se)),X.join("")}}function T(re,ie){return function(he){var X=eT(1900,void 0,1),se=j(X,re,he+="",0),le,xe;if(se!=he.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(ie&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(le=qH(eT(X.y,0,1)),xe=le.getUTCDay(),le=xe>4||xe===0?g4.ceil(le):g4(le),le=v9.offset(le,(X.V-1)*7),X.y=le.getUTCFullYear(),X.m=le.getUTCMonth(),X.d=le.getUTCDate()+(X.w+6)%7):(le=VH(eT(X.y,0,1)),xe=le.getDay(),le=xe>4||xe===0?m4.ceil(le):m4(le),le=_P.offset(le,(X.V-1)*7),X.y=le.getFullYear(),X.m=le.getMonth(),X.d=le.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),xe="Z"in X?qH(eT(X.y,0,1)).getUTCDay():VH(eT(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(xe+5)%7:X.w+X.U*7-(xe+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,qH(X)):VH(X)}}function j(re,ie,he,X){for(var se=0,le=ie.length,xe=he.length,de,ue;se<le;){if(X>=xe)return-1;if(de=ie.charCodeAt(se++),de===37){if(de=ie.charAt(se++),ue=_[de in QNe?ie.charAt(se++):de],!ue||(X=ue(re,he,X))<0)return-1}else if(de!=he.charCodeAt(X++))return-1}return X}function N(re,ie,he){var X=u.exec(ie.slice(he));return X?(re.p=d.get(X[0].toLowerCase()),he+X[0].length):-1}function I(re,ie,he){var X=p.exec(ie.slice(he));return X?(re.w=m.get(X[0].toLowerCase()),he+X[0].length):-1}function P(re,ie,he){var X=f.exec(ie.slice(he));return X?(re.w=h.get(X[0].toLowerCase()),he+X[0].length):-1}function R(re,ie,he){var X=x.exec(ie.slice(he));return X?(re.m=w.get(X[0].toLowerCase()),he+X[0].length):-1}function B(re,ie,he){var X=g.exec(ie.slice(he));return X?(re.m=y.get(X[0].toLowerCase()),he+X[0].length):-1}function D(re,ie,he){return j(re,t,ie,he)}function $(re,ie,he){return j(re,r,ie,he)}function U(re,ie,he){return j(re,n,ie,he)}function z(re){return i[re.getDay()]}function H(re){return a[re.getDay()]}function Q(re){return c[re.getMonth()]}function L(re){return l[re.getMonth()]}function Z(re){return s[+(re.getHours()>=12)]}function V(re){return 1+~~(re.getMonth()/3)}function M(re){return i[re.getUTCDay()]}function W(re){return a[re.getUTCDay()]}function G(re){return c[re.getUTCMonth()]}function J(re){return l[re.getUTCMonth()]}function ae(re){return s[+(re.getUTCHours()>=12)]}function te(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ie=E(re+="",S);return ie.toString=function(){return re},ie},parse:function(re){var ie=T(re+="",!1);return ie.toString=function(){return re},ie},utcFormat:function(re){var ie=E(re+="",k);return ie.toString=function(){return re},ie},utcParse:function(re){var ie=T(re+="",!0);return ie.toString=function(){return re},ie}}}var QNe={"-":"",_:" ",0:"0"},El=/^\s*\d+/,b_r=/^%/,x_r=/[\\^$*+?|[\]().{}]/g;function Bs(e,t,r){var n=e<0?"-":"",s=(n?-e:e)+"",a=s.length;return n+(a<r?new Array(r-a+1).join(t)+s:s)}function w_r(e){return e.replace(x_r,"\\$&")}function tT(e){return new RegExp("^(?:"+e.map(w_r).join("|")+")","i")}function rT(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function S_r(e,t,r){var n=El.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function O_r(e,t,r){var n=El.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function k_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function __r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function E_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function WNe(e,t,r){var n=El.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function GNe(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function C_r(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function j_r(e,t,r){var n=El.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function T_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function ZNe(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function N_r(e,t,r){var n=El.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function YNe(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function A_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function I_r(e,t,r){var n=El.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function R_r(e,t,r){var n=El.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function P_r(e,t,r){var n=El.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function M_r(e,t,r){var n=b_r.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function D_r(e,t,r){var n=El.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function L_r(e,t,r){var n=El.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function XNe(e,t){return Bs(e.getDate(),t,2)}function $_r(e,t){return Bs(e.getHours(),t,2)}function F_r(e,t){return Bs(e.getHours()%12||12,t,2)}function z_r(e,t){return Bs(1+_P.count(Yy(e),e),t,3)}function fot(e,t){return Bs(e.getMilliseconds(),t,3)}function B_r(e,t){return fot(e,t)+"000"}function U_r(e,t){return Bs(e.getMonth()+1,t,2)}function V_r(e,t){return Bs(e.getMinutes(),t,2)}function q_r(e,t){return Bs(e.getSeconds(),t,2)}function H_r(e){var t=e.getDay();return t===0?7:t}function Q_r(e,t){return Bs(b9.count(Yy(e)-1,e),t,2)}function hot(e){var t=e.getDay();return t>=4||t===0?G_(e):G_.ceil(e)}function W_r(e,t){return e=hot(e),Bs(G_.count(Yy(e),e)+(Yy(e).getDay()===4),t,2)}function G_r(e){return e.getDay()}function Z_r(e,t){return Bs(m4.count(Yy(e)-1,e),t,2)}function Y_r(e,t){return Bs(e.getFullYear()%100,t,2)}function X_r(e,t){return e=hot(e),Bs(e.getFullYear()%100,t,2)}function K_r(e,t){return Bs(e.getFullYear()%1e4,t,4)}function J_r(e,t){var r=e.getDay();return e=r>=4||r===0?G_(e):G_.ceil(e),Bs(e.getFullYear()%1e4,t,4)}function eEr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Bs(t/60|0,"0",2)+Bs(t%60,"0",2)}function KNe(e,t){return Bs(e.getUTCDate(),t,2)}function tEr(e,t){return Bs(e.getUTCHours(),t,2)}function rEr(e,t){return Bs(e.getUTCHours()%12||12,t,2)}function nEr(e,t){return Bs(1+v9.count(Xy(e),e),t,3)}function pot(e,t){return Bs(e.getUTCMilliseconds(),t,3)}function sEr(e,t){return pot(e,t)+"000"}function aEr(e,t){return Bs(e.getUTCMonth()+1,t,2)}function iEr(e,t){return Bs(e.getUTCMinutes(),t,2)}function oEr(e,t){return Bs(e.getUTCSeconds(),t,2)}function lEr(e){var t=e.getUTCDay();return t===0?7:t}function cEr(e,t){return Bs(x9.count(Xy(e)-1,e),t,2)}function mot(e){var t=e.getUTCDay();return t>=4||t===0?Z_(e):Z_.ceil(e)}function uEr(e,t){return e=mot(e),Bs(Z_.count(Xy(e),e)+(Xy(e).getUTCDay()===4),t,2)}function dEr(e){return e.getUTCDay()}function fEr(e,t){return Bs(g4.count(Xy(e)-1,e),t,2)}function hEr(e,t){return Bs(e.getUTCFullYear()%100,t,2)}function pEr(e,t){return e=mot(e),Bs(e.getUTCFullYear()%100,t,2)}function mEr(e,t){return Bs(e.getUTCFullYear()%1e4,t,4)}function gEr(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Z_(e):Z_.ceil(e),Bs(e.getUTCFullYear()%1e4,t,4)}function yEr(){return"+0000"}function JNe(){return"%"}function eAe(e){return+e}function tAe(e){return Math.floor(+e/1e3)}var bO,got,yot;vEr({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 vEr(e){return bO=v_r(e),got=bO.format,bO.parse,yot=bO.utcFormat,bO.utcParse,bO}function bEr(e){return new Date(e)}function xEr(e){return e instanceof Date?+e:+new Date(+e)}function ipe(e,t,r,n,s,a,i,l,c,u){var d=Qhe(),f=d.invert,h=d.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),y=u("%I %p"),x=u("%a %d"),w=u("%b %d"),S=u("%B"),k=u("%Y");function _(E){return(c(E)<E?p:l(E)<E?m:i(E)<E?g:a(E)<E?y:n(E)<E?s(E)<E?x:w:r(E)<E?S:k)(E)}return d.invert=function(E){return new Date(f(E))},d.domain=function(E){return arguments.length?h(Array.from(E,xEr)):h().map(bEr)},d.ticks=function(E){var T=h();return e(T[0],T[T.length-1],E??10)},d.tickFormat=function(E,T){return T==null?_:u(T)},d.nice=function(E){var T=h();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?h(not(T,E)):d},d.copy=function(){return kP(d,ipe(e,t,r,n,s,a,i,l,c,u))},d}function wEr(){return Dh.apply(ipe(g_r,y_r,Yy,spe,b9,_P,rpe,epe,_w,got).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function SEr(){return Dh.apply(ipe(p_r,m_r,Xy,ape,x9,v9,npe,tpe,_w,yot).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function w9(){var e=0,t=1,r,n,s,a,i=Yc,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:i(s===0?.5:(f=(a(f)-r)*s,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),s=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(i=f,u):i};function d(f){return function(h){var p,m;return arguments.length?([p,m]=h,i=f(p,m),u):[i(0),i(1)]}}return u.range=d(My),u.rangeRound=d(Hhe),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,r=f(e),n=f(t),s=r===n?0:1/(n-r),u}}function n0(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function vot(){var e=r0(w9()(Yc));return e.copy=function(){return n0(e,vot())},gv.apply(e,arguments)}function bot(){var e=Zhe(w9()).domain([1,10]);return e.copy=function(){return n0(e,bot()).base(e.base())},gv.apply(e,arguments)}function xot(){var e=Yhe(w9());return e.copy=function(){return n0(e,xot()).constant(e.constant())},gv.apply(e,arguments)}function ope(){var e=Xhe(w9());return e.copy=function(){return n0(e,ope()).exponent(e.exponent())},gv.apply(e,arguments)}function OEr(){return ope.apply(null,arguments).exponent(.5)}function wot(){var e=[],t=Yc;function r(n){if(n!=null&&!isNaN(n=+n))return t((SP(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let s of n)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Qb),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,s)=>t(s/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,a)=>rkr(e,a/n))},r.copy=function(){return wot(t).domain(e)},gv.apply(r,arguments)}function S9(){var e=0,t=.5,r=1,n=1,s,a,i,l,c,u=Yc,d,f=!1,h;function p(g){return isNaN(g=+g)?h:(g=.5+((g=+d(g))-a)*(n*g<n*a?l:c),u(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,r]=g,s=d(e=+e),a=d(t=+t),i=d(r=+r),l=s===a?0:.5/(a-s),c=a===i?0:.5/(i-a),n=a<s?-1:1,p):[e,t,r]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(u=g,p):u};function m(g){return function(y){var x,w,S;return arguments.length?([x,w,S]=y,u=Mkr(g,[x,w,S]),p):[u(0),u(.5),u(1)]}}return p.range=m(My),p.rangeRound=m(Hhe),p.unknown=function(g){return arguments.length?(h=g,p):h},function(g){return d=g,s=g(e),a=g(t),i=g(r),l=s===a?0:.5/(a-s),c=a===i?0:.5/(i-a),n=a<s?-1:1,p}}function Sot(){var e=r0(S9()(Yc));return e.copy=function(){return n0(e,Sot())},gv.apply(e,arguments)}function Oot(){var e=Zhe(S9()).domain([.1,1,10]);return e.copy=function(){return n0(e,Oot()).base(e.base())},gv.apply(e,arguments)}function kot(){var e=Yhe(S9());return e.copy=function(){return n0(e,kot()).constant(e.constant())},gv.apply(e,arguments)}function lpe(){var e=Xhe(S9());return e.copy=function(){return n0(e,lpe()).exponent(e.exponent())},gv.apply(e,arguments)}function kEr(){return lpe.apply(null,arguments).exponent(.5)}const VT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Uhe,scaleDiverging:Sot,scaleDivergingLog:Oot,scaleDivergingPow:lpe,scaleDivergingSqrt:kEr,scaleDivergingSymlog:kot,scaleIdentity:rot,scaleImplicit:Dae,scaleLinear:tot,scaleLog:sot,scaleOrdinal:Bhe,scalePoint:akr,scalePow:Khe,scaleQuantile:oot,scaleQuantize:lot,scaleRadial:iot,scaleSequential:vot,scaleSequentialLog:bot,scaleSequentialPow:ope,scaleSequentialQuantile:wot,scaleSequentialSqrt:OEr,scaleSequentialSymlog:xot,scaleSqrt:s_r,scaleSymlog:aot,scaleThreshold:cot,scaleTime:wEr,scaleUtc:SEr,tickFormat:eot},Symbol.toStringTag,{value:"Module"}));function _Er(e){if(e in VT)return VT[e]();var t="scale".concat(mP(e));if(t in VT)return VT[t]()}function rAe(e,t,r){if(typeof e=="function")return e.copy().domain(t).range(r);if(e!=null){var n=_Er(e);if(n!=null)return n.domain(t).range(r),n}}function cpe(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?rAe(e.scale,r,n):rAe(t,r,n)}function EEr(e){return"scale".concat(mP(e))}function CEr(e){return EEr(e)in VT}var _ot=(e,t,r)=>{if(e!=null){var{scale:n,type:s}=e;if(n==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof n=="string")return CEr(n)?n:"point"}};function jEr(e,t){for(var r=0,n=e.length,s=e[0]<e[e.length-1];r<n;){var a=Math.floor((r+n)/2);(s?e[a]<t:e[a]>t)?r=a+1:n=a}return r}function Eot(e,t){if(e){var r=t??e.domain(),n=r.map(a=>{var i;return(i=e(a))!==null&&i!==void 0?i:0}),s=e.range();if(!(r.length===0||s.length<2))return a=>{var i,l,c=jEr(n,a);if(c<=0)return r[0];if(c>=r.length)return r[r.length-1];var u=(i=n[c-1])!==null&&i!==void 0?i:0,d=(l=n[c])!==null&&l!==void 0?l:0;return Math.abs(a-u)<=Math.abs(a-d)?r[c-1]:r[c]}}}function TEr(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):Eot(e,void 0)}function nAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function y4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nAe(Object(r),!0).forEach(function(n){NEr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NEr(e,t,r){return(t=AEr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AEr(e){var t=IEr(e,"string");return typeof t=="symbol"?t:t+""}function IEr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bae=[0,"auto"],Yo={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"},Cot=(e,t)=>e.cartesianAxis.xAxis[t],yv=(e,t)=>{var r=Cot(e,t);return r??Yo},Xo={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Bae,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:vP},jot=(e,t)=>e.cartesianAxis.yAxis[t],vv=(e,t)=>{var r=jot(e,t);return r??Xo},REr={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:""},upe=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??REr},du=(e,t,r)=>{switch(t){case"xAxis":return yv(e,r);case"yAxis":return vv(e,r);case"zAxis":return upe(e,r);case"angleAxis":return Mhe(e,r);case"radiusAxis":return Dhe(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},PEr=(e,t,r)=>{switch(t){case"xAxis":return yv(e,r);case"yAxis":return vv(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},EP=(e,t,r)=>{switch(t){case"xAxis":return yv(e,r);case"yAxis":return vv(e,r);case"angleAxis":return Mhe(e,r);case"radiusAxis":return Dhe(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Tot=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Not(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var Aot=e=>e.graphicalItems.cartesianItems,MEr=Xe([kl,p9],Not),Iot=(e,t,r)=>e.filter(r).filter(n=>t?.includeHidden===!0?!0:!n.hide),CP=Xe([Aot,du,MEr],Iot,{memoizeOptions:{resultEqualityCheck:g9}}),Rot=Xe([CP],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter($he)),Pot=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),DEr=Xe([CP],Pot),Mot=e=>e.map(t=>t.data).filter(Boolean).flat(1),LEr=Xe([CP],Mot,{memoizeOptions:{resultEqualityCheck:g9}}),Dot=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},dpe=Xe([LEr,jhe],Dot),Lot=(e,t,r)=>t?.dataKey!=null?e.map(n=>({value:Ql(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:Ql(s,n)}))):e.map(n=>({value:n})),jP=Xe([dpe,du,CP],Lot);function Xk(e){if(eg(e)||e instanceof Date){var t=Number(e);if(zs(t))return t}}function sAe(e){if(Array.isArray(e)){var t=[Xk(e[0]),Xk(e[1])];return qm(t)?t:void 0}var r=Xk(e);if(r!=null)return[r,r]}function Ky(e){return e.map(Xk).filter($u)}function $Er(e,t){var r=Xk(e),n=Xk(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var FEr=Xe([jP],e=>e?.map(t=>t.value).sort($Er));function $ot(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function zEr(e,t,r){return!r||typeof t!="number"||Wy(t)?[]:r.length?Ky(r.flatMap(n=>{var s=Ql(e,n.dataKey),a,i;if(Array.isArray(s)?[a,i]=s:a=i=s,!(!zs(a)||!zs(i)))return[t-a,t+i]})):[]}var al=e=>{var t=_l(e),r=sC(e);return EP(e,t,r)},TP=Xe([al],e=>e?.dataKey),BEr=Xe([Rot,jhe,al],Uit),Fot=(e,t,r,n)=>{var s={},a=t.reduce((i,l)=>{if(l.stackId==null)return i;var c=i[l.stackId];return c==null&&(c=[]),c.push(l),i[l.stackId]=c,i},s);return Object.fromEntries(Object.entries(a).map(i=>{var[l,c]=i,u=n?[...c].reverse():c,d=u.map(Bit);return[l,{stackedData:t1r(e,d,r),graphicalItems:u}]}))},UEr=Xe([BEr,Rot,u9,Pit],Fot),zot=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:a}=t;if(n==null&&r!=="zAxis"){var i=s1r(e,s,a);if(!(i!=null&&i[0]===0&&i[1]===0))return i}},VEr=Xe([du],e=>e.allowDataOverflow),fpe=e=>{var t;if(e==null||!("domain"in e))return Bae;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Ky(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:Bae},Bot=Xe([du],fpe),Uot=Xe([Bot,VEr],Oit),qEr=Xe([UEr,t0,kl,Uot],zot,{memoizeOptions:{resultEqualityCheck:m9}}),hpe=e=>e.errorBars,HEr=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>$ot(r,n)),v4=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r.filter(Boolean);if(s.length!==0){var a=s.flat(),i=Math.min(...a),l=Math.max(...a);return[i,l]}},Vot=(e,t,r,n,s)=>{var a,i;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var u,d,f=(u=n[c.id])===null||u===void 0?void 0:u.filter(x=>$ot(s,x)),h=Ql(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),p=zEr(l,h,f);if(p.length>=2){var m=Math.min(...p),g=Math.max(...p);(a==null||m<a)&&(a=m),(i==null||g>i)&&(i=g)}var y=sAe(h);y!=null&&(a=a==null?y[0]:Math.min(a,y[0]),i=i==null?y[1]:Math.max(i,y[1]))})}),t?.dataKey!=null&&e.forEach(l=>{var c=sAe(Ql(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),i=i==null?c[1]:Math.max(i,c[1]))}),zs(a)&&zs(i))return[a,i]},QEr=Xe([dpe,du,DEr,hpe,kl],Vot,{memoizeOptions:{resultEqualityCheck:m9}});function WEr(e){var{value:t}=e;if(eg(t)||t instanceof Date)return t}var GEr=(e,t,r)=>{var n=e.map(WEr).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&tat(n))?Sit(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},qot=e=>e.referenceElements.dots,aC=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),ZEr=Xe([qot,kl,p9],aC),Hot=e=>e.referenceElements.areas,YEr=Xe([Hot,kl,p9],aC),Qot=e=>e.referenceElements.lines,XEr=Xe([Qot,kl,p9],aC),Wot=(e,t)=>{if(e!=null){var r=Ky(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},KEr=Xe(ZEr,kl,Wot),Got=(e,t)=>{if(e!=null){var r=Ky(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},JEr=Xe([YEr,kl],Got);function eCr(e){var t;if(e.x!=null)return Ky([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Ky(r)}function tCr(e){var t;if(e.y!=null)return Ky([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Ky(r)}var Zot=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?eCr(n):tCr(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},rCr=Xe([XEr,kl],Zot),nCr=Xe(KEr,rCr,JEr,(e,t,r)=>v4(e,r,t)),Yot=(e,t,r,n,s,a,i,l)=>{if(r!=null)return r;var c=i==="vertical"&&l==="xAxis"||i==="horizontal"&&l==="yAxis",u=c?v4(n,a,s):v4(a,s);return AOr(t,u,e.allowDataOverflow)},sCr=Xe([du,Bot,Uot,qEr,QEr,nCr,Fi,kl],Yot,{memoizeOptions:{resultEqualityCheck:m9}}),aCr=[0,1],Xot=(e,t,r,n,s,a,i)=>{if(!((e==null||r==null||r.length===0)&&i===void 0)){var{dataKey:l,type:c}=e,u=hv(t,a);if(u&&l==null){var d;return Sit(0,(d=r?.length)!==null&&d!==void 0?d:0)}return c==="category"?GEr(n,e,u):s==="expand"?aCr:i}},ppe=Xe([du,Fi,dpe,jP,u9,kl,sCr],Xot),iC=Xe([du,Tot,Ihe],_ot),Kot=(e,t,r)=>{var{niceTicks:n}=t;if(n!=="none"){var s=fpe(t),a=Array.isArray(s)&&(s[0]==="auto"||s[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&qm(e)){if(a)return hNe(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return pNe(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(a&&qm(e))return hNe(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&qm(e))return pNe(e,t.tickCount,t.allowDecimals,"adaptive")}}},mpe=Xe([ppe,EP,iC],Kot),Jot=(e,t,r,n)=>{if(n!=="angleAxis"&&e?.type==="number"&&qm(t)&&Array.isArray(r)&&r.length>0){var s,a,i=t[0],l=(s=r[0])!==null&&s!==void 0?s:0,c=t[1],u=(a=r[r.length-1])!==null&&a!==void 0?a:0;return[Math.min(i,l),Math.max(c,u)]}return t},iCr=Xe([du,ppe,mpe,kl],Jot),oCr=Xe(jP,du,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Ky(e.map(f=>f.value))).sort((f,h)=>f-h),s=n[0],a=n[n.length-1];if(s==null||a==null)return 1/0;var i=a-s;if(i===0)return 1/0;for(var l=0;l<n.length-1;l++){var c=n[l],u=n[l+1];if(!(c==null||u==null)){var d=u-c;r=Math.min(r,d)}}return r/i}}),elt=Xe(oCr,Fi,DOr,Yl,(e,t,r,n,s)=>s,(e,t,r,n,s)=>{if(!zs(e))return 0;var a=t==="vertical"?n.height:n.width;if(s==="gap")return e*a/2;if(s==="no-gap"){var i=wx(r,e*a),l=e*a/2;return l-i-(l-i)/a*i}return 0}),lCr=(e,t,r)=>{var n=yv(e,t);return n==null||typeof n.padding!="string"?0:elt(e,"xAxis",t,r,n.padding)},cCr=(e,t,r)=>{var n=vv(e,t);return n==null||typeof n.padding!="string"?0:elt(e,"yAxis",t,r,n.padding)},uCr=Xe(yv,lCr,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((n=s.right)!==null&&n!==void 0?n:0)+t}}),dCr=Xe(vv,cCr,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((n=s.bottom)!==null&&n!==void 0?n:0)+t}}),fCr=Xe([Yl,uCr,s9,n9,(e,t,r)=>r],(e,t,r,n,s)=>{var{padding:a}=n;return s?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),hCr=Xe([Yl,Fi,dCr,s9,n9,(e,t,r)=>r],(e,t,r,n,s,a)=>{var{padding:i}=s;return a?[n.height-i.bottom,i.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),NP=(e,t,r,n)=>{var s;switch(t){case"xAxis":return fCr(e,r,n);case"yAxis":return hCr(e,r,n);case"zAxis":return(s=upe(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return $it(e);case"radiusAxis":return Fit(e,r);default:return}},tlt=Xe([du,NP],d9),pCr=Xe([iC,iCr],qOr),gpe=Xe([du,iC,pCr,tlt],cpe),rlt=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:a}=r,i=hv(e,n);if(i&&(s==="number"||a!=="auto"))return t.map(l=>l.value)}},ype=Xe([Fi,jP,EP,kl],rlt),O9=Xe([gpe],Fhe);Xe([gpe],TEr);Xe([gpe,FEr],Eot);Xe([CP,hpe,kl],HEr);function nlt(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var k9=(e,t)=>t,_9=(e,t,r)=>r,mCr=Xe(t9,k9,_9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(nlt)),gCr=Xe(r9,k9,_9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(nlt)),slt=(e,t)=>({width:e.width,height:t.height}),yCr=(e,t)=>{var r=typeof t.width=="number"?t.width:vP;return{width:r,height:e.height}},vCr=Xe(Yl,yv,slt),bCr=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},xCr=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},wCr=Xe(mv,Yl,mCr,k9,_9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=slt(t,l);i==null&&(i=bCr(t,n,e));var u=n==="top"&&!s||n==="bottom"&&s;a[l.id]=i-Number(u)*c.height,i+=(u?-1:1)*c.height}),a}),SCr=Xe(pv,Yl,gCr,k9,_9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=yCr(t,l);i==null&&(i=xCr(t,n,e));var u=n==="left"&&!s||n==="right"&&s;a[l.id]=i-Number(u)*c.width,i+=(u?-1:1)*c.width}),a}),OCr=(e,t)=>{var r=yv(e,t);if(r!=null)return wCr(e,r.orientation,r.mirror)},kCr=Xe([Yl,yv,OCr,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r?.[n];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),_Cr=(e,t)=>{var r=vv(e,t);if(r!=null)return SCr(e,r.orientation,r.mirror)},ECr=Xe([Yl,vv,_Cr,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r?.[n];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),CCr=Xe(Yl,vv,(e,t)=>{var r=typeof t.width=="number"?t.width:vP;return{width:r,height:e.height}}),alt=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:a,dataKey:i}=r,l=hv(e,n),c=t.map(u=>u.value);if(i&&l&&a==="category"&&s&&tat(c))return c}},vpe=Xe([Fi,jP,du,kl],alt),aAe=Xe([Fi,PEr,iC,O9,vpe,ype,NP,mpe,kl],(e,t,r,n,s,a,i,l,c)=>{if(t!=null){var u=hv(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:s,isCategorical:u,niceTicks:l,range:i,realScaleType:r,scale:n}}}),jCr=(e,t,r,n,s,a,i,l,c)=>{if(!(t==null||n==null)){var u=hv(e,c),{type:d,ticks:f,tickCount:h}=t,p=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,m=d==="category"&&n.bandwidth?n.bandwidth()/p:0;m=c==="angleAxis"&&a!=null&&a.length>=2?ch(a[0]-a[1])*2*m:m;var g=f||s;return g?g.map((y,x)=>{var w=i?i.indexOf(y):y,S=n.map(w);return zs(S)?{index:x,coordinate:S+m,value:y,offset:m}:null}).filter($u):u&&l?l.map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:y,index:x,offset:m}:null}).filter($u):n.ticks?n.ticks(h).map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:y,index:x,offset:m}:null}).filter($u):n.domain().map((y,x)=>{var w=n.map(y);return zs(w)?{coordinate:w+m,value:i?i[y]:y,index:x,offset:m}:null}).filter($u)}},ilt=Xe([Fi,EP,iC,O9,mpe,NP,vpe,ype,kl],jCr),TCr=(e,t,r,n,s,a,i)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=hv(e,i),{tickCount:c}=t,u=0;return u=i==="angleAxis"&&n?.length>=2?ch(n[0]-n[1])*2*u:u,l&&a?a.map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter($u):r.ticks?r.ticks(c).map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:d,index:f,offset:u}:null}).filter($u):r.domain().map((d,f)=>{var h=r.map(d);return zs(h)?{coordinate:h+u,value:s?s[d]:d,index:f,offset:u}:null}).filter($u)}},olt=Xe([Fi,EP,O9,NP,vpe,ype,kl],TCr),llt=Xe(du,O9,(e,t)=>{if(!(e==null||t==null))return y4(y4({},e),{},{scale:t})}),NCr=Xe([du,iC,ppe,tlt],cpe),ACr=Xe([NCr],Fhe);Xe((e,t,r)=>upe(e,r),ACr,(e,t)=>{if(!(e==null||t==null))return y4(y4({},e),{},{scale:t})});var ICr=Xe([Fi,t9,r9],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),RCr=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};Xe([RCr],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,s=e[0];for(var a of e){var i=Math.abs(a.coordinate-t);i<n&&(n=i,s=a)}return(r=s)===null||r===void 0?void 0:r.value}});var clt=e=>e.options.defaultTooltipEventType,ult=e=>e.options.validateTooltipEventTypes;function dlt(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function bpe(e,t){var r=clt(e),n=ult(e);return dlt(t,r,n)}function PCr(e){return en(t=>bpe(t,e))}var flt=(e,t)=>{var r,n=Number(t);if(!(Wy(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},MCr=e=>e.tooltip.settings,kb={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},DCr={itemInteraction:{click:kb,hover:kb},axisInteraction:{click:kb,hover:kb},keyboardInteraction:kb,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}},hlt=Ec({name:"tooltip",initialState:DCr,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:ci()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:ci()},removeTooltipEntrySettings:{reducer(e,t){var r=uh(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:ci()},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:LCr,replaceTooltipEntrySettings:$Cr,removeTooltipEntrySettings:FCr,setTooltipSettingsState:zCr,setActiveMouseOverItemIndex:BCr,mouseLeaveItem:VPn,mouseLeaveChart:plt,setActiveClickItemIndex:qPn,setMouseOverAxisIndex:mlt,setMouseClickAxisIndex:UCr,setSyncInteraction:Uae,setKeyboardInteraction:b4}=hlt.actions,VCr=hlt.reducer;function iAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iAe(Object(r),!0).forEach(function(n){qCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qCr(e,t,r){return(t=HCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HCr(e){var t=QCr(e,"string");return typeof t=="symbol"?t:t+""}function QCr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WCr(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function GCr(e){return e.index!=null}var glt=(e,t,r,n)=>{if(t==null)return kb;var s=WCr(e,t,r);if(s==null)return kb;if(s.active)return s;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(GCr(s)){if(a)return qD(qD({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return qD(qD({},kb),{},{coordinate:s.coordinate})};function ZCr(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 r=Number(e);return Number.isFinite(r)?r:void 0}function YCr(e,t){var r=ZCr(e),n=t[0],s=t[1];if(r===void 0)return!1;var a=Math.min(n,s),i=Math.max(n,s);return r>=a&&r<=i}function XCr(e,t,r){if(r==null||t==null)return!0;var n=Ql(e,t);return n==null||!qm(r)?!0:YCr(n,r)}var xpe=(e,t,r,n)=>{var s=e?.index;if(s==null)return null;var a=Number(s);if(!zs(a))return s;var i=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(i,Math.min(a,l)),u=t[c];return u==null||XCr(u,r,n)?String(c):null},ylt=(e,t,r,n,s,a,i)=>{if(a!=null){var l=i[0],c=l?.getPosition(a);if(c!=null)return c;var u=s?.[Number(a)];if(u)return r==="horizontal"?{x:u.coordinate,y:(n.top+t)/2}:{x:(n.left+e)/2,y:u.coordinate}}},vlt=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&s==null)return e.tooltipItemPayloads;if(s==null&&n!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(i=>{var l;return((l=i.settings)===null||l===void 0?void 0:l.graphicalItemId)===s})},blt=e=>e.options.tooltipPayloadSearcher,oC=e=>e.tooltip;function oAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function lAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oAe(Object(r),!0).forEach(function(n){KCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KCr(e,t,r){return(t=JCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JCr(e){var t=ejr(e,"string");return typeof t=="symbol"?t:t+""}function ejr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tjr(e){if(typeof e=="string"||typeof e=="number")return e}function rjr(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function njr(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function cAe(e){if(typeof e=="string")return e}function sjr(e){if(!(e==null||typeof e!="object")){var t="name"in e?tjr(e.name):void 0,r="unit"in e?rjr(e.unit):void 0,n="dataKey"in e?njr(e.dataKey):void 0,s="payload"in e?e.payload:void 0,a="color"in e?cAe(e.color):void 0,i="fill"in e?cAe(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:s,color:a,fill:i}}}function ajr(e,t){return e??t}var xlt=(e,t,r,n,s,a,i)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:d}=r,f=[];return e.reduce((h,p)=>{var m,{dataDefinedOnItem:g,settings:y}=p,x=ajr(g,l),w=Array.isArray(x)?qat(x,u,d):x,S=(m=y?.dataKey)!==null&&m!==void 0?m:n,k=y?.nameKey,_;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&i==="axis"?_=rat(w,n,s):_=a(w,t,c,k),Array.isArray(_))_.forEach(T=>{var j,N,I=sjr(T),P=I?.name,R=I?.dataKey,B=I?.payload,D=lAe(lAe({},y),{},{name:P,unit:I?.unit,color:(j=I?.color)!==null&&j!==void 0?j:y?.color,fill:(N=I?.fill)!==null&&N!==void 0?N:y?.fill});h.push(oTe({tooltipEntrySettings:D,dataKey:R,payload:B,value:Ql(B,R),name:P==null?void 0:String(P)}))});else{var E;h.push(oTe({tooltipEntrySettings:y,dataKey:S,payload:_,value:Ql(_,S),name:(E=Ql(_,k))!==null&&E!==void 0?E:y?.name}))}return h},f)}},wpe=Xe([al,Tot,Ihe],_ot),ijr=Xe([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),ojr=Xe([_l,sC],Not),lC=Xe([ijr,al,ojr],Iot,{memoizeOptions:{resultEqualityCheck:g9}}),ljr=Xe([lC],e=>e.filter($he)),cjr=Xe([lC],Mot,{memoizeOptions:{resultEqualityCheck:g9}}),cC=Xe([cjr,t0],Dot),ujr=Xe([ljr,t0,al],Uit),Spe=Xe([cC,al,lC],Lot),wlt=Xe([al],fpe),djr=Xe([al],e=>e.allowDataOverflow),Slt=Xe([wlt,djr],Oit),fjr=Xe([lC],e=>e.filter($he)),hjr=Xe([ujr,fjr,u9,Pit],Fot),pjr=Xe([hjr,t0,_l,Slt],zot),mjr=Xe([lC],Pot),gjr=Xe([cC,al,mjr,hpe,_l],Vot,{memoizeOptions:{resultEqualityCheck:m9}}),yjr=Xe([qot,_l,sC],aC),vjr=Xe([yjr,_l],Wot),bjr=Xe([Hot,_l,sC],aC),xjr=Xe([bjr,_l],Got),wjr=Xe([Qot,_l,sC],aC),Sjr=Xe([wjr,_l],Zot),Ojr=Xe([vjr,Sjr,xjr],v4),kjr=Xe([al,wlt,Slt,pjr,gjr,Ojr,Fi,_l],Yot),AP=Xe([al,Fi,cC,Spe,u9,_l,kjr],Xot),_jr=Xe([AP,al,wpe],Kot),Ejr=Xe([al,AP,_jr,_l],Jot),Olt=e=>{var t=_l(e),r=sC(e),n=!1;return NP(e,t,r,n)},klt=Xe([al,Olt],d9),Cjr=Xe([al,wpe,Ejr,klt],cpe),_lt=Xe([Cjr],Fhe),jjr=Xe([Fi,Spe,al,_l],alt),Tjr=Xe([Fi,Spe,al,_l],rlt),Njr=(e,t,r,n,s,a,i,l)=>{if(t){var{type:c}=t,u=hv(e,l);if(n){var d=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/d:0;return f=l==="angleAxis"&&s!=null&&s?.length>=2?ch(s[0]-s[1])*2*f:f,u&&i?i.map((h,p)=>{var m=n.map(h);return zs(m)?{coordinate:m+f,value:h,index:p,offset:f}:null}).filter($u):n.domain().map((h,p)=>{var m=n.map(h);return zs(m)?{coordinate:m+f,value:a?a[h]:h,index:p,offset:f}:null}).filter($u)}}},bv=Xe([Fi,al,wpe,_lt,Olt,jjr,Tjr,_l],Njr),Ope=Xe([clt,ult,MCr],(e,t,r)=>dlt(r.shared,e,t)),Elt=e=>e.tooltip.settings.trigger,kpe=e=>e.tooltip.settings.defaultIndex,IP=Xe([oC,Ope,Elt,kpe],glt),iI=Xe([IP,cC,TP,AP],xpe),Clt=Xe([bv,iI],flt),Ajr=Xe([IP],e=>{if(e)return e.dataKey}),Ijr=Xe([IP],e=>{if(e)return e.graphicalItemId}),jlt=Xe([oC,Ope,Elt,kpe],vlt),Rjr=Xe([pv,mv,Fi,Yl,bv,kpe,jlt],ylt),Pjr=Xe([IP,Rjr],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Mjr=Xe([IP],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),Djr=Xe([jlt,iI,t0,TP,Clt,blt,Ope],xlt),Ljr=Xe([Djr],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function uAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function dAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uAe(Object(r),!0).forEach(function(n){$jr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $jr(e,t,r){return(t=Fjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fjr(e){var t=zjr(e,"string");return typeof t=="symbol"?t:t+""}function zjr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bjr=()=>en(al),Ujr=()=>{var e=Bjr(),t=en(bv),r=en(_lt);return Z5(!e||!r?void 0:dAe(dAe({},e),{},{scale:r}),t)};function fAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fAe(Object(r),!0).forEach(function(n){Vjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vjr(e,t,r){return(t=qjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qjr(e){var t=Hjr(e,"string");return typeof t=="symbol"?t:t+""}function Hjr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qjr=(e,t,r,n)=>{var s=t.find(a=>a&&a.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:s.coordinate}}return{x:0,y:0}},Wjr=(e,t,r,n)=>{var s=t.find(u=>u&&u.index===r);if(s){if(e==="centric"){var a=s.coordinate,{radius:i}=n;return xO(xO(xO({},n),Ul(n.cx,n.cy,i,a)),{},{angle:a,radius:i})}var l=s.coordinate,{angle:c}=n;return xO(xO(xO({},n),Ul(n.cx,n.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 Gjr(e,t){var{relativeX:r,relativeY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var Tlt=(e,t,r,n,s)=>{var a,i=(a=t?.length)!==null&&a!==void 0?a:0;if(i<=1||e==null)return 0;if(n==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var l=0;l<i;l++){var c,u,d,f,h,p=l>0?(c=r[l-1])===null||c===void 0?void 0:c.coordinate:(u=r[i-1])===null||u===void 0?void 0:u.coordinate,m=(d=r[l])===null||d===void 0?void 0:d.coordinate,g=l>=i-1?(f=r[0])===null||f===void 0?void 0:f.coordinate:(h=r[l+1])===null||h===void 0?void 0:h.coordinate,y=void 0;if(!(p==null||m==null||g==null))if(ch(m-p)!==ch(g-m)){var x=[];if(ch(g-m)===ch(s[1]-s[0])){y=g;var w=m+s[1]-s[0];x[0]=Math.min(w,(w+p)/2),x[1]=Math.max(w,(w+p)/2)}else{y=p;var S=g+s[1]-s[0];x[0]=Math.min(m,(S+m)/2),x[1]=Math.max(m,(S+m)/2)}var k=[Math.min(m,(y+m)/2),Math.max(m,(y+m)/2)];if(e>k[0]&&e<=k[1]||e>=x[0]&&e<=x[1]){var _;return(_=r[l])===null||_===void 0?void 0:_.index}}else{var E=Math.min(p,g),T=Math.max(p,g);if(e>(E+m)/2&&e<=(T+m)/2){var j;return(j=r[l])===null||j===void 0?void 0:j.index}}}else if(t)for(var N=0;N<i;N++){var I=t[N];if(I!=null){var P=t[N+1],R=t[N-1];if(N===0&&P!=null&&e<=(I.coordinate+P.coordinate)/2||N===i-1&&R!=null&&e>(I.coordinate+R.coordinate)/2||N>0&&N<i-1&&R!=null&&P!=null&&e>(I.coordinate+R.coordinate)/2&&e<=(I.coordinate+P.coordinate)/2)return I.index}}return-1},Zjr=()=>en(Ihe),_pe=(e,t)=>t,Nlt=(e,t,r)=>r,Epe=(e,t,r,n)=>n,Yjr=Xe(bv,e=>Hz(e,t=>t.coordinate)),Cpe=Xe([oC,_pe,Nlt,Epe],glt),jpe=Xe([Cpe,cC,TP,AP],xpe),Xjr=(e,t,r)=>{if(t!=null){var n=oC(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},Alt=Xe([oC,_pe,Nlt,Epe],vlt),x4=Xe([pv,mv,Fi,Yl,bv,Epe,Alt],ylt),Kjr=Xe([Cpe,x4],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),Ilt=Xe([bv,jpe],flt),Jjr=Xe([Alt,jpe,t0,TP,Ilt,blt,_pe],xlt),eTr=Xe([Cpe,jpe],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),tTr=(e,t,r,n,s,a,i)=>{if(!(!e||!r||!n||!s)&&Gjr(e,i)){var l=a1r(e,t),c=Tlt(l,a,s,r,n),u=Qjr(t,s,c,e);return{activeIndex:String(c),activeCoordinate:u}}},rTr=(e,t,r,n,s,a,i)=>{if(!(!e||!n||!s||!a||!r)){var l=xOr(e,r);if(l){var c=i1r(l,t),u=Tlt(c,i,a,n,s),d=Wjr(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},nTr=(e,t,r,n,s,a,i,l)=>{if(!(!e||!t||!n||!s||!a))return t==="horizontal"||t==="vertical"?tTr(e,t,n,s,a,i,l):rTr(e,t,r,n,s,a,i)},sTr=Xe(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),aTr=Xe(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(Zc)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:VOr}});function hAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hAe(Object(r),!0).forEach(function(n){iTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iTr(e,t,r){return(t=oTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oTr(e){var t=lTr(e,"string");return typeof t=="symbol"?t:t+""}function lTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cTr={},uTr={zIndexMap:Object.values(Zc).reduce((e,t)=>pAe(pAe({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),cTr)},dTr=new Set(Object.values(Zc));function fTr(e){return dTr.has(e)}var Rlt=Ec({name:"zIndex",initialState:uTr,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:ci()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!fTr(r)&&delete e.zIndexMap[r])},prepare:ci()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:s?void 0:n,panoramaElement:s?n:void 0}},prepare:ci()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:ci()}}}),{registerZIndexPortal:hTr,unregisterZIndexPortal:pTr,registerZIndexPortalElement:mTr,unregisterZIndexPortalElement:gTr}=Rlt.actions,yTr=Rlt.reducer;function xv(e){var{zIndex:t,children:r}=e,n=F1r(),s=n&&t!==void 0&&t!==0,a=sd(),i=Vo();b.useLayoutEffect(()=>s?(i(hTr({zIndex:t})),()=>{i(pTr({zIndex:t}))}):hS,[i,t,s]);var l=en(c=>sTr(c,t,a));return s?l?cu.createPortal(r,l):null:r}function Vae(){return Vae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vae.apply(null,arguments)}function mAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function HD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mAe(Object(r),!0).forEach(function(n){vTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vTr(e,t,r){return(t=bTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bTr(e){var t=xTr(e,"string");return typeof t=="symbol"?t:t+""}function xTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wTr(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return b.isValidElement(t)?b.cloneElement(t,n):b.createElement(r,n)}function STr(e){var t,{coordinate:r,payload:n,index:s,offset:a,tooltipAxisBandSize:i,layout:l,cursor:c,tooltipEventType:u,chartName:d}=e,f=r,h=n,p=s;if(!c||!f||d!=="ScatterChart"&&u!=="axis")return null;var m,g,y;if(d==="ScatterChart")m=f,g=PSr,y=Zc.cursorLine;else if(d==="BarChart")m=MSr(l,f,a,i),g=vit,y=Zc.cursorRectangle;else if(l==="radial"&&aat(f)){var{cx:x,cy:w,radius:S,startAngle:k,endAngle:_}=bit(f);m={cx:x,cy:w,startAngle:k,endAngle:_,innerRadius:S,outerRadius:S},g=wit,y=Zc.cursorLine}else m={points:kOr(l,f,a)},g=hit,y=Zc.cursorLine;var E=typeof c=="object"&&"className"in c?c.className:void 0,T=HD(HD(HD(HD({stroke:"#ccc",pointerEvents:"none"},a),m),zz(c)),{},{payload:h,payloadIndex:p,className:wa("recharts-tooltip-cursor",E)});return b.createElement(xv,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:y},b.createElement(wTr,{cursor:c,cursorComp:g,cursorProps:T}))}function OTr(e){var t=Ujr(),r=Jat(),n=tC(),s=Zjr();return t==null||r==null||n==null||s==null?null:b.createElement(STr,Vae({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var Plt=b.createContext(null),kTr=()=>b.useContext(Plt),HH={exports:{}},gAe;function _Tr(){return gAe||(gAe=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,f||c,h),m=r?r+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function i(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,m=new Array(p);h<p;h++)m[h]=f[h].fn;return m},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,m){var g=r?r+u:u;if(!this._events[g])return!1;var y=this._events[g],x=arguments.length,w,S;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),x){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,h),!0;case 5:return y.fn.call(y.context,d,f,h,p),!0;case 6:return y.fn.call(y.context,d,f,h,p,m),!0}for(S=1,w=new Array(x-1);S<x;S++)w[S-1]=arguments[S];y.fn.apply(y.context,w)}else{var k=y.length,_;for(S=0;S<k;S++)switch(y[S].once&&this.removeListener(u,y[S].fn,void 0,!0),x){case 1:y[S].fn.call(y[S].context);break;case 2:y[S].fn.call(y[S].context,d);break;case 3:y[S].fn.call(y[S].context,d,f);break;case 4:y[S].fn.call(y[S].context,d,f,h);break;default:if(!w)for(_=1,w=new Array(x-1);_<x;_++)w[_-1]=arguments[_];y[S].fn.apply(y[S].context,w)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=r?r+u:u;if(!this._events[p])return this;if(!d)return i(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!h||m.once)&&(!f||m.context===f)&&i(this,p);else{for(var g=0,y=[],x=m.length;g<x;g++)(m[g].fn!==d||h&&!m[g].once||f&&m[g].context!==f)&&y.push(m[g]);y.length?this._events[p]=y.length===1?y[0]:y:i(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&i(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(HH)),HH.exports}var ETr=_Tr();const CTr=Uo(ETr);var oI=new CTr,qae="recharts.syncEvent.tooltip",yAe="recharts.syncEvent.brush",jTr=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Wy(r))return e[r]}},TTr={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Mlt=Ec({name:"options",initialState:TTr,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),NTr=Mlt.reducer,{createEventEmitter:ATr}=Mlt.actions;function ITr(e){return e.tooltip.syncInteraction}var RTr={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Dlt=Ec({name:"chartData",initialState:RTr,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:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:vAe,setDataStartEndIndexes:PTr,setComputedData:HPn}=Dlt.actions,MTr=Dlt.reducer,DTr=["x","y"];function bAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function wO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bAe(Object(r),!0).forEach(function(n){LTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LTr(e,t,r){return(t=$Tr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Tr(e){var t=FTr(e,"string");return typeof t=="symbol"?t:t+""}function FTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zTr(e,t){if(e==null)return{};var r,n,s=BTr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function BTr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function UTr(){var e=en(Rhe),t=en(Phe),r=Vo(),n=en(Mit),s=en(bv),a=tC(),i=a9(),l=en(c=>c.rootProps.className);b.useEffect(()=>{if(e==null)return hS;var c=(u,d,f)=>{if(t!==f&&e===u){if(n==="index"){var h;if(i&&d!==null&&d!==void 0&&(h=d.payload)!==null&&h!==void 0&&h.coordinate&&d.payload.sourceViewBox){var p=d.payload.coordinate,{x:m,y:g}=p,y=zTr(p,DTr),{x,y:w,width:S,height:k}=d.payload.sourceViewBox,_=wO(wO({},y),{},{x:i.x+(S?(m-x)/S:0)*i.width,y:i.y+(k?(g-w)/k:0)*i.height});r(wO(wO({},d),{},{payload:wO(wO({},d.payload),{},{coordinate:_})}))}else r(d);return}if(s!=null){var E;if(typeof n=="function"){var T={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},j=n(s,T);E=s[j]}else n==="value"&&(E=s.find(U=>String(U.value)===d.payload.label));var{coordinate:N}=d.payload;if(E==null||d.payload.active===!1||N==null||i==null){r(Uae({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:I,y:P}=N,R=Math.min(I,i.x+i.width),B=Math.min(P,i.y+i.height),D={x:a==="horizontal"?E.coordinate:R,y:a==="horizontal"?B:E.coordinate},$=Uae({active:d.payload.active,coordinate:D,dataKey:d.payload.dataKey,index:String(E.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});r($)}}};return oI.on(qae,c),()=>{oI.off(qae,c)}},[l,r,t,e,n,s,a,i])}function VTr(){var e=en(Rhe),t=en(Phe),r=Vo();b.useEffect(()=>{if(e==null)return hS;var n=(s,a,i)=>{t!==i&&e===s&&r(PTr(a))};return oI.on(yAe,n),()=>{oI.off(yAe,n)}},[r,t,e])}function qTr(){var e=Vo();b.useEffect(()=>{e(ATr())},[e]),UTr(),VTr()}function HTr(e,t,r,n,s,a){var i=en(m=>Xjr(m,e,t)),l=en(Ijr),c=en(Phe),u=en(Rhe),d=en(Mit),f=en(ITr),h=f?.active,p=a9();b.useEffect(()=>{if(!h&&u!=null&&c!=null){var m=Uae({active:a,coordinate:r,dataKey:i,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:p,graphicalItemId:l});oI.emit(qae,u,m,c)}},[h,r,i,l,s,n,c,u,d,a,p])}function xAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function wAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xAe(Object(r),!0).forEach(function(n){QTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QTr(e,t,r){return(t=WTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WTr(e){var t=GTr(e,"string");return typeof t=="symbol"?t:t+""}function GTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ZTr(e){return e.dataKey}function YTr(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(cSr,t)}var SAe=[],XTr={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 KTr(e){var t,r,n=nd(e,XTr),{active:s,allowEscapeViewBox:a,animationDuration:i,animationEasing:l,content:c,filterNull:u,isAnimationActive:d,offset:f,payloadUniqBy:h,position:p,reverseDirection:m,useTranslate3d:g,wrapperStyle:y,cursor:x,shared:w,trigger:S,defaultIndex:k,portal:_,axisId:E}=n,T=Vo(),j=typeof k=="number"?String(k):k;b.useEffect(()=>{T(zCr({shared:w,trigger:S,axisId:E,active:s,defaultIndex:j}))},[T,w,S,E,s,j]);var N=a9(),I=fit(),P=PCr(w),{activeIndex:R,isActive:B}=(t=en(te=>eTr(te,P,S,j)))!==null&&t!==void 0?t:{},D=en(te=>Jjr(te,P,S,j)),$=en(te=>Ilt(te,P,S,j)),U=en(te=>Kjr(te,P,S,j)),z=D,H=kTr(),Q=(r=s??B)!==null&&r!==void 0?r:!1,[L,Z]=X0r([z,Q]),V=P==="axis"?$:void 0;HTr(P,S,U,V,R,Q);var M=_??H;if(M==null||N==null||P==null)return null;var W=z??SAe;Q||(W=SAe),u&&W.length&&(W=$0r(W.filter(te=>te.value!=null&&(te.hide!==!0||n.includeHidden)),h,ZTr));var G=W.length>0,J=wAe(wAe({},n),{},{payload:W,label:V,active:Q,activeIndex:R,coordinate:U,accessibilityLayer:I}),ae=b.createElement(xSr,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:Q,coordinate:U,hasPayload:G,offset:f,position:p,reverseDirection:m,useTranslate3d:g,viewBox:N,wrapperStyle:y,lastBoundingBox:L,innerRef:Z,hasPortalFromProps:!!_},YTr(c,J));return b.createElement(b.Fragment,null,cu.createPortal(ae,M),Q&&b.createElement(OTr,{cursor:x,tooltipEventType:P,coordinate:U,payload:W,index:R}))}function JTr(e,t,r){return(t=eNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eNr(e){var t=tNr(e,"string");return typeof t=="symbol"?t:t+""}function tNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class rNr{constructor(t){JTr(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function OAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function nNr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OAe(Object(r),!0).forEach(function(n){sNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sNr(e,t,r){return(t=aNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aNr(e){var t=iNr(e,"string");return typeof t=="symbol"?t:t+""}function iNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oNr={cacheSize:2e3,enableCache:!0},Llt=nNr({},oNr),kAe=new rNr(Llt.cacheSize),lNr={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},_Ae="recharts_measurement_span";function cNr(e,t){var r=t.fontSize||"",n=t.fontFamily||"",s=t.fontWeight||"",a=t.fontStyle||"",i=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(s,"|").concat(a,"|").concat(i,"|").concat(l)}var EAe=(e,t)=>{try{var r=document.getElementById(_Ae);r||(r=document.createElement("span"),r.setAttribute("id",_Ae),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,lNr,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},jN=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||wP.isSsr)return{width:0,height:0};if(!Llt.enableCache)return EAe(t,r);var n=cNr(t,r),s=kAe.get(n);if(s)return s;var a=EAe(t,r);return kAe.set(n,a),a},$lt;function uNr(e,t,r){return(t=dNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dNr(e){var t=fNr(e,"string");return typeof t=="symbol"?t:t+""}function fNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,jAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,hNr=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,pNr=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,mNr={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},gNr=["cm","mm","pt","pc","in","Q","px"];function yNr(e){return gNr.includes(e)}var hk="NaN";function vNr(e,t){return e*mNr[t]}class Ml{static parse(t){var r,[,n,s]=(r=pNr.exec(t))!==null&&r!==void 0?r:[];return n==null?Ml.NaN:new Ml(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Wy(t)&&(this.unit=""),r!==""&&!hNr.test(r)&&(this.num=NaN,this.unit=""),yNr(r)&&(this.num=vNr(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new Ml(NaN,""):new Ml(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Ml(NaN,""):new Ml(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ml(NaN,""):new Ml(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ml(NaN,""):new Ml(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wy(this.num)}}$lt=Ml;uNr(Ml,"NaN",new $lt(NaN,""));function Flt(e){if(e==null||e.includes(hk))return hk;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,a]=(r=CAe.exec(t))!==null&&r!==void 0?r:[],i=Ml.parse(n??""),l=Ml.parse(a??""),c=s==="*"?i.multiply(l):i.divide(l);if(c.isNaN())return hk;t=t.replace(CAe,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,h]=(u=jAe.exec(t))!==null&&u!==void 0?u:[],p=Ml.parse(d??""),m=Ml.parse(h??""),g=f==="+"?p.add(m):p.subtract(m);if(g.isNaN())return hk;t=t.replace(jAe,g.toString())}return t}var TAe=/\(([^()]*)\)/;function bNr(e){for(var t=e,r;(r=TAe.exec(t))!=null;){var[,n]=r;t=t.replace(TAe,Flt(n))}return t}function xNr(e){var t=e.replace(/\s+/g,"");return t=bNr(t),t=Flt(t),t}function wNr(e){try{return xNr(e)}catch{return hk}}function QH(e){var t=wNr(e.slice(5,-1));return t===hk?"":t}var SNr=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],ONr=["dx","dy","angle","className","breakAll"];function Hae(){return Hae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hae.apply(null,arguments)}function NAe(e,t){if(e==null)return{};var r,n,s=kNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function kNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var zlt=/[ \f\n\r\t\v\u2028\u2029]+/,Blt=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];Sl(t)||(r?s=t.toString().split(""):s=t.toString().split(zlt));var a=s.map(l=>({word:l,width:jN(l,n).width})),i=r?0:jN(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:i}}catch{return null}};function Ult(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function _Nr(e){return Sl(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Vlt=(e,t,r,n)=>e.reduce((s,a)=>{var{word:i,width:l}=a,c=s[s.length-1];if(c&&l!=null&&(t==null||n||c.width+l+r<Number(t)))c.words.push(i),c.width+=l+r;else{var u={words:[i],width:l};s.push(u)}return s},[]),qlt=e=>e.reduce((t,r)=>t.width>r.width?t:r),ENr="…",AAe=(e,t,r,n,s,a,i,l)=>{var c=e.slice(0,t),u=Blt({breakAll:r,style:n,children:c+ENr});if(!u)return[!1,[]];var d=Vlt(u.wordsWithComputedWidth,a,i,l),f=d.length>s||qlt(d).width>Number(a);return[f,d]},CNr=(e,t,r,n,s)=>{var{maxLines:a,children:i,style:l,breakAll:c}=e,u=qr(a),d=String(i),f=Vlt(t,n,r,s);if(!u||s)return f;var h=f.length>a||qlt(f).width>Number(n);if(!h)return f;for(var p=0,m=d.length-1,g=0,y;p<=m&&g<=d.length-1;){var x=Math.floor((p+m)/2),w=x-1,[S,k]=AAe(d,w,c,l,a,n,r,s),[_]=AAe(d,x,c,l,a,n,r,s);if(!S&&!_&&(p=x+1),S&&_&&(m=x-1),!S&&_){y=k;break}g++}return y||f},IAe=e=>{var t=Sl(e)?[]:e.toString().split(zlt);return[{words:t,width:void 0}]},jNr=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:a,maxLines:i}=e;if((t||r)&&!wP.isSsr){var l,c,u=Blt({breakAll:a,children:n,style:s});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return IAe(n);return CNr({breakAll:a,children:n,maxLines:i,style:s},l,c,t,!!r)}return IAe(n)},Hlt="#808080",TNr={angle:0,breakAll:!1,capHeight:"0.71em",fill:Hlt,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Tpe=b.forwardRef((e,t)=>{var r=nd(e,TNr),{x:n,y:s,lineHeight:a,capHeight:i,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=r,f=NAe(r,SNr),h=b.useMemo(()=>jNr({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:p,dy:m,angle:g,className:y,breakAll:x}=f,w=NAe(f,ONr);if(!eg(n)||!eg(s)||h.length===0)return null;var S=Number(n)+(qr(p)?p:0),k=Number(s)+(qr(m)?m:0);if(!zs(S)||!zs(k))return null;var _;switch(d){case"start":_=QH("calc(".concat(i,")"));break;case"middle":_=QH("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(i," / 2))"));break;default:_=QH("calc(".concat(h.length-1," * -").concat(a,")"));break}var E=[],T=h[0];if(c&&T!=null){var j=T.width,{width:N}=f;E.push("scale(".concat(qr(N)&&qr(j)?N/j:1,")"))}return g&&E.push("rotate(".concat(g,", ").concat(S,", ").concat(k,")")),E.length&&(w.transform=E.join(" ")),b.createElement("text",Hae({},su(w),{ref:t,x:S,y:k,className:wa("recharts-text",y),textAnchor:u,fill:l.includes("url")?Hlt:l}),h.map((I,P)=>{var R=I.words.join(x?"":" ");return b.createElement("tspan",{x:S,dy:P===0?_:a,key:"".concat(R,"-").concat(P)},R)}))});Tpe.displayName="Text";function RAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function nm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RAe(Object(r),!0).forEach(function(n){NNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NNr(e,t,r){return(t=ANr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ANr(e){var t=INr(e,"string");return typeof t=="symbol"?t:t+""}function INr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var RNr=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:a,y:i,height:l,upperWidth:c,lowerWidth:u}=Ohe(t),d=a,f=a+(c-u)/2,h=(d+f)/2,p=(c+u)/2,m=d+c/2,g=l>=0?1:-1,y=g*n,x=g>0?"end":"start",w=g>0?"start":"end",S=c>=0?1:-1,k=S*n,_=S>0?"end":"start",E=S>0?"start":"end",T=s;if(r==="top"){var j={x:d+c/2,y:i-y,horizontalAnchor:"middle",verticalAnchor:x};return T&&(j.height=Math.max(i-T.y,0),j.width=c),j}if(r==="bottom"){var N={x:f+u/2,y:i+l+y,horizontalAnchor:"middle",verticalAnchor:w};return T&&(N.height=Math.max(T.y+T.height-(i+l),0),N.width=u),N}if(r==="left"){var I={x:h-k,y:i+l/2,horizontalAnchor:_,verticalAnchor:"middle"};return T&&(I.width=Math.max(I.x-T.x,0),I.height=l),I}if(r==="right"){var P={x:h+p+k,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"};return T&&(P.width=Math.max(T.x+T.width-P.x,0),P.height=l),P}var R=T?{width:p,height:l}:{};return r==="insideLeft"?nm({x:h+k,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideRight"?nm({x:h+p-k,y:i+l/2,horizontalAnchor:_,verticalAnchor:"middle"},R):r==="insideTop"?nm({x:d+c/2,y:i+y,horizontalAnchor:"middle",verticalAnchor:w},R):r==="insideBottom"?nm({x:f+u/2,y:i+l-y,horizontalAnchor:"middle",verticalAnchor:x},R):r==="insideTopLeft"?nm({x:d+k,y:i+y,horizontalAnchor:E,verticalAnchor:w},R):r==="insideTopRight"?nm({x:d+c-k,y:i+y,horizontalAnchor:_,verticalAnchor:w},R):r==="insideBottomLeft"?nm({x:f+k,y:i+l-y,horizontalAnchor:E,verticalAnchor:x},R):r==="insideBottomRight"?nm({x:f+u-k,y:i+l-y,horizontalAnchor:_,verticalAnchor:x},R):r&&typeof r=="object"&&(qr(r.x)||O1(r.x))&&(qr(r.y)||O1(r.y))?nm({x:a+wx(r.x,p),y:i+wx(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},R):nm({x:m,y:i+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},PNr=["labelRef"],MNr=["content"];function PAe(e,t){if(e==null)return{};var r,n,s=DNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function MAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MAe(Object(r),!0).forEach(function(n){LNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LNr(e,t,r){return(t=$Nr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Nr(e){var t=FNr(e,"string");return typeof t=="symbol"?t:t+""}function FNr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wy(){return wy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wy.apply(null,arguments)}var Qlt=b.createContext(null),zNr=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:s,width:a,height:i,children:l}=e,c=b.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:s,width:a,height:i}),[t,r,n,s,a,i]);return b.createElement(Qlt.Provider,{value:c},l)},Wlt=()=>{var e=b.useContext(Qlt),t=a9();return e||(t?Ohe(t):void 0)},BNr=b.createContext(null),UNr=()=>{var e=b.useContext(BNr),t=en(zit);return e||t},VNr=e=>{var{value:t,formatter:r}=e,n=Sl(e.children)?t:e.children;return typeof r=="function"?r(n):n},Npe=e=>e!=null&&typeof e=="function",qNr=(e,t)=>{var r=ch(t-e),n=Math.min(Math.abs(t-e),360);return r*n},HNr=(e,t,r,n,s)=>{var{offset:a,className:i}=e,{cx:l,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:h,clockWise:p}=s,m=(u+d)/2,g=qNr(f,h),y=g>=0?1:-1,x,w;switch(t){case"insideStart":x=f+y*a,w=p;break;case"insideEnd":x=h-y*a,w=!p;break;case"end":x=h+y*a,w=p;break;default:throw new Error("Unsupported position ".concat(t))}w=g<=0?w:!w;var S=Ul(l,c,m,x),k=Ul(l,c,m,x+(w?1:-1)*359),_="M".concat(S.x,",").concat(S.y,`
292
292
  A`).concat(m,",").concat(m,",0,1,").concat(w?0:1,`,
293
- `).concat(k.x,",").concat(k.y),E=Sl(e.id)?GA("recharts-radial-line-"):e.id;return b.createElement("text",wy({},n,{dominantBaseline:"central",className:wa("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},QNr=(e,t,r)=>{var{cx:n,cy:s,innerRadius:a,outerRadius:i,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(r==="outside"){var{x:d,y:f}=Ul(n,s,i+t,u);return{x:d,y:f,textAnchor:d>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var h=(a+i)/2,{x:p,y:m}=Ul(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},_$=e=>e!=null&&"cx"in e&&qr(e.cx),WNr={angle:0,offset:5,zIndex:Zc.label,position:"middle",textBreakAll:!1};function GNr(e){if(!_$(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function bb(e){var t=nd(e,WNr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=UNr(),h=Wlt(),p=s==="center"?h:f??h,m,g,y;r==null?m=p:_$(r)?m=r:m=Ohe(r);var x=GNr(m);if(!m||Sl(a)&&Sl(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=qT(qT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=PAe(w,PNr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=PAe(w,MNr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=VNr(t);var T=su(t);if(_$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return HNr(t,s,g,T,m);y=QNr(m,t.offset,t.position)}else{if(!x)return null;var j=RNr({viewBox:x,position:s,offset:t.offset,parentViewBox:_$(n)?void 0:n});y=qT(qT({x:j.x,y:j.y,textAnchor:j.horizontalAnchor,verticalAnchor:j.verticalAnchor},j.width!==void 0?{width:j.width}:{}),j.height!==void 0?{height:j.height}:{})}return b.createElement(xv,{zIndex:t.zIndex},b.createElement(Tpe,wy({ref:d,className:wa("recharts-label",c)},T,y,{textAnchor:Ult(T.textAnchor)?T.textAnchor:y.textAnchor,breakAll:u}),g))}bb.displayName="Label";var ZNr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(bb,wy({key:"label-implicit"},n)):eg(e)?b.createElement(bb,wy({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===bb?b.cloneElement(e,qT({key:"label-implicit"},n)):b.createElement(bb,wy({key:"label-implicit",content:e},n)):Npe(e)?b.createElement(bb,wy({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(bb,wy({},e,{key:"label-implicit"},n)):null};function YNr(e){var{label:t,labelRef:r}=e,n=Wlt();return ZNr(t,n,r)||null}var XNr=["valueAccessor"],KNr=["dataKey","clockWise","id","textBreakAll","zIndex"];function w4(){return w4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w4.apply(null,arguments)}function DAe(e,t){if(e==null)return{};var r,n,s=JNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function JNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var eAr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(_Nr(t))return t},Glt=b.createContext(void 0),tAr=Glt.Provider,Zlt=b.createContext(void 0);Zlt.Provider;function rAr(){return b.useContext(Glt)}function nAr(){return b.useContext(Zlt)}function E$(e){var{valueAccessor:t=eAr}=e,r=DAe(e,XNr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=DAe(r,KNr),u=rAr(),d=nAr(),f=u||d;return!f||!f.length?null:b.createElement(xv,{zIndex:l??Zc.label},b.createElement(Qy,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=Sl(n)?t(h,p):Ql(h.payload,n),y=Sl(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(bb,w4({key:"label-".concat(p)},su(h),c,y,{fill:(m=r.fill)!==null&&m!==void 0?m:h.fill,parentViewBox:h.parentViewBox,value:g,textBreakAll:i,viewBox:h.viewBox,index:p,zIndex:0}))})))}E$.displayName="LabelList";function sAr(e){var{label:t}=e;return t?t===!0?b.createElement(E$,{key:"labelList-implicit"}):b.isValidElement(t)||Npe(t)?b.createElement(E$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(E$,w4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Qae(){return Qae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qae.apply(null,arguments)}var Ylt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=wa("recharts-dot",s);return qr(t)&&qr(r)&&qr(n)?b.createElement("circle",Qae({},Jm(e),phe(e),{className:a,cx:t,cy:r,r:n})):null},aAr={radiusAxis:{},angleAxis:{}},Xlt=Ec({name:"polarAxis",initialState:aAr,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:QPn,removeRadiusAxis:WPn,addAngleAxis:GPn,removeAngleAxis:ZPn}=Xlt.actions,iAr=Xlt.reducer;function oAr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var WH={exports:{}},Js={};var LAe;function lAr(){if(LAe)return Js;LAe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type,y){case r:case s:case n:case u:case d:return y;default:switch(y=y&&y.$$typeof,y){case l:case i:case c:case h:case f:case a:return y;default:return x}}case t:return x}}}return Js.ContextConsumer=i,Js.ContextProvider=a,Js.Element=e,Js.ForwardRef=c,Js.Fragment=r,Js.Lazy=h,Js.Memo=f,Js.Portal=t,Js.Profiler=s,Js.StrictMode=n,Js.Suspense=u,Js.SuspenseList=d,Js.isAsyncMode=function(){return!1},Js.isConcurrentMode=function(){return!1},Js.isContextConsumer=function(y){return g(y)===i},Js.isContextProvider=function(y){return g(y)===a},Js.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Js.isForwardRef=function(y){return g(y)===c},Js.isFragment=function(y){return g(y)===r},Js.isLazy=function(y){return g(y)===h},Js.isMemo=function(y){return g(y)===f},Js.isPortal=function(y){return g(y)===t},Js.isProfiler=function(y){return g(y)===s},Js.isStrictMode=function(y){return g(y)===n},Js.isSuspense=function(y){return g(y)===u},Js.isSuspenseList=function(y){return g(y)===d},Js.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===s||y===n||y===u||y===d||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===a||y.$$typeof===i||y.$$typeof===c||y.$$typeof===m||y.getModuleId!==void 0)},Js.typeOf=g,Js}var $Ae;function cAr(){return $Ae||($Ae=1,WH.exports=lAr()),WH.exports}cAr();var Klt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,GH={},FAe;function uAr(){return FAe||(FAe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(GH)),GH}var ZH,zAe;function dAr(){return zAe||(zAe=1,ZH=uAr().isPlainObject),ZH}var fAr=dAr();const hAr=Uo(fAr);var BAe,UAe,VAe,qAe,HAe;function QAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function WAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QAe(Object(r),!0).forEach(function(n){pAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pAr(e,t,r){return(t=mAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mAr(e){var t=gAr(e,"string");return typeof t=="symbol"?t:t+""}function gAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function S4(){return S4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S4.apply(null,arguments)}function nT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var GAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(BAe||(BAe=nT(["M ",",",""])),e,t),i+=Qi(UAe||(UAe=nT(["L ",",",""])),e+r,t),i+=Qi(VAe||(VAe=nT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(qAe||(qAe=nT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(HAe||(HAe=nT(["L ",","," Z"])),e,t),i},yAr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},vAr=e=>{var t=nd(e,yAr),{x:r,y:n,upperWidth:s,lowerWidth:a,height:i,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,h=b.useRef(null),[p,m]=b.useState(-1),g=b.useRef(s),y=b.useRef(a),x=b.useRef(i),w=b.useRef(r),S=b.useRef(n),k=Che(e,"trapezoid-");if(b.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var D=h.current.getTotalLength();D&&m(D)}catch{}},[]),r!==+r||n!==+n||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var _=wa("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",S4({},su(t),{className:_,d:GAe(r,n,s,a,i)})));var E=g.current,T=y.current,j=x.current,N=w.current,I=S.current,P="0px ".concat(p===-1?1:p,"px"),R="".concat(p,"px ").concat(p,"px"),B=pit(["strokeDasharray"],u,c);return b.createElement(Ehe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},D=>{var $=Mu(E,s,D),U=Mu(T,a,D),z=Mu(j,i,D),H=Mu(N,r,D),Q=Mu(I,n,D);h.current&&(g.current=$,y.current=U,x.current=z,w.current=H,S.current=Q);var L=D>0?{transition:B,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",S4({},su(t),{className:_,d:GAe(H,Q,$,U,z),ref:h,style:WAe(WAe({},L),t.style)}))})},bAr=["option","shapeType","activeClassName","inActiveClassName"];function xAr(e,t){if(e==null)return{};var r,n,s=wAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ZAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function O4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZAe(Object(r),!0).forEach(function(n){SAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SAr(e,t,r){return(t=OAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OAr(e){var t=kAr(e,"string");return typeof t=="symbol"?t:t+""}function kAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _Ar(e,t){return O4(O4({},t),e)}function EAr(e,t){return e==="symbols"}function YAe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(vit,r);case"trapezoid":return b.createElement(vAr,r);case"sector":return b.createElement(wit,r);case"symbols":if(EAr(t))return b.createElement(sat,r);break;case"curve":return b.createElement(hit,r);default:return null}}function CAr(e){return b.isValidElement(e)?e.props:e}function jAr(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=xAr(e,bAr),i;if(b.isValidElement(t))i=b.cloneElement(t,O4(O4({},a),CAr(t)));else if(typeof t=="function")i=t(a,a.index);else if(hAr(t)&&typeof t!="boolean"){var l=_Ar(t,a);i=b.createElement(YAe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(YAe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Qy,{className:n},i):b.createElement(Qy,{className:s},i)}function TAr(e){var{tooltipEntrySettings:t}=e,r=Vo(),n=sd(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(LCr(t)):s.current!==t&&r($Cr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(FCr(s.current)),s.current=null)},[r]),null}function NAr(e){var{legendPayload:t}=e,r=Vo(),n=sd(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(K1r(t)):s.current!==t&&r(J1r({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(eSr(s.current)),s.current=null)},[r]),null}var YH,AAr=()=>{var[e]=b.useState(()=>GA("uid-"));return e},IAr=(YH=Y1.useId)!==null&&YH!==void 0?YH:AAr;function RAr(e,t){var r=IAr();return t||(e?"".concat(e,"-").concat(r):r)}var PAr=b.createContext(void 0),MAr=e=>{var{id:t,type:r,children:n}=e,s=RAr("recharts-".concat(r),t);return b.createElement(PAr.Provider,{value:s},n(s))},DAr={cartesianItems:[],polarItems:[]},Jlt=Ec({name:"graphicalItems",initialState:DAr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:ci()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:ci()},removeCartesianGraphicalItem:{reducer(e,t){var r=uh(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:ci()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:ci()},removePolarGraphicalItem:{reducer(e,t){var r=uh(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:ci()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:ci()}}}),{addCartesianGraphicalItem:LAr,replaceCartesianGraphicalItem:$Ar,removeCartesianGraphicalItem:FAr,addPolarGraphicalItem:YPn,removePolarGraphicalItem:XPn,replacePolarGraphicalItem:KPn}=Jlt.actions,zAr=Jlt.reducer,BAr=e=>{var t=Vo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(LAr(e)):r.current!==e&&t($Ar({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(FAr(r.current)),r.current=null)},[t]),null},UAr=b.memo(BAr),VAr=["points"];function XAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XAe(Object(r),!0).forEach(function(n){qAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qAr(e,t,r){return(t=HAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HAr(e){var t=QAr(e,"string");return typeof t=="symbol"?t:t+""}function QAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k4(){return k4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k4.apply(null,arguments)}function WAr(e,t){if(e==null)return{};var r,n,s=GAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function GAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ZAr(e){var{option:t,dotProps:r,className:n}=e;if(b.isValidElement(t))return b.cloneElement(t,r);if(typeof t=="function")return t(r);var s=wa(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=WAr(a,VAr);return b.createElement(Ylt,k4({},l,{className:s}))}function YAr(e,t){return e==null?!1:t?!0:e.length===1}function XAr(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Zc.scatter}=e;if(!YAr(t,r))return null;var d=Klt(r),f=cxr(r),h=t.map((m,g)=>{var y,x,w=XH(XH(XH({r:3},i),f),{},{index:g,cx:(y=m.x)!==null&&y!==void 0?y:void 0,cy:(x=m.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return b.createElement(ZAr,{key:"dot-".concat(g),option:r,dotProps:w,className:s})}),p={};return l&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),b.createElement(xv,{zIndex:u},b.createElement(Qy,k4({className:n},p),h))}function KAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function JAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KAe(Object(r),!0).forEach(function(n){KAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KAr(e,t,r){return(t=JAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JAr(e){var t=eIr(e,"string");return typeof t=="symbol"?t:t+""}function eIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tIr={xAxis:{},yAxis:{},zAxis:{}},ect=Ec({name:"cartesianAxis",initialState:tIr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:ci()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:ci()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:ci()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:ci()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:ci()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:ci()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:ci()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:ci()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:ci()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&n===i[1]&&n!==s.width&&Math.abs(n-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...i,n].slice(-3);e.yAxis[r]=JAe(JAe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:rIr,replaceXAxis:nIr,removeXAxis:sIr,addYAxis:aIr,replaceYAxis:iIr,removeYAxis:oIr,addZAxis:JPn,replaceZAxis:eMn,removeZAxis:tMn,updateYAxisWidth:lIr}=ect.actions,cIr=ect.reducer,uIr=Xe([Yl],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),dIr=Xe([uIr,pv,mv],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Ape=()=>en(dIr),fIr=()=>en(Ljr);function eIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function KH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eIe(Object(r),!0).forEach(function(n){hIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hIr(e,t,r){return(t=pIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pIr(e){var t=mIr(e,"string");return typeof t=="symbol"?t:t+""}function mIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gIr=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var l={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KH(KH(KH({},l),zz(s)),phe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Ylt,c),b.createElement(Qy,{className:"recharts-active-dot",clipPath:i},u)};function yIr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=Zc.activeDot}=e,l=en(iI),c=fIr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return Sl(u)?null:b.createElement(xv,{zIndex:i},b.createElement(gIr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var vIr=e=>{var{chartData:t}=e,r=Vo(),n=sd();return b.useEffect(()=>n?()=>{}:(r(vAe(t)),()=>{r(vAe(void 0))}),[t,r,n]),null},tIe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},tct=Ec({name:"brush",initialState:tIe,reducers:{setBrushSettings(e,t){return t.payload==null?tIe:t.payload}}}),{setBrushSettings:rMn}=tct.actions,bIr=tct.reducer;function xIr(e){return(e%180+180)%180}var wIr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=xIr(s),i=a*Math.PI/180,l=Math.atan(n/r),c=i>l&&i<Math.PI-l?n/Math.sin(i):r/Math.cos(i);return Math.abs(c)},SIr={dots:[],areas:[],lines:[]},rct=Ec({name:"referenceElements",initialState:SIr,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=uh(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=uh(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=uh(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:nMn,removeDot:sMn,addArea:aMn,removeArea:iMn,addLine:oMn,removeLine:lMn}=rct.actions,OIr=rct.reducer,kIr=b.createContext(void 0),_Ir=e=>{var{children:t}=e,[r]=b.useState("".concat(GA("recharts"),"-clip")),n=Ape();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(kIr.Provider,{value:r},b.createElement("defs",null,b.createElement("clipPath",{id:r},b.createElement("rect",{x:s,y:a,height:l,width:i}))),t)};function nct(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function EIr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return wIr(n,r)}function CIr(e,t,r){var n=r==="width",{x:s,y:a,width:i,height:l}=e;return t===1?{start:n?s:a,end:n?s+i:a+l}:{start:n?s+i:a+l,end:n?s:a}}function lI(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-s)<=0}function jIr(e,t){return nct(e,t+1)}function TIr(e,t,r,n,s){for(var a=(n||[]).slice(),{start:i,end:l}=t,c=0,u=1,d=i,f=function(){var m=n?.[c];if(m===void 0)return{v:nct(n,u)};var g=c,y,x=()=>(y===void 0&&(y=r(m,g)),y),w=m.coordinate,S=c===0||lI(e,w,x,d,l);S||(c=0,d=i,u+=1),S&&(d=w+e*(x()/2+s),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function NIr(e,t,r,n,s){var a=(n||[]).slice(),i=a.length;if(i===0)return[];for(var{start:l,end:c}=t,u=1;u<=i;u++){for(var d=(i-1)%u,f=l,h=!0,p=function(){var k=n[g];if(k==null)return 0;var _=g,E,T=()=>(E===void 0&&(E=r(k,_)),E),j=k.coordinate,N=g===d||lI(e,j,T,f,c);if(!N)return h=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=p(),!(m!==0&&m===1));g+=u);if(h){for(var y=[],x=d;x<i;x+=u){var w=n[x];w!=null&&y.push(w)}return y}}return[]}function rIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function rc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rIe(Object(r),!0).forEach(function(n){AIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AIr(e,t,r){return(t=IIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IIr(e){var t=RIr(e,"string");return typeof t=="symbol"?t:t+""}function RIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PIr(e,t,r,n,s){for(var a=(n||[]).slice(),i=a.length,{start:l}=t,{end:c}=t,u=function(h){var p=a[h];if(p==null)return 1;var m=p,g,y=()=>(g===void 0&&(g=r(p,h)),g);if(h===i-1){var x=e*(m.coordinate+e*y()/2-c);a[h]=m=rc(rc({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=rc(rc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=lI(e,m.tickCoord,y,l,c);w&&(c=m.tickCoord-e*(y()/2+s),a[h]=rc(rc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function MIr(e,t,r,n,s,a){var i=(n||[]).slice(),l=i.length,{start:c,end:u}=t;if(a){var d=n[l-1];if(d!=null){var f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);if(i[l-1]=d=rc(rc({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=lI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=rc(rc({},d),{},{isShow:!0}))}}}for(var m=a?l-1:l,g=function(w){var S=i[w];if(S==null)return 1;var k=S,_,E=()=>(_===void 0&&(_=r(S,w)),_);if(w===0){var T=e*(k.coordinate-e*E()/2-c);i[w]=k=rc(rc({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=rc(rc({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=lI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=rc(rc({},k),{},{isShow:!0}))}},y=0;y<m;y++)g(y);return i}function Ipe(e,t,r){var{tick:n,ticks:s,viewBox:a,minTickGap:i,orientation:l,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!n)return[];if(qr(c)||wP.isSsr){var h;return(h=jIr(s,qr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?jN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?EIr(jN(T,{fontSize:t,letterSpacing:r}),g,f):jN(T,{fontSize:t,letterSpacing:r})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?ch(w.coordinate-x.coordinate):1,k=CIr(a,S,m);return c==="equidistantPreserveStart"?TIr(S,k,y,s,i):c==="equidistantPreserveEnd"?NIr(S,k,y,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=MIr(S,k,y,s,i,c==="preserveStartEnd"):p=PIr(S,k,y,s,i),p.filter(_=>_.isShow))}var DIr=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=e,i=0;if(t){Array.from(t).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>i&&(i=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+a,u=i+c+l+(r?n:0);return Math.round(u)}return 0},LIr={xAxis:{},yAxis:{}},sct=Ec({name:"renderedTicks",initialState:LIr,reducers:{setRenderedTicks:(e,t)=>{var{axisType:r,axisId:n,ticks:s}=t.payload;e[r][n]=s},removeRenderedTicks:(e,t)=>{var{axisType:r,axisId:n}=t.payload;delete e[r][n]}}}),{setRenderedTicks:$Ir,removeRenderedTicks:FIr}=sct.actions,zIr=sct.reducer,BIr=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function UIr(e,t){if(e==null)return{};var r,n,s=VIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function VIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function T1(){return T1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},T1.apply(null,arguments)}function nIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nIe(Object(r),!0).forEach(function(n){qIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qIr(e,t,r){return(t=HIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HIr(e){var t=QIr(e,"string");return typeof t=="symbol"?t:t+""}function QIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dy={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:Zc.axis};function WIr(e){var{x:t,y:r,width:n,height:s,orientation:a,mirror:i,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Hi(Hi(Hi({},c),Jm(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=Hi(Hi({},u),{},{x1:t,y1:r+d*s,x2:t+n,y2:r+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=Hi(Hi({},u),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return b.createElement("line",T1({},u,{className:wa("recharts-cartesian-axis-line",qz(l,"className"))}))}function GIr(e,t,r,n,s,a,i,l,c){var u,d,f,h,p,m,g=l?-1:1,y=e.tickSize||i,x=qr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=r+ +!l*s,f=h-g*y,m=f-g*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!l*n,u=d-g*y,p=u-g*c,m=x;break;case"right":f=h=e.coordinate,d=t+ +l*n,u=d+g*y,p=u+g*c,m=x;break;default:u=d=e.coordinate,h=r+ +l*s,f=h+g*y,m=f+g*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:m}}}function ZIr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function YIr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function XIr(e){var{option:t,tickProps:r,value:n}=e,s,a=wa(r.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))s=b.cloneElement(t,Hi(Hi({},r),{},{className:a}));else if(typeof t=="function")s=t(Hi(Hi({},r),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=wa(i,oAr(t))),s=b.createElement(Tpe,T1({},r,{className:i}),n)}return s}function KIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Vo();return b.useEffect(()=>{if(n==null||r==null)return hS;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s($Ir({ticks:a,axisId:n,axisType:r})),()=>{s(FIr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var JIr=b.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:i,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:f,x:h,y:p,width:m,height:g,tickSize:y,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:k,events:_,axisType:E,axisId:T}=e,j=Ipe(Hi(Hi({},k),{},{ticks:r}),w,S),N=Jm(k),I=zz(n),P=Ult(N.textAnchor)?N.textAnchor:ZIr(d,f),R=YIr(d,f),B={};typeof s=="object"&&(B=s);var D=Hi(Hi({},N),{},{fill:"none"},B),$=j.map(H=>Hi({entry:H},GIr(H,h,p,m,g,d,y,f,x))),U=$.map(H=>{var{entry:Q,line:L}=H;return b.createElement(Qy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&b.createElement("line",T1({},D,L,{className:wa("recharts-cartesian-axis-tick-line",qz(s,"className"))})))}),z=$.map((H,Q)=>{var L,Z,{entry:V,tick:M}=H,W=Hi(Hi(Hi(Hi({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},M),{},{index:Q,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(L=(Z=u?.angle)!==null&&Z!==void 0?Z:N.angle)!==null&&L!==void 0?L:0}),G=Hi(Hi({},W),I);return b.createElement(Qy,T1({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},h0r(_,V,Q)),n&&b.createElement(XIr,{option:n,tickProps:G,value:"".concat(typeof i=="function"?i(V.value,Q):V.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(KIr,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(xv,{zIndex:Zc.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),U.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},U))}),eRr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=UIr(e,BIr),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return DIr({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var y=b.useCallback(x=>{if(x){var w=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=w;var S=w[0];if(S){var k=window.getComputedStyle(S),_=k.fontSize,E=k.letterSpacing;(_!==f||E!==p)&&(h(_),m(E))}}},[f,p]);return i||n!=null&&n<=0||s!=null&&s<=0?null:b.createElement(xv,{zIndex:e.zIndex},b.createElement(Qy,{className:wa("recharts-cartesian-axis",a)},b.createElement(WIr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Jm(e)}),b.createElement(JIr,{ref:y,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:p,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:u}),b.createElement(zNr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(YNr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Rpe=b.forwardRef((e,t)=>{var r=nd(e,Dy);return b.createElement(eRr,T1({},r,{ref:t}))});Rpe.displayName="CartesianAxis";var tRr=["x1","y1","x2","y2","key"],rRr=["offset"],nRr=["xAxisId","yAxisId"],sRr=["xAxisId","yAxisId"];function sIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sIe(Object(r),!0).forEach(function(n){aRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aRr(e,t,r){return(t=iRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iRr(e){var t=oRr(e,"string");return typeof t=="symbol"?t:t+""}function oRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ew(){return Ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ew.apply(null,arguments)}function _4(e,t){if(e==null)return{};var r,n,s=lRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function lRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var cRr=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:i,ry:l}=e;return b.createElement("rect",{x:n,y:s,ry:l,width:a,height:i,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function act(e){var{option:t,lineItemProps:r}=e,n;if(b.isValidElement(t))n=b.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:a,y1:i,x2:l,y2:c,key:u}=r,d=_4(r,tRr),f=(s=Jm(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=_4(f,rRr);n=b.createElement("line",Ew({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function uRr(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_4(e,nRr),c=s.map((u,d)=>{var f=cc(cc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(act,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function dRr(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_4(e,sRr),c=s.map((u,d)=>{var f=cc(cc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(act,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function fRr(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:a,height:i,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var u=l.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%t.length;return b.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:g,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function hRr(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:i,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%r.length;return b.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:g,height:l,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var pRr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return Hat(Ipe(cc(cc(cc({},Dy),r),{},{ticks:Qat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},mRr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return Hat(Ipe(cc(cc(cc({},Dy),r),{},{ticks:Qat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},gRr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Zc.grid};function ict(e){var t=eit(),r=tit(),n=Jat(),s=cc(cc({},nd(e,gRr)),{},{x:qr(e.x)?e.x:n.left,y:qr(e.y)?e.y:n.top,width:qr(e.width)?e.width:n.width,height:qr(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:i,x:l,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:p}=s,m=sd(),g=en(N=>aAe(N,"xAxis",a,m)),y=en(N=>aAe(N,"yAxis",i,m));if(!tg(u)||!tg(d)||!qr(l)||!qr(c))return null;var x=s.verticalCoordinatesGenerator||pRr,w=s.horizontalCoordinatesGenerator||mRr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:y?cc(cc({},y),{},{ticks:_?h:y.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);Y5(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}if((!k||!k.length)&&typeof x=="function"){var T=p&&p.length,j=x({xAxis:g?cc(cc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);Y5(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(xv,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(cRr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(fRr,Ew({},s,{horizontalPoints:S})),b.createElement(hRr,Ew({},s,{verticalPoints:k})),b.createElement(uRr,Ew({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:y})),b.createElement(dRr,Ew({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:y}))))}ict.displayName="CartesianGrid";var yRr={},oct=Ec({name:"errorBars",initialState:yRr,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:cMn,replaceErrorBar:uMn,removeErrorBar:dMn}=oct.actions,vRr=oct.reducer,bRr=["children"];function xRr(e,t){if(e==null)return{};var r,n,s=wRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var SRr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},ORr=b.createContext(SRr);function kRr(e){var{children:t}=e,r=xRr(e,bRr);return b.createElement(ORr.Provider,{value:r},t)}function lct(e,t){var r,n,s=en(u=>yv(u,e)),a=en(u=>vv(u,t)),i=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Yo.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:Xo.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function _Rr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=Ape(),{needClipX:a,needClipY:i,needClip:l}=lct(t,r);if(!l||!s)return null;var{x:c,y:u,width:d,height:f}=s;return b.createElement("clipPath",{id:"clipPath-".concat(n)},b.createElement("rect",{x:a?c:c-d/2,y:i?u:u-f/2,width:a?d:d*2,height:i?f:f*2}))}var cct=(e,t,r,n)=>llt(e,"xAxis",t,n),uct=(e,t,r,n)=>olt(e,"xAxis",t,n),dct=(e,t,r,n)=>llt(e,"yAxis",r,n),fct=(e,t,r,n)=>olt(e,"yAxis",r,n),ERr=Xe([Fi,cct,dct,uct,fct],(e,t,r,n,s)=>hv(e,"xAxis")?Z5(t,n,!1):Z5(r,s,!1)),CRr=(e,t,r,n,s)=>s;function jRr(e){return e.type==="line"}var TRr=Xe([Aot,CRr],(e,t)=>e.filter(jRr).find(r=>r.id===t)),NRr=Xe([Fi,cct,dct,uct,fct,TRr,ERr,jhe],(e,t,r,n,s,a,i,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(a==null||t==null||r==null||n==null||s==null||n.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:h}=a,p;if(h!=null&&h.length>0?p=h:p=c?.slice(u,d+1),p!=null)return XRr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function ARr(e){var t=zz(e),r=3,n=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),l=Number(a);return(Number.isNaN(i)||i<0)&&(i=r),(Number.isNaN(l)||l<0)&&(l=n),{r:i,strokeWidth:l}}return{r,strokeWidth:n}}var IRr=["id"],RRr=["type","layout","connectNulls","needClip","shape"],PRr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function cI(){return cI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cI.apply(null,arguments)}function aIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aIe(Object(r),!0).forEach(function(n){MRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MRr(e,t,r){return(t=DRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DRr(e){var t=LRr(e,"string");return typeof t=="symbol"?t:t+""}function LRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ppe(e,t){if(e==null)return{};var r,n,s=$Rr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $Rr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var FRr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:Wat(r,t),payload:e}]},zRr=b.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:s,fill:a,name:i,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r,getPosition:hS,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Wat(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(TAr,{tooltipEntrySettings:f})}),hct=(e,t)=>"".concat(t,"px ").concat(e,"px");function BRr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var URr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return hct(t,e);for(var s=Math.floor(e/n),a=e%n,i=[],l=0,c=0;l<r.length;c+=(u=r[l])!==null&&u!==void 0?u:0,++l){var u,d=r[l];if(d!=null&&c+d>a){i=[...r.slice(0,l),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...BRr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function VRr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=Ppe(n,IRr),u=Jm(c);return b.createElement(XAr,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function qRr(e){var{showLabels:t,children:r,points:n}=e,s=b.useMemo(()=>n?.map(a=>{var i,l,c={x:(i=a.x)!==null&&i!==void 0?i:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return pm(pm({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(tAr,{value:t?s:void 0},r)}function iIe(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:s,props:a}=e,{type:i,layout:l,connectNulls:c,needClip:u,shape:d}=a,f=Ppe(a,RRr),h=pm(pm({},su(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:n,type:i,layout:l,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return b.createElement(b.Fragment,null,n?.length>1&&b.createElement(jAr,cI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement(VRr,{points:n,clipPathId:t,props:a}))}function HRr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function QRr(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:h,width:p,height:m,onAnimationEnd:g,onAnimationStart:y}=r,x=s.current,w=Che(i,"recharts-line-"),S=b.useRef(w),[k,_]=b.useState(!1),E=!k,T=b.useCallback(()=>{typeof g=="function"&&g(),_(!1)},[g]),j=b.useCallback(()=>{typeof y=="function"&&y(),_(!0)},[y]),N=HRr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(qRr,{points:i,showLabels:E},r.children,b.createElement(Ehe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Mu(P,N+P,R),D=Math.min(B,N),$;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Q=>parseFloat(Q));$=URr(D,N,U)}else $=hct(N,D);else $=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,D)),x){var z=x.length/i.length,H=R===1?i:i.map((Q,L)=>{var Z=Math.floor(L*z);if(x[Z]){var V=x[Z];return pm(pm({},Q),{},{x:Mu(V.x,Q.x,R),y:Mu(V.y,Q.y,R)})}return h?pm(pm({},Q),{},{x:Mu(p*2,Q.x,R),y:Mu(m/2,Q.y,R)}):pm(pm({},Q),{},{x:Q.x,y:Q.y})});return s.current=H,b.createElement(iIe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:$})}return b.createElement(iIe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:$})}),b.createElement(sAr,{label:r.label}))}function WRr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(QRr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var GRr=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:Ql(e.payload,t)}};class ZRr extends b.Component{render(){var{hide:t,dot:r,points:n,className:s,xAxisId:a,yAxisId:i,top:l,left:c,width:u,height:d,id:f,needClip:h,zIndex:p}=this.props;if(t)return null;var m=wa("recharts-line",s),g=f,{r:y,strokeWidth:x}=ARr(r),w=Klt(r),S=y*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(xv,{zIndex:p},b.createElement(Qy,{className:m},h&&b.createElement("defs",null,b.createElement(_Rr,{clipPathId:g,xAxisId:a,yAxisId:i}),!w&&b.createElement("clipPath",{id:"clipPath-dots-".concat(g)},b.createElement("rect",{x:c-S/2,y:l-S/2,width:u+S,height:d+S}))),b.createElement(kRr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:GRr,errorBarOffset:0},b.createElement(WRr,{props:this.props,clipPathId:g}))),b.createElement(yIr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var pct={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:Zc.line,type:"linear"};function YRr(e){var t=nd(e,pct),{activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:f,legendType:h,xAxisId:p,yAxisId:m,id:g}=t,y=Ppe(t,PRr),{needClip:x}=lct(p,m),w=Ape(),S=tC(),k=sd(),_=en(I=>NRr(I,p,m,k,g));if(S!=="horizontal"&&S!=="vertical"||_==null||w==null)return null;var{height:E,width:T,x:j,y:N}=w;return b.createElement(ZRr,cI({},y,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:h,xAxisId:p,yAxisId:m,points:_,layout:S,height:E,width:T,left:j,top:N,needClip:x}))}function XRr(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var f=Ql(u,i);if(t==="horizontal"){var h=sTe({axis:r,ticks:s,bandSize:l,entry:u,index:d}),p=Sl(f)?null:n.scale.map(f);return{x:h,y:p??null,value:f,payload:u}}var m=Sl(f)?null:r.scale.map(f),g=sTe({axis:n,ticks:a,bandSize:l,entry:u,index:d});return m==null||g==null?null:{x:m,y:g,value:f,payload:u}}).filter(Boolean)}function KRr(e){var t=nd(e,pct),r=sd();return b.createElement(MAr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(NAr,{legendPayload:FRr(t)}),b.createElement(zRr,{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:n}),b.createElement(UAr,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),b.createElement(YRr,cI({},t,{id:n}))))}var mct=b.memo(KRr,c9);mct.displayName="Line";var JRr=["domain","range"],ePr=["domain","range"];function oIe(e,t){if(e==null)return{};var r,n,s=tPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function tPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function lIe(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 gct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=oIe(e,JRr),{domain:a,range:i}=t,l=oIe(t,ePr);return!lIe(r,a)||!lIe(n,i)?!1:c9(s,l)}var rPr=["type"],nPr=["dangerouslySetInnerHTML","ticks","scale"],sPr=["id","scale"];function Wae(){return Wae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wae.apply(null,arguments)}function cIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function uIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cIe(Object(r),!0).forEach(function(n){aPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aPr(e,t,r){return(t=iPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iPr(e){var t=oPr(e,"string");return typeof t=="symbol"?t:t+""}function oPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gae(e,t){if(e==null)return{};var r,n,s=lPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function lPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function cPr(e){var t=Vo(),r=b.useRef(null),n=rit(),{type:s}=e,a=Gae(e,rPr),i=f9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return uIe(uIe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(rIr(l)):r.current!==l&&t(nIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(sIr(r.current)),r.current=null)},[t]),null}var uPr=e=>{var{xAxisId:t,className:r}=e,n=en(Zat),s=sd(),a="xAxis",i=en(x=>ilt(x,a,t,s)),l=en(x=>vCr(x,t)),c=en(x=>kCr(x,t)),u=en(x=>Cot(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Gae(e,nPr),{id:m,scale:g}=u,y=Gae(u,sPr);return b.createElement(Rpe,Wae({},p,y,{x:c.x,y:c.y,width:l.width,height:l.height,className:wa("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},dPr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:Dy.axisLine,height:Yo.height,hide:!1,includeHidden:Yo.includeHidden,interval:Yo.interval,label:!1,minTickGap:Yo.minTickGap,mirror:Yo.mirror,orientation:Yo.orientation,padding:Yo.padding,reversed:Yo.reversed,scale:Yo.scale,tick:Yo.tick,tickCount:Yo.tickCount,tickLine:Dy.tickLine,tickSize:Dy.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,xAxisId:0},fPr=e=>{var t=nd(e,dPr);return b.createElement(b.Fragment,null,b.createElement(cPr,{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}),b.createElement(uPr,t))},yct=b.memo(fPr,gct);yct.displayName="XAxis";var hPr=["type"],pPr=["dangerouslySetInnerHTML","ticks","scale"],mPr=["id","scale"];function Zae(){return Zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zae.apply(null,arguments)}function dIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dIe(Object(r),!0).forEach(function(n){gPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gPr(e,t,r){return(t=yPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yPr(e){var t=vPr(e,"string");return typeof t=="symbol"?t:t+""}function vPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yae(e,t){if(e==null)return{};var r,n,s=bPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function bPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function xPr(e){var t=Vo(),r=b.useRef(null),n=rit(),{type:s}=e,a=Yae(e,hPr),i=f9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return fIe(fIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(aIr(l)):r.current!==l&&t(iIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(oIr(r.current)),r.current=null)},[t]),null}function wPr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(Zat),c=sd(),u=Vo(),d="yAxis",f=en(E=>CCr(E,t)),h=en(E=>ECr(E,t)),p=en(E=>ilt(E,d,t,c)),m=en(E=>jot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Npe(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(lIr({id:t,width:T}))}}},[p,f,u,s,t,n,m]),f==null||h==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:x}=e,w=Yae(e,pPr),{id:S,scale:k}=m,_=Yae(m,mPr);return b.createElement(Rpe,Zae({},w,_,{ref:a,labelRef:i,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:wa("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var SPr={allowDataOverflow:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:Xo.allowDuplicatedCategory,angle:Xo.angle,axisLine:Dy.axisLine,hide:!1,includeHidden:Xo.includeHidden,interval:Xo.interval,label:!1,minTickGap:Xo.minTickGap,mirror:Xo.mirror,orientation:Xo.orientation,padding:Xo.padding,reversed:Xo.reversed,scale:Xo.scale,tick:Xo.tick,tickCount:Xo.tickCount,tickLine:Dy.tickLine,tickSize:Dy.tickSize,type:Xo.type,niceTicks:Xo.niceTicks,width:Xo.width,yAxisId:0},OPr=e=>{var t=nd(e,SPr);return b.createElement(b.Fragment,null,b.createElement(xPr,{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}),b.createElement(wPr,t))},vct=b.memo(OPr,gct);vct.displayName="YAxis";var kPr=(e,t)=>t,Mpe=Xe([kPr,Fi,zit,_l,klt,bv,Yjr,Yl],nTr);function _Pr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Dpe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(_Pr(e)){var s=e.currentTarget.getBBox();r=s.width>0?t.width/s.width:1,n=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(l,c)=>({relativeX:Math.round((l-t.left)/r),relativeY:Math.round((c-t.top)/n)});return"touches"in e?Array.from(e.touches).map(l=>i(l.clientX,l.clientY)):i(e.clientX,e.clientY)}var bct=of("mouseClick"),xct=yP();xct.startListening({actionCreator:bct,effect:(e,t)=>{var r=e.payload,n=Mpe(t.getState(),Dpe(r));n?.activeIndex!=null&&t.dispatch(UCr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Xae=of("mouseMove"),wct=yP(),SO=null,F0=null,JH=null;wct.startListening({actionCreator:Xae,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");SO!==null&&(cancelAnimationFrame(SO),SO=null),F0!==null&&(typeof s!="number"||!i)&&(clearTimeout(F0),F0=null),JH=Dpe(r);var l=()=>{var c=t.getState(),u=bpe(c,c.tooltip.settings.shared);if(!JH){SO=null,F0=null;return}if(u==="axis"){var d=Mpe(c,JH);d?.activeIndex!=null?t.dispatch(mlt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(plt())}SO=null,F0=null};if(!i){l();return}s==="raf"?SO=requestAnimationFrame(l):typeof s=="number"&&F0===null&&(F0=setTimeout(l,s))}});function EPr(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 hIe={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},Sct=Ec({name:"rootProps",initialState:hIe,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:hIe.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}}}),CPr=Sct.reducer,{updateOptions:jPr}=Sct.actions,TPr=null,NPr={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)},Oct=Ec({name:"polarOptions",initialState:TPr,reducers:NPr}),{updatePolarOptions:fMn}=Oct.actions,APr=Oct.reducer,kct=of("keyDown"),_ct=of("focus"),Ect=of("blur"),E9=yP(),OO=null,z0=null,QD=null;E9.startListening({actionCreator:kct,effect:(e,t)=>{QD=e.payload,OO!==null&&(cancelAnimationFrame(OO),OO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");z0!==null&&(typeof n!="number"||!a)&&(clearTimeout(z0),z0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=QD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=xpe(u,cC(l),TP(l),AP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=bv(l);if(d==="Enter"){var m=x4(l,"axis","hover",String(u.index));t.dispatch(b4({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=ICr(l),y=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=h+x*y;if(p==null||w>=p.length||w<0)return;var S=x4(l,"axis","hover",String(w));t.dispatch(b4({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{OO=null,z0=null}};if(!a){i();return}n==="raf"?OO=requestAnimationFrame(i):typeof n=="number"&&z0===null&&(i(),QD=null,z0=setTimeout(()=>{QD?i():(z0=null,OO=null)},n))}});E9.startListening({actionCreator:_ct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var a="0",i=x4(r,"axis","hover",String(a));t.dispatch(b4({active:!0,activeIndex:a,activeCoordinate:i}))}}}});E9.startListening({actionCreator:Ect,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(b4({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function Cct(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var s=Reflect.get(r,n);return typeof s=="function"?s.bind(r):s}})}var Wf=of("externalEvent"),jct=yP(),WD=new Map,sT=new Map,eQ=new Map;jct.startListening({actionCreator:Wf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=Cct(n);eQ.set(s,{handler:r,reactEvent:a});var i=WD.get(s);i!==void 0&&(cancelAnimationFrame(i),WD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=sT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),sT.delete(s));var p=()=>{var y=eQ.get(s);try{if(!y)return;var{handler:x,reactEvent:w}=y,S=t.getState(),k={activeCoordinate:Pjr(S),activeDataKey:Ajr(S),activeIndex:iI(S),activeLabel:Clt(S),activeTooltipIndex:iI(S),isTooltipActive:Mjr(S)};x&&x(k,w)}finally{WD.delete(s),sT.delete(s),eQ.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);WD.set(s,m)}else if(typeof c=="number"){if(!sT.has(s)){p();var g=setTimeout(p,c);sT.set(s,g)}}else p()}}});var IPr=Xe([oC],e=>e.tooltipItemPayloads),RPr=Xe([IPr,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),Tct=of("touchMove"),Nct=yP(),B0=null,rb=null,pIe=null,aT=null;Nct.startListening({actionCreator:Tct,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){aT=Cct(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");B0!==null&&(cancelAnimationFrame(B0),B0=null),rb!==null&&(typeof s!="number"||!i)&&(clearTimeout(rb),rb=null),pIe=Array.from(r.touches).map(c=>Dpe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(aT!=null){var c=t.getState(),u=bpe(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=pIe)===null||d===void 0?void 0:d[0];if(f==null){B0=null,rb=null;return}var h=Mpe(c,f);h?.activeIndex!=null&&t.dispatch(mlt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=aT.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var y=g.getAttribute(l1r),x=(p=g.getAttribute(c1r))!==null&&p!==void 0?p:void 0,w=lC(c).find(_=>_.id===x);if(y==null||w==null||x==null)return;var{dataKey:S}=w,k=RPr(c,y,x);t.dispatch(BCr({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:x}))}B0=null,rb=null}};if(!i){l();return}s==="raf"?B0=requestAnimationFrame(l):typeof s=="number"&&rb===null&&(l(),aT=null,rb=setTimeout(()=>{aT?l():(rb=null,B0=null)},s))}}});var Act={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Ict=Ec({name:"eventSettings",initialState:Act,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:PPr}=Ict.actions,MPr=Ict.reducer,DPr=lnt({brush:bIr,cartesianAxis:cIr,chartData:MTr,errorBars:vRr,eventSettings:MPr,graphicalItems:zAr,layout:Wwr,legend:tSr,options:NTr,polarAxis:iAr,polarOptions:APr,referenceElements:OIr,renderedTicks:zIr,rootProps:CPr,tooltip:VCr,zIndex:yTr}),LPr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return vwr({reducer:DPr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([xct.middleware,wct.middleware,E9.middleware,jct.middleware,Nct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(Aat({type:"raf"}))},devTools:{serialize:{replacer:EPr},name:"recharts-".concat(r)}})};function $Pr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=sd(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=LPr(t,n));var i=ghe;return b.createElement(ynt,{context:i,store:a.current},r)}function FPr(e){var{layout:t,margin:r}=e,n=Vo(),s=sd();return b.useEffect(()=>{s||(n(qwr(t)),n(Vwr(r)))},[n,s,t,r]),null}var zPr=b.memo(FPr,c9);function BPr(e){var t=Vo();return b.useEffect(()=>{t(jPr(e))},[t,e]),null}var UPr=e=>{var t=Vo();return b.useEffect(()=>{t(PPr(e))},[t,e]),null},VPr=b.memo(UPr,c9);function mIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Vo();return b.useLayoutEffect(()=>(n.current&&s(mTr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(gTr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function gIe(e){var{children:t,isPanorama:r}=e,n=en(aTr);if(!n||n.length===0)return t;var s=n.filter(i=>i<0),a=n.filter(i=>i>0);return b.createElement(b.Fragment,null,s.map(i=>b.createElement(mIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(mIe,{key:i,zIndex:i,isPanorama:r})))}var qPr=["children"];function HPr(e,t){if(e==null)return{};var r,n,s=QPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function QPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function E4(){return E4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E4.apply(null,arguments)}var WPr={width:"100%",height:"100%",display:"block"},GPr=b.forwardRef((e,t)=>{var r=eit(),n=tit(),s=fit();if(!tg(r)||!tg(n))return null;var{children:a,otherAttributes:i,title:l,desc:c}=e,u,d;return i!=null&&(typeof i.tabIndex=="number"?u=i.tabIndex:u=s?0:void 0,typeof i.role=="string"?d=i.role:d=s?"application":void 0),b.createElement(Lst,E4({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:WPr,ref:t}),a)}),ZPr=e=>{var{children:t}=e,r=en(s9);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(Lst,{width:n,height:s,x:i,y:a},t)},yIe=b.forwardRef((e,t)=>{var{children:r}=e,n=HPr(e,qPr),s=sd();return s?b.createElement(ZPr,null,b.createElement(gIe,{isPanorama:!0},r)):b.createElement(GPr,E4({ref:t},n),b.createElement(gIe,{isPanorama:!1},r))});function YPr(){var e=Vo(),[t,r]=b.useState(null),n=en(o1r);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(Qwr(a))}},[t,e,n]),r}function vIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XPr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vIe(Object(r),!0).forEach(function(n){KPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KPr(e,t,r){return(t=JPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JPr(e){var t=eMr(e,"string");return typeof t=="symbol"?t:t+""}function eMr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wb(){return Wb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wb.apply(null,arguments)}var tMr=()=>(qTr(),null);function C4(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var rMr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:C4((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:C4((n=e.style)===null||n===void 0?void 0:n.height)}),l=b.useCallback((u,d)=>{i(f=>{var h=Math.round(u),p=Math.round(d);return f.containerWidth===h&&f.containerHeight===p?f:{containerWidth:h,containerHeight:p}})},[]),c=b.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var h=m=>{var g=m[0];if(g!=null){var{width:y,height:x}=g.contentRect;l(y,x)}},p=new ResizeObserver(h);p.observe(u),s.current=p}},[t,l]);return b.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[l]),b.createElement(b.Fragment,null,b.createElement(bP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Wb({ref:c},e)))}),nMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:C4(r),containerHeight:C4(n)}),i=b.useCallback((c,u)=>{a(d=>{var f=Math.round(c),h=Math.round(u);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),l=b.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();i(u,d)}},[t,i]);return b.createElement(b.Fragment,null,b.createElement(bP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Wb({ref:l},e)))}),sMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(bP,{width:r,height:n}),b.createElement("div",Wb({ref:t},e)))}),aMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(nMr,Wb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(sMr,Wb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(bP,{width:r,height:n}),b.createElement("div",Wb({ref:t},e)))});function iMr(e){return e?rMr:aMr}var oMr=b.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:a,onContextMenu:i,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:p,onTouchMove:m,onTouchStart:g,style:y,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,k=b.useRef(null),_=Vo(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=YPr(),P=She(),R=P?.width>0?P.width:x,B=P?.height>0?P.height:s,D=b.useCallback(ie=>{I(ie),typeof t=="function"&&t(ie),T(ie),N(ie),ie!=null&&(k.current=ie)},[I,t,T,N]),$=b.useCallback(ie=>{_(bct(ie)),_(Wf({handler:a,reactEvent:ie}))},[_,a]),U=b.useCallback(ie=>{_(Xae(ie)),_(Wf({handler:u,reactEvent:ie}))},[_,u]),z=b.useCallback(ie=>{_(plt()),_(Wf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(Xae(ie)),_(Wf({handler:f,reactEvent:ie}))},[_,f]),Q=b.useCallback(()=>{_(_ct())},[_]),L=b.useCallback(()=>{_(Ect())},[_]),Z=b.useCallback(ie=>{_(kct(ie.key))},[_]),V=b.useCallback(ie=>{_(Wf({handler:i,reactEvent:ie}))},[_,i]),M=b.useCallback(ie=>{_(Wf({handler:l,reactEvent:ie}))},[_,l]),W=b.useCallback(ie=>{_(Wf({handler:c,reactEvent:ie}))},[_,c]),G=b.useCallback(ie=>{_(Wf({handler:h,reactEvent:ie}))},[_,h]),J=b.useCallback(ie=>{_(Wf({handler:g,reactEvent:ie}))},[_,g]),ae=b.useCallback(ie=>{S&&_(Tct(ie)),_(Wf({handler:m,reactEvent:ie}))},[_,S,m]),te=b.useCallback(ie=>{_(Wf({handler:p,reactEvent:ie}))},[_,p]),re=iMr(w);return b.createElement(Plt.Provider,{value:E},b.createElement(gxr.Provider,{value:j},b.createElement(re,{width:R??y?.width,height:B??y?.height,className:wa("recharts-wrapper",n),style:XPr({position:"relative",cursor:"default",width:R,height:B},y),onClick:$,onContextMenu:V,onDoubleClick:M,onFocus:Q,onBlur:L,onKeyDown:Z,onMouseDown:W,onMouseEnter:U,onMouseLeave:z,onMouseMove:H,onMouseUp:G,onTouchEnd:te,onTouchMove:ae,onTouchStart:J,ref:D},b.createElement(tMr,null),r)))}),lMr=["width","height","responsive","children","className","style","compact","title","desc"];function cMr(e,t){if(e==null)return{};var r,n,s=uMr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function uMr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var dMr=b.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:a,className:i,style:l,compact:c,title:u,desc:d}=e,f=cMr(e,lMr),h=Jm(f);return c?b.createElement(b.Fragment,null,b.createElement(bP,{width:r,height:n}),b.createElement(yIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(oMr,{className:i,style:l,width:r,height:n,responsive:s??!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},b.createElement(yIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(_Ir,null,a)))});function Kae(){return Kae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kae.apply(null,arguments)}function bIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fMr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bIe(Object(r),!0).forEach(function(n){hMr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hMr(e,t,r){return(t=pMr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pMr(e){var t=mMr(e,"string");return typeof t=="symbol"?t:t+""}function mMr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gMr={top:5,right:5,bottom:5,left:5},yMr=fMr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:gMr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Act),vMr=b.forwardRef(function(t,r){var n,s=nd(t.categoricalChartProps,yMr),{chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return b.createElement($Pr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(vIr,{chartData:u.data}),b.createElement(zPr,{layout:s.layout,margin:s.margin}),b.createElement(VPr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(BPr,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),b.createElement(dMr,Kae({},s,{ref:r})))}),bMr=["axis"],xMr=b.forwardRef((e,t)=>b.createElement(vMr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:bMr,tooltipPayloadSearcher:jTr,categoricalChartProps:e,ref:t}));function wMr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function SMr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function OMr(e){return e/100*window.innerHeight}function kMr(e){return e/100*window.innerWidth}function _Mr(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function HT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=_Mr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=SMr(t,s);break}case"em":{n=wMr(t,s);break}case"vh":{n=OMr(s);break}case"vw":{n=kMr(s);break}}return n}function zu(e){return parseFloat(e.toFixed(3))}function Y_({group:e}){const{orientation:t,panels:r}=e;return r.reduce((n,s)=>(n+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,n),0)}function Jae(e){const{panels:t}=e,r=Y_({group:e});return r===0?t.map(n=>({groupResizeBehavior:n.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:n.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:n.panelConstraints.disabled,minSize:0,maxSize:100,panelId:n.id})):t.map(n=>{const{element:s,panelConstraints:a}=n;let i=0;if(a.collapsedSize!==void 0){const d=HT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=zu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=HT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=zu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=HT({groupSize:r,panelElement:s,styleProp:a.minSize});c=zu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=HT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=zu(d/r*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:l,disabled:a.disabled,minSize:c,maxSize:u,panelId:n.id}})}function ja(e,t="Assertion error"){if(!e)throw Error(t)}function eie(e,t){return Array.from(t).sort(e==="horizontal"?EMr:CMr)}function EMr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function CMr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Rct(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Pct(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function jMr({orientation:e,rects:t,targetRect:r}){const n={x:r.x+r.width/2,y:r.y+r.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:l,y:c}=Pct(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return ja(s,"No rect found"),s}let GD;function TMr(){return GD===void 0&&(typeof matchMedia=="function"?GD=!!matchMedia("(pointer:coarse)").matches:GD=!1),GD}function Mct(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=eie(r,Array.from(t.children).filter(Rct).map(m=>({element:m}))).map(({element:m})=>m),i=[];let l=!1,c=!1,u=-1,d=-1,f=0,h,p=[];{let m=-1;for(const g of a)g.hasAttribute("data-panel")&&(m++,g.ariaDisabled===null&&(f++,u===-1&&(u=m),d=m))}if(f>1){let m=-1;for(const g of a)if(g.hasAttribute("data-panel")){m++;const y=n.find(x=>x.element===g);if(y){if(h){const x=h.element.getBoundingClientRect(),w=g.getBoundingClientRect();let S;if(c){const k=r==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),_=r==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(p.length){case 0:{S=[k,_];break}case 1:{const E=p[0],T=jMr({orientation:r,rects:[x,w],targetRect:E.element.getBoundingClientRect()});S=[E,T===x?_:k];break}default:{S=p;break}}}else p.length?S=p:S=[r==="horizontal"?new DOMRect(x.right,w.top,w.left-x.right,w.height):new DOMRect(w.left,x.bottom,w.width,w.top-x.bottom)];for(const k of S){let _="width"in k?k:k.element.getBoundingClientRect();const E=TMr()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(_.width<E){const j=E-_.width;_=new DOMRect(_.x-j/2,_.y,_.width+j,_.height)}if(_.height<E){const j=E-_.height;_=new DOMRect(_.x,_.y-j/2,_.width,_.height+j)}const T=m<=u||m>d;!l&&!T&&i.push({group:e,groupSize:Y_({group:e}),panels:[h,y],separator:"width"in k?void 0:k,rect:_}),l=!1}}c=!1,h=y,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const y=s.find(x=>x.element===g);y?p.push(y):(h=void 0,p=[])}else c=!0}return i}let Dct=class{#e={};addListener(t,r){const n=this.#e[t];return n===void 0?this.#e[t]=[r]:n.includes(r)||n.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const n=this.#e[t];if(n!==void 0)if(n.length===1)n[0].call(null,r);else{let s=!1,a=null;const i=Array.from(n);for(let l=0;l<i.length;l++){const c=i[l];try{c.call(null,r)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,r){const n=this.#e[t];if(n!==void 0){const s=n.indexOf(r);s>=0&&n.splice(s,1)}}},Pm=new Map;const Lct=new Dct;function NMr(e){Pm=new Map(Pm),Pm.delete(e)}function xIe(e,t){for(const[r]of Pm)if(r.id===e)return r}function Gb(e,t){for(const[r,n]of Pm)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function gS(){return Pm}function Lpe(e,t){return Lct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function Jy(e,t){const r=Pm.get(e);Pm=new Map(Pm),Pm.set(e,t),Lct.emit("groupChange",{group:e,prev:r,next:t})}function AMr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=Pct(r,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(n=a,s=i);break}case"vertical":{i.y<=s.y&&(n=a,s=i);break}}}return n?{distance:s,hitRegion:n}:void 0}function IMr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function RMr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:OIe(e),b:OIe(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();ja(n,"Stacking order can only be calculated for elements with a common ancestor");const s={a:SIe(wIe(r.a)),b:SIe(wIe(r.b))};if(s.a===s.b){const a=n.childNodes,i={a:r.a.at(-1),b:r.b.at(-1)};let l=a.length;for(;l--;){const c=a[l];if(c===i.a)return 1;if(c===i.b)return-1}}return Math.sign(s.a-s.b)}const PMr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function MMr(e){const t=getComputedStyle($ct(e)??e).display;return t==="flex"||t==="inline-flex"}function DMr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||MMr(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||PMr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function wIe(e){let t=e.length;for(;t--;){const r=e[t];if(ja(r,"Missing node"),DMr(r))return r}return null}function SIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function OIe(e){const t=[];for(;e;)t.push(e),e=$ct(e);return t}function $ct(e){const{parentNode:t}=e;return IMr(t)?t.host:t}function LMr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function $Mr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Rct(r)||r.contains(e)||e.contains(r))return!0;if(RMr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(LMr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function $pe(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=Mct(s),i=AMr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&$Mr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function FMr(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function qc(e,t,r=0){return Math.abs(zu(e)-zu(t))<=r}function um(e,t){return qc(e,t)?0:e>t?1:-1}function pk({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return r;if(um(n,c)<0)if(a){const u=(s+c)/2;um(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=zu(n),n}function uI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(qc(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=n;ja(d!=null,"Invalid first pivot index"),ja(f!=null,"Invalid second pivot index");let h=0;switch(a){case"keyboard":{{const g=e<0?f:d,y=r[g];ja(y,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(ja(k!=null,`Previous layout not found for panel index ${g}`),qc(k,x)){const _=S-k;um(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}{const g=e<0?d:f,y=r[g];ja(y,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(ja(k!=null,`Previous layout not found for panel index ${g}`),qc(k,S)){const _=k-x;um(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}break}default:{const g=e<0?f:d,y=r[g];ja(y,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:k}=y;if(w&&um(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;um(T,k)<0&&(e=um(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;um(T,k)<0&&(e=um(100+e,E)>0?0:-_)}break}}{const g=e<0?1:-1;let y=e<0?f:d,x=0;for(;;){const S=l[y];ja(S!=null,`Previous layout not found for panel index ${y}`);const k=pk({overrideDisabledPanels:i,panelConstraints:r[y],prevSize:S,size:100})-S;if(x+=k,y+=g,y<0||y>=r.length)break}const w=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-w:w}{let g=e<0?d:f;for(;g>=0&&g<r.length;){const y=Math.abs(e)-Math.abs(h),x=l[g];ja(x!=null,`Previous layout not found for panel index ${g}`);const w=x-y,S=pk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!qc(x,S)&&(h+=x-S,u[g]=S,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(FMr(c,u))return s;{const g=e<0?f:d,y=l[g];ja(y!=null,`Previous layout not found for panel index ${g}`);const x=y+h,w=pk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:y,size:x});if(u[g]=w,!qc(w,x)){let S=x-w,k=e<0?f:d;for(;k>=0&&k<r.length;){const _=u[k];ja(_!=null,`Previous layout not found for panel index ${k}`);const E=_+S,T=pk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(qc(_,T)||(S-=T-_,u[k]=T),qc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,y)=>y+g,0);if(!qc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,y,x)=>(g[m[x]]=y,g),{})}function N1(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||um(e[r],t[r])!==0)return!1;return!0}function A1({layout:e,panelConstraints:t}){const r=Object.values(e),n=[...r],s=n.reduce((l,c)=>l+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!qc(s,100)&&n.length>0)for(let l=0;l<t.length;l++){const c=n[l];ja(c!=null,`No layout data found for index ${l}`);const u=100/s*c;n[l]=u}let a=0;for(let l=0;l<t.length;l++){const c=r[l];ja(c!=null,`No layout data found for index ${l}`);const u=n[l];ja(u!=null,`No layout data found for index ${l}`);const d=pk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!qc(a,0))for(let l=0;l<t.length;l++){const c=n[l];ja(c!=null,`No layout data found for index ${l}`);const u=c+a,d=pk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,qc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function Fct({groupId:e,panelId:t}){const r=()=>{const l=gS();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:h,separatorToPanels:p}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:h,layout:f,separatorToPanels:p};throw Error(`Group ${e} not found`)},n=()=>{const l=r().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const l=r().group.panels.find(c=>c.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const l=r().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=l=>{const c=a();if(l===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:h,layout:p,separatorToPanels:m}=r(),g=f.panels.findIndex(S=>S.id===t),y=g===f.panels.length-1,x=uI({delta:y?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:y?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=A1({layout:x,panelConstraints:d});N1(p,w)||Jy(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:h,layout:w,separatorToPanels:m})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=n(),{mutableValues:u}=s(),d=a();l&&d!==c&&(u.expandToSize=d,i(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=n(),{mutableValues:d}=s(),f=a();if(l&&f===c){let h=d.expandToSize??u;h===0&&(h=1),i(h)}},getSize:()=>{const{group:l}=r(),c=a(),{element:u}=s(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=n(),u=a();return l&&qc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=Y_({group:c}),f=HT({groupSize:d,panelElement:u,styleProp:l}),h=zu(f/d*100);i(h)}}}function kIe(e){if(e.defaultPrevented)return;const t=gS();$pe(e,t).forEach(r=>{if(r.separator){const n=r.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(n){const s=n.panelConstraints.defaultSize,a=Fct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function C$(e){const t=gS();for(const[r]of t)if(r.separators.some(n=>n.element===e))return r;throw Error("Could not find parent Group for separator element")}function zct({groupId:e}){const t=()=>{const r=gS();for(const[n,s]of r)if(n.id===e)return{group:n,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:n}=t();return r?{}:n},setLayout(r){const{defaultLayoutDeferred:n,derivedPanelConstraints:s,group:a,groupSize:i,layout:l,separatorToPanels:c}=t(),u=A1({layout:r,panelConstraints:s});return n?l:(N1(l,u)||Jy(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function U0(e,t){const r=C$(e),n=Gb(r.id,!0),s=r.separators.find(d=>d.element===e);ja(s,"Matching separator not found");const a=n.separatorToPanels.get(s);ja(a,"Matching panels not found");const i=a.map(d=>r.panels.indexOf(d)),l=zct({groupId:r.id}).getLayout(),c=uI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=A1({layout:c,panelConstraints:n.derivedPanelConstraints});N1(l,u)||Jy(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function _Ie(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=C$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&U0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&U0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&U0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&U0(t,-5);break}case"End":{e.preventDefault(),U0(t,100);break}case"Enter":{e.preventDefault();const n=C$(t),s=Gb(n.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=n.separators.find(h=>h.element===t);ja(c,"Matching separator not found");const u=l.get(c);ja(u,"Matching panels not found");const d=u[0],f=a.find(h=>h.panelId===d.id);if(ja(f,"Panel metadata not found"),f.collapsible){const h=i[d.id],p=f.collapsedSize===h?n.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;U0(t,p-h)}break}case"F6":{e.preventDefault();const n=C$(t).separators.map(i=>i.element),s=Array.from(n).findIndex(i=>i===e.currentTarget);ja(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:n.length-1:s+1<n.length?s+1:0;n[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),U0(t,-100);break}}}let Kk={cursorFlags:0,state:"inactive"};const Fpe=new Dct;function I1(){return Kk}function zMr(e){return Fpe.addListener("change",e)}function BMr(e){const t=Kk,r={...Kk};r.cursorFlags=e,Kk=r,Fpe.emit("change",{prev:t,next:r})}function Jk(e){const t=Kk;Kk=e,Fpe.emit("change",{prev:t,next:e})}function EIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=gS(),r=$pe(e,t),n=new Map;let s=!1;r.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&n.set(a.group,i.layout)}),Jk({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const UMr=e=>e,tQ=()=>{},Bct=1,Uct=2,Vct=4,qct=8,CIe=3,jIe=12;let ZD;function TIe(){return ZD===void 0&&(ZD=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ZD=!0)),ZD}function VMr({cursorFlags:e,groups:t,state:r}){let n=0,s=0;switch(r){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{n++;break}case"vertical":{s++;break}}})}if(!(n===0&&s===0)){switch(r){case"active":{if(e&&TIe()){const a=(e&Bct)!==0,i=(e&Uct)!==0,l=(e&Vct)!==0,c=(e&qct)!==0;if(a)return l?"se-resize":c?"ne-resize":"e-resize";if(i)return l?"sw-resize":c?"nw-resize":"w-resize";if(l)return"s-resize";if(c)return"n-resize"}break}}return TIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const NIe=new WeakMap;function zpe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=NIe.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=I1();switch(n.state){case"active":case"hover":{const s=VMr({cursorFlags:n.cursorFlags,groups:n.hitRegions.map(i=>i.group),state:n.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?r.cssRules.length===0?r.insertRule(a):r.replaceSync(a):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}NIe.set(e,{prevStyle:t,styleSheet:r})}function Hct({document:e,event:t,hitRegions:r,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let l=0;r.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:h,panels:p}=d,{disableCursor:m}=d.mutableState;let g=0;a?h==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:h==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const y=n.get(d),x=s.get(d);if(!y||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:_,separatorToPanels:E}=x;if(S&&_&&E){const T=uI({delta:g,initialLayout:y,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(N1(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?Bct:Uct;break}case"vertical":{l|=g<0?Vct:qct;break}}}else Jy(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&CIe:c|=l&CIe,t.movementY===0?c|=i&jIe:c|=l&jIe,BMr(c),zpe(e)}function AIe(e){const t=gS(),r=I1();r.state==="active"&&Hct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function IIe(e){if(e.defaultPrevented)return;const t=I1(),r=gS();switch(t.state){case"active":{if(e.buttons===0){Jk({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=Gb(n.group.id,!0);Jy(n.group,s)});return}Hct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=$pe(e,r);n.length===0?t.state!=="inactive"&&Jk({cursorFlags:0,state:"inactive"}):Jk({cursorFlags:0,hitRegions:n,state:"hover"}),zpe(e.currentTarget);break}}}function RIe(e){e.relatedTarget instanceof HTMLIFrameElement&&I1().state==="hover"&&Jk({cursorFlags:0,state:"inactive"})}function PIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=I1();t.state==="active"&&(Jk({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(zpe(e.currentTarget),t.hitRegions.forEach(r=>{const n=Gb(r.group.id,!0);Jy(r.group,n)}),e.preventDefault()))}function MIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=zu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=zu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function qMr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=Y_({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:zu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function HMr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function QMr({group:e,nextGroupSize:t,prevGroupSize:r,prevLayout:n}){if(r<=0||t<=0||r===t)return n;let s=0,a=0,i=!1;const l=new Map,c=[];for(const f of e.panels){const h=n[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const p=h/100*r,m=zu(p/t*100);l.set(f.id,m),s+=m}else c.push(f.id),a+=h}if(!i||c.length===0)return n;const u=100-s,d={...n};if(l.forEach((f,h)=>{d[h]=f}),a>0)for(const f of c){const h=n[f]??0;d[f]=zu(h/a*u)}else{const f=zu(u/c.length);for(const h of c)d[h]=f}return d}function WMr(e,t){const r=e.map(s=>s.id),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r)if(!n.includes(s))return!1;return!0}const kO=new Map;function GMr(e){let t=!0;ja(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,n=new Set,s=new Set,a=new r(m=>{for(const g of m){const{borderBoxSize:y,target:x}=g;if(x===e.element){if(t){const w=Y_({group:e});if(w===0)return;const S=Gb(e.id);if(!S)return;const k=Jae(e),_=S.defaultLayoutDeferred?MIe(k):S.layout,E=QMr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=A1({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&N1(S.layout,T)&&HMr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;Jy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else qMr(e,x,y)}});a.observe(e.element),e.panels.forEach(m=>{ja(!n.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),n.add(m.id),m.onResize&&a.observe(m.element)});const i=Y_({group:e}),l=Jae(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(WMr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??MIe(l),f=A1({layout:d,panelConstraints:l}),h=e.element.ownerDocument;kO.set(h,(kO.get(h)??0)+1);const p=new Map;return Mct(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),Jy(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:p}),e.separators.forEach(m=>{ja(!s.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),s.add(m.id),m.element.addEventListener("keydown",_Ie)}),kO.get(h)===1&&(h.addEventListener("dblclick",kIe,!0),h.addEventListener("pointerdown",EIe,!0),h.addEventListener("pointerleave",AIe),h.addEventListener("pointermove",IIe),h.addEventListener("pointerout",RIe),h.addEventListener("pointerup",PIe,!0)),function(){t=!1,kO.set(h,Math.max(0,(kO.get(h)??0)-1)),NMr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",_Ie)}),kO.get(h)||(h.removeEventListener("dblclick",kIe,!0),h.removeEventListener("pointerdown",EIe,!0),h.removeEventListener("pointerleave",AIe),h.removeEventListener("pointermove",IIe),h.removeEventListener("pointerout",RIe),h.removeEventListener("pointerup",PIe,!0)),a.disconnect()}}function ZMr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Bpe(e){const t=b.useId();return`${e??t}`}const yS=typeof window<"u"?b.useLayoutEffect:b.useEffect;function TN(e){const t=b.useRef(e);return yS(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function Upe(...e){return TN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Vpe(e){const t=b.useRef({...e});return yS(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Qct=b.createContext(null);function YMr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:UMr});b.useImperativeHandle(t,()=>r.current,[]),yS(()=>{Object.assign(r.current,zct({groupId:e}))})}function C9({children:e,className:t,defaultLayout:r,disableCursor:n,disabled:s,elementRef:a,groupRef:i,id:l,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:h,...p}){const m=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=TN(P=>{N1(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),y=TN(P=>{N1(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Bpe(l),w=b.useRef(null),[S,k]=ZMr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=Upe(w,a);YMr(x,i);const T=TN((P,R)=>{const B=I1(),D=xIe(P),$=Gb(P);if($){let U=!1;return B.state==="active"&&(U=B.hitRegions.some(z=>z.group===D)),{flexGrow:$.layout[R]??1,pointerEvents:U?"none":void 0}}return{flexGrow:r?.[R]??1}}),j=Vpe({defaultLayout:r,disableCursor:n}),N=b.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:x,orientation:d,registerPanel:P=>{const R=_.current;return R.panels=eie(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(B=>B!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=eie(d,[...R.separators,P]),k(),()=>{R.separators=R.separators.filter(B=>B!==P),k()}},togglePanelDisabled:(P,R)=>{const B=_.current.panels.find(U=>U.id===P);B&&(B.panelConstraints.disabled=R);const D=xIe(x),$=Gb(x);D&&$&&Jy(D,{...$,derivedPanelConstraints:Jae(D)})},toggleSeparatorDisabled:(P,R)=>{const B=_.current.separators.find(D=>D.id===P);B&&(B.disabled=R)}}),[T,x,k,d,j]),I=b.useRef(null);return yS(()=>{const P=w.current;if(P===null)return;const R=_.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){B={};for(const L of R.panels){const Z=j.defaultLayout[L.id];Z!==void 0&&(B[L.id]=Z)}}const D={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=D;const $=GMr(D),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:H}=Gb(D.id,!0);!U&&z.length>0&&(g(H),y(H));const Q=Lpe(x,L=>{const{defaultLayoutDeferred:Z,derivedPanelConstraints:V,layout:M}=L.next;if(Z||V.length===0)return;const W=D.panels.map(({id:J})=>J).join(",");D.mutableState.layouts[W]=M,V.forEach(J=>{if(J.collapsible){const{layout:ae}=L.prev??{};if(ae){const te=qc(J.collapsedSize,M[J.panelId]),re=qc(J.collapsedSize,ae[J.panelId]);te&&!re&&(D.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const G=I1().state!=="active";g(M),G&&y(M)});return()=>{I.current=null,$(),Q()}},[s,x,y,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=r,P.mutableState.disableCursor=!!n)}),o.jsx(Qct.Provider,{value:N,children:o.jsx("div",{...p,className:t,"data-group":!0,"data-testid":x,id:x,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...h,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}C9.displayName="Group";function rQ(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function qpe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=rQ(a,t??[]),l=b.useSyncExternalStore(XMr,()=>r.getItem(i),()=>r.getItem(i)),c=b.useMemo(()=>l?JSON.parse(l):void 0,[l]),u=b.useRef(null),d=b.useCallback(()=>{const p=u.current;p&&(u.current=null,clearTimeout(p))},[]);b.useLayoutEffect(()=>()=>{d()},[d]);const f=b.useCallback(p=>{d();let m;s?m=rQ(a,Object.keys(p)):m=rQ(a,[]);try{r.setItem(m,JSON.stringify(p))}catch(g){console.error(g)}},[d,s,a,r]),h=b.useCallback(p=>{d(),e===0?f(p):u.current=setTimeout(()=>{f(p)},e)},[d,e,f]);return{defaultLayout:c,onLayoutChange:h,onLayoutChanged:f}}function XMr(){return function(){}}function Hpe(){const e=b.useContext(Qct);return ja(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function KMr(e,t){const{id:r}=Hpe(),n=b.useRef({collapse:tQ,expand:tQ,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tQ});b.useImperativeHandle(t,()=>n.current,[]),yS(()=>{Object.assign(n.current,Fct({groupId:r,panelId:e}))})}function X_({children:e,className:t,collapsedSize:r="0%",collapsible:n=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:l="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:h,style:p,...m}){const g=!!c,y=Bpe(c),x=Vpe({disabled:a}),w=b.useRef(null),S=Upe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=Hpe(),N=f!==null,I=TN((R,B,D)=>{f?.(R,c,D)});yS(()=>{const R=w.current;if(R!==null){const B={element:R,id:y,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:r,collapsible:n,defaultSize:s,disabled:x.disabled,maxSize:u,minSize:d}};return T(B)}},[l,r,n,s,N,y,g,u,d,I,T,x]),b.useEffect(()=>{j(y,!!a)},[a,y,j]),KMr(y,h);const P=b.useSyncExternalStore(R=>Lpe(_,R),()=>JSON.stringify(k(_,y)),()=>JSON.stringify(k(_,y)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":y,id:y,ref:S,style:{...JMr,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(P)},children:o.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}X_.displayName="Panel";const JMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function e2r(){return b.useRef(null)}function t2r({layout:e,panelConstraints:t,panelId:r,panelIndex:n}){let s,a;const i=e[r],l=t.find(c=>c.panelId===r);if(l){const c=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[n,n+1];a=A1({layout:uI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=A1({layout:uI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function Wct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Bpe(s),c=Vpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=Upe(p,n),{disableCursor:g,id:y,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=Hpe(),k=x==="horizontal"?"vertical":"horizontal";yS(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=zMr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Lpe(y,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:D}=P.next,$=D.get(T);if($){const U=$[0],z=$.indexOf(U);d(t2r({layout:B,panelConstraints:R,panelId:U.id,panelIndex:z}))}});return()=>{N(),I(),j()}}},[y,l,w,c]),b.useEffect(()=>{S(l,!!r)},[r,l,S]);let _;return r&&!g&&(_="not-allowed"),o.jsx("div",{...i,"aria-controls":u.valueControls,"aria-disabled":r||void 0,"aria-orientation":k,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":r?"disabled":f,"data-testid":l,id:l,ref:m,role:"separator",style:{flexBasis:"auto",cursor:_,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:r?void 0:0})}Wct.displayName="Separator";const DIe=e=>{let t;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(p=>p(t,h))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,l);return l},r2r=(e=>e?DIe(e):DIe),n2r=e=>e;function s2r(e,t=n2r){const r=je.useSyncExternalStore(e.subscribe,je.useCallback(()=>t(e.getState()),[e,t]),je.useCallback(()=>t(e.getInitialState()),[e,t]));return je.useDebugValue(r),r}const LIe=e=>{const t=r2r(e),r=n=>s2r(t,n);return Object.assign(r,t),r},Qpe=(e=>e?LIe(e):LIe);function a2r(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),l=(a=r.getItem(s))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,a)=>r.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>r.removeItem(s)}}const tie=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return tie(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return tie(n)(r)}}}},i2r=(e,t)=>(r,n,s)=>{let a={storage:a2r(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,x)=>({...x,...y}),...t},i=!1,l=0;const c=new Set,u=new Set;let d=a.storage;if(!d)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...y)},n,s);const f=()=>{const y=a.partialize({...n()});return d.setItem(a.name,{state:y,version:a.version})},h=s.setState;s.setState=(y,x)=>(h(y,x),f());const p=e((...y)=>(r(...y),f()),n,s);s.getInitialState=()=>p;let m;const g=()=>{var y,x;if(!d)return;const w=++l;i=!1,c.forEach(k=>{var _;return k((_=n())!=null?_:p)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(y=n())!=null?y:p))||void 0;return tie(d.getItem.bind(d))(a.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==a.version){if(a.migrate){const _=a.migrate(k.state,k.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var _;if(w!==l)return;const[E,T]=k;if(m=a.merge(T,(_=n())!=null?_:p),r(m,!0),E)return f()}).then(()=>{w===l&&(S?.(n(),void 0),m=n(),i=!0,u.forEach(k=>k(m)))}).catch(k=>{w===l&&S?.(void 0,k)})};return s.persist={setOptions:y=>{a={...a,...y},y.storage&&(d=y.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(u.add(y),()=>{u.delete(y)})},a.skipHydration||g(),m||p},o2r=i2r;var vS=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(){}},l2r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c2r=class{#e=l2r;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Cw=new c2r;function u2r(e){setTimeout(e,0)}var R1=typeof window>"u"||"Deno"in globalThis;function ic(){}function d2r(e,t){return typeof e=="function"?e(t):e}function rie(e){return typeof e=="number"&&e>=0&&e!==1/0}function Gct(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zb(e,t){return typeof e=="function"?e(t):e}function Yf(e,t){return typeof e=="function"?e(t):e}function $Ie(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Wpe(i,t.options))return!1}else if(!dI(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function FIe(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(P1(t.options.mutationKey)!==P1(a))return!1}else if(!dI(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Wpe(e,t){return(t?.queryKeyHashFn||P1)(e)}function P1(e){return JSON.stringify(e,(t,r)=>nie(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function dI(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>dI(e[r],t[r])):!1}var f2r=Object.prototype.hasOwnProperty;function Gpe(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=zIe(e)&&zIe(t);if(!n&&!(nie(e)&&nie(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let u=0;for(let d=0;d<l;d++){const f=n?d:i[d],h=e[f],p=t[f];if(h===p){c[f]=h,(n?d<a:f2r.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const m=Gpe(h,p,r+1);c[f]=m,m===h&&u++}return a===l&&u===a?e:c}function fI(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function zIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nie(e){if(!BIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!BIe(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function BIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function h2r(e){return new Promise(t=>{Cw.setTimeout(t,e)})}function sie(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Gpe(e,t):t}function p2r(e){return e}function m2r(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function g2r(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Zpe=Symbol();function Zct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zpe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ype(e,t){return typeof e=="function"?e(...t):!!e}function y2r(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var v2r=class extends vS{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!R1&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Xpe=new v2r;function aie(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var b2r=u2r;function x2r(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=b2r;const a=l=>{t?e.push(l):s(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Zi=x2r(),w2r=class extends vS{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!R1&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},j4=new w2r;function S2r(e){return Math.min(1e3*2**e,3e4)}function Yct(e){return(e??"online")==="online"?j4.isOnline():!0}var iie=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Xct(e){let t=!1,r=0,n;const s=aie(),a=()=>s.status!=="pending",i=g=>{if(!a()){const y=new iie(g);h(y),e.onCancel?.(y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Xpe.isFocused()&&(e.networkMode==="always"||j4.isOnline())&&e.canRun(),d=()=>Yct(e.networkMode)&&e.canRun(),f=g=>{a()||(n?.(),s.resolve(g))},h=g=>{a()||(n?.(),s.reject(g))},p=()=>new Promise(g=>{n=y=>{(a()||u())&&g(y)},e.onPause?.()}).then(()=>{n=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(a())return;const w=e.retry??(R1?0:3),S=e.retryDelay??S2r,k=typeof S=="function"?S(r,x):S,_=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,x);if(t||!_){h(x);return}r++,e.onFail?.(r,x),h2r(k).then(()=>u()?void 0:p()).then(()=>{t?h(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(n?.(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),s)}}var Kct=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rie(this.gcTime)&&(this.#e=Cw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(R1?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Cw.clearTimeout(this.#e),this.#e=void 0)}},O2r=class extends Kct{#e;#t;#r;#s;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=VIe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=VIe(this.options);t.data!==void 0&&(this.setState(UIe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=sie(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(ic).catch(ic):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Yf(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zpe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zb(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Gct(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},s=()=>{const l=Zct(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(d),d})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return n(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta}),this.#n=Xct({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof iie&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const l=await this.#n.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof iie){if(l.silent)return this.#n.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Jct(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...UIe(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Zi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Jct(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yct(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function UIe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VIe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var j9=class extends vS{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=aie(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#s=void 0;#n;#a;#o;#i;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),qIe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oie(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yf(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!fI(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&HIe(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||Yf(this.options.enabled,this.#t)!==Yf(t.enabled,this.#t)||Zb(this.options.staleTime,this.#t)!==Zb(t.staleTime,this.#t))&&this.#g();const s=this.#y();n&&(this.#t!==r||Yf(this.options.enabled,this.#t)!==Yf(t.enabled,this.#t)||s!==this.#l)&&this.#v(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return _2r(this,r)&&(this.#s=r,this.#a=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ic)),t}#g(){this.#x();const e=Zb(this.options.staleTime,this.#t);if(R1||this.#s.isStale||!rie(e))return;const r=Gct(this.#s.dataUpdatedAt,e)+1;this.#c=Cw.setTimeout(()=>{this.#s.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(R1||Yf(this.options.enabled,this.#t)===!1||!rie(this.#l)||this.#l===0)&&(this.#u=Cw.setInterval(()=>{(this.options.refetchIntervalInBackground||Xpe.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(Cw.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Cw.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#t,n=this.options,s=this.#s,a=this.#n,i=this.#a,c=e!==r?e.state:this.#r,{state:u}=e;let d={...u},f=!1,h;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&qIe(e,t),I=j&&HIe(e,r,t,n);(N||I)&&(d={...d,...Jct(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=d;h=d.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,y=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",h=sie(s?.data,j,t),f=!0)}if(t.select&&h!==void 0&&!y)if(s&&h===a?.data&&t.select===this.#p)h=this.#d;else try{this.#p=t.select,h=t.select(h),h=sie(s?.data,h,t),this.#d=h,this.#i=null}catch(j){this.#i=j}this.#i&&(p=this.#i,h=this.#d,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",w=g==="pending",S=g==="error",k=w&&x,_=h!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&_,isStale:Kpe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Yf(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=B=>{N?B.reject(T.error):j&&B.resolve(T.data)},P=()=>{const B=this.#o=T.promise=aie();I(B)},R=this.#o;switch(R.status){case"pending":e.queryHash===r.queryHash&&I(R);break;case"fulfilled":(N||T.data!==R.value)&&P();break;case"rejected":(!N||T.error!==R.reason)&&P();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#f=this.#t),fI(t,e))return;this.#s=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#h.size)return!0;const a=new Set(s??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const l=i;return this.#s[l]!==e[l]&&a.has(l)})};this.#O({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(e){Zi.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function k2r(e,t){return Yf(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qIe(e,t){return k2r(e,t)||e.state.data!==void 0&&oie(e,t,t.refetchOnMount)}function oie(e,t,r){if(Yf(t.enabled,e)!==!1&&Zb(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Kpe(e,t)}return!1}function HIe(e,t,r,n){return(e!==t||Yf(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Kpe(e,r)}function Kpe(e,t){return Yf(t.enabled,e)!==!1&&e.isStaleByTime(Zb(t.staleTime,e))}function _2r(e,t){return!fI(e.getCurrentResult(),t)}function T4(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{y2r(m,()=>t.signal,()=>d=!0)},h=Zct(t.options,t.fetchOptions),p=async(m,g,y)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return f(E),E})(),S=await h(w),{maxPages:k}=t.options,_=y?g2r:m2r;return{pages:_(m.pages,S,k),pageParams:_(m.pageParams,g,k)}};if(s&&a.length){const m=s==="backward",g=m?eut:lie,y={pages:a,pageParams:i},x=g(n,y);l=await p(y,x,m)}else{const m=e??a.length;do{const g=c===0?i[0]??n.initialPageParam:lie(n,l);if(c>0&&g==null)break;l=await p(l,g),c++}while(c<m)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function lie(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function eut(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function E2r(e,t){return t?lie(e,t)!=null:!1}function C2r(e,t){return!t||!e.getPreviousPageParam?!1:eut(e,t)!=null}var j2r=class extends j9{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:T4()})}getOptimisticResult(e){return e.behavior=T4(),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){const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:l}=n,c=r.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",h=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:E2r(t,r.data),hasPreviousPage:C2r(t,r.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!h}}},T2r=class extends Kct{#e;#t;#r;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||tut(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Xct({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#n({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#s.canStart();try{if(n)t();else{this.#n({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const i=await this.options.onMutate?.(e,r);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#n({type:"success",data:a}),a}catch(a){try{await this.#r.config.onError?.(a,e,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,r)}catch(i){Promise.reject(i)}try{await this.#r.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,r)}catch(i){Promise.reject(i)}throw this.#n({type:"error",error:a}),a}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Zi.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function tut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var N2r=class extends vS{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const n=new T2r({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=YD(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=YD(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=YD(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(s=>s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=YD(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zi.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>FIe(t,r))}findAll(e={}){return this.getAll().filter(t=>FIe(e,t))}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Zi.batch(()=>Promise.all(e.map(t=>t.continue().catch(ic))))}};function YD(e){return e.options.scope?.id}var A2r=class extends vS{#e;#t=void 0;#r;#s;constructor(t,r){super(),this.#e=t,this.setOptions(r),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#e.defaultMutationOptions(t),fI(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&P1(r.mutationKey)!==P1(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#a()}mutate(t,r){return this.#s=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#n(){const t=this.#r?.state??tut();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Zi.batch(()=>{if(this.#s&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,r,n,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,r,n,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(r=>{r(this.#t)})})}};function QIe(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function I2r(e,t,r){const n=e.slice(0);return n[t]=r,n}var R2r=class extends vS{#e;#t;#r;#s;#n;#a;#o;#i;#p;#d=[];constructor(e,t,r){super(),this.#e=e,this.#s=r,this.#r=[],this.#n=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#s=t,Zi.batch(()=>{const r=this.#n,n=this.#u(this.#r);n.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=n.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=r.length!==s.length,l=s.some((d,f)=>d!==r[f]),c=i||l,u=c?!0:a.some((d,f)=>{const h=this.#t[f];return!h||!fI(d,h)});!c&&!u||(c&&(this.#d=n,this.#n=s),this.#t=a,this.hasListeners()&&(c&&(QIe(r,s).forEach(d=>{d.destroy()}),QIe(s,r).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const r=this.#u(e),n=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=r.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#c(a??n,t,s),()=>this.#f(n,r)]}#f(e,t){return t.map((r,n)=>{const s=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,r){if(t){const n=this.#p,s=r!==void 0&&n!==void 0&&(n.length!==r.length||r.some((a,i)=>a!==n[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,r!==void 0&&(this.#p=r),this.#a=Gpe(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#n.forEach(n=>{const s=n.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(n):t.set(s,[n])});const r=[];return e.forEach(n=>{const s=this.#e.defaultQueryOptions(n),i=t.get(s.queryHash)?.shift()??new j9(this.#e,s);r.push({defaultedQueryOptions:s,observer:i})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#t=I2r(this.#t,r,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),r=this.#c(t,this.#s?.combine);e!==r&&Zi.batch(()=>{this.listeners.forEach(n=>{n(this.#t)})})}}},P2r=class extends vS{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Wpe(n,t);let a=this.get(s);return a||(a=new O2r({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Zi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>$Ie(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>$Ie(e,r)):t}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},M2r=class{#e;#t;#r;#s;#n;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new P2r,this.#t=e.mutationCache||new N2r,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Xpe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=j4.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Zb(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(n.queryHash)?.state.data,i=d2r(t,a);if(i!==void 0)return this.#e.build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Zi.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Zi.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return Zi.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zi.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(ic).catch(ic)}invalidateQueries(e,t={}){return Zi.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zi.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(ic)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(ic)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Zb(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ic).catch(ic)}fetchInfiniteQuery(e){return e.behavior=T4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ic).catch(ic)}ensureInfiniteQueryData(e){return e.behavior=T4(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return j4.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#s.set(P1(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{dI(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(P1(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{dI(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Wpe(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===Zpe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},rut=b.createContext(void 0),Xs=e=>{const t=b.useContext(rut);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},D2r=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(rut.Provider,{value:e,children:t})),nut=b.createContext(!1),sut=()=>b.useContext(nut);nut.Provider;function L2r(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $2r=b.createContext(L2r()),aut=()=>b.useContext($2r),iut=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?Ype(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},out=e=>{b.useEffect(()=>{e.clearReset()},[e])},lut=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Ype(r,[e.error,n])),cut=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},F2r=(e,t)=>e.isLoading&&e.isFetching&&!t,cie=(e,t)=>e?.suspense&&t.isPending,uie=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function z2r({queries:e,...t},r){const n=Xs(),s=sut(),a=aut(),i=b.useMemo(()=>e.map(g=>{const y=n.defaultQueryOptions(g);return y._optimisticResults=s?"isRestoring":"optimistic",y}),[e,n,s]);i.forEach(g=>{cut(g);const y=n.getQueryCache().get(g.queryHash);iut(g,a,y)}),out(a);const[l]=b.useState(()=>new R2r(n,i,t)),[c,u,d]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(g=>f?l.subscribe(Zi.batchCalls(g)):ic,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=c.some((g,y)=>cie(i[y],g))?c.flatMap((g,y)=>{const x=i[y];if(x&&cie(x,g)){const w=new j9(n,x);return uie(x,w,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=c.find((g,y)=>{const x=i[y];return x&&lut({result:g,errorResetBoundary:a,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m?.error)throw m.error;return u(d())}function uut(e,t,r){const n=sut(),s=aut(),a=Xs(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",cut(i),iut(i,s,l),out(s);const c=!a.getQueryCache().get(i.queryHash),[u]=b.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!n&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(h=>{const p=f?u.subscribe(Zi.batchCalls(h)):ic;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),cie(i,d))throw uie(i,u,s);if(lut({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!R1&&F2r(d,n)&&(c?uie(i,u,s):l?.promise)?.catch(ic).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function Ot(e,t){return uut(e,j9)}function Wr(e,t){const r=Xs(),[n]=b.useState(()=>new A2r(r,e));b.useEffect(()=>{n.setOptions(e)},[n,e]);const s=b.useSyncExternalStore(b.useCallback(i=>n.subscribe(Zi.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=b.useCallback((i,l)=>{n.mutate(i,l).catch(ic)},[n]);if(s.error&&Ype(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function s0(e,t){return uut(e,j2r)}var Do=(e=>(e.AGENT="agent",e.SCORER="scorer",e.RAG_INGESTION="rag_ingestion",e.TRAJECTORY="trajectory",e.INPUT_PROCESSOR="input_processor",e.INPUT_STEP_PROCESSOR="input_step_processor",e.OUTPUT_PROCESSOR="output_processor",e.OUTPUT_STEP_PROCESSOR="output_step_processor",e.WORKFLOW_STEP="workflow_step",e.TOOL="tool",e.WORKFLOW_RUN="workflow_run",e.MEMORY="memory",e))(Do||{});K1().describe("Database record creation time");var B2r=K1().describe("Database record last update time");B2r.nullable();var T9=_e({page:r1e().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:r1e().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),N9=_e({total:St().describe("Total number of items available"),page:St().describe("Current page"),perPage:Hr([St(),Bt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:yo().describe("True if more pages are available")}),U2r=_e({start:n1e().optional().describe("Start of date range (inclusive by default)"),end:n1e().optional().describe("End of date range (inclusive by default)"),startExclusive:yo().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:yo().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),A9=So(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),wg=So(["sum","avg","min","max","count","last"]).describe("Aggregation function"),bS=So(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),Jpe=So(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),xS=Et(pe()).min(1).describe("Fields to group by"),eme=Et(St().min(0).max(1)).min(1).describe("Percentile values (0-1)"),tme={value:St().nullable().describe("Aggregated value"),previousValue:St().nullable().optional().describe("Value from comparison period"),changePercent:St().nullable().optional().describe("Percentage change from comparison period")},rme=Ws(pe(),pe().nullable()).describe("Dimension values for this group"),uC=St().describe("Aggregated value"),dC=K1().describe("Bucket timestamp"),nme=St().describe("Percentile value"),sme=St().describe("Percentile value at this bucket"),fC=Kle(Do).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),V2r=pe().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),dut=pe().describe("Name of the entity"),fut=pe().describe("Human end-user who triggered execution"),hut=pe().describe("Multi-tenant organization/account"),put=pe().describe("Broader resource context (Mastra memory compatibility)"),mut=pe().describe("Unique execution run identifier"),gut=pe().describe("Session identifier for grouping traces"),yut=pe().describe("Conversation thread identifier"),vut=pe().describe("HTTP request ID for log correlation"),but=pe().describe('Environment (e.g., "production" | "staging" | "development")'),q2r=pe().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),xut=pe().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),wut=pe().describe("Name of the service"),Sut=Kle(Do).describe("Entity type of the parent entity"),H2r=pe().describe("ID of the parent entity"),Out=pe().describe("Name of the parent entity"),kut=Kle(Do).describe("Entity type of the root entity"),Q2r=pe().describe("ID of the root entity"),_ut=pe().describe("Name of the root entity"),Eut=pe().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),Cut=pe().describe("Version ID of the parent entity that produced this signal"),jut=pe().describe("Version ID of the root entity that produced this signal"),I9=pe().describe("Experiment or eval run identifier"),W2r=Ws(pe(),Ia()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),Tut=Ws(pe(),Ia()).describe("User-defined metadata for custom filtering"),Nut=Et(pe()).describe("Labels for filtering"),G2r={entityType:fC.nullish(),entityId:V2r.nullish(),entityName:dut.nullish(),parentEntityType:Sut.nullish(),parentEntityId:H2r.nullish(),parentEntityName:Out.nullish(),rootEntityType:kut.nullish(),rootEntityId:Q2r.nullish(),rootEntityName:_ut.nullish(),userId:fut.nullish(),organizationId:hut.nullish(),resourceId:put.nullish(),runId:mut.nullish(),sessionId:gut.nullish(),threadId:yut.nullish(),requestId:vut.nullish(),environment:but.nullish(),serviceName:wut.nullish(),scope:W2r.nullish(),entityVersionId:Eut.nullish(),parentEntityVersionId:Cut.nullish(),rootEntityVersionId:jut.nullish(),experimentId:I9.nullish()},R9={...G2r,executionSource:xut.nullish(),tags:Nut.nullish()};q2r.nullish();var P9={timestamp:U2r.optional().describe("Filter by timestamp range"),traceId:pe().optional().describe("Filter by trace ID"),spanId:pe().optional().describe("Filter by span ID"),entityType:fC.optional(),entityName:dut.optional(),entityVersionId:Eut.optional(),parentEntityVersionId:Cut.optional(),rootEntityVersionId:jut.optional(),userId:fut.optional(),organizationId:hut.optional(),experimentId:I9.optional(),serviceName:wut.optional(),environment:but.optional(),parentEntityType:Sut.optional(),parentEntityName:Out.optional(),rootEntityType:kut.optional(),rootEntityName:_ut.optional(),resourceId:put.optional(),runId:mut.optional(),sessionId:gut.optional(),threadId:yut.optional(),requestId:vut.optional(),executionSource:xut.optional(),tags:Et(pe()).optional().describe("Filter by tags (must have all specified tags)")},M9=pe().describe("Unique trace identifier"),D9=pe().describe("Unique span identifier within a trace"),N4=So(["debug","info","warn","error","fatal"]),Aut=pe().describe("Log message"),Iut=Ws(pe(),Ia()).describe("Structured data attached to the log"),Rut=_e({logId:pe().nullish().describe("Unique id for this log event"),timestamp:K1().describe("When the log was created"),level:N4.describe("Log severity level"),message:Aut,data:Iut.nullish(),traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:pe().nullish().describe("Execution source"),metadata:Tut.nullish()}).describe("Log record as stored in the database");_e({level:N4,message:Aut,data:Iut.optional(),tags:Nut.optional()}).describe("User-provided log input");var Z2r=Rut;_e({logs:Et(Z2r)}).describe("Arguments for batch creating logs");var Y2r=_e({...P9,source:pe().optional().describe("Filter by execution source"),level:Hr([N4,Et(N4)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),X2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),K2r=_e({field:X2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:Y2r.optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:K2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");_e({pagination:N9,logs:Et(Rut)});var hC=pe().describe("Identifier of the scorer (e.g., relevance, accuracy)"),Put=pe().describe("Display name of the scorer"),Mut=pe().describe("Version of the scorer"),ng=pe().describe("How the score was produced (e.g., manual, automated, experiment)"),Dut=St().describe("Score value (range defined by scorer)"),Lut=pe().describe("Explanation for the score"),$ut=_e({scoreId:pe().nullish().describe("Unique id for this score event"),timestamp:K1().describe("When the score was recorded"),traceId:M9.nullish().describe("Trace that anchors the scored target when available"),spanId:D9.nullish().describe("Span ID this score applies to"),scorerId:hC,scorerName:Put.nullish(),scorerVersion:Mut.nullish(),scoreSource:ng.nullish(),source:ng.nullish(),score:Dut,reason:Lut.nullish(),...R9,scoreTraceId:pe().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:Ws(pe(),Ia()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");_e({scorerId:hC,scorerName:Put.optional(),scorerVersion:Mut.optional(),scoreSource:ng.optional(),source:ng.optional(),score:Dut,reason:Lut.optional(),metadata:Ws(pe(),Ia()).optional().describe("Additional scorer-specific metadata"),experimentId:I9.optional(),scoreTraceId:pe().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:fC.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var ame=$ut;_e({score:ame}).describe("Arguments for creating a score");_e({score:ame.omit({timestamp:!0})}).describe("Arguments for creating a score");_e({success:yo()}).describe("Response from creating a score");_e({scores:Et(ame)}).describe("Arguments for batch recording scores");var RP=_e({...P9,scorerId:Hr([pe(),Et(pe())]).optional().describe("Filter by scorer ID(s)"),scoreSource:ng.optional().describe("Filter by how the score was produced"),source:ng.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),J2r=So(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),eDr=_e({field:J2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:RP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:eDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");_e({pagination:N9,scores:Et($ut)});_e({scorerId:hC,scoreSource:ng.optional(),aggregation:wg,filters:RP.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a score aggregate");_e(tme);_e({scorerId:hC,scoreSource:ng.optional(),groupBy:xS,aggregation:wg,filters:RP.optional()}).describe("Arguments for getting a score breakdown");_e({groups:Et(_e({dimensions:rme,value:uC}))});_e({scorerId:hC,scoreSource:ng.optional(),interval:bS,aggregation:wg,filters:RP.optional(),groupBy:xS.optional()}).describe("Arguments for getting score time series");_e({series:Et(_e({name:pe().describe("Series name (scorer ID or group key)"),points:Et(_e({timestamp:dC,value:uC}))}))});_e({scorerId:hC,scoreSource:ng.optional(),percentiles:eme,interval:bS,filters:RP.optional()}).describe("Arguments for getting score percentiles");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:dC,value:sme}))}))});var sg=pe().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),pC=pe().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),Fut=Hr([St(),pe()]).describe("Feedback value (rating number or correction text)"),zut=pe().describe("Additional comment or context"),A4=pe().describe("User who provided the feedback");function ime(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};return typeof t.userId=="string"&&t.feedbackUserId==null&&(t.feedbackUserId=t.userId,delete t.userId),t}var L9=_e({feedbackId:pe().nullish().describe("Unique id for this feedback event"),timestamp:K1().describe("When the feedback was recorded"),traceId:M9.nullish().describe("Trace that anchors the feedback target when available"),spanId:D9.nullish().describe("Span ID this feedback applies to"),feedbackSource:sg.nullish(),source:sg.nullish(),feedbackType:pC,value:Fut,comment:zut.nullish(),feedbackUserId:A4.nullish(),...R9,sourceId:pe().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:Ws(pe(),Ia()).nullish().describe("User-defined metadata")}),tDr=_e(L9.shape).describe("Feedback record as stored in the database"),rDr=_e({feedbackSource:sg.optional(),source:sg.optional(),feedbackType:pC,value:Fut,comment:zut.optional(),feedbackUserId:A4.optional(),userId:A4.optional(),metadata:Ws(pe(),Ia()).optional().describe("Additional feedback-specific metadata"),experimentId:I9.optional(),sourceId:pe().optional().describe("ID of the source record this feedback is linked to")});_e(rDr.shape).describe("User-provided feedback input");_e({feedback:rce(ime,L9)}).describe("Arguments for creating feedback");_e({feedback:L9.omit({timestamp:!0})}).describe("Arguments for creating feedback");_e({success:yo()}).describe("Response from creating feedback");_e({feedbacks:Et(rce(ime,L9))}).describe("Arguments for batch recording feedback");var But=_e({...P9,feedbackType:Hr([pe(),Et(pe())]).optional().describe("Filter by feedback type(s)"),feedbackSource:sg.optional(),source:sg.optional(),feedbackUserId:A4.optional()}),$9=_e(But.shape).describe("Filters for querying feedback"),nDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),sDr=_e({field:nDr.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:rce(ime,But).optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:sDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");_e({pagination:N9,feedback:Et(tDr)});_e({feedbackType:pC,feedbackSource:sg.optional(),aggregation:wg,filters:$9.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");_e(tme);_e({feedbackType:pC,feedbackSource:sg.optional(),groupBy:xS,aggregation:wg,filters:$9.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");_e({groups:Et(_e({dimensions:rme,value:uC}))});_e({feedbackType:pC,feedbackSource:sg.optional(),interval:bS,aggregation:wg,filters:$9.optional(),groupBy:xS.optional()}).describe("Arguments for getting feedback time series over numeric values");_e({series:Et(_e({name:pe().describe("Series name (feedback type or group key)"),points:Et(_e({timestamp:dC,value:uC}))}))});_e({feedbackType:pC,feedbackSource:sg.optional(),percentiles:eme,interval:bS,filters:$9.optional()}).describe("Arguments for getting feedback percentiles over numeric values");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:dC,value:sme}))}))});So(["counter","gauge","histogram"]);var Uut=pe().describe("Metric name (e.g., mastra_agent_duration_ms)"),Vut=St().describe("Metric value"),qut=Ws(pe(),pe()).describe("Metric labels for dimensional filtering"),Hut=pe().describe("Model provider"),Qut=pe().describe("Model"),aDr=St().describe("Estimated cost"),Wut=pe().describe("Unit for the estimated cost (e.g., usd)"),iDr=Ws(pe(),Ia()).nullish().describe("Structured costing metadata"),Gut=_e({metricId:pe().nullish().describe("Unique id for this metric event"),timestamp:K1().describe("When the metric was recorded"),name:Uut,value:Vut,traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:pe().nullish().describe("Execution source"),provider:Hut.nullish(),model:Qut.nullish(),estimatedCost:aDr.nullish(),costUnit:Wut.nullish(),costMetadata:iDr.nullish(),labels:qut.default({}),metadata:Tut.nullish()}).describe("Metric record as stored in the database");_e({name:Uut,value:Vut,labels:qut.optional()}).describe("User-provided metric input");var oDr=Gut;_e({metrics:Et(oDr)}).describe("Arguments for batch recording metrics");_e({type:wg,interval:bS.optional(),groupBy:xS.optional()}).describe("Metrics aggregation configuration");var PP=_e({...P9,name:Et(pe()).nonempty().optional().describe("Filter by metric name(s)"),source:pe().optional().describe("Filter by execution source"),provider:Hut.optional(),model:Qut.optional(),costUnit:Wut.optional(),labels:Ws(pe(),pe()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),lDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),cDr=_e({field:lDr.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:PP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:cDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing metrics");_e({pagination:N9,metrics:Et(Gut)});_e({name:Et(pe()).nonempty().describe("Metric name(s) to aggregate"),aggregation:wg,filters:PP.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a metric aggregate");_e({...tme,estimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:pe().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:St().nullable().optional().describe("Percentage change in estimated cost from comparison period")});_e({name:Et(pe()).nonempty().describe("Metric name(s) to break down"),groupBy:xS,aggregation:wg,filters:PP.optional()}).describe("Arguments for getting a metric breakdown");_e({groups:Et(_e({dimensions:rme,value:uC,estimatedCost:St().nullable().optional().describe("Summed estimated cost for this group"),costUnit:pe().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});_e({name:Et(pe()).nonempty().describe("Metric name(s)"),interval:bS,aggregation:wg,filters:PP.optional(),groupBy:xS.optional()}).describe("Arguments for getting metric time series");_e({series:Et(_e({name:pe().describe("Series name (metric name or group key)"),costUnit:pe().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Et(_e({timestamp:dC,value:uC,estimatedCost:St().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});_e({name:pe().describe("Metric name"),percentiles:eme,interval:bS,filters:PP.optional()}).describe("Arguments for getting metric percentiles");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:dC,value:sme}))}))});_e({prefix:pe().optional().describe("Filter metric names by prefix"),limit:St().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");_e({names:Et(pe()).describe("Distinct metric names")});_e({metricName:pe().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");_e({keys:Et(pe()).describe("Distinct label keys for the metric")});_e({metricName:pe().describe("Metric name"),labelKey:pe().describe("Label key to get values for"),prefix:pe().optional().describe("Filter values by prefix"),limit:St().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");_e({values:Et(pe()).describe("Distinct label values")});_e({}).describe("Arguments for getting entity types");_e({entityTypes:Et(fC).describe("Distinct entity types")});_e({entityType:fC.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");_e({names:Et(pe()).describe("Distinct entity names")});_e({}).describe("Arguments for getting service names");_e({serviceNames:Et(pe()).describe("Distinct service names")});_e({}).describe("Arguments for getting environments");_e({environments:Et(pe()).describe("Distinct environments")});_e({entityType:fC.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");_e({tags:Et(pe()).describe("Distinct tags")});function Zut(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Zut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Yut(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Zut(e))&&(n&&(n+=" "),n+=t);return n}const WIe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,GIe=Yut,wS=(e,t)=>r=>{var n;if(t?.variants==null)return GIe(e,r?.class,r?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=r?.[u],f=a?.[u];if(d===null)return null;const h=WIe(d)||WIe(f);return s[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...a,...l}[g]):{...a,...l}[g]===y})?[...u,f,h]:u},[]);return GIe(e,i,c,r?.class,r?.className)},uDr=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},dDr=(e,t)=>({classGroupId:e,validator:t}),Xut=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),I4="-",ZIe=[],fDr="arbitrary..",hDr=e=>{const t=mDr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return pDr(i);const l=i.split(I4),c=l[0]===""&&l.length>1?1:0;return Kut(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?uDr(u,c):c:u||ZIe}return r[i]||ZIe}}},Kut=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Kut(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(I4):e.slice(t).join(I4),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},pDr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?fDr+n:void 0})(),mDr=e=>{const{theme:t,classGroups:r}=e;return gDr(r,t)},gDr=(e,t)=>{const r=Xut();for(const n in e){const s=e[n];ome(s,r,n,t)}return r},ome=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];yDr(i,t,r,n)}},yDr=(e,t,r,n)=>{if(typeof e=="string"){vDr(e,t,r);return}if(typeof e=="function"){bDr(e,t,r,n);return}xDr(e,t,r,n)},vDr=(e,t,r)=>{const n=e===""?t:Jut(t,e);n.classGroupId=r},bDr=(e,t,r,n)=>{if(wDr(e)){ome(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(dDr(r,e))},xDr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];ome(c,Jut(t,l),r,n)}},Jut=(e,t)=>{let r=e;const n=t.split(I4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=Xut(),r.nextPart.set(i,l)),r=l}return r},wDr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,SDr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},die="!",YIe=":",ODr=[],XIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),kDr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,u;const d=s.length;for(let g=0;g<d;g++){const y=s[g];if(i===0&&l===0){if(y===YIe){a.push(s.slice(c,g)),c=g+1;continue}if(y==="/"){u=g;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=a.length===0?s:s.slice(c);let h=f,p=!1;f.endsWith(die)?(h=f.slice(0,-1),p=!0):f.startsWith(die)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return XIe(a,p,h,m)};if(t){const s=t+YIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):XIe(ODr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},_Dr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},EDr=e=>({cache:SDr(e.cacheSize),parseClassName:kDr(e),sortModifiers:_Dr(e),...hDr(e)}),CDr=/\s+/,jDr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(CDr);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=r(d);if(f){c=d+(c.length>0?" "+c:c);continue}let y=!!g,x=n(y?m.substring(0,g):m);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=n(m),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=h.length===0?"":h.length===1?h[0]:a(h).join(":"),S=p?w+die:w,k=S+x;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(x,y);for(let E=0;E<_.length;++E){const T=_[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},TDr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=edt(r))&&(s&&(s+=" "),s+=n);return s},edt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=edt(e[n]))&&(r&&(r+=" "),r+=t);return r},KIe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=EDr(u),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=jDr(c,r);return s(c,d),d};return a=i,(...c)=>a(TDr(...c))},NDr=[],Go=e=>{const t=r=>r[e]||NDr;return t.isThemeGetter=!0,t},tdt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rdt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ADr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,IDr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RDr=/\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$/,PDr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,MDr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,DDr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nb=e=>ADr.test(e),qn=e=>!!e&&!Number.isNaN(Number(e)),sb=e=>!!e&&Number.isInteger(Number(e)),nQ=e=>e.endsWith("%")&&qn(e.slice(0,-1)),Jg=e=>IDr.test(e),ndt=()=>!0,LDr=e=>RDr.test(e)&&!PDr.test(e),lme=()=>!1,$Dr=e=>MDr.test(e),FDr=e=>DDr.test(e),zDr=e=>!vr(e)&&!kr(e),BDr=e=>a0(e,idt,lme),vr=e=>tdt.test(e),V0=e=>a0(e,odt,LDr),JIe=e=>a0(e,ZDr,qn),UDr=e=>a0(e,cdt,ndt),VDr=e=>a0(e,ldt,lme),eRe=e=>a0(e,sdt,lme),qDr=e=>a0(e,adt,FDr),XD=e=>a0(e,udt,$Dr),kr=e=>rdt.test(e),iT=e=>SS(e,odt),HDr=e=>SS(e,ldt),tRe=e=>SS(e,sdt),QDr=e=>SS(e,idt),WDr=e=>SS(e,adt),KD=e=>SS(e,udt,!0),GDr=e=>SS(e,cdt,!0),a0=(e,t,r)=>{const n=tdt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},SS=(e,t,r=!1)=>{const n=rdt.exec(e);return n?n[1]?t(n[1]):r:!1},sdt=e=>e==="position"||e==="percentage",adt=e=>e==="image"||e==="url",idt=e=>e==="length"||e==="size"||e==="bg-size",odt=e=>e==="length",ZDr=e=>e==="number",ldt=e=>e==="family-name",cdt=e=>e==="number"||e==="weight",udt=e=>e==="shadow",rRe=()=>{const e=Go("color"),t=Go("font"),r=Go("text"),n=Go("font-weight"),s=Go("tracking"),a=Go("leading"),i=Go("breakpoint"),l=Go("container"),c=Go("spacing"),u=Go("radius"),d=Go("shadow"),f=Go("inset-shadow"),h=Go("text-shadow"),p=Go("drop-shadow"),m=Go("blur"),g=Go("perspective"),y=Go("aspect"),x=Go("ease"),w=Go("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...k(),kr,vr],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[kr,vr,c],N=()=>[nb,"full","auto",...j()],I=()=>[sb,"none","subgrid",kr,vr],P=()=>["auto",{span:["full",sb,kr,vr]},sb,kr,vr],R=()=>[sb,"auto",kr,vr],B=()=>["auto","min","max","fr",kr,vr],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],z=()=>[nb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[nb,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Q=()=>[nb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,vr],Z=()=>[...k(),tRe,eRe,{position:[kr,vr]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",QDr,BDr,{size:[kr,vr]}],W=()=>[nQ,iT,V0],G=()=>["","none","full",u,kr,vr],J=()=>["",qn,iT,V0],ae=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[qn,nQ,tRe,eRe],ie=()=>["","none",m,kr,vr],he=()=>["none",qn,kr,vr],X=()=>["none",qn,kr,vr],se=()=>[qn,kr,vr],le=()=>[nb,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jg],breakpoint:[Jg],color:[ndt],container:[Jg],"drop-shadow":[Jg],ease:["in","out","in-out"],font:[zDr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jg],shadow:[Jg],spacing:["px",qn],text:[Jg],"text-shadow":[Jg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nb,vr,kr,y]}],container:["container"],columns:[{columns:[qn,vr,kr,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:_()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[sb,"auto",kr,vr]}],basis:[{basis:[nb,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qn,nb,"auto","initial","none",vr]}],grow:[{grow:["",qn,kr,vr]}],shrink:[{shrink:["",qn,kr,vr]}],order:[{order:[sb,"first","last","none",kr,vr]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,iT,V0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,GDr,UDr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nQ,vr]}],"font-family":[{font:[HDr,VDr,t]}],"font-features":[{"font-features":[vr]}],"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:[s,kr,vr]}],"line-clamp":[{"line-clamp":[qn,"none",kr,JIe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",kr,vr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kr,vr]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[qn,"from-font","auto",kr,V0]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[qn,"auto",kr,vr]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kr,vr]}],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",kr,vr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sb,kr,vr],radial:["",kr,vr],conic:[sb,kr,vr]},WDr,qDr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qn,kr,vr]}],"outline-w":[{outline:["",qn,iT,V0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,KD,XD]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,KD,XD]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[qn,V0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,KD,XD]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[qn,kr,vr]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":[qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[kr,vr]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kr,vr]}],filter:[{filter:["","none",kr,vr]}],blur:[{blur:ie()}],brightness:[{brightness:[qn,kr,vr]}],contrast:[{contrast:[qn,kr,vr]}],"drop-shadow":[{"drop-shadow":["","none",p,KD,XD]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",qn,kr,vr]}],"hue-rotate":[{"hue-rotate":[qn,kr,vr]}],invert:[{invert:["",qn,kr,vr]}],saturate:[{saturate:[qn,kr,vr]}],sepia:[{sepia:["",qn,kr,vr]}],"backdrop-filter":[{"backdrop-filter":["","none",kr,vr]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[qn,kr,vr]}],"backdrop-contrast":[{"backdrop-contrast":[qn,kr,vr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qn,kr,vr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qn,kr,vr]}],"backdrop-invert":[{"backdrop-invert":["",qn,kr,vr]}],"backdrop-opacity":[{"backdrop-opacity":[qn,kr,vr]}],"backdrop-saturate":[{"backdrop-saturate":[qn,kr,vr]}],"backdrop-sepia":[{"backdrop-sepia":["",qn,kr,vr]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",kr,vr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qn,"initial",kr,vr]}],ease:[{ease:["linear","initial",x,kr,vr]}],delay:[{delay:[qn,kr,vr]}],animate:[{animate:["none",w,kr,vr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,kr,vr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[kr,vr,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",kr,vr]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",kr,vr]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[qn,iT,V0,JIe]}],stroke:[{stroke:["none",...L()]}],"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"]}},YDr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(QT(e,"cacheSize",t),QT(e,"prefix",r),QT(e,"experimentalParseClassName",n),JD(e.theme,a.theme),JD(e.classGroups,a.classGroups),JD(e.conflictingClassGroups,a.conflictingClassGroups),JD(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),QT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),eL(e.theme,s.theme),eL(e.classGroups,s.classGroups),eL(e.conflictingClassGroups,s.conflictingClassGroups),eL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),ddt(e,s,"orderSensitiveModifiers"),e),QT=(e,t,r)=>{r!==void 0&&(e[t]=r)},JD=(e,t)=>{if(t)for(const r in t)QT(e,r,t[r])},eL=(e,t)=>{if(t)for(const r in t)ddt(e,t,r)},ddt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},XDr=(e,...t)=>typeof e=="function"?KIe(rRe,e,...t):KIe(()=>YDr(rRe(),e),...t),KDr=Object.keys({...ky,...Y9t}),JDr=Object.keys(r8t),eLr=Object.keys(X9t),tLr=Object.keys(K9t),rLr=Object.keys(Z9t),q0=Object.keys(t8t),nLr=Object.keys(J9t).concat(Object.keys(e8t)),sLr=XDr({extend:{theme:{color:KDr,spacing:JDr,radius:rLr,leading:tLr,shadow:nLr},classGroups:{"font-size":[{text:eLr}],h:[{h:q0}],w:[{w:q0}],size:[{size:q0}],"min-h":[{"min-h":q0}],"min-w":[{"min-w":q0}],"max-h":[{"max-h":q0}],"max-w":[{"max-w":q0}]}}});function Y(...e){return sLr(Yut(e))}const ad=h5t,Xr=p5t,Kr=m5t,Gr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(g5t,{children:o.jsxs(Rqe,{ref:s,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n,children:[r,o.jsx(y5t,{className:"fill-surface3"})]})}));Gr.displayName=Rqe.displayName;const aLr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},Ce=({children:e,className:t,size:r="default",...n})=>o.jsx("span",{className:Y("block",aLr[r],t),...n,children:e}),lc={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},F9="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",iLr="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",oLr="rounded-md",fdt="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",cme="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",ume="disabled:opacity-50 disabled:cursor-not-allowed",tL=Y("gap-[.75em] rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),mC=wS(Y("inline-flex items-center justify-center leading-0","transition-all duration-normal ease-out-custom",ume,cme),{variants:{variant:{default:"bg-surface3 border-2 border-border1 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",primary:"bg-surface4 border-2 border-border2 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",cta:"bg-accent1 border-2 border-transparent hover:bg-accent1/90 hover:shadow-glow-accent1 disabled:hover:shadow-none text-surface1 font-medium",ghost:"bg-transparent border-2 border-transparent hover:bg-surface4 hover:text-neutral6 active:bg-surface5 text-neutral4",outline:"bg-transparent border-2 border-border1 hover:bg-surface3 hover:text-neutral6 active:bg-surface4 text-neutral5",link:"inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"},size:{sm:Y(`${lc.sm} text-ui-sm px-[.75em]`,tL),md:Y(`${lc.md} text-ui-md px-[.75em]`,tL),default:Y(`${lc.default} text-ui-md px-[.85em]`,tL),lg:Y(`${lc.lg} text-ui-lg px-[1em]`,tL),"icon-sm":`${lc.sm} w-form-sm rounded-md`,"icon-md":`${lc.md} w-form-md rounded-md`,"icon-lg":`${lc.lg} w-form-lg rounded-md`}},defaultVariants:{variant:"default",size:"default"}}),lLr={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function hdt(e){const t=[];return je.Children.forEach(e,r=>{je.isValidElement(r)&&r.type===je.Fragment?t.push(...hdt(r.props.children)):t.push(r)}),t}function cLr(e){const t=hdt(e);return t.length>0&&t.every(r=>je.isValidElement(r))}function uLr(e){return typeof e=="string"&&e.startsWith("icon-")}const ce=je.forwardRef(({className:e,as:t,size:r,variant:n="default",disabled:s,children:a,tooltip:i,"aria-label":l,...c},u)=>{const d=t||"button",f=uLr(r),h=r??"default",p=!f&&cLr(a),m=l??((f||p)&&typeof i=="string"?i:void 0),g=f?o.jsx(Ce,{size:lLr[r],children:a}):a,y=o.jsx(d,{ref:u,disabled:s,"aria-label":m,className:Y(mC({variant:n,size:h}),p&&"[&>svg]:opacity-75",e),...c,children:g});return i?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:y}),o.jsx(Gr,{children:i})]}):y});ce.displayName="Button";const Ln=je.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ce,{ref:r,...t})}),e&&o.jsx(Gr,{children:e})]}));Ln.displayName="ButtonWithTooltip";const ln={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},i0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},pdt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),R4=({children:e,as:t="a",href:r,className:n,prefetch:s,to:a})=>o.jsx(t,{href:r,prefetch:s,to:a,className:Y("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",ln.colors,n),children:e}),mdt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),P4=({children:e,isActive:t,className:r})=>o.jsx("li",{className:Y("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",ln.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),gdt=({onClick:e})=>o.jsx(ce,{variant:"ghost",className:Y("shrink-0 opacity-0",ln.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(Ce,{children:o.jsx(Wl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),dLr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},fLr={mono:"font-mono"},me=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Y(dLr[r],n&&fLr[n],t),...s}),hLr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},ydt=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Y(hLr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",ln.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?o.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):o.jsx(me,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),pLr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},mLr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},vt=({icon:e,variant:t="default",className:r,children:n,...s})=>o.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",ln.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":pLr[t],r),...s,children:[e&&o.jsx("span",{className:mLr[t],children:o.jsx(Ce,{children:e})}),n]}),gLr=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),Xa=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),jr=({className:e,as:t,isCurrent:r,action:n,...s})=>{const a=t||"span";return o.jsxs(o.Fragment,{children:[o.jsxs("li",{className:"flex h-full shrink-0 items-center gap-1",children:[o.jsx(a,{"aria-current":r?"page":void 0,className:Y("text-ui-md leading-ui-md flex items-center gap-2",ln.colors,r?"text-white":"text-neutral3 hover:text-neutral5",e),...s}),n]}),!r&&o.jsx("li",{role:"separator",className:"flex h-full items-center",children:o.jsx(Ce,{className:Y("text-neutral2",ln.colors),children:o.jsx(gLr,{})})})]})};function yLr(e,t=5){if(!e?.properties)return[];const r=[];function n(s,a,i){if(i>t)return;const l=Array.isArray(s.type)?s.type.join(" | "):s.type;if(r.push({path:a,label:a,description:s.description??s.title,type:l}),s.properties)for(const[c,u]of Object.entries(s.properties))n(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))n(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function vLr(e){const t=yLr(e);return KWe({override:[bLr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function bLr(e){return t=>{const n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;const s=n[1]??"",a=t.pos-s.length,i=s?e.filter(c=>c.path.toLowerCase().startsWith(s.toLowerCase())):e;if(i.length===0)return null;const l=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,h)=>{const g=u.state.sliceDoc(h,h+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:h,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:l,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const xLr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,wLr=er.mark({class:"cm-variable-highlight"}),nRe=new fWe({regexp:xLr,decoration:()=>wLr}),SLr=Oi.fromClass(class{decorations;constructor(e){this.decorations=nRe.createDeco(e)}update(e){this.decorations=nRe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),OLr=SLr,ya=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),o.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),kLr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),o.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),dme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),fme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),o0=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),vdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:o.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_22095",children:o.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),bdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[o.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"#4285F4"}),o.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"#34A853"}),o.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"#FBBC05"}),o.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"#EA4335"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_20513",children:o.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),_Lr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),o.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),o.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),z9=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),hme=e=>o.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),Mi=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),gC=e=>o.jsx(W9t,{...e}),Di=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),gl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),o.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),B9=e=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});function lp(e){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),o.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),o.jsx("path",{d:"M15 2v2"}),o.jsx("path",{d:"M15 20v2"}),o.jsx("path",{d:"M2 15h2"}),o.jsx("path",{d:"M2 9h2"}),o.jsx("path",{d:"M20 15h2"}),o.jsx("path",{d:"M20 9h2"}),o.jsx("path",{d:"M9 2v2"}),o.jsx("path",{d:"M9 20v2"})]})}const xdt=e=>o.jsxs("svg",{className:"h-3 w-3",width:"16",height:"16",viewBox:"0 0 181 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_1480_1723)",children:[o.jsx("path",{d:"M51.2203 39.3158C51.2203 41.5066 51.4572 43.2829 51.8717 44.5856C52.3453 45.8882 52.9374 47.3093 53.7664 48.8487C54.0624 49.3224 54.1809 49.7961 54.1809 50.2106C54.1809 50.8027 53.8256 51.3948 53.0559 51.9869L49.3256 54.4737C48.7927 54.829 48.2598 55.0066 47.7861 55.0066C47.194 55.0066 46.6019 54.7106 46.0098 54.1777C45.1809 53.2895 44.4703 52.3422 43.8782 51.3948C43.2861 50.3882 42.694 49.2632 42.0427 47.9014C37.4243 53.3487 31.6217 56.0724 24.6348 56.0724C19.6611 56.0724 15.694 54.6514 12.7927 51.8093C9.8914 48.9672 8.41113 45.1777 8.41113 40.4408C8.41113 35.4079 10.1874 31.3224 13.7993 28.2435C17.4111 25.1645 22.2072 23.6251 28.3059 23.6251C30.319 23.6251 32.3914 23.8027 34.5822 24.0987C36.773 24.3948 39.023 24.8685 41.3914 25.4014V21.079C41.3914 16.579 40.444 13.4408 38.6085 11.6053C36.7138 9.76979 33.5164 8.88163 28.9572 8.88163C26.8848 8.88163 24.7532 9.11847 22.5624 9.65137C20.3717 10.1843 18.2401 10.8356 16.1677 11.6645C15.2203 12.079 14.5098 12.3158 14.0953 12.4343C13.6809 12.5527 13.3848 12.6119 13.148 12.6119C12.319 12.6119 11.9046 12.0198 11.9046 10.7764V7.87505C11.9046 6.92768 12.023 6.21716 12.319 5.80268C12.6151 5.38821 13.148 4.97374 13.9769 4.55926C16.0493 3.49347 18.5361 2.60531 21.4374 1.89479C24.3388 1.12505 27.4177 0.769788 30.6743 0.769788C37.7203 0.769788 42.8717 2.36847 46.1875 5.56584C49.444 8.76321 51.1019 13.6185 51.1019 20.1316V39.3158H51.2203ZM27.1809 48.3158C29.1348 48.3158 31.148 47.9606 33.2796 47.2501C35.4111 46.5395 37.3059 45.2369 38.9046 43.4606C39.8519 42.3356 40.5625 41.0922 40.9177 39.6711C41.273 38.2501 41.5098 36.5329 41.5098 34.5198V32.0329C39.7927 31.6185 37.9572 31.2632 36.0624 31.0264C34.1677 30.7895 32.3322 30.6711 30.4967 30.6711C26.5296 30.6711 23.6282 31.4408 21.6743 33.0395C19.7203 34.6382 18.773 36.8882 18.773 39.8487C18.773 42.6316 19.4835 44.704 20.9638 46.1251C22.3848 47.6053 24.4572 48.3158 27.1809 48.3158ZM74.7269 54.7106C73.6611 54.7106 72.9506 54.5329 72.4769 54.1185C72.0032 53.7632 71.5888 52.9343 71.2335 51.8093L57.319 6.03953C56.9638 4.85531 56.7861 4.08558 56.7861 3.6711C56.7861 2.72374 57.2598 2.19084 58.2072 2.19084H64.0098C65.1348 2.19084 65.9046 2.36847 66.319 2.78295C66.7927 3.13821 67.148 3.96716 67.5032 5.09216L77.4506 44.2895L86.6874 5.09216C86.9835 3.90795 87.3388 3.13821 87.8124 2.78295C88.2861 2.42768 89.1151 2.19084 90.1809 2.19084H94.9177C96.0427 2.19084 96.8124 2.36847 97.2861 2.78295C97.7598 3.13821 98.1743 3.96716 98.4111 5.09216L107.766 44.7632L118.01 5.09216C118.365 3.90795 118.78 3.13821 119.194 2.78295C119.668 2.42768 120.437 2.19084 121.503 2.19084H127.01C127.957 2.19084 128.49 2.66453 128.49 3.6711C128.49 3.96716 128.431 4.26321 128.372 4.61847C128.312 4.97374 128.194 5.44742 127.957 6.09874L113.687 51.8685C113.332 53.0527 112.918 53.8224 112.444 54.1777C111.97 54.5329 111.201 54.7698 110.194 54.7698H105.102C103.977 54.7698 103.207 54.5922 102.733 54.1777C102.26 53.7632 101.845 52.9935 101.608 51.8093L92.4309 13.6185L83.3125 51.7501C83.0164 52.9343 82.6611 53.704 82.1874 54.1185C81.7138 54.5329 80.8848 54.7106 79.819 54.7106H74.7269ZM150.812 56.3093C147.734 56.3093 144.655 55.954 141.694 55.2435C138.733 54.5329 136.424 53.7632 134.885 52.8751C133.937 52.3422 133.286 51.7501 133.049 51.2172C132.812 50.6843 132.694 50.0922 132.694 49.5593V46.5395C132.694 45.2961 133.168 44.704 134.056 44.704C134.411 44.704 134.766 44.7632 135.122 44.8816C135.477 45.0001 136.01 45.2369 136.602 45.4737C138.615 46.3619 140.806 47.0724 143.115 47.5461C145.484 48.0198 147.793 48.2566 150.161 48.2566C153.891 48.2566 156.793 47.6053 158.806 46.3027C160.819 45 161.885 43.1053 161.885 40.6777C161.885 39.0198 161.352 37.6579 160.286 36.5329C159.22 35.4079 157.207 34.4014 154.306 33.454L145.72 30.7895C141.398 29.4277 138.201 27.4145 136.247 24.7501C134.293 22.1448 133.286 19.2435 133.286 16.1645C133.286 13.6777 133.819 11.4869 134.885 9.59216C135.951 7.69742 137.372 6.03953 139.148 4.73689C140.924 3.37505 142.937 2.36847 145.306 1.65795C147.674 0.94742 150.161 0.651367 152.766 0.651367C154.069 0.651367 155.431 0.710578 156.734 0.888209C158.095 1.06584 159.339 1.30268 160.582 1.53953C161.766 1.83558 162.891 2.13163 163.957 2.48689C165.023 2.84216 165.852 3.19742 166.444 3.55268C167.273 4.02637 167.865 4.50005 168.22 5.03295C168.576 5.50663 168.753 6.15795 168.753 6.98689V9.76979C168.753 11.0132 168.28 11.6645 167.391 11.6645C166.918 11.6645 166.148 11.4277 165.141 10.954C161.766 9.41453 157.977 8.64479 153.773 8.64479C150.398 8.64479 147.734 9.17768 145.898 10.3027C144.062 11.4277 143.115 13.1448 143.115 15.5724C143.115 17.2303 143.707 18.6514 144.891 19.7764C146.076 20.9014 148.266 22.0264 151.405 23.0329L159.812 25.6974C164.076 27.0593 167.155 28.954 168.99 31.3816C170.826 33.8093 171.714 36.5922 171.714 39.6711C171.714 42.2172 171.181 44.5264 170.174 46.5395C169.108 48.5527 167.687 50.329 165.852 51.7501C164.016 53.2303 161.826 54.2961 159.28 55.0658C156.615 55.8948 153.832 56.3093 150.812 56.3093Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.004 85.0856C142.524 99.4738 114.221 107.112 89.8855 107.112C55.7803 107.112 25.05 94.5001 1.83948 73.5396C0.00394917 71.8817 1.66184 69.6317 3.85263 70.9343C28.9579 85.5001 59.925 94.3225 91.9579 94.3225C113.57 94.3225 137.313 89.8225 159.162 80.5856C162.418 79.1054 165.201 82.7172 162.004 85.0856Z",fill:"#FF9900"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M170.115 75.8487C167.628 72.6513 153.654 74.3092 147.319 75.079C145.424 75.3158 145.128 73.6579 146.845 72.4145C157.976 64.5987 176.272 66.8487 178.404 69.454C180.536 72.1184 177.812 90.4145 167.391 99.1776C165.792 100.539 164.253 99.8289 164.963 98.0526C167.332 92.1908 172.601 78.9868 170.115 75.8487Z",fill:"#FF9900"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1480_1723",children:o.jsx("rect",{width:"180",height:"107.763",fill:"white",transform:"translate(0.0625)"})})})]}),ELr=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),CLr=e=>o.jsx("svg",{className:"h-3 w-3",fill:"white",height:"78",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"78",style:{color:"currentcolor"},...e,children:o.jsx("g",{transform:"translate(0,2)",children:o.jsx("path",{d:"M11.375 0h-2.411L13.352 11.13h2.411L11.375 0ZM4.4 0 0 11.13h2.46l0.9-2.336h4.604l0.9 2.336h2.46L6.924 0H4.4Zm-0.244 6.723 1.506-3.909 1.506 3.909H4.156Z",fill:"currentColor"})})}),wdt=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...e,children:o.jsx("path",{d:"M7.402 13.8777C9.45763 13.4674 11.1555 13.128 11.175 13.1233L11.2104 13.1148L9.2697 10.507C8.2023 9.07276 7.32898 7.8937 7.32898 7.88691C7.32898 7.87404 9.33293 1.63997 9.3442 1.61779C9.34797 1.61037 10.7117 4.27017 12.65 8.06532C14.4647 11.6184 15.9608 14.5479 15.9747 14.5754L16 14.6253L9.83224 14.6244L3.66449 14.6235L7.402 13.8777ZM0 13.0824C0 13.0787 0.914457 11.2855 2.03212 9.09735L4.06425 5.11896L6.43245 2.87384C7.73497 1.63902 8.80417 0.627201 8.80845 0.625356C8.81274 0.623511 8.79561 0.672228 8.77038 0.733617C8.74515 0.795006 7.58796 3.59893 6.19884 6.96455L3.67317 13.0839L1.83659 13.0865C0.826464 13.0879 0 13.0861 0 13.0824Z",fill:"#0089D6",style:{fill:"#0089D6",fillOpacity:1}})}),jLr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"18",fill:"none",...e,children:[o.jsx("mask",{id:"mask0_174_2406",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"17",height:"18",children:o.jsx("path",{d:"M17 0.5H0V17.5H17V0.5Z",fill:"white"})}),o.jsxs("g",{mask:"url(#mask0_174_2406)",children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.50773 10.6219C5.9653 10.6219 6.8755 10.5968 8.13362 10.0788C9.59973 9.47518 12.5166 8.37942 14.6208 7.2539C16.0924 6.46668 16.7375 5.42553 16.7375 4.02344C16.7375 2.07751 15.16 0.5 13.2141 0.5H5.06095C2.26586 0.5 0 2.76586 0 5.56095C0 8.35604 2.12151 10.6219 5.50773 10.6219Z",fill:"#39594D"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.88672 14.107C6.88672 12.7369 7.71155 11.5016 8.97699 10.9764L11.5446 9.9108C14.1417 8.83294 17.0003 10.7415 17.0003 13.5535C17.0003 15.732 15.2339 17.4979 13.0553 17.4973L10.2754 17.4966C8.40372 17.4961 6.88672 15.9787 6.88672 14.107Z",fill:"#D18EE2"}),o.jsx("path",{d:"M2.91749 11.2891C1.30623 11.2891 0 12.5952 0 14.2065V14.5844C0 16.1956 1.30618 17.5018 2.91744 17.5018C4.5287 17.5018 5.83493 16.1956 5.83493 14.5844V14.2065C5.83493 12.5952 4.52875 11.2891 2.91749 11.2891Z",fill:"#FF7759"})]})]}),TLr=e=>o.jsxs("svg",{className:"h-3 w-3","data-testid":"geist-icon",height:"78",strokeLinejoin:"round",viewBox:"0 0 160 59",width:"104",style:{color:"currentcolor"},...e,children:[o.jsx("mask",{id:"mask0_4345_1846",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"160",height:"59",style:{maskType:"luminance"},children:o.jsx("path",{d:"M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z",fill:"white"})}),o.jsx("g",{mask:"url(#mask0_4345_1846)",children:o.jsx("path",{d:"M95.4635 0.314595C84.4822 0.314595 75.5599 9.19525 75.5599 20.1677C75.5599 31.1402 84.4632 40.0208 95.4635 40.0208C106.464 40.0208 115.367 31.1402 115.367 20.1677C115.348 9.21427 106.445 0.333611 95.4635 0.314595ZM95.4635 32.5664C88.6002 32.5664 83.0333 27.0136 83.0333 20.1677C83.0333 13.3218 88.6002 7.76902 95.4635 7.76902C102.327 7.76902 107.894 13.3218 107.894 20.1677C107.894 27.0136 102.327 32.5664 95.4635 32.5664ZM67.9912 0.39066C67.3049 0.314595 66.6376 0.276562 65.9513 0.276562C65.6081 0.276562 65.284 0.276562 64.9599 0.295578C64.6358 0.314595 64.2926 0.333611 63.9685 0.352628C62.634 0.44771 61.2995 0.675906 60.0031 1.03722C57.3531 1.74082 54.8556 2.99591 52.7013 4.68836C50.4898 6.43787 48.7358 8.68181 47.5347 11.23C46.9437 12.5041 46.5052 13.8543 46.2193 15.2234C46.0858 15.908 45.9905 16.5926 45.9142 17.2772C45.8952 17.6195 45.857 17.9618 45.857 18.3041L45.838 18.8175V19.293L45.8761 32.5854L45.9142 39.2221H53.3685L53.4067 32.5854L53.4448 19.293V18.5893C53.4448 18.3802 53.4829 18.171 53.4829 17.9618C53.5211 17.5434 53.5973 17.1441 53.6736 16.7257C53.8452 15.9271 54.093 15.1474 54.4362 14.4057C55.1225 12.9225 56.152 11.6293 57.4293 10.6025C58.7639 9.53755 60.3081 8.75787 61.9477 8.3205C62.7865 8.0923 63.6635 7.94017 64.5405 7.8641C64.7693 7.84509 64.979 7.82607 65.2078 7.82607C65.4365 7.82607 65.6653 7.80705 65.875 7.80705C66.2944 7.80705 66.7329 7.82607 67.1524 7.8641C68.8491 8.03525 70.4887 8.54869 71.9948 9.38541L75.7124 2.93886C73.3484 1.56968 70.7175 0.694923 67.9912 0.39066ZM20.3484 0.219513C9.36711 0.124431 0.36855 8.92902 0.273226 19.8825C0.177902 30.8359 9.00488 39.8116 19.9862 39.9067H26.8876V32.4713H20.3484C13.4851 32.5474 7.84193 27.0707 7.76567 20.2057C7.68941 13.3408 13.1801 7.73099 20.0624 7.65492H20.3484C27.2117 7.65492 32.7786 13.2077 32.8167 20.0536V38.3284C32.8167 45.1172 27.2689 50.651 20.4819 50.7271C17.2218 50.708 14.1142 49.3959 11.8265 47.0949L6.54553 52.3625C10.206 56.0326 15.1628 58.1244 20.3484 58.1625H20.6153C31.4632 58.0103 40.1757 49.2248 40.2329 38.4044V19.5592C39.966 8.81492 31.1391 0.238529 20.3484 0.219513ZM139.389 0.314595C128.407 0.314595 119.485 9.19525 119.504 20.1677C119.504 31.1212 128.407 40.0018 139.389 40.0018H146.195V32.5664H139.389C132.525 32.5664 126.958 27.0136 126.958 20.1677C126.958 13.3218 132.525 7.76902 139.389 7.76902C145.833 7.76902 151.209 12.6943 151.781 19.1028H151.762V57.2116H159.216V20.1677C159.216 9.21427 150.351 0.314595 139.389 0.314595Z",fill:"currentColor"})})]}),NLr=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:e.fill||"currentColor"})}),ALr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"176",height:"162",viewBox:"0 0 176 162",fill:"none",...e,children:[o.jsx("rect",{x:"15",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{y:"1",width:"16",height:"160",fill:"black"}),o.jsx("rect",{x:"63",y:"97",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"95",y:"33",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"1",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"97",width:"16",height:"64",fill:"black"})]}),ILr=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"113",viewBox:"0 0 128 113",children:[o.jsxs("g",{clipPath:"url(#clip0_236_138)",...e,children:[o.jsx("path",{d:"M34.593 94.0509H33.3844L27.3514 88.0179V86.8094L36.5743 77.5866H42.9639L43.8158 78.4385V84.8281L34.593 94.0509Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M27.3514 25.816V24.6074L33.3844 18.5744H34.593L43.8158 27.7972V34.1868L42.9639 35.0388H36.5743L27.3514 25.816Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M80.4594 74.6047H71.6824L70.9493 73.8717V53.3259C70.9493 49.6705 69.5129 46.8372 65.1046 46.7382C62.836 46.6787 60.2405 46.7382 57.4668 46.8471L57.0507 47.2731V73.8618L56.3176 74.5948H47.5406L46.8075 73.8618V38.7636L47.5406 38.0305H67.2939C74.9713 38.0305 81.1925 44.2517 81.1925 51.9291V73.8717L80.4594 74.6047Z",fill:e.fill||"#014847"}),o.jsx("path",{d:"M35.8412 61.4491H0.73307L0 60.716V51.9192L0.73307 51.1861H35.8412L36.5743 51.9192V60.716L35.8412 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M127.277 61.4491H92.1687L91.4356 60.716V51.9192L92.1687 51.1861H127.277L128.01 51.9192V60.716L127.277 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 27.0642V0.73307L59.6759 0H68.4727L69.2058 0.73307V27.0642L68.4727 27.7972H59.6759L58.9428 27.0642Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 111.902V85.5711L59.6759 84.838H68.4727L69.2058 85.5711V111.902L68.4727 112.635H59.6759L58.9428 111.902Z",fill:e.fill||"#05BDBA"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_236_138",children:o.jsx("rect",{width:"128",height:"112.635",fill:"white"})})})]}),sRe=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),RLr=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",width:"78",height:"78",style:{color:"currentcolor"},...e,children:o.jsxs("g",{children:[o.jsx("polygon",{fill:"currentColor",points:"226.83 411.15 501.31 803.15 623.31 803.15 348.82 411.15 226.83 411.15"}),o.jsx("polygon",{fill:"currentColor",points:"348.72 628.87 226.69 803.15 348.77 803.15 409.76 716.05 348.72 628.87"}),o.jsx("polygon",{fill:"currentColor",points:"651.23 196.85 440.28 498.12 501.32 585.29 773.31 196.85 651.23 196.85"}),o.jsx("polygon",{fill:"currentColor",points:"673.31 383.25 673.31 803.15 773.31 803.15 773.31 240.44 673.31 383.25"})]})}),PLr={duration:5e3,cancel:{label:o.jsx(Ce,{children:o.jsx(Wl,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-xl gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card :data-content:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"bg-transparent! hover:bg-surface2! border-none! rounded-md! p-1.5! m-0! text-neutral3! hover:text-neutral6! shrink-0 transition-all",actionButton:"bg-white! flex items-center justify-center font-medium text-black! order-last hover:opacity-80"}};function Jd(e){const{classNames:t,...r}=PLr,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:Y(t?.title,n?.title),toast:Y(t?.toast,n?.toast),cancelButton:Y(t?.cancelButton,n?.cancelButton),actionButton:Y(t?.actionButton,n?.actionButton),description:Y(t?.description,n?.description)},...s}}const ze=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>mc(r,Jd(t)));if(je.isValidElement(e))return mc(e,Jd(t));if(typeof e=="string")return mc(e,Jd(t));throw new Error("Invalid message type")};ze.success=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent1 shrink-0",children:o.jsx(Azt,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.success(e,Jd(r));case"object":return e.forEach(n=>mc.success(n,Jd(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent2 shrink-0",children:o.jsx(AHe,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.error(e,Jd(r));case"object":return e.forEach(n=>mc.error(n,Jd(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent6 shrink-0",children:o.jsx(Uce,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.warning(e,Jd(r));case"object":return e.forEach(n=>mc.warning(n,Jd(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent3 shrink-0",children:o.jsx(FR,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.info(e,Jd(r));case"object":return e.forEach(n=>mc.info(n,Jd(r)))}};ze.custom=(e,t={})=>mc(e,Jd(t));ze.dismiss=e=>{e&&mc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>mc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...Jd(i)});function cf({text:e,copyMessage:t="Copied to clipboard!"}){const[r,n]=b.useState(!1),s=b.useRef(null),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{ze.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{ze.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}function ra({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=cf({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ce,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(cv,{}):o.jsx(RHe,{})})}),o.jsx(Gr,{children:a?"Copied!":r})]})}const MLr="mastra-theme",DLr="mastra-playground-store",fie=e=>e==="dark"||e==="light"||e==="system",LLr=e=>{try{const t=e.getItem(DLr);if(!t)return;const n=JSON.parse(t)?.state?.theme;return fie(n)?n:void 0}catch{return}},$Lr=(e=MLr)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(fie(t))return t;const r=LLr(window.localStorage);return r?(window.localStorage.setItem(e,r),r):null}catch{return null}},set(t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},subscribe(t){if(typeof window>"u")return()=>{};const r=n=>{if(n.key===e){if(n.newValue===null){t(null);return}fie(n.newValue)&&t(n.newValue)}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}),Sdt=b.createContext(null),Odt="(prefers-color-scheme: dark)",FLr=typeof window>"u"?b.useEffect:b.useLayoutEffect,kdt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(Odt).matches?"dark":"light",_dt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(Odt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},zLr=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},Edt=({children:e,defaultTheme:t="system",storageKey:r,target:n})=>{const s=b.useMemo(()=>$Lr(r),[r]),a=b.useRef(null),[i,l]=b.useState(()=>s.get()??t),c=b.useSyncExternalStore(_dt,kdt,()=>"dark");b.useEffect(()=>s.subscribe(f=>l(f??t)),[s,t]);const u=i==="system"?c:i;FLr(()=>{const f=n??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&zLr(f,u),a.current=f},[u,n]);const d=b.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{l(f),s.set(f)}}),[i,u,c,s]);return o.jsx(Sdt.Provider,{value:d,children:e})},BLr=()=>{},yC=()=>{const e=b.useContext(Sdt),t=b.useSyncExternalStore(_dt,kdt,()=>"dark");return b.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:BLr},[e,t])};function ULr(){const e=qE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)",caret:"var(--neutral6)"},styles:[{tag:[ne.className,ne.propertyName],color:"var(--neutral6)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:ne.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=ft.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]}function VLr(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--neutral3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"},"&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection":{background:"color-mix(in srgb, var(--accent3) 22%, transparent) !important"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}}),t=Pp.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[ne.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:[ne.deleted],color:"var(--accent2)"},{tag:ne.invalid,color:"var(--error)"},{tag:[ne.standard(ne.tagName)],color:"var(--accent1)"}]);return[e,Wx(t)]}const wv=()=>{const e=yC().resolvedTheme==="dark";return b.useMemo(()=>e?ULr():VLr(),[e])},Xn=b.forwardRef(({data:e,value:t,onChange:r,showCopyButton:n=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:l,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...h},p)=>{const m=wv(),g=e?JSON.stringify(e,null,2):t??"",y=b.useMemo(()=>{const x=[];return a==="json"?x.push(Gd):a==="markdown"&&(x.push(Que({base:d1,codeLanguages:xZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(OLr),c&&a==="markdown"&&x.push(vLr(c)),f===!1&&x.push(zn.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...h,children:[n&&o.jsx(ra,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(vc,{ref:p,value:g,theme:m,extensions:y,onChange:r,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function qLr(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ke(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-CmxmGF_j.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in n))return null;const{tokens:s}=await r(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function Ja({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return o.jsxs("div",{className:Y("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&o.jsx("div",{className:"mb-4",children:e}),o.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),r&&o.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:r}),n&&o.jsx("div",{className:"mt-5",children:n})]})}const wf=({children:e,className:t,onClick:r})=>o.jsx("div",{tabIndex:r?0:void 0,onKeyDown:n=>{r&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),r?.())},className:Y("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",r&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:r,children:e}),Cdt=({children:e,className:t,style:r})=>o.jsx(Ce,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),Sf=({children:e,className:t})=>o.jsx(me,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),Of=({children:e,className:t})=>o.jsx(me,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),kf=({children:e,className:t})=>o.jsx("div",{className:Y("flex-1 w-full",t),children:e});function Zs({resource:e,title:t,description:r,actionSlot:n,className:s}){const a="Permission Denied",i=e?`You don't have permission to access ${e}. Contact your administrator for access.`:"You don't have permission to access this resource. Contact your administrator for access.";return o.jsx(Ja,{className:s,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(R9t,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function aa({title:e,description:t,className:r}){const[n,s]=b.useState(!1),a=We(),i=b.useCallback(async()=>{try{s(!0);const{baseUrl:l="",apiPrefix:c}=a.options||{},u=(c||"/api").trim(),d=(u.startsWith("/")?u:`/${u}`).replace(/\/$/,""),f=new URLSearchParams({redirect_uri:window.location.href}),h=`${l}${d}/auth/sso/login?${f}`,p=await fetch(h,{credentials:"include",headers:{"Content-Type":"application/json"}});if(p.ok){const m=await p.json();window.location.href=m.url}}finally{s(!1)}},[a]);return o.jsx(Ja,{className:r,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(k9t,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(ce,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const jn=({children:e,border:t=!0,className:r})=>o.jsx("header",{className:Y("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},r),children:e}),Qu=({children:e})=>o.jsx(me,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),fu=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),HLr=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),Yb=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:"currentColor"})}),QLr={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},WLr=({className:e,children:t,size:r="default",style:n})=>o.jsx("table",{className:Y("w-full",QLr[r],e),style:n,children:t}),GLr=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Y("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),ZLr=({className:e,children:t,...r})=>o.jsx("th",{className:Y("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...r,children:t}),YLr=({className:e,children:t,...r})=>o.jsx("tbody",{className:Y("",e),...r,children:t}),XLr=b.forwardRef(({className:e,children:t,selected:r=!1,style:n,onClick:s,isActive:a=!1,...i},l)=>{const c=b.useRef(null);b.useEffect(()=>{l&&(typeof l=="function"?l(c.current):l.current=c.current)},[l]),b.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return o.jsx("tr",{className:Y("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-hidden focus:ring-1 focus:ring-inset focus:ring-accent1/50",r&&"bg-surface4",s&&"cursor-pointer",e),style:n,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),KLr=({className:e,children:t,...r})=>o.jsx("td",{className:Y("text-neutral5 first:pl-3 last:pr-3",e),...r,children:o.jsx("div",{className:Y("flex h-full w-full shrink-0 items-center"),children:t})}),JLr=wS(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","min-h-[80px] resize-y"),{variants:{variant:{default:Y(fdt,cme,ume),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:"px-2 py-1.5 text-ui-sm",md:"px-3 py-2 text-ui-sm",default:"px-3 py-2 text-ui-md",lg:"px-4 py-3 text-ui-sm"}},defaultVariants:{variant:"default",size:"default"}}),gc=b.forwardRef(({className:e,size:t,testId:r,variant:n,error:s,...a},i)=>o.jsx("textarea",{className:Y(JLr({variant:n,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:i,"aria-invalid":s,...a}));gc.displayName="Textarea";const e$r=MXt,t$r=DXt,jdt=LXt;function $t({open:e,onOpenChange:t,children:r}){return o.jsx(e$r,{open:e,onOpenChange:t,children:r})}const pme=b.forwardRef(({className:e,...t},r)=>o.jsx(eXe,{ref:r,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));pme.displayName=eXe.displayName;const Tdt=b.forwardRef(({className:e,...t},r)=>o.jsxs(jdt,{children:[o.jsx(pme,{}),o.jsx(tXe,{ref:r,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...t})]}));Tdt.displayName=tXe.displayName;const Ndt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Ndt.displayName="AlertDialogHeader";const Adt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});Adt.displayName="AlertDialogFooter";const Idt=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Idt.displayName="AlertDialogBody";const Rdt=b.forwardRef(({className:e,...t},r)=>o.jsx(sXe,{ref:r,className:Y("text-ui-md font-medium",e),...t}));Rdt.displayName=sXe.displayName;const Pdt=b.forwardRef(({className:e,...t},r)=>o.jsx(aXe,{ref:r,className:Y("text-ui-sm text-neutral3",e),...t}));Pdt.displayName=aXe.displayName;const Mdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rXe,{ref:r,className:Y(mC({variant:"primary",size:"default"}),e),...t}));Mdt.displayName=rXe.displayName;const Ddt=b.forwardRef(({className:e,...t},r)=>o.jsx(nXe,{ref:r,className:Y(mC({variant:"default",size:"default"}),e),...t}));Ddt.displayName=nXe.displayName;$t.Trigger=t$r;$t.Portal=jdt;$t.Overlay=pme;$t.Content=Tdt;$t.Header=Ndt;$t.Footer=Adt;$t.Body=Idt;$t.Title=Rdt;$t.Description=Pdt;$t.Action=Mdt;$t.Cancel=Ddt;const hi=b.forwardRef(({className:e,...t},r)=>o.jsx(ide,{ref:r,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",ln.all,"hover:border-neutral5 hover:shadow-md",F9,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:bg-accent1 data-[state=checked]:border-accent1 data-[state=checked]:text-surface1","data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(cXe,{className:Y("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(cv,{className:"h-3.5 w-3.5 stroke-3"})})}));hi.displayName=ide.displayName;const Cp=HXt,_h=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(lde,{ref:n,className:Y("-outline-offset-2",ln.colors,i0.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));_h.displayName=lde.displayName;const Eh=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(ude,{ref:n,className:Y("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...r,children:t}));Eh.displayName=ude.displayName;const yn={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:Y("min-w-(--anchor-width) w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-(--transform-origin)","transition-[transform,scale,opacity] duration-150 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0"),positioner:"z-50 pointer-events-auto",searchContainer:Y("flex items-center border-b border-border1 px-3 py-2",ln.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",ln.colors),searchInput:Y("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",ln.colors),empty:"not-empty:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:Y("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",ln.colors,"data-highlighted:bg-surface5 data-highlighted:text-neutral5"),itemSelected:"data-selected:bg-accent1Dark data-selected:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:Y("h-4 w-4 text-accent1",ln.opacity),checkbox:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border1",checkboxIcon:"h-3 w-3 text-white",optionContent:"flex items-center gap-2 w-full min-w-0",optionText:"flex flex-col gap-0.5 min-w-0",optionLabel:"truncate",optionDescription:"text-xs text-neutral3 truncate",optionEnd:"ml-auto",error:"text-xs text-accent2"};function Gl({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="default",open:d,onOpenChange:f,container:h,error:p}){const m=e.find(y=>y.value===t)??null,g=y=>{y&&r?.(y.value)};return o.jsxs("div",{className:yn.root,children:[o.jsxs(fKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(xKe,{className:Y(mC({variant:c,size:u}),yn.trigger,p&&yn.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(Ser,{placeholder:n})]}),o.jsx(TF,{className:yn.chevron})]}),o.jsx(kKe,{container:h,children:o.jsx(CKe,{align:"start",sideOffset:4,className:yn.positioner,children:o.jsxs(jKe,{className:yn.popup,children:[o.jsxs("div",{className:yn.searchContainer,children:[o.jsx(w_,{className:yn.searchIcon}),o.jsx(bKe,{className:yn.searchInput,placeholder:s})]}),o.jsx(RKe,{className:yn.empty,children:a}),o.jsx(SKe,{className:yn.list,children:y=>o.jsxs(IKe,{value:y,className:Y(yn.item,yn.itemSelected),children:[o.jsx("span",{className:yn.checkContainer,children:o.jsx(ctr,{children:o.jsx(cv,{className:yn.checkIcon})})}),o.jsxs("span",{className:yn.optionContent,children:[y.start,o.jsxs("span",{className:yn.optionText,children:[o.jsx("span",{className:yn.optionLabel,children:y.label}),y.description&&o.jsx("span",{className:yn.optionDescription,children:y.description})]}),y.end?o.jsx("div",{className:yn.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),p&&o.jsx("span",{className:yn.error,children:p})]})}function Ldt({options:e,value:t=[],onValueChange:r,placeholder:n="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="md",open:d,onOpenChange:f,container:h,error:p}){const m=e.filter(x=>t.includes(x.value)),g=x=>{x&&r?.(x.map(w=>w.value))},y=m.length===0?n:`${m.length} selected`;return o.jsxs("div",{className:yn.root,children:[o.jsxs(fKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(xKe,{className:Y(mC({variant:c,size:u}),yn.trigger,p&&yn.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&yn.placeholder),children:y}),o.jsx(TF,{className:yn.chevron})]}),o.jsx(kKe,{container:h,children:o.jsx(CKe,{align:"start",sideOffset:4,className:yn.positioner,children:o.jsxs(jKe,{className:yn.popup,children:[o.jsxs("div",{className:yn.searchContainer,children:[o.jsx(w_,{className:yn.searchIcon}),o.jsx(bKe,{className:yn.searchInput,placeholder:s})]}),o.jsx(RKe,{className:yn.empty,children:a}),o.jsx(SKe,{className:yn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(IKe,{value:x,className:yn.item,children:[o.jsx("span",{className:Y(yn.checkbox,w?yn.checkboxSelected:yn.checkboxUnselected),children:w&&o.jsx(cv,{className:yn.checkboxIcon})}),o.jsxs("span",{className:yn.optionContent,children:[x.start,o.jsxs("span",{className:yn.optionText,children:[o.jsx("span",{className:yn.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:yn.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:yn.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),p&&o.jsx("span",{className:yn.error,children:p})]})}const On=YF,$dt=zYe,r$r=XF,n$r=XR,Fdt=b.forwardRef(({className:e,...t},r)=>o.jsx(ZR,{ref:r,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));Fdt.displayName=ZR.displayName;const vn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(r$r,{children:[o.jsx(Fdt,{}),o.jsxs(YR,{ref:n,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...r,children:[t,o.jsx(XR,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:o.jsx(Wl,{})})})]})]}));vn.displayName=YR.displayName;const kn=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});kn.displayName="DialogHeader";const uf=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});uf.displayName="DialogFooter";const Bn=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Bn.displayName="DialogBody";const bn=b.forwardRef(({className:e,...t},r)=>o.jsx(KF,{ref:r,className:Y("text-ui-md font-medium",e),...t}));bn.displayName=KF.displayName;const qs=b.forwardRef(({className:e,...t},r)=>o.jsx(JF,{ref:r,className:Y("sr-only",e),...t}));qs.displayName=JF.displayName;const zdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rd,{ref:r,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));zdt.displayName=rd.displayName;const s$r=({children:e,title:t="Command Palette",description:r="Search for commands and actions",...n})=>{const s=b.useCallback((i,l)=>{const c=i.toLowerCase();return l.toLowerCase().split(/\s+/).filter(Boolean).every(h=>c.includes(h))?1:0},[]),a=b.useCallback(i=>{i.stopPropagation()},[]);return o.jsx(On,{...n,children:o.jsxs(vn,{className:"overflow-hidden p-0",children:[o.jsx(bn,{className:"sr-only",children:t}),o.jsx(qs,{className:"sr-only",children:r}),o.jsx(zdt,{filter:s,onKeyDown:a,className:Y("**:[[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3","[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2","[&_[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:e})]})})},Bdt=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",ln.colors),"cmdk-input-wrapper":"",children:[o.jsx(w_,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",ln.colors)}),o.jsx(rd.Input,{ref:r,className:Y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",ln.colors,e),...t})]}));Bdt.displayName=rd.Input.displayName;const Udt=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.List,{ref:r,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Udt.displayName=rd.List.displayName;const Vdt=b.forwardRef((e,t)=>o.jsx(rd.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));Vdt.displayName=rd.Empty.displayName;const fb=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Group,{ref:r,className:Y("overflow-hidden p-1 text-neutral5","**:[[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-neutral3",e),...t}));fb.displayName=rd.Group.displayName;const iw=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Separator,{ref:r,className:Y("-mx-1 h-px bg-border1",e),...t}));iw.displayName=rd.Separator.displayName;const Zo=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Item,{ref:r,className:Y("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",ln.colors,"data-[selected=true]:bg-surface5 data-[selected=true]:text-neutral5","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Zo.displayName=rd.Item.displayName;const qdt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});qdt.displayName="CommandShortcut";function Hdt({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const a$r=inr,i$r=onr,o$r=iP,l$r=unr,c$r=lnr,mme=Y("relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"),Qdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(DJe,{ref:n,className:Y("cursor-pointer",e),...r,children:t}));Qdt.displayName=DJe.displayName;const Wdt=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(VJe,{ref:s,className:Y(mme,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(zce,{className:"-rotate-90 opacity-50"})})]}));Wdt.displayName=VJe.displayName;const Gdt=b.forwardRef(({className:e,...t},r)=>o.jsx(iP,{children:o.jsx(fz,{ref:r,className:Y("bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...t})}));Gdt.displayName=fz.displayName;const Zdt=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(iP,{container:t,children:o.jsx(LJe,{ref:s,sideOffset:r,className:Y("bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...n})}));Zdt.displayName=LJe.displayName;const Ydt=b.forwardRef(({className:e,...t},r)=>o.jsx(FJe,{ref:r,className:Y(mme,e),...t}));Ydt.displayName=FJe.displayName;const Xdt=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(zJe,{ref:s,className:Y(mme,"w-full gap-4 px-2",e),checked:r,...n,children:[o.jsx("div",{className:"border dark:border-white/20 border-black/20 flex h-4 w-4 items-center justify-center rounded-sm",children:r&&o.jsx(cv,{})}),t]}));Xdt.displayName=zJe.displayName;const Kdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(BJe,{ref:n,className:Y("relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(cnr,{children:o.jsx(IHe,{className:"h-2 w-2 fill-current"})})}),t]}));Kdt.displayName=BJe.displayName;const Jdt=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx($Je,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Jdt.displayName=$Je.displayName;const eft=b.forwardRef(({className:e,...t},r)=>o.jsx(UJe,{ref:r,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));eft.displayName=UJe.displayName;const tft=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});tft.displayName="DropdownMenuShortcut";function yt({open:e,onOpenChange:t,children:r,modal:n}){return o.jsx(a$r,{modal:n,open:e,onOpenChange:t,children:r})}yt.Trigger=Qdt;yt.Content=Zdt;yt.Group=i$r;yt.Portal=o$r;yt.Item=Ydt;yt.CheckboxItem=Xdt;yt.RadioItem=Kdt;yt.Label=Jdt;yt.Separator=eft;yt.Shortcut=tft;yt.Sub=l$r;yt.SubContent=Gdt;yt.SubTrigger=Wdt;yt.RadioGroup=c$r;const rL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function _n({className:e,...t}){return o.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:bg-linear-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const rft=({icon:e,title:t,isLoading:r,children:n})=>o.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[o.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?o.jsx(_n,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(me,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&o.jsx("div",{className:"pt-2",children:n})]});function u$r({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",t),children:e})}function d$r({children:e}){return o.jsxs("p",{className:Y("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx($E,{})," ",e]})}function f$r({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function h$r({children:e,name:t,required:r,size:n="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Y("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":n==="bigger"},s),children:[e,r&&o.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function p$r({children:e,className:t,layout:r="vertical",labelColumnWidth:n}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":r==="horizontal"},t),style:r==="horizontal"&&n?{gridTemplateColumns:`${n} 1fr`}:void 0,children:e})}const mo=Object.assign({},{Layout:p$r,Column:u$r,Label:h$r,HelpText:f$r,ErrorMsg:d$r});function m$r({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-6 content-start",t),children:e})}function g$r({children:e,className:t,columns:r=1,gap:n}){return o.jsx("div",{className:Y("grid",{"grid-cols-1":r===1,"grid-cols-2":r===2},n??"gap-6",t),children:e})}Object.assign(g$r,{Column:m$r});const y$r=wS(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(fdt,cme,ume),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${lc.sm} text-ui-sm px-[.75em]`,md:`${lc.md} text-ui-md px-[.75em]`,default:`${lc.default} text-ui-md px-[.85em]`,lg:`${lc.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),ar=b.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Y(y$r({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:l,"aria-invalid":a,...i}));ar.displayName="Input";function Sx({name:e,value:t,label:r,labelIsHidden:n=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:l=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:h="default",testId:p,className:m,...g}){return o.jsxs(mo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:l,size:u||"bigger",children:n?o.jsx(Zu,{children:r}):r})}):null,o.jsxs(mo.Column,{children:[!n&&d==="vertical"?o.jsx(mo.Label,{name:e,required:l,size:u||"default",children:r}):null,o.jsx(ar,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":p,size:h,...g}),a&&o.jsx(mo.HelpText,{children:a}),i&&o.jsx(mo.ErrorMsg,{children:i})]})]})}function Ox({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,value:a,label:i,labelIsHidden:l=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:h,size:p,isMinimized:m,onMinimizedChange:g}){const y=b.useRef(null);return b.useEffect(()=>{m===!1&&y.current?.focus()},[m]),m?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ce,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(w_,{})})}),o.jsx(Gr,{children:i||"Search"})]}):o.jsxs(mo.Layout,{layout:c,className:h,children:[c==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:l?o.jsx(Zu,{children:i}):i})}):null,o.jsxs(mo.Column,{children:[c==="vertical"&&i&&!l?o.jsx(mo.Label,{name:e,required:n,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(ar,{ref:y,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:p,className:Y(p==="sm"&&"pl-8 pr-8",p==="md"&&"pl-9 pr-9",(!p||p==="default")&&"pl-10 pr-10",p==="lg"&&"pl-11 pr-11")}),o.jsx(w_,{"aria-hidden":"true",className:Y("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",p==="sm"&&"w-3.5 h-3.5",p==="md"&&"w-4 h-4",(!p||p==="default")&&"w-[1.125rem] h-[1.125rem]",p==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&o.jsx(ce,{variant:"ghost",size:p||"default","aria-label":"Clear search",onClick:()=>{a&&f(),m===!1&&g?.(!0)},className:"absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(Wl,{})})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const pi=Fnr,mi=znr,ei=b.forwardRef(({className:e,children:t,variant:r="default",size:n="default",...s},a)=>o.jsxs(met,{ref:a,className:Y(mC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(Bnr,{asChild:!0,children:o.jsx(zce,{className:Y("h-4 w-4 text-neutral3",ln.colors)})})]}));ei.displayName=met.displayName;const ti=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(Unr,{children:o.jsx(get,{ref:s,className:Y("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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",r==="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:r,...n,children:o.jsx(Vnr,{className:Y("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ti.displayName=get.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(yet,{ref:n,className:Y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",ln.colors,"hover:bg-surface5 hover:text-neutral5","focus:bg-surface5 focus:text-neutral5","data-[state=checked]:bg-accent1Dark data-[state=checked]:text-accent1","data-disabled:pointer-events-none data-disabled:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Hnr,{children:o.jsx(cv,{className:"h-4 w-4 text-accent1"})})}),o.jsx(qnr,{children:t})]}));ss.displayName=yet.displayName;function $o({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,size:a="default",value:i,label:l,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:h="Select an option",onValueChange:p,className:m}){return o.jsxs(mo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:c?o.jsx(Zu,{children:l}):l})}):null,o.jsxs(mo.Column,{children:[u==="vertical"&&l&&!c?o.jsx(mo.Label,{name:e,required:n,children:l}):null,o.jsxs(pi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(ei,{size:a,children:o.jsx(mi,{placeholder:h})}),o.jsx(ti,{children:f.map(g=>o.jsx(ss,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const v$r=wS("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(bet,{ref:r,className:Y(v$r(),e),...t}));xt.displayName=bet.displayName;function K_({children:e}){const t=e.replace(/\\n/g,`
293
+ `).concat(k.x,",").concat(k.y),E=Sl(e.id)?GA("recharts-radial-line-"):e.id;return b.createElement("text",wy({},n,{dominantBaseline:"central",className:wa("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},QNr=(e,t,r)=>{var{cx:n,cy:s,innerRadius:a,outerRadius:i,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(r==="outside"){var{x:d,y:f}=Ul(n,s,i+t,u);return{x:d,y:f,textAnchor:d>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var h=(a+i)/2,{x:p,y:m}=Ul(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},_$=e=>e!=null&&"cx"in e&&qr(e.cx),WNr={angle:0,offset:5,zIndex:Zc.label,position:"middle",textBreakAll:!1};function GNr(e){if(!_$(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function bb(e){var t=nd(e,WNr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=UNr(),h=Wlt(),p=s==="center"?h:f??h,m,g,y;r==null?m=p:_$(r)?m=r:m=Ohe(r);var x=GNr(m);if(!m||Sl(a)&&Sl(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=qT(qT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=PAe(w,PNr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=PAe(w,MNr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=VNr(t);var T=su(t);if(_$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return HNr(t,s,g,T,m);y=QNr(m,t.offset,t.position)}else{if(!x)return null;var j=RNr({viewBox:x,position:s,offset:t.offset,parentViewBox:_$(n)?void 0:n});y=qT(qT({x:j.x,y:j.y,textAnchor:j.horizontalAnchor,verticalAnchor:j.verticalAnchor},j.width!==void 0?{width:j.width}:{}),j.height!==void 0?{height:j.height}:{})}return b.createElement(xv,{zIndex:t.zIndex},b.createElement(Tpe,wy({ref:d,className:wa("recharts-label",c)},T,y,{textAnchor:Ult(T.textAnchor)?T.textAnchor:y.textAnchor,breakAll:u}),g))}bb.displayName="Label";var ZNr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(bb,wy({key:"label-implicit"},n)):eg(e)?b.createElement(bb,wy({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===bb?b.cloneElement(e,qT({key:"label-implicit"},n)):b.createElement(bb,wy({key:"label-implicit",content:e},n)):Npe(e)?b.createElement(bb,wy({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(bb,wy({},e,{key:"label-implicit"},n)):null};function YNr(e){var{label:t,labelRef:r}=e,n=Wlt();return ZNr(t,n,r)||null}var XNr=["valueAccessor"],KNr=["dataKey","clockWise","id","textBreakAll","zIndex"];function w4(){return w4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w4.apply(null,arguments)}function DAe(e,t){if(e==null)return{};var r,n,s=JNr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function JNr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var eAr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(_Nr(t))return t},Glt=b.createContext(void 0),tAr=Glt.Provider,Zlt=b.createContext(void 0);Zlt.Provider;function rAr(){return b.useContext(Glt)}function nAr(){return b.useContext(Zlt)}function E$(e){var{valueAccessor:t=eAr}=e,r=DAe(e,XNr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=DAe(r,KNr),u=rAr(),d=nAr(),f=u||d;return!f||!f.length?null:b.createElement(xv,{zIndex:l??Zc.label},b.createElement(Qy,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=Sl(n)?t(h,p):Ql(h.payload,n),y=Sl(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(bb,w4({key:"label-".concat(p)},su(h),c,y,{fill:(m=r.fill)!==null&&m!==void 0?m:h.fill,parentViewBox:h.parentViewBox,value:g,textBreakAll:i,viewBox:h.viewBox,index:p,zIndex:0}))})))}E$.displayName="LabelList";function sAr(e){var{label:t}=e;return t?t===!0?b.createElement(E$,{key:"labelList-implicit"}):b.isValidElement(t)||Npe(t)?b.createElement(E$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(E$,w4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Qae(){return Qae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qae.apply(null,arguments)}var Ylt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=wa("recharts-dot",s);return qr(t)&&qr(r)&&qr(n)?b.createElement("circle",Qae({},Jm(e),phe(e),{className:a,cx:t,cy:r,r:n})):null},aAr={radiusAxis:{},angleAxis:{}},Xlt=Ec({name:"polarAxis",initialState:aAr,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:QPn,removeRadiusAxis:WPn,addAngleAxis:GPn,removeAngleAxis:ZPn}=Xlt.actions,iAr=Xlt.reducer;function oAr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var WH={exports:{}},Js={};var LAe;function lAr(){if(LAe)return Js;LAe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type,y){case r:case s:case n:case u:case d:return y;default:switch(y=y&&y.$$typeof,y){case l:case i:case c:case h:case f:case a:return y;default:return x}}case t:return x}}}return Js.ContextConsumer=i,Js.ContextProvider=a,Js.Element=e,Js.ForwardRef=c,Js.Fragment=r,Js.Lazy=h,Js.Memo=f,Js.Portal=t,Js.Profiler=s,Js.StrictMode=n,Js.Suspense=u,Js.SuspenseList=d,Js.isAsyncMode=function(){return!1},Js.isConcurrentMode=function(){return!1},Js.isContextConsumer=function(y){return g(y)===i},Js.isContextProvider=function(y){return g(y)===a},Js.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Js.isForwardRef=function(y){return g(y)===c},Js.isFragment=function(y){return g(y)===r},Js.isLazy=function(y){return g(y)===h},Js.isMemo=function(y){return g(y)===f},Js.isPortal=function(y){return g(y)===t},Js.isProfiler=function(y){return g(y)===s},Js.isStrictMode=function(y){return g(y)===n},Js.isSuspense=function(y){return g(y)===u},Js.isSuspenseList=function(y){return g(y)===d},Js.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===s||y===n||y===u||y===d||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===a||y.$$typeof===i||y.$$typeof===c||y.$$typeof===m||y.getModuleId!==void 0)},Js.typeOf=g,Js}var $Ae;function cAr(){return $Ae||($Ae=1,WH.exports=lAr()),WH.exports}cAr();var Klt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,GH={},FAe;function uAr(){return FAe||(FAe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(GH)),GH}var ZH,zAe;function dAr(){return zAe||(zAe=1,ZH=uAr().isPlainObject),ZH}var fAr=dAr();const hAr=Uo(fAr);var BAe,UAe,VAe,qAe,HAe;function QAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function WAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QAe(Object(r),!0).forEach(function(n){pAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pAr(e,t,r){return(t=mAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mAr(e){var t=gAr(e,"string");return typeof t=="symbol"?t:t+""}function gAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function S4(){return S4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S4.apply(null,arguments)}function nT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var GAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(BAe||(BAe=nT(["M ",",",""])),e,t),i+=Qi(UAe||(UAe=nT(["L ",",",""])),e+r,t),i+=Qi(VAe||(VAe=nT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(qAe||(qAe=nT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(HAe||(HAe=nT(["L ",","," Z"])),e,t),i},yAr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},vAr=e=>{var t=nd(e,yAr),{x:r,y:n,upperWidth:s,lowerWidth:a,height:i,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,h=b.useRef(null),[p,m]=b.useState(-1),g=b.useRef(s),y=b.useRef(a),x=b.useRef(i),w=b.useRef(r),S=b.useRef(n),k=Che(e,"trapezoid-");if(b.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var D=h.current.getTotalLength();D&&m(D)}catch{}},[]),r!==+r||n!==+n||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var _=wa("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",S4({},su(t),{className:_,d:GAe(r,n,s,a,i)})));var E=g.current,T=y.current,j=x.current,N=w.current,I=S.current,P="0px ".concat(p===-1?1:p,"px"),R="".concat(p,"px ").concat(p,"px"),B=pit(["strokeDasharray"],u,c);return b.createElement(Ehe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},D=>{var $=Mu(E,s,D),U=Mu(T,a,D),z=Mu(j,i,D),H=Mu(N,r,D),Q=Mu(I,n,D);h.current&&(g.current=$,y.current=U,x.current=z,w.current=H,S.current=Q);var L=D>0?{transition:B,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",S4({},su(t),{className:_,d:GAe(H,Q,$,U,z),ref:h,style:WAe(WAe({},L),t.style)}))})},bAr=["option","shapeType","activeClassName","inActiveClassName"];function xAr(e,t){if(e==null)return{};var r,n,s=wAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ZAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function O4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZAe(Object(r),!0).forEach(function(n){SAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SAr(e,t,r){return(t=OAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OAr(e){var t=kAr(e,"string");return typeof t=="symbol"?t:t+""}function kAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _Ar(e,t){return O4(O4({},t),e)}function EAr(e,t){return e==="symbols"}function YAe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(vit,r);case"trapezoid":return b.createElement(vAr,r);case"sector":return b.createElement(wit,r);case"symbols":if(EAr(t))return b.createElement(sat,r);break;case"curve":return b.createElement(hit,r);default:return null}}function CAr(e){return b.isValidElement(e)?e.props:e}function jAr(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=xAr(e,bAr),i;if(b.isValidElement(t))i=b.cloneElement(t,O4(O4({},a),CAr(t)));else if(typeof t=="function")i=t(a,a.index);else if(hAr(t)&&typeof t!="boolean"){var l=_Ar(t,a);i=b.createElement(YAe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(YAe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Qy,{className:n},i):b.createElement(Qy,{className:s},i)}function TAr(e){var{tooltipEntrySettings:t}=e,r=Vo(),n=sd(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(LCr(t)):s.current!==t&&r($Cr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(FCr(s.current)),s.current=null)},[r]),null}function NAr(e){var{legendPayload:t}=e,r=Vo(),n=sd(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(K1r(t)):s.current!==t&&r(J1r({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(eSr(s.current)),s.current=null)},[r]),null}var YH,AAr=()=>{var[e]=b.useState(()=>GA("uid-"));return e},IAr=(YH=Y1.useId)!==null&&YH!==void 0?YH:AAr;function RAr(e,t){var r=IAr();return t||(e?"".concat(e,"-").concat(r):r)}var PAr=b.createContext(void 0),MAr=e=>{var{id:t,type:r,children:n}=e,s=RAr("recharts-".concat(r),t);return b.createElement(PAr.Provider,{value:s},n(s))},DAr={cartesianItems:[],polarItems:[]},Jlt=Ec({name:"graphicalItems",initialState:DAr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:ci()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:ci()},removeCartesianGraphicalItem:{reducer(e,t){var r=uh(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:ci()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:ci()},removePolarGraphicalItem:{reducer(e,t){var r=uh(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:ci()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=uh(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:ci()}}}),{addCartesianGraphicalItem:LAr,replaceCartesianGraphicalItem:$Ar,removeCartesianGraphicalItem:FAr,addPolarGraphicalItem:YPn,removePolarGraphicalItem:XPn,replacePolarGraphicalItem:KPn}=Jlt.actions,zAr=Jlt.reducer,BAr=e=>{var t=Vo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(LAr(e)):r.current!==e&&t($Ar({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(FAr(r.current)),r.current=null)},[t]),null},UAr=b.memo(BAr),VAr=["points"];function XAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XAe(Object(r),!0).forEach(function(n){qAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qAr(e,t,r){return(t=HAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HAr(e){var t=QAr(e,"string");return typeof t=="symbol"?t:t+""}function QAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k4(){return k4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k4.apply(null,arguments)}function WAr(e,t){if(e==null)return{};var r,n,s=GAr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function GAr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ZAr(e){var{option:t,dotProps:r,className:n}=e;if(b.isValidElement(t))return b.cloneElement(t,r);if(typeof t=="function")return t(r);var s=wa(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=WAr(a,VAr);return b.createElement(Ylt,k4({},l,{className:s}))}function YAr(e,t){return e==null?!1:t?!0:e.length===1}function XAr(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Zc.scatter}=e;if(!YAr(t,r))return null;var d=Klt(r),f=cxr(r),h=t.map((m,g)=>{var y,x,w=XH(XH(XH({r:3},i),f),{},{index:g,cx:(y=m.x)!==null&&y!==void 0?y:void 0,cy:(x=m.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return b.createElement(ZAr,{key:"dot-".concat(g),option:r,dotProps:w,className:s})}),p={};return l&&c!=null&&(p.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),b.createElement(xv,{zIndex:u},b.createElement(Qy,k4({className:n},p),h))}function KAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function JAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KAe(Object(r),!0).forEach(function(n){KAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KAr(e,t,r){return(t=JAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JAr(e){var t=eIr(e,"string");return typeof t=="symbol"?t:t+""}function eIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tIr={xAxis:{},yAxis:{},zAxis:{}},ect=Ec({name:"cartesianAxis",initialState:tIr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:ci()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:ci()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:ci()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:ci()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:ci()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:ci()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:ci()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:ci()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:ci()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&n===i[1]&&n!==s.width&&Math.abs(n-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...i,n].slice(-3);e.yAxis[r]=JAe(JAe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:rIr,replaceXAxis:nIr,removeXAxis:sIr,addYAxis:aIr,replaceYAxis:iIr,removeYAxis:oIr,addZAxis:JPn,replaceZAxis:eMn,removeZAxis:tMn,updateYAxisWidth:lIr}=ect.actions,cIr=ect.reducer,uIr=Xe([Yl],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),dIr=Xe([uIr,pv,mv],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Ape=()=>en(dIr),fIr=()=>en(Ljr);function eIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function KH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eIe(Object(r),!0).forEach(function(n){hIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hIr(e,t,r){return(t=pIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pIr(e){var t=mIr(e,"string");return typeof t=="symbol"?t:t+""}function mIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gIr=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var l={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KH(KH(KH({},l),zz(s)),phe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Ylt,c),b.createElement(Qy,{className:"recharts-active-dot",clipPath:i},u)};function yIr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=Zc.activeDot}=e,l=en(iI),c=fIr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return Sl(u)?null:b.createElement(xv,{zIndex:i},b.createElement(gIr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var vIr=e=>{var{chartData:t}=e,r=Vo(),n=sd();return b.useEffect(()=>n?()=>{}:(r(vAe(t)),()=>{r(vAe(void 0))}),[t,r,n]),null},tIe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},tct=Ec({name:"brush",initialState:tIe,reducers:{setBrushSettings(e,t){return t.payload==null?tIe:t.payload}}}),{setBrushSettings:rMn}=tct.actions,bIr=tct.reducer;function xIr(e){return(e%180+180)%180}var wIr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=xIr(s),i=a*Math.PI/180,l=Math.atan(n/r),c=i>l&&i<Math.PI-l?n/Math.sin(i):r/Math.cos(i);return Math.abs(c)},SIr={dots:[],areas:[],lines:[]},rct=Ec({name:"referenceElements",initialState:SIr,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=uh(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=uh(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=uh(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:nMn,removeDot:sMn,addArea:aMn,removeArea:iMn,addLine:oMn,removeLine:lMn}=rct.actions,OIr=rct.reducer,kIr=b.createContext(void 0),_Ir=e=>{var{children:t}=e,[r]=b.useState("".concat(GA("recharts"),"-clip")),n=Ape();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(kIr.Provider,{value:r},b.createElement("defs",null,b.createElement("clipPath",{id:r},b.createElement("rect",{x:s,y:a,height:l,width:i}))),t)};function nct(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function EIr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return wIr(n,r)}function CIr(e,t,r){var n=r==="width",{x:s,y:a,width:i,height:l}=e;return t===1?{start:n?s:a,end:n?s+i:a+l}:{start:n?s+i:a+l,end:n?s:a}}function lI(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-s)<=0}function jIr(e,t){return nct(e,t+1)}function TIr(e,t,r,n,s){for(var a=(n||[]).slice(),{start:i,end:l}=t,c=0,u=1,d=i,f=function(){var m=n?.[c];if(m===void 0)return{v:nct(n,u)};var g=c,y,x=()=>(y===void 0&&(y=r(m,g)),y),w=m.coordinate,S=c===0||lI(e,w,x,d,l);S||(c=0,d=i,u+=1),S&&(d=w+e*(x()/2+s),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function NIr(e,t,r,n,s){var a=(n||[]).slice(),i=a.length;if(i===0)return[];for(var{start:l,end:c}=t,u=1;u<=i;u++){for(var d=(i-1)%u,f=l,h=!0,p=function(){var k=n[g];if(k==null)return 0;var _=g,E,T=()=>(E===void 0&&(E=r(k,_)),E),j=k.coordinate,N=g===d||lI(e,j,T,f,c);if(!N)return h=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=p(),!(m!==0&&m===1));g+=u);if(h){for(var y=[],x=d;x<i;x+=u){var w=n[x];w!=null&&y.push(w)}return y}}return[]}function rIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function rc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rIe(Object(r),!0).forEach(function(n){AIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AIr(e,t,r){return(t=IIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IIr(e){var t=RIr(e,"string");return typeof t=="symbol"?t:t+""}function RIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PIr(e,t,r,n,s){for(var a=(n||[]).slice(),i=a.length,{start:l}=t,{end:c}=t,u=function(h){var p=a[h];if(p==null)return 1;var m=p,g,y=()=>(g===void 0&&(g=r(p,h)),g);if(h===i-1){var x=e*(m.coordinate+e*y()/2-c);a[h]=m=rc(rc({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=rc(rc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=lI(e,m.tickCoord,y,l,c);w&&(c=m.tickCoord-e*(y()/2+s),a[h]=rc(rc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function MIr(e,t,r,n,s,a){var i=(n||[]).slice(),l=i.length,{start:c,end:u}=t;if(a){var d=n[l-1];if(d!=null){var f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);if(i[l-1]=d=rc(rc({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=lI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=rc(rc({},d),{},{isShow:!0}))}}}for(var m=a?l-1:l,g=function(w){var S=i[w];if(S==null)return 1;var k=S,_,E=()=>(_===void 0&&(_=r(S,w)),_);if(w===0){var T=e*(k.coordinate-e*E()/2-c);i[w]=k=rc(rc({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=rc(rc({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=lI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=rc(rc({},k),{},{isShow:!0}))}},y=0;y<m;y++)g(y);return i}function Ipe(e,t,r){var{tick:n,ticks:s,viewBox:a,minTickGap:i,orientation:l,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!n)return[];if(qr(c)||wP.isSsr){var h;return(h=jIr(s,qr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?jN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?EIr(jN(T,{fontSize:t,letterSpacing:r}),g,f):jN(T,{fontSize:t,letterSpacing:r})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?ch(w.coordinate-x.coordinate):1,k=CIr(a,S,m);return c==="equidistantPreserveStart"?TIr(S,k,y,s,i):c==="equidistantPreserveEnd"?NIr(S,k,y,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=MIr(S,k,y,s,i,c==="preserveStartEnd"):p=PIr(S,k,y,s,i),p.filter(_=>_.isShow))}var DIr=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=e,i=0;if(t){Array.from(t).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>i&&(i=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+a,u=i+c+l+(r?n:0);return Math.round(u)}return 0},LIr={xAxis:{},yAxis:{}},sct=Ec({name:"renderedTicks",initialState:LIr,reducers:{setRenderedTicks:(e,t)=>{var{axisType:r,axisId:n,ticks:s}=t.payload;e[r][n]=s},removeRenderedTicks:(e,t)=>{var{axisType:r,axisId:n}=t.payload;delete e[r][n]}}}),{setRenderedTicks:$Ir,removeRenderedTicks:FIr}=sct.actions,zIr=sct.reducer,BIr=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function UIr(e,t){if(e==null)return{};var r,n,s=VIr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function VIr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function T1(){return T1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},T1.apply(null,arguments)}function nIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nIe(Object(r),!0).forEach(function(n){qIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qIr(e,t,r){return(t=HIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HIr(e){var t=QIr(e,"string");return typeof t=="symbol"?t:t+""}function QIr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dy={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:Zc.axis};function WIr(e){var{x:t,y:r,width:n,height:s,orientation:a,mirror:i,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Hi(Hi(Hi({},c),Jm(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=Hi(Hi({},u),{},{x1:t,y1:r+d*s,x2:t+n,y2:r+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=Hi(Hi({},u),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return b.createElement("line",T1({},u,{className:wa("recharts-cartesian-axis-line",qz(l,"className"))}))}function GIr(e,t,r,n,s,a,i,l,c){var u,d,f,h,p,m,g=l?-1:1,y=e.tickSize||i,x=qr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=r+ +!l*s,f=h-g*y,m=f-g*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!l*n,u=d-g*y,p=u-g*c,m=x;break;case"right":f=h=e.coordinate,d=t+ +l*n,u=d+g*y,p=u+g*c,m=x;break;default:u=d=e.coordinate,h=r+ +l*s,f=h+g*y,m=f+g*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:m}}}function ZIr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function YIr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function XIr(e){var{option:t,tickProps:r,value:n}=e,s,a=wa(r.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))s=b.cloneElement(t,Hi(Hi({},r),{},{className:a}));else if(typeof t=="function")s=t(Hi(Hi({},r),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=wa(i,oAr(t))),s=b.createElement(Tpe,T1({},r,{className:i}),n)}return s}function KIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Vo();return b.useEffect(()=>{if(n==null||r==null)return hS;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s($Ir({ticks:a,axisId:n,axisType:r})),()=>{s(FIr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var JIr=b.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:i,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:f,x:h,y:p,width:m,height:g,tickSize:y,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:k,events:_,axisType:E,axisId:T}=e,j=Ipe(Hi(Hi({},k),{},{ticks:r}),w,S),N=Jm(k),I=zz(n),P=Ult(N.textAnchor)?N.textAnchor:ZIr(d,f),R=YIr(d,f),B={};typeof s=="object"&&(B=s);var D=Hi(Hi({},N),{},{fill:"none"},B),$=j.map(H=>Hi({entry:H},GIr(H,h,p,m,g,d,y,f,x))),U=$.map(H=>{var{entry:Q,line:L}=H;return b.createElement(Qy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&b.createElement("line",T1({},D,L,{className:wa("recharts-cartesian-axis-tick-line",qz(s,"className"))})))}),z=$.map((H,Q)=>{var L,Z,{entry:V,tick:M}=H,W=Hi(Hi(Hi(Hi({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},M),{},{index:Q,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(L=(Z=u?.angle)!==null&&Z!==void 0?Z:N.angle)!==null&&L!==void 0?L:0}),G=Hi(Hi({},W),I);return b.createElement(Qy,T1({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},h0r(_,V,Q)),n&&b.createElement(XIr,{option:n,tickProps:G,value:"".concat(typeof i=="function"?i(V.value,Q):V.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(KIr,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(xv,{zIndex:Zc.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),U.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},U))}),eRr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=UIr(e,BIr),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return DIr({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var y=b.useCallback(x=>{if(x){var w=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=w;var S=w[0];if(S){var k=window.getComputedStyle(S),_=k.fontSize,E=k.letterSpacing;(_!==f||E!==p)&&(h(_),m(E))}}},[f,p]);return i||n!=null&&n<=0||s!=null&&s<=0?null:b.createElement(xv,{zIndex:e.zIndex},b.createElement(Qy,{className:wa("recharts-cartesian-axis",a)},b.createElement(WIr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Jm(e)}),b.createElement(JIr,{ref:y,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:p,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:u}),b.createElement(zNr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(YNr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Rpe=b.forwardRef((e,t)=>{var r=nd(e,Dy);return b.createElement(eRr,T1({},r,{ref:t}))});Rpe.displayName="CartesianAxis";var tRr=["x1","y1","x2","y2","key"],rRr=["offset"],nRr=["xAxisId","yAxisId"],sRr=["xAxisId","yAxisId"];function sIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sIe(Object(r),!0).forEach(function(n){aRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aRr(e,t,r){return(t=iRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iRr(e){var t=oRr(e,"string");return typeof t=="symbol"?t:t+""}function oRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ew(){return Ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ew.apply(null,arguments)}function _4(e,t){if(e==null)return{};var r,n,s=lRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function lRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var cRr=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:i,ry:l}=e;return b.createElement("rect",{x:n,y:s,ry:l,width:a,height:i,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function act(e){var{option:t,lineItemProps:r}=e,n;if(b.isValidElement(t))n=b.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:a,y1:i,x2:l,y2:c,key:u}=r,d=_4(r,tRr),f=(s=Jm(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=_4(f,rRr);n=b.createElement("line",Ew({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function uRr(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_4(e,nRr),c=s.map((u,d)=>{var f=cc(cc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(act,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function dRr(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=_4(e,sRr),c=s.map((u,d)=>{var f=cc(cc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(act,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function fRr(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:a,height:i,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var u=l.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%t.length;return b.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:g,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function hRr(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:i,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,h)=>f-h);s!==u[0]&&u.unshift(0);var d=u.map((f,h)=>{var p=u[h+1],m=p==null,g=m?s+i-f:p-f;if(g<=0)return null;var y=h%r.length;return b.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:g,height:l,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var pRr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return Hat(Ipe(cc(cc(cc({},Dy),r),{},{ticks:Qat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},mRr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return Hat(Ipe(cc(cc(cc({},Dy),r),{},{ticks:Qat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},gRr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Zc.grid};function ict(e){var t=eit(),r=tit(),n=Jat(),s=cc(cc({},nd(e,gRr)),{},{x:qr(e.x)?e.x:n.left,y:qr(e.y)?e.y:n.top,width:qr(e.width)?e.width:n.width,height:qr(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:i,x:l,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:p}=s,m=sd(),g=en(N=>aAe(N,"xAxis",a,m)),y=en(N=>aAe(N,"yAxis",i,m));if(!tg(u)||!tg(d)||!qr(l)||!qr(c))return null;var x=s.verticalCoordinatesGenerator||pRr,w=s.horizontalCoordinatesGenerator||mRr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:y?cc(cc({},y),{},{ticks:_?h:y.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);Y5(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}if((!k||!k.length)&&typeof x=="function"){var T=p&&p.length,j=x({xAxis:g?cc(cc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);Y5(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(xv,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(cRr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(fRr,Ew({},s,{horizontalPoints:S})),b.createElement(hRr,Ew({},s,{verticalPoints:k})),b.createElement(uRr,Ew({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:y})),b.createElement(dRr,Ew({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:y}))))}ict.displayName="CartesianGrid";var yRr={},oct=Ec({name:"errorBars",initialState:yRr,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:cMn,replaceErrorBar:uMn,removeErrorBar:dMn}=oct.actions,vRr=oct.reducer,bRr=["children"];function xRr(e,t){if(e==null)return{};var r,n,s=wRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var SRr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},ORr=b.createContext(SRr);function kRr(e){var{children:t}=e,r=xRr(e,bRr);return b.createElement(ORr.Provider,{value:r},t)}function lct(e,t){var r,n,s=en(u=>yv(u,e)),a=en(u=>vv(u,t)),i=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Yo.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:Xo.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function _Rr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=Ape(),{needClipX:a,needClipY:i,needClip:l}=lct(t,r);if(!l||!s)return null;var{x:c,y:u,width:d,height:f}=s;return b.createElement("clipPath",{id:"clipPath-".concat(n)},b.createElement("rect",{x:a?c:c-d/2,y:i?u:u-f/2,width:a?d:d*2,height:i?f:f*2}))}var cct=(e,t,r,n)=>llt(e,"xAxis",t,n),uct=(e,t,r,n)=>olt(e,"xAxis",t,n),dct=(e,t,r,n)=>llt(e,"yAxis",r,n),fct=(e,t,r,n)=>olt(e,"yAxis",r,n),ERr=Xe([Fi,cct,dct,uct,fct],(e,t,r,n,s)=>hv(e,"xAxis")?Z5(t,n,!1):Z5(r,s,!1)),CRr=(e,t,r,n,s)=>s;function jRr(e){return e.type==="line"}var TRr=Xe([Aot,CRr],(e,t)=>e.filter(jRr).find(r=>r.id===t)),NRr=Xe([Fi,cct,dct,uct,fct,TRr,ERr,jhe],(e,t,r,n,s,a,i,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(a==null||t==null||r==null||n==null||s==null||n.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:h}=a,p;if(h!=null&&h.length>0?p=h:p=c?.slice(u,d+1),p!=null)return XRr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function ARr(e){var t=zz(e),r=3,n=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),l=Number(a);return(Number.isNaN(i)||i<0)&&(i=r),(Number.isNaN(l)||l<0)&&(l=n),{r:i,strokeWidth:l}}return{r,strokeWidth:n}}var IRr=["id"],RRr=["type","layout","connectNulls","needClip","shape"],PRr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function cI(){return cI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cI.apply(null,arguments)}function aIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aIe(Object(r),!0).forEach(function(n){MRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MRr(e,t,r){return(t=DRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DRr(e){var t=LRr(e,"string");return typeof t=="symbol"?t:t+""}function LRr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ppe(e,t){if(e==null)return{};var r,n,s=$Rr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $Rr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var FRr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:Wat(r,t),payload:e}]},zRr=b.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:s,fill:a,name:i,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r,getPosition:hS,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Wat(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(TAr,{tooltipEntrySettings:f})}),hct=(e,t)=>"".concat(t,"px ").concat(e,"px");function BRr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var URr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return hct(t,e);for(var s=Math.floor(e/n),a=e%n,i=[],l=0,c=0;l<r.length;c+=(u=r[l])!==null&&u!==void 0?u:0,++l){var u,d=r[l];if(d!=null&&c+d>a){i=[...r.slice(0,l),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...BRr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function VRr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=Ppe(n,IRr),u=Jm(c);return b.createElement(XAr,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function qRr(e){var{showLabels:t,children:r,points:n}=e,s=b.useMemo(()=>n?.map(a=>{var i,l,c={x:(i=a.x)!==null&&i!==void 0?i:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return pm(pm({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(tAr,{value:t?s:void 0},r)}function iIe(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:s,props:a}=e,{type:i,layout:l,connectNulls:c,needClip:u,shape:d}=a,f=Ppe(a,RRr),h=pm(pm({},su(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:n,type:i,layout:l,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return b.createElement(b.Fragment,null,n?.length>1&&b.createElement(jAr,cI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement(VRr,{points:n,clipPathId:t,props:a}))}function HRr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function QRr(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:h,width:p,height:m,onAnimationEnd:g,onAnimationStart:y}=r,x=s.current,w=Che(i,"recharts-line-"),S=b.useRef(w),[k,_]=b.useState(!1),E=!k,T=b.useCallback(()=>{typeof g=="function"&&g(),_(!1)},[g]),j=b.useCallback(()=>{typeof y=="function"&&y(),_(!0)},[y]),N=HRr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(qRr,{points:i,showLabels:E},r.children,b.createElement(Ehe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Mu(P,N+P,R),D=Math.min(B,N),$;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Q=>parseFloat(Q));$=URr(D,N,U)}else $=hct(N,D);else $=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,D)),x){var z=x.length/i.length,H=R===1?i:i.map((Q,L)=>{var Z=Math.floor(L*z);if(x[Z]){var V=x[Z];return pm(pm({},Q),{},{x:Mu(V.x,Q.x,R),y:Mu(V.y,Q.y,R)})}return h?pm(pm({},Q),{},{x:Mu(p*2,Q.x,R),y:Mu(m/2,Q.y,R)}):pm(pm({},Q),{},{x:Q.x,y:Q.y})});return s.current=H,b.createElement(iIe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:$})}return b.createElement(iIe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:$})}),b.createElement(sAr,{label:r.label}))}function WRr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(QRr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var GRr=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:Ql(e.payload,t)}};class ZRr extends b.Component{render(){var{hide:t,dot:r,points:n,className:s,xAxisId:a,yAxisId:i,top:l,left:c,width:u,height:d,id:f,needClip:h,zIndex:p}=this.props;if(t)return null;var m=wa("recharts-line",s),g=f,{r:y,strokeWidth:x}=ARr(r),w=Klt(r),S=y*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(xv,{zIndex:p},b.createElement(Qy,{className:m},h&&b.createElement("defs",null,b.createElement(_Rr,{clipPathId:g,xAxisId:a,yAxisId:i}),!w&&b.createElement("clipPath",{id:"clipPath-dots-".concat(g)},b.createElement("rect",{x:c-S/2,y:l-S/2,width:u+S,height:d+S}))),b.createElement(kRr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:GRr,errorBarOffset:0},b.createElement(WRr,{props:this.props,clipPathId:g}))),b.createElement(yIr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var pct={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:Zc.line,type:"linear"};function YRr(e){var t=nd(e,pct),{activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:f,legendType:h,xAxisId:p,yAxisId:m,id:g}=t,y=Ppe(t,PRr),{needClip:x}=lct(p,m),w=Ape(),S=tC(),k=sd(),_=en(I=>NRr(I,p,m,k,g));if(S!=="horizontal"&&S!=="vertical"||_==null||w==null)return null;var{height:E,width:T,x:j,y:N}=w;return b.createElement(ZRr,cI({},y,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:n,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:h,xAxisId:p,yAxisId:m,points:_,layout:S,height:E,width:T,left:j,top:N,needClip:x}))}function XRr(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var f=Ql(u,i);if(t==="horizontal"){var h=sTe({axis:r,ticks:s,bandSize:l,entry:u,index:d}),p=Sl(f)?null:n.scale.map(f);return{x:h,y:p??null,value:f,payload:u}}var m=Sl(f)?null:r.scale.map(f),g=sTe({axis:n,ticks:a,bandSize:l,entry:u,index:d});return m==null||g==null?null:{x:m,y:g,value:f,payload:u}}).filter(Boolean)}function KRr(e){var t=nd(e,pct),r=sd();return b.createElement(MAr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(NAr,{legendPayload:FRr(t)}),b.createElement(zRr,{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:n}),b.createElement(UAr,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),b.createElement(YRr,cI({},t,{id:n}))))}var mct=b.memo(KRr,c9);mct.displayName="Line";var JRr=["domain","range"],ePr=["domain","range"];function oIe(e,t){if(e==null)return{};var r,n,s=tPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function tPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function lIe(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 gct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=oIe(e,JRr),{domain:a,range:i}=t,l=oIe(t,ePr);return!lIe(r,a)||!lIe(n,i)?!1:c9(s,l)}var rPr=["type"],nPr=["dangerouslySetInnerHTML","ticks","scale"],sPr=["id","scale"];function Wae(){return Wae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wae.apply(null,arguments)}function cIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function uIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cIe(Object(r),!0).forEach(function(n){aPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aPr(e,t,r){return(t=iPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iPr(e){var t=oPr(e,"string");return typeof t=="symbol"?t:t+""}function oPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gae(e,t){if(e==null)return{};var r,n,s=lPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function lPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function cPr(e){var t=Vo(),r=b.useRef(null),n=rit(),{type:s}=e,a=Gae(e,rPr),i=f9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return uIe(uIe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(rIr(l)):r.current!==l&&t(nIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(sIr(r.current)),r.current=null)},[t]),null}var uPr=e=>{var{xAxisId:t,className:r}=e,n=en(Zat),s=sd(),a="xAxis",i=en(x=>ilt(x,a,t,s)),l=en(x=>vCr(x,t)),c=en(x=>kCr(x,t)),u=en(x=>Cot(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Gae(e,nPr),{id:m,scale:g}=u,y=Gae(u,sPr);return b.createElement(Rpe,Wae({},p,y,{x:c.x,y:c.y,width:l.width,height:l.height,className:wa("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},dPr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:Dy.axisLine,height:Yo.height,hide:!1,includeHidden:Yo.includeHidden,interval:Yo.interval,label:!1,minTickGap:Yo.minTickGap,mirror:Yo.mirror,orientation:Yo.orientation,padding:Yo.padding,reversed:Yo.reversed,scale:Yo.scale,tick:Yo.tick,tickCount:Yo.tickCount,tickLine:Dy.tickLine,tickSize:Dy.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,xAxisId:0},fPr=e=>{var t=nd(e,dPr);return b.createElement(b.Fragment,null,b.createElement(cPr,{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}),b.createElement(uPr,t))},yct=b.memo(fPr,gct);yct.displayName="XAxis";var hPr=["type"],pPr=["dangerouslySetInnerHTML","ticks","scale"],mPr=["id","scale"];function Zae(){return Zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zae.apply(null,arguments)}function dIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dIe(Object(r),!0).forEach(function(n){gPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gPr(e,t,r){return(t=yPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yPr(e){var t=vPr(e,"string");return typeof t=="symbol"?t:t+""}function vPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yae(e,t){if(e==null)return{};var r,n,s=bPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function bPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function xPr(e){var t=Vo(),r=b.useRef(null),n=rit(),{type:s}=e,a=Yae(e,hPr),i=f9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return fIe(fIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(aIr(l)):r.current!==l&&t(iIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(oIr(r.current)),r.current=null)},[t]),null}function wPr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(Zat),c=sd(),u=Vo(),d="yAxis",f=en(E=>CCr(E,t)),h=en(E=>ECr(E,t)),p=en(E=>ilt(E,d,t,c)),m=en(E=>jot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Npe(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(lIr({id:t,width:T}))}}},[p,f,u,s,t,n,m]),f==null||h==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:x}=e,w=Yae(e,pPr),{id:S,scale:k}=m,_=Yae(m,mPr);return b.createElement(Rpe,Zae({},w,_,{ref:a,labelRef:i,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:wa("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var SPr={allowDataOverflow:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:Xo.allowDuplicatedCategory,angle:Xo.angle,axisLine:Dy.axisLine,hide:!1,includeHidden:Xo.includeHidden,interval:Xo.interval,label:!1,minTickGap:Xo.minTickGap,mirror:Xo.mirror,orientation:Xo.orientation,padding:Xo.padding,reversed:Xo.reversed,scale:Xo.scale,tick:Xo.tick,tickCount:Xo.tickCount,tickLine:Dy.tickLine,tickSize:Dy.tickSize,type:Xo.type,niceTicks:Xo.niceTicks,width:Xo.width,yAxisId:0},OPr=e=>{var t=nd(e,SPr);return b.createElement(b.Fragment,null,b.createElement(xPr,{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}),b.createElement(wPr,t))},vct=b.memo(OPr,gct);vct.displayName="YAxis";var kPr=(e,t)=>t,Mpe=Xe([kPr,Fi,zit,_l,klt,bv,Yjr,Yl],nTr);function _Pr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Dpe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(_Pr(e)){var s=e.currentTarget.getBBox();r=s.width>0?t.width/s.width:1,n=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(l,c)=>({relativeX:Math.round((l-t.left)/r),relativeY:Math.round((c-t.top)/n)});return"touches"in e?Array.from(e.touches).map(l=>i(l.clientX,l.clientY)):i(e.clientX,e.clientY)}var bct=of("mouseClick"),xct=yP();xct.startListening({actionCreator:bct,effect:(e,t)=>{var r=e.payload,n=Mpe(t.getState(),Dpe(r));n?.activeIndex!=null&&t.dispatch(UCr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Xae=of("mouseMove"),wct=yP(),SO=null,F0=null,JH=null;wct.startListening({actionCreator:Xae,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");SO!==null&&(cancelAnimationFrame(SO),SO=null),F0!==null&&(typeof s!="number"||!i)&&(clearTimeout(F0),F0=null),JH=Dpe(r);var l=()=>{var c=t.getState(),u=bpe(c,c.tooltip.settings.shared);if(!JH){SO=null,F0=null;return}if(u==="axis"){var d=Mpe(c,JH);d?.activeIndex!=null?t.dispatch(mlt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(plt())}SO=null,F0=null};if(!i){l();return}s==="raf"?SO=requestAnimationFrame(l):typeof s=="number"&&F0===null&&(F0=setTimeout(l,s))}});function EPr(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 hIe={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},Sct=Ec({name:"rootProps",initialState:hIe,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:hIe.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}}}),CPr=Sct.reducer,{updateOptions:jPr}=Sct.actions,TPr=null,NPr={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)},Oct=Ec({name:"polarOptions",initialState:TPr,reducers:NPr}),{updatePolarOptions:fMn}=Oct.actions,APr=Oct.reducer,kct=of("keyDown"),_ct=of("focus"),Ect=of("blur"),E9=yP(),OO=null,z0=null,QD=null;E9.startListening({actionCreator:kct,effect:(e,t)=>{QD=e.payload,OO!==null&&(cancelAnimationFrame(OO),OO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");z0!==null&&(typeof n!="number"||!a)&&(clearTimeout(z0),z0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=QD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=xpe(u,cC(l),TP(l),AP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=bv(l);if(d==="Enter"){var m=x4(l,"axis","hover",String(u.index));t.dispatch(b4({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=ICr(l),y=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=h+x*y;if(p==null||w>=p.length||w<0)return;var S=x4(l,"axis","hover",String(w));t.dispatch(b4({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{OO=null,z0=null}};if(!a){i();return}n==="raf"?OO=requestAnimationFrame(i):typeof n=="number"&&z0===null&&(i(),QD=null,z0=setTimeout(()=>{QD?i():(z0=null,OO=null)},n))}});E9.startListening({actionCreator:_ct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var a="0",i=x4(r,"axis","hover",String(a));t.dispatch(b4({active:!0,activeIndex:a,activeCoordinate:i}))}}}});E9.startListening({actionCreator:Ect,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(b4({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function Cct(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var s=Reflect.get(r,n);return typeof s=="function"?s.bind(r):s}})}var Wf=of("externalEvent"),jct=yP(),WD=new Map,sT=new Map,eQ=new Map;jct.startListening({actionCreator:Wf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=Cct(n);eQ.set(s,{handler:r,reactEvent:a});var i=WD.get(s);i!==void 0&&(cancelAnimationFrame(i),WD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=sT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),sT.delete(s));var p=()=>{var y=eQ.get(s);try{if(!y)return;var{handler:x,reactEvent:w}=y,S=t.getState(),k={activeCoordinate:Pjr(S),activeDataKey:Ajr(S),activeIndex:iI(S),activeLabel:Clt(S),activeTooltipIndex:iI(S),isTooltipActive:Mjr(S)};x&&x(k,w)}finally{WD.delete(s),sT.delete(s),eQ.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);WD.set(s,m)}else if(typeof c=="number"){if(!sT.has(s)){p();var g=setTimeout(p,c);sT.set(s,g)}}else p()}}});var IPr=Xe([oC],e=>e.tooltipItemPayloads),RPr=Xe([IPr,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),Tct=of("touchMove"),Nct=yP(),B0=null,rb=null,pIe=null,aT=null;Nct.startListening({actionCreator:Tct,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){aT=Cct(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");B0!==null&&(cancelAnimationFrame(B0),B0=null),rb!==null&&(typeof s!="number"||!i)&&(clearTimeout(rb),rb=null),pIe=Array.from(r.touches).map(c=>Dpe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(aT!=null){var c=t.getState(),u=bpe(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=pIe)===null||d===void 0?void 0:d[0];if(f==null){B0=null,rb=null;return}var h=Mpe(c,f);h?.activeIndex!=null&&t.dispatch(mlt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=aT.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var y=g.getAttribute(l1r),x=(p=g.getAttribute(c1r))!==null&&p!==void 0?p:void 0,w=lC(c).find(_=>_.id===x);if(y==null||w==null||x==null)return;var{dataKey:S}=w,k=RPr(c,y,x);t.dispatch(BCr({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:x}))}B0=null,rb=null}};if(!i){l();return}s==="raf"?B0=requestAnimationFrame(l):typeof s=="number"&&rb===null&&(l(),aT=null,rb=setTimeout(()=>{aT?l():(rb=null,B0=null)},s))}}});var Act={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Ict=Ec({name:"eventSettings",initialState:Act,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:PPr}=Ict.actions,MPr=Ict.reducer,DPr=lnt({brush:bIr,cartesianAxis:cIr,chartData:MTr,errorBars:vRr,eventSettings:MPr,graphicalItems:zAr,layout:Wwr,legend:tSr,options:NTr,polarAxis:iAr,polarOptions:APr,referenceElements:OIr,renderedTicks:zIr,rootProps:CPr,tooltip:VCr,zIndex:yTr}),LPr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return vwr({reducer:DPr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([xct.middleware,wct.middleware,E9.middleware,jct.middleware,Nct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(Aat({type:"raf"}))},devTools:{serialize:{replacer:EPr},name:"recharts-".concat(r)}})};function $Pr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=sd(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=LPr(t,n));var i=ghe;return b.createElement(ynt,{context:i,store:a.current},r)}function FPr(e){var{layout:t,margin:r}=e,n=Vo(),s=sd();return b.useEffect(()=>{s||(n(qwr(t)),n(Vwr(r)))},[n,s,t,r]),null}var zPr=b.memo(FPr,c9);function BPr(e){var t=Vo();return b.useEffect(()=>{t(jPr(e))},[t,e]),null}var UPr=e=>{var t=Vo();return b.useEffect(()=>{t(PPr(e))},[t,e]),null},VPr=b.memo(UPr,c9);function mIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Vo();return b.useLayoutEffect(()=>(n.current&&s(mTr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(gTr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function gIe(e){var{children:t,isPanorama:r}=e,n=en(aTr);if(!n||n.length===0)return t;var s=n.filter(i=>i<0),a=n.filter(i=>i>0);return b.createElement(b.Fragment,null,s.map(i=>b.createElement(mIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(mIe,{key:i,zIndex:i,isPanorama:r})))}var qPr=["children"];function HPr(e,t){if(e==null)return{};var r,n,s=QPr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function QPr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function E4(){return E4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E4.apply(null,arguments)}var WPr={width:"100%",height:"100%",display:"block"},GPr=b.forwardRef((e,t)=>{var r=eit(),n=tit(),s=fit();if(!tg(r)||!tg(n))return null;var{children:a,otherAttributes:i,title:l,desc:c}=e,u,d;return i!=null&&(typeof i.tabIndex=="number"?u=i.tabIndex:u=s?0:void 0,typeof i.role=="string"?d=i.role:d=s?"application":void 0),b.createElement(Lst,E4({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:WPr,ref:t}),a)}),ZPr=e=>{var{children:t}=e,r=en(s9);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(Lst,{width:n,height:s,x:i,y:a},t)},yIe=b.forwardRef((e,t)=>{var{children:r}=e,n=HPr(e,qPr),s=sd();return s?b.createElement(ZPr,null,b.createElement(gIe,{isPanorama:!0},r)):b.createElement(GPr,E4({ref:t},n),b.createElement(gIe,{isPanorama:!1},r))});function YPr(){var e=Vo(),[t,r]=b.useState(null),n=en(o1r);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(Qwr(a))}},[t,e,n]),r}function vIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XPr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vIe(Object(r),!0).forEach(function(n){KPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KPr(e,t,r){return(t=JPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JPr(e){var t=eMr(e,"string");return typeof t=="symbol"?t:t+""}function eMr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wb(){return Wb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wb.apply(null,arguments)}var tMr=()=>(qTr(),null);function C4(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var rMr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:C4((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:C4((n=e.style)===null||n===void 0?void 0:n.height)}),l=b.useCallback((u,d)=>{i(f=>{var h=Math.round(u),p=Math.round(d);return f.containerWidth===h&&f.containerHeight===p?f:{containerWidth:h,containerHeight:p}})},[]),c=b.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var h=m=>{var g=m[0];if(g!=null){var{width:y,height:x}=g.contentRect;l(y,x)}},p=new ResizeObserver(h);p.observe(u),s.current=p}},[t,l]);return b.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[l]),b.createElement(b.Fragment,null,b.createElement(bP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Wb({ref:c},e)))}),nMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:C4(r),containerHeight:C4(n)}),i=b.useCallback((c,u)=>{a(d=>{var f=Math.round(c),h=Math.round(u);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),l=b.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();i(u,d)}},[t,i]);return b.createElement(b.Fragment,null,b.createElement(bP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Wb({ref:l},e)))}),sMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(bP,{width:r,height:n}),b.createElement("div",Wb({ref:t},e)))}),aMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(nMr,Wb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(sMr,Wb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(bP,{width:r,height:n}),b.createElement("div",Wb({ref:t},e)))});function iMr(e){return e?rMr:aMr}var oMr=b.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:a,onContextMenu:i,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:p,onTouchMove:m,onTouchStart:g,style:y,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,k=b.useRef(null),_=Vo(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=YPr(),P=She(),R=P?.width>0?P.width:x,B=P?.height>0?P.height:s,D=b.useCallback(ie=>{I(ie),typeof t=="function"&&t(ie),T(ie),N(ie),ie!=null&&(k.current=ie)},[I,t,T,N]),$=b.useCallback(ie=>{_(bct(ie)),_(Wf({handler:a,reactEvent:ie}))},[_,a]),U=b.useCallback(ie=>{_(Xae(ie)),_(Wf({handler:u,reactEvent:ie}))},[_,u]),z=b.useCallback(ie=>{_(plt()),_(Wf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(Xae(ie)),_(Wf({handler:f,reactEvent:ie}))},[_,f]),Q=b.useCallback(()=>{_(_ct())},[_]),L=b.useCallback(()=>{_(Ect())},[_]),Z=b.useCallback(ie=>{_(kct(ie.key))},[_]),V=b.useCallback(ie=>{_(Wf({handler:i,reactEvent:ie}))},[_,i]),M=b.useCallback(ie=>{_(Wf({handler:l,reactEvent:ie}))},[_,l]),W=b.useCallback(ie=>{_(Wf({handler:c,reactEvent:ie}))},[_,c]),G=b.useCallback(ie=>{_(Wf({handler:h,reactEvent:ie}))},[_,h]),J=b.useCallback(ie=>{_(Wf({handler:g,reactEvent:ie}))},[_,g]),ae=b.useCallback(ie=>{S&&_(Tct(ie)),_(Wf({handler:m,reactEvent:ie}))},[_,S,m]),te=b.useCallback(ie=>{_(Wf({handler:p,reactEvent:ie}))},[_,p]),re=iMr(w);return b.createElement(Plt.Provider,{value:E},b.createElement(gxr.Provider,{value:j},b.createElement(re,{width:R??y?.width,height:B??y?.height,className:wa("recharts-wrapper",n),style:XPr({position:"relative",cursor:"default",width:R,height:B},y),onClick:$,onContextMenu:V,onDoubleClick:M,onFocus:Q,onBlur:L,onKeyDown:Z,onMouseDown:W,onMouseEnter:U,onMouseLeave:z,onMouseMove:H,onMouseUp:G,onTouchEnd:te,onTouchMove:ae,onTouchStart:J,ref:D},b.createElement(tMr,null),r)))}),lMr=["width","height","responsive","children","className","style","compact","title","desc"];function cMr(e,t){if(e==null)return{};var r,n,s=uMr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function uMr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var dMr=b.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:a,className:i,style:l,compact:c,title:u,desc:d}=e,f=cMr(e,lMr),h=Jm(f);return c?b.createElement(b.Fragment,null,b.createElement(bP,{width:r,height:n}),b.createElement(yIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(oMr,{className:i,style:l,width:r,height:n,responsive:s??!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},b.createElement(yIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(_Ir,null,a)))});function Kae(){return Kae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kae.apply(null,arguments)}function bIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fMr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bIe(Object(r),!0).forEach(function(n){hMr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hMr(e,t,r){return(t=pMr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pMr(e){var t=mMr(e,"string");return typeof t=="symbol"?t:t+""}function mMr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gMr={top:5,right:5,bottom:5,left:5},yMr=fMr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:gMr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Act),vMr=b.forwardRef(function(t,r){var n,s=nd(t.categoricalChartProps,yMr),{chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return b.createElement($Pr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(vIr,{chartData:u.data}),b.createElement(zPr,{layout:s.layout,margin:s.margin}),b.createElement(VPr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(BPr,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),b.createElement(dMr,Kae({},s,{ref:r})))}),bMr=["axis"],xMr=b.forwardRef((e,t)=>b.createElement(vMr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:bMr,tooltipPayloadSearcher:jTr,categoricalChartProps:e,ref:t}));function wMr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function SMr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function OMr(e){return e/100*window.innerHeight}function kMr(e){return e/100*window.innerWidth}function _Mr(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function HT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=_Mr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=SMr(t,s);break}case"em":{n=wMr(t,s);break}case"vh":{n=OMr(s);break}case"vw":{n=kMr(s);break}}return n}function zu(e){return parseFloat(e.toFixed(3))}function Y_({group:e}){const{orientation:t,panels:r}=e;return r.reduce((n,s)=>(n+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,n),0)}function Jae(e){const{panels:t}=e,r=Y_({group:e});return r===0?t.map(n=>({groupResizeBehavior:n.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:n.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:n.panelConstraints.disabled,minSize:0,maxSize:100,panelId:n.id})):t.map(n=>{const{element:s,panelConstraints:a}=n;let i=0;if(a.collapsedSize!==void 0){const d=HT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=zu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=HT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=zu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=HT({groupSize:r,panelElement:s,styleProp:a.minSize});c=zu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=HT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=zu(d/r*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:l,disabled:a.disabled,minSize:c,maxSize:u,panelId:n.id}})}function ja(e,t="Assertion error"){if(!e)throw Error(t)}function eie(e,t){return Array.from(t).sort(e==="horizontal"?EMr:CMr)}function EMr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function CMr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Rct(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Pct(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function jMr({orientation:e,rects:t,targetRect:r}){const n={x:r.x+r.width/2,y:r.y+r.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:l,y:c}=Pct(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return ja(s,"No rect found"),s}let GD;function TMr(){return GD===void 0&&(typeof matchMedia=="function"?GD=!!matchMedia("(pointer:coarse)").matches:GD=!1),GD}function Mct(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=eie(r,Array.from(t.children).filter(Rct).map(m=>({element:m}))).map(({element:m})=>m),i=[];let l=!1,c=!1,u=-1,d=-1,f=0,h,p=[];{let m=-1;for(const g of a)g.hasAttribute("data-panel")&&(m++,g.ariaDisabled===null&&(f++,u===-1&&(u=m),d=m))}if(f>1){let m=-1;for(const g of a)if(g.hasAttribute("data-panel")){m++;const y=n.find(x=>x.element===g);if(y){if(h){const x=h.element.getBoundingClientRect(),w=g.getBoundingClientRect();let S;if(c){const k=r==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),_=r==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(p.length){case 0:{S=[k,_];break}case 1:{const E=p[0],T=jMr({orientation:r,rects:[x,w],targetRect:E.element.getBoundingClientRect()});S=[E,T===x?_:k];break}default:{S=p;break}}}else p.length?S=p:S=[r==="horizontal"?new DOMRect(x.right,w.top,w.left-x.right,w.height):new DOMRect(w.left,x.bottom,w.width,w.top-x.bottom)];for(const k of S){let _="width"in k?k:k.element.getBoundingClientRect();const E=TMr()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(_.width<E){const j=E-_.width;_=new DOMRect(_.x-j/2,_.y,_.width+j,_.height)}if(_.height<E){const j=E-_.height;_=new DOMRect(_.x,_.y-j/2,_.width,_.height+j)}const T=m<=u||m>d;!l&&!T&&i.push({group:e,groupSize:Y_({group:e}),panels:[h,y],separator:"width"in k?void 0:k,rect:_}),l=!1}}c=!1,h=y,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const y=s.find(x=>x.element===g);y?p.push(y):(h=void 0,p=[])}else c=!0}return i}let Dct=class{#e={};addListener(t,r){const n=this.#e[t];return n===void 0?this.#e[t]=[r]:n.includes(r)||n.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const n=this.#e[t];if(n!==void 0)if(n.length===1)n[0].call(null,r);else{let s=!1,a=null;const i=Array.from(n);for(let l=0;l<i.length;l++){const c=i[l];try{c.call(null,r)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,r){const n=this.#e[t];if(n!==void 0){const s=n.indexOf(r);s>=0&&n.splice(s,1)}}},Pm=new Map;const Lct=new Dct;function NMr(e){Pm=new Map(Pm),Pm.delete(e)}function xIe(e,t){for(const[r]of Pm)if(r.id===e)return r}function Gb(e,t){for(const[r,n]of Pm)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function gS(){return Pm}function Lpe(e,t){return Lct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function Jy(e,t){const r=Pm.get(e);Pm=new Map(Pm),Pm.set(e,t),Lct.emit("groupChange",{group:e,prev:r,next:t})}function AMr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=Pct(r,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(n=a,s=i);break}case"vertical":{i.y<=s.y&&(n=a,s=i);break}}}return n?{distance:s,hitRegion:n}:void 0}function IMr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function RMr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:OIe(e),b:OIe(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();ja(n,"Stacking order can only be calculated for elements with a common ancestor");const s={a:SIe(wIe(r.a)),b:SIe(wIe(r.b))};if(s.a===s.b){const a=n.childNodes,i={a:r.a.at(-1),b:r.b.at(-1)};let l=a.length;for(;l--;){const c=a[l];if(c===i.a)return 1;if(c===i.b)return-1}}return Math.sign(s.a-s.b)}const PMr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function MMr(e){const t=getComputedStyle($ct(e)??e).display;return t==="flex"||t==="inline-flex"}function DMr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||MMr(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||PMr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function wIe(e){let t=e.length;for(;t--;){const r=e[t];if(ja(r,"Missing node"),DMr(r))return r}return null}function SIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function OIe(e){const t=[];for(;e;)t.push(e),e=$ct(e);return t}function $ct(e){const{parentNode:t}=e;return IMr(t)?t.host:t}function LMr(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function $Mr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Rct(r)||r.contains(e)||e.contains(r))return!0;if(RMr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(LMr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function $pe(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=Mct(s),i=AMr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&$Mr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function FMr(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function qc(e,t,r=0){return Math.abs(zu(e)-zu(t))<=r}function um(e,t){return qc(e,t)?0:e>t?1:-1}function pk({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return r;if(um(n,c)<0)if(a){const u=(s+c)/2;um(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=zu(n),n}function uI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(qc(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=n;ja(d!=null,"Invalid first pivot index"),ja(f!=null,"Invalid second pivot index");let h=0;switch(a){case"keyboard":{{const g=e<0?f:d,y=r[g];ja(y,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(ja(k!=null,`Previous layout not found for panel index ${g}`),qc(k,x)){const _=S-k;um(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}{const g=e<0?d:f,y=r[g];ja(y,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=y;if(w){const k=l[g];if(ja(k!=null,`Previous layout not found for panel index ${g}`),qc(k,S)){const _=k-x;um(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}break}default:{const g=e<0?f:d,y=r[g];ja(y,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:k}=y;if(w&&um(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;um(T,k)<0&&(e=um(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;um(T,k)<0&&(e=um(100+e,E)>0?0:-_)}break}}{const g=e<0?1:-1;let y=e<0?f:d,x=0;for(;;){const S=l[y];ja(S!=null,`Previous layout not found for panel index ${y}`);const k=pk({overrideDisabledPanels:i,panelConstraints:r[y],prevSize:S,size:100})-S;if(x+=k,y+=g,y<0||y>=r.length)break}const w=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-w:w}{let g=e<0?d:f;for(;g>=0&&g<r.length;){const y=Math.abs(e)-Math.abs(h),x=l[g];ja(x!=null,`Previous layout not found for panel index ${g}`);const w=x-y,S=pk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!qc(x,S)&&(h+=x-S,u[g]=S,h.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(FMr(c,u))return s;{const g=e<0?f:d,y=l[g];ja(y!=null,`Previous layout not found for panel index ${g}`);const x=y+h,w=pk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:y,size:x});if(u[g]=w,!qc(w,x)){let S=x-w,k=e<0?f:d;for(;k>=0&&k<r.length;){const _=u[k];ja(_!=null,`Previous layout not found for panel index ${k}`);const E=_+S,T=pk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(qc(_,T)||(S-=T-_,u[k]=T),qc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,y)=>y+g,0);if(!qc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,y,x)=>(g[m[x]]=y,g),{})}function N1(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||um(e[r],t[r])!==0)return!1;return!0}function A1({layout:e,panelConstraints:t}){const r=Object.values(e),n=[...r],s=n.reduce((l,c)=>l+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!qc(s,100)&&n.length>0)for(let l=0;l<t.length;l++){const c=n[l];ja(c!=null,`No layout data found for index ${l}`);const u=100/s*c;n[l]=u}let a=0;for(let l=0;l<t.length;l++){const c=r[l];ja(c!=null,`No layout data found for index ${l}`);const u=n[l];ja(u!=null,`No layout data found for index ${l}`);const d=pk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!qc(a,0))for(let l=0;l<t.length;l++){const c=n[l];ja(c!=null,`No layout data found for index ${l}`);const u=c+a,d=pk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,qc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function Fct({groupId:e,panelId:t}){const r=()=>{const l=gS();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:h,separatorToPanels:p}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:h,layout:f,separatorToPanels:p};throw Error(`Group ${e} not found`)},n=()=>{const l=r().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const l=r().group.panels.find(c=>c.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const l=r().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=l=>{const c=a();if(l===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:h,layout:p,separatorToPanels:m}=r(),g=f.panels.findIndex(S=>S.id===t),y=g===f.panels.length-1,x=uI({delta:y?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:y?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=A1({layout:x,panelConstraints:d});N1(p,w)||Jy(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:h,layout:w,separatorToPanels:m})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=n(),{mutableValues:u}=s(),d=a();l&&d!==c&&(u.expandToSize=d,i(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=n(),{mutableValues:d}=s(),f=a();if(l&&f===c){let h=d.expandToSize??u;h===0&&(h=1),i(h)}},getSize:()=>{const{group:l}=r(),c=a(),{element:u}=s(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=n(),u=a();return l&&qc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=Y_({group:c}),f=HT({groupSize:d,panelElement:u,styleProp:l}),h=zu(f/d*100);i(h)}}}function kIe(e){if(e.defaultPrevented)return;const t=gS();$pe(e,t).forEach(r=>{if(r.separator){const n=r.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(n){const s=n.panelConstraints.defaultSize,a=Fct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function C$(e){const t=gS();for(const[r]of t)if(r.separators.some(n=>n.element===e))return r;throw Error("Could not find parent Group for separator element")}function zct({groupId:e}){const t=()=>{const r=gS();for(const[n,s]of r)if(n.id===e)return{group:n,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:n}=t();return r?{}:n},setLayout(r){const{defaultLayoutDeferred:n,derivedPanelConstraints:s,group:a,groupSize:i,layout:l,separatorToPanels:c}=t(),u=A1({layout:r,panelConstraints:s});return n?l:(N1(l,u)||Jy(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function U0(e,t){const r=C$(e),n=Gb(r.id,!0),s=r.separators.find(d=>d.element===e);ja(s,"Matching separator not found");const a=n.separatorToPanels.get(s);ja(a,"Matching panels not found");const i=a.map(d=>r.panels.indexOf(d)),l=zct({groupId:r.id}).getLayout(),c=uI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=A1({layout:c,panelConstraints:n.derivedPanelConstraints});N1(l,u)||Jy(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function _Ie(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=C$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&U0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&U0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&U0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&U0(t,-5);break}case"End":{e.preventDefault(),U0(t,100);break}case"Enter":{e.preventDefault();const n=C$(t),s=Gb(n.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=n.separators.find(h=>h.element===t);ja(c,"Matching separator not found");const u=l.get(c);ja(u,"Matching panels not found");const d=u[0],f=a.find(h=>h.panelId===d.id);if(ja(f,"Panel metadata not found"),f.collapsible){const h=i[d.id],p=f.collapsedSize===h?n.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;U0(t,p-h)}break}case"F6":{e.preventDefault();const n=C$(t).separators.map(i=>i.element),s=Array.from(n).findIndex(i=>i===e.currentTarget);ja(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:n.length-1:s+1<n.length?s+1:0;n[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),U0(t,-100);break}}}let Kk={cursorFlags:0,state:"inactive"};const Fpe=new Dct;function I1(){return Kk}function zMr(e){return Fpe.addListener("change",e)}function BMr(e){const t=Kk,r={...Kk};r.cursorFlags=e,Kk=r,Fpe.emit("change",{prev:t,next:r})}function Jk(e){const t=Kk;Kk=e,Fpe.emit("change",{prev:t,next:e})}function EIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=gS(),r=$pe(e,t),n=new Map;let s=!1;r.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&n.set(a.group,i.layout)}),Jk({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const UMr=e=>e,tQ=()=>{},Bct=1,Uct=2,Vct=4,qct=8,CIe=3,jIe=12;let ZD;function TIe(){return ZD===void 0&&(ZD=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ZD=!0)),ZD}function VMr({cursorFlags:e,groups:t,state:r}){let n=0,s=0;switch(r){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{n++;break}case"vertical":{s++;break}}})}if(!(n===0&&s===0)){switch(r){case"active":{if(e&&TIe()){const a=(e&Bct)!==0,i=(e&Uct)!==0,l=(e&Vct)!==0,c=(e&qct)!==0;if(a)return l?"se-resize":c?"ne-resize":"e-resize";if(i)return l?"sw-resize":c?"nw-resize":"w-resize";if(l)return"s-resize";if(c)return"n-resize"}break}}return TIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const NIe=new WeakMap;function zpe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=NIe.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=I1();switch(n.state){case"active":case"hover":{const s=VMr({cursorFlags:n.cursorFlags,groups:n.hitRegions.map(i=>i.group),state:n.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?r.cssRules.length===0?r.insertRule(a):r.replaceSync(a):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}NIe.set(e,{prevStyle:t,styleSheet:r})}function Hct({document:e,event:t,hitRegions:r,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let l=0;r.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:h,panels:p}=d,{disableCursor:m}=d.mutableState;let g=0;a?h==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:h==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const y=n.get(d),x=s.get(d);if(!y||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:_,separatorToPanels:E}=x;if(S&&_&&E){const T=uI({delta:g,initialLayout:y,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(N1(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?Bct:Uct;break}case"vertical":{l|=g<0?Vct:qct;break}}}else Jy(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&CIe:c|=l&CIe,t.movementY===0?c|=i&jIe:c|=l&jIe,BMr(c),zpe(e)}function AIe(e){const t=gS(),r=I1();r.state==="active"&&Hct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function IIe(e){if(e.defaultPrevented)return;const t=I1(),r=gS();switch(t.state){case"active":{if(e.buttons===0){Jk({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=Gb(n.group.id,!0);Jy(n.group,s)});return}Hct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=$pe(e,r);n.length===0?t.state!=="inactive"&&Jk({cursorFlags:0,state:"inactive"}):Jk({cursorFlags:0,hitRegions:n,state:"hover"}),zpe(e.currentTarget);break}}}function RIe(e){e.relatedTarget instanceof HTMLIFrameElement&&I1().state==="hover"&&Jk({cursorFlags:0,state:"inactive"})}function PIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=I1();t.state==="active"&&(Jk({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(zpe(e.currentTarget),t.hitRegions.forEach(r=>{const n=Gb(r.group.id,!0);Jy(r.group,n)}),e.preventDefault()))}function MIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=zu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=zu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function qMr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=Y_({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:zu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function HMr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function QMr({group:e,nextGroupSize:t,prevGroupSize:r,prevLayout:n}){if(r<=0||t<=0||r===t)return n;let s=0,a=0,i=!1;const l=new Map,c=[];for(const f of e.panels){const h=n[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const p=h/100*r,m=zu(p/t*100);l.set(f.id,m),s+=m}else c.push(f.id),a+=h}if(!i||c.length===0)return n;const u=100-s,d={...n};if(l.forEach((f,h)=>{d[h]=f}),a>0)for(const f of c){const h=n[f]??0;d[f]=zu(h/a*u)}else{const f=zu(u/c.length);for(const h of c)d[h]=f}return d}function WMr(e,t){const r=e.map(s=>s.id),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r)if(!n.includes(s))return!1;return!0}const kO=new Map;function GMr(e){let t=!0;ja(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,n=new Set,s=new Set,a=new r(m=>{for(const g of m){const{borderBoxSize:y,target:x}=g;if(x===e.element){if(t){const w=Y_({group:e});if(w===0)return;const S=Gb(e.id);if(!S)return;const k=Jae(e),_=S.defaultLayoutDeferred?MIe(k):S.layout,E=QMr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=A1({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&N1(S.layout,T)&&HMr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;Jy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else qMr(e,x,y)}});a.observe(e.element),e.panels.forEach(m=>{ja(!n.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),n.add(m.id),m.onResize&&a.observe(m.element)});const i=Y_({group:e}),l=Jae(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(WMr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??MIe(l),f=A1({layout:d,panelConstraints:l}),h=e.element.ownerDocument;kO.set(h,(kO.get(h)??0)+1);const p=new Map;return Mct(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),Jy(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:p}),e.separators.forEach(m=>{ja(!s.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),s.add(m.id),m.element.addEventListener("keydown",_Ie)}),kO.get(h)===1&&(h.addEventListener("dblclick",kIe,!0),h.addEventListener("pointerdown",EIe,!0),h.addEventListener("pointerleave",AIe),h.addEventListener("pointermove",IIe),h.addEventListener("pointerout",RIe),h.addEventListener("pointerup",PIe,!0)),function(){t=!1,kO.set(h,Math.max(0,(kO.get(h)??0)-1)),NMr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",_Ie)}),kO.get(h)||(h.removeEventListener("dblclick",kIe,!0),h.removeEventListener("pointerdown",EIe,!0),h.removeEventListener("pointerleave",AIe),h.removeEventListener("pointermove",IIe),h.removeEventListener("pointerout",RIe),h.removeEventListener("pointerup",PIe,!0)),a.disconnect()}}function ZMr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Bpe(e){const t=b.useId();return`${e??t}`}const yS=typeof window<"u"?b.useLayoutEffect:b.useEffect;function TN(e){const t=b.useRef(e);return yS(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function Upe(...e){return TN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Vpe(e){const t=b.useRef({...e});return yS(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Qct=b.createContext(null);function YMr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:UMr});b.useImperativeHandle(t,()=>r.current,[]),yS(()=>{Object.assign(r.current,zct({groupId:e}))})}function C9({children:e,className:t,defaultLayout:r,disableCursor:n,disabled:s,elementRef:a,groupRef:i,id:l,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:h,...p}){const m=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=TN(P=>{N1(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),y=TN(P=>{N1(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Bpe(l),w=b.useRef(null),[S,k]=ZMr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=Upe(w,a);YMr(x,i);const T=TN((P,R)=>{const B=I1(),D=xIe(P),$=Gb(P);if($){let U=!1;return B.state==="active"&&(U=B.hitRegions.some(z=>z.group===D)),{flexGrow:$.layout[R]??1,pointerEvents:U?"none":void 0}}return{flexGrow:r?.[R]??1}}),j=Vpe({defaultLayout:r,disableCursor:n}),N=b.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:x,orientation:d,registerPanel:P=>{const R=_.current;return R.panels=eie(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(B=>B!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=eie(d,[...R.separators,P]),k(),()=>{R.separators=R.separators.filter(B=>B!==P),k()}},togglePanelDisabled:(P,R)=>{const B=_.current.panels.find(U=>U.id===P);B&&(B.panelConstraints.disabled=R);const D=xIe(x),$=Gb(x);D&&$&&Jy(D,{...$,derivedPanelConstraints:Jae(D)})},toggleSeparatorDisabled:(P,R)=>{const B=_.current.separators.find(D=>D.id===P);B&&(B.disabled=R)}}),[T,x,k,d,j]),I=b.useRef(null);return yS(()=>{const P=w.current;if(P===null)return;const R=_.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){B={};for(const L of R.panels){const Z=j.defaultLayout[L.id];Z!==void 0&&(B[L.id]=Z)}}const D={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=D;const $=GMr(D),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:H}=Gb(D.id,!0);!U&&z.length>0&&(g(H),y(H));const Q=Lpe(x,L=>{const{defaultLayoutDeferred:Z,derivedPanelConstraints:V,layout:M}=L.next;if(Z||V.length===0)return;const W=D.panels.map(({id:J})=>J).join(",");D.mutableState.layouts[W]=M,V.forEach(J=>{if(J.collapsible){const{layout:ae}=L.prev??{};if(ae){const te=qc(J.collapsedSize,M[J.panelId]),re=qc(J.collapsedSize,ae[J.panelId]);te&&!re&&(D.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const G=I1().state!=="active";g(M),G&&y(M)});return()=>{I.current=null,$(),Q()}},[s,x,y,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=r,P.mutableState.disableCursor=!!n)}),o.jsx(Qct.Provider,{value:N,children:o.jsx("div",{...p,className:t,"data-group":!0,"data-testid":x,id:x,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...h,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}C9.displayName="Group";function rQ(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function qpe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=rQ(a,t??[]),l=b.useSyncExternalStore(XMr,()=>r.getItem(i),()=>r.getItem(i)),c=b.useMemo(()=>l?JSON.parse(l):void 0,[l]),u=b.useRef(null),d=b.useCallback(()=>{const p=u.current;p&&(u.current=null,clearTimeout(p))},[]);b.useLayoutEffect(()=>()=>{d()},[d]);const f=b.useCallback(p=>{d();let m;s?m=rQ(a,Object.keys(p)):m=rQ(a,[]);try{r.setItem(m,JSON.stringify(p))}catch(g){console.error(g)}},[d,s,a,r]),h=b.useCallback(p=>{d(),e===0?f(p):u.current=setTimeout(()=>{f(p)},e)},[d,e,f]);return{defaultLayout:c,onLayoutChange:h,onLayoutChanged:f}}function XMr(){return function(){}}function Hpe(){const e=b.useContext(Qct);return ja(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function KMr(e,t){const{id:r}=Hpe(),n=b.useRef({collapse:tQ,expand:tQ,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tQ});b.useImperativeHandle(t,()=>n.current,[]),yS(()=>{Object.assign(n.current,Fct({groupId:r,panelId:e}))})}function X_({children:e,className:t,collapsedSize:r="0%",collapsible:n=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:l="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:h,style:p,...m}){const g=!!c,y=Bpe(c),x=Vpe({disabled:a}),w=b.useRef(null),S=Upe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=Hpe(),N=f!==null,I=TN((R,B,D)=>{f?.(R,c,D)});yS(()=>{const R=w.current;if(R!==null){const B={element:R,id:y,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:r,collapsible:n,defaultSize:s,disabled:x.disabled,maxSize:u,minSize:d}};return T(B)}},[l,r,n,s,N,y,g,u,d,I,T,x]),b.useEffect(()=>{j(y,!!a)},[a,y,j]),KMr(y,h);const P=b.useSyncExternalStore(R=>Lpe(_,R),()=>JSON.stringify(k(_,y)),()=>JSON.stringify(k(_,y)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":y,id:y,ref:S,style:{...JMr,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(P)},children:o.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}X_.displayName="Panel";const JMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function e2r(){return b.useRef(null)}function t2r({layout:e,panelConstraints:t,panelId:r,panelIndex:n}){let s,a;const i=e[r],l=t.find(c=>c.panelId===r);if(l){const c=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[n,n+1];a=A1({layout:uI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=A1({layout:uI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function Wct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Bpe(s),c=Vpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=Upe(p,n),{disableCursor:g,id:y,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=Hpe(),k=x==="horizontal"?"vertical":"horizontal";yS(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=zMr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Lpe(y,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:D}=P.next,$=D.get(T);if($){const U=$[0],z=$.indexOf(U);d(t2r({layout:B,panelConstraints:R,panelId:U.id,panelIndex:z}))}});return()=>{N(),I(),j()}}},[y,l,w,c]),b.useEffect(()=>{S(l,!!r)},[r,l,S]);let _;return r&&!g&&(_="not-allowed"),o.jsx("div",{...i,"aria-controls":u.valueControls,"aria-disabled":r||void 0,"aria-orientation":k,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":r?"disabled":f,"data-testid":l,id:l,ref:m,role:"separator",style:{flexBasis:"auto",cursor:_,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:r?void 0:0})}Wct.displayName="Separator";const DIe=e=>{let t;const r=new Set,n=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(p=>p(t,h))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,l);return l},r2r=(e=>e?DIe(e):DIe),n2r=e=>e;function s2r(e,t=n2r){const r=je.useSyncExternalStore(e.subscribe,je.useCallback(()=>t(e.getState()),[e,t]),je.useCallback(()=>t(e.getInitialState()),[e,t]));return je.useDebugValue(r),r}const LIe=e=>{const t=r2r(e),r=n=>s2r(t,n);return Object.assign(r,t),r},Qpe=(e=>e?LIe(e):LIe);function a2r(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),l=(a=r.getItem(s))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,a)=>r.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>r.removeItem(s)}}const tie=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return tie(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return tie(n)(r)}}}},i2r=(e,t)=>(r,n,s)=>{let a={storage:a2r(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,x)=>({...x,...y}),...t},i=!1,l=0;const c=new Set,u=new Set;let d=a.storage;if(!d)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...y)},n,s);const f=()=>{const y=a.partialize({...n()});return d.setItem(a.name,{state:y,version:a.version})},h=s.setState;s.setState=(y,x)=>(h(y,x),f());const p=e((...y)=>(r(...y),f()),n,s);s.getInitialState=()=>p;let m;const g=()=>{var y,x;if(!d)return;const w=++l;i=!1,c.forEach(k=>{var _;return k((_=n())!=null?_:p)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(y=n())!=null?y:p))||void 0;return tie(d.getItem.bind(d))(a.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==a.version){if(a.migrate){const _=a.migrate(k.state,k.version);return _ instanceof Promise?_.then(E=>[!0,E]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var _;if(w!==l)return;const[E,T]=k;if(m=a.merge(T,(_=n())!=null?_:p),r(m,!0),E)return f()}).then(()=>{w===l&&(S?.(n(),void 0),m=n(),i=!0,u.forEach(k=>k(m)))}).catch(k=>{w===l&&S?.(void 0,k)})};return s.persist={setOptions:y=>{a={...a,...y},y.storage&&(d=y.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(u.add(y),()=>{u.delete(y)})},a.skipHydration||g(),m||p},o2r=i2r;var vS=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(){}},l2r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c2r=class{#e=l2r;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Cw=new c2r;function u2r(e){setTimeout(e,0)}var R1=typeof window>"u"||"Deno"in globalThis;function ic(){}function d2r(e,t){return typeof e=="function"?e(t):e}function rie(e){return typeof e=="number"&&e>=0&&e!==1/0}function Gct(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zb(e,t){return typeof e=="function"?e(t):e}function Yf(e,t){return typeof e=="function"?e(t):e}function $Ie(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Wpe(i,t.options))return!1}else if(!dI(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function FIe(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(P1(t.options.mutationKey)!==P1(a))return!1}else if(!dI(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Wpe(e,t){return(t?.queryKeyHashFn||P1)(e)}function P1(e){return JSON.stringify(e,(t,r)=>nie(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function dI(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>dI(e[r],t[r])):!1}var f2r=Object.prototype.hasOwnProperty;function Gpe(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=zIe(e)&&zIe(t);if(!n&&!(nie(e)&&nie(t)))return t;const a=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),l=i.length,c=n?new Array(l):{};let u=0;for(let d=0;d<l;d++){const f=n?d:i[d],h=e[f],p=t[f];if(h===p){c[f]=h,(n?d<a:f2r.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const m=Gpe(h,p,r+1);c[f]=m,m===h&&u++}return a===l&&u===a?e:c}function fI(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function zIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nie(e){if(!BIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!BIe(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function BIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function h2r(e){return new Promise(t=>{Cw.setTimeout(t,e)})}function sie(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Gpe(e,t):t}function p2r(e){return e}function m2r(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function g2r(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Zpe=Symbol();function Zct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zpe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ype(e,t){return typeof e=="function"?e(...t):!!e}function y2r(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var v2r=class extends vS{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!R1&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Xpe=new v2r;function aie(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var b2r=u2r;function x2r(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=b2r;const a=l=>{t?e.push(l):s(()=>{r(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Zi=x2r(),w2r=class extends vS{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!R1&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},j4=new w2r;function S2r(e){return Math.min(1e3*2**e,3e4)}function Yct(e){return(e??"online")==="online"?j4.isOnline():!0}var iie=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Xct(e){let t=!1,r=0,n;const s=aie(),a=()=>s.status!=="pending",i=g=>{if(!a()){const y=new iie(g);h(y),e.onCancel?.(y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Xpe.isFocused()&&(e.networkMode==="always"||j4.isOnline())&&e.canRun(),d=()=>Yct(e.networkMode)&&e.canRun(),f=g=>{a()||(n?.(),s.resolve(g))},h=g=>{a()||(n?.(),s.reject(g))},p=()=>new Promise(g=>{n=y=>{(a()||u())&&g(y)},e.onPause?.()}).then(()=>{n=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(a())return;const w=e.retry??(R1?0:3),S=e.retryDelay??S2r,k=typeof S=="function"?S(r,x):S,_=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,x);if(t||!_){h(x);return}r++,e.onFail?.(r,x),h2r(k).then(()=>u()?void 0:p()).then(()=>{t?h(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(n?.(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),s)}}var Kct=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rie(this.gcTime)&&(this.#e=Cw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(R1?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Cw.clearTimeout(this.#e),this.#e=void 0)}},O2r=class extends Kct{#e;#t;#r;#s;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=VIe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=VIe(this.options);t.data!==void 0&&(this.setState(UIe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=sie(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(ic).catch(ic):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Yf(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zpe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zb(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Gct(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},s=()=>{const l=Zct(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(d),d})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return n(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta}),this.#n=Xct({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof iie&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const l=await this.#n.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof iie){if(l.silent)return this.#n.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Jct(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...UIe(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Zi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Jct(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yct(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function UIe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VIe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var j9=class extends vS{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=aie(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#s=void 0;#n;#a;#o;#i;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),qIe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oie(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yf(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!fI(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&HIe(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||Yf(this.options.enabled,this.#t)!==Yf(t.enabled,this.#t)||Zb(this.options.staleTime,this.#t)!==Zb(t.staleTime,this.#t))&&this.#g();const s=this.#y();n&&(this.#t!==r||Yf(this.options.enabled,this.#t)!==Yf(t.enabled,this.#t)||s!==this.#l)&&this.#v(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return _2r(this,r)&&(this.#s=r,this.#a=this.options,this.#n=this.#t.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ic)),t}#g(){this.#x();const e=Zb(this.options.staleTime,this.#t);if(R1||this.#s.isStale||!rie(e))return;const r=Gct(this.#s.dataUpdatedAt,e)+1;this.#c=Cw.setTimeout(()=>{this.#s.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(R1||Yf(this.options.enabled,this.#t)===!1||!rie(this.#l)||this.#l===0)&&(this.#u=Cw.setInterval(()=>{(this.options.refetchIntervalInBackground||Xpe.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(Cw.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Cw.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#t,n=this.options,s=this.#s,a=this.#n,i=this.#a,c=e!==r?e.state:this.#r,{state:u}=e;let d={...u},f=!1,h;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&qIe(e,t),I=j&&HIe(e,r,t,n);(N||I)&&(d={...d,...Jct(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=d;h=d.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,y=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",h=sie(s?.data,j,t),f=!0)}if(t.select&&h!==void 0&&!y)if(s&&h===a?.data&&t.select===this.#p)h=this.#d;else try{this.#p=t.select,h=t.select(h),h=sie(s?.data,h,t),this.#d=h,this.#i=null}catch(j){this.#i=j}this.#i&&(p=this.#i,h=this.#d,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",w=g==="pending",S=g==="error",k=w&&x,_=h!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&_,isStale:Kpe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Yf(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=B=>{N?B.reject(T.error):j&&B.resolve(T.data)},P=()=>{const B=this.#o=T.promise=aie();I(B)},R=this.#o;switch(R.status){case"pending":e.queryHash===r.queryHash&&I(R);break;case"fulfilled":(N||T.data!==R.value)&&P();break;case"rejected":(!N||T.error!==R.reason)&&P();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#f=this.#t),fI(t,e))return;this.#s=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#h.size)return!0;const a=new Set(s??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const l=i;return this.#s[l]!==e[l]&&a.has(l)})};this.#O({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(e){Zi.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function k2r(e,t){return Yf(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qIe(e,t){return k2r(e,t)||e.state.data!==void 0&&oie(e,t,t.refetchOnMount)}function oie(e,t,r){if(Yf(t.enabled,e)!==!1&&Zb(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Kpe(e,t)}return!1}function HIe(e,t,r,n){return(e!==t||Yf(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Kpe(e,r)}function Kpe(e,t){return Yf(t.enabled,e)!==!1&&e.isStaleByTime(Zb(t.staleTime,e))}function _2r(e,t){return!fI(e.getCurrentResult(),t)}function T4(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{y2r(m,()=>t.signal,()=>d=!0)},h=Zct(t.options,t.fetchOptions),p=async(m,g,y)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return f(E),E})(),S=await h(w),{maxPages:k}=t.options,_=y?g2r:m2r;return{pages:_(m.pages,S,k),pageParams:_(m.pageParams,g,k)}};if(s&&a.length){const m=s==="backward",g=m?eut:lie,y={pages:a,pageParams:i},x=g(n,y);l=await p(y,x,m)}else{const m=e??a.length;do{const g=c===0?i[0]??n.initialPageParam:lie(n,l);if(c>0&&g==null)break;l=await p(l,g),c++}while(c<m)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function lie(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function eut(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function E2r(e,t){return t?lie(e,t)!=null:!1}function C2r(e,t){return!t||!e.getPreviousPageParam?!1:eut(e,t)!=null}var j2r=class extends j9{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:T4()})}getOptimisticResult(e){return e.behavior=T4(),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){const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:l}=n,c=r.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",h=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:E2r(t,r.data),hasPreviousPage:C2r(t,r.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!h}}},T2r=class extends Kct{#e;#t;#r;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||tut(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Xct({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#n({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const n=this.state.status==="pending",s=!this.#s.canStart();try{if(n)t();else{this.#n({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const i=await this.options.onMutate?.(e,r);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#n({type:"success",data:a}),a}catch(a){try{await this.#r.config.onError?.(a,e,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,r)}catch(i){Promise.reject(i)}try{await this.#r.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,r)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,r)}catch(i){Promise.reject(i)}throw this.#n({type:"error",error:a}),a}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Zi.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function tut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var N2r=class extends vS{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const n=new T2r({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=YD(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=YD(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=YD(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(s=>s.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=YD(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Zi.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>FIe(t,r))}findAll(e={}){return this.getAll().filter(t=>FIe(e,t))}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Zi.batch(()=>Promise.all(e.map(t=>t.continue().catch(ic))))}};function YD(e){return e.options.scope?.id}var A2r=class extends vS{#e;#t=void 0;#r;#s;constructor(t,r){super(),this.#e=t,this.setOptions(r),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#e.defaultMutationOptions(t),fI(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&P1(r.mutationKey)!==P1(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#a()}mutate(t,r){return this.#s=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#n(){const t=this.#r?.state??tut();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Zi.batch(()=>{if(this.#s&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,r,n,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,r,n,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,r,n,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(r=>{r(this.#t)})})}};function QIe(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function I2r(e,t,r){const n=e.slice(0);return n[t]=r,n}var R2r=class extends vS{#e;#t;#r;#s;#n;#a;#o;#i;#p;#d=[];constructor(e,t,r){super(),this.#e=e,this.#s=r,this.#r=[],this.#n=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#s=t,Zi.batch(()=>{const r=this.#n,n=this.#u(this.#r);n.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=n.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=r.length!==s.length,l=s.some((d,f)=>d!==r[f]),c=i||l,u=c?!0:a.some((d,f)=>{const h=this.#t[f];return!h||!fI(d,h)});!c&&!u||(c&&(this.#d=n,this.#n=s),this.#t=a,this.hasListeners()&&(c&&(QIe(r,s).forEach(d=>{d.destroy()}),QIe(s,r).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const r=this.#u(e),n=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=r.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#c(a??n,t,s),()=>this.#f(n,r)]}#f(e,t){return t.map((r,n)=>{const s=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?s:r.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,r){if(t){const n=this.#p,s=r!==void 0&&n!==void 0&&(n.length!==r.length||r.some((a,i)=>a!==n[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,r!==void 0&&(this.#p=r),this.#a=Gpe(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#n.forEach(n=>{const s=n.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(n):t.set(s,[n])});const r=[];return e.forEach(n=>{const s=this.#e.defaultQueryOptions(n),i=t.get(s.queryHash)?.shift()??new j9(this.#e,s);r.push({defaultedQueryOptions:s,observer:i})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#t=I2r(this.#t,r,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),r=this.#c(t,this.#s?.combine);e!==r&&Zi.batch(()=>{this.listeners.forEach(n=>{n(this.#t)})})}}},P2r=class extends vS{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Wpe(n,t);let a=this.get(s);return a||(a=new O2r({client:e,queryKey:n,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Zi.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>$Ie(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>$Ie(e,r)):t}notify(e){Zi.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zi.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},M2r=class{#e;#t;#r;#s;#n;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new P2r,this.#t=e.mutationCache||new N2r,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Xpe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=j4.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Zb(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(n.queryHash)?.state.data,i=d2r(t,a);if(i!==void 0)return this.#e.build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Zi.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Zi.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return Zi.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Zi.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(ic).catch(ic)}invalidateQueries(e,t={}){return Zi.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Zi.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(ic)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(ic)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Zb(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ic).catch(ic)}fetchInfiniteQuery(e){return e.behavior=T4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ic).catch(ic)}ensureInfiniteQueryData(e){return e.behavior=T4(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return j4.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#s.set(P1(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{dI(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(P1(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{dI(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Wpe(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===Zpe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},rut=b.createContext(void 0),Xs=e=>{const t=b.useContext(rut);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},D2r=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(rut.Provider,{value:e,children:t})),nut=b.createContext(!1),sut=()=>b.useContext(nut);nut.Provider;function L2r(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $2r=b.createContext(L2r()),aut=()=>b.useContext($2r),iut=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?Ype(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},out=e=>{b.useEffect(()=>{e.clearReset()},[e])},lut=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Ype(r,[e.error,n])),cut=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},F2r=(e,t)=>e.isLoading&&e.isFetching&&!t,cie=(e,t)=>e?.suspense&&t.isPending,uie=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function z2r({queries:e,...t},r){const n=Xs(),s=sut(),a=aut(),i=b.useMemo(()=>e.map(g=>{const y=n.defaultQueryOptions(g);return y._optimisticResults=s?"isRestoring":"optimistic",y}),[e,n,s]);i.forEach(g=>{cut(g);const y=n.getQueryCache().get(g.queryHash);iut(g,a,y)}),out(a);const[l]=b.useState(()=>new R2r(n,i,t)),[c,u,d]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(g=>f?l.subscribe(Zi.batchCalls(g)):ic,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=c.some((g,y)=>cie(i[y],g))?c.flatMap((g,y)=>{const x=i[y];if(x&&cie(x,g)){const w=new j9(n,x);return uie(x,w,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=c.find((g,y)=>{const x=i[y];return x&&lut({result:g,errorResetBoundary:a,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m?.error)throw m.error;return u(d())}function uut(e,t,r){const n=sut(),s=aut(),a=Xs(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",cut(i),iut(i,s,l),out(s);const c=!a.getQueryCache().get(i.queryHash),[u]=b.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!n&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(h=>{const p=f?u.subscribe(Zi.batchCalls(h)):ic;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),cie(i,d))throw uie(i,u,s);if(lut({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!R1&&F2r(d,n)&&(c?uie(i,u,s):l?.promise)?.catch(ic).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function Ot(e,t){return uut(e,j9)}function Wr(e,t){const r=Xs(),[n]=b.useState(()=>new A2r(r,e));b.useEffect(()=>{n.setOptions(e)},[n,e]);const s=b.useSyncExternalStore(b.useCallback(i=>n.subscribe(Zi.batchCalls(i)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=b.useCallback((i,l)=>{n.mutate(i,l).catch(ic)},[n]);if(s.error&&Ype(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function s0(e,t){return uut(e,j2r)}var Do=(e=>(e.AGENT="agent",e.SCORER="scorer",e.RAG_INGESTION="rag_ingestion",e.TRAJECTORY="trajectory",e.INPUT_PROCESSOR="input_processor",e.INPUT_STEP_PROCESSOR="input_step_processor",e.OUTPUT_PROCESSOR="output_processor",e.OUTPUT_STEP_PROCESSOR="output_step_processor",e.WORKFLOW_STEP="workflow_step",e.TOOL="tool",e.WORKFLOW_RUN="workflow_run",e.MEMORY="memory",e))(Do||{});K1().describe("Database record creation time");var B2r=K1().describe("Database record last update time");B2r.nullable();var T9=_e({page:r1e().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:r1e().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),N9=_e({total:St().describe("Total number of items available"),page:St().describe("Current page"),perPage:Hr([St(),Bt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:yo().describe("True if more pages are available")}),U2r=_e({start:n1e().optional().describe("Start of date range (inclusive by default)"),end:n1e().optional().describe("End of date range (inclusive by default)"),startExclusive:yo().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:yo().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),A9=So(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),wg=So(["sum","avg","min","max","count","last"]).describe("Aggregation function"),bS=So(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),Jpe=So(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),xS=Et(pe()).min(1).describe("Fields to group by"),eme=Et(St().min(0).max(1)).min(1).describe("Percentile values (0-1)"),tme={value:St().nullable().describe("Aggregated value"),previousValue:St().nullable().optional().describe("Value from comparison period"),changePercent:St().nullable().optional().describe("Percentage change from comparison period")},rme=Ws(pe(),pe().nullable()).describe("Dimension values for this group"),uC=St().describe("Aggregated value"),dC=K1().describe("Bucket timestamp"),nme=St().describe("Percentile value"),sme=St().describe("Percentile value at this bucket"),fC=Kle(Do).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),V2r=pe().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),dut=pe().describe("Name of the entity"),fut=pe().describe("Human end-user who triggered execution"),hut=pe().describe("Multi-tenant organization/account"),put=pe().describe("Broader resource context (Mastra memory compatibility)"),mut=pe().describe("Unique execution run identifier"),gut=pe().describe("Session identifier for grouping traces"),yut=pe().describe("Conversation thread identifier"),vut=pe().describe("HTTP request ID for log correlation"),but=pe().describe('Environment (e.g., "production" | "staging" | "development")'),q2r=pe().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),xut=pe().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),wut=pe().describe("Name of the service"),Sut=Kle(Do).describe("Entity type of the parent entity"),H2r=pe().describe("ID of the parent entity"),Out=pe().describe("Name of the parent entity"),kut=Kle(Do).describe("Entity type of the root entity"),Q2r=pe().describe("ID of the root entity"),_ut=pe().describe("Name of the root entity"),Eut=pe().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),Cut=pe().describe("Version ID of the parent entity that produced this signal"),jut=pe().describe("Version ID of the root entity that produced this signal"),I9=pe().describe("Experiment or eval run identifier"),W2r=Ws(pe(),Ia()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),Tut=Ws(pe(),Ia()).describe("User-defined metadata for custom filtering"),Nut=Et(pe()).describe("Labels for filtering"),G2r={entityType:fC.nullish(),entityId:V2r.nullish(),entityName:dut.nullish(),parentEntityType:Sut.nullish(),parentEntityId:H2r.nullish(),parentEntityName:Out.nullish(),rootEntityType:kut.nullish(),rootEntityId:Q2r.nullish(),rootEntityName:_ut.nullish(),userId:fut.nullish(),organizationId:hut.nullish(),resourceId:put.nullish(),runId:mut.nullish(),sessionId:gut.nullish(),threadId:yut.nullish(),requestId:vut.nullish(),environment:but.nullish(),serviceName:wut.nullish(),scope:W2r.nullish(),entityVersionId:Eut.nullish(),parentEntityVersionId:Cut.nullish(),rootEntityVersionId:jut.nullish(),experimentId:I9.nullish()},R9={...G2r,executionSource:xut.nullish(),tags:Nut.nullish()};q2r.nullish();var P9={timestamp:U2r.optional().describe("Filter by timestamp range"),traceId:pe().optional().describe("Filter by trace ID"),spanId:pe().optional().describe("Filter by span ID"),entityType:fC.optional(),entityName:dut.optional(),entityVersionId:Eut.optional(),parentEntityVersionId:Cut.optional(),rootEntityVersionId:jut.optional(),userId:fut.optional(),organizationId:hut.optional(),experimentId:I9.optional(),serviceName:wut.optional(),environment:but.optional(),parentEntityType:Sut.optional(),parentEntityName:Out.optional(),rootEntityType:kut.optional(),rootEntityName:_ut.optional(),resourceId:put.optional(),runId:mut.optional(),sessionId:gut.optional(),threadId:yut.optional(),requestId:vut.optional(),executionSource:xut.optional(),tags:Et(pe()).optional().describe("Filter by tags (must have all specified tags)")},M9=pe().describe("Unique trace identifier"),D9=pe().describe("Unique span identifier within a trace"),N4=So(["debug","info","warn","error","fatal"]),Aut=pe().describe("Log message"),Iut=Ws(pe(),Ia()).describe("Structured data attached to the log"),Rut=_e({logId:pe().nullish().describe("Unique id for this log event"),timestamp:K1().describe("When the log was created"),level:N4.describe("Log severity level"),message:Aut,data:Iut.nullish(),traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:pe().nullish().describe("Execution source"),metadata:Tut.nullish()}).describe("Log record as stored in the database");_e({level:N4,message:Aut,data:Iut.optional(),tags:Nut.optional()}).describe("User-provided log input");var Z2r=Rut;_e({logs:Et(Z2r)}).describe("Arguments for batch creating logs");var Y2r=_e({...P9,source:pe().optional().describe("Filter by execution source"),level:Hr([N4,Et(N4)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),X2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),K2r=_e({field:X2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:Y2r.optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:K2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");_e({pagination:N9,logs:Et(Rut)});var hC=pe().describe("Identifier of the scorer (e.g., relevance, accuracy)"),Put=pe().describe("Display name of the scorer"),Mut=pe().describe("Version of the scorer"),ng=pe().describe("How the score was produced (e.g., manual, automated, experiment)"),Dut=St().describe("Score value (range defined by scorer)"),Lut=pe().describe("Explanation for the score"),$ut=_e({scoreId:pe().nullish().describe("Unique id for this score event"),timestamp:K1().describe("When the score was recorded"),traceId:M9.nullish().describe("Trace that anchors the scored target when available"),spanId:D9.nullish().describe("Span ID this score applies to"),scorerId:hC,scorerName:Put.nullish(),scorerVersion:Mut.nullish(),scoreSource:ng.nullish(),source:ng.nullish(),score:Dut,reason:Lut.nullish(),...R9,scoreTraceId:pe().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:Ws(pe(),Ia()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");_e({scorerId:hC,scorerName:Put.optional(),scorerVersion:Mut.optional(),scoreSource:ng.optional(),source:ng.optional(),score:Dut,reason:Lut.optional(),metadata:Ws(pe(),Ia()).optional().describe("Additional scorer-specific metadata"),experimentId:I9.optional(),scoreTraceId:pe().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:fC.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var ame=$ut;_e({score:ame}).describe("Arguments for creating a score");_e({score:ame.omit({timestamp:!0})}).describe("Arguments for creating a score");_e({success:yo()}).describe("Response from creating a score");_e({scores:Et(ame)}).describe("Arguments for batch recording scores");var RP=_e({...P9,scorerId:Hr([pe(),Et(pe())]).optional().describe("Filter by scorer ID(s)"),scoreSource:ng.optional().describe("Filter by how the score was produced"),source:ng.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),J2r=So(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),eDr=_e({field:J2r.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:RP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:eDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");_e({pagination:N9,scores:Et($ut)});_e({scorerId:hC,scoreSource:ng.optional(),aggregation:wg,filters:RP.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a score aggregate");_e(tme);_e({scorerId:hC,scoreSource:ng.optional(),groupBy:xS,aggregation:wg,filters:RP.optional()}).describe("Arguments for getting a score breakdown");_e({groups:Et(_e({dimensions:rme,value:uC}))});_e({scorerId:hC,scoreSource:ng.optional(),interval:bS,aggregation:wg,filters:RP.optional(),groupBy:xS.optional()}).describe("Arguments for getting score time series");_e({series:Et(_e({name:pe().describe("Series name (scorer ID or group key)"),points:Et(_e({timestamp:dC,value:uC}))}))});_e({scorerId:hC,scoreSource:ng.optional(),percentiles:eme,interval:bS,filters:RP.optional()}).describe("Arguments for getting score percentiles");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:dC,value:sme}))}))});var sg=pe().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),pC=pe().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),Fut=Hr([St(),pe()]).describe("Feedback value (rating number or correction text)"),zut=pe().describe("Additional comment or context"),A4=pe().describe("User who provided the feedback");function ime(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};return typeof t.userId=="string"&&t.feedbackUserId==null&&(t.feedbackUserId=t.userId,delete t.userId),t}var L9=_e({feedbackId:pe().nullish().describe("Unique id for this feedback event"),timestamp:K1().describe("When the feedback was recorded"),traceId:M9.nullish().describe("Trace that anchors the feedback target when available"),spanId:D9.nullish().describe("Span ID this feedback applies to"),feedbackSource:sg.nullish(),source:sg.nullish(),feedbackType:pC,value:Fut,comment:zut.nullish(),feedbackUserId:A4.nullish(),...R9,sourceId:pe().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:Ws(pe(),Ia()).nullish().describe("User-defined metadata")}),tDr=_e(L9.shape).describe("Feedback record as stored in the database"),rDr=_e({feedbackSource:sg.optional(),source:sg.optional(),feedbackType:pC,value:Fut,comment:zut.optional(),feedbackUserId:A4.optional(),userId:A4.optional(),metadata:Ws(pe(),Ia()).optional().describe("Additional feedback-specific metadata"),experimentId:I9.optional(),sourceId:pe().optional().describe("ID of the source record this feedback is linked to")});_e(rDr.shape).describe("User-provided feedback input");_e({feedback:rce(ime,L9)}).describe("Arguments for creating feedback");_e({feedback:L9.omit({timestamp:!0})}).describe("Arguments for creating feedback");_e({success:yo()}).describe("Response from creating feedback");_e({feedbacks:Et(rce(ime,L9))}).describe("Arguments for batch recording feedback");var But=_e({...P9,feedbackType:Hr([pe(),Et(pe())]).optional().describe("Filter by feedback type(s)"),feedbackSource:sg.optional(),source:sg.optional(),feedbackUserId:A4.optional()}),$9=_e(But.shape).describe("Filters for querying feedback"),nDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),sDr=_e({field:nDr.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:rce(ime,But).optional().describe("Optional filters to apply"),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:sDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");_e({pagination:N9,feedback:Et(tDr)});_e({feedbackType:pC,feedbackSource:sg.optional(),aggregation:wg,filters:$9.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");_e(tme);_e({feedbackType:pC,feedbackSource:sg.optional(),groupBy:xS,aggregation:wg,filters:$9.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");_e({groups:Et(_e({dimensions:rme,value:uC}))});_e({feedbackType:pC,feedbackSource:sg.optional(),interval:bS,aggregation:wg,filters:$9.optional(),groupBy:xS.optional()}).describe("Arguments for getting feedback time series over numeric values");_e({series:Et(_e({name:pe().describe("Series name (feedback type or group key)"),points:Et(_e({timestamp:dC,value:uC}))}))});_e({feedbackType:pC,feedbackSource:sg.optional(),percentiles:eme,interval:bS,filters:$9.optional()}).describe("Arguments for getting feedback percentiles over numeric values");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:dC,value:sme}))}))});So(["counter","gauge","histogram"]);var Uut=pe().describe("Metric name (e.g., mastra_agent_duration_ms)"),Vut=St().describe("Metric value"),qut=Ws(pe(),pe()).describe("Metric labels for dimensional filtering"),Hut=pe().describe("Model provider"),Qut=pe().describe("Model"),aDr=St().describe("Estimated cost"),Wut=pe().describe("Unit for the estimated cost (e.g., usd)"),iDr=Ws(pe(),Ia()).nullish().describe("Structured costing metadata"),Gut=_e({metricId:pe().nullish().describe("Unique id for this metric event"),timestamp:K1().describe("When the metric was recorded"),name:Uut,value:Vut,traceId:M9.nullish(),spanId:D9.nullish(),...R9,source:pe().nullish().describe("Execution source"),provider:Hut.nullish(),model:Qut.nullish(),estimatedCost:aDr.nullish(),costUnit:Wut.nullish(),costMetadata:iDr.nullish(),labels:qut.default({}),metadata:Tut.nullish()}).describe("Metric record as stored in the database");_e({name:Uut,value:Vut,labels:qut.optional()}).describe("User-provided metric input");var oDr=Gut;_e({metrics:Et(oDr)}).describe("Arguments for batch recording metrics");_e({type:wg,interval:bS.optional(),groupBy:xS.optional()}).describe("Metrics aggregation configuration");var PP=_e({...P9,name:Et(pe()).nonempty().optional().describe("Filter by metric name(s)"),source:pe().optional().describe("Filter by execution source"),provider:Hut.optional(),model:Qut.optional(),costUnit:Wut.optional(),labels:Ws(pe(),pe()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),lDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),cDr=_e({field:lDr.default("timestamp").describe("Field to order by"),direction:A9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:PP.optional(),pagination:T9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:cDr.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing metrics");_e({pagination:N9,metrics:Et(Gut)});_e({name:Et(pe()).nonempty().describe("Metric name(s) to aggregate"),aggregation:wg,filters:PP.optional(),comparePeriod:Jpe.optional()}).describe("Arguments for getting a metric aggregate");_e({...tme,estimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:pe().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:St().nullable().optional().describe("Percentage change in estimated cost from comparison period")});_e({name:Et(pe()).nonempty().describe("Metric name(s) to break down"),groupBy:xS,aggregation:wg,filters:PP.optional()}).describe("Arguments for getting a metric breakdown");_e({groups:Et(_e({dimensions:rme,value:uC,estimatedCost:St().nullable().optional().describe("Summed estimated cost for this group"),costUnit:pe().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});_e({name:Et(pe()).nonempty().describe("Metric name(s)"),interval:bS,aggregation:wg,filters:PP.optional(),groupBy:xS.optional()}).describe("Arguments for getting metric time series");_e({series:Et(_e({name:pe().describe("Series name (metric name or group key)"),costUnit:pe().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Et(_e({timestamp:dC,value:uC,estimatedCost:St().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});_e({name:pe().describe("Metric name"),percentiles:eme,interval:bS,filters:PP.optional()}).describe("Arguments for getting metric percentiles");_e({series:Et(_e({percentile:nme,points:Et(_e({timestamp:dC,value:sme}))}))});_e({prefix:pe().optional().describe("Filter metric names by prefix"),limit:St().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");_e({names:Et(pe()).describe("Distinct metric names")});_e({metricName:pe().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");_e({keys:Et(pe()).describe("Distinct label keys for the metric")});_e({metricName:pe().describe("Metric name"),labelKey:pe().describe("Label key to get values for"),prefix:pe().optional().describe("Filter values by prefix"),limit:St().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");_e({values:Et(pe()).describe("Distinct label values")});_e({}).describe("Arguments for getting entity types");_e({entityTypes:Et(fC).describe("Distinct entity types")});_e({entityType:fC.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");_e({names:Et(pe()).describe("Distinct entity names")});_e({}).describe("Arguments for getting service names");_e({serviceNames:Et(pe()).describe("Distinct service names")});_e({}).describe("Arguments for getting environments");_e({environments:Et(pe()).describe("Distinct environments")});_e({entityType:fC.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");_e({tags:Et(pe()).describe("Distinct tags")});function Zut(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Zut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Yut(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Zut(e))&&(n&&(n+=" "),n+=t);return n}const WIe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,GIe=Yut,wS=(e,t)=>r=>{var n;if(t?.variants==null)return GIe(e,r?.class,r?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=r?.[u],f=a?.[u];if(d===null)return null;const h=WIe(d)||WIe(f);return s[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...a,...l}[g]):{...a,...l}[g]===y})?[...u,f,h]:u},[]);return GIe(e,i,c,r?.class,r?.className)},uDr=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},dDr=(e,t)=>({classGroupId:e,validator:t}),Xut=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),I4="-",ZIe=[],fDr="arbitrary..",hDr=e=>{const t=mDr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return pDr(i);const l=i.split(I4),c=l[0]===""&&l.length>1?1:0;return Kut(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?uDr(u,c):c:u||ZIe}return r[i]||ZIe}}},Kut=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Kut(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(I4):e.slice(t).join(I4),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},pDr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?fDr+n:void 0})(),mDr=e=>{const{theme:t,classGroups:r}=e;return gDr(r,t)},gDr=(e,t)=>{const r=Xut();for(const n in e){const s=e[n];ome(s,r,n,t)}return r},ome=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];yDr(i,t,r,n)}},yDr=(e,t,r,n)=>{if(typeof e=="string"){vDr(e,t,r);return}if(typeof e=="function"){bDr(e,t,r,n);return}xDr(e,t,r,n)},vDr=(e,t,r)=>{const n=e===""?t:Jut(t,e);n.classGroupId=r},bDr=(e,t,r,n)=>{if(wDr(e)){ome(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(dDr(r,e))},xDr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];ome(c,Jut(t,l),r,n)}},Jut=(e,t)=>{let r=e;const n=t.split(I4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=Xut(),r.nextPart.set(i,l)),r=l}return r},wDr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,SDr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},die="!",YIe=":",ODr=[],XIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),kDr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,u;const d=s.length;for(let g=0;g<d;g++){const y=s[g];if(i===0&&l===0){if(y===YIe){a.push(s.slice(c,g)),c=g+1;continue}if(y==="/"){u=g;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=a.length===0?s:s.slice(c);let h=f,p=!1;f.endsWith(die)?(h=f.slice(0,-1),p=!0):f.startsWith(die)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return XIe(a,p,h,m)};if(t){const s=t+YIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):XIe(ODr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},_Dr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},EDr=e=>({cache:SDr(e.cacheSize),parseClassName:kDr(e),sortModifiers:_Dr(e),...hDr(e)}),CDr=/\s+/,jDr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(CDr);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=r(d);if(f){c=d+(c.length>0?" "+c:c);continue}let y=!!g,x=n(y?m.substring(0,g):m);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=n(m),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=h.length===0?"":h.length===1?h[0]:a(h).join(":"),S=p?w+die:w,k=S+x;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(x,y);for(let E=0;E<_.length;++E){const T=_[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},TDr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=edt(r))&&(s&&(s+=" "),s+=n);return s},edt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=edt(e[n]))&&(r&&(r+=" "),r+=t);return r},KIe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=EDr(u),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=jDr(c,r);return s(c,d),d};return a=i,(...c)=>a(TDr(...c))},NDr=[],Go=e=>{const t=r=>r[e]||NDr;return t.isThemeGetter=!0,t},tdt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rdt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ADr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,IDr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RDr=/\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$/,PDr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,MDr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,DDr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nb=e=>ADr.test(e),qn=e=>!!e&&!Number.isNaN(Number(e)),sb=e=>!!e&&Number.isInteger(Number(e)),nQ=e=>e.endsWith("%")&&qn(e.slice(0,-1)),Jg=e=>IDr.test(e),ndt=()=>!0,LDr=e=>RDr.test(e)&&!PDr.test(e),lme=()=>!1,$Dr=e=>MDr.test(e),FDr=e=>DDr.test(e),zDr=e=>!vr(e)&&!kr(e),BDr=e=>a0(e,idt,lme),vr=e=>tdt.test(e),V0=e=>a0(e,odt,LDr),JIe=e=>a0(e,ZDr,qn),UDr=e=>a0(e,cdt,ndt),VDr=e=>a0(e,ldt,lme),eRe=e=>a0(e,sdt,lme),qDr=e=>a0(e,adt,FDr),XD=e=>a0(e,udt,$Dr),kr=e=>rdt.test(e),iT=e=>SS(e,odt),HDr=e=>SS(e,ldt),tRe=e=>SS(e,sdt),QDr=e=>SS(e,idt),WDr=e=>SS(e,adt),KD=e=>SS(e,udt,!0),GDr=e=>SS(e,cdt,!0),a0=(e,t,r)=>{const n=tdt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},SS=(e,t,r=!1)=>{const n=rdt.exec(e);return n?n[1]?t(n[1]):r:!1},sdt=e=>e==="position"||e==="percentage",adt=e=>e==="image"||e==="url",idt=e=>e==="length"||e==="size"||e==="bg-size",odt=e=>e==="length",ZDr=e=>e==="number",ldt=e=>e==="family-name",cdt=e=>e==="number"||e==="weight",udt=e=>e==="shadow",rRe=()=>{const e=Go("color"),t=Go("font"),r=Go("text"),n=Go("font-weight"),s=Go("tracking"),a=Go("leading"),i=Go("breakpoint"),l=Go("container"),c=Go("spacing"),u=Go("radius"),d=Go("shadow"),f=Go("inset-shadow"),h=Go("text-shadow"),p=Go("drop-shadow"),m=Go("blur"),g=Go("perspective"),y=Go("aspect"),x=Go("ease"),w=Go("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...k(),kr,vr],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[kr,vr,c],N=()=>[nb,"full","auto",...j()],I=()=>[sb,"none","subgrid",kr,vr],P=()=>["auto",{span:["full",sb,kr,vr]},sb,kr,vr],R=()=>[sb,"auto",kr,vr],B=()=>["auto","min","max","fr",kr,vr],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],z=()=>[nb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[nb,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Q=()=>[nb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,vr],Z=()=>[...k(),tRe,eRe,{position:[kr,vr]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",QDr,BDr,{size:[kr,vr]}],W=()=>[nQ,iT,V0],G=()=>["","none","full",u,kr,vr],J=()=>["",qn,iT,V0],ae=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[qn,nQ,tRe,eRe],ie=()=>["","none",m,kr,vr],he=()=>["none",qn,kr,vr],X=()=>["none",qn,kr,vr],se=()=>[qn,kr,vr],le=()=>[nb,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jg],breakpoint:[Jg],color:[ndt],container:[Jg],"drop-shadow":[Jg],ease:["in","out","in-out"],font:[zDr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jg],shadow:[Jg],spacing:["px",qn],text:[Jg],"text-shadow":[Jg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nb,vr,kr,y]}],container:["container"],columns:[{columns:[qn,vr,kr,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:_()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[sb,"auto",kr,vr]}],basis:[{basis:[nb,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qn,nb,"auto","initial","none",vr]}],grow:[{grow:["",qn,kr,vr]}],shrink:[{shrink:["",qn,kr,vr]}],order:[{order:[sb,"first","last","none",kr,vr]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,iT,V0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,GDr,UDr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nQ,vr]}],"font-family":[{font:[HDr,VDr,t]}],"font-features":[{"font-features":[vr]}],"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:[s,kr,vr]}],"line-clamp":[{"line-clamp":[qn,"none",kr,JIe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",kr,vr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kr,vr]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[qn,"from-font","auto",kr,V0]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[qn,"auto",kr,vr]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kr,vr]}],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",kr,vr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sb,kr,vr],radial:["",kr,vr],conic:[sb,kr,vr]},WDr,qDr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qn,kr,vr]}],"outline-w":[{outline:["",qn,iT,V0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,KD,XD]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,KD,XD]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[qn,V0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,KD,XD]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[qn,kr,vr]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":[qn]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[kr,vr]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[qn]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kr,vr]}],filter:[{filter:["","none",kr,vr]}],blur:[{blur:ie()}],brightness:[{brightness:[qn,kr,vr]}],contrast:[{contrast:[qn,kr,vr]}],"drop-shadow":[{"drop-shadow":["","none",p,KD,XD]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",qn,kr,vr]}],"hue-rotate":[{"hue-rotate":[qn,kr,vr]}],invert:[{invert:["",qn,kr,vr]}],saturate:[{saturate:[qn,kr,vr]}],sepia:[{sepia:["",qn,kr,vr]}],"backdrop-filter":[{"backdrop-filter":["","none",kr,vr]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[qn,kr,vr]}],"backdrop-contrast":[{"backdrop-contrast":[qn,kr,vr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qn,kr,vr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qn,kr,vr]}],"backdrop-invert":[{"backdrop-invert":["",qn,kr,vr]}],"backdrop-opacity":[{"backdrop-opacity":[qn,kr,vr]}],"backdrop-saturate":[{"backdrop-saturate":[qn,kr,vr]}],"backdrop-sepia":[{"backdrop-sepia":["",qn,kr,vr]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",kr,vr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qn,"initial",kr,vr]}],ease:[{ease:["linear","initial",x,kr,vr]}],delay:[{delay:[qn,kr,vr]}],animate:[{animate:["none",w,kr,vr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,kr,vr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[kr,vr,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",kr,vr]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",kr,vr]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[qn,iT,V0,JIe]}],stroke:[{stroke:["none",...L()]}],"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"]}},YDr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(QT(e,"cacheSize",t),QT(e,"prefix",r),QT(e,"experimentalParseClassName",n),JD(e.theme,a.theme),JD(e.classGroups,a.classGroups),JD(e.conflictingClassGroups,a.conflictingClassGroups),JD(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),QT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),eL(e.theme,s.theme),eL(e.classGroups,s.classGroups),eL(e.conflictingClassGroups,s.conflictingClassGroups),eL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),ddt(e,s,"orderSensitiveModifiers"),e),QT=(e,t,r)=>{r!==void 0&&(e[t]=r)},JD=(e,t)=>{if(t)for(const r in t)QT(e,r,t[r])},eL=(e,t)=>{if(t)for(const r in t)ddt(e,t,r)},ddt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},XDr=(e,...t)=>typeof e=="function"?KIe(rRe,e,...t):KIe(()=>YDr(rRe(),e),...t),KDr=Object.keys({...ky,...Y9t}),JDr=Object.keys(r8t),eLr=Object.keys(X9t),tLr=Object.keys(K9t),rLr=Object.keys(Z9t),q0=Object.keys(t8t),nLr=Object.keys(J9t).concat(Object.keys(e8t)),sLr=XDr({extend:{theme:{color:KDr,spacing:JDr,radius:rLr,leading:tLr,shadow:nLr},classGroups:{"font-size":[{text:eLr}],h:[{h:q0}],w:[{w:q0}],size:[{size:q0}],"min-h":[{"min-h":q0}],"min-w":[{"min-w":q0}],"max-h":[{"max-h":q0}],"max-w":[{"max-w":q0}]}}});function Y(...e){return sLr(Yut(e))}const ad=h5t,Xr=p5t,Kr=m5t,Gr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(g5t,{children:o.jsxs(Rqe,{ref:s,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n,children:[r,o.jsx(y5t,{className:"fill-surface3"})]})}));Gr.displayName=Rqe.displayName;const aLr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},Ce=({children:e,className:t,size:r="default",...n})=>o.jsx("span",{className:Y("block",aLr[r],t),...n,children:e}),lc={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},F9="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",iLr="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",oLr="rounded-md",fdt="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",cme="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",ume="disabled:opacity-50 disabled:cursor-not-allowed",tL=Y("gap-[.75em] rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),mC=wS(Y("inline-flex items-center justify-center leading-0","transition-all duration-normal ease-out-custom",ume,cme),{variants:{variant:{default:"bg-surface3 border-2 border-border1 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",primary:"bg-surface4 border-2 border-border2 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",cta:"bg-accent1 border-2 border-transparent hover:bg-accent1/90 hover:shadow-glow-accent1 disabled:hover:shadow-none text-surface1 font-medium",ghost:"bg-transparent border-2 border-transparent hover:bg-surface4 hover:text-neutral6 active:bg-surface5 text-neutral4",outline:"bg-transparent border-2 border-border1 hover:bg-surface3 hover:text-neutral6 active:bg-surface4 text-neutral5",link:"inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"},size:{sm:Y(`${lc.sm} text-ui-sm px-[.75em]`,tL),md:Y(`${lc.md} text-ui-md px-[.75em]`,tL),default:Y(`${lc.default} text-ui-md px-[.85em]`,tL),lg:Y(`${lc.lg} text-ui-lg px-[1em]`,tL),"icon-sm":`${lc.sm} w-form-sm rounded-md`,"icon-md":`${lc.md} w-form-md rounded-md`,"icon-lg":`${lc.lg} w-form-lg rounded-md`}},defaultVariants:{variant:"default",size:"default"}}),lLr={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function hdt(e){const t=[];return je.Children.forEach(e,r=>{je.isValidElement(r)&&r.type===je.Fragment?t.push(...hdt(r.props.children)):t.push(r)}),t}function cLr(e){const t=hdt(e);return t.length>0&&t.every(r=>je.isValidElement(r))}function uLr(e){return typeof e=="string"&&e.startsWith("icon-")}const ce=je.forwardRef(({className:e,as:t,size:r,variant:n="default",disabled:s,children:a,tooltip:i,"aria-label":l,...c},u)=>{const d=t||"button",f=uLr(r),h=r??"default",p=!f&&cLr(a),m=l??((f||p)&&typeof i=="string"?i:void 0),g=f?o.jsx(Ce,{size:lLr[r],children:a}):a,y=o.jsx(d,{ref:u,disabled:s,"aria-label":m,className:Y(mC({variant:n,size:h}),p&&"[&>svg]:opacity-75",e),...c,children:g});return i?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:y}),o.jsx(Gr,{children:i})]}):y});ce.displayName="Button";const Ln=je.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ce,{ref:r,...t})}),e&&o.jsx(Gr,{children:e})]}));Ln.displayName="ButtonWithTooltip";const ln={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},i0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},pdt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),R4=({children:e,as:t="a",href:r,className:n,prefetch:s,to:a})=>o.jsx(t,{href:r,prefetch:s,to:a,className:Y("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",ln.colors,n),children:e}),mdt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),P4=({children:e,isActive:t,className:r})=>o.jsx("li",{className:Y("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",ln.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),gdt=({onClick:e})=>o.jsx(ce,{variant:"ghost",className:Y("shrink-0 opacity-0",ln.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(Ce,{children:o.jsx(Wl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),dLr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},fLr={mono:"font-mono"},me=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Y(dLr[r],n&&fLr[n],t),...s}),hLr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},ydt=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Y(hLr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",ln.all,n&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?o.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):o.jsx(me,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),pLr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},mLr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},vt=({icon:e,variant:t="default",className:r,children:n,...s})=>o.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",ln.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":pLr[t],r),...s,children:[e&&o.jsx("span",{className:mLr[t],children:o.jsx(Ce,{children:e})}),n]}),gLr=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),Xa=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),jr=({className:e,as:t,isCurrent:r,action:n,...s})=>{const a=t||"span";return o.jsxs(o.Fragment,{children:[o.jsxs("li",{className:"flex h-full shrink-0 items-center gap-1",children:[o.jsx(a,{"aria-current":r?"page":void 0,className:Y("text-ui-md leading-ui-md flex items-center gap-2",ln.colors,r?"text-white":"text-neutral3 hover:text-neutral5",e),...s}),n]}),!r&&o.jsx("li",{role:"separator",className:"flex h-full items-center",children:o.jsx(Ce,{className:Y("text-neutral2",ln.colors),children:o.jsx(gLr,{})})})]})};function yLr(e,t=5){if(!e?.properties)return[];const r=[];function n(s,a,i){if(i>t)return;const l=Array.isArray(s.type)?s.type.join(" | "):s.type;if(r.push({path:a,label:a,description:s.description??s.title,type:l}),s.properties)for(const[c,u]of Object.entries(s.properties))n(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))n(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))n(a,s,1);return r}function vLr(e){const t=yLr(e);return KWe({override:[bLr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function bLr(e){return t=>{const n=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!n)return null;const s=n[1]??"",a=t.pos-s.length,i=s?e.filter(c=>c.path.toLowerCase().startsWith(s.toLowerCase())):e;if(i.length===0)return null;const l=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,h)=>{const g=u.state.sliceDoc(h,h+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:h,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:l,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const xLr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,wLr=er.mark({class:"cm-variable-highlight"}),nRe=new fWe({regexp:xLr,decoration:()=>wLr}),SLr=Oi.fromClass(class{decorations;constructor(e){this.decorations=nRe.createDeco(e)}update(e){this.decorations=nRe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),OLr=SLr,ya=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),o.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),kLr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),o.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),dme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),fme=e=>o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),o0=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),vdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:o.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_22095",children:o.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),bdt=e=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[o.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"#4285F4"}),o.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"#34A853"}),o.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"#FBBC05"}),o.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"#EA4335"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_21999_20513",children:o.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),_Lr=e=>o.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),o.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),o.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),o.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),z9=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),hme=e=>o.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),Mi=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),gC=e=>o.jsx(W9t,{...e}),Di=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),gl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),o.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),B9=e=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});function lp(e){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),o.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),o.jsx("path",{d:"M15 2v2"}),o.jsx("path",{d:"M15 20v2"}),o.jsx("path",{d:"M2 15h2"}),o.jsx("path",{d:"M2 9h2"}),o.jsx("path",{d:"M20 15h2"}),o.jsx("path",{d:"M20 9h2"}),o.jsx("path",{d:"M9 2v2"}),o.jsx("path",{d:"M9 20v2"})]})}const xdt=e=>o.jsxs("svg",{className:"h-3 w-3",width:"16",height:"16",viewBox:"0 0 181 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsxs("g",{clipPath:"url(#clip0_1480_1723)",children:[o.jsx("path",{d:"M51.2203 39.3158C51.2203 41.5066 51.4572 43.2829 51.8717 44.5856C52.3453 45.8882 52.9374 47.3093 53.7664 48.8487C54.0624 49.3224 54.1809 49.7961 54.1809 50.2106C54.1809 50.8027 53.8256 51.3948 53.0559 51.9869L49.3256 54.4737C48.7927 54.829 48.2598 55.0066 47.7861 55.0066C47.194 55.0066 46.6019 54.7106 46.0098 54.1777C45.1809 53.2895 44.4703 52.3422 43.8782 51.3948C43.2861 50.3882 42.694 49.2632 42.0427 47.9014C37.4243 53.3487 31.6217 56.0724 24.6348 56.0724C19.6611 56.0724 15.694 54.6514 12.7927 51.8093C9.8914 48.9672 8.41113 45.1777 8.41113 40.4408C8.41113 35.4079 10.1874 31.3224 13.7993 28.2435C17.4111 25.1645 22.2072 23.6251 28.3059 23.6251C30.319 23.6251 32.3914 23.8027 34.5822 24.0987C36.773 24.3948 39.023 24.8685 41.3914 25.4014V21.079C41.3914 16.579 40.444 13.4408 38.6085 11.6053C36.7138 9.76979 33.5164 8.88163 28.9572 8.88163C26.8848 8.88163 24.7532 9.11847 22.5624 9.65137C20.3717 10.1843 18.2401 10.8356 16.1677 11.6645C15.2203 12.079 14.5098 12.3158 14.0953 12.4343C13.6809 12.5527 13.3848 12.6119 13.148 12.6119C12.319 12.6119 11.9046 12.0198 11.9046 10.7764V7.87505C11.9046 6.92768 12.023 6.21716 12.319 5.80268C12.6151 5.38821 13.148 4.97374 13.9769 4.55926C16.0493 3.49347 18.5361 2.60531 21.4374 1.89479C24.3388 1.12505 27.4177 0.769788 30.6743 0.769788C37.7203 0.769788 42.8717 2.36847 46.1875 5.56584C49.444 8.76321 51.1019 13.6185 51.1019 20.1316V39.3158H51.2203ZM27.1809 48.3158C29.1348 48.3158 31.148 47.9606 33.2796 47.2501C35.4111 46.5395 37.3059 45.2369 38.9046 43.4606C39.8519 42.3356 40.5625 41.0922 40.9177 39.6711C41.273 38.2501 41.5098 36.5329 41.5098 34.5198V32.0329C39.7927 31.6185 37.9572 31.2632 36.0624 31.0264C34.1677 30.7895 32.3322 30.6711 30.4967 30.6711C26.5296 30.6711 23.6282 31.4408 21.6743 33.0395C19.7203 34.6382 18.773 36.8882 18.773 39.8487C18.773 42.6316 19.4835 44.704 20.9638 46.1251C22.3848 47.6053 24.4572 48.3158 27.1809 48.3158ZM74.7269 54.7106C73.6611 54.7106 72.9506 54.5329 72.4769 54.1185C72.0032 53.7632 71.5888 52.9343 71.2335 51.8093L57.319 6.03953C56.9638 4.85531 56.7861 4.08558 56.7861 3.6711C56.7861 2.72374 57.2598 2.19084 58.2072 2.19084H64.0098C65.1348 2.19084 65.9046 2.36847 66.319 2.78295C66.7927 3.13821 67.148 3.96716 67.5032 5.09216L77.4506 44.2895L86.6874 5.09216C86.9835 3.90795 87.3388 3.13821 87.8124 2.78295C88.2861 2.42768 89.1151 2.19084 90.1809 2.19084H94.9177C96.0427 2.19084 96.8124 2.36847 97.2861 2.78295C97.7598 3.13821 98.1743 3.96716 98.4111 5.09216L107.766 44.7632L118.01 5.09216C118.365 3.90795 118.78 3.13821 119.194 2.78295C119.668 2.42768 120.437 2.19084 121.503 2.19084H127.01C127.957 2.19084 128.49 2.66453 128.49 3.6711C128.49 3.96716 128.431 4.26321 128.372 4.61847C128.312 4.97374 128.194 5.44742 127.957 6.09874L113.687 51.8685C113.332 53.0527 112.918 53.8224 112.444 54.1777C111.97 54.5329 111.201 54.7698 110.194 54.7698H105.102C103.977 54.7698 103.207 54.5922 102.733 54.1777C102.26 53.7632 101.845 52.9935 101.608 51.8093L92.4309 13.6185L83.3125 51.7501C83.0164 52.9343 82.6611 53.704 82.1874 54.1185C81.7138 54.5329 80.8848 54.7106 79.819 54.7106H74.7269ZM150.812 56.3093C147.734 56.3093 144.655 55.954 141.694 55.2435C138.733 54.5329 136.424 53.7632 134.885 52.8751C133.937 52.3422 133.286 51.7501 133.049 51.2172C132.812 50.6843 132.694 50.0922 132.694 49.5593V46.5395C132.694 45.2961 133.168 44.704 134.056 44.704C134.411 44.704 134.766 44.7632 135.122 44.8816C135.477 45.0001 136.01 45.2369 136.602 45.4737C138.615 46.3619 140.806 47.0724 143.115 47.5461C145.484 48.0198 147.793 48.2566 150.161 48.2566C153.891 48.2566 156.793 47.6053 158.806 46.3027C160.819 45 161.885 43.1053 161.885 40.6777C161.885 39.0198 161.352 37.6579 160.286 36.5329C159.22 35.4079 157.207 34.4014 154.306 33.454L145.72 30.7895C141.398 29.4277 138.201 27.4145 136.247 24.7501C134.293 22.1448 133.286 19.2435 133.286 16.1645C133.286 13.6777 133.819 11.4869 134.885 9.59216C135.951 7.69742 137.372 6.03953 139.148 4.73689C140.924 3.37505 142.937 2.36847 145.306 1.65795C147.674 0.94742 150.161 0.651367 152.766 0.651367C154.069 0.651367 155.431 0.710578 156.734 0.888209C158.095 1.06584 159.339 1.30268 160.582 1.53953C161.766 1.83558 162.891 2.13163 163.957 2.48689C165.023 2.84216 165.852 3.19742 166.444 3.55268C167.273 4.02637 167.865 4.50005 168.22 5.03295C168.576 5.50663 168.753 6.15795 168.753 6.98689V9.76979C168.753 11.0132 168.28 11.6645 167.391 11.6645C166.918 11.6645 166.148 11.4277 165.141 10.954C161.766 9.41453 157.977 8.64479 153.773 8.64479C150.398 8.64479 147.734 9.17768 145.898 10.3027C144.062 11.4277 143.115 13.1448 143.115 15.5724C143.115 17.2303 143.707 18.6514 144.891 19.7764C146.076 20.9014 148.266 22.0264 151.405 23.0329L159.812 25.6974C164.076 27.0593 167.155 28.954 168.99 31.3816C170.826 33.8093 171.714 36.5922 171.714 39.6711C171.714 42.2172 171.181 44.5264 170.174 46.5395C169.108 48.5527 167.687 50.329 165.852 51.7501C164.016 53.2303 161.826 54.2961 159.28 55.0658C156.615 55.8948 153.832 56.3093 150.812 56.3093Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.004 85.0856C142.524 99.4738 114.221 107.112 89.8855 107.112C55.7803 107.112 25.05 94.5001 1.83948 73.5396C0.00394917 71.8817 1.66184 69.6317 3.85263 70.9343C28.9579 85.5001 59.925 94.3225 91.9579 94.3225C113.57 94.3225 137.313 89.8225 159.162 80.5856C162.418 79.1054 165.201 82.7172 162.004 85.0856Z",fill:"#FF9900"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M170.115 75.8487C167.628 72.6513 153.654 74.3092 147.319 75.079C145.424 75.3158 145.128 73.6579 146.845 72.4145C157.976 64.5987 176.272 66.8487 178.404 69.454C180.536 72.1184 177.812 90.4145 167.391 99.1776C165.792 100.539 164.253 99.8289 164.963 98.0526C167.332 92.1908 172.601 78.9868 170.115 75.8487Z",fill:"#FF9900"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1480_1723",children:o.jsx("rect",{width:"180",height:"107.763",fill:"white",transform:"translate(0.0625)"})})})]}),ELr=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),CLr=e=>o.jsx("svg",{className:"h-3 w-3",fill:"white",height:"78",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"78",style:{color:"currentcolor"},...e,children:o.jsx("g",{transform:"translate(0,2)",children:o.jsx("path",{d:"M11.375 0h-2.411L13.352 11.13h2.411L11.375 0ZM4.4 0 0 11.13h2.46l0.9-2.336h4.604l0.9 2.336h2.46L6.924 0H4.4Zm-0.244 6.723 1.506-3.909 1.506 3.909H4.156Z",fill:"currentColor"})})}),wdt=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",...e,children:o.jsx("path",{d:"M7.402 13.8777C9.45763 13.4674 11.1555 13.128 11.175 13.1233L11.2104 13.1148L9.2697 10.507C8.2023 9.07276 7.32898 7.8937 7.32898 7.88691C7.32898 7.87404 9.33293 1.63997 9.3442 1.61779C9.34797 1.61037 10.7117 4.27017 12.65 8.06532C14.4647 11.6184 15.9608 14.5479 15.9747 14.5754L16 14.6253L9.83224 14.6244L3.66449 14.6235L7.402 13.8777ZM0 13.0824C0 13.0787 0.914457 11.2855 2.03212 9.09735L4.06425 5.11896L6.43245 2.87384C7.73497 1.63902 8.80417 0.627201 8.80845 0.625356C8.81274 0.623511 8.79561 0.672228 8.77038 0.733617C8.74515 0.795006 7.58796 3.59893 6.19884 6.96455L3.67317 13.0839L1.83659 13.0865C0.826464 13.0879 0 13.0861 0 13.0824Z",fill:"#0089D6",style:{fill:"#0089D6",fillOpacity:1}})}),jLr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"18",fill:"none",...e,children:[o.jsx("mask",{id:"mask0_174_2406",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"17",height:"18",children:o.jsx("path",{d:"M17 0.5H0V17.5H17V0.5Z",fill:"white"})}),o.jsxs("g",{mask:"url(#mask0_174_2406)",children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.50773 10.6219C5.9653 10.6219 6.8755 10.5968 8.13362 10.0788C9.59973 9.47518 12.5166 8.37942 14.6208 7.2539C16.0924 6.46668 16.7375 5.42553 16.7375 4.02344C16.7375 2.07751 15.16 0.5 13.2141 0.5H5.06095C2.26586 0.5 0 2.76586 0 5.56095C0 8.35604 2.12151 10.6219 5.50773 10.6219Z",fill:"#39594D"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.88672 14.107C6.88672 12.7369 7.71155 11.5016 8.97699 10.9764L11.5446 9.9108C14.1417 8.83294 17.0003 10.7415 17.0003 13.5535C17.0003 15.732 15.2339 17.4979 13.0553 17.4973L10.2754 17.4966C8.40372 17.4961 6.88672 15.9787 6.88672 14.107Z",fill:"#D18EE2"}),o.jsx("path",{d:"M2.91749 11.2891C1.30623 11.2891 0 12.5952 0 14.2065V14.5844C0 16.1956 1.30618 17.5018 2.91744 17.5018C4.5287 17.5018 5.83493 16.1956 5.83493 14.5844V14.2065C5.83493 12.5952 4.52875 11.2891 2.91749 11.2891Z",fill:"#FF7759"})]})]}),TLr=e=>o.jsxs("svg",{className:"h-3 w-3","data-testid":"geist-icon",height:"78",strokeLinejoin:"round",viewBox:"0 0 160 59",width:"104",style:{color:"currentcolor"},...e,children:[o.jsx("mask",{id:"mask0_4345_1846",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"160",height:"59",style:{maskType:"luminance"},children:o.jsx("path",{d:"M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z",fill:"white"})}),o.jsx("g",{mask:"url(#mask0_4345_1846)",children:o.jsx("path",{d:"M95.4635 0.314595C84.4822 0.314595 75.5599 9.19525 75.5599 20.1677C75.5599 31.1402 84.4632 40.0208 95.4635 40.0208C106.464 40.0208 115.367 31.1402 115.367 20.1677C115.348 9.21427 106.445 0.333611 95.4635 0.314595ZM95.4635 32.5664C88.6002 32.5664 83.0333 27.0136 83.0333 20.1677C83.0333 13.3218 88.6002 7.76902 95.4635 7.76902C102.327 7.76902 107.894 13.3218 107.894 20.1677C107.894 27.0136 102.327 32.5664 95.4635 32.5664ZM67.9912 0.39066C67.3049 0.314595 66.6376 0.276562 65.9513 0.276562C65.6081 0.276562 65.284 0.276562 64.9599 0.295578C64.6358 0.314595 64.2926 0.333611 63.9685 0.352628C62.634 0.44771 61.2995 0.675906 60.0031 1.03722C57.3531 1.74082 54.8556 2.99591 52.7013 4.68836C50.4898 6.43787 48.7358 8.68181 47.5347 11.23C46.9437 12.5041 46.5052 13.8543 46.2193 15.2234C46.0858 15.908 45.9905 16.5926 45.9142 17.2772C45.8952 17.6195 45.857 17.9618 45.857 18.3041L45.838 18.8175V19.293L45.8761 32.5854L45.9142 39.2221H53.3685L53.4067 32.5854L53.4448 19.293V18.5893C53.4448 18.3802 53.4829 18.171 53.4829 17.9618C53.5211 17.5434 53.5973 17.1441 53.6736 16.7257C53.8452 15.9271 54.093 15.1474 54.4362 14.4057C55.1225 12.9225 56.152 11.6293 57.4293 10.6025C58.7639 9.53755 60.3081 8.75787 61.9477 8.3205C62.7865 8.0923 63.6635 7.94017 64.5405 7.8641C64.7693 7.84509 64.979 7.82607 65.2078 7.82607C65.4365 7.82607 65.6653 7.80705 65.875 7.80705C66.2944 7.80705 66.7329 7.82607 67.1524 7.8641C68.8491 8.03525 70.4887 8.54869 71.9948 9.38541L75.7124 2.93886C73.3484 1.56968 70.7175 0.694923 67.9912 0.39066ZM20.3484 0.219513C9.36711 0.124431 0.36855 8.92902 0.273226 19.8825C0.177902 30.8359 9.00488 39.8116 19.9862 39.9067H26.8876V32.4713H20.3484C13.4851 32.5474 7.84193 27.0707 7.76567 20.2057C7.68941 13.3408 13.1801 7.73099 20.0624 7.65492H20.3484C27.2117 7.65492 32.7786 13.2077 32.8167 20.0536V38.3284C32.8167 45.1172 27.2689 50.651 20.4819 50.7271C17.2218 50.708 14.1142 49.3959 11.8265 47.0949L6.54553 52.3625C10.206 56.0326 15.1628 58.1244 20.3484 58.1625H20.6153C31.4632 58.0103 40.1757 49.2248 40.2329 38.4044V19.5592C39.966 8.81492 31.1391 0.238529 20.3484 0.219513ZM139.389 0.314595C128.407 0.314595 119.485 9.19525 119.504 20.1677C119.504 31.1212 128.407 40.0018 139.389 40.0018H146.195V32.5664H139.389C132.525 32.5664 126.958 27.0136 126.958 20.1677C126.958 13.3218 132.525 7.76902 139.389 7.76902C145.833 7.76902 151.209 12.6943 151.781 19.1028H151.762V57.2116H159.216V20.1677C159.216 9.21427 150.351 0.314595 139.389 0.314595Z",fill:"currentColor"})})]}),NLr=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:e.fill||"currentColor"})}),ALr=e=>o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"176",height:"162",viewBox:"0 0 176 162",fill:"none",...e,children:[o.jsx("rect",{x:"15",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"47",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"111",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"79",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"15",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{x:"143",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),o.jsx("rect",{y:"1",width:"16",height:"160",fill:"black"}),o.jsx("rect",{x:"63",y:"97",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"95",y:"33",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"1",width:"16",height:"32",fill:"black"}),o.jsx("rect",{x:"127",y:"97",width:"16",height:"64",fill:"black"})]}),ILr=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"113",viewBox:"0 0 128 113",children:[o.jsxs("g",{clipPath:"url(#clip0_236_138)",...e,children:[o.jsx("path",{d:"M34.593 94.0509H33.3844L27.3514 88.0179V86.8094L36.5743 77.5866H42.9639L43.8158 78.4385V84.8281L34.593 94.0509Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M27.3514 25.816V24.6074L33.3844 18.5744H34.593L43.8158 27.7972V34.1868L42.9639 35.0388H36.5743L27.3514 25.816Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M80.4594 74.6047H71.6824L70.9493 73.8717V53.3259C70.9493 49.6705 69.5129 46.8372 65.1046 46.7382C62.836 46.6787 60.2405 46.7382 57.4668 46.8471L57.0507 47.2731V73.8618L56.3176 74.5948H47.5406L46.8075 73.8618V38.7636L47.5406 38.0305H67.2939C74.9713 38.0305 81.1925 44.2517 81.1925 51.9291V73.8717L80.4594 74.6047Z",fill:e.fill||"#014847"}),o.jsx("path",{d:"M35.8412 61.4491H0.73307L0 60.716V51.9192L0.73307 51.1861H35.8412L36.5743 51.9192V60.716L35.8412 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M127.277 61.4491H92.1687L91.4356 60.716V51.9192L92.1687 51.1861H127.277L128.01 51.9192V60.716L127.277 61.4491Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 27.0642V0.73307L59.6759 0H68.4727L69.2058 0.73307V27.0642L68.4727 27.7972H59.6759L58.9428 27.0642Z",fill:e.fill||"#05BDBA"}),o.jsx("path",{d:"M58.9428 111.902V85.5711L59.6759 84.838H68.4727L69.2058 85.5711V111.902L68.4727 112.635H59.6759L58.9428 111.902Z",fill:e.fill||"#05BDBA"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_236_138",children:o.jsx("rect",{width:"128",height:"112.635",fill:"white"})})})]}),sRe=e=>o.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:o.jsx("path",{d:"m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),RLr=e=>o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 1000",width:"78",height:"78",style:{color:"currentcolor"},...e,children:o.jsxs("g",{children:[o.jsx("polygon",{fill:"currentColor",points:"226.83 411.15 501.31 803.15 623.31 803.15 348.82 411.15 226.83 411.15"}),o.jsx("polygon",{fill:"currentColor",points:"348.72 628.87 226.69 803.15 348.77 803.15 409.76 716.05 348.72 628.87"}),o.jsx("polygon",{fill:"currentColor",points:"651.23 196.85 440.28 498.12 501.32 585.29 773.31 196.85 651.23 196.85"}),o.jsx("polygon",{fill:"currentColor",points:"673.31 383.25 673.31 803.15 773.31 803.15 773.31 240.44 673.31 383.25"})]})}),PLr={duration:5e3,cancel:{label:o.jsx(Ce,{children:o.jsx(Wl,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-xl gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card :data-content:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"bg-transparent! hover:bg-surface2! border-none! rounded-md! p-1.5! m-0! text-neutral3! hover:text-neutral6! shrink-0 transition-all",actionButton:"bg-white! flex items-center justify-center font-medium text-black! order-last hover:opacity-80"}};function Jd(e){const{classNames:t,...r}=PLr,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:Y(t?.title,n?.title),toast:Y(t?.toast,n?.toast),cancelButton:Y(t?.cancelButton,n?.cancelButton),actionButton:Y(t?.actionButton,n?.actionButton),description:Y(t?.description,n?.description)},...s}}const ze=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>mc(r,Jd(t)));if(je.isValidElement(e))return mc(e,Jd(t));if(typeof e=="string")return mc(e,Jd(t));throw new Error("Invalid message type")};ze.success=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent1 shrink-0",children:o.jsx(Azt,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.success(e,Jd(r));case"object":return e.forEach(n=>mc.success(n,Jd(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent2 shrink-0",children:o.jsx(AHe,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.error(e,Jd(r));case"object":return e.forEach(n=>mc.error(n,Jd(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent6 shrink-0",children:o.jsx(Uce,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.warning(e,Jd(r));case"object":return e.forEach(n=>mc.warning(n,Jd(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent3 shrink-0",children:o.jsx(FR,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return mc.info(e,Jd(r));case"object":return e.forEach(n=>mc.info(n,Jd(r)))}};ze.custom=(e,t={})=>mc(e,Jd(t));ze.dismiss=e=>{e&&mc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>mc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...Jd(i)});function cf({text:e,copyMessage:t="Copied to clipboard!"}){const[r,n]=b.useState(!1),s=b.useRef(null),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{ze.success(t),n(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{n(!1)},2e3)}).catch(()=>{ze.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:r,handleCopy:a}}function ra({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=cf({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ce,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(cv,{}):o.jsx(RHe,{})})}),o.jsx(Gr,{children:a?"Copied!":r})]})}const MLr="mastra-theme",DLr="mastra-playground-store",fie=e=>e==="dark"||e==="light"||e==="system",LLr=e=>{try{const t=e.getItem(DLr);if(!t)return;const n=JSON.parse(t)?.state?.theme;return fie(n)?n:void 0}catch{return}},$Lr=(e=MLr)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(fie(t))return t;const r=LLr(window.localStorage);return r?(window.localStorage.setItem(e,r),r):null}catch{return null}},set(t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},subscribe(t){if(typeof window>"u")return()=>{};const r=n=>{if(n.key===e){if(n.newValue===null){t(null);return}fie(n.newValue)&&t(n.newValue)}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}),Sdt=b.createContext(null),Odt="(prefers-color-scheme: dark)",FLr=typeof window>"u"?b.useEffect:b.useLayoutEffect,kdt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(Odt).matches?"dark":"light",_dt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(Odt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},zLr=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},Edt=({children:e,defaultTheme:t="system",storageKey:r,target:n})=>{const s=b.useMemo(()=>$Lr(r),[r]),a=b.useRef(null),[i,l]=b.useState(()=>s.get()??t),c=b.useSyncExternalStore(_dt,kdt,()=>"dark");b.useEffect(()=>s.subscribe(f=>l(f??t)),[s,t]);const u=i==="system"?c:i;FLr(()=>{const f=n??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&zLr(f,u),a.current=f},[u,n]);const d=b.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{l(f),s.set(f)}}),[i,u,c,s]);return o.jsx(Sdt.Provider,{value:d,children:e})},BLr=()=>{},yC=()=>{const e=b.useContext(Sdt),t=b.useSyncExternalStore(_dt,kdt,()=>"dark");return b.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:BLr},[e,t])};function ULr(){const e=qE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)",caret:"var(--neutral6)"},styles:[{tag:[ne.className,ne.propertyName],color:"var(--neutral6)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:ne.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=ft.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]}function VLr(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--neutral3)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"},"&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection":{background:"color-mix(in srgb, var(--accent3) 22%, transparent) !important"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}}),t=Pp.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"},{tag:ne.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.heading1,ne.heading2,ne.heading3,ne.heading4,ne.heading5,ne.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[ne.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[ne.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:ne.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ne.url,color:"var(--accent3)"},{tag:ne.monospace,color:"var(--neutral6)"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:[ne.deleted],color:"var(--accent2)"},{tag:ne.invalid,color:"var(--error)"},{tag:[ne.standard(ne.tagName)],color:"var(--accent1)"}]);return[e,Wx(t)]}const wv=()=>{const e=yC().resolvedTheme==="dark";return b.useMemo(()=>e?ULr():VLr(),[e])},Xn=b.forwardRef(({data:e,value:t,onChange:r,showCopyButton:n=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:l,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...h},p)=>{const m=wv(),g=e?JSON.stringify(e,null,2):t??"",y=b.useMemo(()=>{const x=[];return a==="json"?x.push(Gd):a==="markdown"&&(x.push(Que({base:d1,codeLanguages:xZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(OLr),c&&a==="markdown"&&x.push(vLr(c)),f===!1&&x.push(zn.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...h,children:[n&&o.jsx(ra,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(vc,{ref:p,value:g,theme:m,extensions:y,onChange:r,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function qLr(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ke(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-lVi8ohSV.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in n))return null;const{tokens:s}=await r(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function Ja({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return o.jsxs("div",{className:Y("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&o.jsx("div",{className:"mb-4",children:e}),o.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),r&&o.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:r}),n&&o.jsx("div",{className:"mt-5",children:n})]})}const wf=({children:e,className:t,onClick:r})=>o.jsx("div",{tabIndex:r?0:void 0,onKeyDown:n=>{r&&(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),r?.())},className:Y("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",r&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:r,children:e}),Cdt=({children:e,className:t,style:r})=>o.jsx(Ce,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),Sf=({children:e,className:t})=>o.jsx(me,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),Of=({children:e,className:t})=>o.jsx(me,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),kf=({children:e,className:t})=>o.jsx("div",{className:Y("flex-1 w-full",t),children:e});function Zs({resource:e,title:t,description:r,actionSlot:n,className:s}){const a="Permission Denied",i=e?`You don't have permission to access ${e}. Contact your administrator for access.`:"You don't have permission to access this resource. Contact your administrator for access.";return o.jsx(Ja,{className:s,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(R9t,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function aa({title:e,description:t,className:r}){const[n,s]=b.useState(!1),a=We(),i=b.useCallback(async()=>{try{s(!0);const{baseUrl:l="",apiPrefix:c}=a.options||{},u=(c||"/api").trim(),d=(u.startsWith("/")?u:`/${u}`).replace(/\/$/,""),f=new URLSearchParams({redirect_uri:window.location.href}),h=`${l}${d}/auth/sso/login?${f}`,p=await fetch(h,{credentials:"include",headers:{"Content-Type":"application/json"}});if(p.ok){const m=await p.json();window.location.href=m.url}}finally{s(!1)}},[a]);return o.jsx(Ja,{className:r,iconSlot:o.jsx(Ce,{size:"lg",className:"text-neutral3",children:o.jsx(k9t,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(ce,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const jn=({children:e,border:t=!0,className:r})=>o.jsx("header",{className:Y("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},r),children:e}),Qu=({children:e})=>o.jsx(me,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),fu=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),HLr=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),Yb=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:o.jsx("path",{d:"M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",fill:"currentColor"})}),QLr={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},WLr=({className:e,children:t,size:r="default",style:n})=>o.jsx("table",{className:Y("w-full",QLr[r],e),style:n,children:t}),GLr=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Y("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),ZLr=({className:e,children:t,...r})=>o.jsx("th",{className:Y("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...r,children:t}),YLr=({className:e,children:t,...r})=>o.jsx("tbody",{className:Y("",e),...r,children:t}),XLr=b.forwardRef(({className:e,children:t,selected:r=!1,style:n,onClick:s,isActive:a=!1,...i},l)=>{const c=b.useRef(null);b.useEffect(()=>{l&&(typeof l=="function"?l(c.current):l.current=c.current)},[l]),b.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return o.jsx("tr",{className:Y("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-hidden focus:ring-1 focus:ring-inset focus:ring-accent1/50",r&&"bg-surface4",s&&"cursor-pointer",e),style:n,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),KLr=({className:e,children:t,...r})=>o.jsx("td",{className:Y("text-neutral5 first:pl-3 last:pr-3",e),...r,children:o.jsx("div",{className:Y("flex h-full w-full shrink-0 items-center"),children:t})}),JLr=wS(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","min-h-[80px] resize-y"),{variants:{variant:{default:Y(fdt,cme,ume),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:"px-2 py-1.5 text-ui-sm",md:"px-3 py-2 text-ui-sm",default:"px-3 py-2 text-ui-md",lg:"px-4 py-3 text-ui-sm"}},defaultVariants:{variant:"default",size:"default"}}),gc=b.forwardRef(({className:e,size:t,testId:r,variant:n,error:s,...a},i)=>o.jsx("textarea",{className:Y(JLr({variant:n,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:i,"aria-invalid":s,...a}));gc.displayName="Textarea";const e$r=MXt,t$r=DXt,jdt=LXt;function $t({open:e,onOpenChange:t,children:r}){return o.jsx(e$r,{open:e,onOpenChange:t,children:r})}const pme=b.forwardRef(({className:e,...t},r)=>o.jsx(eXe,{ref:r,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));pme.displayName=eXe.displayName;const Tdt=b.forwardRef(({className:e,...t},r)=>o.jsxs(jdt,{children:[o.jsx(pme,{}),o.jsx(tXe,{ref:r,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...t})]}));Tdt.displayName=tXe.displayName;const Ndt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Ndt.displayName="AlertDialogHeader";const Adt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});Adt.displayName="AlertDialogFooter";const Idt=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Idt.displayName="AlertDialogBody";const Rdt=b.forwardRef(({className:e,...t},r)=>o.jsx(sXe,{ref:r,className:Y("text-ui-md font-medium",e),...t}));Rdt.displayName=sXe.displayName;const Pdt=b.forwardRef(({className:e,...t},r)=>o.jsx(aXe,{ref:r,className:Y("text-ui-sm text-neutral3",e),...t}));Pdt.displayName=aXe.displayName;const Mdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rXe,{ref:r,className:Y(mC({variant:"primary",size:"default"}),e),...t}));Mdt.displayName=rXe.displayName;const Ddt=b.forwardRef(({className:e,...t},r)=>o.jsx(nXe,{ref:r,className:Y(mC({variant:"default",size:"default"}),e),...t}));Ddt.displayName=nXe.displayName;$t.Trigger=t$r;$t.Portal=jdt;$t.Overlay=pme;$t.Content=Tdt;$t.Header=Ndt;$t.Footer=Adt;$t.Body=Idt;$t.Title=Rdt;$t.Description=Pdt;$t.Action=Mdt;$t.Cancel=Ddt;const hi=b.forwardRef(({className:e,...t},r)=>o.jsx(ide,{ref:r,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",ln.all,"hover:border-neutral5 hover:shadow-md",F9,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:bg-accent1 data-[state=checked]:border-accent1 data-[state=checked]:text-surface1","data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(cXe,{className:Y("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(cv,{className:"h-3.5 w-3.5 stroke-3"})})}));hi.displayName=ide.displayName;const Cp=HXt,_h=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(lde,{ref:n,className:Y("-outline-offset-2",ln.colors,i0.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));_h.displayName=lde.displayName;const Eh=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(ude,{ref:n,className:Y("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...r,children:t}));Eh.displayName=ude.displayName;const yn={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:Y("min-w-(--anchor-width) w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-(--transform-origin)","transition-[transform,scale,opacity] duration-150 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0"),positioner:"z-50 pointer-events-auto",searchContainer:Y("flex items-center border-b border-border1 px-3 py-2",ln.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",ln.colors),searchInput:Y("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",ln.colors),empty:"not-empty:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:Y("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",ln.colors,"data-highlighted:bg-surface5 data-highlighted:text-neutral5"),itemSelected:"data-selected:bg-accent1Dark data-selected:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:Y("h-4 w-4 text-accent1",ln.opacity),checkbox:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border1",checkboxIcon:"h-3 w-3 text-white",optionContent:"flex items-center gap-2 w-full min-w-0",optionText:"flex flex-col gap-0.5 min-w-0",optionLabel:"truncate",optionDescription:"text-xs text-neutral3 truncate",optionEnd:"ml-auto",error:"text-xs text-accent2"};function Gl({options:e,value:t,onValueChange:r,placeholder:n="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="default",open:d,onOpenChange:f,container:h,error:p}){const m=e.find(y=>y.value===t)??null,g=y=>{y&&r?.(y.value)};return o.jsxs("div",{className:yn.root,children:[o.jsxs(fKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(xKe,{className:Y(mC({variant:c,size:u}),yn.trigger,p&&yn.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(Ser,{placeholder:n})]}),o.jsx(TF,{className:yn.chevron})]}),o.jsx(kKe,{container:h,children:o.jsx(CKe,{align:"start",sideOffset:4,className:yn.positioner,children:o.jsxs(jKe,{className:yn.popup,children:[o.jsxs("div",{className:yn.searchContainer,children:[o.jsx(w_,{className:yn.searchIcon}),o.jsx(bKe,{className:yn.searchInput,placeholder:s})]}),o.jsx(RKe,{className:yn.empty,children:a}),o.jsx(SKe,{className:yn.list,children:y=>o.jsxs(IKe,{value:y,className:Y(yn.item,yn.itemSelected),children:[o.jsx("span",{className:yn.checkContainer,children:o.jsx(ctr,{children:o.jsx(cv,{className:yn.checkIcon})})}),o.jsxs("span",{className:yn.optionContent,children:[y.start,o.jsxs("span",{className:yn.optionText,children:[o.jsx("span",{className:yn.optionLabel,children:y.label}),y.description&&o.jsx("span",{className:yn.optionDescription,children:y.description})]}),y.end?o.jsx("div",{className:yn.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),p&&o.jsx("span",{className:yn.error,children:p})]})}function Ldt({options:e,value:t=[],onValueChange:r,placeholder:n="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="md",open:d,onOpenChange:f,container:h,error:p}){const m=e.filter(x=>t.includes(x.value)),g=x=>{x&&r?.(x.map(w=>w.value))},y=m.length===0?n:`${m.length} selected`;return o.jsxs("div",{className:yn.root,children:[o.jsxs(fKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(xKe,{className:Y(mC({variant:c,size:u}),yn.trigger,p&&yn.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&yn.placeholder),children:y}),o.jsx(TF,{className:yn.chevron})]}),o.jsx(kKe,{container:h,children:o.jsx(CKe,{align:"start",sideOffset:4,className:yn.positioner,children:o.jsxs(jKe,{className:yn.popup,children:[o.jsxs("div",{className:yn.searchContainer,children:[o.jsx(w_,{className:yn.searchIcon}),o.jsx(bKe,{className:yn.searchInput,placeholder:s})]}),o.jsx(RKe,{className:yn.empty,children:a}),o.jsx(SKe,{className:yn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(IKe,{value:x,className:yn.item,children:[o.jsx("span",{className:Y(yn.checkbox,w?yn.checkboxSelected:yn.checkboxUnselected),children:w&&o.jsx(cv,{className:yn.checkboxIcon})}),o.jsxs("span",{className:yn.optionContent,children:[x.start,o.jsxs("span",{className:yn.optionText,children:[o.jsx("span",{className:yn.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:yn.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:yn.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),p&&o.jsx("span",{className:yn.error,children:p})]})}const On=YF,$dt=zYe,r$r=XF,n$r=XR,Fdt=b.forwardRef(({className:e,...t},r)=>o.jsx(ZR,{ref:r,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));Fdt.displayName=ZR.displayName;const vn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(r$r,{children:[o.jsx(Fdt,{}),o.jsxs(YR,{ref:n,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...r,children:[t,o.jsx(XR,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:o.jsx(Wl,{})})})]})]}));vn.displayName=YR.displayName;const kn=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});kn.displayName="DialogHeader";const uf=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});uf.displayName="DialogFooter";const Bn=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Bn.displayName="DialogBody";const bn=b.forwardRef(({className:e,...t},r)=>o.jsx(KF,{ref:r,className:Y("text-ui-md font-medium",e),...t}));bn.displayName=KF.displayName;const qs=b.forwardRef(({className:e,...t},r)=>o.jsx(JF,{ref:r,className:Y("sr-only",e),...t}));qs.displayName=JF.displayName;const zdt=b.forwardRef(({className:e,...t},r)=>o.jsx(rd,{ref:r,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));zdt.displayName=rd.displayName;const s$r=({children:e,title:t="Command Palette",description:r="Search for commands and actions",...n})=>{const s=b.useCallback((i,l)=>{const c=i.toLowerCase();return l.toLowerCase().split(/\s+/).filter(Boolean).every(h=>c.includes(h))?1:0},[]),a=b.useCallback(i=>{i.stopPropagation()},[]);return o.jsx(On,{...n,children:o.jsxs(vn,{className:"overflow-hidden p-0",children:[o.jsx(bn,{className:"sr-only",children:t}),o.jsx(qs,{className:"sr-only",children:r}),o.jsx(zdt,{filter:s,onKeyDown:a,className:Y("**:[[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3","[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2","[&_[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:e})]})})},Bdt=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",ln.colors),"cmdk-input-wrapper":"",children:[o.jsx(w_,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",ln.colors)}),o.jsx(rd.Input,{ref:r,className:Y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",ln.colors,e),...t})]}));Bdt.displayName=rd.Input.displayName;const Udt=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.List,{ref:r,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Udt.displayName=rd.List.displayName;const Vdt=b.forwardRef((e,t)=>o.jsx(rd.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));Vdt.displayName=rd.Empty.displayName;const fb=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Group,{ref:r,className:Y("overflow-hidden p-1 text-neutral5","**:[[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-neutral3",e),...t}));fb.displayName=rd.Group.displayName;const iw=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Separator,{ref:r,className:Y("-mx-1 h-px bg-border1",e),...t}));iw.displayName=rd.Separator.displayName;const Zo=b.forwardRef(({className:e,...t},r)=>o.jsx(rd.Item,{ref:r,className:Y("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",ln.colors,"data-[selected=true]:bg-surface5 data-[selected=true]:text-neutral5","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Zo.displayName=rd.Item.displayName;const qdt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});qdt.displayName="CommandShortcut";function Hdt({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const a$r=inr,i$r=onr,o$r=iP,l$r=unr,c$r=lnr,mme=Y("relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"),Qdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(DJe,{ref:n,className:Y("cursor-pointer",e),...r,children:t}));Qdt.displayName=DJe.displayName;const Wdt=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(VJe,{ref:s,className:Y(mme,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(zce,{className:"-rotate-90 opacity-50"})})]}));Wdt.displayName=VJe.displayName;const Gdt=b.forwardRef(({className:e,...t},r)=>o.jsx(iP,{children:o.jsx(fz,{ref:r,className:Y("bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...t})}));Gdt.displayName=fz.displayName;const Zdt=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(iP,{container:t,children:o.jsx(LJe,{ref:s,sideOffset:r,className:Y("bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...n})}));Zdt.displayName=LJe.displayName;const Ydt=b.forwardRef(({className:e,...t},r)=>o.jsx(FJe,{ref:r,className:Y(mme,e),...t}));Ydt.displayName=FJe.displayName;const Xdt=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(zJe,{ref:s,className:Y(mme,"w-full gap-4 px-2",e),checked:r,...n,children:[o.jsx("div",{className:"border dark:border-white/20 border-black/20 flex h-4 w-4 items-center justify-center rounded-sm",children:r&&o.jsx(cv,{})}),t]}));Xdt.displayName=zJe.displayName;const Kdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(BJe,{ref:n,className:Y("relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(cnr,{children:o.jsx(IHe,{className:"h-2 w-2 fill-current"})})}),t]}));Kdt.displayName=BJe.displayName;const Jdt=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx($Je,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Jdt.displayName=$Je.displayName;const eft=b.forwardRef(({className:e,...t},r)=>o.jsx(UJe,{ref:r,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));eft.displayName=UJe.displayName;const tft=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});tft.displayName="DropdownMenuShortcut";function yt({open:e,onOpenChange:t,children:r,modal:n}){return o.jsx(a$r,{modal:n,open:e,onOpenChange:t,children:r})}yt.Trigger=Qdt;yt.Content=Zdt;yt.Group=i$r;yt.Portal=o$r;yt.Item=Ydt;yt.CheckboxItem=Xdt;yt.RadioItem=Kdt;yt.Label=Jdt;yt.Separator=eft;yt.Shortcut=tft;yt.Sub=l$r;yt.SubContent=Gdt;yt.SubTrigger=Wdt;yt.RadioGroup=c$r;const rL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function _n({className:e,...t}){return o.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:bg-linear-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const rft=({icon:e,title:t,isLoading:r,children:n})=>o.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[o.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?o.jsx(_n,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(me,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&o.jsx("div",{className:"pt-2",children:n})]});function u$r({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",t),children:e})}function d$r({children:e}){return o.jsxs("p",{className:Y("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx($E,{})," ",e]})}function f$r({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function h$r({children:e,name:t,required:r,size:n="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Y("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":n==="bigger"},s),children:[e,r&&o.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function p$r({children:e,className:t,layout:r="vertical",labelColumnWidth:n}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":r==="horizontal"},t),style:r==="horizontal"&&n?{gridTemplateColumns:`${n} 1fr`}:void 0,children:e})}const mo=Object.assign({},{Layout:p$r,Column:u$r,Label:h$r,HelpText:f$r,ErrorMsg:d$r});function m$r({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-6 content-start",t),children:e})}function g$r({children:e,className:t,columns:r=1,gap:n}){return o.jsx("div",{className:Y("grid",{"grid-cols-1":r===1,"grid-cols-2":r===2},n??"gap-6",t),children:e})}Object.assign(g$r,{Column:m$r});const y$r=wS(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(fdt,cme,ume),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${lc.sm} text-ui-sm px-[.75em]`,md:`${lc.md} text-ui-md px-[.75em]`,default:`${lc.default} text-ui-md px-[.85em]`,lg:`${lc.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),ar=b.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Y(y$r({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:l,"aria-invalid":a,...i}));ar.displayName="Input";function Sx({name:e,value:t,label:r,labelIsHidden:n=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:l=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:h="default",testId:p,className:m,...g}){return o.jsxs(mo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:l,size:u||"bigger",children:n?o.jsx(Zu,{children:r}):r})}):null,o.jsxs(mo.Column,{children:[!n&&d==="vertical"?o.jsx(mo.Label,{name:e,required:l,size:u||"default",children:r}):null,o.jsx(ar,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":p,size:h,...g}),a&&o.jsx(mo.HelpText,{children:a}),i&&o.jsx(mo.ErrorMsg,{children:i})]})]})}function Ox({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,value:a,label:i,labelIsHidden:l=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:h,size:p,isMinimized:m,onMinimizedChange:g}){const y=b.useRef(null);return b.useEffect(()=>{m===!1&&y.current?.focus()},[m]),m?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ce,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(w_,{})})}),o.jsx(Gr,{children:i||"Search"})]}):o.jsxs(mo.Layout,{layout:c,className:h,children:[c==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:l?o.jsx(Zu,{children:i}):i})}):null,o.jsxs(mo.Column,{children:[c==="vertical"&&i&&!l?o.jsx(mo.Label,{name:e,required:n,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(ar,{ref:y,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:p,className:Y(p==="sm"&&"pl-8 pr-8",p==="md"&&"pl-9 pr-9",(!p||p==="default")&&"pl-10 pr-10",p==="lg"&&"pl-11 pr-11")}),o.jsx(w_,{"aria-hidden":"true",className:Y("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",p==="sm"&&"w-3.5 h-3.5",p==="md"&&"w-4 h-4",(!p||p==="default")&&"w-[1.125rem] h-[1.125rem]",p==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&o.jsx(ce,{variant:"ghost",size:p||"default","aria-label":"Clear search",onClick:()=>{a&&f(),m===!1&&g?.(!0)},className:"absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(Wl,{})})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const pi=Fnr,mi=znr,ei=b.forwardRef(({className:e,children:t,variant:r="default",size:n="default",...s},a)=>o.jsxs(met,{ref:a,className:Y(mC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(Bnr,{asChild:!0,children:o.jsx(zce,{className:Y("h-4 w-4 text-neutral3",ln.colors)})})]}));ei.displayName=met.displayName;const ti=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(Unr,{children:o.jsx(get,{ref:s,className:Y("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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",r==="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:r,...n,children:o.jsx(Vnr,{className:Y("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ti.displayName=get.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(yet,{ref:n,className:Y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",ln.colors,"hover:bg-surface5 hover:text-neutral5","focus:bg-surface5 focus:text-neutral5","data-[state=checked]:bg-accent1Dark data-[state=checked]:text-accent1","data-disabled:pointer-events-none data-disabled:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Hnr,{children:o.jsx(cv,{className:"h-4 w-4 text-accent1"})})}),o.jsx(qnr,{children:t})]}));ss.displayName=yet.displayName;function $o({name:e,helpText:t,errorMsg:r,required:n=!1,disabled:s=!1,size:a="default",value:i,label:l,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:h="Select an option",onValueChange:p,className:m}){return o.jsxs(mo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(mo.Column,{children:o.jsx(mo.Label,{name:e,required:n,children:c?o.jsx(Zu,{children:l}):l})}):null,o.jsxs(mo.Column,{children:[u==="vertical"&&l&&!c?o.jsx(mo.Label,{name:e,required:n,children:l}):null,o.jsxs(pi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(ei,{size:a,children:o.jsx(mi,{placeholder:h})}),o.jsx(ti,{children:f.map(g=>o.jsx(ss,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const v$r=wS("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(bet,{ref:r,className:Y(v$r(),e),...t}));xt.displayName=bet.displayName;function K_({children:e}){const t=e.replace(/\\n/g,`
294
294
  `);return o.jsx(Qet,{remarkPlugins:[gtt],components:x$r,className:"space-y-3",children:t})}const nft=je.memo(({children:e,language:t,...r})=>{const[n,s]=b.useState([]);return b.useEffect(()=>{qLr(e,t).then(a=>{a&&s(a)})},[e,t]),n.length?o.jsx("pre",{...r,children:o.jsx("code",{children:n.map((a,i)=>o.jsxs(o.Fragment,{children:[o.jsx("span",{children:a.map((l,c)=>{const u=typeof l.htmlStyle=="string"?void 0:l.htmlStyle;return o.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:u,children:l.content},c)})},i),i!==n.length-1&&`
295
295
  `]}))})}):o.jsx("pre",{...r,children:e})});nft.displayName="HighlightedCode";const b$r=({children:e,className:t,language:r,...n})=>{const s=typeof e=="string"?e:hie(e),a=Y("overflow-x-scroll rounded-md border bg-surface1/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return o.jsxs("div",{className:"group/code relative mb-4",children:[o.jsx(b.Suspense,{fallback:o.jsx("pre",{className:a,...n,children:e}),children:o.jsx(nft,{language:r,className:a,children:s})}),o.jsx("div",{className:"invisible absolute right-2 top-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100",children:o.jsx(ra,{content:s,copyMessage:"Copied code to clipboard"})})]})};function hie(e){if(typeof e=="string")return e;if(e?.props?.children){let t=e.props.children;return Array.isArray(t)?t.map(r=>hie(r)).join(""):hie(t)}return""}const x$r={h1:({children:e,...t})=>o.jsx("h1",{className:"text-2xl font-semibold",...t,children:e}),h2:({children:e,...t})=>o.jsx("h2",{className:"font-semibold text-xl",...t,children:e}),h3:({children:e,...t})=>o.jsx("h3",{className:"font-semibold text-lg",...t,children:e}),h4:({children:e,...t})=>o.jsx("h4",{className:"font-semibold text-base",...t,children:e}),h5:({children:e,...t})=>o.jsx("h5",{className:"font-medium",...t,children:e}),strong:({children:e,...t})=>o.jsx("strong",{className:"font-semibold",...t,children:e}),a:({children:e,...t})=>o.jsx("a",{className:"underline underline-offset-2",...t,children:e}),blockquote:({children:e,...t})=>o.jsx("blockquote",{className:"border-l-2 border-neutral6 pl-4",...t,children:e}),code:({children:e,className:t,...r})=>{const n=/language-(\w+)/.exec(t||"");return n?o.jsx(b$r,{className:t,language:n[1],...r,children:e}):o.jsx("code",{className:Y("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-surface1/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...r,children:e})},pre:({children:e})=>e,ol:({children:e,...t})=>o.jsx("ol",{className:"list-decimal space-y-2 pl-6",...t,children:e}),ul:({children:e,...t})=>o.jsx("ul",{className:"list-disc space-y-2 pl-6",...t,children:e}),li:({children:e,...t})=>o.jsx("li",{className:"my-1.5",...t,children:e}),table:({children:e,...t})=>o.jsx("table",{className:"w-full border-collapse overflow-y-auto rounded-md border border-neutral6/20",...t,children:e}),th:({children:e,...t})=>o.jsx("th",{className:"border border-neutral6/20 px-4 py-2 text-left font-bold [[align=center]]:text-center [[align=right]]:text-right",...t,children:e}),td:({children:e,...t})=>o.jsx("td",{className:"border border-neutral6/20 px-4 py-2 text-left [[align=center]]:text-center [[align=right]]:text-right",...t,children:e}),tr:({children:e,...t})=>o.jsx("tr",{className:"m-0 border-t p-0 even:bg-surface4",...t,children:e}),p:({children:e,...t})=>o.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",...t,children:e}),hr:({...e})=>o.jsx("hr",{className:"border-neutral6/20",...e})};function w$r({children:e,className:t}){return o.jsx("div",{className:Y("overflow-x-auto ",t),children:e})}function sft({children:e,className:t}){return o.jsx("p",{className:Y("text-ui-md text-neutral2 leading-tight mt-0.5",t),children:e})}function S$r({message:e="Failed to load data",className:t}){return o.jsx("div",{className:Y("flex flex-col gap-3 items-center justify-center",t),children:o.jsx("p",{className:"text-ui-sm text-accent2",children:e})})}const O$r={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Dt({color:e,className:t,size:r="md"}){return o.jsx("svg",{className:Y("animate-spin",O$r[r],t),style:{animationDuration:"800ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}function k$r({className:e}){return o.jsx("div",{className:Y("flex items-center justify-center",e),children:o.jsx(Dt,{size:"md",color:ky.neutral1})})}function _$r({message:e="No data yet",className:t}){return o.jsx("div",{className:Y("flex items-center justify-center h-full",t),children:o.jsx("p",{className:"text-neutral1 text-sm",children:e})})}function aRe({children:e,className:t}){return o.jsx(Hdt,{className:Y("flex-1 grid grid-rows-[4rem_1fr] min-h-72 gap-2 min-w-80 md:min-w-[22rem] lg:min-w-[24rem] xl:min-w-[26rem] 2xl:min-w-[30rem]",t),children:e})}function E$r({value:e,label:t,className:r}){return o.jsxs("div",{className:Y("grid justify-end content-start text-right gap-1",r),children:[o.jsx("span",{className:"text-ui-lg font-semibold text-neutral4 leading-none",children:e}),t&&o.jsx("span",{className:"text-ui-md text-neutral2",children:t})]})}function aft({children:e,className:t,as:r="h2"}){return o.jsx(r,{className:Y("text-ui-md font-normal text-neutral4",t),children:e})}function C$r(e){if("children"in e)return o.jsx("div",{className:e.className,children:e.children});const{title:t,description:r,titleAs:n}=e;return o.jsxs("div",{className:e.className,children:[o.jsx(aft,{as:n,children:t}),r&&o.jsx(sft,{children:r})]})}function j$r({children:e,className:t}){return o.jsx("div",{className:Y("grid grid-cols-[1fr_auto] gap-4",t),children:e})}function T$r({changePct:e,prevValue:t,lowerIsBetter:r,className:n}){const s=r?e<0:e>=0;return o.jsxs("div",{className:Y("flex items-center gap-1 text-sm text-neutral1 flex-wrap",n),children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Y("[&>svg]:w-4 [&>svg]:h-4",s?"text-green-600":"text-red-600"),children:e>=0?o.jsx(V9t,{}):o.jsx(B9t,{})}),o.jsx("span",{className:Y(s?"text-green-600":"text-red-600"),children:`${e>=0?"+":"-"}${Math.abs(e).toFixed(1)}%`})]}),t&&o.jsxs("div",{children:["vs previous ",o.jsx("b",{className:"text-neutral2 font-semibold",children:t})]})]})}function N$r({message:e="Failed to load data",className:t}){return o.jsx("span",{className:Y("text-ui-sm text-accent2",t),children:e})}function A$r({children:e,className:t}){return o.jsx("span",{className:Y("text-ui-md text-neutral3 leading-relaxed",t),children:e})}function I$r({className:e}){return o.jsx("span",{className:Y("text-sm",e),children:o.jsx(Dt,{size:"md",color:ky.neutral1})})}function R$r({message:e="No previous value to compare",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function P$r({message:e="No data yet",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function M$r({children:e,className:t}){return o.jsx(Hdt,{className:Y("flex-1 min-w-60",t),children:o.jsx("div",{className:"grid gap-1",children:e})})}function D$r({children:e,className:t}){return o.jsx("strong",{className:Y("text-header-lg text-neutral4 font-semibold",t),children:e})}const Cn=Object.assign(M$r,{Label:A$r,Value:D$r,Change:T$r,NoChange:R$r,NoData:P$r,Error:N$r,Loading:I$r}),Wt=Object.assign(aRe,{Root:aRe,Kpi:Cn,TopBar:j$r,TitleAndDescription:C$r,Title:aft,Description:sft,Summary:E$r,Loading:k$r,Error:S$r,Content:w$r,NoData:_$r});function pie({children:e,className:t}){return o.jsx("div",{className:Y("flex flex-wrap gap-8",t),children:e})}const _f=Mcr,id=Dcr,hu=b.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(Lcr,{children:o.jsx(Ctt,{ref:s,align:t,sideOffset:r,className:Y("z-50 w-72 rounded-xl border-2 border-border1/50 bg-surface3 text-neutral5 shadow-md focus-visible:outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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",e&&/\bp[trblxy]?-\S+/.test(e)?!1:"py-3.5 px-3",e),...n})}));hu.displayName=Ctt.displayName;function ift({children:e,...t}){const[r,n]=b.useState(!1),s=b.useRef(void 0),a=b.useCallback(()=>{clearTimeout(s.current),n(!0)},[]),i=b.useCallback(()=>{s.current=setTimeout(()=>n(!1),150)},[]);return b.useEffect(()=>()=>clearTimeout(s.current),[]),o.jsx(_f,{open:r,onOpenChange:n,...t,children:o.jsx("span",{onMouseEnter:a,onMouseLeave:i,onFocusCapture:a,onBlurCapture:i,style:{display:"contents"},children:e})})}function oft({disabled:e,onClear:t,onRemoveAll:r,onSave:n,onRemoveSaved:s}){const a=!!(r||n||s),i=!!t;return!i&&!a?null:o.jsxs("div",{className:"flex items-center gap-2",children:[i&&o.jsxs(ce,{disabled:e,size:"md",onClick:()=>t(),children:[o.jsx(Wl,{}),"Clear"]}),a&&o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{disabled:e,size:"md","aria-label":"More filter actions",children:o.jsx(Qzt,{})})}),o.jsxs(yt.Content,{align:"end",children:[r&&o.jsxs(yt.Item,{onSelect:()=>r(),children:[o.jsx(Wl,{}),"Remove all filters"]}),r&&(n||s)&&o.jsx(yt.Separator,{}),n&&o.jsxs(yt.Item,{onSelect:()=>n(),children:[o.jsx(MHe,{}),"Save filters for next time"]}),s&&o.jsxs(yt.Item,{onSelect:()=>s(),children:[o.jsx(DHe,{}),"Remove saved filters"]})]})]})]})}const vC=b.forwardRef(({className:e,...t},r)=>o.jsx(ztt,{className:Y("grid gap-2",e),...t,ref:r}));vC.displayName=ztt.displayName;const Xc=b.forwardRef(({className:e,...t},r)=>o.jsx(Btt,{ref:r,className:Y("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",ln.all,"hover:border-neutral5 hover:shadow-md",F9,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:border-accent1 data-[state=checked]:shadow-glow-accent1",e),...t,children:o.jsx(Wcr,{className:Y("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(IHe,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));Xc.displayName=Btt.displayName;function lft({field:e,tokens:t,onChange:r}){const[n,s]=b.useState(""),a=b.useMemo(()=>{const u=n.trim().toLowerCase();return u?e.options.filter(d=>d.label.toLowerCase().includes(u)):e.options},[e.options,n]),i=b.useMemo(()=>t.find(u=>u.fieldId===e.id),[t,e.id]),l=typeof i?.value=="string"?i.value:void 0,c=b.useMemo(()=>Array.isArray(i?.value)?i.value:typeof i?.value=="string"?[i.value]:[],[i]);return o.jsxs(o.Fragment,{children:[e.searchable!==!1&&o.jsx(ar,{size:"sm",value:n,onChange:u=>s(u.target.value),placeholder:`Search ${e.label.toLowerCase()}...`,className:"mb-2",onKeyDown:u=>{if(u.key!=="ArrowDown")return;const f=u.currentTarget.closest("[data-pick-multi-panel]")?.querySelector("[data-pick-multi-item]:not([disabled])");f&&(u.preventDefault(),u.stopPropagation(),f.focus())}}),e.isLoading?o.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 text-ui-sm text-neutral3",children:[o.jsx(Dt,{size:"sm",className:"w-3 h-3",color:"var(--neutral3)"}),"Loading options…"]}):a.length===0?o.jsx("div",{className:"px-2 py-1.5 text-ui-sm text-neutral3",children:e.emptyText??"No option found."}):e.multi?o.jsx("div",{className:"max-h-[80dvh] overflow-auto",children:a.map(u=>{const d=c.includes(u.value);return o.jsxs("label",{title:u.label,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(hi,{"data-pick-multi-item":"",checked:d,onCheckedChange:f=>{const p=f===!0?c.includes(u.value)?c:[...c,u.value]:c.filter(m=>m!==u.value);r(e.id,p)},className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)})}):o.jsxs(vC,{value:l??"",onValueChange:u=>r(e.id,u),className:"max-h-[80dvh] gap-0 overflow-auto",children:[a.map(u=>o.jsxs("label",{title:u.label,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(Xc,{"data-pick-multi-item":"",value:u.value,className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)),o.jsxs("label",{title:"Any",className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 cursor-pointer focus-within:bg-surface4 focus-within:text-neutral6 min-w-0",children:[o.jsx(Xc,{"data-pick-multi-item":"",value:"Any",className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:"Any"})]})]})]})}function cft(e){return Array.isArray(e)?e.length===0?"Any":e.join(", "):e}const gme="inline-flex",uft=`${lc.md} border-y-2 border-border1 px-[.75em] text-neutral3 whitespace-nowrap flex items-center`,yme=`${uft} text-ui-md rounded-l-lg border-l-2 border-r-1`,vme=`${uft} text-ui-md `,bme="rounded-tl-none rounded-bl-none border-l-transparent",L$r="rounded-none",$$r="rounded-none";function F$r({field:e,value:t,onChange:r,onRemove:n,disabled:s,autoFocus:a}){const[i,l]=b.useState(t),c=b.useRef(null);return b.useEffect(()=>{i.trim()!==t&&l(t)},[t]),b.useEffect(()=>{a&&c.current?.focus()},[a]),o.jsxs("div",{className:gme,children:[o.jsx("span",{className:yme,children:e.label}),o.jsx("span",{className:vme,children:"is"}),o.jsx(ar,{ref:c,size:"md",disabled:s,value:i,placeholder:e.placeholder??`Enter ${e.label}`,className:L$r,onChange:u=>{const d=u.target.value;l(d),d.trim()!==t&&r(d)},onKeyDown:u=>{if(u.key==="Enter"){u.preventDefault();const d=i.trim();d!==t&&r(d)}else u.key==="Escape"&&(u.preventDefault(),l(t),u.target.blur())}}),o.jsx(ce,{type:"button",disabled:s,"aria-label":`Remove ${e.label} filter`,className:bme,size:"md",onMouseDown:u=>u.preventDefault(),onClick:n,children:o.jsx(Wl,{})})]})}function z$r({field:e,token:t,tokens:r,onChange:n,onRemove:s,disabled:a}){const[i,l]=b.useState(!1);return o.jsxs("div",{className:gme,children:[o.jsx("span",{className:yme,children:e.label}),o.jsx("span",{className:vme,children:"is"}),o.jsxs(_f,{open:i,onOpenChange:l,children:[o.jsx(id,{asChild:!0,children:o.jsx(ce,{type:"button",disabled:a,size:"md",className:$$r,children:cft(t.value)})}),o.jsx(hu,{align:"start",sideOffset:8,className:"w-64 p-2","data-pick-multi-panel":!0,children:o.jsx(lft,{field:e,tokens:r,onChange:n})})]}),o.jsx(ce,{type:"button",disabled:a,"aria-label":`Remove ${e.label} filter`,className:bme,size:"md",onClick:s,children:o.jsx(Wl,{})})]})}function dft({fields:e,tokens:t,onTokensChange:r,disabled:n,autoFocusFieldId:s}){if(t.length===0)return null;const a=(l,c)=>{const u=[...t];u[l]=c,r(u)},i=l=>{r(t.filter((c,u)=>u!==l))};return o.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:t.map((l,c)=>{const u=e.find(d=>d.id===l.fieldId);return u?u.kind==="text"&&typeof l.value=="string"?o.jsx(F$r,{field:u,value:l.value,disabled:n,autoFocus:s===l.fieldId,onChange:d=>a(c,{fieldId:l.fieldId,value:d}),onRemove:()=>i(c)},`${l.fieldId}-${c}`):u.kind==="pick-multi"?o.jsx(z$r,{field:u,token:l,tokens:t,disabled:n,onChange:(d,f)=>{if(f===void 0){i(c);return}a(c,{fieldId:d,value:f})},onRemove:()=>i(c)},`${l.fieldId}-${c}`):o.jsxs("div",{className:gme,children:[o.jsx("span",{className:yme,children:u.label}),o.jsx("span",{className:vme,children:"is"}),o.jsx("span",{className:"px-2.5 py-1.5 max-w-[20rem] truncate",children:cft(l.value)}),o.jsx(ce,{type:"button",disabled:n,size:"md","aria-label":`Remove ${u.label} filter`,className:bme,onClick:()=>i(c),children:o.jsx(Wl,{})})]},`${l.fieldId}-${c}`):null})})}function fft({fields:e,tokens:t,onTokensChange:r,label:n="Add Filter",disabled:s,size:a,onStartTextFilter:i}){const[l,c]=b.useState(!1),[u,d]=b.useState(),[f,h]=b.useState(""),[p,m]=b.useState([]),[g,y]=b.useState(),[x,w]=b.useState(),S=b.useRef(null),k=b.useRef(!1),_=b.useCallback(R=>{w(B=>B===R?void 0:R)},[]),E=b.useCallback(()=>w(void 0),[]);b.useEffect(()=>{l||w(void 0)},[l]);const T=b.useMemo(()=>e.find(R=>R.id===u),[e,u]),j=b.useMemo(()=>{const R=new Set;for(const B of t){const D=e.find($=>$.id===B.fieldId);D&&D.kind!=="pick-multi"&&R.add(B.fieldId)}return R},[t,e]),N=b.useCallback(()=>{d(void 0),h(""),m([]),y(void 0)},[]);b.useEffect(()=>{l||N()},[l,N]),b.useEffect(()=>{l&&T?.kind==="text"&&S.current?.focus()},[l,T]);const I=b.useCallback((R,B)=>{const D=t.findIndex(z=>z.fieldId===R);if(B===void 0||Array.isArray(B)&&B.length===0){if(D===-1)return;r(t.filter((z,H)=>H!==D));return}if(D===-1){r([...t,{fieldId:R,value:B}]);return}const U=[...t];U[D]={fieldId:R,value:B},r(U)},[r,t]),P=b.useCallback(()=>{if(!T){y("Choose a property first.");return}if(j.has(T.id)){y(`Remove the existing ${T.label} filter before adding another.`);return}if(T.kind==="text"&&!f.trim()){y(`Enter a value for ${T.label}.`);return}if(T.kind==="multi-select"&&p.length===0){y(`Choose at least one ${T.label.toLowerCase()} value.`);return}const R=T.kind==="multi-select"?{fieldId:T.id,value:p}:{fieldId:T.id,value:f.trim()};r([...t,R]),c(!1)},[p,r,T,j,f,t]);return o.jsxs(_f,{open:l,onOpenChange:c,children:[o.jsx(id,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:a,disabled:s,children:[o.jsx(b9t,{}),n]})}),o.jsx(hu,{align:"end",className:"p-3 w-64",onOpenAutoFocus:R=>R.preventDefault(),onCloseAutoFocus:R=>{k.current&&(k.current=!1,R.preventDefault())},children:o.jsxs("div",{className:"grid gap-3",children:[T&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button","aria-label":"Back to properties",className:"text-neutral3 hover:text-neutral6 transition-colors",onClick:()=>{d(void 0),h(""),m([]),y(void 0)},children:o.jsx(LE,{className:"h-4 w-4"})}),o.jsx(l9t,{className:"h-4 w-4 shrink-0 text-neutral3"}),o.jsx("span",{className:"text-ui-sm text-neutral3",children:`${T.label} · is`})]}),!T&&o.jsx("div",{role:"menu",className:"max-h-[80dvh] overflow-auto",onKeyDown:R=>{if(R.key!=="ArrowDown"&&R.key!=="ArrowUp"&&R.key!=="Home"&&R.key!=="End")return;const B=Array.from(R.currentTarget.querySelectorAll("[data-filter-item]:not([disabled])"));if(B.length===0)return;R.preventDefault();const D=document.activeElement,$=B.findIndex(z=>z===D);let U;R.key==="Home"?U=0:R.key==="End"?U=B.length-1:R.key==="ArrowDown"?U=$<0?0:($+1)%B.length:U=$<=0?B.length-1:$-1,B[U]?.focus()},children:e.length>0?e.map(R=>{const B=j.has(R.id);return R.kind==="pick-multi"?o.jsx(B$r,{field:R,tokens:t,onChange:I,open:x===R.id,onToggle:_,onClose:E},R.id):o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Y("group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-ui-md transition-colors","focus:bg-surface4 focus:text-neutral6 focus:outline-none",B?"cursor-not-allowed text-neutral2 opacity-70":"text-neutral4 hover:bg-surface4 hover:text-neutral6"),disabled:B,onClick:()=>{if(y(void 0),R.kind==="text"){r([...t,{fieldId:R.id,value:""}]),i?.(R.id),k.current=!0,c(!1);return}d(R.id)},children:[o.jsx("span",{className:"truncate",children:R.label}),B?o.jsx("span",{className:"ml-auto text-neutral3",children:"In use"}):o.jsx(Hce,{className:"ml-auto h-4 w-4 text-neutral3 opacity-0 transition-opacity group-hover:opacity-100 group-focus:opacity-100"})]},R.id)}):o.jsx("div",{className:"px-2 py-1.5 text-ui-sm text-neutral3",children:"No matching property."})}),T&&T.kind==="text"&&o.jsx(ar,{ref:S,size:"md",value:f,onChange:R=>{h(R.target.value),y(void 0)},placeholder:T.placeholder??`Enter ${T.label}`,onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),P())}}),T&&T.kind==="multi-select"&&o.jsx(Ldt,{options:T.options??[],value:p,onValueChange:R=>{m(R),y(void 0)},placeholder:T.placeholder??`Choose ${T.label}`,searchPlaceholder:`Search ${T.label.toLowerCase()}...`,emptyText:T.emptyText??"No option found.",size:"md"}),g&&o.jsx("div",{className:"text-ui-sm text-red-500",children:g}),T&&T.kind!=="pick-multi"&&o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx(ce,{variant:"ghost",size:"md",onClick:()=>c(!1),children:"Cancel"}),o.jsx(ce,{variant:"outline",size:"md",onClick:P,children:"Add filter"})]})]})})]})}function B$r({field:e,tokens:t,onChange:r,open:n,onToggle:s,onClose:a}){const i=b.useRef(null);return o.jsxs(_f,{open:n,onOpenChange:l=>{l?s(e.id):a()},children:[o.jsx(id,{asChild:!0,children:o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Y("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 transition-colors","focus:bg-surface4 focus:text-neutral6 focus:outline-none"),onKeyDown:l=>{l.key!=="ArrowRight"&&l.key!=="ArrowLeft"||(n||s(e.id),l.preventDefault(),requestAnimationFrame(()=>{i.current?.querySelector('input, button, [tabindex]:not([tabindex="-1"])')?.focus()}))},children:[n&&o.jsx(Bce,{className:"h-4 w-4 text-neutral3 shrink-0"}),o.jsx("span",{className:"truncate",children:e.label}),!n&&o.jsx(x_,{className:"h-4 w-4 ml-auto text-neutral3 shrink-0"})]})}),o.jsx(hu,{ref:i,side:"right",align:"start",sideOffset:8,className:"w-64 p-2",onOpenAutoFocus:l=>l.preventDefault(),onKeyDown:l=>{if(l.key!=="ArrowDown"&&l.key!=="ArrowUp"&&l.key!=="Home"&&l.key!=="End")return;const c=Array.from(l.currentTarget.querySelectorAll("[data-pick-multi-item]:not([disabled])"));if(c.length===0)return;l.preventDefault(),l.stopPropagation();const u=document.activeElement,d=c.findIndex(h=>h===u);let f;l.key==="Home"?f=0:l.key==="End"?f=c.length-1:l.key==="ArrowDown"?f=d<0?0:(d+1)%c.length:f=d<=0?c.length-1:d-1,c[f]?.focus()},"data-pick-multi-panel":!0,children:o.jsx(lft,{field:e,tokens:t,onChange:r})})]})}const hft=(e,{enabled:t=!0})=>{const r=b.useRef(t);je.useEffect(()=>{if(!t||!e?.current)return;const n=e.current,s=new MutationObserver(()=>{r.current&&n.scrollTo({top:n.scrollHeight,behavior:"smooth"})});s.observe(n,{childList:!0,subtree:!0,characterData:!0});const a=i=>{const l=i.target,c=l.scrollTop+l.clientHeight,u=l.scrollHeight;c>=u-1?r.current=!0:r.current=!1};return n.addEventListener("scroll",a),()=>{n.removeEventListener("scroll",a),s.disconnect()}},[t,e])},Ms=b.forwardRef(({className:e,children:t,viewPortClassName:r,maxHeight:n,autoScroll:s=!1,orientation:a="vertical",...i},l)=>{const c=b.useRef(null);return hft(c,{enabled:s}),o.jsxs(ert,{ref:l,className:Y("relative overflow-hidden",e),...i,children:[o.jsx(aur,{ref:c,className:Y("h-full w-full rounded-[inherit] [&>div]:block!",r),style:n?{maxHeight:n}:void 0,children:t}),(a==="vertical"||a==="both")&&o.jsx(mie,{orientation:"vertical"}),(a==="horizontal"||a==="both")&&o.jsx(mie,{orientation:"horizontal"}),a==="both"&&o.jsx(iur,{})]})});Ms.displayName=ert.displayName;const mie=b.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(efe,{ref:n,orientation:t,className:Y("flex touch-none select-none transition-all duration-normal ease-out-custom","opacity-0 hover:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...r,children:o.jsx(Ztt,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));mie.displayName=efe.displayName;const iRe={sm:lc.sm,md:lc.md,lg:lc.lg,default:lc.default},km=({onSearch:e,label:t,placeholder:r,debounceMs:n=300,size:s="md"})=>{const a=b.useId(),i=b.useRef(null),l=dS(u=>{e(u)},n);b.useEffect(()=>()=>{l.cancel()},[l]),b.useEffect(()=>{const u=i.current;if(!u)return;const d=f=>{f.key.toLowerCase()==="f"&&f.shiftKey&&(f.ctrlKey||f.metaKey)&&(f.preventDefault(),u.focus())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]);const c=u=>{l(u.target.value)};return o.jsxs("div",{className:Y("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",oLr,iLr,ln.all,"hover:border-neutral2",iRe[s]),children:[o.jsx(w_,{className:Y("text-neutral3 h-4 w-4",ln.colors)}),o.jsxs("div",{className:"flex-1",children:[o.jsx("label",{htmlFor:a,className:"sr-only",children:t}),o.jsx("input",{id:a,type:"text",placeholder:r,className:Y("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-hidden",iRe[s]),name:a,ref:i,onChange:c})]})]})},U$r=({children:e})=>o.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e}),M4=b.forwardRef(({className:e,...t},r)=>o.jsxs(grt,{ref:r,className:Y("relative flex w-full touch-none select-none items-center group",e),...t,children:[o.jsx(kur,{className:Y("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",ln.colors),children:o.jsx(_ur,{className:Y("absolute h-full bg-accent1",ln.all)})}),o.jsx(Eur,{className:Y("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",F9,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));M4.displayName=grt.displayName;const bc=b.forwardRef(({className:e,...t},r)=>o.jsx(Srt,{className:Y("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent",ln.all,F9,"hover:brightness-110","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:brightness-100","data-[state=checked]:bg-accent1 data-[state=checked]:shadow-glow-accent1","data-[state=unchecked]:bg-neutral2",e),...t,ref:r,children:o.jsx(Aur,{className:Y("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-md","transition-all duration-normal ease-out-custom","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0","data-[state=checked]:shadow-lg")})}));bc.displayName=Srt.displayName;function V$r({children:e,untilChar:t,charCount:r,copy:n,withTooltip:s=!0,className:a,as:i="span",...l}){const c=e;let u=c,d=!1;if(t!==void 0){const h=c.indexOf(t);h!==-1&&(u=c.slice(0,h),d=!0)}else r!==void 0&&c.length>r&&(u=c.slice(0,r),d=!0);if(!d)return o.jsx(me,{as:i,className:a,...l,children:c});const f=o.jsxs(me,{as:"span",className:"cursor-default",variant:l.variant,font:l.font,children:[u,"..."]});return o.jsxs(me,{as:i,className:Y("group inline-flex items-center gap-1",a),...l,children:[s?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:f}),o.jsx(Gr,{children:c})]}):f,n&&o.jsx(ra,{content:c,className:"opacity-0 group-hover:opacity-100 transition-opacity"})]})}function ps({children:e,className:t,spacing:r="default"}){return o.jsx("div",{className:Y("flex gap-2 items-center ",{"gap-[2px] [&>*:not(:last-child)]:rounded-r-none [&>*:not(:first-child)]:rounded-l-none":r==="close"},t),children:e})}function zr({children:e,className:t,style:r}){const n=pft("MainContentLayout");return o.jsx("main",{className:Y("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...r,...n?{border:"3px dotted red"}:{}},children:e})}function df({children:e,className:t,isCentered:r=!1,isDivided:n=!1,hasLeftServiceColumn:s=!1,style:a}){const i=pft("MainContentContent"),l=xme({isCentered:r,isDivided:n,hasLeftServiceColumn:s,className:t});return o.jsx("div",{className:l,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const xme=({isCentered:e,isDivided:t,hasLeftServiceColumn:r,className:n})=>Y("grid overflow-y-auto h-full ","overflow-x-auto min-w-min",{"items-start content-start":!e&&!t&&!r,"grid place-items-center":e,"grid-cols-[1fr_1fr]":t&&!r,"grid-cols-[12rem_1fr_1fr]":t&&r,"grid-cols-[auto_1fr]":!t&&r},n);function pft(e){try{const t=localStorage.getItem("add-dev-style-to-components");return t?t.split(",").map(n=>n.trim()).filter(Boolean).includes(e):!1}catch(t){return console.error("Error reading or parsing localStorage:",t),!1}}function q$r({children:e,className:t}){return o.jsx("div",{className:Y("grid content-start",t),children:e})}function H$r({children:e,isLoading:t}){return o.jsx("p",{className:Y("text-neutral3 text-sm max-w-[35rem] flex flex-wrap gap-x-4 gap-y-1 mt-1 first-of-type:mt-3 ml-1",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":t}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function Q$r({children:e,title:t,description:r,icon:n,className:s,withMargins:a=!0}){const i=t==="loading",l=r==="loading";return e?o.jsx("header",{className:Y("grid grid-cols-[1fr_auto] gap-16 w-full ",{"mt-[6vh] mb-[4vh]":a},s),children:e}):o.jsxs("header",{className:Y("grid gap-2 pt-8 pb-8 ",s),children:[o.jsx("h1",{className:Y("text-neutral6 text-xl font-normal flex items-center gap-2","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:text-neutral3",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":i}),children:i?o.jsx(o.Fragment,{children:" "}):o.jsxs(o.Fragment,{children:[n&&n," ",t]})}),r&&o.jsx("p",{className:Y("text-neutral4 text-sm m-0",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":l}),children:l?o.jsx(o.Fragment,{children:" "}):r})]})}function W$r({children:e,isLoading:t,size:r="default"}){return o.jsx("h1",{className:Y("text-neutral5 text-xl font-normal gap-2 flex items-center","[&>svg]:w-[1.25em] [&>svg]:h-[1.25em] [&>svg]:opacity-50",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":t,"text-md":r==="smaller"}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}const Ir=Object.assign(Q$r,{Title:W$r,Description:H$r,Column:q$r});function kx({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-12",t),children:e})}const mft=({className:e,children:t})=>o.jsx("div",{className:Y("flex items-center text-ui-sm border border-border1 rounded-lg overflow-hidden","[&>button]:border-0 [&>button:not(:first-child)]:border-l [&>button:not(:first-child)]:border-border1","[&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg",e),children:t});function D4({className:e,classNames:t,showOutsideDays:r=!0,...n}){return o.jsx(hpr,{showOutsideDays:r,className:Y("p-3",e),classNames:{months:"flex flex-col space-y-4 sm:space-y-0 ",month:"space-y-4 text-ui-sm ",caption:"flex justify-between pt-1 items-center pl-2",caption_label:"text-text font-medium ",nav:"flex items-center",nav_button_previous:Y("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:Y("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),dropdown_month:"w-full border-collapse space-y-1",weeknumber:"flex",day:Y("relative p-0 text-center focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-surface5 [&:has([aria-selected].day-outside)]:bg-surface5/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md","h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start rounded-l-md",day_range_end:"day-range-end rounded-r-md",day_selected:Y("bg-accent1! text-white! hover:bg-accent1/80! focus:bg-accent1/80! focus:text-white!",n.mode!=="range"&&"rounded-md"),day_today:"bg-neutral6/10 text-neutral5",day_outside:"day-outside text-neutral3 opacity-50 aria-selected:bg-surface5/50 aria-selected:text-neutral3 aria-selected:opacity-30",day_disabled:"text-neutral3 opacity-50",day_range_middle:"aria-selected:bg-surface5 aria-selected:text-neutral5",day_hidden:"invisible",head_cell:"text-ui-xs text-neutral3",...t},...n})}const sQ=["12","1","2","3","4","5","6","7","8","9","10","11"],nL=["00","15","30","45","59"],sL=["AM","PM"];function gie({defaultValue:e,onValueChange:t,className:r}){const[n,s]=b.useState("12"),[a,i]=b.useState("00"),[l,c]=b.useState("AM");b.useEffect(()=>{if(e){const h=/^(\d{1,2}):(\d{2})(?::\d{2})?\s*(AM|PM|am|pm)?$/,p=e.match(h);if(p){let m=parseInt(p[1],10);const g=parseInt(p[2],10),y=p[3]?.toUpperCase();m>=1&&m<=12&&g>=0&&g<=59&&(s(m.toString()),i(g===0?"00":g.toString()),c(y||"AM"))}}},[e]);const u=h=>{s(h),t(`${sQ[+h]}:${a} ${l}`.trim())},d=h=>{i(nL[+h]),t(`${n}:${nL[+h]} ${l}`.trim())},f=h=>{c(sL[+h]),t(`${n}:${a} ${sL[+h]}`.trim())};return o.jsxs("div",{className:Y("flex gap-2 items-center",r),children:[o.jsxs(pi,{name:"hour",value:sQ.indexOf(n).toString(),onValueChange:u,children:[o.jsx(ei,{size:"sm",children:o.jsx(mi,{placeholder:"Select..."})}),o.jsx(ti,{children:sQ.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),":",o.jsxs(pi,{name:"minute",value:nL.indexOf(a).toString(),onValueChange:d,children:[o.jsx(ei,{size:"sm",children:o.jsx(mi,{placeholder:"Select..."})}),o.jsx(ti,{children:nL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),o.jsxs(pi,{name:"period",value:sL.indexOf(l).toString(),onValueChange:f,children:[o.jsx(ei,{size:"sm",children:o.jsx(mi,{placeholder:"Select..."})}),o.jsx(ti,{children:sL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]})]})}const oRe=({value:e,minValue:t,maxValue:r,defaultTimeStrValue:n,onValueChange:s,children:a,className:i,placeholder:l,...c})=>{const[u,d]=b.useState(!1);return o.jsxs(_f,{open:u,onOpenChange:d,children:[o.jsx(id,{asChild:!0,children:a||o.jsx(Z$r,{value:e,placeholder:l,className:i,"data-testid":"datepicker-button"})}),o.jsx(hu,{className:"backdrop-blur-4xl w-auto p-0! bg-surface4 max-w-[16.5rem]",align:"start","data-testid":"datepicker-calendar",children:o.jsx(G$r,{value:e,minValue:t,maxValue:r,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:n,...c})})]})};function aL({date:e,timeStr:t=""}){if(!_y(e))return null;if(t){const r=tr(e,"yyyy-MM-dd"),n=new Date(`${r} ${t}`);if(_y(n))return n}return e}const G$r=({value:e,minValue:t,maxValue:r,onValueChange:n,setOpenPopover:s,placeholder:a,className:i,defaultTimeStrValue:l,...c})=>{const[u,d]=b.useState(null),[f,h]=b.useState(e?tr(aL({date:e,timeStr:l})||"","PP p"):""),[p,m]=b.useState(l||""),[g,y]=b.useState(e?new Date(e):void 0),x=dS(B=>{_y(B)&&(y(B),n?.(B),s?.(!1))},500),w=B=>{h(B.currentTarget.value);const D=new Date(B.currentTarget.value);x(D)},S=B=>{_y(B)?r&&B>r?(d(`The selected date should be before ${tr(r,"PP p")}`),h("")):t&&B<t?(d(`The selected date should be after ${tr(t,"PP p")}`),h("")):(h(tr(B,"PP p")),d("")):(h(""),d(""))},k=new Date(f),_=_y(k),E=_&&k.getTime()!==e?.getTime(),T=B=>{if(y(B),B){const D=aL({date:B,timeStr:p});S(D||"")}else S("")},j=B=>{if(y(B),B){const D=aL({date:B,timeStr:p});S(D||"")}else S("")},N=B=>{if(m(B),_){const D=aL({date:k,timeStr:B});S(D||"")}},I=()=>{s?.(!1)},P=()=>{_y(k)&&n(k),s?.(!1)},R=()=>{n(void 0),y(void 0),h(""),m(""),s?.(!1)};return o.jsxs("div",{"aria-label":"Choose date",className:Y("relative flex flex-col",i),onKeyDown:B=>{B.stopPropagation(),B.key==="Escape"&&s?.(!1)},children:[o.jsx(Sx,{name:"date-range",type:"text",value:f,onChange:w,placeholder:a,className:"m-4 mb-0 w-auto!"}),u&&o.jsxs("div",{className:Y("text-ui-md m-4 mb-0 text-neutral3","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mt-0.5 [&>svg]:text-red-500 [&>svg]:float-left [&>svg]:mr-2"),children:[o.jsx(Uce,{})," ",u]}),o.jsx(D4,{mode:"single",month:g,selected:g,onMonthChange:j,onSelect:T,...c}),o.jsx(gie,{onValueChange:N,className:"m-4 mt-0 w-auto",defaultValue:e?tr(new Date(e),"hh:mm a"):l}),o.jsxs("div",{className:"grid grid-cols-[1fr_2fr] gap-2 m-4 mt-0",children:[E&&o.jsx(ce,{tabIndex:0,size:"md",onClick:R,type:"button",children:"Clear"}),o.jsx(ce,{tabIndex:0,type:"button",size:"md",variant:E?"primary":"default",onClick:()=>{_?P():I()},children:E?"Apply":"Cancel"})]})]})},Z$r=b.forwardRef(({value:e,placeholder:t,className:r,...n},s)=>o.jsxs(ce,{ref:s,className:Y("justify-start",r),...n,children:[o.jsx(nne,{className:"h-4 w-4"}),e?o.jsx("span",{className:"text-white",children:tr(e,"PP p")}):o.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));function gft({children:e}){return o.jsx("ul",{className:"grid bg-surface3 overflow-y-auto",children:e})}function yft(e){return!e||e.length===0?"":e?.map(t=>t.size).join(" ")}function vft({entry:e,isSelected:t,onClick:r,children:n,columns:s}){const a=()=>{r?.(e?.id)};return o.jsx("li",{className:Y("border-t text-neutral5 border-border1 last:border-b-0 text-ui-md","[&:last-child>button]:rounded-b-lg",ln.colors,{"bg-accent1Dark":t}),children:o.jsx("button",{onClick:a,className:Y("grid w-full px-6 gap-6 text-left items-center min-h-12",ln.colors,i0.visible,{"hover:bg-surface4":e&&!t}),style:{gridTemplateColumns:yft(s)},disabled:!e,children:n})})}function Y$r({children:e,isLoading:t}){return o.jsx("div",{className:"text-neutral4 text-ui-md truncate ",children:t?o.jsx("div",{className:"bg-surface4 rounded-md animate-pulse text-transparent h-4 select-none"}):e})}function X$r({status:e}){return o.jsxs("div",{className:Y("flex justify-center items-center w-full relative"),children:[e?o.jsx("div",{className:Y("w-[0.6rem] h-[0.6rem] rounded-full",{"bg-green-600":e==="success","bg-red-700":e==="failed"})}):o.jsx("div",{className:"text-neutral2 text-ui-sm leading-none",children:"-"}),o.jsxs(Zu,{children:["Status: ",e||"not provided"]})]})}function bft({columns:e}){return o.jsx("div",{className:Y("sticky top-0 bg-surface4 z-10 rounded-t-lg px-6"),children:o.jsx("div",{className:Y("grid gap-6 text-left uppercase py-3 text-neutral3 text-ui-sm"),style:{gridTemplateColumns:yft(e)},children:e?.map(t=>o.jsx("span",{children:t.label||t.name},t.name))})})}function K$r({children:e,message:t,className:r,type:n}){return!e&&!t?null:o.jsx("div",{className:Y("grid border-t border-border1",r),children:t?o.jsxs("p",{className:Y("text-neutral3 text-ui-md text-center grid p-8 justify-center justify-items-center gap-2","[&>svg]:w-[1.5em] [&>svg]:h-[1.5em] [&>svg]:opacity-75",{"[&>svg]:text-red-500":n==="error"}),children:[n==="error"?o.jsx($E,{}):o.jsx(FR,{})," ",t]}):e})}function J$r({isLoading:e,hasMore:t,setEndOfListElement:r,loadingText:n="Loading more data...",noMoreDataText:s="No more data to load"}){return r?o.jsxs("div",{ref:r,className:"text-ui-md text-neutral3 opacity-50 flex mt-8 justify-center",children:[e&&n,!t&&!e&&s]}):null}function e3r({currentPage:e,hasMore:t,onNextPage:r,onPrevPage:n}){const s=typeof e=="number"&&e>0||t;return o.jsxs("div",{className:Y("flex pt-6 items-center justify-center text-neutral3 text-ui-md gap-8"),children:[o.jsxs("span",{children:["Page ",o.jsx("b",{children:e?e+1:"1"})]}),s&&o.jsxs("div",{className:Y("flex gap-4","[&>button]:flex [&>button]:items-center [&>button]:gap-2 [&>button]:text-neutral4 [&>button:hover]:text-neutral5 [&>button]:transition-colors [&>button]:border [&>button]:border-border1 [&>button]:p-1 [&>button]:px-2 [&>button]:rounded-md","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[typeof e=="number"&&e>0&&o.jsxs("button",{onClick:n,children:[o.jsx(LE,{}),"Previous"]}),t&&o.jsxs("button",{onClick:r,children:["Next",o.jsx(Um,{})]})]})]})}function t3r({children:e}){return o.jsx("div",{className:"grid",children:e})}function xft({children:e}){return o.jsx("div",{className:Y("rounded-lg border border-border1 overflow-clip"),children:e})}const pa=Object.assign(t3r,{Header:bft,Trim:xft,Entries:gft,Entry:vft,Message:K$r,NextPageLoading:J$r,Pagination:e3r,EntryText:Y$r,EntryStatus:X$r}),lRe=["75%","50%","65%","90%","60%","80%"];function r3r({columns:e,numberOfRows:t=3}){const r=(n,s)=>{const a=(n+s+(e?.length||0)+(t||0))%lRe.length;return lRe[a]};return o.jsx(gft,{children:Array.from({length:t}).map((n,s)=>o.jsx(vft,{columns:e,children:(e||[]).map((a,i)=>{const l=`${a.name}-${i}`;return o.jsx("div",{className:"bg-surface4 rounded-md animate-pulse text-transparent h-4 select-none",style:{width:`${r(s,i)}`}},l)})},s))})}function wft({columns:e,numberOfRows:t}){return o.jsx(pa,{children:o.jsxs(xft,{children:[o.jsx(bft,{columns:e}),o.jsx(r3r,{columns:e,numberOfRows:t})]})})}function Sft({entries:e,id:t,update:r}){const n=e.findIndex(a=>a.id===t);if(n<e.length-1)return()=>{const a=e[n+1];r(a.id)}}function Oft({entries:e,id:t,update:r}){const n=e.findIndex(a=>a.id===t);if(n>0)return()=>{const a=e[n-1];r(a.id)}}function kft({name:e,value:t,label:r,labelIsHidden:n=!1,className:s,required:a,disabled:i,helpMsg:l,options:c,onValueChange:u,placeholder:d="Select an option",size:f="default"}){const h=({children:p})=>n?o.jsx(Zu,{children:p}):p;return o.jsxs("div",{className:Y("flex gap-2 items-center",{"grid-rows-[auto_1fr]":r,"grid-rows-[auto_1fr_auto]":l},s),children:[o.jsx(h,{children:o.jsxs("label",{className:Y("text-ui-sm text-neutral3 flex justify-between items-center shrink-0"),children:[r,a&&o.jsx("i",{className:"text-neutral2",children:"(required)"})]})}),o.jsxs(pi,{name:e,value:t,onValueChange:u,disabled:i,children:[o.jsx(ei,{id:`select-${e}`,size:f,className:"grid grid-cols-[1fr_auto] [&>span]:truncate w-full",children:o.jsx(mi,{placeholder:d})}),o.jsx(ti,{children:c.map(p=>o.jsx(ss,{value:p.value,disabled:p.disabled,children:o.jsxs("span",{className:"whitespace-nowrap truncate flex items-center gap-2",children:[p.icon,p.label]})},p.value))})]}),l&&o.jsx("p",{className:"text-neutral3 text-ui-sm",children:l})]})}const _ft=b.createContext(null);function n3r({children:e,value:t}){return o.jsx(_ft.Provider,{value:t,children:e})}function U9(){const e=b.useContext(_ft);if(!e)throw new Error("useJSONSchemaForm must be used within a JSONSchemaForm.Root");return e}let s3r=0;function V9(e={}){return{id:`field-${Date.now()}-${s3r++}`,name:"",type:"string",nullable:!1,optional:!1,...e}}function a3r(e){return e==="text"?"string":e}function Eft(e){const t=a3r(e.type),n={type:e.nullable?[t,"null"]:t};if(e.description&&(n.description=e.description),e.type==="object"&&e.properties&&e.properties.length>0){const{properties:s,required:a}=Cft(e.properties);n.properties=s,a.length>0&&(n.required=a)}return e.type==="array"&&e.items&&(n.items=Eft(e.items)),n}function Cft(e){const t={},r=[];for(const n of e)n.name.trim()&&(t[n.name]=Eft(n),n.optional||r.push(n.name));return{properties:t,required:r}}function i3r(e){const{properties:t,required:r}=Cft(e),n={type:"object",properties:t};return r.length>0&&(n.required=r),n}function jft(e){if(Array.isArray(e)){const t=e.includes("null");return{type:e.find(n=>n!=="null")||"string",nullable:t}}return{type:e||"string",nullable:!1}}function Tft(e){return["string","number","boolean","object","array"].includes(e)?e:"string"}function Nft(e){const{type:t,nullable:r}=jft(e.type);return V9({name:"",type:Tft(t),description:e.description,nullable:r,optional:!1,properties:e.properties?q9({properties:e.properties,required:e.required}):void 0,items:e.items?Nft(e.items):void 0})}function q9(e){if(!e?.properties)return[];const t=new Set(e.required||[]);return Object.entries(e.properties).map(([r,n])=>{const{type:s,nullable:a}=jft(n.type);return V9({name:r,type:Tft(s),description:n.description,nullable:a,optional:!t.has(r),properties:n.properties?q9({properties:n.properties,required:n.required}):void 0,items:n.items?Nft(n.items):void 0})})}function yie(e,t,r,n){if(t.length===0)return e.map(i=>i.id===r?{...i,...n}:i);const[s,...a]=t;return e.map(i=>i.id!==s?i:i.type==="object"?{...i,properties:yie(i.properties||[],a,r,n)}:i.type==="array"&&i.items?{...i,items:{...i.items,properties:yie(i.items.properties||[],a,r,n)}}:i)}function vie(e,t,r){if(t.length===0)return[...e,r];const[n,...s]=t;return e.map(a=>a.id!==n?a:a.type==="object"?{...a,properties:vie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:vie(a.items.properties||[],s,r)}}:a)}function bie(e,t,r){if(t.length===0)return e.filter(a=>a.id!==r);const[n,...s]=t;return e.map(a=>a.id!==n?a:a.type==="object"?{...a,properties:bie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:bie(a.items.properties||[],s,r)}}:a)}function o3r({onChange:e,onFieldsChange:t,defaultValue:r,maxDepth:n=5,className:s,children:a}){const[i,l]=b.useState(()=>r||[]),c=b.useRef("");b.useEffect(()=>{const p=i3r(i),m=JSON.stringify(p);m!==c.current&&(c.current=m,e?.(p))},[i,e]),b.useEffect(()=>{t?.(i)},[i,t]);const u=b.useCallback(p=>{const m=V9();l(g=>vie(g,p,m))},[]),d=b.useCallback((p,m)=>{l(g=>bie(g,p,m))},[]),f=b.useCallback((p,m,g)=>{l(y=>yie(y,p,m,g))},[]),h=b.useMemo(()=>({fields:i,addField:u,removeField:d,updateField:f,maxDepth:n}),[i,u,d,f,n]);return o.jsx(n3r,{value:h,children:o.jsx("div",{className:Y(s),children:a})})}const Aft=b.createContext(null);function l3r({children:e,value:t}){return o.jsx(Aft.Provider,{value:t,children:e})}function bC(){const e=b.useContext(Aft);if(!e)throw new Error("useJSONSchemaFormField must be used within a JSONSchemaForm.Field");return e}function c3r({field:e,parentPath:t=[],depth:r=0,className:n,children:s}){const{updateField:a,removeField:i}=U9(),l=b.useCallback(d=>{a(t,e.id,d)},[a,t,e.id]),c=b.useCallback(()=>{i(t,e.id)},[i,t,e.id]),u=b.useMemo(()=>({field:e,parentPath:t,depth:r,update:l,remove:c}),[e,t,r,l,c]);return o.jsx(l3r,{value:u,children:o.jsx("div",{className:Y(n),children:s})})}const Ift=b.createContext(null);function u3r({children:e,value:t}){return o.jsx(Ift.Provider,{value:t,children:e})}function Rft(){return b.useContext(Ift)}function d3r({className:e,children:t}){const{fields:r}=U9(),n=Rft(),s=n?n.fields:r,a=n?n.parentPath:[],i=n?n.depth:0;return s.length===0?null:o.jsx("div",{className:e,children:s.map((l,c)=>t(l,c,{parentPath:a,depth:i}))})}function f3r(e){const{field:t,update:r}=bC(),n=b.useCallback(s=>{r({name:s.target.value})},[r]);return o.jsx(Sx,{...e,size:"md",labelIsHidden:!0,name:`field-name-${t.id}`,value:t.name,onChange:n})}const h3r=[{value:"string",label:"String",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Wce,{})})},{value:"number",label:"Number",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Vce,{})})},{value:"boolean",label:"Boolean",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Qce,{})})},{value:"text",label:"Text",icon:o.jsx(Ce,{size:"sm",children:o.jsx(uA,{})})},{value:"object",label:"Object",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Ib,{})})},{value:"array",label:"Array",icon:o.jsx(Ce,{size:"sm",children:o.jsx(qce,{})})}];function p3r({className:e,...t}){const{field:r,update:n}=bC(),s=b.useCallback(a=>{n({type:a})},[n]);return o.jsx($o,{className:Y("w-28 shrink-0",e),name:`field-type-${r.id}`,label:"Select type",labelIsHidden:!0,value:r.type,onValueChange:s,options:h3r,size:"md",...t})}function m3r({label:e="Optional",labelClassName:t,className:r,...n}){const{field:s,update:a}=bC(),i=b.useCallback(l=>{a({optional:l===!0})},[a]);return o.jsxs("label",{className:Y("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(hi,{...n,className:r,checked:s.optional,onCheckedChange:i}),e]})}function g3r({label:e="Nullable",labelClassName:t,className:r,...n}){const{field:s,update:a}=bC(),i=b.useCallback(l=>{a({nullable:l===!0})},[a]);return o.jsxs("label",{className:Y("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(hi,{...n,className:r,checked:s.nullable,onCheckedChange:i}),e]})}function y3r({children:e,tooltip:t="Remove field",...r}){const{remove:n}=bC();return o.jsx(ce,{...r,tooltip:t,onClick:n,size:"icon-md",children:e||o.jsx(DHe,{})})}function v3r({className:e,children:t}){const{maxDepth:r,updateField:n}=U9(),{field:s,parentPath:a,depth:i}=bC(),l=s.type==="object"||s.type==="array",c=i>=r;if(b.useEffect(()=>{s.type==="object"&&!s.properties&&n(a,s.id,{properties:[]}),s.type==="array"&&!s.items&&n(a,s.id,{items:V9({name:"items",type:"object",properties:[]})})},[s.type,s.properties,s.items,s.id,a,n]),!l||c)return null;const u=[...a,s.id],d=i+1,f=s.type==="object"?s.properties||[]:s.type==="array"&&s.items?s.items.properties||[]:[];return o.jsx(u3r,{value:{parentPath:u,depth:d,fields:f},children:o.jsx("div",{className:Y("pl-4 border-l border-border1 mt-2",e),children:t})})}function b3r({children:e,...t}){const{addField:r}=U9(),n=Rft(),s=n?n.parentPath:[],a=b.useCallback(()=>{r(s)},[r,s]);return o.jsx(ce,{type:"button",...t,onClick:a,children:e||"Add field"})}const vi={Root:o3r,Field:c3r,FieldList:d3r,FieldName:f3r,FieldType:p3r,FieldOptional:m3r,FieldNullable:g3r,FieldRemove:y3r,NestedFields:v3r,AddField:b3r};function OS({data:e,className:t,labelsAreHidden:r,isLoading:n,LinkComponent:s}){const a=({children:i})=>r?o.jsx(Zu,{children:i}):i;return!e||e.length===0?null:o.jsx("dl",{className:Y("grid grid-cols-[auto_1fr] gap-x-4 items-start content-start",t),children:e.map(({label:i,value:l,icon:c,separator:u},d)=>{const f=Array.isArray(l);return o.jsxs(je.Fragment,{children:[o.jsxs("dt",{className:Y("text-neutral3 text-ui-md flex items-center gap-8 justify-between min-h-9"),children:[o.jsxs("span",{className:Y("flex items-center gap-2","[&>svg]:w-[1.4em] [&>svg]:h-[1.4em] [&>svg]:text-neutral3 [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[c," ",o.jsx(a,{children:i})]}),!r&&o.jsx("span",{className:Y("text-neutral3","[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:text-neutral3"),children:u})]}),o.jsx("dd",{className:Y("flex flex-wrap gap-2 py-1 min-h-9 text-ui-md items-center text-neutral5 text-wrap","[&>a]:text-neutral5 [&>a]:max-w-full [&>a]:w-auto truncate [&>a]:bg-surface4 [&>a]:transition-colors [&>a]:flex [&>a]:items-center [&>a]:gap-2 [&>a]:pt-0.5 [&>a]:pb-0.5 [&>a]:px-2 [&>a]:rounded-md [&>a]:text-ui-md [&>a]:min-h-7 [&>a]:leading-none","[&>a:hover]:text-neutral6 [&>a:hover]:bg-surface6","[&>a>svg]:w-[1em] [&>a>svg]:h-[1em] [&>a>svg]:text-neutral3 [&>a>svg]:ml-[-0.5em]"),children:n?o.jsx("span",{className:Y("bg-surface4 rounded-e-lg w-full"),style:{width:`${Math.floor(Math.random()*61)+50}%`},children:" "}):f?l?.map(h=>h.path&&s?o.jsx(cRe,{description:h.description,children:o.jsxs(s,{href:h.path,children:[h?.name," ",o.jsx(x_,{})]})},h.id):h.path?o.jsx(cRe,{description:h.description,children:o.jsxs("a",{href:h.path,children:[h?.name," ",o.jsx(x_,{})]})},h.id):o.jsx("span",{children:h?.name},h.id)):o.jsx(o.Fragment,{children:l||o.jsx("span",{className:"text-neutral3 text-ui-sm",children:"n/a"})})})]},i+d)})})}function cRe({description:e,children:t}){return e?o.jsxs(_fe,{openDelay:250,children:[o.jsx(Efe,{asChild:!0,children:t}),o.jsx(Cfe,{children:o.jsxs(jfe,{className:"z-50 w-auto max-w-60 rounded-md bg-surface5 p-2 px-4 text-ui-sm text-neutral5 text-center",sideOffset:5,side:"top",children:[e,o.jsx(Tfe,{className:"fill-surface5"})]})})]}):t}function x3r({children:e,className:t}){return o.jsx("div",{className:Y("mt-auto",t),children:e})}function w3r({children:e,className:t}){return o.jsx("nav",{className:Y("",t),children:e})}function Pft({className:e}){return o.jsx("div",{className:Y("min-h-5 relative",'[&:after]:content-[""] [&:after]:block [&:after]:absolute [&:after]:h-0 [&:after]:border-border1 [&:after]:border-t [&:after]:top-1/2 [&:after]:left-3 [&:after]:right-3',e)})}function S3r({children:e,className:t,state:r="default",href:n,isActive:s,LinkComponent:a}){const i=r==="default",l=i?e:o.jsx(Zu,{children:e});return o.jsxs("div",{className:Y("grid grid-cols-[auto_1fr] items-center min-h-11",t),children:[o.jsx("header",{className:Y("text-ui-xs uppercase tracking-widest",{"pl-3":i,"text-black dark:text-white font-semibold":s,"text-neutral3/75":!s}),children:n&&i&&a?o.jsx(a,{href:n,className:Y("transition-colors duration-normal",{"hover:text-neutral5":!s,"text-black dark:text-white":s}),children:l}):l}),o.jsx(Pft,{})]})}function O3r({link:e,state:t="default",children:r,isActive:n,className:s,LinkComponent:a}){const i=t==="collapsed",l=e?.variant==="featured",u=e?.url?.startsWith("http")?{target:"_blank",rel:"noreferrer"}:{};return o.jsx("li",{className:Y("flex relative","[&>a]:flex [&>a]:items-center [&>a]:min-h-8 [&>a]:gap-2.5 [&>a]:text-ui-md [&>a]:text-neutral3 [&>a]:py-1.5 [&>a]:px-3 [&>a]:w-full [&>a]:rounded-lg [&>a]:justify-center","[&>a]:transition-all [&>a]:duration-normal [&>a]:ease-out-custom","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3/60 [&_svg]:transition-colors [&_svg]:duration-normal","[&>a:hover]:bg-surface4 [&>a:hover]:text-neutral5 [&>a:hover_svg]:text-neutral3",{"[&>a]:text-neutral5 [&>a]:bg-surface3":n,"[&_svg]:text-neutral5":n,"before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:w-0.5 before:h-5 before:bg-black dark:before:bg-white before:rounded-r-full before:transition-all before:duration-normal":n&&!i,"[&>a]:justify-start":!i,"[&_svg]:text-neutral3":i,"[&>a]:rounded-md [&>a]:my-2 [&>a]:bg-accent1Dark [&>a:hover]:bg-accent1Darker [&>a]:text-accent1 [&>a:hover]:text-accent1 [&>a]:border [&>a]:border-accent1/30":l,"dark:[&>a]:bg-accent1 dark:[&>a:hover]:bg-accent1/90 dark:[&>a]:text-black dark:[&>a:hover]:text-black dark:[&>a]:border-transparent":l,"[&_svg]:text-accent1 [&>a:hover_svg]:text-accent1 dark:[&_svg]:text-black/75 dark:[&>a:hover_svg]:text-black":l,"[&>a]:pl-7 [&>a]:text-ui-sm":e?.indent&&!i},s),children:e?o.jsx(o.Fragment,{children:i||e.tooltipMsg?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsxs(a,{href:e.url,...u,children:[e.icon&&e.icon,i?o.jsx(Zu,{children:e.name}):e.name," ",r]})}),o.jsx(Gr,{side:"right",align:"center",className:"ml-4",children:e.tooltipMsg?o.jsxs(o.Fragment,{children:[i&&`${e.name} | `," ",e.tooltipMsg]}):e.name})]}):o.jsxs(a,{href:e.url,...u,children:[e.icon&&e.icon,i?o.jsx(Zu,{children:e.name}):e.name," ",r,e.isExperimental&&o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(Uce,{className:"ml-auto stroke-accent5"})}),o.jsx(Gr,{side:"right",align:"center",className:"ml-4",children:"Experimental Feature"})]})]})}):r})}function k3r({children:e,className:t}){return o.jsx("ul",{className:Y("grid gap-1 items-start content-center",t),children:e})}function _3r({children:e,className:t}){return o.jsx("section",{className:Y("grid items-start content-center relative",t),children:e})}const Mft="sidebar:state",wme=je.createContext(null);function Sme(){const e=je.useContext(wme);if(!e)throw new Error("useMainSidebar must be used within a MainSidebarProvider.");return e}function E3r(){return je.useContext(wme)}const C3r=e=>{window.localStorage.setItem(Mft,e.toString())};function j3r({children:e}){const[t,r]=je.useState(()=>"default");je.useLayoutEffect(()=>{const a=window.localStorage.getItem(Mft);(a==="collapsed"||a==="default")&&r(a)},[]);const n=je.useCallback(()=>{C3r(t==="default"?"collapsed":"default"),r(t==="default"?"collapsed":"default")},[t]),s=je.useMemo(()=>({state:t,toggleSidebar:n}),[t,n]);return o.jsx(wme.Provider,{value:s,children:e})}function T3r({children:e,className:t}){const{state:r,toggleSidebar:n}=Sme(),s=r==="collapsed";return o.jsxs("div",{className:Y("flex flex-col h-full px-4 relative overflow-y-auto","transition-all duration-slow ease-out-custom",{"lg:min-w-52 xl:min-w-56 2xl:min-w-60 3xl:min-w-64 4xl:min-w-72":!s},t),children:[e,o.jsx("button",{onClick:n,className:Y("w-[.75rem] h-full right-0 top-0 absolute opacity-10",{"cursor-w-resize":!s,"cursor-e-resize":s}),"aria-label":"Toggle sidebar"})]})}function N3r({className:e}){const{state:t,toggleSidebar:r}=Sme(),n=t==="collapsed";return b.useEffect(()=>{const s=a=>{a.ctrlKey&&a.key==="b"&&(a.preventDefault(),r())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[r]),o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("button",{onClick:r,className:Y("inline-flex w-auto items-center text-neutral3 h-8 px-3 rounded-md","hover:bg-surface4 hover:text-neutral5","transition-all duration-normal ease-out-custom","focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&_svg]:transition-transform [&_svg]:duration-normal",e),"aria-label":"Toggle sidebar",children:o.jsx(j9t,{className:Y({"rotate-180":n})})})}),o.jsxs(Gr,{children:["Toggle Sidebar",o.jsxs("div",{className:"flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]",children:[o.jsx(p9t,{})," Ctrl+B"]})]})]})}const Hh=Object.assign(T3r,{Bottom:x3r,Nav:w3r,NavSection:_3r,NavLink:O3r,NavHeader:S3r,NavList:k3r,NavSeparator:Pft,Trigger:N3r});function aQ({children:e,className:t,isVisible:r,autoDismiss:n=!0,dismissTime:s=5e3,dismissible:a=!0,type:i="info"}){const[l,c]=b.useState(r),[u,d]=b.useState(!1);b.useEffect(()=>{if(a&&n&&r){const m=setTimeout(()=>{f()},s);return()=>clearTimeout(m)}},[n,r,s,a]),b.useEffect(()=>{r&&(d(!1),c(!0))},[r]);const f=()=>{d(!0),setTimeout(()=>{c(!1),d(!1)},200)};if(!l)return null;const h={info:"bg-surface4 border-border1",error:"bg-accent2Darker border-accent2/20",success:"bg-accent1Darker border-accent1/30",warning:"bg-accent6Darker border-accent6/30"},p={info:"text-accent5",error:"text-accent2",success:"text-accent1",warning:"text-accent6"};return o.jsxs("div",{className:Y("grid grid-cols-[auto_1fr_auto] gap-3 rounded-xl border py-2.5 px-3.5 text-ui-md text-neutral4 items-start","shadow-card",ln.all,u?"animate-out fade-out-0 slide-out-to-right-2 duration-200":"animate-in fade-in-0 slide-in-from-right-2 duration-300",h[i],t),children:[o.jsx("div",{className:Y("shrink-0 mt-0.5",p[i]),children:i==="error"||i==="warning"?o.jsx($E,{className:"h-4 w-4"}):o.jsx(FR,{className:"h-4 w-4"})}),o.jsx("div",{className:"flex gap-2 items-start min-w-0",children:e}),a&&o.jsxs(ce,{variant:"ghost",className:Y("h-6 w-6 p-0 shrink-0",ln.colors,"hover:bg-surface5"),onClick:f,children:[o.jsx(Wl,{className:"h-4 w-4"}),o.jsx(Zu,{children:"Dismiss"})]})]})}function Dft({children:e,isLoading:t}){return o.jsx("p",{className:Y("text-neutral2 text-sm max-w-[35rem] flex flex-wrap gap-x-4 gap-y-1 mt-1",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":t}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function Lft({children:e,isLoading:t,size:r="default"}){return o.jsx("h1",{className:Y("text-neutral5 text-xl font-normal gap-2 flex items-center","[&>svg]:w-[1.25em] [&>svg]:h-[1.25em] [&>svg]:opacity-50",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":t,"text-md":r==="smaller"}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function A3r({children:e,className:t,title:r,description:n,icon:s,isLoading:a}){const i=e===void 0&&r!==void 0;return o.jsx("header",{className:Y("w-full grid",t),children:i?o.jsxs(o.Fragment,{children:[o.jsxs(Lft,{isLoading:a,children:[s," ",r]}),n!==void 0&&o.jsx(Dft,{isLoading:a,children:n})]}):e})}const xn=Object.assign(A3r,{Title:Lft,Description:Dft});function I3r({children:e,className:t}){return o.jsx("header",{className:Y("grid items-center grid-cols-[1fr_auto]",t),children:e})}function R3r({headingLevel:e="h2",children:t,className:r}){const n=e;return o.jsx(n,{className:Y("flex items-center gap-2 text-ui-lg font-bold text-neutral4","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",r),children:t})}function $ft({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-4",t),children:e})}function kS({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-2",t),children:e})}const pl=Object.assign($ft,{Header:I3r,Heading:R3r});function P3r(){return qE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8125rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[ne.className,ne.propertyName]}]})}function M3r(){const e=ft.theme({"&":{backgroundColor:"transparent",color:"var(--neutral6)",fontSize:"0.8125rem"},"&.cm-editor .cm-scroller":{fontFamily:"var(--geist-mono)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--neutral2)",borderRight:"none"},".cm-content":{color:"var(--neutral6)",caretColor:"var(--neutral6)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-activeLineGutter":{backgroundColor:"transparent"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--neutral6)"}}),t=Pp.define([{tag:[ne.comment,ne.bracket],color:"var(--neutral2)"},{tag:[ne.string,ne.meta,ne.regexp],color:"var(--accent1)"},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:"var(--accent6)"},{tag:[ne.keyword,ne.operator,ne.tagName],color:"var(--accent2)"},{tag:[ne.function(ne.propertyName),ne.propertyName],color:"var(--accent5)"},{tag:[ne.definition(ne.variableName),ne.function(ne.variableName),ne.className,ne.attributeName],color:"var(--accent3)"},{tag:[ne.variableName,ne.number],color:"var(--accent5)"},{tag:[ne.name,ne.quote],color:"var(--accent1)"}]);return[e,Wx(t)]}const D3r=()=>{const e=yC().resolvedTheme==="dark";return b.useMemo(()=>e?P3r():M3r(),[e])};function L3r({codeStr:e="",title:t,icon:r,simplified:n=!1}){const s=D3r(),[a,i]=b.useState(!1),l=b.useMemo(()=>{try{const u=JSON.parse(e);return xie(u||"")}catch{return!1}},[e]),c=a?e?.replace(/\\n/g,`
296
296
  `):e;return o.jsxs(pl,{children:[o.jsxs(pl.Header,{children:[o.jsxs(pl.Heading,{children:[r,t]}),o.jsxs(ps,{children:[o.jsx(ra,{content:e||"No content"}),l&&o.jsx(ce,{onClick:()=>i(!a),children:a?o.jsx(uA,{}):o.jsx(_3,{})})]})]}),e&&o.jsx("div",{className:"dark:bg-black/20 bg-surface3 p-4 overflow-hidden rounded-xl border dark:border-white/10 border-border1 text-neutral4 text-ui-md break-all max-h-[30vh] overflow-y-auto",children:n?o.jsx("div",{className:"text-neutral4 font-mono break-all px-2",children:o.jsx("pre",{className:"text-wrap",children:e})}):o.jsx(vc,{extensions:[j_(),ft.lineWrapping],theme:s,value:c})})]})}function xie(e){if(typeof e=="string"){const t=e.indexOf(`
@@ -547,7 +547,7 @@ Token usage: ${r} input + ${n} output = ${s} total`:`The model stopped generatin
547
547
  "groundTruth": "Expected result (optional)",
548
548
  "metadata": { "key": "value" } // optional
549
549
  }
550
- ]`})]})]})}function iNn({errors:e,maxErrors:t=5}){if(e.length===0)return null;const r=e.slice(0,t),n=e.length-t;return o.jsxs("div",{className:"bg-accent2/10 border border-accent2/30 rounded-md p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-accent2 mb-2",children:[o.jsx(Ce,{children:o.jsx(IE,{className:"w-4 h-4"})}),o.jsxs("span",{className:"font-medium text-sm",children:[e.length," validation error",e.length!==1?"s":""]})]}),o.jsx("ul",{className:"text-sm text-accent2/80 space-y-1",children:r.map((s,a)=>o.jsxs("li",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0",children:"•"}),o.jsx("span",{children:s.message})]},a))}),n>0&&o.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",n," more error",n!==1?"s":""]})]})}function oNn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState({current:0,total:0}),[d,f]=b.useState(null),[h,p]=b.useState(!1),{parseFile:m,isParsing:g,error:y}=fTn(),{batchInsertItems:x}=ni(),w=b.useCallback(async I=>{try{const P=await m(I);l(P),a("preview")}catch{}},[m]),S=b.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),p(!0);const{items:I}=i;u({current:0,total:I.length});try{await x.mutateAsync({datasetId:e,items:I.map(P=>({input:P.input,groundTruth:P.groundTruth,metadata:P.metadata}))}),f({success:I.length,errors:0})}catch{f({success:0,errors:I.length})}u({current:I.length,total:I.length}),p(!1),a("complete")},[i,x,e]),k=b.useCallback(()=>{r(!1),n?.(),d&&d.success>0&&ze.success(`Imported ${d.success} item${d.success!==1?"s":""}`),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150)},[r,n,d]),_=b.useCallback(()=>{h||(r(!1),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150))},[h,r]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return o.jsx(aNn,{onFileSelect:w,isParsing:g,error:y?.message});case"preview":return i?o.jsx("div",{className:"flex flex-col gap-4",children:i.errors.length>0?o.jsxs(o.Fragment,{children:[o.jsx(iNn,{errors:i.errors}),o.jsx("div",{className:"text-sm text-neutral4",children:"Please fix the errors in your JSON file and try again."})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm text-neutral4",children:["Found ",i.items.length," valid item",i.items.length!==1?"s":""," to import."]}),o.jsx(sNn,{items:i.items,maxRows:5})]})}):null;case"importing":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx(Dt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return o.jsx(ce,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(ce,{variant:"primary",onClick:S,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return o.jsx(ce,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(On,{open:t,onOpenChange:_,children:o.jsxs(vn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:N[s]}),o.jsx(qs,{children:"Import dataset items from a JSON file."})]}),o.jsx(Bn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(uf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function lNn({dataset:e,isLoading:t=!1,onEditClick:r,onDuplicateClick:n,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(Ir,{className:c,children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{isLoading:t,children:[o.jsx(Na,{})," ",e?.name]}),o.jsx(Ir.Description,{isLoading:t,children:e?.description}),o.jsxs(Ir.Description,{isLoading:t,children:[o.jsxs(Zn,{children:[o.jsx(p_,{})," Created at ",e?.createdAt?tr(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Vx,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsx("div",{className:"pointer-events-none opacity-50",inert:!0,"aria-disabled":"true",children:a})})}),o.jsx(Gr,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(ce,{disabled:!0,tabIndex:-1,children:[o.jsx(ux,{}),"Run Experiment"]})})}),o.jsx(Gr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(ce,{onClick:l,children:[o.jsx(ux,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(vVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(iv,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(tu,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(ed,{})," Delete Dataset"]})]})]})]})})]})}const USt=e=>{const t=We(),{data:r}=wR(e),n=r?.experiments;return Ot({queryKey:["dataset-review-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="needs-review").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})},cNn=e=>{const t=We(),{data:r}=wR(e),n=r?.experiments;return Ot({queryKey:["dataset-completed-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="complete").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})};function uNn(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const r=JSON.stringify(e);return r.length>t?r.slice(0,t)+"...":r}catch{return String(e)}}const dNn=Y("bg-surface5 backdrop-blur-xl z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95");function DBe({className:e,children:t,...r}){return o.jsx(iP,{children:o.jsx(fz,{className:Y(dNn,e),...r,children:t})})}function fNn({datasetId:e}){const t=We(),{data:r}=Tg(e),{data:n,isLoading:s}=USt(e),{data:a,isLoading:i}=cNn(e),{updateExperimentResult:l}=ni(),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState(new Set),[m,g]=b.useState(!1),[y,x]=b.useState(!1),[w,S]=b.useState(!1),[k,_]=b.useState(""),[E,T]=b.useState(""),[j,N]=b.useState(""),[I,P]=b.useState([]),[R,B]=b.useState(!1),[D,$]=b.useState(null),U=D??n??[];b.useEffect(()=>{n&&D===null&&$(n)},[n]);const z=b.useMemo(()=>{const ge=new Set;if(r?.tags)for(const Ee of r.tags)ge.add(Ee);for(const Ee of U)for(const Fe of Ee.tags)ge.add(Fe);return[...ge].sort()},[r,U]),H=b.useCallback(ge=>{!r||!e||(r.tags??[]).includes(ge)},[r,e]),Q=b.useMemo(()=>d?d==="__untagged__"?U.filter(ge=>ge.tags.length===0):U.filter(ge=>ge.tags.includes(d)):U,[U,d]),L=b.useMemo(()=>{const ge=new Map;for(const Ee of U)for(const Fe of Ee.tags)ge.set(Fe,(ge.get(Fe)??0)+1);return[...ge.entries()].sort((Ee,Fe)=>Fe[1]-Ee[1])},[U]),Z=b.useMemo(()=>U.filter(ge=>ge.tags.length===0).length,[U]),V=b.useMemo(()=>{let ge=0;return d&&ge++,m&&ge++,ge},[d,m]),M=b.useCallback((ge,Ee)=>{$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,tags:Ee}:wt));const Fe=U.find(ct=>ct.id===ge);Fe?.experimentId&&Fe?.datasetId&&l.mutate({datasetId:Fe.datasetId,experimentId:Fe.experimentId,resultId:Fe.id,tags:Ee})},[U,l]),W=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&Ee!==void 0&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ee==="positive"?1:-1,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,rating:Ee}:wt))},[U,t]),G=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ee,comment:Ee,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,comment:Ee}:wt))},[U,t]),J=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);$(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:null})},[U,l,c]),ae=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);$(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:"complete"})},[U,l,c]),te=b.useMemo(()=>{const ge=m?a??[]:Q;return!m||!d?ge:d==="__untagged__"?ge.filter(Ee=>Ee.tags.length===0):ge.filter(Ee=>Ee.tags.includes(d))},[m,a,Q,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(te.map(ge=>ge.id)),[te]),he=b.useMemo(()=>[...h].filter(ge=>ie.has(ge)).length,[h,ie]),X=te.length>0&&he===te.length,se=he>0&&!X,le=b.useCallback(ge=>{p(Ee=>{const Fe=new Set(Ee);return Fe.has(ge)?Fe.delete(ge):Fe.add(ge),Fe})},[]),xe=b.useCallback(()=>{p(X?new Set:new Set(te.map(ge=>ge.id)))},[X,te]),de=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&!Fe.tags.includes(ge)&&M(Ee,[...Fe.tags,ge])}},[U,h,M]),ue=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&Fe.tags.includes(ge)&&M(Ee,Fe.tags.filter(ct=>ct!==ge))}},[U,h,M]),ve=b.useCallback(()=>{for(const ge of h)ae(ge);p(new Set)},[h,ae]),we=b.useCallback(()=>{for(const ge of h)J(ge);p(new Set)},[h,J]),Ne=b.useCallback(()=>{_(""),S(!0)},[]),K=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ge=U.filter(Fe=>h.has(Fe.id));if(ge.length===0){x(!1);return}const Ee=await t.clusterFailures({modelId:`${E}/${j}`,items:ge.map(Fe=>({id:Fe.id,input:Fe.input,output:Fe.output??void 0,error:typeof Fe.error=="string"?Fe.error:Fe.error?String(Fe.error):void 0,scores:Fe.scores,existingTags:Fe.tags.length>0?Fe.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:k||void 0});Ee.proposedTags&&Ee.proposedTags.length>0&&(P(Ee.proposedTags.map(Fe=>({...Fe,accepted:!0}))),B(!0))}catch(ge){console.error("Analysis failed:",ge)}finally{x(!1)}}},[E,j,U,h,t,z,k]),oe=b.useCallback(()=>{for(const ge of I){if(!ge.accepted)continue;const Ee=U.find(Fe=>Fe.id===ge.itemId);if(Ee){const Fe=[...new Set([...Ee.tags,...ge.tags])];M(Ee.id,Fe)}}B(!1)},[I,U,M]),be=b.useCallback(ge=>{u(Ee=>Ee===ge?null:ge)},[]),Ae=b.useMemo(()=>c?te.find(ge=>ge.id===c)??null:null,[c,te]),$e=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge<te.length-1&&u(te[ge+1].id)},[c,te]),ye=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge>0&&u(te[ge-1].id)},[c,te]),ke=Ae?"2rem 1fr 10rem 8rem":"2rem 1fr 10rem 8rem 6rem 6rem";return s?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Dt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx(On,{open:w,onOpenChange:S,children:o.jsxs(vn,{children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Analyze Items"}),o.jsx(qs,{children:"Use an LLM to automatically suggest tags for the selected items."})]}),o.jsxs("div",{className:"space-y-4 py-2",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Provider"}),o.jsx(Ng,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Ag,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(me,{variant:"ui-xs",className:"text-neutral3",children:[h.size," item",h.size!==1?"s":""," will be analyzed"]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs",children:"Instructions (optional)"}),o.jsx(gc,{value:k,onChange:ge=>_(ge.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(uf,{children:[o.jsx(ce,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(ce,{onClick:K,disabled:!E||!j||y,children:[y?o.jsx(Dt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(On,{open:R,onOpenChange:B,children:o.jsxs(vn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Review Proposed Tags"}),o.jsxs(qs,{children:[I.filter(ge=>ge.accepted).length," of ",I.length," proposals selected"]})]}),o.jsx("div",{className:"space-y-3 py-2",children:I.map((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge.itemId);return o.jsx("div",{className:Y("p-3 border rounded-lg",!ge.accepted&&"opacity-50"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(hi,{checked:ge.accepted,onCheckedChange:ct=>P(wt=>wt.map((lr,Ve)=>Ve===Ee?{...lr,accepted:!!ct}:lr))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate block",children:Fe?typeof Fe.input=="string"?Fe.input.slice(0,100):JSON.stringify(Fe.input).slice(0,100):ge.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ge.tags.map((ct,wt)=>o.jsx(PSt,{tag:ct,onRename:lr=>P(Ve=>Ve.map((qe,Ie)=>Ie===Ee?{...qe,tags:qe.tags.map((Le,Re)=>Re===wt?lr:Le)}:qe)),onRemove:()=>P(lr=>lr.map((Ve,qe)=>qe===Ee?{...Ve,tags:Ve.tags.filter((Ie,Le)=>Le!==wt)}:Ve))},`${ct}-${wt}`))}),ge.reason&&o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ge.reason})]})]})},ge.itemId)})}),o.jsxs(uf,{children:[o.jsx(ce,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(ce,{onClick:oe,disabled:I.filter(ge=>ge.accepted).length===0,children:["Accept ",I.filter(ge=>ge.accepted).length," proposals"]})]})]})}),o.jsxs(tf,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:"md",children:[o.jsx(bVe,{}),"Filter",V>0&&o.jsx("span",{className:Y("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:V})]})}),o.jsxs(yt.Content,{align:"start",className:Y("min-w-48"),children:[o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(DBe,{children:[o.jsx(yt.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ge=>ge.preventDefault(),children:"Review Queue"}),o.jsx(yt.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ge=>ge.preventDefault(),children:"Completed"})]})]}),o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(DBe,{children:[o.jsx(yt.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ge=>ge.preventDefault(),children:"All"}),Z>0&&o.jsx(yt.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ge=>ge.preventDefault(),children:"Untagged"}),L.length>0&&o.jsx(yt.Separator,{}),L.map(([ge])=>o.jsx(yt.CheckboxItem,{checked:d===ge,onCheckedChange:()=>f(d===ge?null:ge),onSelect:Ee=>Ee.preventDefault(),children:ge},ge))]})]}),V>0&&o.jsxs(o.Fragment,{children:[o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(An,{}),"Clear all filters"]})]})]})]}),V>0&&o.jsxs(ce,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(An,{}),"Reset"]})]}),!m&&h.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(RSt,{selectedCount:h.size,vocabulary:z,onApplyTag:de,onRemoveTag:ue,onNewTag:ge=>de(ge)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{disabled:y,children:[y?o.jsx(Dt,{className:"w-4 h-4"}):o.jsx(Ce,{size:"sm",children:o.jsx(as,{})}),"Actions"]})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:ve,children:[o.jsx(Ce,{size:"sm",children:o.jsx(Jw,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:we,children:[o.jsx(Ce,{size:"sm",children:o.jsx(ed,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Ne,children:[o.jsx(Ce,{size:"sm",children:o.jsx(y_,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Dt,{className:"w-6 h-6"})}):te.length===0?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"text-center px-8",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-2 block",children:m?"Items marked as complete will appear here for auditing.":"When experiment results are flagged for review, they will appear here."})]})}):o.jsxs(Se,{columns:ke,children:[o.jsxs(Se.Top,{children:[!m&&o.jsx(Se.TopCell,{children:o.jsx(hi,{checked:X?!0:se?"indeterminate":!1,onCheckedChange:()=>xe(),"aria-label":"Select all"})}),m&&o.jsx(Se.TopCell,{children:" "}),o.jsx(Se.TopCell,{children:"Input"}),o.jsx(Se.TopCell,{children:"Comment"}),o.jsx(Se.TopCell,{children:"Tags"}),!Ae&&o.jsx(Se.TopCell,{children:"Rating"}),!Ae&&o.jsx(Se.TopCell,{children:"Scores"})]}),o.jsx(Se.Rows,{children:te.map(ge=>{const Ee=ge.scores?Object.entries(ge.scores):[];return o.jsxs(Se.Row,{onClick:()=>be(ge.id),selected:c===ge.id,children:[o.jsx(Se.Cell,{children:m?ge.error?o.jsx("div",{className:"w-2 h-2 rounded-full bg-red-700",title:"Error"}):o.jsx("div",{className:"w-2 h-2 rounded-full bg-green-600",title:"Success"}):o.jsx(hi,{checked:h.has(ge.id),onCheckedChange:()=>le(ge.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ge.id}`})}),o.jsx(Se.NameCell,{children:uNn(ge.input,80)}),o.jsx(Se.Cell,{children:ge.comment?o.jsx(me,{variant:"ui-xs",className:"text-neutral3 truncate",children:ge.comment}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Se.Cell,{children:ge.tags.length>0?o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate",children:ge.tags.join(", ")}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Ae&&o.jsxs(Se.Cell,{children:[ge.rating==="positive"&&o.jsx(Ce,{size:"sm",className:"text-positive1",children:o.jsx(uce,{})}),ge.rating==="negative"&&o.jsx(Ce,{size:"sm",className:"text-negative1",children:o.jsx(cce,{})}),!ge.rating&&o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Ae&&o.jsx(Se.Cell,{children:Ee.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ce,{size:"sm",className:"text-neutral3",children:o.jsx(La,{})}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ee[0][1].toFixed(2)}),Ee.length>1&&o.jsxs(vt,{variant:"default",children:["+",Ee.length-1]})]}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ge.id)})})]})]}),Ae&&o.jsx(ISt,{item:Ae,isCompleted:m,tagVocabulary:z,onRate:ge=>W(Ae.id,ge),onSetTags:ge=>{M(Ae.id,ge);for(const Ee of ge)z.includes(Ee)||H(Ee)},onComment:ge=>G(Ae.id,ge),onRemove:()=>J(Ae.id),onComplete:m?void 0:()=>ae(Ae.id),onPrevious:ye,onNext:$e,onClose:()=>u(null)})]})]})}function hNn({datasetId:e,onExperimentClick:t,onEditClick:r,onDeleteClick:n,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:l,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=or(),[h,p]=b.useState(u??"items"),m=Ut=>{p(Ut),d?.(Ut)},[g,y]=b.useState(!1),[x,w]=b.useState(!1),[S,k]=b.useState(!1),[_,E]=b.useState([]),[T,j]=b.useState(!1),[N,I]=b.useState([]),[P,R]=b.useState(!1),[B,D]=b.useState([]),[$,U]=b.useState(!1),[z,H]=b.useState(0),[Q,L]=b.useState(null),[Z,V]=b.useState(""),[M]=lur(Z,300),[W,G]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=Tg(e),{data:ie=[],total:he,isLoading:X,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe}=kE(e,M||void 0,ae),{data:de=[],total:ue,isLoading:ve}=kE(e,void 0,ae),[we,Ne]=b.useState({}),{data:K,isLoading:oe}=wR(e,void 0,we),{data:be}=wR(e),{deleteItems:Ae}=ni(),$e=K?.experiments??[],ye=be?.experiments??[],ke=NTn({hasSearchQuery:!!M,filteredItemsLength:ie.length,unfilteredItemsTotal:ue,itemsTotal:he}),{data:ge}=USt(e),Ee=ge?.length??0,Fe=Ut=>{L(Ut)},ct=()=>{L(null)},wt=Ut=>{const $r=Ut.isCurrent?null:Ut;c?c($r):G(Ut.isCurrent?null:Ut.version)},lr=Ut=>{E(Ut),k(!0)},Ve=Ut=>{I(Ut),j(!0)},qe=Ut=>{j(Ut),Ut||(I([]),H($r=>$r+1))},Ie=Ut=>{f(`/datasets/${e}/items?items=${Ut.join(",")}`)},Le=Ut=>{f(`/datasets/${e}/versions?ids=${Ut.join(",")}`)},Re=Ut=>{D(Ut),R(!0)},it=async()=>{await Ae.mutateAsync({datasetId:e,itemIds:B}),ze.success(`Deleted ${B.length} items`),R(!1),D([]),H(Ut=>Ut+1)},rt=Ut=>{k(!1),E([]),H($r=>$r+1),i?.(Ut)},ht=Ut=>{k(Ut),Ut||(E([]),H($r=>$r+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Y("h-full w-full",ln.allSlow),children:o.jsxs("div",{className:Y("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",Q?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(lNn,{dataset:te,isLoading:re,onEditClick:r,onDuplicateClick:()=>U(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!ve&&de.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(Ef,{defaultTab:"items",value:h,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(Cf,{children:[o.jsxs(cs,{value:"items",children:["Items ",o.jsx(za,{color:"gray",children:ke})]}),o.jsxs(cs,{value:"experiments",children:["Experiments",o.jsx(za,{color:"gray",children:$e.length})]}),o.jsxs(cs,{value:"review",children:["Review",Ee>0&&o.jsx(za,{color:"orange",children:Ee})]})]}),o.jsx(xs,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(nNn,{datasetId:e,items:ie,isLoading:X,featuredItemId:Q,onItemSelect:Fe,onItemClose:ct,onAddClick:s??(()=>{}),onImportClick:()=>y(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Re,onCreateDatasetClick:lr,onAddToDatasetClick:Ve,onCompareItemsClick:Ie,datasetName:te?.name,clearSelectionTrigger:z,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe,searchQuery:Z,onSearchChange:V,activeDatasetVersion:ae,currentDatasetVersion:te?.version,onVersionSelect:wt,onCompareVersionsClick:Le})}),o.jsx(xs,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(QTn,{experiments:$e,allExperiments:ye,isLoading:oe,datasetId:e,filters:we,onFiltersChange:Ne})}),o.jsx(xs,{value:"review",className:"overflow-auto mt-0",children:o.jsx(fNn,{datasetId:e})})]})})]})})}),o.jsx($Tn,{datasetId:e,open:g,onOpenChange:y}),o.jsx(oNn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(kTn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(_Tn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(ETn,{open:$,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx($t,{open:P,onOpenChange:R,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Items"}),o.jsxs($t.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:it,children:Ae.isPending?"Deleting...":"Delete"})]})]})})]})}function pNn(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const r=JSON.parse(t[1]);if(r.field&&Array.isArray(r.errors))return{field:r.field,errors:r.errors}}catch{}return null}function LBe({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((r,n)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,r.path!=="/"?r.path:""]}),": ",r.message]},n))}):null}function mNn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("{}"),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(null),{addItem:h}=ni(),p=async x=>{x.preventDefault();let w;try{w=JSON.parse(s)}catch{ze.error("Input must be valid JSON");return}let S;if(i.trim())try{S=JSON.parse(i)}catch{ze.error("Ground Truth must be valid JSON");return}let k;if(c.trim())try{k=JSON.parse(c)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await h.mutateAsync({datasetId:e,input:w,groundTruth:S,expectedTrajectory:k}),ze.success("Item added successfully"),f(null),a("{}"),l(""),u(""),r(!1),n?.()}catch(_){const E=pNn(_);E?f(E):ze.error(`Failed to add item: ${_ instanceof Error?_.message:"Unknown error"}`)}},m=x=>{a(x),d?.field==="input"&&f(null)},g=x=>{l(x),d?.field==="groundTruth"&&f(null)},y=()=>{a("{}"),l(""),u(""),f(null),r(!1)};return o.jsx(On,{open:t,onOpenChange:r,children:o.jsxs(vn,{className:"max-w-lg",children:[o.jsx(kn,{children:o.jsx(bn,{children:"Add Item"})}),o.jsx(Bn,{children:o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-input",children:"Input (JSON) *"}),o.jsx(Xn,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(LBe,{field:"input",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),o.jsx(Xn,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(LBe,{field:"groundTruth",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),o.jsx(Xn,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(ce,{type:"button",onClick:y,children:"Cancel"}),o.jsx(ce,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function gNn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=cd(),i=b.useMemo(()=>s?Object.entries(s).map(([l,c])=>({value:l,label:c.scorer?.config?.name||l,description:c.scorer?.config?.description||""})):[],[s]);return o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Scorers (Optional)"}),o.jsx(Ldt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const yNn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function vNn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Eg(),{data:l,isLoading:c}=c0(),{data:u,isLoading:d}=cd(),f=e==="agent"?Object.entries(a??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="workflow"?Object.entries(l??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,y])=>({value:g,label:y.scorer?.config?.name??g})):[],h=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,p=g=>{t(g),n("")},m=e==="agent"?"Agent":e==="workflow"?"Workflow":"Scorer";return o.jsxs("div",{className:"grid gap-6",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Target Type"}),o.jsx(Gl,{options:yNn,value:e,onValueChange:p,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:m}),o.jsx(Gl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function bNn({datasetId:e,version:t,open:r,onOpenChange:n,onSuccess:s}){const a=b.useRef(null),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState([]),{triggerExperiment:h}=ni(),p=i&&c,m=h.isPending,g=async()=>{if(p)try{const x=await h.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});mc.success("Experiment triggered successfully"),n(!1),s?.(x.experimentId),l(""),u(""),f([])}catch(x){const w=x instanceof Error?x.message:"Failed to trigger experiment";mc.error(w)}},y=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(On,{open:r,onOpenChange:y,children:o.jsxs(vn,{ref:a,children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Run Experiment"}),o.jsx(qs,{children:t?`Execute items from ${tr(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(Bn,{className:"grid gap-6",children:[o.jsx(vNn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(gNn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(uf,{className:"px-6 pt-4",children:[o.jsx(ce,{onClick:y,disabled:m,children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:g,disabled:!p||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const VSt=e=>{const t=We();return Ot({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},$Be=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function xNn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=nre(e?.input),d=nre(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(wC,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(ce,{onClick:a,disabled:!e.traceId,children:[o.jsx(lce,{}),"Show Trace"]}),o.jsx(ce,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(An,{})})]})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(ux,{})," ",e.id]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(lx,{})," ",e.itemId]})})]})}),c&&o.jsx(cn,{variant:"destructive",title:"Error",children:o.jsx(cn.Message,{children:nre(e?.error&&typeof e.error=="object"?e.error.message:e?.error)})}),t&&t.length>0&&o.jsxs(Pt,{className:"grid-rows-[auto_auto] overflow-visible",children:[o.jsxs(Pt.Header,{columns:$Be,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Score"})]}),o.jsx(Pt.Items,{children:t.map(f=>o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:f.id},columns:$Be,isFeatured:l===f.id,onClick:i,children:[o.jsx(Pt.TextCell,{children:f.scorerId}),o.jsx(Pt.TextCell,{className:"font-mono",children:f.score.toFixed(3)})]})},f.id))})]}),(e.status||Array.isArray(e.tags)&&e.tags.length>0)&&o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(AE,{className:"w-4 h-4"})," Review Status"]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.status&&o.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${e.status==="needs-review"?"bg-warning/10 text-warning":e.status==="complete"?"bg-accent1/10 text-accent1":"bg-neutral3/10 text-neutral4"}`,children:e.status}),Array.isArray(e.tags)&&e.tags.length>0&&e.tags.map(f=>o.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-surface4 text-neutral4",children:f},f))]})]}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(lx,{}),codeStr:u}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:d}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(p_,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:tr(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function nre(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function wNn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(cx,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(wh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Attributes",icon:o.jsx(wh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function SNn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=D1(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(wC,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(ce,{onClick:s,"aria-label":"Close span details",children:o.jsx(An,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(wh,{})," Span ",ef(t)]})})}),o.jsx(wNn,{span:i})]})]})}const ONn=e=>{if(!e||e.length===0)return[];const t=e.reduce((l,c)=>{const u=c?.endedAt?new Date(c.endedAt):void 0;return u&&(!l||u>l)?u:l},null),r=new Map,n=[];e.forEach(l=>{const c=new Date(l.startedAt),u=l.endedAt?new Date(l.endedAt):void 0,d={id:l.spanId,name:l.name,type:l.spanType,latency:u?u.getTime()-c.getTime():0,startTime:c.toISOString(),endTime:u?u.toISOString():void 0,spans:[],parentSpanId:l.parentSpanId};r.set(l.spanId,d)}),e.forEach(l=>{const c=r.get(l.spanId);if(l?.parentSpanId==null){if(t&&c.endTime&&t>new Date(c.endTime)){c.endTime=t.toISOString();const u=new Date(t).getTime(),d=new Date(c.startTime).getTime();c.latency=u-d}n.push(c)}else{const u=r.get(l.parentSpanId);u?u.spans.push(c):n.push(c)}});const s=l=>l.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(n),i=l=>{l.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function qSt(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...qSt(r))}),t}const FBe=["agent","workflow","model","mcp","tool","workspace","other"];function HSt(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(ya,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"bg-oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:o.jsx(Di,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"bg-oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:o.jsx(Em,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(gl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(Mi,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"bg-oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},workspace:{icon:o.jsx(B9,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in r?r[t]:{typePrefix:"other"}}function kNn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Y("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(zBe,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(lVe,{}):o.jsx(Ux,{}):o.jsx(as,{})]}),a>(l??0)&&!i&&o.jsxs(zBe,{onClick:()=>s?.(),children:[a," ",o.jsx(oVe,{})]})]}):null})}function zBe({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Y("h-full",r),children:o.jsx("div",{className:Y("flex items-center gap-[0.1rem] text-ui-sm text-neutral5 border border-border1 pl-2 pr-1 rounded-lg transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-4 [&>svg]:h-4 [&>svg]:transition-all"),children:t})})}function _Nn({isLastChild:e,hasChildren:t=!1,expanded:r=!1}){return o.jsx("div",{className:Y("w-12 h-[2.8rem] relative opacity-100",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-0 after:border-l after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-0 before:border-b before:border-neutral3 before:border-dashed',"[&_svg]:transition-all","[&:hover_svg]:text-yellow-500 [&:hover_svg]:scale-[1.3] [&:hover_svg]:opacity-100",{"after:bottom-[50%]":e}),children:t&&o.jsx("span",{className:Y("flex absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%] items-center justify-center bg-surface2 p-1","[&>svg]:shrink-0 [&>svg]:opacity-60 [&>svg]:w-[0.8rem] [&>svg]:h-[0.8rem]"),children:r?o.jsx(dVe,{}):o.jsx(uVe,{})})})}function ENn({span:e,spanUI:t,isFaded:r,depth:n=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:l,isRootSpan:c,isExpanded:u,toggleChildren:d}){return o.jsxs("div",{className:"flex overflow-x-auto",style:{paddingLeft:`${n*1.5}rem`},children:[!c&&o.jsx("button",{onClick:()=>d?.(),disabled:!l,className:Y({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(_Nn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function QSt({span:e,depth:t=0,onSpanClick:r,selectedSpanId:n,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:l,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:h}){const p=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=qSt(e),y=g.length,x=t===0,w=HSt(e?.type),S=f?f.includes(e.id):!1,k=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(w?.typePrefix||""):!1)||k;b.useEffect(()=>{x&&h?.([e.id])},[x,e.id,h]),b.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const I=e.spans.some(P=>d.includes(P.id));!S&&I&&T()},[d,e.spans,e.id,S,h,f]);const T=()=>{if(!(!h||!f))if(S){const I=[e.id,...g];h(f.filter(P=>!I.includes(P)))}else h([...f,e.id])},j=()=>{!h||!f||h([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(ENn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(kNn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:y,allDescendantsExpanded:N,numOfChildren:m}),p&&S&&e.spans?.map((I,P,R)=>{const B=P===R.length-1;return o.jsx(QSt,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:h,featuredSpanIds:d},I.id)})]})}function CNn({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:r,isLoading:n,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:l}){const c=e?.[0]?.latency||0,u=e?.[0]?.startTime||"",d=e?.[0]?.endTime||"";return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Y("flex items-center text-ui-md gap-4 bg-surface3/50 rounded-md p-6 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Dt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(QSt,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function jNn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=FBe.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!FBe.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=trt(h=>{s?.(h)},1e3);return o.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[o.jsx("div",{className:"flex",children:o.jsx(Ox,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:h=>{l(h.target.value)},onReset:()=>l("")})}),o.jsxs(mft,{children:[c.map(h=>{const p=HSt(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(ce,{onClick:()=>d(h),className:m?"opacity-40":"",style:{color:m?void 0:p?.color,backgroundColor:p?.bgColor},children:[p?.icon&&o.jsx(Ce,{children:p.icon}),p?.label]})},h)}),u&&o.jsxs(ce,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ce,{children:o.jsx(oF,{})}),"Other"]}),o.jsx(ce,{onClick:n,disabled:t?.length===0,children:o.jsx(Ce,{children:o.jsx(An,{})})})]})]})}function TNn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=VSt(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>ONn(i),[i]);b.useEffect(()=>{if(l.trim()===""){h([]);return}const S=l.toLowerCase(),k=i.filter(_=>_.name.toLowerCase().includes(S)).map(_=>_.spanId);h(k)},[l,i]),b.useEffect(()=>{c(""),d([]),h([]),m([])},[e]);const y=S=>{r?.(t===S?void 0:S)},x=S=>{d(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(gr.Toolbar,{children:o.jsx(ce,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(An,{})})}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(xo,{})," Trace ",ef(e)]})})}),o.jsx(jNn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(CNn,{hierarchicalSpans:g,onSpanClick:y,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function NNn({results:e,isLoading:t,featuredResultId:r,onResultClick:n,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:l,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Dt,{})})]}):e.length===0?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx(Se.NoMatch,{message:"No results yet"})]}):o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsxs(Se.Rows,{children:[e.map(f=>{const h=!!f.error,p=f.id===r;return o.jsxs(Se.Row,{onClick:()=>n(f.id),selected:p,children:[o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(Se.Cell,{children:o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",h?"bg-red-700":"bg-green-600")})})}),o.jsx(Gr,{children:h?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:INn(ANn(f.input),200)})}),i?.map(m=>{const y=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(Se.TextCell,{children:o.jsx("span",{className:"font-mono",children:y!=null?y.score.toFixed(3):"-"})},m)})]},f.id)}),o.jsxs("div",{ref:l,className:"h-1 col-span-full",children:[c&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Dt,{})}),!u&&e.length>0&&o.jsx(me,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function ANn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function INn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function RNn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function PNn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=RNn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(wC,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(ce,{onClick:n,"aria-label":"Close score details",children:o.jsx(An,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(La,{})," ",e.scorerId]})})}),o.jsxs(kx,{children:[o.jsx(Vt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(La,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(lx,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(sc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(sc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(sc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(sc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const BBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function MNn({scoresByItemId:e,experimentStatus:t}){const r=b.useMemo(()=>{if(!e)return[];const n={};for(const s of Object.values(e))for(const a of s)n[a.scorerId]||(n[a.scorerId]={sum:0,count:0}),n[a.scorerId].sum+=a.score,n[a.scorerId].count++;return Object.entries(n).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(r.length===0){const n=t==="running"||t==="pending",s=e!==void 0;let a,i;return n?(a="Experiment in progress",i="Summary metrics will appear here once the experiment completes."):s?(a="No scorers configured",i="Add scorers when triggering an experiment to evaluate results and see summary metrics here."):(a="Loading scores",i="Fetching scorer results…"),o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(La,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:BBe,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Avg Score"}),o.jsx(Pt.HeaderCol,{children:"Items Scored"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:r.map(({scorerId:n,avg:s,count:a})=>o.jsxs(Pt.Row,{columns:BBe,children:[o.jsx(Pt.TextCell,{children:n}),o.jsx(Pt.TextCell,{className:"font-mono",children:s.toFixed(3)}),o.jsx(Pt.TextCell,{className:"font-mono",children:a})]},n))})})]})}function WSt({experimentId:e,experimentStatus:t,results:r,isLoading:n,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(void 0),[p,m]=b.useState(null),g=r.find(z=>z.id===l)??null,{data:y}=OSt(e,t),x=b.useMemo(()=>{if(!y)return[];const z=new Set;for(const H of Object.values(y))for(const Q of H)z.add(Q.scorerId);return[...z].sort()},[y]),{data:w}=VSt(u),S=w?.spans??[],k=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>=0&&z<S.length-1)return()=>h(S[z+1].spanId)},_=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>0)return()=>h(S[z-1].spanId)},E=z=>{c(z),d(null),h(void 0),m(null)},T=z=>{E(z===l?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>=0&&z<r.length-1)return()=>E(r[z+1].id)},I=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>0)return()=>E(r[z-1].id)},P=g?y?.[g.itemId]:void 0,R=P?.find(z=>z.id===p)??null,B=z=>{m(z===p?null:z),d(null),h(void 0)},D=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>=0&&z<P.length-1)return()=>m(P[z+1].id)},$=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>0)return()=>m(P[z-1].id)},U=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(z=>({name:z,label:z,size:"1fr"}))],[l,x]);return o.jsxs(Ef,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(Cf,{children:[o.jsx(cs,{value:"summary",children:"Summary"}),o.jsx(cs,{value:"results",children:"Results"})]}),o.jsx(xs,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(MNn,{scoresByItemId:y,experimentStatus:t})}),o.jsx(xs,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(tf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(gr,{children:o.jsx(NNn,{results:r,isLoading:n,featuredResultId:l,onResultClick:T,columns:U,scoresByItemId:y,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(J3r,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(xNn,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:B,featuredScoreId:p,onShowTrace:()=>{d(g.traceId??null),h(void 0),m(null)}})}),g&&!u&&R&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(PNn,{score:R,onNext:D(),onPrevious:$(),onClose:()=>m(null)})}),g&&u&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(TNn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(SNn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const DNn={pending:o.jsx(CE,{}),running:o.jsx(g3,{}),completed:o.jsx(na,{}),failed:o.jsx(An,{})};function LNn({experiment:e,className:t}){const r=e.status,n=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Y("grid justify-items-end gap-3",t),children:[o.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[o.jsx("span",{className:Y("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":r==="completed","bg-red-700":r==="failed","bg-cyan-600":r==="running","bg-yellow-600":r==="pending"}),children:DNn[r]}),e.status]}),o.jsxs("div",{className:Y("flex items-center gap-3 text-neutral3 text-ui-md ","[&>span]:flex [&>span]:gap-1 [&>span]:items-center ","[&_b]:text-neutral4 [&_b]:font-semibold"),children:[o.jsxs("span",{children:["Total: ",o.jsx("b",{children:e.totalItems})]}),o.jsxs("span",{children:["Succeeded: ",o.jsx("b",{children:e.succeededCount})]}),o.jsxs("span",{children:["Failed: ",o.jsx("b",{children:e.failedCount})]}),(r==="pending"||r==="running")&&o.jsxs("span",{children:["Pending: ",o.jsx("b",{children:n})]})]})]})}function GSt({experimentId:e,experiment:t}){const{Link:r,paths:n}=or(),{data:s}=Eg(),{data:a}=c0(),{data:i}=cd(),l=()=>{switch(t.targetType){case"agent":return n.agentLink(t.targetId);case"workflow":return n.workflowLink(t.targetId);case"scorer":return n.scorerLink(t.targetId);default:return"#"}},c=()=>{const u=t.targetId;if(!u)return u;switch(t.targetType){case"agent":return s?.[u]?.name??u;case"workflow":return a?.[u]?.name??u;case"scorer":return i?.[u]?.scorer?.config?.name??u;default:return u}};return o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(hVe,{}),e," ",e&&o.jsx(ra,{content:e})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(p_,{})," Created at ",tr(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(Zn,{children:[o.jsx(p_,{})," Completed at ",tr(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(a2t,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(Zn,{children:[o.jsx(cF,{})," Version",t.targetType==="agent"&&t.targetId?o.jsx(r,{href:`${n.agentLink(t.targetId)}/editor?version=${encodeURIComponent(t.agentVersion)}`,className:"font-mono text-xs underline hover:text-accent1",children:t.agentVersion}):o.jsx("span",{className:"font-mono text-xs",children:t.agentVersion}),o.jsx(ra,{content:t.agentVersion})]})]})]}),o.jsx(Ir.Column,{children:o.jsx(LNn,{experiment:t})})]})}function Rve({delta:e}){const t=e>0?o.jsx(za,{size:"small",color:"green",intensity:"muted",children:o.jsx(nce,{})}):e<0?o.jsx(za,{size:"small",color:"red",intensity:"muted",children:o.jsx(sVe,{})}):null;return o.jsxs("span",{className:Y("font-mono text-sm text-neutral4 min-w-20"),children:[o.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function zL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function $Nn({item:e,baselineId:t,contenderId:r,baselineVersion:n,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[r],d=!!(c&&u),f=new Set;if(c)for(const p of Object.keys(c.scores))f.add(p);if(u)for(const p of Object.keys(u.scores))f.add(p);const h=[...f].sort();return o.jsxs(gr,{withLeftSeparator:!0,children:[o.jsxs(gr.Toolbar,{children:[o.jsx(wC,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(ce,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(An,{})})})]}),o.jsxs(gr.Content,{className:"pb-6",children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(lx,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(kx,{children:[h.length>0&&o.jsxs("div",{className:"grid gap-3",children:[o.jsx("h4",{className:"text-sm font-medium text-neutral5",children:"Scores"}),o.jsx("div",{className:"grid gap-2",children:h.map(p=>{const m=c?.scores[p]??null,g=u?.scores[p]??null,y=m!=null&&g!=null?g-m:null;return o.jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2 rounded-lg bg-surface2",children:[o.jsx("span",{className:"text-sm text-neutral5 font-medium",children:p}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"text-sm text-neutral3",children:[m!=null?m.toFixed(3):"-"," →"," ",g!=null?g.toFixed(3):"-"]}),y!=null&&o.jsx(Rve,{delta:y})]})]},p)})})]}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(Qd,{}),codeStr:zL(c?.output)}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(Qd,{}),codeStr:zL(u?.output)}),o.jsx(Vt.CodeSection,{title:"Item Input",icon:o.jsx(cx,{}),codeStr:zL(e.input)}),o.jsx(Vt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(AVe,{}),codeStr:zL(e.groundTruth)})]})}):o.jsx(cn,{variant:"warning",title:"Comparison not available",children:o.jsx(cn.Message,{children:(()=>{const p=c?"Contender":"Baseline",m=c?s:n;return o.jsxs(o.Fragment,{children:["The ",p," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item."]})})()})})]})]})}function FNn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(gr,{children:o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:a,children:[o.jsx(Pt.HeaderCol,{children:"Item ID"}),!s&&n.map(l=>o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[r],d=!!(c&&u);return o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Pt.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:n.map(f=>{const h=c?.scores[f]??null,p=u?.scores[f]??null,m=h!=null&&p!=null?p-h:null;return o.jsx(Pt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[h?.toFixed(2)," → ",p?.toFixed(2)]}),o.jsx(Rve,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const zNn={baseline:{label:"Baseline",color:"purple",customStyle:"items-end justify-items-end [&>div]:justify-end border-r-0 rounded-r-none"},contender:{label:"Contender",color:"cyan",customStyle:"items-start justify-items-start [&>div]:justify-start border-l-0 rounded-l-none"}};function UBe({datasetId:e,experiment:t,type:r}){const{Link:n}=or(),{label:s,color:a,customStyle:i}=zNn[r];if(!t)return null;const l=t.createdAt?new Date(t.createdAt):null;return o.jsxs("div",{className:`grid border-2 border-border1 rounded-lg p-5 gap-3 ${i}`,children:[o.jsxs("div",{className:"flex items-center gap-3 w-full overflow-clip",children:[r==="contender"&&o.jsxs(za,{size:"small",color:a,children:[s,o.jsx(Dw,{})]}),o.jsx(ce,{as:n,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),r==="baseline"&&o.jsxs(za,{size:"small",color:a,children:[o.jsx(wp,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(Zn,{children:[o.jsx(AVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(Zn,{children:[o.jsx(xVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(Zn,{children:[o.jsx(aVe,{})," ",tr(l,"MMM d, yyyy HH:mm")]})]})]})}function BNn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=rTn(e,t,r),{data:u}=G6(e,t),{data:d}=G6(e,r),f=u&&d&&u.datasetVersion!==d.datasetVersion,h=b.useMemo(()=>{if(!i)return[];const T=new Set;for(const j of i.items)for(const N of Object.values(j.results))if(N)for(const I of Object.keys(N.scores))T.add(I);return[...T].sort()},[i]),p=b.useMemo(()=>{if(!i||h.length===0)return[];const T=i.baselineId,j=t===T?r:t;return h.map(N=>{let I=0,P=0,R=0,B=0;for(const z of i.items){const H=z.results[T]?.scores[N],Q=z.results[j]?.scores[N];H!=null&&(I+=H,R++),Q!=null&&(P+=Q,B++)}const D=R>0?I/R:null,$=B>0?P/B:null,U=D!=null&&$!=null?$-D:null;return{scorerId:N,avgA:D,avgB:$,delta:U}})},[i,h,t,r]),m=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"baselineAvg",label:"Baseline Avg",size:"1fr"},{name:"comparisonAvg",label:"Comparison Avg",size:"1fr"},{name:"delta",label:"Delta",size:"1fr"}],g=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"8rem"},...s?[]:h.map(T=>({name:T,label:T,size:"1fr"}))],[h,s]),y=i?.items.find(T=>T.itemId===s)??null,x=T=>{a(T===s?null:T)},w=()=>{a(null)},S=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>=0&&T<i.items.length-1)return()=>a(i.items[T+1].itemId)},k=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>0)return()=>a(i.items[T-1].itemId)};if(l)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(Dt,{})});if(c)return o.jsx(cn,{variant:"warning",title:"Error loading comparison",children:o.jsx(cn.Message,{children:c instanceof Error?c.message:"Unknown error"})});if(!i||i.items.length===0)return o.jsx("div",{className:"text-neutral4 text-sm text-center py-8",children:"No comparison data"});const _=i.baselineId,E=t===_?r:t;return o.jsxs("div",{className:"grid gap-10",children:[u&&d&&o.jsxs("div",{className:Y("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(UBe,{datasetId:e,experiment:u,type:"baseline"}),o.jsx("div",{className:"relative flex items-center justify-center px-[2vw] before:absolute before:inset-y-0 before:left-1/2 before:-translate-x-1/2 before:w-[2px] before:bg-border1",children:o.jsx("div",{className:"relative z-1 bg-surface2 rounded-lg p-2",children:o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ce,{onClick:n,children:"VS"})}),o.jsx(Gr,{children:"Switch the order"})]})})}),o.jsx(UBe,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsx(cn,{variant:"warning",title:"Version mismatch",children:o.jsxs(cn.Message,{children:["These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})}),p.length>0&&o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:m,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(fRe,{children:[o.jsx(za,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx(za,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(fRe,{children:[o.jsx(za,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx(za,{color:"cyan",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:p.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>o.jsxs(Pt.Row,{columns:m,children:[o.jsx(Pt.TextCell,{children:T}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"flex justify-center",children:I!=null?o.jsx(Rve,{delta:I}):"-"})]},T))})})]}),o.jsxs(tf,{className:Y({"grid-cols-[1fr_2fr]":!!y}),children:[o.jsx(FNn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!y&&o.jsx($Nn,{item:y,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function UNn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=Ive(e,t),[l,c]=b.useState(!1),[u,d]=b.useState(new Set),f=x=>{r?.(x)},h=x=>s==null?x.isLatest:x.datasetVersion===s,p=x=>{d(w=>{const S=new Set(w);if(S.has(x))S.delete(x);else if(S.size>=2){const[k]=Array.from(S);return new Set([k,x])}else S.add(x);return S})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},y=()=>{u.size===2&&n?.([...u])};return o.jsxs(gr,{className:"min-w-56",children:[l?o.jsx(gr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ce,{onClick:m,children:"Cancel"}),o.jsx(Ln,{variant:"primary",disabled:u.size!==2,onClick:y,tooltipContent:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):o.jsx(o.Fragment,{children:(a||[]).length>1&&o.jsx(gr.Toolbar,{children:o.jsxs(ce,{onClick:g,className:"w-full",children:[o.jsx(zm,{})," Compare Ver."]})})}),i?o.jsx(VNn,{}):o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:a?.map(x=>{const w=String(x.datasetVersion),S=typeof x.updatedAt=="string"?new Date(x.updatedAt):x.updatedAt;return o.jsxs(Pt.Row,{isSelected:l&&u.has(w),children:[l&&o.jsx(Pt.LabelCell,{children:o.jsx(hi,{checked:u.has(w),disabled:x.isDeleted,onCheckedChange:()=>{},onClick:k=>{k.stopPropagation(),x.isDeleted||p(w)},"aria-label":`Select version ${x.datasetVersion}`})}),o.jsx(Pt.RowButton,{item:x,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:h(x),onClick:()=>f(x),className:"py-2",children:o.jsx(Pt.VersionCell,{version:x.datasetVersion,date:S,isLatest:x.isLatest,isDeleted:x.isDeleted})})]},String(x.datasetVersion))})})})]})]})}function VNn(){return o.jsxs(Pt,{children:[o.jsx(Pt.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Pt.Row,{children:o.jsx(Pt.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function qNn(e,t){if(t){const r=typeof t=="string"?new Date(t):t;return`v${e} ${tr(r,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function HNn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=Nve(e),a=(s??[]).map(i=>({value:String(i.version),label:`${qNn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(gr.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx($o,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>n?.(i,r??"")}),o.jsx($o,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:r??"",onValueChange:i=>n?.(t??"",i)}),o.jsx("div",{})]})}const QNn=[{name:"id",label:"ID",size:"1fr"},{name:"versionA",label:"Version A",size:"1fr"},{name:"versionB",label:"Version B",size:"1fr"},{name:"compare",label:"Compare",size:"10rem"}],WNn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(ds,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(TVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(g2t,{}),tooltip:"Same in both versions"}};function sre({red:e=!1,tooltip:t}){return o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ZPt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Gr,{children:t})]})}function J0({variant:e,version:t}){if(!e)return o.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:r,icon:n,tooltip:s}=WNn[e];return o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsxs("div",{className:"grid grid-cols-[1fr_auto]",children:[t!==void 0&&o.jsxs("span",{className:"pr-3 text-ui-md text-neutral4 min-w-16 flex justify-end",children:["v. ",t]}),o.jsx(za,{color:r,size:"small",children:n})]})}),o.jsx(Gr,{children:s})]})}function GNn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function ZNn({datasetId:e,versionA:t,versionB:r,allItems:n,itemsAMap:s,itemsBMap:a}){const{Link:i}=or(),l=t>r;return o.jsx(Pt,{children:o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:n.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=GNn(u,d);return o.jsxs(Pt.Row,{columns:QNn,children:[o.jsx(Pt.IdCell,{id:c,isShortened:!1}),f!=="same"?o.jsxs(o.Fragment,{children:[u?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&l?o.jsx(J0,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(J0,{variant:"changed",version:u.datasetVersion}):o.jsx(J0,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:l,tooltip:l?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!l?o.jsx(J0,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(J0,{variant:"changed",version:d.datasetVersion}):o.jsx(J0,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:!l,tooltip:l?"Not present in this version":"Deleted in this version"})})]}):o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:o.jsx(J0,{variant:"same",version:d?.datasetVersion})}),f==="changed"?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):o.jsx(Pt.Cell,{children:o.jsx(sre,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const VBe={needsReview:"#facc15",complete:"#22c55e"},YNn=[{label:"Needs Review",color:VBe.needsReview},{label:"Reviewed",color:VBe.complete}];function XNn({reviewSummary:e,experiments:t,datasets:r,isLoading:n,isError:s}){const{data:a,maxVal:i,totalInPipeline:l}=b.useMemo(()=>{if(!e?.counts||!t)return{data:[],maxVal:0,totalInPipeline:0};const u=new Map;for(const m of t)u.set(m.id,m);const d=new Map;if(r)for(const m of r)d.set(m.id,m.name);let f=0,h=0;const p=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;h+=g,g>f&&(f=g);const y=u.get(m.experimentId),x=y?.datasetId?d.get(y.datasetId):void 0,w=x?`${x} · ${m.experimentId.slice(0,8)}`:m.experimentId.slice(0,8);p.push({name:w,values:[m.needsReview,m.complete]})}return{data:p,maxVal:f,totalInPipeline:h}},[e,t,r]),c=a.length>0;return o.jsxs(Wt,{children:[o.jsxs(Wt.TopBar,{children:[o.jsx(Wt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Wt.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Wt.Loading,{}):s?o.jsx(Wt.Error,{message:"Failed to load review data"}):o.jsx(Wt.Content,{children:c?o.jsx(J_,{data:a,segments:YNn,maxVal:i,fmt:u=>String(u)}):o.jsx(Wt.NoData,{message:"No items have been sent to review yet"})})]})}function Pve(){const e=We();return Ot({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function ZSt(e){const t=new Map;if(!e?.counts)return t;for(const r of e.counts)t.set(r.experimentId,{needsReview:r.needsReview,complete:r.complete,total:r.total});return t}function KNn(e,t){const r=new Map,n=ZSt(e);if(!n.size||!t)return r;for(const s of t){const a=n.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const l=r.get(s.datasetId)??{needsReview:0,complete:0};l.needsReview+=a.needsReview,l.complete+=a.complete,r.set(s.datasetId,l)}return r}function JNn(e){return e?.counts?e.counts.reduce((t,r)=>({needsReview:t.needsReview+r.needsReview,complete:t.complete+r.complete,inPipeline:t.inPipeline+r.needsReview+r.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const eAn=10;function tAn(){const[e,t]=b.useState(!1),[r,n]=b.useState(""),[s,a]=b.useState("all"),[i,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState(0),{data:h,isLoading:p,error:m}=Lh({page:d,perPage:eAn}),{data:g,isLoading:y,error:x}=rB(),{data:w}=Pve(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>xTn(S),[S]),T=b.useMemo(()=>KNn(w,_),[w,_]),j=p||y,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(Q=>Q+1),[]),R=b.useCallback(()=>f(Q=>Math.max(0,Q-1)),[]),B=b.useCallback(Q=>{n(Q),f(0)},[]),D=b.useCallback(Q=>{a(Q),f(0)},[]),$=b.useCallback(Q=>{l(Q),f(0)},[]),U=b.useCallback(Q=>{u(Q),f(0)},[]);if(N&&Ps(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(aa,{})});if(N&&ks(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(Zs,{resource:"datasets"})});if(N)return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(pu,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(wTn,{onCreateClick:I})}),o.jsx(Rle,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||r!=="",H=()=>{n(""),a("all"),l("all"),u("all"),f(0)};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:j,children:[o.jsx(Na,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Ln,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(ds,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Datasets documentation",children:o.jsx(Li,{})})]})]}),o.jsx(OTn,{search:r,onSearchChange:B,targetFilter:s,onTargetFilterChange:D,experimentFilter:i,onExperimentFilterChange:$,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:H,hasActiveFilters:z})]}),o.jsx(yTn,{datasets:S,experiments:_,reviewByDataset:T,isLoading:j,search:r,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:k,onNextPage:P,onPrevPage:R}),o.jsx(Rle,{open:e,onOpenChange:t})]})}const rAn=new Set(["items","experiments","review"]);function nAn(){const{datasetId:e}=sa(),t=uu(),[r,n]=ao(),s=r.get("tab"),a=s&&rAn.has(s)?s:"items",i=E=>{n(E==="items"?{}:{tab:E},{replace:!0})},[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(!1),[g,y]=b.useState(null),{data:x,error:w}=Tg(e??"");if(!e)return o.jsx(zr,{children:o.jsx(df,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Ps(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})});if(w&&ks(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},k=()=>{t("/datasets")},_=E=>{y(E?.version??null)};return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(TTn,{value:e,variant:"ghost"})})]})}),o.jsxs(df,{className:"content-stretch",children:[o.jsx(hNn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(ce,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(ux,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(bNn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(mNn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(CTn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(jTn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function sAn(){const{datasetId:e,experimentId:t}=sa(),{data:r}=Tg(e??""),{data:n,isLoading:s,error:a}=G6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=tB({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Dt,{})})}):a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):a&&ks(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a||!n?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:r?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(GSt,{experimentId:t,experiment:n}),o.jsx(WSt,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function aAn(){const{datasetId:e}=sa(),[t,r]=ao(),{data:n,error:s}=Tg(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Ps(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):s&&ks(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(zm,{})}),"Compare Experiments"]})]})}),o.jsx(df,{children:o.jsxs("div",{className:"text-neutral4 text-center py-8",children:[o.jsx("p",{children:"Select two experiments to compare."}),o.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(zm,{})}),"Experiments Comparison"]})]})}),o.jsx(df,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ir.Description,{children:["Comparing"," ",o.jsx(fr,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(fr,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]})})]}),o.jsx(BNn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function iAn(){const{datasetId:e,itemId:t}=sa(),{Link:r}=or(),n=uu(),{data:s,isLoading:a,error:i}=Ive(e??"",t??""),{updateItem:l,deleteItem:c}=ni(),{data:u}=Tg(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[h,p]=b.useState(null),m=b.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(d.input,null,2),groundTruth:d.groundTruth?JSON.stringify(d.groundTruth,null,2):"",metadata:d.metadata?JSON.stringify(d.metadata,null,2):""},[d,f]),g=d?.datasetVersion??0,[y,x]=b.useState(!1),[w,S]=b.useState(m.input),[k,_]=b.useState(m.groundTruth),[E,T]=b.useState(m.metadata),[j,N]=b.useState(g);g!==j&&(N(g),S(m.input),_(m.groundTruth),T(m.metadata));const[I,P]=b.useState(!1),R=V=>{p(f?V:V.isLatest?null:V)},B=()=>{p(null)},D=!f&&h!=null,$=()=>{D||x(!0)},U=()=>{D||P(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(w)}catch{ze.error("Input must be valid JSON");return}let M;if(k.trim())try{M=JSON.parse(k)}catch{ze.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:M,metadata:W}),ze.success("Item updated successfully"),x(!1)}catch(G){ze.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},H=()=>{d&&(S(JSON.stringify(d.input,null,2)),_(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},Q=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),n(`/datasets/${e}`)}catch(V){ze.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},L=h??d,Z=L?{id:t??"",datasetId:e??"",datasetVersion:L.datasetVersion,input:L.input,groundTruth:L.groundTruth,metadata:L.metadata,createdAt:L.createdAt,updatedAt:L.updatedAt}:null;return i&&Ps(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):i&&ks(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(zr,{children:o.jsx(df,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:u?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Item"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(lx,{}),t," ",o.jsx(ra,{content:t})]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Item of ",o.jsx(Na,{})," ",u?.name]})}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(p_,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Vx,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ir.Column,{children:!y&&!f&&o.jsxs(ps,{children:[o.jsxs(ce,{onClick:$,disabled:D,title:D?"Return to latest version to edit":void 0,children:[o.jsx(TVe,{})," Edit"]}),o.jsxs(ce,{onClick:U,disabled:D,title:D?"Return to latest version to delete":void 0,children:[o.jsx(ed,{})," Delete"]})]})})]}),o.jsxs(tf,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(gr,{withRightSeparator:!y,children:[f&&d&&o.jsx(cn,{variant:"destructive",title:"Item deleted",children:o.jsxs(cn.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&D&&h&&o.jsx(cn,{variant:"warning",title:"Previous version",action:o.jsxs(cn.Button,{onClick:B,children:[o.jsx(fw,{})," Return to the latest version"]}),children:o.jsxs(cn.Message,{children:["Viewing version v",h.datasetVersion]})}),y?o.jsx(zSt,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:l.isPending}):Z?o.jsx(nB,{item:Z,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&o.jsx(gr,{children:o.jsx(UNn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{n(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:h?.datasetVersion??null})})]})]})})]}),o.jsx($t,{open:I,onOpenChange:P,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsx($t.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:Q,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function qBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function oAn(){const{datasetId:e}=sa(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Tg(e??""),{Link:i}=or(),[l,c]=b.useState(!1),{data:u}=Nle(e??"",n[0]??""),{data:d}=Nle(e??"",n[1]??"");return a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):a&&ks(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||n.length<2?o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two items to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(wp,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{}),"Compare Dataset Items"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",n.length," items of"," ",o.jsx(fr,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]}),o.jsx(ce,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(yVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(l2t,{})," Diff View"]})})]})})]}),o.jsx(tf,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(lAn,{datasetId:e,itemId:f,Link:i,idx:h,itemIds:n,showContent:!l,onItemChange:p=>{const m=[...n];m[h]=p,r({items:m.join(",")})}}),h==0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(zft,{codeA:qBe(u),codeB:qBe(d)})]})})]})}function lAn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Nle(e,t),{data:u}=kE(e),d=new Set(s.filter((h,p)=>p!==n)),f=(u??[]).map(h=>({value:h.id,label:h.id,disabled:d.has(h.id)}));return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"flex gap-4",children:[o.jsx(sge,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(ce,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Vx,{}),"Versions"]})]}),i&&o.jsx(gr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(BSt,{item:l}),o.jsx(nB,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function HBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function cAn(){const{datasetId:e,itemId:t}=sa(),[r,n]=ao(),[s,a]=b.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(p=>!isNaN(p)&&p>0)??[],{data:l,error:c}=Tg(e??""),{Link:u}=or(),{data:d}=Ive(e??"",t??""),{data:f}=Mle(e??"",t??"",i[0]??0,l?.version),{data:h}=Mle(e??"",t??"",i[1]??0,l?.version);return c&&Ps(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):c&&ks(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:l?.name}),o.jsx(jr,{as:fr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(wp,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",i.length," versions of"," ",o.jsx(fr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:fr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(wp,{}),"Back to Item"]}),o.jsx(ce,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(yVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(H2t,{})," Diff View"]})})]})})]}),o.jsx(tf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(uAn,{datasetId:e,itemId:t,datasetVersion:p,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const y=[...i];y[m]=g,n({ids:y.join(",")})}}),m===0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},p))}),s&&f&&h&&o.jsx(zft,{codeA:HBe(f),codeB:HBe(h)})]})})]})}function uAn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:l,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Mle(e,t,r,n),h=new Set(a.filter((g,y)=>y!==l)),p=s.map(g=>{const y=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",tr(y,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx(za,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:h.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Vx,{className:"w-6 h-6 opacity-50"}),o.jsx(sge,{label:"Version",name:`compare-version-${l}`,value:String(r),onValueChange:g=>u(Number(g)),options:p,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(gr.Content,{children:f?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?o.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):o.jsx(nB,{item:m,Link:i})})]})}function dAn(){const{datasetId:e}=sa(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=uu(),{data:s,error:a}=Tg(e??""),i=kE(e??"",void 0,r[0]??null),l=kE(e??"",void 0,r[1]??null),c=b.useMemo(()=>i.data??[],[i.data]),u=b.useMemo(()=>l.data??[],[l.data]),d=b.useMemo(()=>{const g=new Map;for(const y of[...c,...u])g.has(y.id)||g.set(y.id,{id:y.id,createdAt:new Date(y.createdAt)});return[...g.values()].sort((y,x)=>x.createdAt.getTime()-y.createdAt.getTime())},[c,u]),f=b.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),h=b.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&Ps(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})});if(a&&ks(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});if(!e||r.length<2)return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]});const p=(g,y,x)=>{n(`/datasets/${e}/items/${g}/versions?ids=${y?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,y)=>{n(`/datasets/${e}/versions?ids=${g},${y}`,{replace:!0})};return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(g1e,{})}),"Compare Versions"]})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(g1e,{})," Compare Dataset Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(Vx,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]})})]}),o.jsx(tf,{children:o.jsxs(gr,{children:[o.jsx(HNn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(ZNn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function fAn(e){if(!e||e.length<2)return null;const t=[...e].sort((i,l)=>new Date(i.createdAt).getTime()-new Date(l.createdAt).getTime()),r=Math.floor(t.length/2),n=r,s=t.length-r;if(n===0)return null;const a=(s-n)/n*100;return{changePct:Math.round(a*10)/10,prevValue:String(n)}}function hAn({scorers:e,datasets:t,experiments:r,avgScore:n,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:l,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,h=t?.length,p=r?.length,m=n!=null&&s!=null&&s!==0?{changePct:Math.round((n-s)/s*100*10)/10,prevValue:String(s)}:null,g=fAn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Total Scorers"}),i?o.jsx(Cn.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(f)}),o.jsx(Cn.NoChange,{message:"Static count"})]}):o.jsx(Cn.NoData,{})]}),o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Total Datasets"}),l?o.jsx(Cn.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(h)}),o.jsx(Cn.NoChange,{message:"Static count"})]}):o.jsx(Cn.NoData,{})]}),o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Avg Score"}),u?o.jsx(Cn.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(n)}),m?o.jsx(Cn.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(Cn.NoChange,{})]}):o.jsx(Cn.NoData,{})]}),o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Total Experiments"}),c?o.jsx(Cn.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(p)}),g?o.jsx(Cn.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(Cn.NoChange,{})]}):o.jsx(Cn.NoData,{})]}),o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Needs Review"}),d?o.jsx(Cn.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(a)}),a>0?o.jsx(Cn.NoChange,{message:"items pending review"}):o.jsx(Cn.NoChange,{message:"All caught up"})]}):o.jsx(Cn.NoData,{})]})]})}const pAn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],QBe="auto 1fr auto auto auto auto auto auto auto";function mAn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const gAn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function yAn({experiments:e,datasets:t,reviewByExperiment:r,isLoading:n,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=or(),u=b.useMemo(()=>{const h=new Map;return t?.forEach(p=>h.set(p.id,p.name)),h},[t]),d=b.useMemo(()=>[...e].sort((h,p)=>{const m=h.createdAt?new Date(h.createdAt).getTime():0;return(p.createdAt?new Date(p.createdAt).getTime():0)-m}),[e]),f=b.useMemo(()=>{const h=s.toLowerCase();return d.filter(p=>{const m=p.datasetId?u.get(p.datasetId)??"":"",g=!h||p.id.toLowerCase().includes(h)||m.toLowerCase().includes(h)||(p.targetId??"").toLowerCase().includes(h),y=a==="all"||p.status===a,x=i==="all"||p.datasetId===i;return g&&y&&x})},[d,s,u,a,i]);return n?o.jsx(yh,{columns:QBe}):o.jsxs(Se,{columns:QBe,children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Experiment"}),o.jsx(Se.TopCell,{children:"Dataset"}),o.jsx(Se.TopCell,{children:"Target"}),o.jsx(Se.TopCell,{children:"Status"}),o.jsx(Se.TopCell,{className:"text-center",children:"Items"}),o.jsx(Se.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(Se.TopCell,{className:"text-center",children:"Failed"}),o.jsx(Se.TopCell,{className:"text-center",children:"Review"}),o.jsx(Se.TopCell,{children:"Date"})]}),f.map(h=>{const p=h.datasetId?u.get(h.datasetId)??h.datasetId.slice(0,8):"—",m=h.status??"pending",g=h.succeededCount??0,y=h.failedCount??0,x=h.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(Se.RowLink,{to:l.experimentLink(h.id),LinkComponent:c,children:[o.jsx(Se.NameCell,{className:"font-mono",children:h.id.slice(0,8)}),o.jsx(Se.TextCell,{children:p}),o.jsx(Se.Cell,{children:o.jsxs("span",{className:"truncate",children:[h.targetType," ",h.targetId]})}),o.jsx(Se.Cell,{children:o.jsx(M1,{variant:gAn[m]??"neutral",withDot:!0,children:m})}),o.jsx(Se.TextCell,{className:"text-center",children:x}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsx("span",{className:y>0?"text-accent2":"",children:y})}),o.jsx(Se.Cell,{className:"text-center",children:(()=>{const S=r?.get(h.id);if(!S)return o.jsx("span",{className:"text-neutral2",children:"—"});const k=S.needsReview+S.complete;return k===0?o.jsx("span",{className:"text-neutral2",children:"—"}):S.needsReview>0?o.jsxs(vt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(vt,{variant:"success",children:[S.complete,"/",k," reviewed"]})})()}),o.jsx(Se.TextCell,{children:mAn(h.createdAt)})]},h.id)})]})}function vAn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const BL={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},bAn=[{label:"Completed",color:BL.completed},{label:"Running",color:BL.running},{label:"Pending",color:BL.pending},{label:"Failed",color:BL.failed}];function xAn({experiments:e,datasets:t,isLoading:r,isError:n}){const{data:s,maxVal:a}=b.useMemo(()=>{if(!e||e.length===0)return{data:[],maxVal:0};const l=new Map;if(t)for(const f of t)l.set(f.id,f.name);const c=new Map;for(const f of e){const h=f.datasetId??"unknown";c.has(h)||c.set(h,{completed:0,running:0,pending:0,failed:0});const p=c.get(h),m=f.status;m in p&&p[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,h])=>{const p=h.completed+h.running+h.pending+h.failed;return p>u&&(u=p),{name:l.get(f)??f.slice(0,12),values:[h.completed,h.running,h.pending,h.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return o.jsxs(Wt,{children:[o.jsxs(Wt.TopBar,{children:[o.jsx(Wt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Wt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Wt.Loading,{}):n?o.jsx(Wt.Error,{message:"Failed to load experiments data"}):o.jsx(Wt.Content,{children:i?o.jsx(J_,{data:s,segments:bAn,maxVal:a,fmt:l=>String(l)}):o.jsx(Wt.NoData,{message:"No experiments have been run yet"})})]})}const wAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Experiments yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Run an experiment from a dataset to evaluate ",o.jsx("br",{}),"your agents and workflows."]}),actionSlot:o.jsx("div",{className:"flex flex-col items-center gap-2",children:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(xa,{})]})})})});function SAn({search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:i,onReset:l,hasActiveFilters:c}){return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Sg,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx($o,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...pAn],value:r,onValueChange:n,className:"whitespace-nowrap"}),o.jsx($o,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(ce,{onClick:l,size:"sm",variant:"default",children:[o.jsx(An,{className:"size-3"})," Reset"]})]})]})}function OAn(){const{data:e,isLoading:t,error:r}=cd(),{data:n,isLoading:s,error:a}=Lh(),{data:i,isLoading:l,error:c}=rB(),{data:u,isLoading:d,isError:f,error:h}=vOn(),{data:p,isLoading:m,isError:g,error:y}=Pve(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>JNn(p),[p]),k=r||a||c||h||y;return k&&Ps(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(aa,{})}):k&&ks(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"evaluation"})}):k?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(pu,{title:"Failed to load evaluation data",message:k.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Tu,{})," Evaluation"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Evaluation documentation",children:o.jsx(Li,{})})})]})}),o.jsxs("div",{className:"flex flex-col gap-6 pt-4",children:[o.jsx(pie,{children:o.jsx(hAn,{scorers:e,datasets:x,experiments:w,avgScore:u?.avgScore??null,prevAvgScore:u?.prevAvgScore??null,totalNeedsReview:S.needsReview,isLoadingScorers:t,isLoadingDatasets:s,isLoadingExperiments:l,isLoadingScores:d,isLoadingReview:m})}),o.jsx(oOn,{summaryData:u?.summaryData??[],overTimeData:u?.overTimeData??[],scorerNames:u?.scorerNames??[],avgScore:u?.avgScore??null,isLoading:d,isError:f}),o.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[o.jsx(STn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(xAn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(XNn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function kAn(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=Lh(),{data:u,isLoading:d,error:f}=rB(),{data:h}=Pve(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>vAn(p),[p]),y=b.useMemo(()=>ZSt(h),[h]),x=l||d,w=f||c;if(w&&Ps(w))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(aa,{})});if(f&&ks(f))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"experiments"})});if(c&&ks(c))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"datasets"})});if(w)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(pu,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(wAn,{})});const S=r!=="all"||s!=="all"||e!=="",k=()=>{t(""),n("all"),a("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:x,children:[o.jsx(Tu,{})," Experiments"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Experiments documentation",children:o.jsx(Li,{})})})]}),o.jsx(SAn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(yAn,{experiments:m,datasets:p,reviewByExperiment:y,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function _An(){const{experimentId:e}=sa(),{data:t,isLoading:r}=rB(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=G6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=tB({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?r||i||!s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Dt,{})})}):l&&Ps(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):l&&ks(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):l||!a?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/experiments",children:[o.jsx(Ce,{children:o.jsx(Tu,{})}),"Experiments"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(GSt,{experimentId:e,experiment:a}),o.jsx(WSt,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h})]})})]}):null}function YSt({redirectUri:e,onSuccess:t,initialMode:r="signin",errorMessage:n}){const{data:s,isLoading:a}=SC(),{mutate:i,isPending:l,error:c}=Ajn(),{mutate:u,isPending:d,error:f}=Ijn(),{mutate:h,isPending:p}=LSt(),[m,g]=b.useState(r),[y,x]=b.useState(""),[w,S]=b.useState(""),[k,_]=b.useState("");if(a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Authentication is not configured"})});const{login:E}=s,T=E.type==="sso"||E.type==="both",j=E.type==="credentials"||E.type==="both",N=E.sso,I=E.signUpEnabled!==!1,P=m==="signin"||!I,R=P?l:d,B=P?c:f,D=()=>{t?t():e?window.location.href=e:window.location.href="/"},$=H=>{H.preventDefault(),P?i({email:w,password:k},{onSuccess:D}):u({email:w,password:k,name:y||void 0},{onSuccess:D})},U=()=>{h({redirectUri:e},{onSuccess:H=>{window.location.href=H.url}})},z=()=>{g(P?"signup":"signin")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[o.jsx(Yb,{className:"h-10 w-10"}),o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:P?"Sign in to Mastra Studio":"Create your account"})]}),E.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[o.jsx(SVe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"text-sm text-neutral3",children:E.description})]}),n&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:n}),j&&o.jsxs("form",{onSubmit:$,className:"space-y-4",children:[!P&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"name",className:"block text-sm text-neutral4",children:"Name"}),o.jsx(ar,{id:"name",type:"text",value:y,onChange:H=>x(H.target.value),placeholder:"Your name",variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"email",className:"block text-sm text-neutral4",children:"Email"}),o.jsx(ar,{id:"email",type:"email",value:w,onChange:H=>S(H.target.value),placeholder:"you@example.com",required:!0,variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"password",className:"block text-sm text-neutral4",children:"Password"}),o.jsx(ar,{id:"password",type:"password",value:k,onChange:H=>_(H.target.value),placeholder:P?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),o.jsx(ce,{type:"submit",disabled:R,className:"w-full",size:"lg",children:R?P?"Signing in...":"Creating account...":P?"Sign in":"Create account"}),I&&o.jsxs("div",{className:"text-center text-sm",children:[o.jsx("span",{className:"text-neutral3",children:P?"Don't have an account? ":"Already have an account? "}),o.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:P?"Sign up":"Sign in"})]})]}),T&&j&&o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border1"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&o.jsxs(ce,{onClick:U,disabled:p,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&o.jsx("span",{className:"mr-2",children:N.icon}),p?"Redirecting...":N.text||"Sign in"]})]})})}function EAn(){const[e]=ao(),t=uu(),r=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(YSt,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}function CAn(){const[e,t]=ao(),r=Tzr(e,t),n=Izr(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=Nht(),{data:d=[],isPending:f}=Aht({entityType:r.selectedEntityOption?.entityType,rootOnly:!0}),{data:h=[],isPending:p}=Iht(),{data:m=[],isPending:g}=Rht(),y=b.useMemo(()=>Szr({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:h,loading:{tags:u,entityNames:f,serviceNames:g,environments:p}}),[c,d,m,h,u,f,g,p]),x=b.useMemo(()=>Ezr({rootEntityType:r.selectedEntityOption?.entityType,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,tokens:r.filterTokens}),[r.filterTokens,r.selectedDateFrom,r.selectedDateTo,r.selectedEntityOption]),{data:w=[],isLoading:S,error:k,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T}=gzr({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=Mzr(w,r.featuredLogId,r.handleFeaturedChange,r.featuredTraceId),{data:B,isLoading:D}=Mme(r.featuredTraceId??null),{data:$,isLoading:U}=D1(r.featuredTraceId??"",r.featuredSpanId??""),z=b.useCallback(()=>r.applyFilterTokens(Czr(y,r.filterTokens)),[y,r]),H=b.useCallback(()=>r.handleFeaturedChange({logId:null}),[r]),Q=b.useCallback(G=>r.handleFeaturedChange({traceId:G,spanId:null}),[r]),L=b.useCallback((G,J)=>r.handleFeaturedChange({traceId:G,spanId:J}),[r]),Z=b.useCallback(()=>{r.handleFeaturedChange({traceId:null,spanId:null}),l(!1)},[r]),V=b.useCallback(()=>r.handleFeaturedChange({spanId:null}),[r]),M=b.useCallback(G=>r.handleFeaturedChange({spanId:G??null}),[r]);if(k)return o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(ozr,{error:k,resource:"logs",errorTitle:"Failed to load logs"})});const W=r.filterTokens.length>0||r.datePreset!=="last-24h"||!!r.selectedDateTo;return w.length===0&&!S&&!W?o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(fzr,{})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:S,children:[o.jsx(YL,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(cht,{preset:r.datePreset,onPresetChange:r.handleDatePresetChange,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,onDateChange:r.handleDateChange,disabled:S,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(fft,{fields:y,tokens:r.filterTokens,onTokensChange:r.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/logs/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Logs documentation",tooltipContent:"Go to Logs documentation",children:o.jsx(Li,{})})]})]}),o.jsx(uzr,{isLoading:S,filterFields:y,filterTokens:r.filterTokens,onFilterTokensChange:r.handleFilterTokensChange,onClear:z,onRemoveAll:r.handleRemoveAll,onSave:n.handleSave,onRemoveSaved:n.hasSavedFilters?n.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]}),o.jsx(lzr,{logCollapsed:i,listSlot:o.jsx(czr,{logs:w,isLoading:S,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:r.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(izr,{log:N,onClose:H,onTraceClick:Q,onSpanClick:L,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:r.featuredTraceId?o.jsx(NFr,{traceId:r.featuredTraceId,spans:B?.spans,isLoading:D,onClose:Z,onSpanSelect:M,selectedSpanId:r.featuredSpanId}):null,spanPanelSlot:r.featuredTraceId&&r.featuredSpanId?o.jsx(TFr,{spanId:r.featuredSpanId,span:$?.span,isLoading:U,onClose:V}):null})]})}const XSt=e=>{const t=We();return Ot({queryKey:["mcpserver-tools",e?.id],queryFn:async()=>{const n=(await t.getMcpServerTools(e?.id)).tools,s={};return n.forEach(a=>{s[a.id]=a}),s},retry:!1,refetchOnWindowFocus:!1})};function jAn({server:e}){const{paths:t,Link:r}=or(),s=We().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=XSt(e),l=Object.values(i||{}),c=l.length,u=l.filter(h=>h.toolType==="agent").length,d=l.filter(h=>h.toolType==="workflow").length,f=Ch(e.name,50);return o.jsxs(Se.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:r,children:[o.jsx(Se.NameCell,{children:f}),o.jsx(Se.DescriptionCell,{children:a}),o.jsx(Se.TextCell,{className:"text-center",children:u||""}),o.jsx(Se.TextCell,{className:"text-center",children:c||""}),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]})}function TAn({mcpServers:e,isLoading:t,search:r=""}){const n=b.useMemo(()=>{const s=r.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,r]);return t?o.jsx(yh,{columns:"auto 1fr auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"URL"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ya,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Tools",short:o.jsx(Mi,{}),tooltip:"Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Workflows",short:o.jsx(Di,{}),tooltip:"Workflow Tools",className:"text-center"})]}),n.length===0&&r?o.jsx(Se.NoMatch,{message:"No MCP Servers match your search"}):null,n.map(s=>o.jsx(jAn,{server:s},s.id))]})}const NAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No MCP Servers yet",descriptionSlot:o.jsxs(o.Fragment,{children:["MCP servers are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(xa,{})]})})}),AAn=()=>{const{data:e=[],isLoading:t,error:r}=uM(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(aa,{})}):r&&ks(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(Zs,{resource:"MCP servers"})}):r?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(pu,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(NAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(gl,{})," MCP Servers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to MCP documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(TAn,{mcpServers:e,isLoading:t,search:n})]})},IAn=(e,t)=>{const r=new Map,n=Object.keys(t);for(const s of n){const a=t[s],i=a.tools,l=Object.keys(i);for(const c of l){const u=i[c];r.has(u.id)||r.set(u.id,{...u,agents:[]}),r.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))r.has(a.id)||r.set(a.id,{...a,agents:[]});return Array.from(r.values())};function RAn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=or(),i=b.useMemo(()=>IAn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(yh,{columns:"auto 1fr auto"}):o.jsxs(Se,{columns:"auto 1fr auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ya,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&n?o.jsx(Se.NoMatch,{message:"No Tools match your search"}):null,l.map(c=>{const u=Ch(c.id,50),d=Ch(c.description??"",200),f=c.agents.length;return o.jsxs(Se.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(Se.NameCell,{children:u}),o.jsx(Se.DescriptionCell,{children:d}),o.jsx(Se.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const PAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Tools yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Mastra tools are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(xa,{})]})})}),MAn=()=>{const e=We();return Wr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new h_;Object.entries(n??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:r,requestContext:s})}catch(a){throw ze.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},DAn=({toolId:e})=>{const{canExecute:t}=Sv(),r=t("tools"),{data:n={}}=Eg(),s=b.useMemo(()=>{for(const g of Object.values(n))if(g.tools){const y=Object.values(g.tools).find(x=>x.id===e);if(y)return y}return null},[n,e]),{data:a,isLoading:i,error:l}=Jkn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=MAn(),{requestContext:h}=_s();b.useEffect(()=>{if(l){const g=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${g}`)}},[l]);const p=async(g,y)=>{if(!c)return;const x={...h??{},...y??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?lg(ag(ev(c?.inputSchema))):Gn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(_n,{className:"h-8 w-48 mb-4"}),o.jsx(_n,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(xve,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:p,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function LAn({value:e,onValueChange:t,placeholder:r="Select a tool...",searchPlaceholder:n="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=J8(),{data:h={},isLoading:p,isError:m,error:g}=Eg(),{navigate:y,paths:x}=or();b.useEffect(()=>{if(d){const _=f instanceof Error?f.message:"Failed to load tools";ze.error(`Error loading tools: ${_}`)}},[d,f]),b.useEffect(()=>{if(m){const _=g instanceof Error?g.message:"Failed to load agents";ze.error(`Error loading agents: ${_}`)}},[m,g]);const w=new Map;Object.values(h).forEach(_=>{_.tools&&Object.values(_.tools).forEach(E=>{w.has(E.id)||w.set(E.id,E)})}),Object.values(c).forEach(_=>{w.has(_.id)||w.set(_.id,_)});const S=Array.from(w.values()).map(_=>({label:_.id,value:_.id})),k=_=>{t?t(_):_&&_!==e&&y(x.toolLink(_))};return o.jsx(Gl,{options:S,value:e,onValueChange:k,placeholder:u||p?"Loading tools...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||p||d||m,variant:l})}const $An=({isLoading:e,server:t})=>{const[{sseUrl:r,httpStreamUrl:n},s]=b.useState({sseUrl:"",httpStreamUrl:""});if(b.useEffect(()=>{if(!t)return;const i=window.MASTRA_SERVER_HOST,l=window.MASTRA_SERVER_PORT;let c=null;i&&l&&(c=`http://${i}:${l}`);const u=c||"http://localhost:4111",d=`${u}/api/mcp/${t.id}/sse`,f=`${u}/api/mcp/${t.id}/mcp`;s({sseUrl:d,httpStreamUrl:f})},[t]),e)return null;if(!t)return o.jsx(df,{children:o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${r}`;return o.jsxs(df,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),o.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[o.jsx(vt,{icon:o.jsx(B9,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(vt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(me,{className:"text-neutral3 pb-4",children:"This MCP server can be accessed through multiple transport methods. Choose the one that best fits your use case."}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(ra,{tooltip:"Copy HTTP Stream URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(ra,{tooltip:"Copy SSE URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(ra,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(FAn,{server:t})})]})},FAn=({server:e})=>{const{data:t={},isLoading:r}=XSt(e);if(r)return null;const n=Object.keys(t);return o.jsxs("div",{className:"p-5 overflow-y-scroll",children:[o.jsxs("div",{className:"text-neutral6 flex gap-2 items-center",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(gl,{})}),o.jsx(me,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),o.jsx("div",{className:"flex flex-col gap-2 pt-6",children:n.map(s=>{const a=t[s];return o.jsx(zAn,{tool:a,serverId:e.id},s)})})]})},zAn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=or(),a=F1t[e.toolType||"tool"];return o.jsxs(wf,{onClick:()=>r.current?.click(),children:[o.jsx(Cdt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(kf,{children:[o.jsx(Sf,{children:o.jsx(n,{ref:r,href:s.mcpServerToolLink(t,e.id),children:e.id})}),o.jsx(Of,{children:e.description})]})]})},BAn=()=>{const{serverId:e}=sa(),{data:t=[],isLoading:r}=uM(),n=t.find(s=>s.id===e);return o.jsxs(zr,{children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(gl,{})}),"MCP Servers"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(rSt,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"MCP documentation"]})})]}),o.jsx($An,{isLoading:r,server:n})]})},KSt=(e,t)=>{const{requestContext:r}=_s(),n=We();return Ot({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},UAn=(e,t)=>{const{requestContext:r}=_s(),n=We();return Wr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},VAn=({toolId:e,serverId:t})=>{const{canExecute:r}=Sv(),n=r("tools"),{data:s,isLoading:a,error:i}=KSt(t,e),{mutateAsync:l,isPending:c,data:u}=UAn(t,e);b.useEffect(()=>{if(i){const h=i instanceof Error?i.message:"Failed to load tool";ze.error(`Error loading tool: ${h}`)}},[i]);const d=async h=>{if(s)return await l(h)};if(a)return o.jsxs("div",{className:"p-6",children:[o.jsx(_n,{className:"h-8 w-48 mb-4"}),o.jsx(_n,{className:"h-32 w-full"})]});if(i)return null;if(!s)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!n)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=lg(ag(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Gn({})}return o.jsx(xve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},qAn=()=>{const{data:e}=uM(),{serverId:t,toolId:r}=sa(),{data:n,isLoading:s}=KSt(t,r),a=e?.find(c=>c.id===t),i=n?.name,l=a?.name||"";return s||!n?null:o.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(gl,{})}),"MCP Servers"]}),o.jsx(jr,{as:fr,to:`/mcps/${t}`,children:l}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"MCP documentation"]})})]}),o.jsx(VAn,{toolId:r,serverId:t})]})};function HAn(){const{data:e,isLoading:t,isError:r}=uFr();return o.jsx(eFr,{data:e,isLoading:t,isError:r})}function QAn(){const{data:e,isLoading:t,isError:r}=Sht();return o.jsx(Ame,{label:"Total Agent Runs",value:e?.value!=null?e.value.toLocaleString():null,prevValue:e?.previousValue!=null?e.previousValue.toLocaleString():void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function WAn(){const{data:e,isLoading:t,isError:r}=oFr();return o.jsx(Ame,{label:"Total Model Cost",value:e?.cost!=null?Vw(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Vw(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:r})}function GAn(){const{data:e,isLoading:t,isError:r}=lFr();return o.jsx(Ame,{label:"Total Tokens",value:e?.value!=null?Mm(e.value):null,prevValue:e?.previousValue!=null?Mm(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function ZAn(){const{data:e,isLoading:t,isError:r}=cFr();return o.jsx(tFr,{rows:e,isLoading:t,isError:r})}function YAn(){const{data:e,isLoading:t,isError:r}=fFr();return o.jsx(rFr,{data:e,isLoading:t,isError:r})}function XAn(){const{data:e,isLoading:t,isError:r}=hFr();return o.jsx(sFr,{data:e,isLoading:t,isError:r})}function KAn(){const{data:e,isLoading:t,isError:r}=dFr();return o.jsx(aFr,{data:e,isLoading:t,isError:r})}const JAn=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),are="period";function eIn(){const[e,t]=ao(),r=e.get(are),n=bht(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(are):l.set(are,a),l},{replace:!0})},[t]);return o.jsx(X6r,{initialPreset:n,onPresetChange:s,children:o.jsx(tIn,{})})}function tIn(){const{error:e}=Sht(),{data:t,isLoading:r}=H8(),n=t?.observabilityStorageType,s=n?JAn.has(n):!1,a=n==="ObservabilityInMemory";return e&&Ps(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(aa,{})}):e&&ks(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(Zs,{resource:"metrics"})}):e?o.jsx(Jr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(pu,{title:"Failed to load metrics",message:e.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(sk,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(K6r,{}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:o.jsx(Li,{})})]})]})}),r?null:s?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[a&&o.jsx(cn,{variant:"info",title:"Metrics are not persisted",children:o.jsx(cn.Message,{children:"This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB."})}),o.jsxs(pie,{children:[o.jsx(QAn,{}),o.jsx(WAn,{}),o.jsx(GAn,{})]}),o.jsxs(pie,{children:[o.jsx(ZAn,{}),o.jsx(XAn,{}),o.jsx(YAn,{}),o.jsx(KAn,{}),o.jsx(HAn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"Metrics are not available with your current storage",descriptionSlot:"Metrics require ClickHouse, DuckDB, or in-memory storage for observability. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(xa,{})]})})})]})}const rIn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:sk,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:xo,href:"/observability"}];function nIn(){return o.jsxs(mk,{children:[o.jsx(mk.Top,{children:o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{children:[o.jsx(xo,{})," Observability"]})})})}),o.jsx("div",{className:"px-6 pt-6 overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:rIn.map(e=>o.jsxs(fr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}const sIn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:ya,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:Yi,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:Di,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:e1,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:gl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Mi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:nc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:TE,href:"/request-context"}];function aIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(K2t,{})," Primitives"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:sIn.map(e=>o.jsxs(fr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function iIn(){const{paths:e}=or(),{data:t,isLoading:r,error:n}=Q1t(),{isCmsAvailable:s}=cM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ps(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(aa,{})}):n&&ks(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Zs,{resource:"prompt blocks"})}):n?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(pu,{title:"Failed to load prompt blocks",message:n.message})}):l.length===0&&!r?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Vkn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:r,children:[o.jsx(Yi,{})," Prompts"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Prompts documentation",children:o.jsx(Li,{})}),s&&o.jsxs(ce,{as:fr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(ds,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(Ukn,{promptBlocks:l,isLoading:r,search:a})]})}function oIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(TE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(Y1n,{children:o.jsx(O1t,{})})})]})}const lIn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:h2t,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Li,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:xa,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:rA,href:"https://discord.gg/BTYqqHKUrf",external:!0},{title:"Share with your team",description:"Running Mastra Studio locally? Deploy to the cloud so your team can collaborate.",icon:gVe,href:"https://mastra.ai/cloud",external:!0},{title:"Talk to our Sales team",description:"Get a custom demo, discuss on-prem deployments, and how we can help you accelerate getting agents into production.",icon:oMt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function cIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Li,{})," Resources"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:lIn.map(e=>o.jsxs("a",{href:e.href,...e.external?{target:"_blank",rel:"noreferrer"}:{},className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&o.jsx(xa,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function uIn(){const{data:e={},isLoading:t,error:r}=cd(),[n,s]=b.useState(""),[a,i]=b.useState("all");if(r&&Ps(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(aa,{})});if(r&&ks(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(Zs,{resource:"scorers"})});if(r)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(pu,{title:"Failed to load scorers",message:r.message})});if(Object.keys(e).length===0&&!t)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(cOn,{})});const l=a!=="all"||n!=="",c=()=>{s(""),i("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(La,{})," Scorers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})})})]}),o.jsx(dOn,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(lOn,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function dIn(){const{scorerId:e}=sa(),[t,r]=ao(),n=t.get("scoreId")??void 0,[s,a]=b.useState(n),[i,l]=b.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,isLoading:u,error:d}=aOn(e),{data:f={},isLoading:h,error:p}=Eg(),{isLoading:m,error:g}=c0(),{data:y=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=sOn({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=b.useMemo(()=>c?.agentIds?.filter(L=>f[L]).map(L=>({value:L,label:f[L].name,type:"AGENT"}))||[],[c?.agentIds,f]),T=b.useMemo(()=>c?.workflowIds?.map(L=>({value:L,label:L,type:"WORKFLOW"}))||[],[c?.workflowIds]),j=b.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...E,...T],[E,T]),N=t.get("entity")??"all",I=j.find(L=>L.value===N);I&&I.value!==i?.value&&l(I),b.useEffect(()=>{if(d){const L=d instanceof Error?d.message:"Failed to load scorer";ze.error(`Error loading scorer: ${L}`)}},[d]),b.useEffect(()=>{if(p){const L=p instanceof Error?p.message:"Failed to load agents";ze.error(`Error loading agents: ${L}`)}},[p]),b.useEffect(()=>{if(g){const L=g instanceof Error?g.message:"Failed to load workflows";ze.error(`Error loading workflows: ${L}`)}},[g]);const P=L=>{L?.value&&r(Z=>{const V=new URLSearchParams(Z);return V.set("entity",L.value),V})};b.useEffect(()=>{const L=t.get("scoreId")??void 0;if(L===s)return;if(!L){a(void 0);return}y.find(V=>V.id===L)&&a(L)},[t,y]);const R=b.useCallback(L=>{a(L||void 0),r(Z=>{const V=new URLSearchParams(Z);return L?V.set("scoreId",L):V.delete("scoreId"),V})},[r]);if(!c)return null;const B=Ps(d)||Ps(p)||Ps(g),D=d&&ks(d),$=!B&&!D&&(d||p||g),U=!x&&y.length===0,z=i?.value!=="all",H=o.jsxs(o.Fragment,{children:[o.jsxs(Xa,{children:[o.jsx(jr,{as:fr,to:"/scorers",children:"Scorers"}),o.jsx(iOn,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(xn,{children:[o.jsxs(xn.Title,{isLoading:u,children:[o.jsx(La,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(xn.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Scorers documentation",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})}),c?.scorer?.source==="stored"&&o.jsxs(ce,{variant:"default",as:fr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(iv,{})," Edit"]})]})]})]});if(B||D||$||U&&!z){const L=(d instanceof Error?d.message:void 0)??(p instanceof Error?p.message:void 0)??(g instanceof Error?g.message:void 0)??"An unexpected error occurred";return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{children:H}),o.jsx(bt.MainArea,{isCentered:!0,children:B?o.jsx(aa,{}):D?o.jsx(Zs,{resource:"scorers"}):$?o.jsx(pu,{title:"Failed to load scorer",message:L}):o.jsx(XSn,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(eOn,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{r(L=>{const Z=new URLSearchParams(L);return Z.set("entity","all"),Z})},isLoading:x||h||m})]}),o.jsx(YSn,{scores:y,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const fIn=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],hIn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=cve(),{theme:n,setTheme:s}=yC();return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(hme,{})," Settings"]})})}),o.jsxs(bt.MainArea,{className:"grid gap-8 mt-6",children:[o.jsx("section",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("h2",{className:"text-icon6 font-medium",children:"Theme"}),o.jsx(kft,{name:"theme",label:"Theme mode",value:n,onValueChange:a=>s(a),options:fIn.map(a=>({...a}))})]})}),o.jsx(E1t,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r}})]})]})};function pIn(){const[e]=ao(),t=uu(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(YSt,{redirectUri:r,onSuccess:n,initialMode:"signup"})}function mIn(e){return e.replace(/\/$/,"").split("/").pop()}function sB({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function gIn({templates:e,linkComponent:t,className:r,isLoading:n}){const s=t||"a";return n?o.jsx("div",{className:Y("grid gap-y-4",r),children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):o.jsx("div",{className:Y("grid gap-y-4",r),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return o.jsxs("article",{className:Y("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[o.jsxs(s,{to:`/templates/${a.slug}`,className:Y("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Y("overflow-hidden"),children:o.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),o.jsxs("div",{className:Y("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[o.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),o.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),o.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&o.jsxs("ul",{className:Y("flex gap-4 text-ui-md text-neutral3 m-0 p-0 list-none","[&>li]:flex [&>li]:items-center [&>li]:gap-0.5 text-neutral4"),children:[a?.agents&&a.agents.length>0&&o.jsxs("li",{children:[o.jsx(ya,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(Mi,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(_Ve,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(hF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(gl,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&o.jsx("small",{children:"|"}),o.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(l=>o.jsx("span",{className:"",children:l},l))})]})]})]}),o.jsx("a",{href:a.githubUrl,className:Y("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:o.jsxs("span",{className:"flex items-center gap-2 px-2 py-1 rounded bg-surface1 group-hover:bg-surface2 text-neutral3 transition-colors group-hover:text-neutral5",children:[o.jsx(vdt,{})," ",mIn(a.githubUrl)]})})]},a.slug)})})}function yIn({tagOptions:e,selectedTag:t,providerOptions:r,selectedProvider:n,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:l,onReset:c,className:u,isLoading:d}){return d?o.jsxs("div",{className:Y("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[o.jsx("div",{})," ",o.jsx("div",{})," ",o.jsx("div",{})]}):o.jsxs("div",{className:Y("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(Ox,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx($o,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx($o,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:n,onValueChange:a,options:r}),c&&o.jsxs(ce,{onClick:c,children:["Reset ",o.jsx(An,{})]})]})}function vIn(){const{data:e,isLoading:t}=Vzr(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=b.useState("all"),[l,c]=b.useState("all"),[u,d]=b.useState(""),f=[{value:"all",label:"Any tag"}];(n||[]).forEach(w=>{f.push({value:w,label:w})});const h=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{h.push({value:w,label:w})});const p=(w,S)=>{S==="tag"?i(w):S==="provider"&&c(w)},m=w=>{d(w)},g=()=>{i("all"),c("all"),d("")},y=r.filter(w=>!(u&&!w.title.toLowerCase().includes(u)&&!w.description.toLowerCase().includes(u)||a!=="all"&&!w.tags.includes(a)||l!=="all"&&!w.supportedProviders.includes(l))),x=u||a!=="all"||l!=="all";return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Qu,{children:[o.jsx(Ce,{children:o.jsx(Fb,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(yIn,{selectedTag:a,onTagChange:w=>p(w,"tag"),tagOptions:f,selectedProvider:l,onProviderChange:w=>p(w,"provider"),providerOptions:h,searchTerm:u,onSearchChange:m,onReset:x?g:void 0,className:"max-w-[80rem]",isLoading:t}),o.jsx(gIn,{templates:y,linkComponent:fr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const bIn="1.31.0-alpha.5";function xIn({errorMsg:e,validationErrors:t}){const r=typeof e=="string"?e:e!=null?String(e):void 0,n=r?.includes("Invalid schema for function"),s=r?.includes("validation issue")||t&&t.length>0,a=()=>s?"Template installation completed but some validation issues remain. The template may still be functional, but you should review and fix these issues.":n?"There was an issue with the AI model configuration. This may be related to the selected model or AI SDK version compatibility.":"An unexpected error occurred during template installation.",i=()=>s?{icon:o.jsx(IE,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(z2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(sB,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l,o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),o.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&o.jsxs("details",{className:"text-xs",children:[o.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto max-h-60 text-left space-y-2",children:t.map((u,d)=>o.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[o.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),o.jsx("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap wrap-break-word",children:u.message})]},d))})]}),r&&!s&&o.jsxs("details",{className:"text-xs",children:[o.jsx("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:"Show Details"}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs font-mono overflow-auto max-h-60 text-left",children:o.jsx("div",{className:"whitespace-pre-wrap wrap-break-word",children:r})})]})]})}function wIn({providerOptions:e,selectedProvider:t,onProviderChange:r,variables:n,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:l,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return o.jsx(sB,{children:o.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[o.jsxs("h2",{className:Y("text-neutral4 text-header-sm font-semibold flex items-center gap-2","[&>svg]:w-[1.2em] [&_svg]:h-[1.2em] [&_svg]:opacity-70"),children:["Install Template ",o.jsx(EVe,{})]}),o.jsx($o,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:r,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(n||{}).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),o.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:l?o.jsxs("div",{className:Y("flex items-center justify-center col-span-2 text-neutral3 text-ui-sm gap-4","[&_svg]:opacity-50 [&_svg]:w-[1.1em] [&_svg]:h-[1.1em]","animate-in fade-in duration-300"),children:[o.jsx(Dt,{})," Loading variables..."]}):Object.entries(n).map(([h,p])=>o.jsxs(b.Fragment,{children:[o.jsx(Sx,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(Sx,{name:h,labelIsHidden:!0,label:"Value",value:p,onChange:i,errorMsg:s.includes(h)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},h))}),o.jsxs("div",{className:"border-t border-border1 pt-12 mt-3.5 relative",children:[o.jsx("div",{className:"absolute w-8 h-8 rounded-full bg-surface2 top-0 left-1/2 -translate-x-1/2 -translate-y-4 text-ui-sm text-neutral3 flex items-center justify-center",children:"And"}),o.jsx("h3",{className:"text-neutral4 text-ui-lg",children:"Set AI Model for Template Installation"}),o.jsx("p",{className:"text-neutral3 text-ui-md mt-2 mb-8",children:"This model will be used by the workflow to process and install the template"}),o.jsx(k1t,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(ce,{className:Y("flex items-center gap-2 mt-4 justify-center text-ui-md w-full bg-surface5 min-h-10 rounded-lg text-neutral5 hover:bg-surface6 transition-colors","[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-neutral5"),onClick:a,disabled:!t||!u||!d||s.length>0||c,children:c?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(Dw,{})]})})]})})}function SIn({title:e,description:t,githubUrl:r,isLoading:n,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Y("grid mt-8 items-center"),children:o.jsxs("div",{className:Y("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[o.jsx(Fb,{}),o.jsx("h2",{className:Y({"bg-surface4 flex rounded-lg min-w-[50%]":n}),children:n?o.jsx(o.Fragment,{children:" "}):e})]})}),o.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[o.jsxs("div",{className:"grid",children:[o.jsx("p",{className:Y("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":n}),children:n?o.jsx(o.Fragment,{children:" "}):t}),!n&&a&&o.jsxs("div",{className:Y("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[o.jsx("div",{className:"shrink-0 mt-0.5",children:o.jsx(zy,{className:"w-[1.1em] h-[1.1em] text-blue-500"})}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(cF,{className:"w-[1em] h-[1em] text-neutral4"}),o.jsx("span",{className:"text-ui-md font-medium text-neutral5",children:"A new Git branch will be created"})]}),o.jsxs("div",{className:"text-ui-sm text-neutral4 space-y-1",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Branch name:"})," ",o.jsx("code",{className:"bg-surface3 px-1.5 py-0.5 rounded text-ui-sm font-mono",children:i})]}),o.jsx("div",{children:"This ensures safe installation with easy rollback if needed. Your main branch remains unchanged."})]})]})]}),r&&o.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[o.jsx(vdt,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(OS,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function OIn({name:e,streamResult:t,workflowInfo:r}){const n=t?.phase||"initializing",s=t?.payload?.workflowState,a=t?.payload?.currentStep,i=t?.error,l=s?.steps||{},c=Object.keys(l).length>0,u=m=>m==="input"||m.endsWith(".input")||m.startsWith("Mapping_")&&/[0-9a-f]{8}/.test(m)||/[0-9a-f]{8,}/.test(m)?!1:r?.allSteps?m in r.allSteps:!0,d=Object.entries(l).filter(([m,g])=>u(m)),f=d.length,h=()=>{switch(n){case"initializing":return"Preparing template installation...";case"processing":return`Installing ${e} template`;case"completed":return"Template installation completed!";case"error":return"Template installation failed";default:return"Installing template..."}},p=d.map(([m,g])=>({id:m,status:g?.status,description:g?.description,title:m.charAt(0).toUpperCase()+m.slice(1).replace(/-/g," "),isActive:a?.id===m}));return o.jsxs(sB,{className:"space-y-6 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h3",{className:"text-lg font-semibold text-neutral5",children:h()}),t?.runId&&o.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(n)&&o.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:o.jsx(W3r,{steps:p})}),i&&n==="error"&&o.jsxs("div",{className:Y("rounded-lg text-neutral5 p-6 flex items-center gap-3 text-ui-md bg-red-500/10","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:opacity-70 [&>svg]:text-red-500"),children:[o.jsx(IDt,{}),i||"Something went wrong"]}),c&&o.jsx(Q3r,{steps:p,currentStep:a,className:"pb-4"}),!c&&n==="initializing"&&o.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[o.jsx(Dt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function kIn({name:e,installedEntities:t}){return o.jsxs(sB,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(EVe,{}),o.jsx("h2",{className:"text-header-md",children:"Done!"}),o.jsxs("p",{className:"text-ui-md text-center text-neutral3 ",children:["The ",o.jsx("b",{className:"text-neutral4",children:e})," template has been successfully installed.",t&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("br",{})," Installed entities are listed below."]})]}),t&&t.length>0&&o.jsx(OS,{data:t})]})}function _In(){const{templateSlug:e}=sa(),[t,r]=ao(),[n,s]=b.useState(""),[a,i]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState({}),[f,h]=b.useState([]),[p,m]=b.useState(null),[g,y]=b.useState(!1),[x,w]=b.useState(""),[S,k]=b.useState(!1),[_,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=qzr({repoOrSlug:e,owner:"mastra-ai"}),R=bIn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:D}=Hzr({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:$,isLoading:U}=Qzr(),{mutateAsync:z,isPending:H}=Wzr(),{mutateAsync:Q}=Gzr(),{streamInstall:L,streamResult:Z,isStreaming:V}=Yzr($),{observeInstall:M,streamResult:W,isStreaming:G}=Xzr($);b.useEffect(()=>{const se=t.get("runId");se&&!g&&!p&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:se}),w(se),Q({runId:se}).then(le=>{const xe=le.snapshot;if(xe?.status==="success"&&xe?.result?.success)y(!0);else if(xe?.result?.success===!1)if(xe?.result?.validationResults&&!xe?.result?.validationResults?.valid&&xe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ue,errors:ve}=xe.result.validationResults,we=`Template installation completed but ${ue} validation issue${ue>1?"s":""} remain unresolved.`;m(we),j(ve||[])}else{const ue=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof ue=="string"?ue:String(ue))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,p,V,G,Q]),b.useEffect(()=>{const se=t.get("runId"),le=t.get("resume"),xe=t.get("provider");if(se&&le==="true"&&xe&&!V&&!G&&!S&&!_&&$){w(se),k(!0);try{Q({runId:se}).then(de=>{if(de.snapshot?.status==="running")return M.mutateAsync({runId:se})}).then(()=>{r(de=>{const ue=new URLSearchParams(de);return ue.delete("resume"),ue})}).catch(de=>{console.error("❌ Failed to resume template installation:",de),de.message?.includes("404")||de.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(de){console.error("❌ Auto-resume failed with error:",de),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,G,S,_,$,Q,M,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ae=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(se=>se).join(", "):"n/a",icon:o.jsx(Mi,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(se=>se).join(", "):"n/a",icon:o.jsx(ya,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(se=>se).join(", "):"n/a",icon:o.jsx(hF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Em,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(AE,{})}],te=[{...ae[0]},{...ae[1]},{...ae[2]}].filter(se=>se.value!=="n/a");b.useEffect(()=>{B&&d(B)},[B]),b.useEffect(()=>{const se=Z||W;se?.phase==="error"&&se?.error&&m(typeof se.error=="string"?se.error:String(se.error))},[Z?.phase,Z?.error,W?.phase,W?.error]);const re=se=>{s(se)},ie=async se=>(i(se.provider),c(se.modelId),{message:"Model updated successfully"}),he=async()=>{const se=Object.entries(u).reduce((le,[xe,de])=>(de===""&&le.push(xe),le),[]);if(se.length>0){h(se);return}if(N){m(null),y(!1),w(""),E(!0);try{const xe={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:R,slug:N.slug,variables:u},{runId:de}=await z({});w(de),r(ue=>{const ve=new URLSearchParams(ue);return ve.set("runId",de),ve.set("resume","true"),ve.set("provider",n||"openai"),ve}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:de})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},X=se=>{const{name:le,value:xe}=se.target;xe.trim()===""?h(de=>[...de,le]):h(de=>de.filter(ue=>ue!==le)),d(de=>({...de,[le]:xe}))};return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/templates",children:[o.jsx(Ce,{children:o.jsx(Fb,{})}),"Templates"]}),o.jsx(jr,{as:fr,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:o.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[o.jsx(SIn,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ae,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(V||G)&&o.jsx(OIn,{name:N.title,streamResult:G?W:Z,runId:x,workflowInfo:$}),g&&o.jsx(kIn,{name:N.title,installedEntities:te,linkComponent:fr}),p&&o.jsx(xIn,{errorMsg:p,validationErrors:T.length>0?T:Z?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!p&&o.jsx(wIn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:he,handleVariableChange:X,isLoadingEnvVars:D||U,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const EIn=()=>{const{toolId:e,agentId:t}=sa();return o.jsxs(zr,{children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ya,{})}),"Agents"]}),o.jsx(jr,{as:fr,to:`/agents/${t}/chat`,children:t}),o.jsx(jr,{as:fr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(o0,{})}),"Tools documentation"]})})]}),o.jsx($On,{toolId:e,agentId:t})]})},CIn=()=>{const{toolId:e}=sa();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/tools",children:[o.jsx(Ce,{children:o.jsx(Mi,{})}),"Tools"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(LAn,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"Tools documentation"]})})]}),o.jsx(DAn,{toolId:e})]})};function jIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍 Positive (1)":e.value===0||e.value===-1?"👎 Negative":String(e.value):e.feedbackType==="rating"?String(e.value):e.feedbackType==="comment"?String(e.value??e.comment??"-"):String(e.value??"-")}function TIn({feedback:e,isOpen:t,onClose:r,onNext:n,onPrevious:s}){const a=e?.metadata&&Object.keys(e.metadata).length>0?JSON.stringify(e.metadata,null,2):void 0;return o.jsxs(Vt,{dialogTitle:"Feedback Detail",dialogDescription:"View feedback details",isOpen:t,onClose:r,level:3,children:[o.jsxs(Vt.Top,{children:[o.jsxs(Zn,{children:[o.jsx(rA,{})," Feedback"]}),"|",o.jsx(Vt.Nav,{onNext:n,onPrevious:s})]}),o.jsxs(Vt.Content,{children:[o.jsxs(Vt.Header,{children:[o.jsxs(Vt.Heading,{children:[o.jsx(rA,{})," Feedback"]}),e?.traceId&&o.jsxs(Zn,{children:[o.jsx(g_,{})," ",e.traceId]})]}),o.jsxs(kx,{children:[o.jsx(OS,{data:[{label:"Created at",value:e?.timestamp?tr(new Date(e.timestamp),"MMM d, h:mm:ss aaa"):"n/a",key:"timestamp"},{label:"Type",value:e?.feedbackType??"n/a",key:"type"},{label:"Value",value:e?jIn(e):"n/a",key:"value"},...e?.comment?[{label:"Comment",value:e.comment,key:"comment"}]:[],{label:"Source",value:e?.feedbackSource??e?.source??"n/a",key:"source"},...e?.feedbackUserId?[{label:"User",value:e.feedbackUserId,key:"userId"}]:[],...e?.traceId?[{label:"Trace ID",value:e.traceId,key:"traceId"}]:[],...e?.spanId?[{label:"Span ID",value:e.spanId,key:"spanId"}]:[]]}),a&&o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(g_,{}),codeStr:a,simplified:!0})]})]})]})}const UL=[{name:"source",label:"Source",size:"1fr"},{name:"date",label:"Date",size:"0.8fr"},{name:"time",label:"Time",size:"0.8fr"},{name:"value",label:"Value",size:"0.6fr"},{name:"comment",label:"Comment",size:"2fr"}];function NIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍":e.value===0||e.value===-1?"👎":String(e.value):typeof e.value=="number"?String(e.value):"—"}function AIn(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function JSt({feedbackData:e,isLoadingFeedbackData:t,onPageChange:r}){const[n,s]=b.useState(!1),[a,i]=b.useState(),l=e?.feedback??[],c=h=>{i(l[h]),s(!0)};if(t)return o.jsx(wft,{columns:UL});const u=a?l.indexOf(a):-1,d=u>=0&&u<l.length-1?()=>i(l[u+1]):void 0,f=u>0?()=>i(l[u-1]):void 0;return o.jsxs(o.Fragment,{children:[o.jsxs(pa,{children:[o.jsxs(pa.Trim,{children:[o.jsx(pa.Header,{columns:UL}),l.length>0?o.jsx(pa.Entries,{children:l.map((h,p)=>{const m=new Date(h.timestamp),g=xg(m),y={id:`${h.traceId}-${p}`,source:h.feedbackUserId||h.feedbackSource||"unknown",date:g?"Today":tr(m,"MMM dd"),time:tr(m,"h:mm:ss aaa"),value:NIn(h),comment:AIn(h)};return o.jsx(pa.Entry,{columns:UL,onClick:()=>c(p),entry:y,children:UL.map(x=>o.jsx(pa.EntryText,{children:String(y[x.name]??"")},`col-${x.name}`))},y.id)})}):o.jsx(pa.Message,{message:"No feedback found",type:"info"})]}),o.jsx(pa.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>{const h=e?.pagination?.page||0;h>0&&r?.(h-1)}})]}),o.jsx(TIn,{feedback:a,isOpen:n,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const WBe="auto auto auto auto 1fr";function eOt({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(Y9,{columns:WBe}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Ac,{columns:WBe,className:"min-w-0",children:[o.jsxs(Ac.Top,{children:[o.jsx(Ac.TopCell,{children:"ID"}),o.jsx(Ac.TopCell,{children:"Date"}),o.jsx(Ac.TopCell,{children:"Time"}),o.jsx(Ac.TopCell,{children:"Score"}),o.jsx(Ac.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=xg(a);return o.jsxs(Ac.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Ac.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:ef(s?.id)||"n/a"}),o.jsx(Ac.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":tr(a,"MMM dd")}),o.jsx(Ac.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:tr(a,"h:mm:ss aaa")}),o.jsx(Ac.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Ac.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Ac.NoMatch,{message:"No scores found"})]}),o.jsx(Ac.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>r?.((e?.pagination?.page||0)-1)})]})}const tOt=({traceId:e="",page:t})=>{const r=We(),n=t??0;return Ot({queryKey:["trace-feedback",e,n],queryFn:()=>r.listFeedback({filters:{traceId:e},pagination:{page:n,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})};function IIn(){const[e,t]=ao(),[r,n]=b.useState(!1),s=tzr(e,t,{onRemoveAll:()=>n(!1)}),[a,i]=b.useState(),[l,c]=b.useState(0),[u,d]=b.useState(!1),[f,h]=b.useState(null);b.useEffect(()=>c(0),[s.traceIdParam,s.spanIdParam]);const{data:p,isLoading:m}=cd(),{data:g,isLoading:y}=vve({traceId:s.traceIdParam,spanId:s.spanIdParam,page:l}),[x,w]=b.useState(0);b.useEffect(()=>w(0),[s.traceIdParam,s.spanIdParam]);const{data:S,isLoading:k}=tOt({traceId:s.traceIdParam,page:x}),{data:_,isLoading:E}=Mme(s.traceIdParam??null),T=b.useMemo(()=>_?.spans,[_?.spans]),{data:j,isLoading:N}=D1(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ue=>ue.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=Nht(),{data:B=[],isPending:D}=Aht({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:$=[],isPending:U}=Iht(),{data:z=[],isPending:H}=Rht(),Q=b.useMemo(()=>WFr({availableTags:P,availableRootEntityNames:B,availableServiceNames:z,availableEnvironments:$,loading:{tags:R,entityNames:D,serviceNames:H,environments:U}}),[P,B,z,$,R,D,H,U]),L=b.useMemo(()=>XFr({rootEntityType:s.selectedEntityOption?.entityType,status:s.selectedStatus,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,tokens:s.filterTokens}),[s.filterTokens,s.selectedDateFrom,s.selectedDateTo,s.selectedEntityOption,s.selectedStatus]),{data:Z,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,error:J}=zFr({filters:L}),ae=b.useMemo(()=>Z?.spans??[],[Z?.spans]),te=Z?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=Pht(T,s.spanIdParam??null,ue=>s.handleSpanChange(ue)),he=szr(e,t),X=b.useCallback(()=>s.applyFilterTokens(KFr(Q,s.filterTokens)),[Q,s]),{handlePreviousTrace:se,handleNextTrace:le}=JFr(ae,s.traceIdParam,s.handleTraceClick),xe=b.useCallback(()=>{const ue=T?.find(ve=>ve.parentSpanId==null);ue&&(s.handleSpanChange(ue.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(Jr,{title:"Traces",icon:o.jsx(xo,{}),children:o.jsx(Tht,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const de=!!s.selectedEntityOption||!!s.selectedStatus||s.filterTokens.length>0||s.datePreset!=="last-24h"||!!s.selectedDateTo;return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:V,children:[o.jsx(xo,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(cht,{preset:s.datePreset,onPresetChange:s.handleDatePresetChange,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,onDateChange:s.handleDateChange,disabled:V,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(fft,{fields:Q,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Ln,{disabled:V,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ue=>!ue),children:r?o.jsx(m3,{}):o.jsx(wVe,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})})]})]}),o.jsx(OFr,{isLoading:V,filterFields:Q,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:he.handleSave,onRemoveSaved:he.hasSavedFilters?he.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx(AFr,{traceCollapsed:u,listSlot:o.jsx(RFr,{traces:ae,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,filtersApplied:de,featuredTraceId:s.traceIdParam,onTraceClick:ue=>s.handleTraceClick(s.traceIdParam===ue.traceId?"":ue.traceId),groupByThread:r,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(Cht,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ue=>s.handleSpanChange(ue??null),onEvaluateTrace:xe,onSaveAsDatasetItem:ue=>h(ue),initialSpanId:s.spanIdParam,onPrevious:se,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:E8,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(jht,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ue=>s.handleSpanTabChange(ue),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(JSt,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:k}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ue,traceId:ve,spanId:we})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Cve,{traceId:ve,isTopLevelSpan:!ue.parentSpanId,spanId:we,entityType:ue.attributes?.agentId||ue.entityType===Do.AGENT?"Agent":ue.attributes?.workflowId||ue.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:p,isLoadingScorers:m}),o.jsx(eOt,{scoresData:g,onPageChange:c,isLoadingScoresData:y,onScoreSelect:Ne=>s.handleScoreChange(Ne.id)})]})}):null,scorePanelSlot:I?o.jsx(gve,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(jve,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>h(null)})]})}function RIn(){const{traceId:e}=sa(),[t,r]=ao(),n=uu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",l=t.get("scoreId")||void 0,[c,u]=b.useState(s??null),[d,f]=b.useState(),[h,p]=b.useState(i),[m,g]=b.useState(0),[y,x]=b.useState(!1),{data:w,isLoading:S,error:k}=Mme(e),_=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>_.find(re=>re.parentSpanId==null),[_]),{data:T,isLoading:j}=D1(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=cd(),{data:P,isLoading:R}=vve({traceId:e,spanId:c??void 0,page:m}),[B,D]=b.useState(0);b.useEffect(()=>D(0),[e,c]);const{data:$,isLoading:U}=tOt({traceId:e,page:B});b.useEffect(()=>{if(l&&P?.scores&&!d){const re=P.scores.find(ie=>ie.id===l);re&&f(re)}},[l,P?.scores,d]);const z=b.useCallback(re=>{const ie=new URLSearchParams(t);for(const[he,X]of Object.entries(re))X===null||X===""?ie.delete(he):ie.set(he,X);r(ie,{replace:!0})},[t,r]),H=b.useCallback(re=>{const ie=re??null,he=ie===c;u(ie),he||(f(void 0),p("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),Q=b.useCallback(()=>{u(null),f(void 0),p("details"),z({spanId:null,tab:null,scoreId:null})},[z]),L=b.useCallback(re=>{u(re),f(void 0),p("details"),z({spanId:re,tab:null,scoreId:null})},[z]),{handlePreviousSpan:Z,handleNextSpan:V}=Pht(_,c,L),M=b.useCallback(re=>{const ie=re;p(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=b.useCallback(re=>{f(re),z({scoreId:re.id})},[z]),G=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),J=b.useCallback(()=>{n("/observability")},[n]),ae=b.useCallback(()=>{p("scoring"),E&&c!==E.spanId?(u(E.spanId),f(void 0),z({spanId:E.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[E,c,z]),te=o.jsxs(o.Fragment,{children:[o.jsxs(ce,{as:E8,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(wp,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:S,children:[o.jsx(xo,{})," Trace ",o.jsx("span",{className:"text-neutral3",children:e})]})})}),o.jsx(bt.Column,{children:o.jsxs(ps,{children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs(Ln,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(p3,{}),"Evaluate"]}),o.jsxs(Ln,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(yc,{}),"Save"]})]})]})})]}),E&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(kht,{rootSpan:E,numOfCol:3})})})]});return k?o.jsxs(bt,{height:"full",children:[o.jsx(bt.TopArea,{children:te}),o.jsx(bt.MainArea,{isCentered:!0,children:o.jsx(Tht,{error:k,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:te}),o.jsx(jve,{rootSpanId:E?.spanId,traceId:e,isOpen:y,onClose:()=>x(!1)}),o.jsxs("div",{className:Y("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[o.jsx(Cht,{traceId:e,spans:_,isLoading:S,onClose:J,onSpanSelect:H,onEvaluateTrace:ae,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Y("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(jht,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:Q,onPrevious:Z,onNext:V,activeTab:h,onTabChange:M,feedbackTabBadge:$?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(JSt,{feedbackData:$,onPageChange:D,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:he})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Cve,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:he,entityType:re.attributes?.agentId||re.entityType===Do.AGENT?"Agent":re.attributes?.workflowId||re.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),o.jsx(eOt,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(gve,{score:d,onClose:G})]})]})]})}function PIn(){const{data:e,isLoading:t,error:r}=c0(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(aa,{})}):r&&ks(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(Zs,{resource:"workflows"})}):r?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(pu,{title:"Failed to load workflows",message:r.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(cpn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(Di,{})," Workflows"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(lpn,{workflows:e||{},isLoading:t,search:n})]})}const GBe=()=>{const{workflowId:e}=sa(),{data:t,isLoading:r,error:n}=zP(e);return n&&Ps(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})}):n&&ks(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workflows"})}):o.jsx(Pwt,{workflowId:e,workflow:t??void 0,isLoading:r})};function MIn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(xdt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(bdt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(wdt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(yU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Fre,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(Na,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(nc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Fre,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(yU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(yU,{className:"h-4 w-4 text-neutral4"})}}function rOt(e,t=!1){const{name:r,type:n,mount:s}=e;if(n==="directory")return s?MIn(s):t?o.jsx(jE,{className:"h-4 w-4 text-amber-400"}):o.jsx(nc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(lx,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(ER,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return o.jsx(Yi,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return o.jsx(ice,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(sce,{className:"h-4 w-4 text-neutral4"})}}function nOt(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+nOt(-e);if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(t)),r.length-1);return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function DIn(e){if("body"in e&&e.body&&typeof e.body=="object"){const n=e.body;if(typeof n.error=="string")return n.error;if(typeof n.message=="string")return n.message}const t=e.message,r=t.lastIndexOf(" - {");if(r!==-1)try{const n=t.slice(r+3),s=JSON.parse(n);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function sOt(e){return e==="."||e===""}function LIn({path:e,onNavigate:t}){const n=sOt(e)?[]:e.split("/").filter(Boolean);return o.jsxs("div",{className:"flex items-center gap-1 text-sm overflow-x-auto",children:[o.jsx("button",{onClick:()=>t("."),className:"p-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors","aria-label":"Workspace root",children:o.jsx(jE,{className:"h-4 w-4"})}),n.map((s,a)=>{const i=n.slice(0,a+1).join("/");return o.jsxs("div",{className:"flex items-center",children:[o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("button",{onClick:()=>t(i),className:"px-2 py-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors truncate max-w-[150px]",title:s,children:s})]},i)})]})}function $In({entries:e,currentPath:t,isLoading:r,error:n,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:l,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[h,p]=b.useState(null),m=[...e].sort((w,S)=>w.type==="directory"&&S.type!=="directory"?-1:w.type!=="directory"&&S.type==="directory"?1:w.name.localeCompare(S.name)),g=sOt(t),y=w=>{const S=g?w.name:`${t}/${w.name}`;w.type==="directory"?s(S):a?.(S)},x=w=>{const S=g?w.name:`${t}/${w.name}`;p(S)};return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsx(LIn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(ce,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(CR,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(ce,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const w=prompt("Directory name:");if(w){const S=g?w:`${t}/${w}`;c(S)}},children:d?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(lF,{className:"h-4 w-4"})}),l&&o.jsx(ce,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(fF,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"max-h-[400px] overflow-auto",children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):n?o.jsxs("div",{className:"py-12 px-4 text-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-500/10 mb-4",children:o.jsx(tA,{className:"h-6 w-6 text-red-400"})}),o.jsx("p",{className:"text-sm text-neutral6 font-medium mb-1",children:"Failed to load directory"}),o.jsx("p",{className:"text-xs text-neutral4 max-w-sm mx-auto",children:DIn(n)})]}):m.length===0?o.jsx("div",{className:"py-12 text-center text-neutral4 text-sm",children:g?"Workspace is empty":"Directory is empty"}):o.jsx(ad,{children:o.jsxs("ul",{children:[!g&&o.jsx("li",{children:o.jsxs("button",{onClick:()=>{const w=t.split("/").slice(0,-1).join("/")||".";s(w)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-surface4 transition-colors text-left",children:[o.jsx(jE,{className:"h-4 w-4 text-amber-400"}),o.jsx("span",{className:"text-sm text-neutral5",children:".."})]})}),m.map(w=>{const S=w.mount?.displayName||w.mount?.provider,k=w.mount?.status==="error";return o.jsx("li",{className:"group",children:o.jsxs("div",{className:"flex items-center hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:()=>y(w),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[rOt(w),o.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:w.name}),w.mount&&k&&o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(tA,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Gr,{className:"max-w-xs",children:[o.jsx("span",{className:"text-red-400",children:"Error:"})," ",w.mount.error||"Failed to connect to this filesystem"]})]}),w.mount&&S&&(w.mount.description?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})}),o.jsx(Gr,{children:w.mount.description})]}):o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})),w.type==="file"&&w.size!==void 0&&o.jsx("span",{className:"text-xs text-neutral3 tabular-nums",children:nOt(w.size)})]}),u&&!w.mount&&o.jsx("button",{onClick:()=>x(w),"aria-label":`Delete ${w.name}`,className:"p-2 opacity-0 group-hover:opacity-100 hover:text-red-400 text-neutral3 transition-all",children:o.jsx(ed,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx($t,{open:!!h,onOpenChange:w=>!f&&!w&&p(null),children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsxs($t.Description,{children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{disabled:f,children:"Cancel"}),o.jsxs($t.Action,{disabled:f,onClick:async()=>{try{h&&u&&await u(h)}finally{p(null)}},children:[f?o.jsx(Aa,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function FIn(e){return e&&{js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",mdx:"mdx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",css:"css",scss:"scss",less:"less",html:"html",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile",vue:"vue",svelte:"svelte"}[e.toLowerCase()]||null}function zIn({content:e,language:t}){return o.jsx(nve,{language:t,style:sve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function BIn({path:e,content:t,isLoading:r,mimeType:n,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),l=n?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=FIn(i);return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[rOt({name:a,type:"file"}),o.jsx("span",{className:"text-sm font-medium text-neutral6",children:a})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ra,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(ce,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),o.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):l?o.jsx("div",{className:"p-4 flex items-center justify-center",children:o.jsx("img",{src:`data:${n||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?o.jsx(zIn,{content:t,language:c}):o.jsx("pre",{className:"p-4 text-sm text-neutral5 whitespace-pre-wrap font-mono overflow-x-auto",children:t})})]})}const UIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Workspaces yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Add a workspace to your Mastra configuration to ",o.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(xa,{})]})})}),VIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(YMt,{}),titleSlot:"Workspace Not Configured",descriptionSlot:o.jsxs(o.Fragment,{children:["No workspace is configured. Add a workspace to your ",o.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(xa,{})]})})}),qIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(tA,{}),titleSlot:"Workspace Not Supported",descriptionSlot:o.jsxs(o.Fragment,{children:["The workspace feature requires a newer version of ",o.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",o.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(xa,{})]})})}),ire={bm25:{label:"Keyword",icon:o.jsx(Yi,{className:"h-3.5 w-3.5"}),color:"bg-blue-500/10 text-blue-400 border-blue-500/30"},vector:{label:"Semantic",icon:o.jsx(y_,{className:"h-3.5 w-3.5"}),color:"bg-purple-500/10 text-purple-400 border-purple-500/30"},hybrid:{label:"Hybrid",icon:o.jsx(PLt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function aOt(e){return e.id.replace(/#chunk-\d+$/,"")}function HIn({onSearch:e,isSearching:t,searchResults:r,canBM25:n,canVector:s,onViewResult:a}){const[i,l]=b.useState(""),[c,u]=b.useState(5),d=()=>n&&s?"hybrid":n?"bm25":s?"vector":"bm25",[f,h]=b.useState(d()),p=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...n?["bm25"]:[],...s?["vector"]:[],...n&&s?["hybrid"]:[]];return o.jsxs("div",{className:"rounded-lg bg-surface4",children:[o.jsxs("form",{onSubmit:p,className:"p-4",children:[o.jsxs("div",{className:"flex gap-3 items-center",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(NE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(ar,{value:i,onChange:g=>l(g.target.value),placeholder:"Search workspace files...",className:"pl-9 h-10 bg-surface2 border-border1"})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-xs text-neutral4",children:"Top"}),o.jsx(ar,{type:"number",min:1,max:50,value:c,onChange:g=>u(parseInt(g.target.value)||5),className:"w-14 h-10 text-center bg-surface2 border-border1",title:"Number of results"})]}),o.jsx(ce,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):"Search"})]}),m.length>0&&o.jsx("div",{className:"flex gap-2 mt-3",children:m.map(g=>{const y=ire[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>h(g),className:`
550
+ ]`})]})]})}function iNn({errors:e,maxErrors:t=5}){if(e.length===0)return null;const r=e.slice(0,t),n=e.length-t;return o.jsxs("div",{className:"bg-accent2/10 border border-accent2/30 rounded-md p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-accent2 mb-2",children:[o.jsx(Ce,{children:o.jsx(IE,{className:"w-4 h-4"})}),o.jsxs("span",{className:"font-medium text-sm",children:[e.length," validation error",e.length!==1?"s":""]})]}),o.jsx("ul",{className:"text-sm text-accent2/80 space-y-1",children:r.map((s,a)=>o.jsxs("li",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0",children:"•"}),o.jsx("span",{children:s.message})]},a))}),n>0&&o.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",n," more error",n!==1?"s":""]})]})}function oNn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState({current:0,total:0}),[d,f]=b.useState(null),[h,p]=b.useState(!1),{parseFile:m,isParsing:g,error:y}=fTn(),{batchInsertItems:x}=ni(),w=b.useCallback(async I=>{try{const P=await m(I);l(P),a("preview")}catch{}},[m]),S=b.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),p(!0);const{items:I}=i;u({current:0,total:I.length});try{await x.mutateAsync({datasetId:e,items:I.map(P=>({input:P.input,groundTruth:P.groundTruth,metadata:P.metadata}))}),f({success:I.length,errors:0})}catch{f({success:0,errors:I.length})}u({current:I.length,total:I.length}),p(!1),a("complete")},[i,x,e]),k=b.useCallback(()=>{r(!1),n?.(),d&&d.success>0&&ze.success(`Imported ${d.success} item${d.success!==1?"s":""}`),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150)},[r,n,d]),_=b.useCallback(()=>{h||(r(!1),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150))},[h,r]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return o.jsx(aNn,{onFileSelect:w,isParsing:g,error:y?.message});case"preview":return i?o.jsx("div",{className:"flex flex-col gap-4",children:i.errors.length>0?o.jsxs(o.Fragment,{children:[o.jsx(iNn,{errors:i.errors}),o.jsx("div",{className:"text-sm text-neutral4",children:"Please fix the errors in your JSON file and try again."})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm text-neutral4",children:["Found ",i.items.length," valid item",i.items.length!==1?"s":""," to import."]}),o.jsx(sNn,{items:i.items,maxRows:5})]})}):null;case"importing":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx(Dt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return o.jsx(ce,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(ce,{variant:"primary",onClick:S,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return o.jsx(ce,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(On,{open:t,onOpenChange:_,children:o.jsxs(vn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:N[s]}),o.jsx(qs,{children:"Import dataset items from a JSON file."})]}),o.jsx(Bn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(uf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function lNn({dataset:e,isLoading:t=!1,onEditClick:r,onDuplicateClick:n,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(Ir,{className:c,children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{isLoading:t,children:[o.jsx(Na,{})," ",e?.name]}),o.jsx(Ir.Description,{isLoading:t,children:e?.description}),o.jsxs(Ir.Description,{isLoading:t,children:[o.jsxs(Zn,{children:[o.jsx(p_,{})," Created at ",e?.createdAt?tr(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Vx,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsx("div",{className:"pointer-events-none opacity-50",inert:!0,"aria-disabled":"true",children:a})})}),o.jsx(Gr,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(ce,{disabled:!0,tabIndex:-1,children:[o.jsx(ux,{}),"Run Experiment"]})})}),o.jsx(Gr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(ce,{onClick:l,children:[o.jsx(ux,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ce,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(vVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(iv,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(tu,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(ed,{})," Delete Dataset"]})]})]})]})})]})}const USt=e=>{const t=We(),{data:r}=wR(e),n=r?.experiments;return Ot({queryKey:["dataset-review-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="needs-review").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})},cNn=e=>{const t=We(),{data:r}=wR(e),n=r?.experiments;return Ot({queryKey:["dataset-completed-items",e,n?.map(s=>s.id)],queryFn:async()=>!n||n.length===0?[]:(await Promise.all(n.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(l=>l.status==="complete").map(l=>({id:l.id,input:l.input,output:l.output,error:l.error,itemId:l.itemId,experimentId:l.experimentId,datasetId:a.datasetId??void 0,traceId:l.traceId??void 0,scores:l.scores?Object.fromEntries(l.scores.map(c=>[c.scorerId,c.score??0])):{},tags:l.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!n&&n.length>0,refetchOnWindowFocus:!1})};function uNn(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const r=JSON.stringify(e);return r.length>t?r.slice(0,t)+"...":r}catch{return String(e)}}const dNn=Y("bg-surface5 backdrop-blur-xl z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95");function DBe({className:e,children:t,...r}){return o.jsx(iP,{children:o.jsx(fz,{className:Y(dNn,e),...r,children:t})})}function fNn({datasetId:e}){const t=We(),{data:r}=Tg(e),{data:n,isLoading:s}=USt(e),{data:a,isLoading:i}=cNn(e),{updateExperimentResult:l}=ni(),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState(new Set),[m,g]=b.useState(!1),[y,x]=b.useState(!1),[w,S]=b.useState(!1),[k,_]=b.useState(""),[E,T]=b.useState(""),[j,N]=b.useState(""),[I,P]=b.useState([]),[R,B]=b.useState(!1),[D,$]=b.useState(null),U=D??n??[];b.useEffect(()=>{n&&D===null&&$(n)},[n]);const z=b.useMemo(()=>{const ge=new Set;if(r?.tags)for(const Ee of r.tags)ge.add(Ee);for(const Ee of U)for(const Fe of Ee.tags)ge.add(Fe);return[...ge].sort()},[r,U]),H=b.useCallback(ge=>{!r||!e||(r.tags??[]).includes(ge)},[r,e]),Q=b.useMemo(()=>d?d==="__untagged__"?U.filter(ge=>ge.tags.length===0):U.filter(ge=>ge.tags.includes(d)):U,[U,d]),L=b.useMemo(()=>{const ge=new Map;for(const Ee of U)for(const Fe of Ee.tags)ge.set(Fe,(ge.get(Fe)??0)+1);return[...ge.entries()].sort((Ee,Fe)=>Fe[1]-Ee[1])},[U]),Z=b.useMemo(()=>U.filter(ge=>ge.tags.length===0).length,[U]),V=b.useMemo(()=>{let ge=0;return d&&ge++,m&&ge++,ge},[d,m]),M=b.useCallback((ge,Ee)=>{$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,tags:Ee}:wt));const Fe=U.find(ct=>ct.id===ge);Fe?.experimentId&&Fe?.datasetId&&l.mutate({datasetId:Fe.datasetId,experimentId:Fe.experimentId,resultId:Fe.id,tags:Ee})},[U,l]),W=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&Ee!==void 0&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ee==="positive"?1:-1,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,rating:Ee}:wt))},[U,t]),G=b.useCallback((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge);Fe?.traceId&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ee,comment:Ee,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),$(ct=>(ct??[]).map(wt=>wt.id===ge?{...wt,comment:Ee}:wt))},[U,t]),J=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);$(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:null})},[U,l,c]),ae=b.useCallback(ge=>{const Ee=U.find(Fe=>Fe.id===ge);$(Fe=>(Fe??[]).filter(ct=>ct.id!==ge)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ge),ct}),c===ge&&u(null),Ee?.experimentId&&Ee?.datasetId&&l.mutate({datasetId:Ee.datasetId,experimentId:Ee.experimentId,resultId:Ee.id,status:"complete"})},[U,l,c]),te=b.useMemo(()=>{const ge=m?a??[]:Q;return!m||!d?ge:d==="__untagged__"?ge.filter(Ee=>Ee.tags.length===0):ge.filter(Ee=>Ee.tags.includes(d))},[m,a,Q,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(te.map(ge=>ge.id)),[te]),he=b.useMemo(()=>[...h].filter(ge=>ie.has(ge)).length,[h,ie]),X=te.length>0&&he===te.length,se=he>0&&!X,le=b.useCallback(ge=>{p(Ee=>{const Fe=new Set(Ee);return Fe.has(ge)?Fe.delete(ge):Fe.add(ge),Fe})},[]),xe=b.useCallback(()=>{p(X?new Set:new Set(te.map(ge=>ge.id)))},[X,te]),de=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&!Fe.tags.includes(ge)&&M(Ee,[...Fe.tags,ge])}},[U,h,M]),ue=b.useCallback(ge=>{for(const Ee of h){const Fe=U.find(ct=>ct.id===Ee);Fe&&Fe.tags.includes(ge)&&M(Ee,Fe.tags.filter(ct=>ct!==ge))}},[U,h,M]),ve=b.useCallback(()=>{for(const ge of h)ae(ge);p(new Set)},[h,ae]),we=b.useCallback(()=>{for(const ge of h)J(ge);p(new Set)},[h,J]),Ne=b.useCallback(()=>{_(""),S(!0)},[]),K=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ge=U.filter(Fe=>h.has(Fe.id));if(ge.length===0){x(!1);return}const Ee=await t.clusterFailures({modelId:`${E}/${j}`,items:ge.map(Fe=>({id:Fe.id,input:Fe.input,output:Fe.output??void 0,error:typeof Fe.error=="string"?Fe.error:Fe.error?String(Fe.error):void 0,scores:Fe.scores,existingTags:Fe.tags.length>0?Fe.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:k||void 0});Ee.proposedTags&&Ee.proposedTags.length>0&&(P(Ee.proposedTags.map(Fe=>({...Fe,accepted:!0}))),B(!0))}catch(ge){console.error("Analysis failed:",ge)}finally{x(!1)}}},[E,j,U,h,t,z,k]),oe=b.useCallback(()=>{for(const ge of I){if(!ge.accepted)continue;const Ee=U.find(Fe=>Fe.id===ge.itemId);if(Ee){const Fe=[...new Set([...Ee.tags,...ge.tags])];M(Ee.id,Fe)}}B(!1)},[I,U,M]),be=b.useCallback(ge=>{u(Ee=>Ee===ge?null:ge)},[]),Ae=b.useMemo(()=>c?te.find(ge=>ge.id===c)??null:null,[c,te]),$e=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge<te.length-1&&u(te[ge+1].id)},[c,te]),ye=b.useCallback(()=>{if(!c||te.length===0)return;const ge=te.findIndex(Ee=>Ee.id===c);ge>0&&u(te[ge-1].id)},[c,te]),ke=Ae?"2rem 1fr 10rem 8rem":"2rem 1fr 10rem 8rem 6rem 6rem";return s?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Dt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx(On,{open:w,onOpenChange:S,children:o.jsxs(vn,{children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Analyze Items"}),o.jsx(qs,{children:"Use an LLM to automatically suggest tags for the selected items."})]}),o.jsxs("div",{className:"space-y-4 py-2",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Provider"}),o.jsx(Ng,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Ag,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(me,{variant:"ui-xs",className:"text-neutral3",children:[h.size," item",h.size!==1?"s":""," will be analyzed"]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs",children:"Instructions (optional)"}),o.jsx(gc,{value:k,onChange:ge=>_(ge.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(uf,{children:[o.jsx(ce,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(ce,{onClick:K,disabled:!E||!j||y,children:[y?o.jsx(Dt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(On,{open:R,onOpenChange:B,children:o.jsxs(vn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Review Proposed Tags"}),o.jsxs(qs,{children:[I.filter(ge=>ge.accepted).length," of ",I.length," proposals selected"]})]}),o.jsx("div",{className:"space-y-3 py-2",children:I.map((ge,Ee)=>{const Fe=U.find(ct=>ct.id===ge.itemId);return o.jsx("div",{className:Y("p-3 border rounded-lg",!ge.accepted&&"opacity-50"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(hi,{checked:ge.accepted,onCheckedChange:ct=>P(wt=>wt.map((lr,Ve)=>Ve===Ee?{...lr,accepted:!!ct}:lr))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate block",children:Fe?typeof Fe.input=="string"?Fe.input.slice(0,100):JSON.stringify(Fe.input).slice(0,100):ge.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ge.tags.map((ct,wt)=>o.jsx(PSt,{tag:ct,onRename:lr=>P(Ve=>Ve.map((qe,Ie)=>Ie===Ee?{...qe,tags:qe.tags.map((Le,Re)=>Re===wt?lr:Le)}:qe)),onRemove:()=>P(lr=>lr.map((Ve,qe)=>qe===Ee?{...Ve,tags:Ve.tags.filter((Ie,Le)=>Le!==wt)}:Ve))},`${ct}-${wt}`))}),ge.reason&&o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ge.reason})]})]})},ge.itemId)})}),o.jsxs(uf,{children:[o.jsx(ce,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(ce,{onClick:oe,disabled:I.filter(ge=>ge.accepted).length===0,children:["Accept ",I.filter(ge=>ge.accepted).length," proposals"]})]})]})}),o.jsxs(tf,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:"md",children:[o.jsx(bVe,{}),"Filter",V>0&&o.jsx("span",{className:Y("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:V})]})}),o.jsxs(yt.Content,{align:"start",className:Y("min-w-48"),children:[o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(DBe,{children:[o.jsx(yt.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ge=>ge.preventDefault(),children:"Review Queue"}),o.jsx(yt.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ge=>ge.preventDefault(),children:"Completed"})]})]}),o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(DBe,{children:[o.jsx(yt.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ge=>ge.preventDefault(),children:"All"}),Z>0&&o.jsx(yt.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ge=>ge.preventDefault(),children:"Untagged"}),L.length>0&&o.jsx(yt.Separator,{}),L.map(([ge])=>o.jsx(yt.CheckboxItem,{checked:d===ge,onCheckedChange:()=>f(d===ge?null:ge),onSelect:Ee=>Ee.preventDefault(),children:ge},ge))]})]}),V>0&&o.jsxs(o.Fragment,{children:[o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(An,{}),"Clear all filters"]})]})]})]}),V>0&&o.jsxs(ce,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(An,{}),"Reset"]})]}),!m&&h.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(RSt,{selectedCount:h.size,vocabulary:z,onApplyTag:de,onRemoveTag:ue,onNewTag:ge=>de(ge)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ce,{disabled:y,children:[y?o.jsx(Dt,{className:"w-4 h-4"}):o.jsx(Ce,{size:"sm",children:o.jsx(as,{})}),"Actions"]})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:ve,children:[o.jsx(Ce,{size:"sm",children:o.jsx(Jw,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:we,children:[o.jsx(Ce,{size:"sm",children:o.jsx(ed,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Ne,children:[o.jsx(Ce,{size:"sm",children:o.jsx(y_,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Dt,{className:"w-6 h-6"})}):te.length===0?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"text-center px-8",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-2 block",children:m?"Items marked as complete will appear here for auditing.":"When experiment results are flagged for review, they will appear here."})]})}):o.jsxs(Se,{columns:ke,children:[o.jsxs(Se.Top,{children:[!m&&o.jsx(Se.TopCell,{children:o.jsx(hi,{checked:X?!0:se?"indeterminate":!1,onCheckedChange:()=>xe(),"aria-label":"Select all"})}),m&&o.jsx(Se.TopCell,{children:" "}),o.jsx(Se.TopCell,{children:"Input"}),o.jsx(Se.TopCell,{children:"Comment"}),o.jsx(Se.TopCell,{children:"Tags"}),!Ae&&o.jsx(Se.TopCell,{children:"Rating"}),!Ae&&o.jsx(Se.TopCell,{children:"Scores"})]}),o.jsx(Se.Rows,{children:te.map(ge=>{const Ee=ge.scores?Object.entries(ge.scores):[];return o.jsxs(Se.Row,{onClick:()=>be(ge.id),selected:c===ge.id,children:[o.jsx(Se.Cell,{children:m?ge.error?o.jsx("div",{className:"w-2 h-2 rounded-full bg-red-700",title:"Error"}):o.jsx("div",{className:"w-2 h-2 rounded-full bg-green-600",title:"Success"}):o.jsx(hi,{checked:h.has(ge.id),onCheckedChange:()=>le(ge.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ge.id}`})}),o.jsx(Se.NameCell,{children:uNn(ge.input,80)}),o.jsx(Se.Cell,{children:ge.comment?o.jsx(me,{variant:"ui-xs",className:"text-neutral3 truncate",children:ge.comment}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Se.Cell,{children:ge.tags.length>0?o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate",children:ge.tags.join(", ")}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Ae&&o.jsxs(Se.Cell,{children:[ge.rating==="positive"&&o.jsx(Ce,{size:"sm",className:"text-positive1",children:o.jsx(uce,{})}),ge.rating==="negative"&&o.jsx(Ce,{size:"sm",className:"text-negative1",children:o.jsx(cce,{})}),!ge.rating&&o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Ae&&o.jsx(Se.Cell,{children:Ee.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ce,{size:"sm",className:"text-neutral3",children:o.jsx(La,{})}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ee[0][1].toFixed(2)}),Ee.length>1&&o.jsxs(vt,{variant:"default",children:["+",Ee.length-1]})]}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ge.id)})})]})]}),Ae&&o.jsx(ISt,{item:Ae,isCompleted:m,tagVocabulary:z,onRate:ge=>W(Ae.id,ge),onSetTags:ge=>{M(Ae.id,ge);for(const Ee of ge)z.includes(Ee)||H(Ee)},onComment:ge=>G(Ae.id,ge),onRemove:()=>J(Ae.id),onComplete:m?void 0:()=>ae(Ae.id),onPrevious:ye,onNext:$e,onClose:()=>u(null)})]})]})}function hNn({datasetId:e,onExperimentClick:t,onEditClick:r,onDeleteClick:n,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:l,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=or(),[h,p]=b.useState(u??"items"),m=Ut=>{p(Ut),d?.(Ut)},[g,y]=b.useState(!1),[x,w]=b.useState(!1),[S,k]=b.useState(!1),[_,E]=b.useState([]),[T,j]=b.useState(!1),[N,I]=b.useState([]),[P,R]=b.useState(!1),[B,D]=b.useState([]),[$,U]=b.useState(!1),[z,H]=b.useState(0),[Q,L]=b.useState(null),[Z,V]=b.useState(""),[M]=lur(Z,300),[W,G]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=Tg(e),{data:ie=[],total:he,isLoading:X,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe}=kE(e,M||void 0,ae),{data:de=[],total:ue,isLoading:ve}=kE(e,void 0,ae),[we,Ne]=b.useState({}),{data:K,isLoading:oe}=wR(e,void 0,we),{data:be}=wR(e),{deleteItems:Ae}=ni(),$e=K?.experiments??[],ye=be?.experiments??[],ke=NTn({hasSearchQuery:!!M,filteredItemsLength:ie.length,unfilteredItemsTotal:ue,itemsTotal:he}),{data:ge}=USt(e),Ee=ge?.length??0,Fe=Ut=>{L(Ut)},ct=()=>{L(null)},wt=Ut=>{const $r=Ut.isCurrent?null:Ut;c?c($r):G(Ut.isCurrent?null:Ut.version)},lr=Ut=>{E(Ut),k(!0)},Ve=Ut=>{I(Ut),j(!0)},qe=Ut=>{j(Ut),Ut||(I([]),H($r=>$r+1))},Ie=Ut=>{f(`/datasets/${e}/items?items=${Ut.join(",")}`)},Le=Ut=>{f(`/datasets/${e}/versions?ids=${Ut.join(",")}`)},Re=Ut=>{D(Ut),R(!0)},it=async()=>{await Ae.mutateAsync({datasetId:e,itemIds:B}),ze.success(`Deleted ${B.length} items`),R(!1),D([]),H(Ut=>Ut+1)},rt=Ut=>{k(!1),E([]),H($r=>$r+1),i?.(Ut)},ht=Ut=>{k(Ut),Ut||(E([]),H($r=>$r+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Y("h-full w-full",ln.allSlow),children:o.jsxs("div",{className:Y("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",Q?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(lNn,{dataset:te,isLoading:re,onEditClick:r,onDuplicateClick:()=>U(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!ve&&de.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(Ef,{defaultTab:"items",value:h,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(Cf,{children:[o.jsxs(cs,{value:"items",children:["Items ",o.jsx(za,{color:"gray",children:ke})]}),o.jsxs(cs,{value:"experiments",children:["Experiments",o.jsx(za,{color:"gray",children:$e.length})]}),o.jsxs(cs,{value:"review",children:["Review",Ee>0&&o.jsx(za,{color:"orange",children:Ee})]})]}),o.jsx(xs,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(nNn,{datasetId:e,items:ie,isLoading:X,featuredItemId:Q,onItemSelect:Fe,onItemClose:ct,onAddClick:s??(()=>{}),onImportClick:()=>y(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Re,onCreateDatasetClick:lr,onAddToDatasetClick:Ve,onCompareItemsClick:Ie,datasetName:te?.name,clearSelectionTrigger:z,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe,searchQuery:Z,onSearchChange:V,activeDatasetVersion:ae,currentDatasetVersion:te?.version,onVersionSelect:wt,onCompareVersionsClick:Le})}),o.jsx(xs,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(QTn,{experiments:$e,allExperiments:ye,isLoading:oe,datasetId:e,filters:we,onFiltersChange:Ne})}),o.jsx(xs,{value:"review",className:"overflow-auto mt-0",children:o.jsx(fNn,{datasetId:e})})]})})]})})}),o.jsx($Tn,{datasetId:e,open:g,onOpenChange:y}),o.jsx(oNn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(kTn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(_Tn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(ETn,{open:$,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx($t,{open:P,onOpenChange:R,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Items"}),o.jsxs($t.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:it,children:Ae.isPending?"Deleting...":"Delete"})]})]})})]})}function pNn(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const r=JSON.parse(t[1]);if(r.field&&Array.isArray(r.errors))return{field:r.field,errors:r.errors}}catch{}return null}function LBe({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((r,n)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,r.path!=="/"?r.path:""]}),": ",r.message]},n))}):null}function mNn({datasetId:e,open:t,onOpenChange:r,onSuccess:n}){const[s,a]=b.useState("{}"),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(null),{addItem:h}=ni(),p=async x=>{x.preventDefault();let w;try{w=JSON.parse(s)}catch{ze.error("Input must be valid JSON");return}let S;if(i.trim())try{S=JSON.parse(i)}catch{ze.error("Ground Truth must be valid JSON");return}let k;if(c.trim())try{k=JSON.parse(c)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await h.mutateAsync({datasetId:e,input:w,groundTruth:S,expectedTrajectory:k}),ze.success("Item added successfully"),f(null),a("{}"),l(""),u(""),r(!1),n?.()}catch(_){const E=pNn(_);E?f(E):ze.error(`Failed to add item: ${_ instanceof Error?_.message:"Unknown error"}`)}},m=x=>{a(x),d?.field==="input"&&f(null)},g=x=>{l(x),d?.field==="groundTruth"&&f(null)},y=()=>{a("{}"),l(""),u(""),f(null),r(!1)};return o.jsx(On,{open:t,onOpenChange:r,children:o.jsxs(vn,{className:"max-w-lg",children:[o.jsx(kn,{children:o.jsx(bn,{children:"Add Item"})}),o.jsx(Bn,{children:o.jsxs("form",{onSubmit:p,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-input",children:"Input (JSON) *"}),o.jsx(Xn,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(LBe,{field:"input",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),o.jsx(Xn,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(LBe,{field:"groundTruth",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xt,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),o.jsx(Xn,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(ce,{type:"button",onClick:y,children:"Cancel"}),o.jsx(ce,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function gNn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=cd(),i=b.useMemo(()=>s?Object.entries(s).map(([l,c])=>({value:l,label:c.scorer?.config?.name||l,description:c.scorer?.config?.description||""})):[],[s]);return o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Scorers (Optional)"}),o.jsx(Ldt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const yNn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function vNn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Eg(),{data:l,isLoading:c}=c0(),{data:u,isLoading:d}=cd(),f=e==="agent"?Object.entries(a??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="workflow"?Object.entries(l??{}).map(([g,y])=>({value:g,label:y.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,y])=>({value:g,label:y.scorer?.config?.name??g})):[],h=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,p=g=>{t(g),n("")},m=e==="agent"?"Agent":e==="workflow"?"Workflow":"Scorer";return o.jsxs("div",{className:"grid gap-6",children:[o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:"Target Type"}),o.jsx(Gl,{options:yNn,value:e,onValueChange:p,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(xt,{children:m}),o.jsx(Gl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function bNn({datasetId:e,version:t,open:r,onOpenChange:n,onSuccess:s}){const a=b.useRef(null),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState([]),{triggerExperiment:h}=ni(),p=i&&c,m=h.isPending,g=async()=>{if(p)try{const x=await h.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});mc.success("Experiment triggered successfully"),n(!1),s?.(x.experimentId),l(""),u(""),f([])}catch(x){const w=x instanceof Error?x.message:"Failed to trigger experiment";mc.error(w)}},y=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(On,{open:r,onOpenChange:y,children:o.jsxs(vn,{ref:a,children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Run Experiment"}),o.jsx(qs,{children:t?`Execute items from ${tr(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(Bn,{className:"grid gap-6",children:[o.jsx(vNn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(gNn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(uf,{className:"px-6 pt-4",children:[o.jsx(ce,{onClick:y,disabled:m,children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:g,disabled:!p||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const VSt=e=>{const t=We();return Ot({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},$Be=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function xNn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=nre(e?.input),d=nre(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(wC,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(ce,{onClick:a,disabled:!e.traceId,children:[o.jsx(lce,{}),"Show Trace"]}),o.jsx(ce,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(An,{})})]})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(ux,{})," ",e.id]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(lx,{})," ",e.itemId]})})]})}),c&&o.jsx(cn,{variant:"destructive",title:"Error",children:o.jsx(cn.Message,{children:nre(e?.error&&typeof e.error=="object"?e.error.message:e?.error)})}),t&&t.length>0&&o.jsxs(Pt,{className:"grid-rows-[auto_auto] overflow-visible",children:[o.jsxs(Pt.Header,{columns:$Be,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Score"})]}),o.jsx(Pt.Items,{children:t.map(f=>o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:f.id},columns:$Be,isFeatured:l===f.id,onClick:i,children:[o.jsx(Pt.TextCell,{children:f.scorerId}),o.jsx(Pt.TextCell,{className:"font-mono",children:f.score.toFixed(3)})]})},f.id))})]}),(e.status||Array.isArray(e.tags)&&e.tags.length>0)&&o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(AE,{className:"w-4 h-4"})," Review Status"]}),o.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.status&&o.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${e.status==="needs-review"?"bg-warning/10 text-warning":e.status==="complete"?"bg-accent1/10 text-accent1":"bg-neutral3/10 text-neutral4"}`,children:e.status}),Array.isArray(e.tags)&&e.tags.length>0&&e.tags.map(f=>o.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-surface4 text-neutral4",children:f},f))]})]}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(lx,{}),codeStr:u}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:d}),o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[o.jsx(p_,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:tr(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function nre(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function wNn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(cx,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(wh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Attributes",icon:o.jsx(wh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function SNn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=D1(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(wC,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(ce,{onClick:s,"aria-label":"Close span details",children:o.jsx(An,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(wh,{})," Span ",ef(t)]})})}),o.jsx(wNn,{span:i})]})]})}const ONn=e=>{if(!e||e.length===0)return[];const t=e.reduce((l,c)=>{const u=c?.endedAt?new Date(c.endedAt):void 0;return u&&(!l||u>l)?u:l},null),r=new Map,n=[];e.forEach(l=>{const c=new Date(l.startedAt),u=l.endedAt?new Date(l.endedAt):void 0,d={id:l.spanId,name:l.name,type:l.spanType,latency:u?u.getTime()-c.getTime():0,startTime:c.toISOString(),endTime:u?u.toISOString():void 0,spans:[],parentSpanId:l.parentSpanId};r.set(l.spanId,d)}),e.forEach(l=>{const c=r.get(l.spanId);if(l?.parentSpanId==null){if(t&&c.endTime&&t>new Date(c.endTime)){c.endTime=t.toISOString();const u=new Date(t).getTime(),d=new Date(c.startTime).getTime();c.latency=u-d}n.push(c)}else{const u=r.get(l.parentSpanId);u?u.spans.push(c):n.push(c)}});const s=l=>l.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(n),i=l=>{l.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function qSt(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...qSt(r))}),t}const FBe=["agent","workflow","model","mcp","tool","workspace","other"];function HSt(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(ya,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"bg-oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:o.jsx(Di,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"bg-oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:o.jsx(Em,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(gl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(Mi,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"bg-oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},workspace:{icon:o.jsx(B9,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in r?r[t]:{typePrefix:"other"}}function kNn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Y("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(zBe,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(lVe,{}):o.jsx(Ux,{}):o.jsx(as,{})]}),a>(l??0)&&!i&&o.jsxs(zBe,{onClick:()=>s?.(),children:[a," ",o.jsx(oVe,{})]})]}):null})}function zBe({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Y("h-full",r),children:o.jsx("div",{className:Y("flex items-center gap-[0.1rem] text-ui-sm text-neutral5 border border-border1 pl-2 pr-1 rounded-lg transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-4 [&>svg]:h-4 [&>svg]:transition-all"),children:t})})}function _Nn({isLastChild:e,hasChildren:t=!1,expanded:r=!1}){return o.jsx("div",{className:Y("w-12 h-[2.8rem] relative opacity-100",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-0 after:border-l after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-0 before:border-b before:border-neutral3 before:border-dashed',"[&_svg]:transition-all","[&:hover_svg]:text-yellow-500 [&:hover_svg]:scale-[1.3] [&:hover_svg]:opacity-100",{"after:bottom-[50%]":e}),children:t&&o.jsx("span",{className:Y("flex absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%] items-center justify-center bg-surface2 p-1","[&>svg]:shrink-0 [&>svg]:opacity-60 [&>svg]:w-[0.8rem] [&>svg]:h-[0.8rem]"),children:r?o.jsx(dVe,{}):o.jsx(uVe,{})})})}function ENn({span:e,spanUI:t,isFaded:r,depth:n=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:l,isRootSpan:c,isExpanded:u,toggleChildren:d}){return o.jsxs("div",{className:"flex overflow-x-auto",style:{paddingLeft:`${n*1.5}rem`},children:[!c&&o.jsx("button",{onClick:()=>d?.(),disabled:!l,className:Y({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(_Nn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function QSt({span:e,depth:t=0,onSpanClick:r,selectedSpanId:n,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:l,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:h}){const p=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=qSt(e),y=g.length,x=t===0,w=HSt(e?.type),S=f?f.includes(e.id):!1,k=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(w?.typePrefix||""):!1)||k;b.useEffect(()=>{x&&h?.([e.id])},[x,e.id,h]),b.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const I=e.spans.some(P=>d.includes(P.id));!S&&I&&T()},[d,e.spans,e.id,S,h,f]);const T=()=>{if(!(!h||!f))if(S){const I=[e.id,...g];h(f.filter(P=>!I.includes(P)))}else h([...f,e.id])},j=()=>{!h||!f||h([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(ENn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(kNn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:y,allDescendantsExpanded:N,numOfChildren:m}),p&&S&&e.spans?.map((I,P,R)=>{const B=P===R.length-1;return o.jsx(QSt,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:h,featuredSpanIds:d},I.id)})]})}function CNn({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:r,isLoading:n,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:l}){const c=e?.[0]?.latency||0,u=e?.[0]?.startTime||"",d=e?.[0]?.endTime||"";return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Y("flex items-center text-ui-md gap-4 bg-surface3/50 rounded-md p-6 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Dt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(QSt,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function jNn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=FBe.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!FBe.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=trt(h=>{s?.(h)},1e3);return o.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[o.jsx("div",{className:"flex",children:o.jsx(Ox,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:h=>{l(h.target.value)},onReset:()=>l("")})}),o.jsxs(mft,{children:[c.map(h=>{const p=HSt(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(ce,{onClick:()=>d(h),className:m?"opacity-40":"",style:{color:m?void 0:p?.color,backgroundColor:p?.bgColor},children:[p?.icon&&o.jsx(Ce,{children:p.icon}),p?.label]})},h)}),u&&o.jsxs(ce,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ce,{children:o.jsx(oF,{})}),"Other"]}),o.jsx(ce,{onClick:n,disabled:t?.length===0,children:o.jsx(Ce,{children:o.jsx(An,{})})})]})]})}function TNn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=VSt(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>ONn(i),[i]);b.useEffect(()=>{if(l.trim()===""){h([]);return}const S=l.toLowerCase(),k=i.filter(_=>_.name.toLowerCase().includes(S)).map(_=>_.spanId);h(k)},[l,i]),b.useEffect(()=>{c(""),d([]),h([]),m([])},[e]);const y=S=>{r?.(t===S?void 0:S)},x=S=>{d(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(gr.Toolbar,{children:o.jsx(ce,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(An,{})})}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(xo,{})," Trace ",ef(e)]})})}),o.jsx(jNn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(CNn,{hierarchicalSpans:g,onSpanClick:y,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function NNn({results:e,isLoading:t,featuredResultId:r,onResultClick:n,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:l,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Dt,{})})]}):e.length===0?o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsx(Se.NoMatch,{message:"No results yet"})]}):o.jsxs(Se,{columns:d,children:[o.jsx(Se.Top,{children:s.map(f=>o.jsx(Se.TopCell,{children:f.label},f.name))}),o.jsxs(Se.Rows,{children:[e.map(f=>{const h=!!f.error,p=f.id===r;return o.jsxs(Se.Row,{onClick:()=>n(f.id),selected:p,children:[o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(Se.Cell,{children:o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",h?"bg-red-700":"bg-green-600")})})}),o.jsx(Gr,{children:h?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:INn(ANn(f.input),200)})}),i?.map(m=>{const y=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(Se.TextCell,{children:o.jsx("span",{className:"font-mono",children:y!=null?y.score.toFixed(3):"-"})},m)})]},f.id)}),o.jsxs("div",{ref:l,className:"h-1 col-span-full",children:[c&&o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Dt,{})}),!u&&e.length>0&&o.jsx(me,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function ANn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function INn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function RNn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function PNn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=RNn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(wC,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(ce,{onClick:n,"aria-label":"Close score details",children:o.jsx(An,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(La,{})," ",e.scorerId]})})}),o.jsxs(kx,{children:[o.jsx(Vt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(La,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(lx,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Qd,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(sc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(sc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(sc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(sc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const BBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function MNn({scoresByItemId:e,experimentStatus:t}){const r=b.useMemo(()=>{if(!e)return[];const n={};for(const s of Object.values(e))for(const a of s)n[a.scorerId]||(n[a.scorerId]={sum:0,count:0}),n[a.scorerId].sum+=a.score,n[a.scorerId].count++;return Object.entries(n).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(r.length===0){const n=t==="running"||t==="pending",s=e!==void 0;let a,i;return n?(a="Experiment in progress",i="Summary metrics will appear here once the experiment completes."):s?(a="No scorers configured",i="Add scorers when triggering an experiment to evaluate results and see summary metrics here."):(a="Loading scores",i="Fetching scorer results…"),o.jsx("div",{className:"flex h-full items-center justify-center py-12",children:o.jsx(Ja,{iconSlot:o.jsx(La,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:BBe,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{children:"Avg Score"}),o.jsx(Pt.HeaderCol,{children:"Items Scored"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:r.map(({scorerId:n,avg:s,count:a})=>o.jsxs(Pt.Row,{columns:BBe,children:[o.jsx(Pt.TextCell,{children:n}),o.jsx(Pt.TextCell,{className:"font-mono",children:s.toFixed(3)}),o.jsx(Pt.TextCell,{className:"font-mono",children:a})]},n))})})]})}function WSt({experimentId:e,experimentStatus:t,results:r,isLoading:n,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[l,c]=b.useState(null),[u,d]=b.useState(null),[f,h]=b.useState(void 0),[p,m]=b.useState(null),g=r.find(z=>z.id===l)??null,{data:y}=OSt(e,t),x=b.useMemo(()=>{if(!y)return[];const z=new Set;for(const H of Object.values(y))for(const Q of H)z.add(Q.scorerId);return[...z].sort()},[y]),{data:w}=VSt(u),S=w?.spans??[],k=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>=0&&z<S.length-1)return()=>h(S[z+1].spanId)},_=()=>{if(!f)return;const z=S.findIndex(H=>H.spanId===f);if(z>0)return()=>h(S[z-1].spanId)},E=z=>{c(z),d(null),h(void 0),m(null)},T=z=>{E(z===l?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>=0&&z<r.length-1)return()=>E(r[z+1].id)},I=()=>{if(!g)return;const z=r.findIndex(H=>H.id===g.id);if(z>0)return()=>E(r[z-1].id)},P=g?y?.[g.itemId]:void 0,R=P?.find(z=>z.id===p)??null,B=z=>{m(z===p?null:z),d(null),h(void 0)},D=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>=0&&z<P.length-1)return()=>m(P[z+1].id)},$=()=>{if(!p||!P)return;const z=P.findIndex(H=>H.id===p);if(z>0)return()=>m(P[z-1].id)},U=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(z=>({name:z,label:z,size:"1fr"}))],[l,x]);return o.jsxs(Ef,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(Cf,{children:[o.jsx(cs,{value:"summary",children:"Summary"}),o.jsx(cs,{value:"results",children:"Results"})]}),o.jsx(xs,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(MNn,{scoresByItemId:y,experimentStatus:t})}),o.jsx(xs,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(tf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(gr,{children:o.jsx(NNn,{results:r,isLoading:n,featuredResultId:l,onResultClick:T,columns:U,scoresByItemId:y,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(J3r,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(xNn,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:B,featuredScoreId:p,onShowTrace:()=>{d(g.traceId??null),h(void 0),m(null)}})}),g&&!u&&R&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(PNn,{score:R,onNext:D(),onPrevious:$(),onClose:()=>m(null)})}),g&&u&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(TNn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(SNn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const DNn={pending:o.jsx(CE,{}),running:o.jsx(g3,{}),completed:o.jsx(na,{}),failed:o.jsx(An,{})};function LNn({experiment:e,className:t}){const r=e.status,n=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Y("grid justify-items-end gap-3",t),children:[o.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[o.jsx("span",{className:Y("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":r==="completed","bg-red-700":r==="failed","bg-cyan-600":r==="running","bg-yellow-600":r==="pending"}),children:DNn[r]}),e.status]}),o.jsxs("div",{className:Y("flex items-center gap-3 text-neutral3 text-ui-md ","[&>span]:flex [&>span]:gap-1 [&>span]:items-center ","[&_b]:text-neutral4 [&_b]:font-semibold"),children:[o.jsxs("span",{children:["Total: ",o.jsx("b",{children:e.totalItems})]}),o.jsxs("span",{children:["Succeeded: ",o.jsx("b",{children:e.succeededCount})]}),o.jsxs("span",{children:["Failed: ",o.jsx("b",{children:e.failedCount})]}),(r==="pending"||r==="running")&&o.jsxs("span",{children:["Pending: ",o.jsx("b",{children:n})]})]})]})}function GSt({experimentId:e,experiment:t}){const{Link:r,paths:n}=or(),{data:s}=Eg(),{data:a}=c0(),{data:i}=cd(),l=()=>{switch(t.targetType){case"agent":return n.agentLink(t.targetId);case"workflow":return n.workflowLink(t.targetId);case"scorer":return n.scorerLink(t.targetId);default:return"#"}},c=()=>{const u=t.targetId;if(!u)return u;switch(t.targetType){case"agent":return s?.[u]?.name??u;case"workflow":return a?.[u]?.name??u;case"scorer":return i?.[u]?.scorer?.config?.name??u;default:return u}};return o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(hVe,{}),e," ",e&&o.jsx(ra,{content:e})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(p_,{})," Created at ",tr(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(Zn,{children:[o.jsx(p_,{})," Completed at ",tr(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(a2t,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(Zn,{children:[o.jsx(cF,{})," Version",t.targetType==="agent"&&t.targetId?o.jsx(r,{href:`${n.agentLink(t.targetId)}/editor?version=${encodeURIComponent(t.agentVersion)}`,className:"font-mono text-xs underline hover:text-accent1",children:t.agentVersion}):o.jsx("span",{className:"font-mono text-xs",children:t.agentVersion}),o.jsx(ra,{content:t.agentVersion})]})]})]}),o.jsx(Ir.Column,{children:o.jsx(LNn,{experiment:t})})]})}function Rve({delta:e}){const t=e>0?o.jsx(za,{size:"small",color:"green",intensity:"muted",children:o.jsx(nce,{})}):e<0?o.jsx(za,{size:"small",color:"red",intensity:"muted",children:o.jsx(sVe,{})}):null;return o.jsxs("span",{className:Y("font-mono text-sm text-neutral4 min-w-20"),children:[o.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function zL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function $Nn({item:e,baselineId:t,contenderId:r,baselineVersion:n,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[r],d=!!(c&&u),f=new Set;if(c)for(const p of Object.keys(c.scores))f.add(p);if(u)for(const p of Object.keys(u.scores))f.add(p);const h=[...f].sort();return o.jsxs(gr,{withLeftSeparator:!0,children:[o.jsxs(gr.Toolbar,{children:[o.jsx(wC,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(ce,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(An,{})})})]}),o.jsxs(gr.Content,{className:"pb-6",children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(lx,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(kx,{children:[h.length>0&&o.jsxs("div",{className:"grid gap-3",children:[o.jsx("h4",{className:"text-sm font-medium text-neutral5",children:"Scores"}),o.jsx("div",{className:"grid gap-2",children:h.map(p=>{const m=c?.scores[p]??null,g=u?.scores[p]??null,y=m!=null&&g!=null?g-m:null;return o.jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2 rounded-lg bg-surface2",children:[o.jsx("span",{className:"text-sm text-neutral5 font-medium",children:p}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("span",{className:"text-sm text-neutral3",children:[m!=null?m.toFixed(3):"-"," →"," ",g!=null?g.toFixed(3):"-"]}),y!=null&&o.jsx(Rve,{delta:y})]})]},p)})})]}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(Qd,{}),codeStr:zL(c?.output)}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(Qd,{}),codeStr:zL(u?.output)}),o.jsx(Vt.CodeSection,{title:"Item Input",icon:o.jsx(cx,{}),codeStr:zL(e.input)}),o.jsx(Vt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(AVe,{}),codeStr:zL(e.groundTruth)})]})}):o.jsx(cn,{variant:"warning",title:"Comparison not available",children:o.jsx(cn.Message,{children:(()=>{const p=c?"Contender":"Baseline",m=c?s:n;return o.jsxs(o.Fragment,{children:["The ",p," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item."]})})()})})]})]})}function FNn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(gr,{children:o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:a,children:[o.jsx(Pt.HeaderCol,{children:"Item ID"}),!s&&n.map(l=>o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[r],d=!!(c&&u);return o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Pt.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:n.map(f=>{const h=c?.scores[f]??null,p=u?.scores[f]??null,m=h!=null&&p!=null?p-h:null;return o.jsx(Pt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[h?.toFixed(2)," → ",p?.toFixed(2)]}),o.jsx(Rve,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const zNn={baseline:{label:"Baseline",color:"purple",customStyle:"items-end justify-items-end [&>div]:justify-end border-r-0 rounded-r-none"},contender:{label:"Contender",color:"cyan",customStyle:"items-start justify-items-start [&>div]:justify-start border-l-0 rounded-l-none"}};function UBe({datasetId:e,experiment:t,type:r}){const{Link:n}=or(),{label:s,color:a,customStyle:i}=zNn[r];if(!t)return null;const l=t.createdAt?new Date(t.createdAt):null;return o.jsxs("div",{className:`grid border-2 border-border1 rounded-lg p-5 gap-3 ${i}`,children:[o.jsxs("div",{className:"flex items-center gap-3 w-full overflow-clip",children:[r==="contender"&&o.jsxs(za,{size:"small",color:a,children:[s,o.jsx(Dw,{})]}),o.jsx(ce,{as:n,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),r==="baseline"&&o.jsxs(za,{size:"small",color:a,children:[o.jsx(wp,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(Zn,{children:[o.jsx(AVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(Zn,{children:[o.jsx(xVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(Zn,{children:[o.jsx(aVe,{})," ",tr(l,"MMM d, yyyy HH:mm")]})]})]})}function BNn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=rTn(e,t,r),{data:u}=G6(e,t),{data:d}=G6(e,r),f=u&&d&&u.datasetVersion!==d.datasetVersion,h=b.useMemo(()=>{if(!i)return[];const T=new Set;for(const j of i.items)for(const N of Object.values(j.results))if(N)for(const I of Object.keys(N.scores))T.add(I);return[...T].sort()},[i]),p=b.useMemo(()=>{if(!i||h.length===0)return[];const T=i.baselineId,j=t===T?r:t;return h.map(N=>{let I=0,P=0,R=0,B=0;for(const z of i.items){const H=z.results[T]?.scores[N],Q=z.results[j]?.scores[N];H!=null&&(I+=H,R++),Q!=null&&(P+=Q,B++)}const D=R>0?I/R:null,$=B>0?P/B:null,U=D!=null&&$!=null?$-D:null;return{scorerId:N,avgA:D,avgB:$,delta:U}})},[i,h,t,r]),m=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"baselineAvg",label:"Baseline Avg",size:"1fr"},{name:"comparisonAvg",label:"Comparison Avg",size:"1fr"},{name:"delta",label:"Delta",size:"1fr"}],g=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"8rem"},...s?[]:h.map(T=>({name:T,label:T,size:"1fr"}))],[h,s]),y=i?.items.find(T=>T.itemId===s)??null,x=T=>{a(T===s?null:T)},w=()=>{a(null)},S=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>=0&&T<i.items.length-1)return()=>a(i.items[T+1].itemId)},k=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>0)return()=>a(i.items[T-1].itemId)};if(l)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx(Dt,{})});if(c)return o.jsx(cn,{variant:"warning",title:"Error loading comparison",children:o.jsx(cn.Message,{children:c instanceof Error?c.message:"Unknown error"})});if(!i||i.items.length===0)return o.jsx("div",{className:"text-neutral4 text-sm text-center py-8",children:"No comparison data"});const _=i.baselineId,E=t===_?r:t;return o.jsxs("div",{className:"grid gap-10",children:[u&&d&&o.jsxs("div",{className:Y("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(UBe,{datasetId:e,experiment:u,type:"baseline"}),o.jsx("div",{className:"relative flex items-center justify-center px-[2vw] before:absolute before:inset-y-0 before:left-1/2 before:-translate-x-1/2 before:w-[2px] before:bg-border1",children:o.jsx("div",{className:"relative z-1 bg-surface2 rounded-lg p-2",children:o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ce,{onClick:n,children:"VS"})}),o.jsx(Gr,{children:"Switch the order"})]})})}),o.jsx(UBe,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsx(cn,{variant:"warning",title:"Version mismatch",children:o.jsxs(cn.Message,{children:["These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})}),p.length>0&&o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:m,children:[o.jsx(Pt.HeaderCol,{children:"Scorer"}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(fRe,{children:[o.jsx(za,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx(za,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(fRe,{children:[o.jsx(za,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx(za,{color:"cyan",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:p.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>o.jsxs(Pt.Row,{columns:m,children:[o.jsx(Pt.TextCell,{children:T}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),o.jsx(Pt.TextCell,{className:"flex justify-center",children:I!=null?o.jsx(Rve,{delta:I}):"-"})]},T))})})]}),o.jsxs(tf,{className:Y({"grid-cols-[1fr_2fr]":!!y}),children:[o.jsx(FNn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!y&&o.jsx($Nn,{item:y,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function UNn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=Ive(e,t),[l,c]=b.useState(!1),[u,d]=b.useState(new Set),f=x=>{r?.(x)},h=x=>s==null?x.isLatest:x.datasetVersion===s,p=x=>{d(w=>{const S=new Set(w);if(S.has(x))S.delete(x);else if(S.size>=2){const[k]=Array.from(S);return new Set([k,x])}else S.add(x);return S})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},y=()=>{u.size===2&&n?.([...u])};return o.jsxs(gr,{className:"min-w-56",children:[l?o.jsx(gr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ce,{onClick:m,children:"Cancel"}),o.jsx(Ln,{variant:"primary",disabled:u.size!==2,onClick:y,tooltipContent:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):o.jsx(o.Fragment,{children:(a||[]).length>1&&o.jsx(gr.Toolbar,{children:o.jsxs(ce,{onClick:g,className:"w-full",children:[o.jsx(zm,{})," Compare Ver."]})})}),i?o.jsx(VNn,{}):o.jsxs(Pt,{children:[o.jsx(Pt.Header,{children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:a?.map(x=>{const w=String(x.datasetVersion),S=typeof x.updatedAt=="string"?new Date(x.updatedAt):x.updatedAt;return o.jsxs(Pt.Row,{isSelected:l&&u.has(w),children:[l&&o.jsx(Pt.LabelCell,{children:o.jsx(hi,{checked:u.has(w),disabled:x.isDeleted,onCheckedChange:()=>{},onClick:k=>{k.stopPropagation(),x.isDeleted||p(w)},"aria-label":`Select version ${x.datasetVersion}`})}),o.jsx(Pt.RowButton,{item:x,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:h(x),onClick:()=>f(x),className:"py-2",children:o.jsx(Pt.VersionCell,{version:x.datasetVersion,date:S,isLatest:x.isLatest,isDeleted:x.isDeleted})})]},String(x.datasetVersion))})})})]})]})}function VNn(){return o.jsxs(Pt,{children:[o.jsx(Pt.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.HeaderCol,{children:"Item Version History"})}),o.jsx(Pt.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Pt.Row,{children:o.jsx(Pt.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Pt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function qNn(e,t){if(t){const r=typeof t=="string"?new Date(t):t;return`v${e} ${tr(r,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function HNn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=Nve(e),a=(s??[]).map(i=>({value:String(i.version),label:`${qNn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(gr.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx($o,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>n?.(i,r??"")}),o.jsx($o,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:r??"",onValueChange:i=>n?.(t??"",i)}),o.jsx("div",{})]})}const QNn=[{name:"id",label:"ID",size:"1fr"},{name:"versionA",label:"Version A",size:"1fr"},{name:"versionB",label:"Version B",size:"1fr"},{name:"compare",label:"Compare",size:"10rem"}],WNn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(ds,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(TVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(g2t,{}),tooltip:"Same in both versions"}};function sre({red:e=!1,tooltip:t}){return o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx(ZPt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Gr,{children:t})]})}function J0({variant:e,version:t}){if(!e)return o.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:r,icon:n,tooltip:s}=WNn[e];return o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsxs("div",{className:"grid grid-cols-[1fr_auto]",children:[t!==void 0&&o.jsxs("span",{className:"pr-3 text-ui-md text-neutral4 min-w-16 flex justify-end",children:["v. ",t]}),o.jsx(za,{color:r,size:"small",children:n})]})}),o.jsx(Gr,{children:s})]})}function GNn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function ZNn({datasetId:e,versionA:t,versionB:r,allItems:n,itemsAMap:s,itemsBMap:a}){const{Link:i}=or(),l=t>r;return o.jsx(Pt,{children:o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:n.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=GNn(u,d);return o.jsxs(Pt.Row,{columns:QNn,children:[o.jsx(Pt.IdCell,{id:c,isShortened:!1}),f!=="same"?o.jsxs(o.Fragment,{children:[u?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&l?o.jsx(J0,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(J0,{variant:"changed",version:u.datasetVersion}):o.jsx(J0,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:l,tooltip:l?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!l?o.jsx(J0,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(J0,{variant:"changed",version:d.datasetVersion}):o.jsx(J0,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(sre,{red:!l,tooltip:l?"Not present in this version":"Deleted in this version"})})]}):o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:o.jsx(J0,{variant:"same",version:d?.datasetVersion})}),f==="changed"?o.jsx(Pt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):o.jsx(Pt.Cell,{children:o.jsx(sre,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const VBe={needsReview:"#facc15",complete:"#22c55e"},YNn=[{label:"Needs Review",color:VBe.needsReview},{label:"Reviewed",color:VBe.complete}];function XNn({reviewSummary:e,experiments:t,datasets:r,isLoading:n,isError:s}){const{data:a,maxVal:i,totalInPipeline:l}=b.useMemo(()=>{if(!e?.counts||!t)return{data:[],maxVal:0,totalInPipeline:0};const u=new Map;for(const m of t)u.set(m.id,m);const d=new Map;if(r)for(const m of r)d.set(m.id,m.name);let f=0,h=0;const p=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;h+=g,g>f&&(f=g);const y=u.get(m.experimentId),x=y?.datasetId?d.get(y.datasetId):void 0,w=x?`${x} · ${m.experimentId.slice(0,8)}`:m.experimentId.slice(0,8);p.push({name:w,values:[m.needsReview,m.complete]})}return{data:p,maxVal:f,totalInPipeline:h}},[e,t,r]),c=a.length>0;return o.jsxs(Wt,{children:[o.jsxs(Wt.TopBar,{children:[o.jsx(Wt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Wt.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Wt.Loading,{}):s?o.jsx(Wt.Error,{message:"Failed to load review data"}):o.jsx(Wt.Content,{children:c?o.jsx(J_,{data:a,segments:YNn,maxVal:i,fmt:u=>String(u)}):o.jsx(Wt.NoData,{message:"No items have been sent to review yet"})})]})}function Pve(){const e=We();return Ot({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function ZSt(e){const t=new Map;if(!e?.counts)return t;for(const r of e.counts)t.set(r.experimentId,{needsReview:r.needsReview,complete:r.complete,total:r.total});return t}function KNn(e,t){const r=new Map,n=ZSt(e);if(!n.size||!t)return r;for(const s of t){const a=n.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const l=r.get(s.datasetId)??{needsReview:0,complete:0};l.needsReview+=a.needsReview,l.complete+=a.complete,r.set(s.datasetId,l)}return r}function JNn(e){return e?.counts?e.counts.reduce((t,r)=>({needsReview:t.needsReview+r.needsReview,complete:t.complete+r.complete,inPipeline:t.inPipeline+r.needsReview+r.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const eAn=10;function tAn(){const[e,t]=b.useState(!1),[r,n]=b.useState(""),[s,a]=b.useState("all"),[i,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState(0),{data:h,isLoading:p,error:m}=Lh({page:d,perPage:eAn}),{data:g,isLoading:y,error:x}=rB(),{data:w}=Pve(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>xTn(S),[S]),T=b.useMemo(()=>KNn(w,_),[w,_]),j=p||y,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(Q=>Q+1),[]),R=b.useCallback(()=>f(Q=>Math.max(0,Q-1)),[]),B=b.useCallback(Q=>{n(Q),f(0)},[]),D=b.useCallback(Q=>{a(Q),f(0)},[]),$=b.useCallback(Q=>{l(Q),f(0)},[]),U=b.useCallback(Q=>{u(Q),f(0)},[]);if(N&&Ps(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(aa,{})});if(N&&ks(N))return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(Zs,{resource:"datasets"})});if(N)return o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(pu,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(Jr,{title:"Datasets",icon:o.jsx(Na,{}),children:o.jsx(wTn,{onCreateClick:I})}),o.jsx(Rle,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||r!=="",H=()=>{n(""),a("all"),l("all"),u("all"),f(0)};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:j,children:[o.jsx(Na,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Ln,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(ds,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Datasets documentation",children:o.jsx(Li,{})})]})]}),o.jsx(OTn,{search:r,onSearchChange:B,targetFilter:s,onTargetFilterChange:D,experimentFilter:i,onExperimentFilterChange:$,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:H,hasActiveFilters:z})]}),o.jsx(yTn,{datasets:S,experiments:_,reviewByDataset:T,isLoading:j,search:r,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:k,onNextPage:P,onPrevPage:R}),o.jsx(Rle,{open:e,onOpenChange:t})]})}const rAn=new Set(["items","experiments","review"]);function nAn(){const{datasetId:e}=sa(),t=uu(),[r,n]=ao(),s=r.get("tab"),a=s&&rAn.has(s)?s:"items",i=E=>{n(E==="items"?{}:{tab:E},{replace:!0})},[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(!1),[p,m]=b.useState(!1),[g,y]=b.useState(null),{data:x,error:w}=Tg(e??"");if(!e)return o.jsx(zr,{children:o.jsx(df,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Ps(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})});if(w&&ks(w))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},k=()=>{t("/datasets")},_=E=>{y(E?.version??null)};return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(TTn,{value:e,variant:"ghost"})})]})}),o.jsxs(df,{className:"content-stretch",children:[o.jsx(hNn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(ce,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(ux,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(bNn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(mNn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(CTn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(jTn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function sAn(){const{datasetId:e,experimentId:t}=sa(),{data:r}=Tg(e??""),{data:n,isLoading:s,error:a}=G6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=tB({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Dt,{})})}):a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):a&&ks(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a||!n?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:r?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(GSt,{experimentId:t,experiment:n}),o.jsx(WSt,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function aAn(){const{datasetId:e}=sa(),[t,r]=ao(),{data:n,error:s}=Tg(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Ps(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):s&&ks(s)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(zm,{})}),"Compare Experiments"]})]})}),o.jsx(df,{children:o.jsxs("div",{className:"text-neutral4 text-center py-8",children:[o.jsx("p",{children:"Select two experiments to compare."}),o.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(zm,{})}),"Experiments Comparison"]})]})}),o.jsx(df,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ir.Description,{children:["Comparing"," ",o.jsx(fr,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(fr,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]})})]}),o.jsx(BNn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function iAn(){const{datasetId:e,itemId:t}=sa(),{Link:r}=or(),n=uu(),{data:s,isLoading:a,error:i}=Ive(e??"",t??""),{updateItem:l,deleteItem:c}=ni(),{data:u}=Tg(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[h,p]=b.useState(null),m=b.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(d.input,null,2),groundTruth:d.groundTruth?JSON.stringify(d.groundTruth,null,2):"",metadata:d.metadata?JSON.stringify(d.metadata,null,2):""},[d,f]),g=d?.datasetVersion??0,[y,x]=b.useState(!1),[w,S]=b.useState(m.input),[k,_]=b.useState(m.groundTruth),[E,T]=b.useState(m.metadata),[j,N]=b.useState(g);g!==j&&(N(g),S(m.input),_(m.groundTruth),T(m.metadata));const[I,P]=b.useState(!1),R=V=>{p(f?V:V.isLatest?null:V)},B=()=>{p(null)},D=!f&&h!=null,$=()=>{D||x(!0)},U=()=>{D||P(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(w)}catch{ze.error("Input must be valid JSON");return}let M;if(k.trim())try{M=JSON.parse(k)}catch{ze.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:M,metadata:W}),ze.success("Item updated successfully"),x(!1)}catch(G){ze.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},H=()=>{d&&(S(JSON.stringify(d.input,null,2)),_(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},Q=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),n(`/datasets/${e}`)}catch(V){ze.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},L=h??d,Z=L?{id:t??"",datasetId:e??"",datasetVersion:L.datasetVersion,input:L.input,groundTruth:L.groundTruth,metadata:L.metadata,createdAt:L.createdAt,updatedAt:L.updatedAt}:null;return i&&Ps(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):i&&ks(i)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(zr,{children:o.jsx(df,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:u?.name}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Item"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(lx,{}),t," ",o.jsx(ra,{content:t})]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Item of ",o.jsx(Na,{})," ",u?.name]})}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(p_,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Vx,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ir.Column,{children:!y&&!f&&o.jsxs(ps,{children:[o.jsxs(ce,{onClick:$,disabled:D,title:D?"Return to latest version to edit":void 0,children:[o.jsx(TVe,{})," Edit"]}),o.jsxs(ce,{onClick:U,disabled:D,title:D?"Return to latest version to delete":void 0,children:[o.jsx(ed,{})," Delete"]})]})})]}),o.jsxs(tf,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(gr,{withRightSeparator:!y,children:[f&&d&&o.jsx(cn,{variant:"destructive",title:"Item deleted",children:o.jsxs(cn.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&D&&h&&o.jsx(cn,{variant:"warning",title:"Previous version",action:o.jsxs(cn.Button,{onClick:B,children:[o.jsx(fw,{})," Return to the latest version"]}),children:o.jsxs(cn.Message,{children:["Viewing version v",h.datasetVersion]})}),y?o.jsx(zSt,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:l.isPending}):Z?o.jsx(nB,{item:Z,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&o.jsx(gr,{children:o.jsx(UNn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{n(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:h?.datasetVersion??null})})]})]})})]}),o.jsx($t,{open:I,onOpenChange:P,children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsx($t.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:Q,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function qBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function oAn(){const{datasetId:e}=sa(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Tg(e??""),{Link:i}=or(),[l,c]=b.useState(!1),{data:u}=Nle(e??"",n[0]??""),{data:d}=Nle(e??"",n[1]??"");return a&&Ps(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):a&&ks(a)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||n.length<2?o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two items to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(wp,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{}),"Compare Dataset Items"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",n.length," items of"," ",o.jsx(fr,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]}),o.jsx(ce,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(yVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(l2t,{})," Diff View"]})})]})})]}),o.jsx(tf,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(lAn,{datasetId:e,itemId:f,Link:i,idx:h,itemIds:n,showContent:!l,onItemChange:p=>{const m=[...n];m[h]=p,r({items:m.join(",")})}}),h==0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(zft,{codeA:qBe(u),codeB:qBe(d)})]})})]})}function lAn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Nle(e,t),{data:u}=kE(e),d=new Set(s.filter((h,p)=>p!==n)),f=(u??[]).map(h=>({value:h.id,label:h.id,disabled:d.has(h.id)}));return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"flex gap-4",children:[o.jsx(sge,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(ce,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Vx,{}),"Versions"]})]}),i&&o.jsx(gr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(BSt,{item:l}),o.jsx(nB,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function HBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function cAn(){const{datasetId:e,itemId:t}=sa(),[r,n]=ao(),[s,a]=b.useState(!1),i=r.get("ids")?.split(",").map(Number).filter(p=>!isNaN(p)&&p>0)??[],{data:l,error:c}=Tg(e??""),{Link:u}=or(),{data:d}=Ive(e??"",t??""),{data:f}=Mle(e??"",t??"",i[0]??0,l?.version),{data:h}=Mle(e??"",t??"",i[1]??0,l?.version);return c&&Ps(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):c&&ks(c)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]}):o.jsxs(zr,{children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:l?.name}),o.jsx(jr,{as:fr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(wp,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(zm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",i.length," versions of"," ",o.jsx(fr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:fr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(wp,{}),"Back to Item"]}),o.jsx(ce,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(yVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(H2t,{})," Diff View"]})})]})})]}),o.jsx(tf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(uAn,{datasetId:e,itemId:t,datasetVersion:p,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const y=[...i];y[m]=g,n({ids:y.join(",")})}}),m===0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},p))}),s&&f&&h&&o.jsx(zft,{codeA:HBe(f),codeB:HBe(h)})]})})]})}function uAn({datasetId:e,itemId:t,datasetVersion:r,latestVersion:n,allVersions:s,versionNumbers:a,Link:i,idx:l,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Mle(e,t,r,n),h=new Set(a.filter((g,y)=>y!==l)),p=s.map(g=>{const y=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",tr(y,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx(za,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:h.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Vx,{className:"w-6 h-6 opacity-50"}),o.jsx(sge,{label:"Version",name:`compare-version-${l}`,value:String(r),onValueChange:g=>u(Number(g)),options:p,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(gr.Content,{children:f?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?o.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):o.jsx(nB,{item:m,Link:i})})]})}function dAn(){const{datasetId:e}=sa(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=uu(),{data:s,error:a}=Tg(e??""),i=kE(e??"",void 0,r[0]??null),l=kE(e??"",void 0,r[1]??null),c=b.useMemo(()=>i.data??[],[i.data]),u=b.useMemo(()=>l.data??[],[l.data]),d=b.useMemo(()=>{const g=new Map;for(const y of[...c,...u])g.has(y.id)||g.set(y.id,{id:y.id,createdAt:new Date(y.createdAt)});return[...g.values()].sort((y,x)=>x.createdAt.getTime()-y.createdAt.getTime())},[c,u]),f=b.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),h=b.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&Ps(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})});if(a&&ks(a))return o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})});if(!e||r.length<2)return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(df,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]});const p=(g,y,x)=>{n(`/datasets/${e}/items/${g}/versions?ids=${y?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,y)=>{n(`/datasets/${e}/versions?ids=${g},${y}`,{replace:!0})};return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:fr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(g1e,{})}),"Compare Versions"]})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsxs(Ir,{children:[o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{children:[o.jsx(g1e,{})," Compare Dataset Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(Vx,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ce,{as:fr,to:`/datasets/${e}`,children:[o.jsx(wp,{}),"Back to Dataset"]})})]}),o.jsx(tf,{children:o.jsxs(gr,{children:[o.jsx(HNn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(ZNn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function fAn(e){if(!e||e.length<2)return null;const t=[...e].sort((i,l)=>new Date(i.createdAt).getTime()-new Date(l.createdAt).getTime()),r=Math.floor(t.length/2),n=r,s=t.length-r;if(n===0)return null;const a=(s-n)/n*100;return{changePct:Math.round(a*10)/10,prevValue:String(n)}}function hAn({scorers:e,datasets:t,experiments:r,avgScore:n,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:l,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,h=t?.length,p=r?.length,m=n!=null&&s!=null&&s!==0?{changePct:Math.round((n-s)/s*100*10)/10,prevValue:String(s)}:null,g=fAn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Total Scorers"}),i?o.jsx(Cn.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(f)}),o.jsx(Cn.NoChange,{message:"Static count"})]}):o.jsx(Cn.NoData,{})]}),o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Total Datasets"}),l?o.jsx(Cn.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(h)}),o.jsx(Cn.NoChange,{message:"Static count"})]}):o.jsx(Cn.NoData,{})]}),o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Avg Score"}),u?o.jsx(Cn.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(n)}),m?o.jsx(Cn.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(Cn.NoChange,{})]}):o.jsx(Cn.NoData,{})]}),o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Total Experiments"}),c?o.jsx(Cn.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(p)}),g?o.jsx(Cn.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(Cn.NoChange,{})]}):o.jsx(Cn.NoData,{})]}),o.jsxs(Cn,{children:[o.jsx(Cn.Label,{children:"Needs Review"}),d?o.jsx(Cn.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(Cn.Value,{children:String(a)}),a>0?o.jsx(Cn.NoChange,{message:"items pending review"}):o.jsx(Cn.NoChange,{message:"All caught up"})]}):o.jsx(Cn.NoData,{})]})]})}const pAn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],QBe="auto 1fr auto auto auto auto auto auto auto";function mAn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const gAn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function yAn({experiments:e,datasets:t,reviewByExperiment:r,isLoading:n,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=or(),u=b.useMemo(()=>{const h=new Map;return t?.forEach(p=>h.set(p.id,p.name)),h},[t]),d=b.useMemo(()=>[...e].sort((h,p)=>{const m=h.createdAt?new Date(h.createdAt).getTime():0;return(p.createdAt?new Date(p.createdAt).getTime():0)-m}),[e]),f=b.useMemo(()=>{const h=s.toLowerCase();return d.filter(p=>{const m=p.datasetId?u.get(p.datasetId)??"":"",g=!h||p.id.toLowerCase().includes(h)||m.toLowerCase().includes(h)||(p.targetId??"").toLowerCase().includes(h),y=a==="all"||p.status===a,x=i==="all"||p.datasetId===i;return g&&y&&x})},[d,s,u,a,i]);return n?o.jsx(yh,{columns:QBe}):o.jsxs(Se,{columns:QBe,children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Experiment"}),o.jsx(Se.TopCell,{children:"Dataset"}),o.jsx(Se.TopCell,{children:"Target"}),o.jsx(Se.TopCell,{children:"Status"}),o.jsx(Se.TopCell,{className:"text-center",children:"Items"}),o.jsx(Se.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(Se.TopCell,{className:"text-center",children:"Failed"}),o.jsx(Se.TopCell,{className:"text-center",children:"Review"}),o.jsx(Se.TopCell,{children:"Date"})]}),f.map(h=>{const p=h.datasetId?u.get(h.datasetId)??h.datasetId.slice(0,8):"—",m=h.status??"pending",g=h.succeededCount??0,y=h.failedCount??0,x=h.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(Se.RowLink,{to:l.experimentLink(h.id),LinkComponent:c,children:[o.jsx(Se.NameCell,{className:"font-mono",children:h.id.slice(0,8)}),o.jsx(Se.TextCell,{children:p}),o.jsx(Se.Cell,{children:o.jsxs("span",{className:"truncate",children:[h.targetType," ",h.targetId]})}),o.jsx(Se.Cell,{children:o.jsx(M1,{variant:gAn[m]??"neutral",withDot:!0,children:m})}),o.jsx(Se.TextCell,{className:"text-center",children:x}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(Se.TextCell,{className:"text-center",children:o.jsx("span",{className:y>0?"text-accent2":"",children:y})}),o.jsx(Se.Cell,{className:"text-center",children:(()=>{const S=r?.get(h.id);if(!S)return o.jsx("span",{className:"text-neutral2",children:"—"});const k=S.needsReview+S.complete;return k===0?o.jsx("span",{className:"text-neutral2",children:"—"}):S.needsReview>0?o.jsxs(vt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(vt,{variant:"success",children:[S.complete,"/",k," reviewed"]})})()}),o.jsx(Se.TextCell,{children:mAn(h.createdAt)})]},h.id)})]})}function vAn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const BL={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},bAn=[{label:"Completed",color:BL.completed},{label:"Running",color:BL.running},{label:"Pending",color:BL.pending},{label:"Failed",color:BL.failed}];function xAn({experiments:e,datasets:t,isLoading:r,isError:n}){const{data:s,maxVal:a}=b.useMemo(()=>{if(!e||e.length===0)return{data:[],maxVal:0};const l=new Map;if(t)for(const f of t)l.set(f.id,f.name);const c=new Map;for(const f of e){const h=f.datasetId??"unknown";c.has(h)||c.set(h,{completed:0,running:0,pending:0,failed:0});const p=c.get(h),m=f.status;m in p&&p[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,h])=>{const p=h.completed+h.running+h.pending+h.failed;return p>u&&(u=p),{name:l.get(f)??f.slice(0,12),values:[h.completed,h.running,h.pending,h.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return o.jsxs(Wt,{children:[o.jsxs(Wt.TopBar,{children:[o.jsx(Wt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Wt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Wt.Loading,{}):n?o.jsx(Wt.Error,{message:"Failed to load experiments data"}):o.jsx(Wt.Content,{children:i?o.jsx(J_,{data:s,segments:bAn,maxVal:a,fmt:l=>String(l)}):o.jsx(Wt.NoData,{message:"No experiments have been run yet"})})]})}const wAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Experiments yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Run an experiment from a dataset to evaluate ",o.jsx("br",{}),"your agents and workflows."]}),actionSlot:o.jsx("div",{className:"flex flex-col items-center gap-2",children:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(xa,{})]})})})});function SAn({search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:i,onReset:l,hasActiveFilters:c}){return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Sg,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx($o,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...pAn],value:r,onValueChange:n,className:"whitespace-nowrap"}),o.jsx($o,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(ce,{onClick:l,size:"sm",variant:"default",children:[o.jsx(An,{className:"size-3"})," Reset"]})]})]})}function OAn(){const{data:e,isLoading:t,error:r}=cd(),{data:n,isLoading:s,error:a}=Lh(),{data:i,isLoading:l,error:c}=rB(),{data:u,isLoading:d,isError:f,error:h}=vOn(),{data:p,isLoading:m,isError:g,error:y}=Pve(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>JNn(p),[p]),k=r||a||c||h||y;return k&&Ps(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(aa,{})}):k&&ks(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"evaluation"})}):k?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Tu,{}),children:o.jsx(pu,{title:"Failed to load evaluation data",message:k.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Tu,{})," Evaluation"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Evaluation documentation",children:o.jsx(Li,{})})})]})}),o.jsxs("div",{className:"flex flex-col gap-6 pt-4",children:[o.jsx(pie,{children:o.jsx(hAn,{scorers:e,datasets:x,experiments:w,avgScore:u?.avgScore??null,prevAvgScore:u?.prevAvgScore??null,totalNeedsReview:S.needsReview,isLoadingScorers:t,isLoadingDatasets:s,isLoadingExperiments:l,isLoadingScores:d,isLoadingReview:m})}),o.jsx(oOn,{summaryData:u?.summaryData??[],overTimeData:u?.overTimeData??[],scorerNames:u?.scorerNames??[],avgScore:u?.avgScore??null,isLoading:d,isError:f}),o.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[o.jsx(STn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(xAn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(XNn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function kAn(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=Lh(),{data:u,isLoading:d,error:f}=rB(),{data:h}=Pve(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>vAn(p),[p]),y=b.useMemo(()=>ZSt(h),[h]),x=l||d,w=f||c;if(w&&Ps(w))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(aa,{})});if(f&&ks(f))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"experiments"})});if(c&&ks(c))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(Zs,{resource:"datasets"})});if(w)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(pu,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Tu,{}),children:o.jsx(wAn,{})});const S=r!=="all"||s!=="all"||e!=="",k=()=>{t(""),n("all"),a("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:x,children:[o.jsx(Tu,{})," Experiments"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Experiments documentation",children:o.jsx(Li,{})})})]}),o.jsx(SAn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(yAn,{experiments:m,datasets:p,reviewByExperiment:y,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function _An(){const{experimentId:e}=sa(),{data:t,isLoading:r}=rB(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=G6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=tB({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?r||i||!s?o.jsx(zr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Dt,{})})}):l&&Ps(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})}):l&&ks(l)?o.jsx(zr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"datasets"})})}):l||!a?o.jsx(zr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/experiments",children:[o.jsx(Ce,{children:o.jsx(Tu,{})}),"Experiments"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Experiment"})]})}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[o.jsx(GSt,{experimentId:e,experiment:a}),o.jsx(WSt,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h})]})})]}):null}function YSt({redirectUri:e,onSuccess:t,initialMode:r="signin",errorMessage:n}){const{data:s,isLoading:a}=SC(),{mutate:i,isPending:l,error:c}=Ajn(),{mutate:u,isPending:d,error:f}=Ijn(),{mutate:h,isPending:p}=LSt(),[m,g]=b.useState(r),[y,x]=b.useState(""),[w,S]=b.useState(""),[k,_]=b.useState("");if(a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Authentication is not configured"})});const{login:E}=s,T=E.type==="sso"||E.type==="both",j=E.type==="credentials"||E.type==="both",N=E.sso,I=E.signUpEnabled!==!1,P=m==="signin"||!I,R=P?l:d,B=P?c:f,D=()=>{t?t():e?window.location.href=e:window.location.href="/"},$=H=>{H.preventDefault(),P?i({email:w,password:k},{onSuccess:D}):u({email:w,password:k,name:y||void 0},{onSuccess:D})},U=()=>{h({redirectUri:e},{onSuccess:H=>{window.location.href=H.url}})},z=()=>{g(P?"signup":"signin")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[o.jsx(Yb,{className:"h-10 w-10"}),o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:P?"Sign in to Mastra Studio":"Create your account"})]}),E.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[o.jsx(SVe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"text-sm text-neutral3",children:E.description})]}),n&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:n}),j&&o.jsxs("form",{onSubmit:$,className:"space-y-4",children:[!P&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"name",className:"block text-sm text-neutral4",children:"Name"}),o.jsx(ar,{id:"name",type:"text",value:y,onChange:H=>x(H.target.value),placeholder:"Your name",variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"email",className:"block text-sm text-neutral4",children:"Email"}),o.jsx(ar,{id:"email",type:"email",value:w,onChange:H=>S(H.target.value),placeholder:"you@example.com",required:!0,variant:"default",size:"lg"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{htmlFor:"password",className:"block text-sm text-neutral4",children:"Password"}),o.jsx(ar,{id:"password",type:"password",value:k,onChange:H=>_(H.target.value),placeholder:P?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),o.jsx(ce,{type:"submit",disabled:R,className:"w-full",size:"lg",children:R?P?"Signing in...":"Creating account...":P?"Sign in":"Create account"}),I&&o.jsxs("div",{className:"text-center text-sm",children:[o.jsx("span",{className:"text-neutral3",children:P?"Don't have an account? ":"Already have an account? "}),o.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:P?"Sign up":"Sign in"})]})]}),T&&j&&o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border1"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&o.jsxs(ce,{onClick:U,disabled:p,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&o.jsx("span",{className:"mr-2",children:N.icon}),p?"Redirecting...":N.text||"Sign in"]})]})})}function EAn(){const[e]=ao(),t=uu(),r=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(YSt,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}function CAn(){const[e,t]=ao(),r=Tzr(e,t),n=Izr(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=Nht(),{data:d=[],isPending:f}=Aht({entityType:r.selectedEntityOption?.entityType,rootOnly:!0}),{data:h=[],isPending:p}=Iht(),{data:m=[],isPending:g}=Rht(),y=b.useMemo(()=>Szr({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:h,loading:{tags:u,entityNames:f,serviceNames:g,environments:p}}),[c,d,m,h,u,f,g,p]),x=b.useMemo(()=>Ezr({rootEntityType:r.selectedEntityOption?.entityType,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,tokens:r.filterTokens}),[r.filterTokens,r.selectedDateFrom,r.selectedDateTo,r.selectedEntityOption]),{data:w=[],isLoading:S,error:k,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T}=gzr({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=Mzr(w,r.featuredLogId,r.handleFeaturedChange,r.featuredTraceId),{data:B,isLoading:D}=Mme(r.featuredTraceId??null),{data:$,isLoading:U}=D1(r.featuredTraceId??"",r.featuredSpanId??""),z=b.useCallback(()=>r.applyFilterTokens(Czr(y,r.filterTokens)),[y,r]),H=b.useCallback(()=>r.handleFeaturedChange({logId:null}),[r]),Q=b.useCallback(G=>r.handleFeaturedChange({traceId:G,spanId:null}),[r]),L=b.useCallback((G,J)=>r.handleFeaturedChange({traceId:G,spanId:J}),[r]),Z=b.useCallback(()=>{r.handleFeaturedChange({traceId:null,spanId:null}),l(!1)},[r]),V=b.useCallback(()=>r.handleFeaturedChange({spanId:null}),[r]),M=b.useCallback(G=>r.handleFeaturedChange({spanId:G??null}),[r]);if(k)return o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(ozr,{error:k,resource:"logs",errorTitle:"Failed to load logs"})});const W=r.filterTokens.length>0||r.datePreset!=="last-24h"||!!r.selectedDateTo;return w.length===0&&!S&&!W?o.jsx(Jr,{title:"Logs",icon:o.jsx(YL,{}),children:o.jsx(fzr,{})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:S,children:[o.jsx(YL,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(cht,{preset:r.datePreset,onPresetChange:r.handleDatePresetChange,dateFrom:r.selectedDateFrom,dateTo:r.selectedDateTo,onDateChange:r.handleDateChange,disabled:S,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(fft,{fields:y,tokens:r.filterTokens,onTokensChange:r.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/logs/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Logs documentation",tooltipContent:"Go to Logs documentation",children:o.jsx(Li,{})})]})]}),o.jsx(uzr,{isLoading:S,filterFields:y,filterTokens:r.filterTokens,onFilterTokensChange:r.handleFilterTokensChange,onClear:z,onRemoveAll:r.handleRemoveAll,onSave:n.handleSave,onRemoveSaved:n.hasSavedFilters?n.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]}),o.jsx(lzr,{logCollapsed:i,listSlot:o.jsx(czr,{logs:w,isLoading:S,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:r.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(izr,{log:N,onClose:H,onTraceClick:Q,onSpanClick:L,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:r.featuredTraceId?o.jsx(NFr,{traceId:r.featuredTraceId,spans:B?.spans,isLoading:D,onClose:Z,onSpanSelect:M,selectedSpanId:r.featuredSpanId}):null,spanPanelSlot:r.featuredTraceId&&r.featuredSpanId?o.jsx(TFr,{spanId:r.featuredSpanId,span:$?.span,isLoading:U,onClose:V}):null})]})}const XSt=e=>{const t=We();return Ot({queryKey:["mcpserver-tools",e?.id],queryFn:async()=>{const n=(await t.getMcpServerTools(e?.id)).tools,s={};return n.forEach(a=>{s[a.id]=a}),s},retry:!1,refetchOnWindowFocus:!1})};function jAn({server:e}){const{paths:t,Link:r}=or(),s=We().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=XSt(e),l=Object.values(i||{}),c=l.length,u=l.filter(h=>h.toolType==="agent").length,d=l.filter(h=>h.toolType==="workflow").length,f=Ch(e.name,50);return o.jsxs(Se.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:r,children:[o.jsx(Se.NameCell,{children:f}),o.jsx(Se.DescriptionCell,{children:a}),o.jsx(Se.TextCell,{className:"text-center",children:u||""}),o.jsx(Se.TextCell,{className:"text-center",children:c||""}),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]})}function TAn({mcpServers:e,isLoading:t,search:r=""}){const n=b.useMemo(()=>{const s=r.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,r]);return t?o.jsx(yh,{columns:"auto 1fr auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"URL"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ya,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Tools",short:o.jsx(Mi,{}),tooltip:"Tools",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Workflows",short:o.jsx(Di,{}),tooltip:"Workflow Tools",className:"text-center"})]}),n.length===0&&r?o.jsx(Se.NoMatch,{message:"No MCP Servers match your search"}):null,n.map(s=>o.jsx(jAn,{server:s},s.id))]})}const NAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No MCP Servers yet",descriptionSlot:o.jsxs(o.Fragment,{children:["MCP servers are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(xa,{})]})})}),AAn=()=>{const{data:e=[],isLoading:t,error:r}=uM(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(aa,{})}):r&&ks(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(Zs,{resource:"MCP servers"})}):r?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(pu,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(gl,{}),children:o.jsx(NAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(gl,{})," MCP Servers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to MCP documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(TAn,{mcpServers:e,isLoading:t,search:n})]})},IAn=(e,t)=>{const r=new Map,n=Object.keys(t);for(const s of n){const a=t[s],i=a.tools,l=Object.keys(i);for(const c of l){const u=i[c];r.has(u.id)||r.set(u.id,{...u,agents:[]}),r.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))r.has(a.id)||r.set(a.id,{...a,agents:[]});return Array.from(r.values())};function RAn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=or(),i=b.useMemo(()=>IAn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(yh,{columns:"auto 1fr auto"}):o.jsxs(Se,{columns:"auto 1fr auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Agents",short:o.jsx(ya,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&n?o.jsx(Se.NoMatch,{message:"No Tools match your search"}):null,l.map(c=>{const u=Ch(c.id,50),d=Ch(c.description??"",200),f=c.agents.length;return o.jsxs(Se.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(Se.NameCell,{children:u}),o.jsx(Se.DescriptionCell,{children:d}),o.jsx(Se.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const PAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Tools yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Mastra tools are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(xa,{})]})})}),MAn=()=>{const e=We();return Wr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new h_;Object.entries(n??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:r,requestContext:s})}catch(a){throw ze.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},DAn=({toolId:e})=>{const{canExecute:t}=Sv(),r=t("tools"),{data:n={}}=Eg(),s=b.useMemo(()=>{for(const g of Object.values(n))if(g.tools){const y=Object.values(g.tools).find(x=>x.id===e);if(y)return y}return null},[n,e]),{data:a,isLoading:i,error:l}=Jkn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=MAn(),{requestContext:h}=_s();b.useEffect(()=>{if(l){const g=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${g}`)}},[l]);const p=async(g,y)=>{if(!c)return;const x={...h??{},...y??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?lg(ag(ev(c?.inputSchema))):Gn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(_n,{className:"h-8 w-48 mb-4"}),o.jsx(_n,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(xve,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:p,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function LAn({value:e,onValueChange:t,placeholder:r="Select a tool...",searchPlaceholder:n="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=J8(),{data:h={},isLoading:p,isError:m,error:g}=Eg(),{navigate:y,paths:x}=or();b.useEffect(()=>{if(d){const _=f instanceof Error?f.message:"Failed to load tools";ze.error(`Error loading tools: ${_}`)}},[d,f]),b.useEffect(()=>{if(m){const _=g instanceof Error?g.message:"Failed to load agents";ze.error(`Error loading agents: ${_}`)}},[m,g]);const w=new Map;Object.values(h).forEach(_=>{_.tools&&Object.values(_.tools).forEach(E=>{w.has(E.id)||w.set(E.id,E)})}),Object.values(c).forEach(_=>{w.has(_.id)||w.set(_.id,_)});const S=Array.from(w.values()).map(_=>({label:_.id,value:_.id})),k=_=>{t?t(_):_&&_!==e&&y(x.toolLink(_))};return o.jsx(Gl,{options:S,value:e,onValueChange:k,placeholder:u||p?"Loading tools...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||p||d||m,variant:l})}const $An=({isLoading:e,server:t})=>{const[{sseUrl:r,httpStreamUrl:n},s]=b.useState({sseUrl:"",httpStreamUrl:""});if(b.useEffect(()=>{if(!t)return;const i=window.MASTRA_SERVER_HOST,l=window.MASTRA_SERVER_PORT;let c=null;i&&l&&(c=`http://${i}:${l}`);const u=c||"http://localhost:4111",d=`${u}/api/mcp/${t.id}/sse`,f=`${u}/api/mcp/${t.id}/mcp`;s({sseUrl:d,httpStreamUrl:f})},[t]),e)return null;if(!t)return o.jsx(df,{children:o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${r}`;return o.jsxs(df,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),o.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[o.jsx(vt,{icon:o.jsx(B9,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(vt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(me,{className:"text-neutral3 pb-4",children:"This MCP server can be accessed through multiple transport methods. Choose the one that best fits your use case."}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(ra,{tooltip:"Copy HTTP Stream URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(ra,{tooltip:"Copy SSE URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(vt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(ra,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(FAn,{server:t})})]})},FAn=({server:e})=>{const{data:t={},isLoading:r}=XSt(e);if(r)return null;const n=Object.keys(t);return o.jsxs("div",{className:"p-5 overflow-y-scroll",children:[o.jsxs("div",{className:"text-neutral6 flex gap-2 items-center",children:[o.jsx(Ce,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(gl,{})}),o.jsx(me,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),o.jsx("div",{className:"flex flex-col gap-2 pt-6",children:n.map(s=>{const a=t[s];return o.jsx(zAn,{tool:a,serverId:e.id},s)})})]})},zAn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=or(),a=F1t[e.toolType||"tool"];return o.jsxs(wf,{onClick:()=>r.current?.click(),children:[o.jsx(Cdt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(kf,{children:[o.jsx(Sf,{children:o.jsx(n,{ref:r,href:s.mcpServerToolLink(t,e.id),children:e.id})}),o.jsx(Of,{children:e.description})]})]})},BAn=()=>{const{serverId:e}=sa(),{data:t=[],isLoading:r}=uM(),n=t.find(s=>s.id===e);return o.jsxs(zr,{children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(gl,{})}),"MCP Servers"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(rSt,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"MCP documentation"]})})]}),o.jsx($An,{isLoading:r,server:n})]})},KSt=(e,t)=>{const{requestContext:r}=_s(),n=We();return Ot({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},UAn=(e,t)=>{const{requestContext:r}=_s(),n=We();return Wr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},VAn=({toolId:e,serverId:t})=>{const{canExecute:r}=Sv(),n=r("tools"),{data:s,isLoading:a,error:i}=KSt(t,e),{mutateAsync:l,isPending:c,data:u}=UAn(t,e);b.useEffect(()=>{if(i){const h=i instanceof Error?i.message:"Failed to load tool";ze.error(`Error loading tool: ${h}`)}},[i]);const d=async h=>{if(s)return await l(h)};if(a)return o.jsxs("div",{className:"p-6",children:[o.jsx(_n,{className:"h-8 w-48 mb-4"}),o.jsx(_n,{className:"h-32 w-full"})]});if(i)return null;if(!s)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!n)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=lg(ag(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Gn({})}return o.jsx(xve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},qAn=()=>{const{data:e}=uM(),{serverId:t,toolId:r}=sa(),{data:n,isLoading:s}=KSt(t,r),a=e?.find(c=>c.id===t),i=n?.name,l=a?.name||"";return s||!n?null:o.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(gl,{})}),"MCP Servers"]}),o.jsx(jr,{as:fr,to:`/mcps/${t}`,children:l}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"MCP documentation"]})})]}),o.jsx(VAn,{toolId:r,serverId:t})]})};function HAn(){const{data:e,isLoading:t,isError:r}=uFr();return o.jsx(eFr,{data:e,isLoading:t,isError:r})}function QAn(){const{data:e,isLoading:t,isError:r}=Sht();return o.jsx(Ame,{label:"Total Agent Runs",value:e?.value!=null?e.value.toLocaleString():null,prevValue:e?.previousValue!=null?e.previousValue.toLocaleString():void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function WAn(){const{data:e,isLoading:t,isError:r}=oFr();return o.jsx(Ame,{label:"Total Model Cost",value:e?.cost!=null?Vw(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Vw(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:r})}function GAn(){const{data:e,isLoading:t,isError:r}=lFr();return o.jsx(Ame,{label:"Total Tokens",value:e?.value!=null?Mm(e.value):null,prevValue:e?.previousValue!=null?Mm(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function ZAn(){const{data:e,isLoading:t,isError:r}=cFr();return o.jsx(tFr,{rows:e,isLoading:t,isError:r})}function YAn(){const{data:e,isLoading:t,isError:r}=fFr();return o.jsx(rFr,{data:e,isLoading:t,isError:r})}function XAn(){const{data:e,isLoading:t,isError:r}=hFr();return o.jsx(sFr,{data:e,isLoading:t,isError:r})}function KAn(){const{data:e,isLoading:t,isError:r}=dFr();return o.jsx(aFr,{data:e,isLoading:t,isError:r})}const JAn=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),are="period";function eIn(){const[e,t]=ao(),r=e.get(are),n=bht(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(are):l.set(are,a),l},{replace:!0})},[t]);return o.jsx(X6r,{initialPreset:n,onPresetChange:s,children:o.jsx(tIn,{})})}function tIn(){const{error:e}=Sht(),{data:t,isLoading:r}=H8(),n=t?.observabilityStorageType,s=n?JAn.has(n):!1,a=n==="ObservabilityInMemory";return e&&Ps(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(aa,{})}):e&&ks(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(Zs,{resource:"metrics"})}):e?o.jsx(Jr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(pu,{title:"Failed to load metrics",message:e.message})}):o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(sk,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(K6r,{}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:o.jsx(Li,{})})]})]})}),r?null:s?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[a&&o.jsx(cn,{variant:"info",title:"Metrics are not persisted",children:o.jsx(cn.Message,{children:"This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB."})}),o.jsxs(pie,{children:[o.jsx(QAn,{}),o.jsx(WAn,{}),o.jsx(GAn,{})]}),o.jsxs(pie,{children:[o.jsx(ZAn,{}),o.jsx(XAn,{}),o.jsx(YAn,{}),o.jsx(KAn,{}),o.jsx(HAn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"Metrics are not available with your current storage",descriptionSlot:"Metrics require ClickHouse, DuckDB, or in-memory storage for observability. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(xa,{})]})})})]})}const rIn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:sk,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:xo,href:"/observability"}];function nIn(){return o.jsxs(mk,{children:[o.jsx(mk.Top,{children:o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{children:[o.jsx(xo,{})," Observability"]})})})}),o.jsx("div",{className:"px-6 pt-6 overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:rIn.map(e=>o.jsxs(fr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}const sIn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:ya,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:Yi,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:Di,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:e1,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:gl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Mi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:nc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:TE,href:"/request-context"}];function aIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(K2t,{})," Primitives"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:sIn.map(e=>o.jsxs(fr,{to:e.href,className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function iIn(){const{paths:e}=or(),{data:t,isLoading:r,error:n}=Q1t(),{isCmsAvailable:s}=cM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ps(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(aa,{})}):n&&ks(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Zs,{resource:"prompt blocks"})}):n?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(pu,{title:"Failed to load prompt blocks",message:n.message})}):l.length===0&&!r?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Vkn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:r,children:[o.jsx(Yi,{})," Prompts"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Prompts documentation",children:o.jsx(Li,{})}),s&&o.jsxs(ce,{as:fr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(ds,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(Ukn,{promptBlocks:l,isLoading:r,search:a})]})}function oIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(TE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(Y1n,{children:o.jsx(O1t,{})})})]})}const lIn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:h2t,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Li,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:xa,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:rA,href:"https://discord.gg/BTYqqHKUrf",external:!0},{title:"Share with your team",description:"Running Mastra Studio locally? Deploy to the cloud so your team can collaborate.",icon:gVe,href:"https://mastra.ai/cloud",external:!0},{title:"Talk to our Sales team",description:"Get a custom demo, discuss on-prem deployments, and how we can help you accelerate getting agents into production.",icon:oMt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function cIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(Li,{})," Resources"]})})}),o.jsx(bt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:lIn.map(e=>o.jsxs("a",{href:e.href,...e.external?{target:"_blank",rel:"noreferrer"}:{},className:"group flex flex-col gap-3 rounded-lg border border-border1 bg-surface2 p-5 transition-colors hover:border-accent1 hover:bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),o.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&o.jsx(xa,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),o.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})]})}function uIn(){const{data:e={},isLoading:t,error:r}=cd(),[n,s]=b.useState(""),[a,i]=b.useState("all");if(r&&Ps(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(aa,{})});if(r&&ks(r))return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(Zs,{resource:"scorers"})});if(r)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(pu,{title:"Failed to load scorers",message:r.message})});if(Object.keys(e).length===0&&!t)return o.jsx(Jr,{title:"Scorers",icon:o.jsx(La,{}),children:o.jsx(cOn,{})});const l=a!=="all"||n!=="",c=()=>{s(""),i("all")};return o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(La,{})," Scorers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})})})]}),o.jsx(dOn,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(lOn,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function dIn(){const{scorerId:e}=sa(),[t,r]=ao(),n=t.get("scoreId")??void 0,[s,a]=b.useState(n),[i,l]=b.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,isLoading:u,error:d}=aOn(e),{data:f={},isLoading:h,error:p}=Eg(),{isLoading:m,error:g}=c0(),{data:y=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=sOn({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=b.useMemo(()=>c?.agentIds?.filter(L=>f[L]).map(L=>({value:L,label:f[L].name,type:"AGENT"}))||[],[c?.agentIds,f]),T=b.useMemo(()=>c?.workflowIds?.map(L=>({value:L,label:L,type:"WORKFLOW"}))||[],[c?.workflowIds]),j=b.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...E,...T],[E,T]),N=t.get("entity")??"all",I=j.find(L=>L.value===N);I&&I.value!==i?.value&&l(I),b.useEffect(()=>{if(d){const L=d instanceof Error?d.message:"Failed to load scorer";ze.error(`Error loading scorer: ${L}`)}},[d]),b.useEffect(()=>{if(p){const L=p instanceof Error?p.message:"Failed to load agents";ze.error(`Error loading agents: ${L}`)}},[p]),b.useEffect(()=>{if(g){const L=g instanceof Error?g.message:"Failed to load workflows";ze.error(`Error loading workflows: ${L}`)}},[g]);const P=L=>{L?.value&&r(Z=>{const V=new URLSearchParams(Z);return V.set("entity",L.value),V})};b.useEffect(()=>{const L=t.get("scoreId")??void 0;if(L===s)return;if(!L){a(void 0);return}y.find(V=>V.id===L)&&a(L)},[t,y]);const R=b.useCallback(L=>{a(L||void 0),r(Z=>{const V=new URLSearchParams(Z);return L?V.set("scoreId",L):V.delete("scoreId"),V})},[r]);if(!c)return null;const B=Ps(d)||Ps(p)||Ps(g),D=d&&ks(d),$=!B&&!D&&(d||p||g),U=!x&&y.length===0,z=i?.value!=="all",H=o.jsxs(o.Fragment,{children:[o.jsxs(Xa,{children:[o.jsx(jr,{as:fr,to:"/scorers",children:"Scorers"}),o.jsx(iOn,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(xn,{children:[o.jsxs(xn.Title,{isLoading:u,children:[o.jsx(La,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(xn.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Scorers documentation",tooltipContent:"Go to Scorers documentation",children:o.jsx(Li,{})}),c?.scorer?.source==="stored"&&o.jsxs(ce,{variant:"default",as:fr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(iv,{})," Edit"]})]})]})]});if(B||D||$||U&&!z){const L=(d instanceof Error?d.message:void 0)??(p instanceof Error?p.message:void 0)??(g instanceof Error?g.message:void 0)??"An unexpected error occurred";return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsx(bt.TopArea,{children:H}),o.jsx(bt.MainArea,{isCentered:!0,children:B?o.jsx(aa,{}):D?o.jsx(Zs,{resource:"scorers"}):$?o.jsx(pu,{title:"Failed to load scorer",message:L}):o.jsx(XSn,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(eOn,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{r(L=>{const Z=new URLSearchParams(L);return Z.set("entity","all"),Z})},isLoading:x||h||m})]}),o.jsx(YSn,{scores:y,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const fIn=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],hIn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=cve(),{theme:n,setTheme:s}=yC();return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{children:[o.jsx(hme,{})," Settings"]})})}),o.jsxs(bt.MainArea,{className:"grid gap-8 mt-6",children:[o.jsx("section",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("h2",{className:"text-icon6 font-medium",children:"Theme"}),o.jsx(kft,{name:"theme",label:"Theme mode",value:n,onValueChange:a=>s(a),options:fIn.map(a=>({...a}))})]})}),o.jsx(E1t,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r}})]})]})};function pIn(){const[e]=ao(),t=uu(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(YSt,{redirectUri:r,onSuccess:n,initialMode:"signup"})}function mIn(e){return e.replace(/\/$/,"").split("/").pop()}function sB({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function gIn({templates:e,linkComponent:t,className:r,isLoading:n}){const s=t||"a";return n?o.jsx("div",{className:Y("grid gap-y-4",r),children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):o.jsx("div",{className:Y("grid gap-y-4",r),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return o.jsxs("article",{className:Y("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[o.jsxs(s,{to:`/templates/${a.slug}`,className:Y("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Y("overflow-hidden"),children:o.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),o.jsxs("div",{className:Y("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[o.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),o.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),o.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&o.jsxs("ul",{className:Y("flex gap-4 text-ui-md text-neutral3 m-0 p-0 list-none","[&>li]:flex [&>li]:items-center [&>li]:gap-0.5 text-neutral4"),children:[a?.agents&&a.agents.length>0&&o.jsxs("li",{children:[o.jsx(ya,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(Mi,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(_Ve,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(hF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(gl,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&o.jsx("small",{children:"|"}),o.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(l=>o.jsx("span",{className:"",children:l},l))})]})]})]}),o.jsx("a",{href:a.githubUrl,className:Y("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:o.jsxs("span",{className:"flex items-center gap-2 px-2 py-1 rounded bg-surface1 group-hover:bg-surface2 text-neutral3 transition-colors group-hover:text-neutral5",children:[o.jsx(vdt,{})," ",mIn(a.githubUrl)]})})]},a.slug)})})}function yIn({tagOptions:e,selectedTag:t,providerOptions:r,selectedProvider:n,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:l,onReset:c,className:u,isLoading:d}){return d?o.jsxs("div",{className:Y("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[o.jsx("div",{})," ",o.jsx("div",{})," ",o.jsx("div",{})]}):o.jsxs("div",{className:Y("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(Ox,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx($o,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx($o,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:n,onValueChange:a,options:r}),c&&o.jsxs(ce,{onClick:c,children:["Reset ",o.jsx(An,{})]})]})}function vIn(){const{data:e,isLoading:t}=Vzr(),{templates:r,tags:n,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=b.useState("all"),[l,c]=b.useState("all"),[u,d]=b.useState(""),f=[{value:"all",label:"Any tag"}];(n||[]).forEach(w=>{f.push({value:w,label:w})});const h=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{h.push({value:w,label:w})});const p=(w,S)=>{S==="tag"?i(w):S==="provider"&&c(w)},m=w=>{d(w)},g=()=>{i("all"),c("all"),d("")},y=r.filter(w=>!(u&&!w.title.toLowerCase().includes(u)&&!w.description.toLowerCase().includes(u)||a!=="all"&&!w.tags.includes(a)||l!=="all"&&!w.supportedProviders.includes(l))),x=u||a!=="all"||l!=="all";return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Qu,{children:[o.jsx(Ce,{children:o.jsx(Fb,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(yIn,{selectedTag:a,onTagChange:w=>p(w,"tag"),tagOptions:f,selectedProvider:l,onProviderChange:w=>p(w,"provider"),providerOptions:h,searchTerm:u,onSearchChange:m,onReset:x?g:void 0,className:"max-w-[80rem]",isLoading:t}),o.jsx(gIn,{templates:y,linkComponent:fr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const bIn="1.31.0";function xIn({errorMsg:e,validationErrors:t}){const r=typeof e=="string"?e:e!=null?String(e):void 0,n=r?.includes("Invalid schema for function"),s=r?.includes("validation issue")||t&&t.length>0,a=()=>s?"Template installation completed but some validation issues remain. The template may still be functional, but you should review and fix these issues.":n?"There was an issue with the AI model configuration. This may be related to the selected model or AI SDK version compatibility.":"An unexpected error occurred during template installation.",i=()=>s?{icon:o.jsx(IE,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(z2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(sB,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l,o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),o.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&o.jsxs("details",{className:"text-xs",children:[o.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto max-h-60 text-left space-y-2",children:t.map((u,d)=>o.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[o.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),o.jsx("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap wrap-break-word",children:u.message})]},d))})]}),r&&!s&&o.jsxs("details",{className:"text-xs",children:[o.jsx("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:"Show Details"}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs font-mono overflow-auto max-h-60 text-left",children:o.jsx("div",{className:"whitespace-pre-wrap wrap-break-word",children:r})})]})]})}function wIn({providerOptions:e,selectedProvider:t,onProviderChange:r,variables:n,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:l,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return o.jsx(sB,{children:o.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[o.jsxs("h2",{className:Y("text-neutral4 text-header-sm font-semibold flex items-center gap-2","[&>svg]:w-[1.2em] [&_svg]:h-[1.2em] [&_svg]:opacity-70"),children:["Install Template ",o.jsx(EVe,{})]}),o.jsx($o,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:r,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(n||{}).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),o.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:l?o.jsxs("div",{className:Y("flex items-center justify-center col-span-2 text-neutral3 text-ui-sm gap-4","[&_svg]:opacity-50 [&_svg]:w-[1.1em] [&_svg]:h-[1.1em]","animate-in fade-in duration-300"),children:[o.jsx(Dt,{})," Loading variables..."]}):Object.entries(n).map(([h,p])=>o.jsxs(b.Fragment,{children:[o.jsx(Sx,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(Sx,{name:h,labelIsHidden:!0,label:"Value",value:p,onChange:i,errorMsg:s.includes(h)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},h))}),o.jsxs("div",{className:"border-t border-border1 pt-12 mt-3.5 relative",children:[o.jsx("div",{className:"absolute w-8 h-8 rounded-full bg-surface2 top-0 left-1/2 -translate-x-1/2 -translate-y-4 text-ui-sm text-neutral3 flex items-center justify-center",children:"And"}),o.jsx("h3",{className:"text-neutral4 text-ui-lg",children:"Set AI Model for Template Installation"}),o.jsx("p",{className:"text-neutral3 text-ui-md mt-2 mb-8",children:"This model will be used by the workflow to process and install the template"}),o.jsx(k1t,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(ce,{className:Y("flex items-center gap-2 mt-4 justify-center text-ui-md w-full bg-surface5 min-h-10 rounded-lg text-neutral5 hover:bg-surface6 transition-colors","[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-neutral5"),onClick:a,disabled:!t||!u||!d||s.length>0||c,children:c?o.jsxs(o.Fragment,{children:[o.jsx(Dt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(Dw,{})]})})]})})}function SIn({title:e,description:t,githubUrl:r,isLoading:n,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Y("grid mt-8 items-center"),children:o.jsxs("div",{className:Y("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":n}),children:[o.jsx(Fb,{}),o.jsx("h2",{className:Y({"bg-surface4 flex rounded-lg min-w-[50%]":n}),children:n?o.jsx(o.Fragment,{children:" "}):e})]})}),o.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[o.jsxs("div",{className:"grid",children:[o.jsx("p",{className:Y("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":n}),children:n?o.jsx(o.Fragment,{children:" "}):t}),!n&&a&&o.jsxs("div",{className:Y("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[o.jsx("div",{className:"shrink-0 mt-0.5",children:o.jsx(zy,{className:"w-[1.1em] h-[1.1em] text-blue-500"})}),o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(cF,{className:"w-[1em] h-[1em] text-neutral4"}),o.jsx("span",{className:"text-ui-md font-medium text-neutral5",children:"A new Git branch will be created"})]}),o.jsxs("div",{className:"text-ui-sm text-neutral4 space-y-1",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Branch name:"})," ",o.jsx("code",{className:"bg-surface3 px-1.5 py-0.5 rounded text-ui-sm font-mono",children:i})]}),o.jsx("div",{children:"This ensures safe installation with easy rollback if needed. Your main branch remains unchanged."})]})]})]}),r&&o.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[o.jsx(vdt,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(OS,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function OIn({name:e,streamResult:t,workflowInfo:r}){const n=t?.phase||"initializing",s=t?.payload?.workflowState,a=t?.payload?.currentStep,i=t?.error,l=s?.steps||{},c=Object.keys(l).length>0,u=m=>m==="input"||m.endsWith(".input")||m.startsWith("Mapping_")&&/[0-9a-f]{8}/.test(m)||/[0-9a-f]{8,}/.test(m)?!1:r?.allSteps?m in r.allSteps:!0,d=Object.entries(l).filter(([m,g])=>u(m)),f=d.length,h=()=>{switch(n){case"initializing":return"Preparing template installation...";case"processing":return`Installing ${e} template`;case"completed":return"Template installation completed!";case"error":return"Template installation failed";default:return"Installing template..."}},p=d.map(([m,g])=>({id:m,status:g?.status,description:g?.description,title:m.charAt(0).toUpperCase()+m.slice(1).replace(/-/g," "),isActive:a?.id===m}));return o.jsxs(sB,{className:"space-y-6 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h3",{className:"text-lg font-semibold text-neutral5",children:h()}),t?.runId&&o.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(n)&&o.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:o.jsx(W3r,{steps:p})}),i&&n==="error"&&o.jsxs("div",{className:Y("rounded-lg text-neutral5 p-6 flex items-center gap-3 text-ui-md bg-red-500/10","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:opacity-70 [&>svg]:text-red-500"),children:[o.jsx(IDt,{}),i||"Something went wrong"]}),c&&o.jsx(Q3r,{steps:p,currentStep:a,className:"pb-4"}),!c&&n==="initializing"&&o.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[o.jsx(Dt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function kIn({name:e,installedEntities:t}){return o.jsxs(sB,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(EVe,{}),o.jsx("h2",{className:"text-header-md",children:"Done!"}),o.jsxs("p",{className:"text-ui-md text-center text-neutral3 ",children:["The ",o.jsx("b",{className:"text-neutral4",children:e})," template has been successfully installed.",t&&t.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("br",{})," Installed entities are listed below."]})]}),t&&t.length>0&&o.jsx(OS,{data:t})]})}function _In(){const{templateSlug:e}=sa(),[t,r]=ao(),[n,s]=b.useState(""),[a,i]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState({}),[f,h]=b.useState([]),[p,m]=b.useState(null),[g,y]=b.useState(!1),[x,w]=b.useState(""),[S,k]=b.useState(!1),[_,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=qzr({repoOrSlug:e,owner:"mastra-ai"}),R=bIn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:D}=Hzr({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:$,isLoading:U}=Qzr(),{mutateAsync:z,isPending:H}=Wzr(),{mutateAsync:Q}=Gzr(),{streamInstall:L,streamResult:Z,isStreaming:V}=Yzr($),{observeInstall:M,streamResult:W,isStreaming:G}=Xzr($);b.useEffect(()=>{const se=t.get("runId");se&&!g&&!p&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:se}),w(se),Q({runId:se}).then(le=>{const xe=le.snapshot;if(xe?.status==="success"&&xe?.result?.success)y(!0);else if(xe?.result?.success===!1)if(xe?.result?.validationResults&&!xe?.result?.validationResults?.valid&&xe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ue,errors:ve}=xe.result.validationResults,we=`Template installation completed but ${ue} validation issue${ue>1?"s":""} remain unresolved.`;m(we),j(ve||[])}else{const ue=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof ue=="string"?ue:String(ue))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,p,V,G,Q]),b.useEffect(()=>{const se=t.get("runId"),le=t.get("resume"),xe=t.get("provider");if(se&&le==="true"&&xe&&!V&&!G&&!S&&!_&&$){w(se),k(!0);try{Q({runId:se}).then(de=>{if(de.snapshot?.status==="running")return M.mutateAsync({runId:se})}).then(()=>{r(de=>{const ue=new URLSearchParams(de);return ue.delete("resume"),ue})}).catch(de=>{console.error("❌ Failed to resume template installation:",de),de.message?.includes("404")||de.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(de){console.error("❌ Auto-resume failed with error:",de),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,G,S,_,$,Q,M,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ae=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(se=>se).join(", "):"n/a",icon:o.jsx(Mi,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(se=>se).join(", "):"n/a",icon:o.jsx(ya,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(se=>se).join(", "):"n/a",icon:o.jsx(hF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Em,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(AE,{})}],te=[{...ae[0]},{...ae[1]},{...ae[2]}].filter(se=>se.value!=="n/a");b.useEffect(()=>{B&&d(B)},[B]),b.useEffect(()=>{const se=Z||W;se?.phase==="error"&&se?.error&&m(typeof se.error=="string"?se.error:String(se.error))},[Z?.phase,Z?.error,W?.phase,W?.error]);const re=se=>{s(se)},ie=async se=>(i(se.provider),c(se.modelId),{message:"Model updated successfully"}),he=async()=>{const se=Object.entries(u).reduce((le,[xe,de])=>(de===""&&le.push(xe),le),[]);if(se.length>0){h(se);return}if(N){m(null),y(!1),w(""),E(!0);try{const xe={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:R,slug:N.slug,variables:u},{runId:de}=await z({});w(de),r(ue=>{const ve=new URLSearchParams(ue);return ve.set("runId",de),ve.set("resume","true"),ve.set("provider",n||"openai"),ve}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:de})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},X=se=>{const{name:le,value:xe}=se.target;xe.trim()===""?h(de=>[...de,le]):h(de=>de.filter(ue=>ue!==le)),d(de=>({...de,[le]:xe}))};return o.jsxs(zr,{children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/templates",children:[o.jsx(Ce,{children:o.jsx(Fb,{})}),"Templates"]}),o.jsx(jr,{as:fr,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:o.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[o.jsx(SIn,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ae,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(V||G)&&o.jsx(OIn,{name:N.title,streamResult:G?W:Z,runId:x,workflowInfo:$}),g&&o.jsx(kIn,{name:N.title,installedEntities:te,linkComponent:fr}),p&&o.jsx(xIn,{errorMsg:p,validationErrors:T.length>0?T:Z?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!p&&o.jsx(wIn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:he,handleVariableChange:X,isLoadingEnvVars:D||U,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const EIn=()=>{const{toolId:e,agentId:t}=sa();return o.jsxs(zr,{children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ya,{})}),"Agents"]}),o.jsx(jr,{as:fr,to:`/agents/${t}/chat`,children:t}),o.jsx(jr,{as:fr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(o0,{})}),"Tools documentation"]})})]}),o.jsx($On,{toolId:e,agentId:t})]})},CIn=()=>{const{toolId:e}=sa();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/tools",children:[o.jsx(Ce,{children:o.jsx(Mi,{})}),"Tools"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(LAn,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"Tools documentation"]})})]}),o.jsx(DAn,{toolId:e})]})};function jIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍 Positive (1)":e.value===0||e.value===-1?"👎 Negative":String(e.value):e.feedbackType==="rating"?String(e.value):e.feedbackType==="comment"?String(e.value??e.comment??"-"):String(e.value??"-")}function TIn({feedback:e,isOpen:t,onClose:r,onNext:n,onPrevious:s}){const a=e?.metadata&&Object.keys(e.metadata).length>0?JSON.stringify(e.metadata,null,2):void 0;return o.jsxs(Vt,{dialogTitle:"Feedback Detail",dialogDescription:"View feedback details",isOpen:t,onClose:r,level:3,children:[o.jsxs(Vt.Top,{children:[o.jsxs(Zn,{children:[o.jsx(rA,{})," Feedback"]}),"|",o.jsx(Vt.Nav,{onNext:n,onPrevious:s})]}),o.jsxs(Vt.Content,{children:[o.jsxs(Vt.Header,{children:[o.jsxs(Vt.Heading,{children:[o.jsx(rA,{})," Feedback"]}),e?.traceId&&o.jsxs(Zn,{children:[o.jsx(g_,{})," ",e.traceId]})]}),o.jsxs(kx,{children:[o.jsx(OS,{data:[{label:"Created at",value:e?.timestamp?tr(new Date(e.timestamp),"MMM d, h:mm:ss aaa"):"n/a",key:"timestamp"},{label:"Type",value:e?.feedbackType??"n/a",key:"type"},{label:"Value",value:e?jIn(e):"n/a",key:"value"},...e?.comment?[{label:"Comment",value:e.comment,key:"comment"}]:[],{label:"Source",value:e?.feedbackSource??e?.source??"n/a",key:"source"},...e?.feedbackUserId?[{label:"User",value:e.feedbackUserId,key:"userId"}]:[],...e?.traceId?[{label:"Trace ID",value:e.traceId,key:"traceId"}]:[],...e?.spanId?[{label:"Span ID",value:e.spanId,key:"spanId"}]:[]]}),a&&o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(g_,{}),codeStr:a,simplified:!0})]})]})]})}const UL=[{name:"source",label:"Source",size:"1fr"},{name:"date",label:"Date",size:"0.8fr"},{name:"time",label:"Time",size:"0.8fr"},{name:"value",label:"Value",size:"0.6fr"},{name:"comment",label:"Comment",size:"2fr"}];function NIn(e){return e.feedbackType==="thumbs"?e.value===1?"👍":e.value===0||e.value===-1?"👎":String(e.value):typeof e.value=="number"?String(e.value):"—"}function AIn(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function JSt({feedbackData:e,isLoadingFeedbackData:t,onPageChange:r}){const[n,s]=b.useState(!1),[a,i]=b.useState(),l=e?.feedback??[],c=h=>{i(l[h]),s(!0)};if(t)return o.jsx(wft,{columns:UL});const u=a?l.indexOf(a):-1,d=u>=0&&u<l.length-1?()=>i(l[u+1]):void 0,f=u>0?()=>i(l[u-1]):void 0;return o.jsxs(o.Fragment,{children:[o.jsxs(pa,{children:[o.jsxs(pa.Trim,{children:[o.jsx(pa.Header,{columns:UL}),l.length>0?o.jsx(pa.Entries,{children:l.map((h,p)=>{const m=new Date(h.timestamp),g=xg(m),y={id:`${h.traceId}-${p}`,source:h.feedbackUserId||h.feedbackSource||"unknown",date:g?"Today":tr(m,"MMM dd"),time:tr(m,"h:mm:ss aaa"),value:NIn(h),comment:AIn(h)};return o.jsx(pa.Entry,{columns:UL,onClick:()=>c(p),entry:y,children:UL.map(x=>o.jsx(pa.EntryText,{children:String(y[x.name]??"")},`col-${x.name}`))},y.id)})}):o.jsx(pa.Message,{message:"No feedback found",type:"info"})]}),o.jsx(pa.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>{const h=e?.pagination?.page||0;h>0&&r?.(h-1)}})]}),o.jsx(TIn,{feedback:a,isOpen:n,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const WBe="auto auto auto auto 1fr";function eOt({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(Y9,{columns:WBe}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Ac,{columns:WBe,className:"min-w-0",children:[o.jsxs(Ac.Top,{children:[o.jsx(Ac.TopCell,{children:"ID"}),o.jsx(Ac.TopCell,{children:"Date"}),o.jsx(Ac.TopCell,{children:"Time"}),o.jsx(Ac.TopCell,{children:"Score"}),o.jsx(Ac.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=xg(a);return o.jsxs(Ac.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Ac.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:ef(s?.id)||"n/a"}),o.jsx(Ac.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":tr(a,"MMM dd")}),o.jsx(Ac.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:tr(a,"h:mm:ss aaa")}),o.jsx(Ac.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Ac.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Ac.NoMatch,{message:"No scores found"})]}),o.jsx(Ac.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>r?.((e?.pagination?.page||0)-1)})]})}const tOt=({traceId:e="",page:t})=>{const r=We(),n=t??0;return Ot({queryKey:["trace-feedback",e,n],queryFn:()=>r.listFeedback({filters:{traceId:e},pagination:{page:n,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})};function IIn(){const[e,t]=ao(),[r,n]=b.useState(!1),s=tzr(e,t,{onRemoveAll:()=>n(!1)}),[a,i]=b.useState(),[l,c]=b.useState(0),[u,d]=b.useState(!1),[f,h]=b.useState(null);b.useEffect(()=>c(0),[s.traceIdParam,s.spanIdParam]);const{data:p,isLoading:m}=cd(),{data:g,isLoading:y}=vve({traceId:s.traceIdParam,spanId:s.spanIdParam,page:l}),[x,w]=b.useState(0);b.useEffect(()=>w(0),[s.traceIdParam,s.spanIdParam]);const{data:S,isLoading:k}=tOt({traceId:s.traceIdParam,page:x}),{data:_,isLoading:E}=Mme(s.traceIdParam??null),T=b.useMemo(()=>_?.spans,[_?.spans]),{data:j,isLoading:N}=D1(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ue=>ue.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=Nht(),{data:B=[],isPending:D}=Aht({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:$=[],isPending:U}=Iht(),{data:z=[],isPending:H}=Rht(),Q=b.useMemo(()=>WFr({availableTags:P,availableRootEntityNames:B,availableServiceNames:z,availableEnvironments:$,loading:{tags:R,entityNames:D,serviceNames:H,environments:U}}),[P,B,z,$,R,D,H,U]),L=b.useMemo(()=>XFr({rootEntityType:s.selectedEntityOption?.entityType,status:s.selectedStatus,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,tokens:s.filterTokens}),[s.filterTokens,s.selectedDateFrom,s.selectedDateTo,s.selectedEntityOption,s.selectedStatus]),{data:Z,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,error:J}=zFr({filters:L}),ae=b.useMemo(()=>Z?.spans??[],[Z?.spans]),te=Z?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=Pht(T,s.spanIdParam??null,ue=>s.handleSpanChange(ue)),he=szr(e,t),X=b.useCallback(()=>s.applyFilterTokens(KFr(Q,s.filterTokens)),[Q,s]),{handlePreviousTrace:se,handleNextTrace:le}=JFr(ae,s.traceIdParam,s.handleTraceClick),xe=b.useCallback(()=>{const ue=T?.find(ve=>ve.parentSpanId==null);ue&&(s.handleSpanChange(ue.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(Jr,{title:"Traces",icon:o.jsx(xo,{}),children:o.jsx(Tht,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const de=!!s.selectedEntityOption||!!s.selectedStatus||s.filterTokens.length>0||s.datePreset!=="last-24h"||!!s.selectedDateTo;return o.jsxs(bt,{width:"wide",height:"full",children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:V,children:[o.jsx(xo,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(cht,{preset:s.datePreset,onPresetChange:s.handleDatePresetChange,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,onDateChange:s.handleDateChange,disabled:V,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(fft,{fields:Q,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Ln,{disabled:V,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ue=>!ue),children:r?o.jsx(m3,{}):o.jsx(wVe,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})})]})]}),o.jsx(OFr,{isLoading:V,filterFields:Q,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:he.handleSave,onRemoveSaved:he.hasSavedFilters?he.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx(AFr,{traceCollapsed:u,listSlot:o.jsx(RFr,{traces:ae,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,filtersApplied:de,featuredTraceId:s.traceIdParam,onTraceClick:ue=>s.handleTraceClick(s.traceIdParam===ue.traceId?"":ue.traceId),groupByThread:r,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(Cht,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ue=>s.handleSpanChange(ue??null),onEvaluateTrace:xe,onSaveAsDatasetItem:ue=>h(ue),initialSpanId:s.spanIdParam,onPrevious:se,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:E8,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(jht,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ue=>s.handleSpanTabChange(ue),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(JSt,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:k}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ue,traceId:ve,spanId:we})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Cve,{traceId:ve,isTopLevelSpan:!ue.parentSpanId,spanId:we,entityType:ue.attributes?.agentId||ue.entityType===Do.AGENT?"Agent":ue.attributes?.workflowId||ue.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:p,isLoadingScorers:m}),o.jsx(eOt,{scoresData:g,onPageChange:c,isLoadingScoresData:y,onScoreSelect:Ne=>s.handleScoreChange(Ne.id)})]})}):null,scorePanelSlot:I?o.jsx(gve,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(jve,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>h(null)})]})}function RIn(){const{traceId:e}=sa(),[t,r]=ao(),n=uu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",l=t.get("scoreId")||void 0,[c,u]=b.useState(s??null),[d,f]=b.useState(),[h,p]=b.useState(i),[m,g]=b.useState(0),[y,x]=b.useState(!1),{data:w,isLoading:S,error:k}=Mme(e),_=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>_.find(re=>re.parentSpanId==null),[_]),{data:T,isLoading:j}=D1(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=cd(),{data:P,isLoading:R}=vve({traceId:e,spanId:c??void 0,page:m}),[B,D]=b.useState(0);b.useEffect(()=>D(0),[e,c]);const{data:$,isLoading:U}=tOt({traceId:e,page:B});b.useEffect(()=>{if(l&&P?.scores&&!d){const re=P.scores.find(ie=>ie.id===l);re&&f(re)}},[l,P?.scores,d]);const z=b.useCallback(re=>{const ie=new URLSearchParams(t);for(const[he,X]of Object.entries(re))X===null||X===""?ie.delete(he):ie.set(he,X);r(ie,{replace:!0})},[t,r]),H=b.useCallback(re=>{const ie=re??null,he=ie===c;u(ie),he||(f(void 0),p("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),Q=b.useCallback(()=>{u(null),f(void 0),p("details"),z({spanId:null,tab:null,scoreId:null})},[z]),L=b.useCallback(re=>{u(re),f(void 0),p("details"),z({spanId:re,tab:null,scoreId:null})},[z]),{handlePreviousSpan:Z,handleNextSpan:V}=Pht(_,c,L),M=b.useCallback(re=>{const ie=re;p(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=b.useCallback(re=>{f(re),z({scoreId:re.id})},[z]),G=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),J=b.useCallback(()=>{n("/observability")},[n]),ae=b.useCallback(()=>{p("scoring"),E&&c!==E.spanId?(u(E.spanId),f(void 0),z({spanId:E.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[E,c,z]),te=o.jsxs(o.Fragment,{children:[o.jsxs(ce,{as:E8,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(wp,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:S,children:[o.jsx(xo,{})," Trace ",o.jsx("span",{className:"text-neutral3",children:e})]})})}),o.jsx(bt.Column,{children:o.jsxs(ps,{children:[o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Traces documentation",tooltipContent:"Go to Traces documentation",children:o.jsx(Li,{})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs(Ln,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(p3,{}),"Evaluate"]}),o.jsxs(Ln,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(yc,{}),"Save"]})]})]})})]}),E&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(kht,{rootSpan:E,numOfCol:3})})})]});return k?o.jsxs(bt,{height:"full",children:[o.jsx(bt.TopArea,{children:te}),o.jsx(bt.MainArea,{isCentered:!0,children:o.jsx(Tht,{error:k,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:te}),o.jsx(jve,{rootSpanId:E?.spanId,traceId:e,isOpen:y,onClose:()=>x(!1)}),o.jsxs("div",{className:Y("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[o.jsx(Cht,{traceId:e,spans:_,isLoading:S,onClose:J,onSpanSelect:H,onEvaluateTrace:ae,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Y("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(jht,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:Q,onPrevious:Z,onNext:V,activeTab:h,onTabChange:M,feedbackTabBadge:$?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(JSt,{feedbackData:$,onPageChange:D,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:he})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Cve,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:he,entityType:re.attributes?.agentId||re.entityType===Do.AGENT?"Agent":re.attributes?.workflowId||re.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),o.jsx(eOt,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(gve,{score:d,onClose:G})]})]})]})}function PIn(){const{data:e,isLoading:t,error:r}=c0(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(aa,{})}):r&&ks(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(Zs,{resource:"workflows"})}):r?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(pu,{title:"Failed to load workflows",message:r.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(cpn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(Di,{})," Workflows"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(lpn,{workflows:e||{},isLoading:t,search:n})]})}const GBe=()=>{const{workflowId:e}=sa(),{data:t,isLoading:r,error:n}=zP(e);return n&&Ps(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})}):n&&ks(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workflows"})}):o.jsx(Pwt,{workflowId:e,workflow:t??void 0,isLoading:r})};function MIn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(xdt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(bdt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(wdt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(yU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Fre,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(Na,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(nc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Fre,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(yU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(yU,{className:"h-4 w-4 text-neutral4"})}}function rOt(e,t=!1){const{name:r,type:n,mount:s}=e;if(n==="directory")return s?MIn(s):t?o.jsx(jE,{className:"h-4 w-4 text-amber-400"}):o.jsx(nc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(lx,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(ER,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return o.jsx(Yi,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return o.jsx(ice,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(sce,{className:"h-4 w-4 text-neutral4"})}}function nOt(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+nOt(-e);if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(t)),r.length-1);return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+r[n]}function DIn(e){if("body"in e&&e.body&&typeof e.body=="object"){const n=e.body;if(typeof n.error=="string")return n.error;if(typeof n.message=="string")return n.message}const t=e.message,r=t.lastIndexOf(" - {");if(r!==-1)try{const n=t.slice(r+3),s=JSON.parse(n);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function sOt(e){return e==="."||e===""}function LIn({path:e,onNavigate:t}){const n=sOt(e)?[]:e.split("/").filter(Boolean);return o.jsxs("div",{className:"flex items-center gap-1 text-sm overflow-x-auto",children:[o.jsx("button",{onClick:()=>t("."),className:"p-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors","aria-label":"Workspace root",children:o.jsx(jE,{className:"h-4 w-4"})}),n.map((s,a)=>{const i=n.slice(0,a+1).join("/");return o.jsxs("div",{className:"flex items-center",children:[o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("button",{onClick:()=>t(i),className:"px-2 py-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors truncate max-w-[150px]",title:s,children:s})]},i)})]})}function $In({entries:e,currentPath:t,isLoading:r,error:n,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:l,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[h,p]=b.useState(null),m=[...e].sort((w,S)=>w.type==="directory"&&S.type!=="directory"?-1:w.type!=="directory"&&S.type==="directory"?1:w.name.localeCompare(S.name)),g=sOt(t),y=w=>{const S=g?w.name:`${t}/${w.name}`;w.type==="directory"?s(S):a?.(S)},x=w=>{const S=g?w.name:`${t}/${w.name}`;p(S)};return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsx(LIn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(ce,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(CR,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(ce,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const w=prompt("Directory name:");if(w){const S=g?w:`${t}/${w}`;c(S)}},children:d?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(lF,{className:"h-4 w-4"})}),l&&o.jsx(ce,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(fF,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"max-h-[400px] overflow-auto",children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):n?o.jsxs("div",{className:"py-12 px-4 text-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-500/10 mb-4",children:o.jsx(tA,{className:"h-6 w-6 text-red-400"})}),o.jsx("p",{className:"text-sm text-neutral6 font-medium mb-1",children:"Failed to load directory"}),o.jsx("p",{className:"text-xs text-neutral4 max-w-sm mx-auto",children:DIn(n)})]}):m.length===0?o.jsx("div",{className:"py-12 text-center text-neutral4 text-sm",children:g?"Workspace is empty":"Directory is empty"}):o.jsx(ad,{children:o.jsxs("ul",{children:[!g&&o.jsx("li",{children:o.jsxs("button",{onClick:()=>{const w=t.split("/").slice(0,-1).join("/")||".";s(w)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-surface4 transition-colors text-left",children:[o.jsx(jE,{className:"h-4 w-4 text-amber-400"}),o.jsx("span",{className:"text-sm text-neutral5",children:".."})]})}),m.map(w=>{const S=w.mount?.displayName||w.mount?.provider,k=w.mount?.status==="error";return o.jsx("li",{className:"group",children:o.jsxs("div",{className:"flex items-center hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:()=>y(w),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[rOt(w),o.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:w.name}),w.mount&&k&&o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(tA,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Gr,{className:"max-w-xs",children:[o.jsx("span",{className:"text-red-400",children:"Error:"})," ",w.mount.error||"Failed to connect to this filesystem"]})]}),w.mount&&S&&(w.mount.description?o.jsxs(Xr,{children:[o.jsx(Kr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})}),o.jsx(Gr,{children:w.mount.description})]}):o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${k?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})),w.type==="file"&&w.size!==void 0&&o.jsx("span",{className:"text-xs text-neutral3 tabular-nums",children:nOt(w.size)})]}),u&&!w.mount&&o.jsx("button",{onClick:()=>x(w),"aria-label":`Delete ${w.name}`,className:"p-2 opacity-0 group-hover:opacity-100 hover:text-red-400 text-neutral3 transition-all",children:o.jsx(ed,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx($t,{open:!!h,onOpenChange:w=>!f&&!w&&p(null),children:o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Delete Item"}),o.jsxs($t.Description,{children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{disabled:f,children:"Cancel"}),o.jsxs($t.Action,{disabled:f,onClick:async()=>{try{h&&u&&await u(h)}finally{p(null)}},children:[f?o.jsx(Aa,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function FIn(e){return e&&{js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",mdx:"mdx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",css:"css",scss:"scss",less:"less",html:"html",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile",vue:"vue",svelte:"svelte"}[e.toLowerCase()]||null}function zIn({content:e,language:t}){return o.jsx(nve,{language:t,style:sve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function BIn({path:e,content:t,isLoading:r,mimeType:n,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),l=n?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=FIn(i);return o.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[rOt({name:a,type:"file"}),o.jsx("span",{className:"text-sm font-medium text-neutral6",children:a})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ra,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(ce,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),o.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:r?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):l?o.jsx("div",{className:"p-4 flex items-center justify-center",children:o.jsx("img",{src:`data:${n||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?o.jsx(zIn,{content:t,language:c}):o.jsx("pre",{className:"p-4 text-sm text-neutral5 whitespace-pre-wrap font-mono overflow-x-auto",children:t})})]})}const UIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Workspaces yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Add a workspace to your Mastra configuration to ",o.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(xa,{})]})})}),VIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(YMt,{}),titleSlot:"Workspace Not Configured",descriptionSlot:o.jsxs(o.Fragment,{children:["No workspace is configured. Add a workspace to your ",o.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(xa,{})]})})}),qIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(tA,{}),titleSlot:"Workspace Not Supported",descriptionSlot:o.jsxs(o.Fragment,{children:["The workspace feature requires a newer version of ",o.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",o.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(xa,{})]})})}),ire={bm25:{label:"Keyword",icon:o.jsx(Yi,{className:"h-3.5 w-3.5"}),color:"bg-blue-500/10 text-blue-400 border-blue-500/30"},vector:{label:"Semantic",icon:o.jsx(y_,{className:"h-3.5 w-3.5"}),color:"bg-purple-500/10 text-purple-400 border-purple-500/30"},hybrid:{label:"Hybrid",icon:o.jsx(PLt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function aOt(e){return e.id.replace(/#chunk-\d+$/,"")}function HIn({onSearch:e,isSearching:t,searchResults:r,canBM25:n,canVector:s,onViewResult:a}){const[i,l]=b.useState(""),[c,u]=b.useState(5),d=()=>n&&s?"hybrid":n?"bm25":s?"vector":"bm25",[f,h]=b.useState(d()),p=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...n?["bm25"]:[],...s?["vector"]:[],...n&&s?["hybrid"]:[]];return o.jsxs("div",{className:"rounded-lg bg-surface4",children:[o.jsxs("form",{onSubmit:p,className:"p-4",children:[o.jsxs("div",{className:"flex gap-3 items-center",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(NE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(ar,{value:i,onChange:g=>l(g.target.value),placeholder:"Search workspace files...",className:"pl-9 h-10 bg-surface2 border-border1"})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-xs text-neutral4",children:"Top"}),o.jsx(ar,{type:"number",min:1,max:50,value:c,onChange:g=>u(parseInt(g.target.value)||5),className:"w-14 h-10 text-center bg-surface2 border-border1",title:"Number of results"})]}),o.jsx(ce,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):"Search"})]}),m.length>0&&o.jsx("div",{className:"flex gap-2 mt-3",children:m.map(g=>{const y=ire[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>h(g),className:`
551
551
  inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-xs font-medium border transition-colors
552
552
  ${x?y.color:"bg-surface2 text-neutral4 border-transparent hover:bg-surface3"}
553
553
  `,children:[y.icon,y.label]},g)})})]}),r&&o.jsxs("div",{className:"border-t border-border1",children:[o.jsxs("div",{className:"px-4 py-2 flex items-center justify-between text-xs",children:[o.jsxs("span",{className:"text-neutral4",children:[r.results.length," result",r.results.length!==1?"s":"",' for "',o.jsx("span",{className:"text-neutral6",children:r.query}),'"']}),o.jsx("span",{className:`px-1.5 py-0.5 rounded ${ire[r.mode].color}`,children:ire[r.mode].label})]}),r.results.length===0?o.jsx("div",{className:"px-4 py-8 text-center text-neutral4 text-sm",children:"No results found. Try a different query."}):o.jsx("ul",{className:"max-h-[320px] overflow-auto",children:r.results.map((g,y)=>o.jsx(QIn,{result:g,rank:y+1,onClick:()=>a?.(aOt(g))},`${g.id}-${y}`))})]})]})}function QIn({result:e,rank:t,onClick:r}){const n=Math.min(100,Math.max(0,e.score*100)),s=aOt(e);return o.jsx("li",{className:"border-t border-border1 first:border-t-0",children:o.jsxs("button",{onClick:r,className:"w-full px-4 py-3 text-left hover:bg-surface5 transition-colors flex gap-3",children:[o.jsx("span",{className:"text-xs text-neutral3 tabular-nums w-4 shrink-0",children:t}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(jE,{className:"h-3.5 w-3.5 text-neutral4 shrink-0"}),o.jsx("span",{className:"font-mono text-sm text-neutral6 truncate",children:s}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o.jsx("div",{className:"w-12 h-1 rounded-full bg-surface2 overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full bg-accent1",style:{width:`${n}%`}})}),o.jsx("span",{className:"text-ui-xs text-neutral3 tabular-nums",children:e.score.toFixed(2)})]})]}),o.jsx("p",{className:"text-xs text-neutral4 line-clamp-2",children:e.content}),e.lineRange&&o.jsxs("p",{className:"text-xs text-neutral3 mt-1",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function WIn({onSearch:e,results:t,isSearching:r,onResultClick:n}){const[s,a]=b.useState(""),[i,l]=b.useState(5),[c,u]=b.useState(!0),d=f=>{f.preventDefault(),s.trim()&&e({query:s.trim(),topK:i,includeReferences:c})};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("form",{onSubmit:d,className:"space-y-3",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(NE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx("input",{type:"text",value:s,onChange:f=>a(f.target.value),placeholder:"Search across skills...",className:"w-full pl-10 pr-4 py-2 rounded-lg bg-surface3 border border-border1 text-sm text-neutral6 placeholder:text-neutral3 focus:outline-hidden focus:ring-2 focus:ring-accent1"})]}),o.jsx(ce,{type:"submit",disabled:!s.trim()||r,children:r?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):"Search"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[o.jsxs("label",{className:"flex items-center gap-2 text-neutral4",children:[o.jsx("span",{children:"Results:"}),o.jsxs("select",{value:i,onChange:f=>l(Number(f.target.value)),className:"px-2 py-1 rounded bg-surface3 border border-border1 text-neutral5",children:[o.jsx("option",{value:3,children:"3"}),o.jsx("option",{value:5,children:"5"}),o.jsx("option",{value:10,children:"10"}),o.jsx("option",{value:20,children:"20"})]})]}),o.jsxs("label",{className:"flex items-center gap-2 text-neutral4 cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:c,onChange:f=>u(f.target.checked),className:"rounded border-border1 bg-surface3"}),o.jsx("span",{children:"Include references"})]})]})]}),t.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5",children:["Found ",t.length," result",t.length!==1?"s":""]}),o.jsx("div",{className:"space-y-2",children:t.map((f,h)=>o.jsx(GIn,{result:f,onClick:()=>n?.(f)},`${f.skillName}-${f.source}-${h}`))})]})]})}function GIn({result:e,onClick:t}){const r=e.source!=="SKILL.md";return o.jsx("button",{onClick:t,className:"w-full p-4 rounded-lg bg-surface3 border border-border1 hover:border-accent1/50 text-left transition-colors",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5 shrink-0 mt-0.5",children:r?o.jsx(Yi,{className:"h-3.5 w-3.5 text-neutral4"}):o.jsx(gC,{className:"h-3.5 w-3.5 text-neutral4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"font-medium text-neutral6",children:e.skillName}),o.jsx("span",{className:"text-xs text-neutral3",children:e.source}),o.jsxs("span",{className:"ml-auto text-xs text-neutral3",children:["Score: ",e.score.toFixed(3)]})]}),o.jsxs("p",{className:"text-sm text-neutral4 line-clamp-3 whitespace-pre-wrap",children:[e.content.slice(0,300),e.content.length>300&&"..."]}),e.lineRange&&o.jsxs("p",{className:"text-xs text-neutral3 mt-2",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function ZIn({skillName:e,onUpdate:t,isUpdating:r}){return o.jsx(ce,{variant:"default",size:"icon-sm",disabled:r,tooltip:`Update ${e}`,onClick:t,children:r?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(Nk,{className:"h-4 w-4"})})}function YIn({skillName:e,onRemove:t,isRemoving:r}){return o.jsxs($t,{children:[o.jsx($t.Trigger,{asChild:!0,children:o.jsx(ce,{variant:"default",size:"icon-sm",disabled:r,tooltip:`Remove ${e}`,children:r?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(ed,{className:"h-4 w-4"})})}),o.jsxs($t.Content,{children:[o.jsxs($t.Header,{children:[o.jsx($t.Title,{children:"Remove Skill"}),o.jsxs($t.Description,{children:['Are you sure you want to remove the skill "',e,'"? This action cannot be undone.']})]}),o.jsxs($t.Footer,{children:[o.jsx($t.Cancel,{children:"Cancel"}),o.jsx($t.Action,{onClick:t,children:"Remove"})]})]})]})}const XIn=".agents/skills/",Mve=[{name:"name",label:"Skill",size:"1fr"},{name:"description",label:"Description",size:"2fr"}],iOt=[...Mve,{name:"actions",label:"",size:"48px"}];function KIn(e,t){if(!e||!t||t.length===0)return null;for(const r of t)if(e.startsWith(r+"/")||e===r)return r;return null}function JIn({skills:e,isLoading:t,isSkillsConfigured:r=!0,hasUndiscoveredAgentSkills:n=!1,basePath:s="/workspace/skills",onAddSkill:a,onUpdateSkill:i,onRemoveSkill:l,updatingSkillName:c,removingSkillName:u,mountPaths:d}){const{navigate:f}=or(),h=d&&d.length>0,p=w=>w.path?.includes(XIn)??!1,m=e.some(p),g=!!l||!!i,y=g&&m,x=y?iOt:Mve;return!r&&!t?o.jsx(tRn,{onAddSkill:a}):t?o.jsx(eRn,{hasRowActions:g}):o.jsxs("div",{className:"space-y-4",children:[a&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(ce,{variant:"default",size:"sm",onClick:a,children:[o.jsx(Ce,{children:o.jsx(ds,{className:"h-4 w-4"})}),"Add Skill"]})}),n&&o.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[o.jsx(IE,{className:"h-5 w-5 text-amber-500 shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"font-medium text-amber-500",children:"Skills installed but not discovered"}),o.jsxs("p",{className:"text-neutral4 mt-1",children:["You have skills in ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4 text-xs",children:".agents/skills"})," that aren't being discovered. Add this path to your workspace skills configuration to see them."]})]})]}),o.jsx(pa,{children:o.jsxs(pa.Trim,{children:[o.jsx(pa.Header,{columns:x}),e.length>0?o.jsx(pa.Entries,{children:e.map(w=>{const S={id:w.path,name:w.name,description:w.description||"—"},k=h?KIn(w.path,d):null;return o.jsxs(pa.Entry,{entry:S,columns:x,onClick:()=>{const _=`${s}/${encodeURIComponent(w.name)}?path=${encodeURIComponent(w.path)}`;f(_)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5",children:o.jsx(gC,{className:"h-3.5 w-3.5 text-neutral4"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"font-medium text-neutral6",children:w.name}),w.path&&o.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[k&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral3 shrink-0",children:k}),o.jsx("span",{className:"text-[11px] text-neutral3 truncate",title:w.path,children:w.path})]})]})]}),o.jsx(pa.EntryText,{children:w.description||"—"}),y&&o.jsx("div",{className:"flex justify-end gap-1",onClick:_=>_.stopPropagation(),children:p(w)&&o.jsxs(o.Fragment,{children:[i&&o.jsx(ZIn,{skillName:w.name,onUpdate:()=>i(w.name),isUpdating:c===w.name}),l&&o.jsx(YIn,{skillName:w.name,onRemove:()=>l(w.name),isRemoving:u===w.name})]})})]},w.path)})}):o.jsx(pa.Message,{message:a?'No skills discovered. Click "Add Skill" to install from skills.sh.':"No skills discovered. Add SKILL.md files to your skills directory."})]})})]})}function eRn({hasRowActions:e}){const t=e?iOt:Mve;return o.jsx(pa,{children:o.jsxs(pa.Trim,{children:[o.jsx(pa.Header,{columns:t}),o.jsx(pa.Entries,{children:Array.from({length:3}).map((r,n)=>o.jsxs(pa.Entry,{columns:t,isLoading:!0,children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-7 w-7 rounded bg-surface4 animate-pulse"}),o.jsxs("div",{children:[o.jsx("div",{className:"h-4 w-32 rounded bg-surface4 animate-pulse"}),o.jsx("div",{className:"h-3 w-40 rounded bg-surface4 animate-pulse mt-1"})]})]}),o.jsx("div",{className:"h-4 w-48 rounded bg-surface4 animate-pulse"}),e&&o.jsx("div",{className:"h-4 w-6 rounded bg-surface4 animate-pulse"})]},n))})]})})}function tRn({onAddSkill:e}){return o.jsx("div",{className:"grid place-items-center py-16",children:o.jsxs("div",{className:"flex flex-col items-center text-center max-w-md",children:[o.jsx("div",{className:"p-4 rounded-full bg-surface4 mb-4",children:o.jsx(gC,{className:"h-8 w-8 text-neutral3"})}),o.jsx("h2",{className:"text-lg font-medium text-neutral6 mb-2",children:"Skills Not Configured"}),o.jsx("p",{className:"text-sm text-neutral4 mb-6",children:"No skills are configured in the workspace. Add SKILL.md files to your skills directory to discover and manage agent skills."}),o.jsxs("div",{className:"flex gap-3",children:[e&&o.jsxs(ce,{size:"lg",variant:"default",onClick:e,children:[o.jsx(Ce,{children:o.jsx(ds,{className:"h-4 w-4"})}),"Add Skill from skills.sh"]}),o.jsxs(ce,{size:"lg",variant:"default",as:"a",href:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(XPt,{className:"h-4 w-4"})}),"Learn about Skills"]})]})]})})}function rRn(e){switch(e.type){case"external":return{icon:o.jsx(Fb,{className:"h-3.5 w-3.5"}),label:"External Package",path:e.packagePath};case"local":return{icon:o.jsx(sDt,{className:"h-3.5 w-3.5"}),label:"Local Project",path:e.projectPath};case"managed":return{icon:o.jsx(XL,{className:"h-3.5 w-3.5"}),label:"Managed",path:e.mastraPath}}}function nRn({skill:e,rawSkillMd:t,onReferenceClick:r}){const[n,s]=b.useState(new Set(["instructions"])),[a,i]=b.useState(!1),l=rRn(e.source),c=u=>{s(d=>{const f=new Set(d);return f.has(u)?f.delete(u):f.add(u),f})};return o.jsxs("div",{className:"space-y-6 min-w-0 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"p-3 rounded-lg bg-surface5",children:o.jsx(gC,{className:"h-6 w-6 text-neutral4"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:e.name}),o.jsx("p",{className:"text-sm text-neutral4 mt-1",children:e.description})]})]}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[o.jsx(CT,{label:"Source",value:l.label,icon:l.icon}),o.jsx(CT,{label:"Path",value:e.path,icon:o.jsx(jE,{className:"h-3.5 w-3.5"})}),e.license&&o.jsx(CT,{label:"License",value:e.license}),e.compatibility!=null&&o.jsx(CT,{label:"Compatibility",value:e.compatibility}),o.jsx(CT,{label:"References",value:`${e.references.length} files`,icon:o.jsx(Yi,{className:"h-3.5 w-3.5"})})]}),o.jsx(VL,{title:"Instructions",isExpanded:n.has("instructions"),onToggle:()=>c("instructions"),headerAction:o.jsxs("button",{onClick:u=>{u.stopPropagation(),i(!a)},className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs text-neutral4 hover:text-neutral5 hover:bg-surface4 transition-colors",title:a?"Show rendered":"Show source",children:[a?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(S2t,{className:"h-3.5 w-3.5"}),a?"Rendered":"Source"]}),children:a?o.jsx("div",{style:{backgroundColor:"black"},className:"rounded-lg overflow-x-auto w-0 min-w-full",children:o.jsx(nve,{language:"markdown",style:sve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},children:t??e.instructions})}):o.jsx(K_,{children:e.instructions})}),e.references.length>0&&o.jsx(VL,{title:`References (${e.references.length})`,isExpanded:n.has("references"),onToggle:()=>c("references"),children:o.jsx("div",{className:"space-y-1",children:e.references.map(u=>o.jsxs("button",{onClick:()=>r?.(u),className:"flex items-center gap-2 w-full px-3 py-2 rounded hover:bg-surface4 text-left transition-colors",children:[o.jsx(Yi,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.scripts.length>0&&o.jsx(VL,{title:`Scripts (${e.scripts.length})`,isExpanded:n.has("scripts"),onToggle:()=>c("scripts"),children:o.jsx("div",{className:"space-y-1",children:e.scripts.map(u=>o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[o.jsx(GMt,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.assets.length>0&&o.jsx(VL,{title:`Assets (${e.assets.length})`,isExpanded:n.has("assets"),onToggle:()=>c("assets"),children:o.jsx("div",{className:"space-y-1",children:e.assets.map(u=>o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[o.jsx(ice,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),o.jsx("div",{className:"pt-4 border-t border-border1",children:o.jsxs("p",{className:"text-xs text-neutral3",children:["Path: ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4",children:e.path})]})})]})}function oOt(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(t=>typeof t=="string"?t:JSON.stringify(t)).join(", ");if(typeof e=="object"&&e!==null){const t=Object.keys(e);if(t.length===0)return"{}";if(t.length===1){const r=t[0],n=e[r];return Array.isArray(n)?`${r}: ${n.join(", ")}`:`${r}: ${oOt(n)}`}return`{${t.join(", ")}}`}return String(e)}function CT({label:e,value:t,icon:r}){const n=oOt(t);return o.jsxs("div",{className:"p-3 rounded-lg bg-surface3",children:[o.jsx("p",{className:"text-xs text-neutral3 mb-1",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[r&&o.jsx("span",{className:"text-neutral4",children:r}),o.jsx("p",{className:"text-sm font-medium text-neutral5 truncate",title:n,children:n})]})]})}function VL({title:e,isExpanded:t,onToggle:r,headerAction:n,children:s}){return o.jsxs("div",{className:"border border-border1 rounded-lg overflow-hidden min-w-0",children:[o.jsxs("div",{className:"flex items-center bg-surface3 hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:r,className:"flex items-center gap-2 flex-1 px-4 py-3",children:[t?o.jsx(as,{className:"h-4 w-4 text-neutral3"}):o.jsx(Vs,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm font-medium text-neutral5",children:e})]}),n&&o.jsx("div",{className:"pr-3",children:n})]}),t&&o.jsx("div",{className:"p-4 bg-surface2 overflow-x-auto w-0 min-w-full",children:s})]})}function sRn({open:e,onOpenChange:t,skillName:r,referencePath:n,content:s,isLoading:a,error:i}){const{isCopied:l,copyToClipboard:c}=L8({copiedDuration:2e3});if(!e)return null;const u=()=>{s&&c(s)};return o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[o.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),o.jsxs("div",{className:"relative w-full max-w-4xl max-h-[85vh] mx-4 bg-surface2 rounded-xl border border-border1 shadow-2xl flex flex-col overflow-hidden",role:"dialog","aria-modal":"true","aria-labelledby":"reference-viewer-title",onKeyDown:d=>{d.key==="Escape"&&t(!1)},children:[o.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border1 bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5",children:o.jsx(Yi,{className:"h-4 w-4 text-neutral4"})}),o.jsxs("div",{children:[o.jsx("h2",{id:"reference-viewer-title",className:"text-base font-medium text-neutral6",children:n}),o.jsxs("p",{className:"text-xs text-neutral3",children:["from ",r]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ce,{size:"md",variant:"default",onClick:u,disabled:!s||a,children:[o.jsx(Ce,{children:l?o.jsx(na,{className:"h-3.5 w-3.5 text-green-400"}):o.jsx(tu,{className:"h-3.5 w-3.5"})}),l?"Copied!":"Copy"]}),o.jsx("button",{onClick:()=>t(!1),"aria-label":"Close reference viewer",className:"p-2 rounded-lg hover:bg-surface4 text-neutral3 hover:text-neutral5 transition-colors",children:o.jsx(An,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"flex-1 overflow-auto p-6",children:a?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx("div",{className:"h-6 w-6 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})}):i?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load reference"}),o.jsx("p",{className:"text-sm text-neutral3",children:i})]}):s?o.jsx("pre",{className:"whitespace-pre-wrap text-sm text-neutral5 font-mono bg-surface3 p-4 rounded-lg overflow-auto",children:s}):o.jsx("div",{className:"flex items-center justify-center py-12 text-neutral3",children:"No content available"})})]})]})}function ZBe(e){return`${e.topSource}/${e.name}`}function YBe(e){const t=pSt(e.topSource,e.name);return t?`${t.owner}/${t.repo}/${e.name}`:null}function aRn({open:e,onOpenChange:t,workspaceId:r,onInstall:n,isInstalling:s,installedSkillIds:a=[],installedSkillNames:i=[],writableMounts:l,installedSkillPaths:c}){const[u,d]=b.useState(""),[f,h]=b.useState(null),[p,m]=b.useState(l&&l.length>0?l[0]?.path:void 0),{data:g,isLoading:y}=oEn(r),x=iEn(r),w=b.useMemo(()=>f?.topSource?pSt(f.topSource,f.name):null,[f]),S=b.useMemo(()=>!w||!f?null:`https://skills.sh/${w.owner}/${w.repo}/${f.name}`,[w,f]),{data:k,isLoading:_}=lEn(r,w?.owner,w?.repo,f?.name,{enabled:!!w&&!!f}),E=dS(D=>{D.trim().length>=2&&x.mutate(D)},300),T=b.useCallback(D=>{d(D),E(D)},[E]),j=b.useMemo(()=>u.trim().length>=2?x.data?.skills??[]:g?.skills??[],[u,x.data,g]),N=x.isPending,I=u.trim().length>=2,P=b.useMemo(()=>{if(!f)return!1;const D=YBe(f);return!!(D&&a.includes(D)||i.includes(f.name))},[f,a,i]),R=b.useCallback(()=>{!f||!w||n({repository:`${w.owner}/${w.repo}`,skillName:f.name,mount:l&&l.length>1?p:void 0})},[f,w,n,l,p]),B=b.useCallback(D=>{D||(d(""),h(null),m(l?.[0]?.path)),t(D)},[t,l]);return o.jsx(On,{open:e,onOpenChange:B,children:o.jsxs(vn,{className:"max-w-4xl h-[80vh] flex flex-col",children:[o.jsxs(kn,{children:[o.jsx(bn,{children:"Add Skill"}),o.jsx(qs,{children:"Search and install skills from the community registry"})]}),o.jsxs(Bn,{className:"flex-1 flex flex-col gap-4 overflow-hidden max-h-none",children:[o.jsxs("div",{className:"relative",children:[o.jsx(NE,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral3"}),o.jsx(ar,{placeholder:"Search skills...",value:u,onChange:D=>T(D.target.value),className:"pl-9"})]}),o.jsxs("div",{className:"flex flex-1 gap-4 min-h-0",children:[o.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[o.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:I?"Search Results":"Popular Skills"}),o.jsx(Ms,{className:"flex-1 border border-border1 rounded-lg",children:y||N?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):j.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-neutral4",children:[o.jsx(Fb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:I?"No skills found":"No skills available"})]}):o.jsx("div",{className:"p-2 space-y-1",children:j.map(D=>{const $=ZBe(D),U=YBe(D),z=U&&a.includes(U)||i.includes(D.name),H=f?ZBe(f):null;return o.jsx("button",{onClick:()=>h(D),className:Y("w-full text-left px-3 py-2 rounded-md transition-colors","hover:bg-surface4",H===$&&"bg-surface5 border border-accent1"),children:o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium text-sm text-neutral6 truncate",children:D.name}),z&&o.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-accent1/20 text-accent1",children:[o.jsx(na,{className:"h-2.5 w-2.5"}),"Installed"]})]}),o.jsx("div",{className:"text-xs text-neutral4 truncate",children:D.topSource})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral3 shrink-0",children:[o.jsx(Nk,{className:"h-3 w-3"}),o.jsx("span",{children:D.installs.toLocaleString()})]})]})},$)})})})]}),o.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[o.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:"Preview"}),o.jsx("div",{className:"flex-1 border border-border1 rounded-lg overflow-hidden flex flex-col",children:f?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-4 border-b border-border1 bg-surface3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-surface5",children:o.jsx(gC,{className:"h-5 w-5 text-neutral4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-semibold text-neutral6 truncate",children:f.name}),o.jsxs("div",{className:"flex items-center gap-3 mt-1 text-xs text-neutral4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(G2t,{className:"h-3 w-3"}),f.topSource]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Nk,{className:"h-3 w-3"}),f.installs.toLocaleString()," installs"]})]})]}),w&&o.jsx("a",{href:`https://github.com/${w.owner}/${w.repo}`,target:"_blank",rel:"noopener noreferrer",className:"text-neutral4 hover:text-neutral5 transition-colors",title:"View on GitHub",children:o.jsx(xa,{className:"h-4 w-4"})})]})}),_?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Aa,{className:"h-6 w-6 animate-spin text-neutral3"})}):k?o.jsx(Ms,{className:"flex-1",children:o.jsx("div",{className:"p-4",children:o.jsx(K_,{children:k})})}):o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-neutral4",children:[o.jsx(Fb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:"Preview unavailable"}),S&&o.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs mt-2 text-accent1 hover:underline flex items-center gap-1",children:["View on skills.sh ",o.jsx(xa,{className:"h-3 w-3"})]})]})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-neutral4",children:[o.jsx(Fb,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:"Select a skill to preview"})]})})]})]}),f&&o.jsxs("div",{className:"flex flex-col gap-3 pt-4 border-t border-border1",children:[l&&l.length>1&&o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-surface3 border border-border1",children:[o.jsx(nc,{className:"h-4 w-4 text-icon4 shrink-0"}),o.jsx("label",{htmlFor:"mount-select",className:"text-sm text-icon5 whitespace-nowrap font-medium",children:"Install to"}),o.jsx("select",{id:"mount-select",value:p??"",onChange:D=>m(D.target.value),className:"flex-1 text-sm px-3 py-1.5 rounded-md border border-border1 bg-surface2 text-icon6",children:l.map(D=>{const $=D.displayName??D.name??D.provider??"unknown";return o.jsxs("option",{value:D.path,children:[$," (",D.path,")"]},D.path)})})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[P&&l&&l.length>1&&f&&c?.[f.name]&&(()=>{const D=c[f.name],$=l.find(U=>D.startsWith(U.path+"/")||D===U.path);return $?o.jsxs("span",{className:"text-xs text-icon4",children:["Installed at ",$.path]}):null})(),o.jsx(ce,{variant:"default",onClick:()=>B(!1),children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:R,disabled:!w||s||P,"data-testid":"install-skill-button",children:s?o.jsxs(o.Fragment,{children:[o.jsx(Aa,{className:"h-4 w-4 mr-2 animate-spin"}),"Installing..."]}):P?o.jsxs(o.Fragment,{children:[o.jsx(na,{className:"h-4 w-4 mr-2"}),"Already Installed"]}):o.jsxs(o.Fragment,{children:[o.jsx(Nk,{className:"h-4 w-4 mr-2"}),"Install"]})})]})]})]})]})})}function XBe(){const{workspaceId:e}=sa(),[t,r]=ao(),n=uu(),[s,a]=b.useState(!1),[i,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState(null),[h,p]=b.useState(null),[m,g]=b.useState(!1),y=t.get("file"),x=t.get("tab"),{data:w,error:S,isLoading:k}=fSt(),_=w?.workspaces??[],E=e??_[0]?.id,{data:T,isLoading:j,error:N}=Y_n(E),I=Ps(S)||Ps(N),P=ks(S)||ks(N),R=t.get("path")||".",B=Ele(S)||Ele(N),D=E?_.find(Re=>Re.id===E):void 0,$=Re=>{const it=new URLSearchParams(t);for(const[rt,ht]of Object.entries(Re))ht===null?it.delete(rt):it.set(rt,ht);r(it)},U=Re=>{g(!1),a(!1),n(`/workspaces/${Re}`)},z=Re=>{$({path:Re==="."||Re===""?null:Re,file:null})},H=Re=>{$({file:Re})},Q=Re=>{$({tab:Re})},L=R,Z=y,{data:V,isLoading:M,error:W,refetch:G}=X_n(L,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:E}),J=J_n(),ae=eEn(),{data:te,isLoading:re}=hSt(Z??"",{enabled:!!Z,workspaceId:E}),{data:ie,isLoading:he,refetch:X}=rEn({workspaceId:E}),se=cEn(),le=uEn(),xe=dEn(),de=T?.isWorkspaceConfigured??!1,ue=T?.capabilities?.hasFilesystem??!1,ve=T?.capabilities?.hasSkills??!1,we=T?.capabilities?.canBM25??!1,Ne=T?.capabilities?.canVector??!1,K=D?.safety?.readOnly??!1,oe=ue&&!K,be=T?.mounts,Ae=be?.filter(Re=>!Re.readOnly).map(Re=>({path:Re.path,displayName:Re.displayName,icon:Re.icon,provider:Re.provider,name:Re.name})),$e=be&&be.length>1?be.map(Re=>Re.path):void 0,ye=b.useCallback(Re=>{E&&se.mutate({...Re,workspaceId:E},{onSuccess:async it=>{if(it.success){u(!1);const{data:rt,error:ht}=await X();if(ht||!rt){ze.success(`Skill "${it.skillName}" installed successfully (${it.filesWritten} files)`);return}rt.skills.some($r=>$r.name===it.skillName)?ze.success(`Skill "${it.skillName}" installed successfully (${it.filesWritten} files)`):(g(!0),ze.warning(`Skill "${it.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else ze.error("Failed to install skill")},onError:it=>{ze.error(`Failed to install skill: ${it instanceof Error?it.message:"Unknown error"}`)}})},[E,se,X]),ke=b.useCallback(Re=>{E&&(p(Re),le.mutate({workspaceId:E,skillName:Re},{onSuccess:it=>{if(p(null),it.updated.length>0){const rt=it.updated[0];rt.success?(ze.success(`Skill "${Re}" updated successfully (${rt.filesWritten} files)`),X()):ze.error(`Failed to update skill: ${rt.error??"Unknown error"}`)}else ze.error("Failed to update skill: No update result returned")},onError:it=>{p(null),ze.error(`Failed to update skill: ${it instanceof Error?it.message:"Unknown error"}`)}}))},[E,le,X]),ge=b.useCallback(Re=>{E&&(f(Re),xe.mutate({workspaceId:E,skillName:Re},{onSuccess:it=>{f(null),it.success?(ze.success(`Skill "${it.skillName}" removed successfully`),X()):ze.error(`Failed to remove skill "${it.skillName}"`)},onError:it=>{f(null),ze.error(`Failed to remove skill: ${it instanceof Error?it.message:"Unknown error"}`)}}))},[E,xe,X]),Fe=x==="files"&&ue?"files":x==="skills"&&ve?"skills":ue?"files":ve?"skills":"files",ct=ie?.skills??[],wt=ie?.isSkillsConfigured??!1,lr=V?.entries??[],Ve=ue&&(we||Ne),qe=ve&&wt&&ct.length>0,Ie=Ve||qe;if(k)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(Dt,{})});if(I)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(aa,{})});if(P)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(Zs,{resource:"workspaces"})});if(B)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(qIn,{})});const Le=S||N;return Le?o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(pu,{title:"Failed to load workspace",message:Le.message})}):!k&&_.length===0?o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(UIn,{})}):!j&&!k&&!de?o.jsx(Jr,{title:"Workspace",icon:o.jsx(nc,{}),children:o.jsx(VIn,{})}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsxs(xn,{children:[o.jsxs(xn.Title,{children:[o.jsx(nc,{})," Workspace"]}),o.jsx(xn.Description,{children:"Manage files, skills, and search your workspace"})]})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[Ie&&o.jsx(Ln,{onClick:()=>a(!s),tooltipContent:"Search workspace","aria-label":"Search workspace",children:o.jsx(NE,{})}),o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workspaces documentation","aria-label":"Workspaces documentation",children:o.jsx(Li,{})})]})]})}),o.jsxs(bt.MainArea,{className:"grid content-start gap-6",children:[_.length>1&&o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>l(!i),className:"flex items-center gap-2 px-3 py-2 text-sm border border-border1 rounded-lg bg-surface2 hover:bg-surface3 transition-colors w-full max-w-md",children:[D?.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1"}):o.jsx(XL,{className:"h-4 w-4 text-neutral4"}),o.jsxs("span",{className:"flex-1 text-left truncate",children:[D?.name??"Select workspace",D?.source==="agent"&&D.agentName&&o.jsxs("span",{className:"text-neutral4 ml-1",children:["(",D.agentName,")"]})]}),o.jsx(as,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&o.jsx("div",{className:"absolute z-50 mt-1 w-full max-w-md bg-surface2 border border-border1 rounded-lg shadow-lg overflow-hidden",children:_.map(Re=>o.jsxs("button",{onClick:()=>{U(Re.id),l(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${D?.id===Re.id?"bg-surface3":""}`,children:[Re.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1 shrink-0"}):o.jsx(XL,{className:"h-4 w-4 text-neutral4 shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:Re.name}),o.jsx("div",{className:"text-xs text-neutral4 truncate",children:Re.source==="agent"?`Agent: ${Re.agentName}`:"Global workspace"})]}),o.jsxs("div",{className:"flex gap-1 shrink-0",children:[Re.safety?.readOnly&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),Re.capabilities.hasFilesystem&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Re.capabilities.hasSandbox&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Re.capabilities.hasSkills&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Re.id))})]}),_.length===1&&D&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[D.source==="agent"?o.jsx(ZL,{className:"h-4 w-4 text-accent1"}):o.jsx(XL,{className:"h-4 w-4"}),o.jsx("span",{children:D.name}),D.source==="agent"&&D.agentName&&o.jsxs("span",{className:"text-neutral3",children:["(",D.agentName,")"]}),K&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&Ie&&E&&o.jsx(iRn,{workspaceId:E,canSearchFiles:Ve,canSearchSkills:qe,canBM25:we,canVector:Ne,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:Re=>{$({file:Re,tab:"files"})},onViewSkillResult:(Re,it)=>{E&&n(`/workspaces/${E}/skills/${encodeURIComponent(Re)}?path=${encodeURIComponent(it)}`)}},E),o.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[ue&&o.jsxs("button",{onClick:()=>Q("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Fe==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[o.jsx(Yi,{className:"h-4 w-4"}),"Files"]}),ve&&o.jsxs("button",{onClick:()=>Q("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Fe==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[o.jsx(y3,{className:"h-4 w-4"}),"Skills",wt&&ct.length>0&&o.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:ct.length})]})]}),o.jsxs("div",{className:"pb-8",children:[Fe==="files"&&ue&&o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[o.jsx($In,{entries:lr,currentPath:L,isLoading:M,error:W,onNavigate:z,onFileSelect:H,onRefresh:()=>G(),onCreateDirectory:K?void 0:Re=>ae.mutate({path:Re,workspaceId:E}),onDelete:K?void 0:Re=>J.mutate({path:Re,recursive:!0,force:!0,workspaceId:E})}),Z&&o.jsx(BIn,{path:Z,content:te?.content??"",isLoading:re,mimeType:te?.mimeType,onClose:()=>H(null)})]})}),Fe==="skills"&&ve&&o.jsx(JIn,{skills:ct,isLoading:he,isSkillsConfigured:wt,hasUndiscoveredAgentSkills:m,basePath:E?`/workspaces/${E}/skills`:"/workspaces",onAddSkill:oe?()=>u(!0):void 0,onUpdateSkill:oe?ke:void 0,onRemoveSkill:oe?ge:void 0,updatingSkillName:h??void 0,removingSkillName:d??void 0,mountPaths:$e}),!ue&&!ve&&!j&&o.jsx("div",{className:"py-12 text-center text-neutral4",children:o.jsx("p",{children:"No workspace capabilities are configured."})})]})]}),E&&oe&&o.jsx(aRn,{open:c,onOpenChange:u,workspaceId:E,onInstall:ye,isInstalling:se.isPending,installedSkillIds:ct.filter(Re=>Re.skillsShSource).map(Re=>`${Re.skillsShSource.owner}/${Re.skillsShSource.repo}/${Re.name}`),installedSkillNames:ct.filter(Re=>!Re.skillsShSource).map(Re=>Re.name),writableMounts:Ae,installedSkillPaths:Object.fromEntries(ct.filter(Re=>Re.path).map(Re=>[Re.name,Re.path]))})]})}function iRn({workspaceId:e,canSearchFiles:t,canSearchSkills:r,canBM25:n,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:l}){const c=tEn(),u=aEn();return o.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[o.jsx(Yi,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&o.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",o.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",o.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),o.jsx(HIn,{onSearch:d=>c.mutate({...d,workspaceId:e}),isSearching:c.isPending,searchResults:c.data?{...c.data,results:c.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:n,canVector:s,onViewResult:i})]}),r&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[o.jsx(y3,{className:"h-4 w-4"}),"Search Skills"]}),o.jsx(WIn,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>l(d.skillName,d.skillPath)})]})]})}function oRn(e,t){return e==null||t==null?null:e in t?e:null}function lRn(){const{skillName:e,workspaceId:t}=sa(),[r]=ao(),n=Xs(),s=e?decodeURIComponent(e):"",a=r.get("path"),i=a?decodeURIComponent(a):void 0,l=r.get("agentId"),c=l?decodeURIComponent(l):null,d=n.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=oRn(c,d),h=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[p,m]=b.useState(null),{data:g,isLoading:y,error:x}=nEn(s,{workspaceId:t,path:i}),{data:w}=hSt(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:S,isLoading:k}=sEn(s,p??"",{enabled:!!p,workspaceId:t,path:i}),_=E=>f?o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:h,children:[o.jsx(Ce,{children:o.jsx(ZL,{className:"h-4 w-4"})}),f]}),o.jsxs(jr,{as:"span",to:"",isCurrent:!0,children:[o.jsx(Ce,{children:o.jsx(y3,{className:"h-4 w-4"})}),E]})]}):o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:h,children:[o.jsx(Ce,{children:o.jsx(nc,{className:"h-4 w-4"})}),"Workspace"]}),o.jsxs(jr,{as:fr,to:h,children:[o.jsx(Ce,{children:o.jsx(y3,{className:"h-4 w-4"})}),"Skills"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:E})]});return y?o.jsxs(zr,{children:[o.jsx(jn,{children:_("Loading...")}),o.jsx("div",{className:"grid place-items-center h-full",children:o.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):x&&Ps(x)?o.jsxs(zr,{children:[o.jsx(jn,{children:_("Session Expired")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})]}):x&&ks(x)?o.jsxs(zr,{children:[o.jsx(jn,{children:_("Permission Denied")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workspaces"})})]}):x||!g?o.jsxs(zr,{children:[o.jsx(jn,{children:_("Error")}),o.jsx("div",{className:"grid place-items-center h-full",children:o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),o.jsx("p",{className:"text-sm text-neutral3",children:x?.message??"Skill not found"})]})})]}):o.jsxs(zr,{children:[o.jsxs(jn,{children:[_(g.name),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(o0,{})}),"Documentation"]})})]}),o.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:o.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:o.jsx(nRn,{skill:g,rawSkillMd:w?.content,onReferenceClick:m})})}),o.jsx(sRn,{open:!!p,onOpenChange:E=>!E&&m(null),skillName:g.name,referencePath:p??"",content:S?.content,isLoading:k})]})}const lOt=()=>{const e=window.MASTRA_CLOUD_API_ENDPOINT;return{isMastraPlatform:!!e,mastraPlatformEndpoint:e}},cRn=[{key:"primitives",title:"Primitives",href:"/primitives",links:[{name:"Agents",url:"/agents",icon:o.jsx(ya,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:o.jsx(Yi,{}),isOnMastraPlatform:!0,indent:!0},{name:"Workflows",url:"/workflows",icon:o.jsx(Di,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:o.jsx(e1,{}),isOnMastraPlatform:!1,indent:!0,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:o.jsx(gl,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:o.jsx(Mi,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"tools:read"},{name:"Workspaces",url:"/workspaces",icon:o.jsx(nc,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:o.jsx(TE,{}),isOnMastraPlatform:!0,indent:!0}]},{key:"evaluation",title:"Evaluation",href:"/evaluation",links:[{name:"Scorers",url:"/scorers",icon:o.jsx(La,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"scorers:read"},{name:"Datasets",url:"/datasets",icon:o.jsx(Na,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]},{name:"Experiments",url:"/experiments",icon:o.jsx(Tu,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]}]},{key:"observability",title:"Observability",href:"/observability-overview",links:[{name:"Metrics",url:"/metrics",icon:o.jsx(sk,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"},{name:"Traces",url:"/observability",activePaths:["/traces"],icon:o.jsx(xo,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"},{name:"Logs",url:"/logs",icon:o.jsx(YL,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"}]},{key:"bottom",separator:!0,links:[{name:"Settings",url:"/settings",icon:o.jsx(hme,{}),isOnMastraPlatform:!1},{name:"Resources",url:"/resources",icon:o.jsx(Li,{}),isOnMastraPlatform:!0}]}];function KBe(e,t){const r=n=>t===n||t.startsWith(n+"/");return r(e.url)?!0:e.activePaths?.some(r)??!1}function uRn(){const{Link:e}=or(),{state:t}=Sme(),n=Oc().pathname,{isMastraPlatform:s}=lOt(),{data:a}=SC(),{isCmsAvailable:i,isLoading:l}=cM(),{hasPermission:c,hasAnyPermission:u,rbacEnabled:d,isAuthenticated:f,isLoading:h}=Sv(),p=a&&HP(a),m=new Set(["/prompts"]),g=y=>m.has(y.url)&&!i&&!l||s&&!y.isOnMastraPlatform?!1:d&&f&&h?!0:!(y.requiredPermission&&!c(y.requiredPermission)||y.requiredAnyPermission&&!u(y.requiredAnyPermission));return o.jsxs(Hh,{children:[o.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:t==="collapsed"?o.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[o.jsx(Yb,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),p&&o.jsx(Ple,{})]}):p?o.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(Yb,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),o.jsx(Ple,{})]}):o.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[o.jsx(Yb,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),o.jsx(Hh.Nav,{children:cRn.map(y=>{const x=y.links.filter(g),w=x.length>0&&y?.separator,S=x.some(_=>KBe(_,n)),k=!!(y.href&&n===y.href&&!S);return o.jsxs(Hh.NavSection,{children:[y?.title?o.jsx(Hh.NavHeader,{LinkComponent:e,state:t,href:y.href,isActive:k,children:y.title}):o.jsx(o.Fragment,{children:w&&o.jsx(Hh.NavSeparator,{})}),o.jsx(Hh.NavList,{children:x.map(_=>{const E=KBe(_,n);return o.jsx(Hh.NavLink,{LinkComponent:e,state:t,link:_,isActive:E},_.name)})})]},y.key)})}),o.jsxs(Hh.Bottom,{children:[t!=="collapsed"&&o.jsxs(o.Fragment,{children:[o.jsx(Hh.NavSeparator,{}),o.jsx(BSn,{collapsed:!1})]}),o.jsx(Hh.NavSeparator,{}),o.jsx("div",{className:"flex justify-end pb-3",children:o.jsx(Hh.Trigger,{})})]})]})}function cOt({children:e,loginUrl:t="/login",signupUrl:r="/signup"}){const{data:n,isLoading:s}=SC();if(s)return o.jsx(o.Fragment,{children:e});if(!n?.enabled)return o.jsx(o.Fragment,{children:e});if(HP(n))return o.jsx(o.Fragment,{children:e});const a=typeof window<"u"?window.location.href:void 0;if(!n.login)return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[o.jsx(Yb,{className:"h-16 w-16 opacity-50"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Authentication Required"}),o.jsx("p",{className:"max-w-sm text-neutral3",children:"This page requires authentication, but no login method is configured. Please contact your administrator."})]})]})});const i=()=>{const l=new URL(r,window.location.origin);a&&l.searchParams.set("redirect",a),window.location.href=l.toString()};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[o.jsx(Yb,{className:"h-16 w-16 opacity-50"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Sign in to continue"}),o.jsx("p",{className:"max-w-sm text-neutral3",children:"You need to sign in to access this page."})]}),n.login.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface2 p-3 text-left",children:[o.jsx(SVe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"max-w-sm text-sm text-neutral3",children:n.login.description})]}),o.jsx($St,{config:n.login,redirectUri:a,loginUrl:t}),(n.login.type==="credentials"||n.login.type==="both")&&n.login.signUpEnabled!==!1&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"text-neutral3",children:"Don't have an account? "}),o.jsx("button",{type:"button",onClick:i,className:"text-neutral6 hover:underline",children:"Sign up"})]})]})})}const uOt="experimental-ui:",dOt="current",dRn=je.createContext(null);function fRn(e,t){const r=window.localStorage.getItem(uOt+e);return r&&t.has(r)?r:dOt}function hRn({experiments:e,children:t}){const r=je.useMemo(()=>new Map(e.map(c=>[c.key,new Set(c.variants.map(u=>u.value))])),[e]),[n,s]=je.useState({});je.useLayoutEffect(()=>{const c={};for(const u of e){const d=r.get(u.key);c[u.key]=fRn(u.key,d)}s(c)},[e,r]);const a=je.useCallback(c=>n[c]??dOt,[n]),i=je.useCallback((c,u)=>{window.localStorage.setItem(uOt+c,u),s(d=>({...d,[c]:u}))},[]),l=je.useMemo(()=>({experiments:e,getVariant:a,setVariant:i}),[e,a,i]);return o.jsx(dRn.Provider,{value:l,children:t})}const pRn=[{key:"entity-list-page",name:"Entity List page UI",path:["/agents","/prompts","/tools","/datasets","/scorers","/mcps","/workflows","/processors"],variants:[{value:"current",label:"Current state"},{value:"new-proposal",label:"New proposal"}]}],mRn=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"}),gRn=()=>{const[e,t]=b.useState(!1),r=b.useCallback(()=>{t(n=>!n)},[]);return b.useEffect(()=>{const n=s=>{s.key==="k"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),r())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[r]),{open:e,setOpen:t,toggle:r}},Dve=()=>{const{requestContext:e}=_s(),t=We();return Ot({queryKey:["processors"],queryFn:()=>t.listProcessors(e)})},fOt=(e,t)=>{const r=We(),{requestContext:n}=_s();return Ot({queryKey:["processor",e],queryFn:()=>r.getProcessor(e).details(n),enabled:!!e})},yRn=()=>{const e=We(),{requestContext:t}=_s();return Wr({mutationFn:async({processorId:r,phase:n,messages:s,agentId:a})=>e.getProcessor(r).execute({phase:n,messages:s,agentId:a,requestContext:t})})},vRn=()=>{const{open:e,setOpen:t}=gRn(),{navigate:r,paths:n}=or(),{isMastraPlatform:s}=lOt(),a=E3r(),{data:i={}}=Eg(),{data:l={}}=c0(),{data:c={}}=J8(),{data:u={}}=Dve(),{data:d=[]}=uM(),{data:f={}}=cd(),h=w=>{r(w),t(!1)},p=Object.entries(i),m=Object.entries(l),g=Object.entries(c),y=Object.values(u).filter(w=>w.phases&&w.phases.length>0),x=Object.entries(f);return o.jsxs(s$r,{open:e,onOpenChange:t,title:"Navigation",description:"Search and navigate to any entity",children:[o.jsx(Bdt,{placeholder:"Search or navigate..."}),o.jsxs(Udt,{children:[o.jsx(Vdt,{children:"No results found."}),o.jsxs(fb,{heading:"Navigation",children:[a&&o.jsxs(Zo,{value:"toggle sidebar collapse expand",onSelect:()=>{a.toggleSidebar(),t(!1)},children:[o.jsx(CVe,{className:"text-neutral3"}),o.jsx("span",{children:"Toggle Sidebar"}),o.jsx(qdt,{children:"Ctrl+B"})]}),o.jsxs(Zo,{value:"all agents",onSelect:()=>h("/agents"),children:[o.jsx(ya,{className:"text-neutral3"}),o.jsx("span",{children:"All Agents"})]}),o.jsxs(Zo,{value:"all workflows",onSelect:()=>h("/workflows"),children:[o.jsx(Di,{className:"text-neutral3"}),o.jsx("span",{children:"All Workflows"})]}),o.jsxs(Zo,{value:"all tools",onSelect:()=>h("/tools"),children:[o.jsx(Mi,{className:"text-neutral3"}),o.jsx("span",{children:"All Tools"})]}),o.jsxs(Zo,{value:"all scorers",onSelect:()=>h("/scorers"),children:[o.jsx(La,{className:"text-neutral3"}),o.jsx("span",{children:"All Scorers"})]}),o.jsxs(Zo,{value:"all processors",onSelect:()=>h("/processors"),children:[o.jsx(e1,{className:"text-neutral3"}),o.jsx("span",{children:"All Processors"})]}),o.jsxs(Zo,{value:"all mcp servers",onSelect:()=>h("/mcps"),children:[o.jsx(gl,{className:"text-neutral3"}),o.jsx("span",{children:"All MCP Servers"})]}),o.jsxs(Zo,{value:"observability traces",onSelect:()=>h("/observability"),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsx("span",{children:"Observability"})]}),!s&&o.jsxs(o.Fragment,{children:[o.jsxs(Zo,{value:"settings",onSelect:()=>h("/settings"),children:[o.jsx(hme,{className:"text-neutral3"}),o.jsx("span",{children:"Settings"})]}),o.jsxs(Zo,{value:"templates",onSelect:()=>h("/templates"),children:[o.jsx(Fb,{className:"text-neutral3"}),o.jsx("span",{children:"Templates"})]})]})]}),p.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Agents",children:p.map(([w,S])=>o.jsxs(je.Fragment,{children:[o.jsxs(Zo,{value:`${S.name} chat agent`,onSelect:()=>h(n.agentLink(w)),children:[o.jsx(ya,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Chat"]})]}),o.jsxs(Zo,{value:`${S.name} traces agent observability`,onSelect:()=>h(`/observability?entity=${w}`),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Traces"]})]})]},w))})]}),m.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Workflows",children:m.map(([w,S])=>o.jsxs(je.Fragment,{children:[o.jsxs(Zo,{value:`${S.name} graph workflow view`,onSelect:()=>h(n.workflowLink(w)),children:[o.jsx(Di,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Graph"]})]}),o.jsxs(Zo,{value:`${S.name} traces workflow observability`,onSelect:()=>h(`/observability?entity=${S.name}`),children:[o.jsx(xo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Traces"]})]})]},w))})]}),g.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Tools",children:g.map(([w,S])=>o.jsxs(Zo,{value:`tool ${S.id}`,onSelect:()=>h(n.toolLink(w)),children:[o.jsx(Mi,{className:"text-neutral3"}),o.jsx("span",{children:S.id})]},w))})]}),x.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Scorers",children:x.map(([w,S])=>{const k=S.scorer?.config?.name||S.scorer?.config?.id||w;return o.jsxs(Zo,{value:`scorer ${k}`,onSelect:()=>h(n.scorerLink(w)),children:[o.jsx(La,{className:"text-neutral3"}),o.jsx("span",{children:k})]},w)})})]}),y.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"Processors",children:y.map(w=>{const S=w.name||w.id,k=w.isWorkflow?n.workflowLink(w.id)+"/graph":n.processorLink(w.id);return o.jsxs(Zo,{value:`processor ${S}`,onSelect:()=>h(k),children:[o.jsx(e1,{className:"text-neutral3"}),o.jsx("span",{children:S})]},w.id)})})]}),d.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(iw,{}),o.jsx(fb,{heading:"MCP Servers",children:d.map(w=>o.jsxs(Zo,{value:`mcp server ${w.name}`,onSelect:()=>h(n.mcpServerLink(w.id)),children:[o.jsx(gl,{className:"text-neutral3"}),o.jsx("span",{children:w.name})]},w.id))})]})]})]})};function bRn({children:e}){const{data:t,isFetched:r}=SC(),{pathname:n}=Oc(),s=r&&t?.enabled&&!HP(t),a=r&&!s;return o.jsxs(o.Fragment,{children:[o.jsx(vRn,{}),o.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&o.jsx(uRn,{}),o.jsx("div",{className:Y("bg-transparent overflow-y-auto",{"h-[calc(100%-1.5rem)]":s}),children:o.jsx(cOt,{children:o.jsx(k4r,{resetKeys:[n],children:e})})})]})]})}const xRn=({children:e})=>{const{experimentalUIEnabled:t}=mRn();return o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(hYe,{position:"bottom-right"}),o.jsx(Edt,{defaultTheme:"dark",children:o.jsx(ad,{delayDuration:0,children:o.jsx(hRn,{experiments:t?pRn:[],children:o.jsx(j3r,{children:o.jsx(bRn,{children:e})})})})})]})},wRn=({children:e})=>o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(hYe,{position:"bottom-right"}),o.jsx(Edt,{defaultTheme:"dark",children:o.jsx(ad,{delayDuration:0,children:o.jsx("div",{className:"h-full overflow-y-auto",children:o.jsx(cOt,{children:e})})})})]});function SRn({agentId:e}){return o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ya,{})}),"Agents"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(IOn,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"Agents documentation"]})})]})}const ORn=({children:e})=>{const{agentId:t}=sa(),r=Oc(),{isCmsAvailable:n}=cM(),{hasObservability:s}=HSn(),a=Dle.has("datasets"),i=n&&a,l=s&&a,{data:c}=Nf(t),u=Jc(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,h=r.pathname.includes("/editor")?"versions":r.pathname.includes("/evaluate")?"evaluate":r.pathname.includes("/review")?"review":r.pathname.includes("/traces")?"traces":"chat",p=(h==="versions"||h==="evaluate"||h==="review")&&(i||l),m=o.jsxs(zr,{className:"grid-rows-[auto_auto_1fr]",children:[o.jsx(SRn,{agentId:t}),o.jsx(HCn,{agentId:t,activeTab:h,showPlayground:i,showObservability:l,rightSlot:p?o.jsx(QCn,{requestContextSchema:f}):void 0}),e]});return o.jsx(FP,{children:o.jsx(V1n,{defaultProvider:u,defaultModel:d,children:o.jsx(ICn,{children:o.jsx(q1n,{children:m})})})})},kRn=({children:e,options:t})=>{const r=new M2r({...t,defaultOptions:{...t?.defaultOptions,queries:{retry:E6r,...t?.defaultOptions?.queries}}});return o.jsx(D2r,{client:r,children:e})},_Rn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(yf,{}),titleSlot:"No Processors yet",descriptionSlot:"Configure processors. Add input or output processors to your agents to transform messages.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:["Processors Documentation ",o.jsx(xa,{})]})})}),ERn=["input","inputStep","outputStep","outputStream","outputResult"];function CRn({processors:e,isLoading:t,search:r=""}){const{paths:n,Link:s}=or(),a=b.useMemo(()=>Object.values(e??{}).filter(l=>l.phases&&l.phases.length>0),[e]),i=b.useMemo(()=>{const l=r.toLowerCase();return a.filter(c=>c.id.toLowerCase().includes(l)||(c.name||"").toLowerCase().includes(l))},[a,r]);return t?o.jsx(yh,{columns:"auto 1fr auto auto auto auto auto auto"}):o.jsxs(Se,{columns:"auto 1fr auto auto auto auto auto auto",children:[o.jsxs(Se.Top,{children:[o.jsx(Se.TopCell,{children:"Name"}),o.jsx(Se.TopCell,{children:"Description"}),o.jsx(Se.TopCellSmart,{long:"Input",short:"Input",tooltip:"Contains Input phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Input Step",short:o.jsxs(o.Fragment,{children:[o.jsx(cx,{})," Step"]}),tooltip:"Contains Input Step phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Step",short:o.jsxs(o.Fragment,{children:[o.jsx(Qd,{})," Step"]}),tooltip:"Contains Output Step phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Stream",short:o.jsxs(o.Fragment,{children:[o.jsx(Qd,{})," Stream"]}),tooltip:"Contains Output Stream phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Result",short:o.jsxs(o.Fragment,{children:[o.jsx(Qd,{})," Result"]}),tooltip:"Contains Output Result phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{short:"Used by",long:"Used by Agents",className:"text-center"})]}),i.length===0&&r?o.jsx(Se.NoMatch,{message:"No Processors match your search"}):null,i.map(l=>{const c=Ch(l.name||l.id,50),u=Ch(l.description??"",200),d=l.agentIds?.length??0,f=new Set(l.phases||[]),h=l.isWorkflow?n.workflowLink(l.id)+"/graph":n.processorLink(l.id);return o.jsxs(Se.RowLink,{to:h,LinkComponent:s,children:[o.jsx(Se.NameCell,{children:c}),o.jsx(Se.DescriptionCell,{children:u}),ERn.map(p=>o.jsx(Se.TextCell,{className:"text-center",children:f.has(p)&&o.jsx(na,{className:"size-4 mx-auto"})},p)),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]},l.id)})]})}function jRn(){const{data:e={},isLoading:t,error:r}=Dve(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Processors",icon:o.jsx(lp,{}),children:o.jsx(aa,{})}):r&&ks(r)?o.jsx(Jr,{title:"Processors",icon:o.jsx(lp,{}),children:o.jsx(Zs,{resource:"processors"})}):r?o.jsx(Jr,{title:"Processors",icon:o.jsx(lp,{}),children:o.jsx(pu,{title:"Failed to load processors",message:r.message})}):Object.keys(e).length===0&&!t?o.jsx(Jr,{title:"Processors",icon:o.jsx(lp,{}),children:o.jsx(_Rn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:t,children:[o.jsx(lp,{})," Processors"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Processors documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),o.jsx(CRn,{processors:e,isLoading:t,search:n})]})}function TRn({value:e,onValueChange:t,placeholder:r="Select a processor...",searchPlaceholder:n="Search processors...",emptyText:s="No processors found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=Dve(),{navigate:h,paths:p}=or();b.useEffect(()=>{if(d){const y=f instanceof Error?f.message:"Failed to load processors";ze.error(`Error loading processors: ${y}`)}},[d,f]);const m=Object.keys(c).filter(y=>{const x=c[y];return x?.phases&&x.phases.length>0}).map(y=>({label:c[y]?.name||y,value:y})),g=y=>{t?t(y):y&&y!==e&&(c[y]?.isWorkflow?h(p.workflowLink(y)+"/graph"):h(p.processorLink(y)))};return o.jsx(Gl,{options:m,value:e,onValueChange:g,placeholder:u?"Loading processors...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||d,variant:l})}const NRn={input:"Input - Process input messages before LLM (once at start)",inputStep:"Input Step - Process at each agentic loop step",outputStream:"Output Stream - Process streaming chunks",outputResult:"Output Result - Process complete output after streaming",outputStep:"Output Step - Process after each LLM response (before tools)"};function ARn({processorId:e}){const{data:t,isLoading:r,error:n}=fOt(e);return b.useEffect(()=>{if(n){const s=n instanceof Error?n.message:"Failed to load processor";ze.error(`Error loading processor: ${s}`)}},[n]),r?o.jsxs("div",{className:"p-6",children:[o.jsx(_n,{className:"h-8 w-48 mb-4"}),o.jsx(_n,{className:"h-32 w-full"})]}):n?null:t?o.jsx(IRn,{processor:t}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Processor not found"})})}function IRn({processor:e}){const t=wv(),r=b.useId(),[n,s]=b.useState(e.phases[0]||"input"),[a,i]=b.useState(e.configurations[0]?.agentId||""),[l,c]=b.useState("Hello, this is a test message."),[u,d]=b.useState(null),[f,h]=b.useState(),p=yRn(),m=async()=>{h(void 0),d(null);const x=n==="outputStep"||n==="outputResult"?"assistant":"user",w=[{id:crypto.randomUUID(),role:x,createdAt:new Date,content:{format:2,parts:[{type:"text",text:l}]}}];try{const S=await p.mutateAsync({processorId:e.id,phase:n,messages:w,agentId:a||void 0});d(S),!S.success&&S.error&&h(S.error)}catch(S){h(S.message||"An error occurred")}},g=u?JSON.stringify(u,null,2):"{}";return o.jsxs(df,{hasLeftServiceColumn:!0,className:"relative",children:[o.jsxs("div",{className:"bg-surface2 border-r border-border1 w-[22rem] overflow-y-auto",children:[o.jsx(RRn,{processor:e}),o.jsxs("div",{className:"p-5 space-y-5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),o.jsxs(pi,{value:n,onValueChange:y=>s(y),children:[o.jsx(ei,{className:"w-full",children:o.jsx(mi,{placeholder:"Select phase"})}),o.jsx(ti,{children:e.phases.map(y=>o.jsx(ss,{value:y,children:y},y))})]}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4",children:NRn[n]})]}),e.configurations.length>1&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Agent Configuration"}),o.jsxs(pi,{value:a,onValueChange:i,children:[o.jsx(ei,{className:"w-full",children:o.jsx(mi,{placeholder:"Select agent"})}),o.jsx(ti,{children:e.configurations.map(y=>o.jsxs(ss,{value:y.agentId,children:[y.agentName," (",y.type,")"]},y.agentId))})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",htmlFor:r,variant:"ui-sm",className:"text-neutral3",children:"Test Message"}),o.jsx("textarea",{id:r,value:l,onChange:y=>c(y.target.value),placeholder:"Enter a test message...",rows:4,className:"w-full bg-transparent border border-border1 rounded-md p-3 text-ui-sm text-neutral6 placeholder:text-neutral3 focus:outline-hidden focus:ring-2 focus:ring-accent1"})]}),o.jsx(ce,{onClick:m,disabled:p.isPending||n==="outputStream",className:"w-full",children:p.isPending?"Running...":"Run Processor"}),n==="outputStream"&&o.jsx(me,{variant:"ui-xs",className:"text-accent6",children:"Output Stream phase cannot be executed directly. Use streaming instead."}),u&&o.jsxs("div",{className:"space-y-2 pt-4 border-t border-border1",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"Status"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(vt,{variant:u.success?"success":"error",children:u.success?"Success":"Failed"}),u.tripwire?.triggered&&o.jsx(vt,{variant:"info",children:"Tripwire Triggered"})]}),u.tripwire?.triggered&&u.tripwire.reason&&o.jsxs("div",{className:"mt-2 p-3 bg-accent6Dark rounded-md border border-accent6/20",children:[o.jsx(me,{variant:"ui-sm",className:"text-accent6 font-medium",children:"Tripwire Reason"}),o.jsx(me,{variant:"ui-sm",className:"text-neutral3 mt-1",children:u.tripwire.reason})]})]})]})]}),o.jsx("div",{className:"absolute top-4 right-4 z-10",children:o.jsx(ra,{content:g,tooltip:"Copy JSON result to clipboard"})}),o.jsx("div",{className:"p-5 h-full relative overflow-x-auto overflow-y-auto",children:o.jsx(vc,{value:f||g,editable:!0,theme:t,extensions:[Gd]})})]})}function RRn({processor:e}){return o.jsxs("div",{className:"px-5 pt-5 pb-4 border-b border-border1",children:[o.jsx(me,{variant:"header-md",className:"text-neutral1 mb-2",children:e.name||e.id}),e.name&&e.name!==e.id&&o.jsx(me,{variant:"ui-sm",className:"text-neutral4 mb-3",children:e.id}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:e.phases.map(t=>o.jsx(vt,{variant:"default",children:t},t))}),o.jsx("div",{className:"mt-3",children:o.jsxs(me,{variant:"ui-xs",className:"text-neutral4",children:["Attached to ",e.configurations.length," agent",e.configurations.length!==1?"s":""]})})]})}function PRn(){const{processorId:e}=sa(),{data:t,isLoading:r,error:n}=fOt(e);return n&&Ps(n)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(lp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:e})]})}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(aa,{})})]}):n&&ks(n)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(lp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:e})]})}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"processors"})})]}):!r&&t?.isWorkflow?o.jsx(mFt,{to:`/workflows/${e}/graph`,replace:!0}):r?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(jn,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(lp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(_n,{className:"h-6 w-32"})})]})}),o.jsxs("div",{className:"p-6",children:[o.jsx(_n,{className:"h-8 w-48 mb-4"}),o.jsx(_n,{className:"h-32 w-full"})]})]}):o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(jn,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:fr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(lp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(TRn,{value:e,variant:"ghost"})})]}),o.jsx(fu,{children:o.jsxs(ce,{as:fr,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[o.jsx(o0,{}),"Processors documentation"]})})]}),o.jsx(ARn,{processorId:e})]})}function MRn(){const{data:e={},isLoading:t,error:r}=Eg(),{data:n={},isLoading:s,error:a}=J8(),[i,l]=b.useState(""),c=t||s,u=a||r;return u&&Ps(u)?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(aa,{})}):u&&ks(u)?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(Zs,{resource:"tools"})}):u?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(pu,{title:"Failed to load tools",message:u.message})}):Object.keys(n).length===0&&!c?o.jsx(Jr,{title:"Tools",icon:o.jsx(Mi,{}),children:o.jsx(PAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(xn,{children:o.jsxs(xn.Title,{isLoading:c,children:[o.jsx(Mi,{})," Tools"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Ln,{as:"a",href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Tools documentation",children:o.jsx(Li,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Sg,{onSearch:l,label:"Filter tools",placeholder:"Filter by name"})})]}),o.jsx(RAn,{tools:n,agents:e,isLoading:c,search:i})]})}const hOt={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,r,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${r?`&path=${encodeURIComponent(r)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,r)=>r?`/agents/${e}/chat/${t}?messageId=${r}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${Ki()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspacesLink:()=>"/workspaces",processorsLink:()=>"/processors",processorLink:e=>`/processors/${e}`,mcpServerLink:e=>`/mcps/${e}`,mcpServerToolLink:(e,t)=>`/mcps/${e}/tools/${t}`,workflowRunLink:(e,t)=>`/workflows/${e}/graph/${t}`,datasetLink:e=>`/datasets/${e}`,datasetItemLink:(e,t)=>`/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/datasets/${e}/experiments/${t}`,experimentLink:e=>`/experiments/${e}`},DRn=()=>{const e=uu(),t=r=>e(r,{viewTransition:!0});return o.jsx(Lht,{Link:E8,navigate:t,paths:hOt,children:o.jsx(xRn,{children:o.jsx(b_,{})})})},LRn=()=>{const e=uu(),t=r=>e(r,{viewTransition:!0});return o.jsx(Lht,{Link:E8,navigate:t,paths:hOt,children:o.jsx(wRn,{children:o.jsx(b_,{})})})},$Rn=!!window.MASTRA_CLOUD_API_ENDPOINT,JBe=Dle.has("datasets"),e7e=[{index:!0,element:o.jsx(Ujn,{})},{path:"instruction-blocks",element:o.jsx(Vjn,{})},{path:"tools",element:o.jsx(Wjn,{})},{path:"agents",element:o.jsx(Fjn,{})},{path:"scorers",element:o.jsx(Hjn,{})},{path:"workflows",element:o.jsx(Zjn,{})},{path:"skills",element:o.jsx(Qjn,{})},{path:"memory",element:o.jsx(qjn,{})},{path:"variables",element:o.jsx(Gjn,{})}],FRn=[{path:"/login",element:o.jsx(EAn,{})},{path:"/signup",element:o.jsx(pIn,{})},{element:o.jsx(LRn,{}),children:[{path:"/agents/:agentId/session",element:o.jsx(SBe,{})},{path:"/agents/:agentId/session/:threadId",element:o.jsx(SBe,{})}]},{element:o.jsx(DRn,{}),children:[...$Rn?[]:[{path:"/settings",element:o.jsx(hIn,{})},{path:"/templates",element:o.jsx(vIn,{})},{path:"/templates/:templateSlug",element:o.jsx(_In,{})}],{path:"/logs",element:o.jsx(CAn,{})},{path:"/primitives",element:o.jsx(aIn,{})},{path:"/evaluation",element:o.jsx(OAn,{})},{path:"/scorers",element:o.jsx(uIn,{})},{path:"/scorers/:scorerId",element:o.jsx(dIn,{})},{path:"/metrics",element:o.jsx(eIn,{})},{path:"/observability-overview",element:o.jsx(nIn,{})},{path:"/observability",element:o.jsx(IIn,{})},{path:"/traces/:traceId",element:o.jsx(RIn,{})},{path:"/resources",element:o.jsx(cIn,{})},{path:"/agents",element:o.jsx(AKr,{})},{path:"/cms/agents/create",element:o.jsx(zjn,{}),children:e7e},{path:"/cms/agents/:agentId/edit",element:o.jsx(Bjn,{}),children:e7e},{path:"/cms/scorers/create",element:o.jsx(Jjn,{})},{path:"/cms/scorers/:scorerId/edit",element:o.jsx(tTn,{})},{path:"/prompts",element:o.jsx(iIn,{})},{path:"/cms/prompts/create",element:o.jsx(Yjn,{})},{path:"/cms/prompts/:promptBlockId/edit",element:o.jsx(Kjn,{})},{path:"/agents/:agentId/tools/:toolId",element:o.jsx(EIn,{})},{path:"/agents/:agentId",element:o.jsx(ORn,{children:o.jsx(b_,{})}),children:[{index:!0,loader:({params:e})=>TU(`/agents/${e.agentId}/chat`)},{path:"chat",element:o.jsx(xBe,{})},{path:"chat/:threadId",element:o.jsx(xBe,{})},...JBe?[{path:"editor",element:o.jsx(Djn,{})},{path:"evaluate",element:o.jsx(Mjn,{})},{path:"review",element:o.jsx(Ljn,{})}]:[],{path:"traces",element:o.jsx($jn,{})}]},{path:"/tools",element:o.jsx(MRn,{})},{path:"/tools/:toolId",element:o.jsx(CIn,{})},{path:"/processors",element:o.jsx(jRn,{})},{path:"/processors/:processorId",element:o.jsx(PRn,{})},{path:"/mcps",element:o.jsx(AAn,{})},{path:"/mcps/:serverId",element:o.jsx(BAn,{})},{path:"/mcps/:serverId/tools/:toolId",element:o.jsx(qAn,{})},{path:"/workspaces",element:o.jsx(XBe,{})},{path:"/workspaces/:workspaceId",element:o.jsx(XBe,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:o.jsx(lRn,{})},{path:"/workflows",element:o.jsx(PIn,{})},{path:"/workflows/:workflowId",element:o.jsx(hYr,{children:o.jsx(b_,{})}),children:[{index:!0,loader:({params:e})=>TU(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:o.jsx(GBe,{})},{path:"graph/:runId",element:o.jsx(GBe,{})}]},...JBe?[{path:"/datasets",element:o.jsx(tAn,{})},{path:"/datasets/:datasetId",element:o.jsx(nAn,{})},{path:"/datasets/:datasetId/items/:itemId",element:o.jsx(iAn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:o.jsx(cAn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:o.jsx(sAn,{})},{path:"/experiments",element:o.jsx(kAn,{})},{path:"/experiments/:experimentId",element:o.jsx(_An,{})},{path:"/datasets/:datasetId/experiments",element:o.jsx(aAn,{})},{path:"/datasets/:datasetId/items",element:o.jsx(oAn,{})},{path:"/datasets/:datasetId/versions",element:o.jsx(dAn,{})}]:[],{index:!0,loader:()=>TU("/agents")},{path:"/request-context",element:o.jsx(oIn,{})}]}];function zRn(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:r,apiPrefix:n,isLoading:s}=cve(),a=b.useMemo(()=>t?Cjn(t,n):void 0,[t,n]);if(s)return null;if(!t)return o.jsx(qSn,{});const i=BFt(FRn,{basename:e});return o.jsx(f4t,{baseUrl:t,headers:r,apiPrefix:n,customFetch:a,children:o.jsx(OKr,{children:o.jsx(fFt,{router:i})})})}function BRn(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",r=window.MASTRA_SERVER_PORT||4111,n=window.MASTRA_API_PREFIX||"/api",s=window.MASTRA_CLOUD_API_ENDPOINT||"",a=window.MASTRA_AUTO_DETECT_URL==="true",i=s||(a?window.location.origin:`${e}://${t}:${r}`);return o.jsx(kRn,{children:o.jsx(cSn,{endpoint:i,defaultApiPrefix:n,children:o.jsx(zRn,{})})})}k_t.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(BRn,{})}));const zMn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{UHe as A,LGe as B,qHe as C,DWe as D,bf as E,ph as F,zMn as G,ea as I,i1 as L,BHe as N,v5t as a,P5t as b,FMn as c,Q1e as d,l1 as e,N5t as f,zk as g,R5t as h,iS as i,oS as j,aS as k,FVt as l,VWe as m,r1 as n,Ra as o,eVt as p,JUt as q,vue as r,_ce as s,ne as t,T3 as u,ku as v,O5t as w,ft as x,nt as y,iZe as z};