@mastra/deployer-cloud 1.29.1-alpha.2 → 1.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/studio/assets/{index-_k8uSPmz.js → index-BDxbe8Gn.js} +1 -1
- package/dist/studio/assets/{index-keE6tb7y.js → index-BFPbwhVc.js} +1 -1
- package/dist/studio/assets/{index-CbSvA8kE.js → index-BWtEmhy2.js} +1 -1
- package/dist/studio/assets/{index-kGFGClQD.js → index-C0vFW9pj.js} +1 -1
- package/dist/studio/assets/{index-Cz_pkY3f.js → index-Cbed1unS.js} +1 -1
- package/dist/studio/assets/{index-DK1OEBdu.js → index-CepEt0G8.js} +1 -1
- package/dist/studio/assets/{index-CHYOUY-Z.js → index-Cl6UcNDm.js} +1 -1
- package/dist/studio/assets/{index-DEneJmWM.js → index-CnUcrcRK.js} +1 -1
- package/dist/studio/assets/{index-CD13sPVm.js → index-Czr-BRha.js} +1 -1
- package/dist/studio/assets/{index-Dho1bYKM.js → index-Dm1OjAoS.js} +1 -1
- package/dist/studio/assets/{index-BiRcsKHw.js → index-DzcWqhqX.js} +1 -1
- package/dist/studio/assets/{index-ZE-w8-dX.js → index-INehCGZv.js} +1 -1
- package/dist/studio/assets/{index-WZlon7GS.js → index-Vq29RmsE.js} +1 -1
- package/dist/studio/assets/{index-Bki5TWKK.js → index-bthpR476.js} +1 -1
- package/dist/studio/assets/{index-Dow1Ljwt.js → index-ceufQExa.js} +1 -1
- package/dist/studio/assets/{index-DqRSq5qV.js → index-hyiexUSA.js} +1 -1
- package/dist/studio/assets/{index-BTwhiGm8.js → index-jCOd2fvg.js} +1 -1
- package/dist/studio/assets/{index-BrlJtmPD.js → index-m9rum56E.js} +1 -1
- package/dist/studio/assets/{main-Br3zt-w7.js → main-Da5vWd85.js} +5 -5
- package/dist/studio/index.html +1 -1
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{_ as Ke}from"./index-_k8uSPmz.js";function s7e(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 e3=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 fU={exports:{}},Sj={};var ywe;function g_t(){if(ywe)return Sj;ywe=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 Sj.Fragment=t,Sj.jsx=r,Sj.jsxs=r,Sj}var vwe;function y_t(){return vwe||(vwe=1,fU.exports=g_t()),fU.exports}var o=y_t(),hU={exports:{}},mn={},bwe;function v_t(){if(bwe)return mn;bwe=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(fe){return fe})):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 mn.Activity=h,mn.Children=Z,mn.Component=w,mn.Fragment=n,mn.Profiler=a,mn.PureComponent=k,mn.StrictMode=s,mn.Suspense=u,mn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,mn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},mn.cache=function(V){return function(){return V.apply(null,arguments)}},mn.cacheSignal=function(){return null},mn.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)},mn.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},mn.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)},mn.createRef=function(){return{current:null}},mn.forwardRef=function(V){return{$$typeof:c,render:V}},mn.isValidElement=R,mn.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Q}},mn.memo=function(V,M){return{$$typeof:d,type:V,compare:M===void 0?null:M}},mn.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}},mn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},mn.use=function(V){return j.H.use(V)},mn.useActionState=function(V,M,W){return j.H.useActionState(V,M,W)},mn.useCallback=function(V,M){return j.H.useCallback(V,M)},mn.useContext=function(V){return j.H.useContext(V)},mn.useDebugValue=function(){},mn.useDeferredValue=function(V,M){return j.H.useDeferredValue(V,M)},mn.useEffect=function(V,M){return j.H.useEffect(V,M)},mn.useEffectEvent=function(V){return j.H.useEffectEvent(V)},mn.useId=function(){return j.H.useId()},mn.useImperativeHandle=function(V,M,W){return j.H.useImperativeHandle(V,M,W)},mn.useInsertionEffect=function(V,M){return j.H.useInsertionEffect(V,M)},mn.useLayoutEffect=function(V,M){return j.H.useLayoutEffect(V,M)},mn.useMemo=function(V,M){return j.H.useMemo(V,M)},mn.useOptimistic=function(V,M){return j.H.useOptimistic(V,M)},mn.useReducer=function(V,M,W){return j.H.useReducer(V,M,W)},mn.useRef=function(V){return j.H.useRef(V)},mn.useState=function(V){return j.H.useState(V)},mn.useSyncExternalStore=function(V,M,W){return j.H.useSyncExternalStore(V,M,W)},mn.useTransition=function(){return j.H.useTransition()},mn.version="19.2.5",mn}var xwe;function jE(){return xwe||(xwe=1,hU.exports=v_t()),hU.exports}var b=jE();const je=Uo(b),JS=s7e({__proto__:null,default:je},[b]);var pU={exports:{}},Oj={},mU={exports:{}},gU={};var wwe;function b_t(){return wwe||(wwe=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}}}})(gU)),gU}var Swe;function x_t(){return Swe||(Swe=1,mU.exports=b_t()),mU.exports}var yU={exports:{}},rc={};var Owe;function w_t(){if(Owe)return rc;Owe=1;var e=jE();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 rc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,rc.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)},rc.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()}},rc.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))},rc.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},rc.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})}},rc.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)},rc.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})}},rc.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)},rc.requestFormReset=function(c){n.d.r(c)},rc.unstable_batchedUpdates=function(c,u){return c(u)},rc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},rc.useFormStatus=function(){return i.H.useHostTransitionStatus()},rc.version="19.2.5",rc}var kwe;function a7e(){if(kwe)return yU.exports;kwe=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(),yU.exports=w_t(),yU.exports}var _we;function S_t(){if(_we)return Oj;_we=1;var e={env:{}};var t=x_t(),r=jE(),n=a7e();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,de=F.child;de;){if(de===C){ee=!0,C=F,A=q;break}if(de===A){ee=!0,A=F,C=q;break}de=de.sibling}if(!ee){for(de=q.child;de;){if(de===C){ee=!0,C=q,A=F;break}if(de===A){ee=!0,A=q,C=F;break}de=de.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)?z0e(v):0;break;default:if(v=O.tagName,O=O.namespaceURI)O=z0e(O),v=B0e(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 fe(v){v.memoizedState!==null&&W(te,v);var O=G.current,C=B0e(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),vj._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-bthpR476.js","./index-BDxbe8Gn.js","./index-Vq29RmsE.js","./index-Cl6UcNDm.js","./index-jCOd2fvg.js","./index-INehCGZv.js","./index-DzcWqhqX.js","./index-C0vFW9pj.js","./index-CepEt0G8.js","./index-BFPbwhVc.js","./index-Cbed1unS.js","./index-m9rum56E.js","./index-Dm1OjAoS.js","./index-CnUcrcRK.js","./index-hyiexUSA.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-ceufQExa.js","./index-BWtEmhy2.js","./index-Czr-BRha.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Ke}from"./index-BDxbe8Gn.js";function s7e(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 e3=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 fU={exports:{}},Sj={};var ywe;function g_t(){if(ywe)return Sj;ywe=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 Sj.Fragment=t,Sj.jsx=r,Sj.jsxs=r,Sj}var vwe;function y_t(){return vwe||(vwe=1,fU.exports=g_t()),fU.exports}var o=y_t(),hU={exports:{}},mn={},bwe;function v_t(){if(bwe)return mn;bwe=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(fe){return fe})):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 mn.Activity=h,mn.Children=Z,mn.Component=w,mn.Fragment=n,mn.Profiler=a,mn.PureComponent=k,mn.StrictMode=s,mn.Suspense=u,mn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,mn.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},mn.cache=function(V){return function(){return V.apply(null,arguments)}},mn.cacheSignal=function(){return null},mn.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)},mn.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},mn.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)},mn.createRef=function(){return{current:null}},mn.forwardRef=function(V){return{$$typeof:c,render:V}},mn.isValidElement=R,mn.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Q}},mn.memo=function(V,M){return{$$typeof:d,type:V,compare:M===void 0?null:M}},mn.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}},mn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},mn.use=function(V){return j.H.use(V)},mn.useActionState=function(V,M,W){return j.H.useActionState(V,M,W)},mn.useCallback=function(V,M){return j.H.useCallback(V,M)},mn.useContext=function(V){return j.H.useContext(V)},mn.useDebugValue=function(){},mn.useDeferredValue=function(V,M){return j.H.useDeferredValue(V,M)},mn.useEffect=function(V,M){return j.H.useEffect(V,M)},mn.useEffectEvent=function(V){return j.H.useEffectEvent(V)},mn.useId=function(){return j.H.useId()},mn.useImperativeHandle=function(V,M,W){return j.H.useImperativeHandle(V,M,W)},mn.useInsertionEffect=function(V,M){return j.H.useInsertionEffect(V,M)},mn.useLayoutEffect=function(V,M){return j.H.useLayoutEffect(V,M)},mn.useMemo=function(V,M){return j.H.useMemo(V,M)},mn.useOptimistic=function(V,M){return j.H.useOptimistic(V,M)},mn.useReducer=function(V,M,W){return j.H.useReducer(V,M,W)},mn.useRef=function(V){return j.H.useRef(V)},mn.useState=function(V){return j.H.useState(V)},mn.useSyncExternalStore=function(V,M,W){return j.H.useSyncExternalStore(V,M,W)},mn.useTransition=function(){return j.H.useTransition()},mn.version="19.2.5",mn}var xwe;function jE(){return xwe||(xwe=1,hU.exports=v_t()),hU.exports}var b=jE();const je=Uo(b),JS=s7e({__proto__:null,default:je},[b]);var pU={exports:{}},Oj={},mU={exports:{}},gU={};var wwe;function b_t(){return wwe||(wwe=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}}}})(gU)),gU}var Swe;function x_t(){return Swe||(Swe=1,mU.exports=b_t()),mU.exports}var yU={exports:{}},rc={};var Owe;function w_t(){if(Owe)return rc;Owe=1;var e=jE();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 rc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,rc.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)},rc.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()}},rc.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))},rc.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},rc.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})}},rc.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)},rc.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})}},rc.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)},rc.requestFormReset=function(c){n.d.r(c)},rc.unstable_batchedUpdates=function(c,u){return c(u)},rc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},rc.useFormStatus=function(){return i.H.useHostTransitionStatus()},rc.version="19.2.5",rc}var kwe;function a7e(){if(kwe)return yU.exports;kwe=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(),yU.exports=w_t(),yU.exports}var _we;function S_t(){if(_we)return Oj;_we=1;var e={env:{}};var t=x_t(),r=jE(),n=a7e();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,de=F.child;de;){if(de===C){ee=!0,C=F,A=q;break}if(de===A){ee=!0,A=F,C=q;break}de=de.sibling}if(!ee){for(de=q.child;de;){if(de===C){ee=!0,C=q,A=F;break}if(de===A){ee=!0,A=q,C=F;break}de=de.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)?z0e(v):0;break;default:if(v=O.tagName,O=O.namespaceURI)O=z0e(O),v=B0e(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 fe(v){v.memoizedState!==null&&W(te,v);var O=G.current,C=B0e(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),vj._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 ue=!1;function ce(v,O){if(!v||ue)return"";ue=!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],de=q[1];if(ee&&de){var Te=ee.split(`
|
|
5
5
|
`),We=de.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"}),ju('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ju('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],qGe=Uue.concat([ju("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ju("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ju("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Mke=new qHe,HGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Lj(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const YQt=["FunctionDeclaration"],XQt={FunctionDeclaration:Lj("function"),ClassDeclaration:Lj("class"),ClassExpression:()=>!0,EnumDeclaration:Lj("constant"),TypeAliasDeclaration:Lj("type"),NamespaceDeclaration:Lj("namespace"),VariableDefinition(e,t){e.matchContext(YQt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function QGe(e,t){let r=Mke.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(Js.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=XQt[i.name];if(l&&l(i,a)||HGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of QGe(e,i.node))n.push(l);return!1}}),Mke.set(t,n),n}const K3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Vue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function WGe(e){let t=Ra(e.state).resolveInner(e.pos,-1);if(Vue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&K3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)HGe.has(s.name)&&(n=n.concat(QGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:K3}}function bV(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 GGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ra(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?bV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?bV(t,r.parent,""):Vue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&K3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?bV(t,r,""):e.explicit?{path:[],name:""}:null}function KQt(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 JQt(e){let t=new Map;return r=>{let n=GGe(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=KQt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:K3}}}const vh=uS.define({name:"javascript",parser:ZQt.configure({props:[c1.add({IfStatement:Vk({except:/^\s*({|else\b)/}),TryStatement:Vk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:ZUt,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:GUt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Vk({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}}),u1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Sue,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:"$"}}),ZGe={test:e=>/^JSX/.test(e.name),facet:UF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},que=vh.configure({dialect:"ts"},"typescript"),Hue=vh.configure({dialect:"jsx",props:[bue.add(e=>e.isTop?[ZGe]:void 0)]}),Que=vh.configure({dialect:"jsx ts",props:[bue.add(e=>e.isTop?[ZGe]:void 0)]},"typescript");let YGe=e=>({label:e,type:"keyword"});const XGe="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(YGe),eWt=XGe.concat(["declare","implements","private","protected","public"].map(YGe));function J3(e={}){let t=e.jsx?e.typescript?Que:Hue:e.typescript?que:vh,r=e.typescript?qGe.concat(eWt):Uue.concat(XGe);return new fS(t,[vh.data.of({autocomplete:PVt(Vue,QWe(r))}),vh.data.of({autocomplete:WGe}),e.jsx?KGe:[]])}function tWt(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 Dke(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 rWt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),KGe=ft.inputHandler.of((e,t,r,n,s)=>{if((rWt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!vh.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=Dke(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=tWt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=Dke(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 nWt(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 vh.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(sWt(u,n.doc,c))}return s}}function Lke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function sWt(e,t,r){let n=Lke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?Lke(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 oD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:KGe,completionPath:GGe,esLint:nWt,javascript:J3,javascriptLanguage:vh,jsxLanguage:Hue,localCompletionSource:WGe,scopeCompletionSource:JQt,snippets:Uue,tsxLanguage:Que,typescriptLanguage:que,typescriptSnippets:qGe},Symbol.toStringTag,{value:"Module"})),$j=["_blank","_self","_top","_parent"],xV=["ascii","utf-8","utf-16","latin1","latin1"],wV=["get","post","put","delete"],SV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Od=["true","false"],Dr={},aWt={a:{attrs:{href:null,ping:null,type:null,media:null,target:$j,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:$j}},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:SV,formmethod:wV,formnovalidate:["novalidate"],formtarget:$j,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":xV,autocomplete:["on","off"],enctype:SV,method:wV,novalidate:["novalidate"],target:$j}},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:SV,formmethod:wV,formnovalidate:["novalidate"],formtarget:$j,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:xV,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:xV}},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},JGe={accesskey:null,class:null,contenteditable:Od,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:Od,autocorrect:Od,autocapitalize:Od,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":Od,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Od,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Od,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Od,"aria-hidden":Od,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Od,"aria-multiselectable":Od,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Od,"aria-relevant":null,"aria-required":Od,"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},eZe="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 eZe)JGe[e]=null;let RA=class{constructor(t,r){this.tags={...aWt,...t},this.globalAttrs={...JGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};RA.default=new RA;function R_(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 P_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function tZe(e,t,r){let n=r.tags[R_(e,P_(t))];return n?.children||r.allTags}function Wue(e,t){let r=[];for(let n=P_(t);n&&!n.type.isTop;n=P_(n.parent)){let s=R_(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 rZe=/^[:\-\.\w\u00b7-\uffff]*$/;function $ke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=P_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:tZe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Wue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Fke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Wue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:rZe}}function iWt(e,t,r,n){let s=[],a=0;for(let i of tZe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Wue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function oWt(e,t,r,n,s){let a=P_(r),i=a?t.tags[R_(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:rZe}}function lWt(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=P_(r),h=f?t.tags[R_(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 nZe(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)?Fke(r,s,s.from,n):$ke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?$ke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Fke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?oWt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?lWt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?iWt(r,e,s,n):null}function sZe(e){return nZe(RA.default,e)}function aZe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new RA(t,r):RA.default;return s=>nZe(n,s)}const cWt=vh.parser.configure({top:"SingleExpression"}),iZe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:que.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Hue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Que.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:cWt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:vh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:IA.parser}],oZe=[{name:"style",parser:IA.parser.configure({top:"Styles"})}].concat(eZe.map(e=>({name:e,parser:vh.parser}))),lZe=uS.define({name:"html",parser:$Ht.configure({props:[c1.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}}),u1.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}}}),FWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),ON=lZe.configure({wrap:PGe(iZe,oZe)});function cZe(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=PGe((e.nestedLanguages||[]).concat(iZe),(e.nestedAttributes||[]).concat(oZe)));let n=r?lZe.configure({wrap:r,dialect:t}):t?ON.configure({dialect:t}):ON;return new fS(n,[ON.data.of({autocomplete:aZe(e)}),e.autoCloseTags!==!1?uZe:[],J3().support,UGe().support])}const zke=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),uZe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!ON.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=R_(i.doc,y.parent,p))&&!zke.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=R_(i.doc,y,p))&&!zke.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)}),uWt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:uZe,html:cZe,htmlCompletionSource:sZe,htmlCompletionSourceWith:aZe,htmlLanguage:ON},Symbol.toStringTag,{value:"Module"})),dZe=UF({commentTokens:{block:{open:"<!--",close:"-->"}}}),fZe=new hn,hZe=zqt.configure({props:[u1.add(e=>!e.is("Block")||e.is("Document")||lse(e)!=null||dWt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),fZe.add(lse),c1.add({Document:()=>null}),zb.add({Document:dZe})]});function lse(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function dWt(e){return e.name=="OrderedList"||e.name=="BulletList"}function fWt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=lse(n.type))!=null&&s<=t)break;r=n}return r.to}const hWt=CWe.of((e,t,r)=>{for(let n=Ra(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(fZe);if(s==null)continue;let a=fWt(n,s);if(a>r)return{from:r,to:a}}return null});function Gue(e){return new Hd(dZe,e,[],"markdown")}const pZe=Gue(hZe),pWt=hZe.configure([Xqt,Jqt,Kqt,eHt,{props:[u1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),mS=Gue(pWt);function mWt(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:dS.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class OV{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(+gZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function mZe(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 OV(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 OV(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 OV(a.parent,c,c+d,i[1],u,f,a))}}return n}function gZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=gZe(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 Zue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(qE)!=" ")return e;let n=Cp(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const yZe=(e={})=>({state:t,dispatch:r})=>{let n=Ra(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!mS.isActiveAt(t,l.from,-1)&&!mS.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=mZe(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"&&kV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&kV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=Uke(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"&&kV(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?Cp(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=Zue(g,t),gWt(f.node,t.doc)&&(g=Uke(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)},vZe=yZe();function Bke(e){return e.name=="QuoteMark"||e.name=="ListMark"}function gWt(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 Uke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Cp(r.text,4,e[s+1].from)-n.length:null,s<a);return Zue(n,t)}function yWt(e,t){let r=e.resolveInner(t,-1),n=t;Bke(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Bke(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const bZe=({state:e,dispatch:t})=>{let r=Ra(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&mS.isActiveAt(e,a.from)){let c=l.lineAt(i),u=mZe(yWt(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(Cp(c.text,4,d.to)-Cp(c.text,4,d.from));return h==c.from&&(p=Zue(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)},xZe=[{key:"Enter",run:vZe},{key:"Backspace",run:bZe}],wZe=cZe({matchClosingTags:!1});function Yue(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=pZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=wZe}=e;if(!(s instanceof QF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,hWt],d;i&&u.push(SZe),r instanceof fS?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?mWt(t,d):void 0;c.push(Uqt({codeParser:f,htmlParser:l.language.parser})),n&&u.push($p.high(VE.of(xZe)));let h=Gue(s.configure(c));return a&&u.push(h.data.of({autocomplete:vWt})),new fS(h,u)}function vWt(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:bWt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let _V=null;function bWt(){if(_V)return _V;let e=sZe(new Eue(zn.create({extensions:wZe}),0,!0));return _V=e?e.options:[]}const xWt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,SZe=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),!mS.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||xWt.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)}}),wWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:pZe,deleteMarkupBackward:bZe,insertNewlineContinueMarkup:vZe,insertNewlineContinueMarkupCommand:yZe,markdown:Yue,markdownKeymap:xZe,markdownLanguage:mS,pasteURLAsLink:SZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new fS(Oue.define(e))}function sb(e){return Ke(()=>import("./index-Bki5TWKK.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const OZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-WZlon7GS.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-WZlon7GS.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return sb("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>vQt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-CHYOUY-Z.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(()=>uWt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-BTwhiGm8.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(()=>oD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-ZE-w8-dX.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(()=>IVt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>oD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-BiRcsKHw.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-kGFGClQD.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return sb("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>wWt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return sb("MSSQL")}}),Ye.of({name:"MySQL",load(){return sb("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-DK1OEBdu.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return sb("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return sb("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-keE6tb7y.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-Cz_pkY3f.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-BrlJtmPD.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-BrlJtmPD.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return sb("StandardSQL")}}),Ye.of({name:"SQLite",load(){return sb("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>oD),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(()=>oD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-Dho1bYKM.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-DEneJmWM.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-DqRSq5qV.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-Dow1Ljwt.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-CbSvA8kE.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function kx(){return kx=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},kx.apply(null,arguments)}var SWt=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=Fp.define(n),u=[l,Jx(c)];return u},OWt={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)"},kWt=[{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 SWt({theme:t,settings:kx({},OWt,r),styles:[...kWt,...n]})};QE();function Xue(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 _Wt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Jue(e.state,r.from);return n.line?EWt(e):n.block?jWt(e):!1};function Kue(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 EWt=Kue(AWt,0),CWt=Kue(kZe,0),jWt=Kue((e,t)=>kZe(e,t,NWt(t)),0);function Jue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Fj=50;function TWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Fj,n),i=e.sliceDoc(s,s+Fj),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*Fj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Fj),f=e.sliceDoc(s-Fj,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 NWt(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 kZe(e,t,r=t.selection.ranges){let n=r.map(a=>Jue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>TWt(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 AWt(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=Jue(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 cse=bg.define(),IWt=bg.define(),RWt=Kt.define(),_Ze=Kt.define({combine(e){return xg(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)})}}),EZe=Oo.define({create(){return Mm.empty},update(e,t){let r=t.state.facet(_Ze),n=t.annotation(cse);if(n){let c=Bu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=e5(d,d.length,r.minDepth,c):d=TZe(d,t.startState.selection),new Mm(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(IWt);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=Bu.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 Mm(e.done.map(Bu.fromJSON),e.undone.map(Bu.fromJSON))}});function PWt(e={}){return[EZe,_Ze.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?CZe:t.inputType=="historyRedo"?use:null;return n?(t.preventDefault(),n(r)):!1}})]}function WF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(EZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const CZe=WF(0,!1),use=WF(1,!1),MWt=WF(0,!0),DWt=WF(1,!0);class Bu{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 Bu(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 Bu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Gm.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,r){let n=dh;for(let s of t.startState.facet(RWt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new Bu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,dh)}static selection(t){return new Bu(void 0,dh,void 0,void 0,t)}}function e5(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 LWt(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 $Wt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function jZe(e,t){return e.length?t.length?e.concat(t):e:t}const dh=[],FWt=200;function TZe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-FWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),e5(e,e.length-1,1e9,r.setSelAfter(n)))}else return[Bu.selection([t])]}function zWt(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 EV(e,t){if(!e.length)return e;let r=e.length,n=dh;for(;r;){let s=BWt(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?[Bu.selection(n)]:dh}function BWt(e,t,r){let n=jZe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):dh,r);if(!e.changes)return Bu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Bu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const UWt=/^(input\.type|delete)($|\.)/;class Mm{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 Mm(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||UWt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,LWt(l.changes,t.changes))||n=="input.type.compose")?i=e5(i,i.length-1,s.minDepth,new Bu(t.changes.compose(l.changes),jZe(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,dh)):i=e5(i,i.length,s.minDepth,t),new Mm(i,dh,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:dh;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&$Wt(a[a.length-1],t)?this:new Mm(TZe(this.done,t),this.undone,r,n)}addMapping(t){return new Mm(EV(this.done,t),EV(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:cse.of({side:t,rest:zWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?dh:s.slice(0,s.length-1);return a.mapped&&(l=EV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:cse.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Mm.empty=new Mm(dh,dh);const VWt=[{key:"Mod-z",run:CZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:use,preventDefault:!0},{linux:"Ctrl-Shift-z",run:use,preventDefault:!0},{key:"Mod-u",run:MWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:DWt,preventDefault:!0}];function WE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function zp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Bp({state:e,dispatch:t},r){let n=WE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(zp(e,n)),!0)}function GF(e,t){return nt.cursor(t?e.to:e.from)}function NZe(e,t){return Bp(e,r=>r.empty?e.moveByChar(r,t):GF(r,t))}function Cc(e){return e.textDirectionAt(e.state.selection.main.head)==$a.LTR}const AZe=e=>NZe(e,!Cc(e)),IZe=e=>NZe(e,Cc(e));function RZe(e,t){return Bp(e,r=>r.empty?e.moveByGroup(r,t):GF(r,t))}const qWt=e=>RZe(e,!Cc(e)),HWt=e=>RZe(e,Cc(e));function QWt(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 ZF(e,t,r){let n=Ra(e).resolveInner(t.head),s=r?hn.closedBy:hn.openedBy;for(let c=t.head;;){let u=r?n.childAfter(c):n.childBefore(c);if(!u)break;QWt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Pm(e,n.from,1):Pm(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 WWt=e=>Bp(e,t=>ZF(e.state,t,!Cc(e))),GWt=e=>Bp(e,t=>ZF(e.state,t,Cc(e)));function PZe(e,t){return Bp(e,r=>{if(!r.empty)return GF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const MZe=e=>PZe(e,!1),DZe=e=>PZe(e,!0);function LZe(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 $Ze(e,t){let r=LZe(e),{state:n}=e,s=WE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):GF(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(zp(n,s),{effects:a}),!0}const Vke=e=>$Ze(e,!1),dse=e=>$Ze(e,!0);function e0(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 ZWt=e=>Bp(e,t=>e0(e,t,!0)),YWt=e=>Bp(e,t=>e0(e,t,!1)),XWt=e=>Bp(e,t=>e0(e,t,!Cc(e))),KWt=e=>Bp(e,t=>e0(e,t,Cc(e))),JWt=e=>Bp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),eGt=e=>Bp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function tGt(e,t,r){let n=!1,s=WE(e.selection,a=>{let i=Pm(e,a.head,-1)||Pm(e,a.head,1)||a.head>0&&Pm(e,a.head-1,1)||a.head<e.doc.length&&Pm(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(zp(e,s)),!0):!1}const rGt=({state:e,dispatch:t})=>tGt(e,t);function Fh(e,t){let r=WE(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(zp(e.state,r)),!0)}function FZe(e,t){return Fh(e,r=>e.moveByChar(r,t))}const zZe=e=>FZe(e,!Cc(e)),BZe=e=>FZe(e,Cc(e));function UZe(e,t){return Fh(e,r=>e.moveByGroup(r,t))}const nGt=e=>UZe(e,!Cc(e)),sGt=e=>UZe(e,Cc(e)),aGt=e=>Fh(e,t=>ZF(e.state,t,!Cc(e))),iGt=e=>Fh(e,t=>ZF(e.state,t,Cc(e)));function VZe(e,t){return Fh(e,r=>e.moveVertically(r,t))}const qZe=e=>VZe(e,!1),HZe=e=>VZe(e,!0);function QZe(e,t){return Fh(e,r=>e.moveVertically(r,t,LZe(e).height))}const qke=e=>QZe(e,!1),Hke=e=>QZe(e,!0),oGt=e=>Fh(e,t=>e0(e,t,!0)),lGt=e=>Fh(e,t=>e0(e,t,!1)),cGt=e=>Fh(e,t=>e0(e,t,!Cc(e))),uGt=e=>Fh(e,t=>e0(e,t,Cc(e))),dGt=e=>Fh(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),fGt=e=>Fh(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),Qke=({state:e,dispatch:t})=>(t(zp(e,{anchor:0})),!0),Wke=({state:e,dispatch:t})=>(t(zp(e,{anchor:e.doc.length})),!0),Gke=({state:e,dispatch:t})=>(t(zp(e,{anchor:e.selection.main.anchor,head:0})),!0),Zke=({state:e,dispatch:t})=>(t(zp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),hGt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),pGt=({state:e,dispatch:t})=>{let r=YF(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},mGt=({state:e,dispatch:t})=>{let r=WE(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(zp(e,r)),!0)};function WZe(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(zp(r,nt.create(s,s.length-1))),!0)}const gGt=e=>WZe(e,!1),yGt=e=>WZe(e,!0),vGt=({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(zp(e,n)),!0):!1};function GR(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=lD(e,c,!1)):c>i&&(r="delete.forward",c=lD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=lD(e,i,!1),l=lD(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 lD(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 GZe=(e,t,r)=>GR(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=Cp(l,a.tabSize),d=u%hS(a)||hS(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=xl(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=xl(i.text,c-i.from,!1,!1)+i.from);return c}),fse=e=>GZe(e,!1,!0),ZZe=e=>GZe(e,!0,!1),YZe=(e,t)=>GR(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=xl(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}),XZe=e=>YZe(e,!1),bGt=e=>YZe(e,!0),xGt=e=>GR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),wGt=e=>GR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),SGt=e=>GR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),OGt=({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},kGt=({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:xl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:xl(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 YF(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 KZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of YF(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 _Gt=({state:e,dispatch:t})=>KZe(e,t,!1),EGt=({state:e,dispatch:t})=>KZe(e,t,!0);function JZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of YF(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 CGt=({state:e,dispatch:t})=>JZe(e,t,!1),jGt=({state:e,dispatch:t})=>JZe(e,t,!0),TGt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(YF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=WE(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 NGt(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(hn.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 Yke=eYe(!1),AGt=eYe(!0);function eYe(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&&NGt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new VF(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=xue(u,a);for(d==null&&(d=Cp(/^\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=["",kA(t,d)];return c&&f.push(kA(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 ede(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 IGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new VF(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=ede(e,(a,i,l)=>{let c=xue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=kA(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},tYe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ede(e,(r,n)=>{n.push({from:r.from,insert:e.facet(qE)})}),{userEvent:"input.indent"})),!0),rYe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ede(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Cp(s,e.tabSize),i=0,l=kA(e,Math.max(0,a-hS(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),RGt=e=>(e.setTabFocusMode(),!0),PGt=[{key:"Ctrl-b",run:AZe,shift:zZe,preventDefault:!0},{key:"Ctrl-f",run:IZe,shift:BZe},{key:"Ctrl-p",run:MZe,shift:qZe},{key:"Ctrl-n",run:DZe,shift:HZe},{key:"Ctrl-a",run:JWt,shift:dGt},{key:"Ctrl-e",run:eGt,shift:fGt},{key:"Ctrl-d",run:ZZe},{key:"Ctrl-h",run:fse},{key:"Ctrl-k",run:xGt},{key:"Ctrl-Alt-h",run:XZe},{key:"Ctrl-o",run:OGt},{key:"Ctrl-t",run:kGt},{key:"Ctrl-v",run:dse}],MGt=[{key:"ArrowLeft",run:AZe,shift:zZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:qWt,shift:nGt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:XWt,shift:cGt,preventDefault:!0},{key:"ArrowRight",run:IZe,shift:BZe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:HWt,shift:sGt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:KWt,shift:uGt,preventDefault:!0},{key:"ArrowUp",run:MZe,shift:qZe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Qke,shift:Gke},{mac:"Ctrl-ArrowUp",run:Vke,shift:qke},{key:"ArrowDown",run:DZe,shift:HZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Wke,shift:Zke},{mac:"Ctrl-ArrowDown",run:dse,shift:Hke},{key:"PageUp",run:Vke,shift:qke},{key:"PageDown",run:dse,shift:Hke},{key:"Home",run:YWt,shift:lGt,preventDefault:!0},{key:"Mod-Home",run:Qke,shift:Gke},{key:"End",run:ZWt,shift:oGt,preventDefault:!0},{key:"Mod-End",run:Wke,shift:Zke},{key:"Enter",run:Yke,shift:Yke},{key:"Mod-a",run:hGt},{key:"Backspace",run:fse,shift:fse,preventDefault:!0},{key:"Delete",run:ZZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:XZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:bGt,preventDefault:!0},{mac:"Mod-Backspace",run:wGt,preventDefault:!0},{mac:"Mod-Delete",run:SGt,preventDefault:!0}].concat(PGt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),DGt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:WWt,shift:aGt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:GWt,shift:iGt},{key:"Alt-ArrowUp",run:_Gt},{key:"Shift-Alt-ArrowUp",run:CGt},{key:"Alt-ArrowDown",run:EGt},{key:"Shift-Alt-ArrowDown",run:jGt},{key:"Mod-Alt-ArrowUp",run:gGt},{key:"Mod-Alt-ArrowDown",run:yGt},{key:"Escape",run:vGt},{key:"Mod-Enter",run:AGt},{key:"Alt-l",mac:"Ctrl-l",run:pGt},{key:"Mod-i",run:mGt,preventDefault:!0},{key:"Mod-[",run:rYe},{key:"Mod-]",run:tYe},{key:"Mod-Alt-\\",run:IGt},{key:"Shift-Mod-k",run:TGt},{key:"Shift-Mod-\\",run:rGt},{key:"Mod-/",run:_Wt},{key:"Alt-A",run:CWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:RGt}].concat(MGt),LGt={key:"Tab",run:tYe,shift:rYe},Xke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Gy{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(Xke(l)):Xke,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 Pu(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=tue(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=Om(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"&&(Gy.prototype[Symbol.iterator]=function(){return this});const nYe={from:-1,to:-1,match:/.*/.exec("")},tde="gm"+(/x/.unicode==null?"":"u");class sYe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=nYe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new aYe(t,r,n,s,a);this.re=new RegExp(r,tde+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=t5(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=t5(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 CV=new WeakMap;class Hk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=CV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Hk(r,t.sliceString(r,n));return CV.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)),CV.set(t,new Hk(i,a)),new Hk(r,a.slice(r-i,n-i))}}class aYe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=nYe,this.matchPos=t5(t,s),this.re=new RegExp(r,tde+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Hk.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=t5(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Hk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(sYe.prototype[Symbol.iterator]=aYe.prototype[Symbol.iterator]=function(){return this});function $Gt(e){try{return new RegExp(e,tde),!0}catch{return!1}}function t5(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 FGt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=_Ut(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},zGt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},BGt=Kt.define({combine(e){return xg(e,zGt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function UGt(e){return[WGt,QGt]}const VGt=er.mark({class:"cm-selectionMatch"}),qGt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Kke(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 HGt(e,t,r,n){return e(t.sliceDoc(r,r+1))==xi.Word&&e(t.sliceDoc(n-1,n))==xi.Word}const QGt=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(BGt),{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),!(Kke(i,r,s.from,s.to)&&HGt(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 Gy(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Kke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(qGt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(VGt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),WGt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),GGt=({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 ZGt(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 Gy(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new Gy(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 YGt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return GGt({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=ZGt(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},GE=Kt.define({combine(e){return xg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new uZt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class iYe{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||$Gt(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"}),ju('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ju('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],qGe=Uue.concat([ju("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ju("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ju("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Mke=new qHe,HGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Lj(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const YQt=["FunctionDeclaration"],XQt={FunctionDeclaration:Lj("function"),ClassDeclaration:Lj("class"),ClassExpression:()=>!0,EnumDeclaration:Lj("constant"),TypeAliasDeclaration:Lj("type"),NamespaceDeclaration:Lj("namespace"),VariableDefinition(e,t){e.matchContext(YQt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function QGe(e,t){let r=Mke.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(Js.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=XQt[i.name];if(l&&l(i,a)||HGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of QGe(e,i.node))n.push(l);return!1}}),Mke.set(t,n),n}const K3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Vue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function WGe(e){let t=Ra(e.state).resolveInner(e.pos,-1);if(Vue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&K3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)HGe.has(s.name)&&(n=n.concat(QGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:K3}}function bV(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 GGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Ra(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?bV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?bV(t,r.parent,""):Vue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&K3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?bV(t,r,""):e.explicit?{path:[],name:""}:null}function KQt(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 JQt(e){let t=new Map;return r=>{let n=GGe(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=KQt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:K3}}}const vh=uS.define({name:"javascript",parser:ZQt.configure({props:[c1.add({IfStatement:Vk({except:/^\s*({|else\b)/}),TryStatement:Vk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:ZUt,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:GUt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Vk({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}}),u1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Sue,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:"$"}}),ZGe={test:e=>/^JSX/.test(e.name),facet:UF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},que=vh.configure({dialect:"ts"},"typescript"),Hue=vh.configure({dialect:"jsx",props:[bue.add(e=>e.isTop?[ZGe]:void 0)]}),Que=vh.configure({dialect:"jsx ts",props:[bue.add(e=>e.isTop?[ZGe]:void 0)]},"typescript");let YGe=e=>({label:e,type:"keyword"});const XGe="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(YGe),eWt=XGe.concat(["declare","implements","private","protected","public"].map(YGe));function J3(e={}){let t=e.jsx?e.typescript?Que:Hue:e.typescript?que:vh,r=e.typescript?qGe.concat(eWt):Uue.concat(XGe);return new fS(t,[vh.data.of({autocomplete:PVt(Vue,QWe(r))}),vh.data.of({autocomplete:WGe}),e.jsx?KGe:[]])}function tWt(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 Dke(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 rWt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),KGe=ft.inputHandler.of((e,t,r,n,s)=>{if((rWt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!vh.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=Dke(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=tWt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=Dke(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 nWt(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 vh.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(sWt(u,n.doc,c))}return s}}function Lke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function sWt(e,t,r){let n=Lke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?Lke(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 oD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:KGe,completionPath:GGe,esLint:nWt,javascript:J3,javascriptLanguage:vh,jsxLanguage:Hue,localCompletionSource:WGe,scopeCompletionSource:JQt,snippets:Uue,tsxLanguage:Que,typescriptLanguage:que,typescriptSnippets:qGe},Symbol.toStringTag,{value:"Module"})),$j=["_blank","_self","_top","_parent"],xV=["ascii","utf-8","utf-16","latin1","latin1"],wV=["get","post","put","delete"],SV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Od=["true","false"],Dr={},aWt={a:{attrs:{href:null,ping:null,type:null,media:null,target:$j,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:$j}},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:SV,formmethod:wV,formnovalidate:["novalidate"],formtarget:$j,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":xV,autocomplete:["on","off"],enctype:SV,method:wV,novalidate:["novalidate"],target:$j}},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:SV,formmethod:wV,formnovalidate:["novalidate"],formtarget:$j,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:xV,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:xV}},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},JGe={accesskey:null,class:null,contenteditable:Od,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:Od,autocorrect:Od,autocapitalize:Od,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":Od,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Od,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Od,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Od,"aria-hidden":Od,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Od,"aria-multiselectable":Od,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Od,"aria-relevant":null,"aria-required":Od,"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},eZe="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 eZe)JGe[e]=null;let RA=class{constructor(t,r){this.tags={...aWt,...t},this.globalAttrs={...JGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};RA.default=new RA;function R_(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 P_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function tZe(e,t,r){let n=r.tags[R_(e,P_(t))];return n?.children||r.allTags}function Wue(e,t){let r=[];for(let n=P_(t);n&&!n.type.isTop;n=P_(n.parent)){let s=R_(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 rZe=/^[:\-\.\w\u00b7-\uffff]*$/;function $ke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=P_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:tZe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Wue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Fke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Wue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:rZe}}function iWt(e,t,r,n){let s=[],a=0;for(let i of tZe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Wue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function oWt(e,t,r,n,s){let a=P_(r),i=a?t.tags[R_(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:rZe}}function lWt(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=P_(r),h=f?t.tags[R_(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 nZe(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)?Fke(r,s,s.from,n):$ke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?$ke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Fke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?oWt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?lWt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?iWt(r,e,s,n):null}function sZe(e){return nZe(RA.default,e)}function aZe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new RA(t,r):RA.default;return s=>nZe(n,s)}const cWt=vh.parser.configure({top:"SingleExpression"}),iZe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:que.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Hue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Que.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:cWt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:vh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:IA.parser}],oZe=[{name:"style",parser:IA.parser.configure({top:"Styles"})}].concat(eZe.map(e=>({name:e,parser:vh.parser}))),lZe=uS.define({name:"html",parser:$Ht.configure({props:[c1.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}}),u1.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}}}),FWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),ON=lZe.configure({wrap:PGe(iZe,oZe)});function cZe(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=PGe((e.nestedLanguages||[]).concat(iZe),(e.nestedAttributes||[]).concat(oZe)));let n=r?lZe.configure({wrap:r,dialect:t}):t?ON.configure({dialect:t}):ON;return new fS(n,[ON.data.of({autocomplete:aZe(e)}),e.autoCloseTags!==!1?uZe:[],J3().support,UGe().support])}const zke=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),uZe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!ON.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=R_(i.doc,y.parent,p))&&!zke.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=R_(i.doc,y,p))&&!zke.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)}),uWt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:uZe,html:cZe,htmlCompletionSource:sZe,htmlCompletionSourceWith:aZe,htmlLanguage:ON},Symbol.toStringTag,{value:"Module"})),dZe=UF({commentTokens:{block:{open:"<!--",close:"-->"}}}),fZe=new hn,hZe=zqt.configure({props:[u1.add(e=>!e.is("Block")||e.is("Document")||lse(e)!=null||dWt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),fZe.add(lse),c1.add({Document:()=>null}),zb.add({Document:dZe})]});function lse(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function dWt(e){return e.name=="OrderedList"||e.name=="BulletList"}function fWt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=lse(n.type))!=null&&s<=t)break;r=n}return r.to}const hWt=CWe.of((e,t,r)=>{for(let n=Ra(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(fZe);if(s==null)continue;let a=fWt(n,s);if(a>r)return{from:r,to:a}}return null});function Gue(e){return new Hd(dZe,e,[],"markdown")}const pZe=Gue(hZe),pWt=hZe.configure([Xqt,Jqt,Kqt,eHt,{props:[u1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),mS=Gue(pWt);function mWt(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:dS.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class OV{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(+gZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function mZe(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 OV(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 OV(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 OV(a.parent,c,c+d,i[1],u,f,a))}}return n}function gZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=gZe(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 Zue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(qE)!=" ")return e;let n=Cp(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const yZe=(e={})=>({state:t,dispatch:r})=>{let n=Ra(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!mS.isActiveAt(t,l.from,-1)&&!mS.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=mZe(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"&&kV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&kV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=Uke(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"&&kV(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?Cp(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=Zue(g,t),gWt(f.node,t.doc)&&(g=Uke(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)},vZe=yZe();function Bke(e){return e.name=="QuoteMark"||e.name=="ListMark"}function gWt(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 Uke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Cp(r.text,4,e[s+1].from)-n.length:null,s<a);return Zue(n,t)}function yWt(e,t){let r=e.resolveInner(t,-1),n=t;Bke(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Bke(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const bZe=({state:e,dispatch:t})=>{let r=Ra(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&mS.isActiveAt(e,a.from)){let c=l.lineAt(i),u=mZe(yWt(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(Cp(c.text,4,d.to)-Cp(c.text,4,d.from));return h==c.from&&(p=Zue(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)},xZe=[{key:"Enter",run:vZe},{key:"Backspace",run:bZe}],wZe=cZe({matchClosingTags:!1});function Yue(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=pZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=wZe}=e;if(!(s instanceof QF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,hWt],d;i&&u.push(SZe),r instanceof fS?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?mWt(t,d):void 0;c.push(Uqt({codeParser:f,htmlParser:l.language.parser})),n&&u.push($p.high(VE.of(xZe)));let h=Gue(s.configure(c));return a&&u.push(h.data.of({autocomplete:vWt})),new fS(h,u)}function vWt(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:bWt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let _V=null;function bWt(){if(_V)return _V;let e=sZe(new Eue(zn.create({extensions:wZe}),0,!0));return _V=e?e.options:[]}const xWt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,SZe=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),!mS.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||xWt.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)}}),wWt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:pZe,deleteMarkupBackward:bZe,insertNewlineContinueMarkup:vZe,insertNewlineContinueMarkupCommand:yZe,markdown:Yue,markdownKeymap:xZe,markdownLanguage:mS,pasteURLAsLink:SZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new fS(Oue.define(e))}function sb(e){return Ke(()=>import("./index-bthpR476.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const OZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-Vq29RmsE.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-Vq29RmsE.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return sb("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>vQt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-Cl6UcNDm.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(()=>uWt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-jCOd2fvg.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(()=>oD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-INehCGZv.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(()=>IVt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>oD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-DzcWqhqX.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-C0vFW9pj.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return sb("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>wWt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return sb("MSSQL")}}),Ye.of({name:"MySQL",load(){return sb("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-CepEt0G8.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return sb("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return sb("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-BFPbwhVc.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-Cbed1unS.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-m9rum56E.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-m9rum56E.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return sb("StandardSQL")}}),Ye.of({name:"SQLite",load(){return sb("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>oD),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(()=>oD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-Dm1OjAoS.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-CnUcrcRK.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-hyiexUSA.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-ceufQExa.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-BWtEmhy2.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function kx(){return kx=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},kx.apply(null,arguments)}var SWt=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=Fp.define(n),u=[l,Jx(c)];return u},OWt={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)"},kWt=[{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 SWt({theme:t,settings:kx({},OWt,r),styles:[...kWt,...n]})};QE();function Xue(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 _Wt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Jue(e.state,r.from);return n.line?EWt(e):n.block?jWt(e):!1};function Kue(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 EWt=Kue(AWt,0),CWt=Kue(kZe,0),jWt=Kue((e,t)=>kZe(e,t,NWt(t)),0);function Jue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Fj=50;function TWt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Fj,n),i=e.sliceDoc(s,s+Fj),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*Fj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Fj),f=e.sliceDoc(s-Fj,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 NWt(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 kZe(e,t,r=t.selection.ranges){let n=r.map(a=>Jue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>TWt(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 AWt(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=Jue(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 cse=bg.define(),IWt=bg.define(),RWt=Kt.define(),_Ze=Kt.define({combine(e){return xg(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)})}}),EZe=Oo.define({create(){return Mm.empty},update(e,t){let r=t.state.facet(_Ze),n=t.annotation(cse);if(n){let c=Bu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=e5(d,d.length,r.minDepth,c):d=TZe(d,t.startState.selection),new Mm(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(IWt);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=Bu.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 Mm(e.done.map(Bu.fromJSON),e.undone.map(Bu.fromJSON))}});function PWt(e={}){return[EZe,_Ze.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?CZe:t.inputType=="historyRedo"?use:null;return n?(t.preventDefault(),n(r)):!1}})]}function WF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(EZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const CZe=WF(0,!1),use=WF(1,!1),MWt=WF(0,!0),DWt=WF(1,!0);class Bu{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 Bu(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 Bu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Gm.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,r){let n=dh;for(let s of t.startState.facet(RWt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new Bu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,dh)}static selection(t){return new Bu(void 0,dh,void 0,void 0,t)}}function e5(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 LWt(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 $Wt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function jZe(e,t){return e.length?t.length?e.concat(t):e:t}const dh=[],FWt=200;function TZe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-FWt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),e5(e,e.length-1,1e9,r.setSelAfter(n)))}else return[Bu.selection([t])]}function zWt(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 EV(e,t){if(!e.length)return e;let r=e.length,n=dh;for(;r;){let s=BWt(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?[Bu.selection(n)]:dh}function BWt(e,t,r){let n=jZe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):dh,r);if(!e.changes)return Bu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Bu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const UWt=/^(input\.type|delete)($|\.)/;class Mm{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 Mm(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||UWt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,LWt(l.changes,t.changes))||n=="input.type.compose")?i=e5(i,i.length-1,s.minDepth,new Bu(t.changes.compose(l.changes),jZe(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,dh)):i=e5(i,i.length,s.minDepth,t),new Mm(i,dh,r,n)}addSelection(t,r,n,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:dh;return a.length>0&&r-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&$Wt(a[a.length-1],t)?this:new Mm(TZe(this.done,t),this.undone,r,n)}addMapping(t){return new Mm(EV(this.done,t),EV(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:cse.of({side:t,rest:zWt(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?dh:s.slice(0,s.length-1);return a.mapped&&(l=EV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:cse.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Mm.empty=new Mm(dh,dh);const VWt=[{key:"Mod-z",run:CZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:use,preventDefault:!0},{linux:"Ctrl-Shift-z",run:use,preventDefault:!0},{key:"Mod-u",run:MWt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:DWt,preventDefault:!0}];function WE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function zp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Bp({state:e,dispatch:t},r){let n=WE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(zp(e,n)),!0)}function GF(e,t){return nt.cursor(t?e.to:e.from)}function NZe(e,t){return Bp(e,r=>r.empty?e.moveByChar(r,t):GF(r,t))}function Cc(e){return e.textDirectionAt(e.state.selection.main.head)==$a.LTR}const AZe=e=>NZe(e,!Cc(e)),IZe=e=>NZe(e,Cc(e));function RZe(e,t){return Bp(e,r=>r.empty?e.moveByGroup(r,t):GF(r,t))}const qWt=e=>RZe(e,!Cc(e)),HWt=e=>RZe(e,Cc(e));function QWt(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 ZF(e,t,r){let n=Ra(e).resolveInner(t.head),s=r?hn.closedBy:hn.openedBy;for(let c=t.head;;){let u=r?n.childAfter(c):n.childBefore(c);if(!u)break;QWt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Pm(e,n.from,1):Pm(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 WWt=e=>Bp(e,t=>ZF(e.state,t,!Cc(e))),GWt=e=>Bp(e,t=>ZF(e.state,t,Cc(e)));function PZe(e,t){return Bp(e,r=>{if(!r.empty)return GF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const MZe=e=>PZe(e,!1),DZe=e=>PZe(e,!0);function LZe(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 $Ze(e,t){let r=LZe(e),{state:n}=e,s=WE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):GF(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(zp(n,s),{effects:a}),!0}const Vke=e=>$Ze(e,!1),dse=e=>$Ze(e,!0);function e0(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 ZWt=e=>Bp(e,t=>e0(e,t,!0)),YWt=e=>Bp(e,t=>e0(e,t,!1)),XWt=e=>Bp(e,t=>e0(e,t,!Cc(e))),KWt=e=>Bp(e,t=>e0(e,t,Cc(e))),JWt=e=>Bp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),eGt=e=>Bp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function tGt(e,t,r){let n=!1,s=WE(e.selection,a=>{let i=Pm(e,a.head,-1)||Pm(e,a.head,1)||a.head>0&&Pm(e,a.head-1,1)||a.head<e.doc.length&&Pm(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(zp(e,s)),!0):!1}const rGt=({state:e,dispatch:t})=>tGt(e,t);function Fh(e,t){let r=WE(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(zp(e.state,r)),!0)}function FZe(e,t){return Fh(e,r=>e.moveByChar(r,t))}const zZe=e=>FZe(e,!Cc(e)),BZe=e=>FZe(e,Cc(e));function UZe(e,t){return Fh(e,r=>e.moveByGroup(r,t))}const nGt=e=>UZe(e,!Cc(e)),sGt=e=>UZe(e,Cc(e)),aGt=e=>Fh(e,t=>ZF(e.state,t,!Cc(e))),iGt=e=>Fh(e,t=>ZF(e.state,t,Cc(e)));function VZe(e,t){return Fh(e,r=>e.moveVertically(r,t))}const qZe=e=>VZe(e,!1),HZe=e=>VZe(e,!0);function QZe(e,t){return Fh(e,r=>e.moveVertically(r,t,LZe(e).height))}const qke=e=>QZe(e,!1),Hke=e=>QZe(e,!0),oGt=e=>Fh(e,t=>e0(e,t,!0)),lGt=e=>Fh(e,t=>e0(e,t,!1)),cGt=e=>Fh(e,t=>e0(e,t,!Cc(e))),uGt=e=>Fh(e,t=>e0(e,t,Cc(e))),dGt=e=>Fh(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),fGt=e=>Fh(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),Qke=({state:e,dispatch:t})=>(t(zp(e,{anchor:0})),!0),Wke=({state:e,dispatch:t})=>(t(zp(e,{anchor:e.doc.length})),!0),Gke=({state:e,dispatch:t})=>(t(zp(e,{anchor:e.selection.main.anchor,head:0})),!0),Zke=({state:e,dispatch:t})=>(t(zp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),hGt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),pGt=({state:e,dispatch:t})=>{let r=YF(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},mGt=({state:e,dispatch:t})=>{let r=WE(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(zp(e,r)),!0)};function WZe(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(zp(r,nt.create(s,s.length-1))),!0)}const gGt=e=>WZe(e,!1),yGt=e=>WZe(e,!0),vGt=({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(zp(e,n)),!0):!1};function GR(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=lD(e,c,!1)):c>i&&(r="delete.forward",c=lD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=lD(e,i,!1),l=lD(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 lD(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 GZe=(e,t,r)=>GR(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=Cp(l,a.tabSize),d=u%hS(a)||hS(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=xl(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=xl(i.text,c-i.from,!1,!1)+i.from);return c}),fse=e=>GZe(e,!1,!0),ZZe=e=>GZe(e,!0,!1),YZe=(e,t)=>GR(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=xl(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}),XZe=e=>YZe(e,!1),bGt=e=>YZe(e,!0),xGt=e=>GR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),wGt=e=>GR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),SGt=e=>GR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),OGt=({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},kGt=({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:xl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:xl(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 YF(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 KZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of YF(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 _Gt=({state:e,dispatch:t})=>KZe(e,t,!1),EGt=({state:e,dispatch:t})=>KZe(e,t,!0);function JZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of YF(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 CGt=({state:e,dispatch:t})=>JZe(e,t,!1),jGt=({state:e,dispatch:t})=>JZe(e,t,!0),TGt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(YF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=WE(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 NGt(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(hn.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 Yke=eYe(!1),AGt=eYe(!0);function eYe(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&&NGt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new VF(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=xue(u,a);for(d==null&&(d=Cp(/^\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=["",kA(t,d)];return c&&f.push(kA(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 ede(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 IGt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new VF(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=ede(e,(a,i,l)=>{let c=xue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=kA(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},tYe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ede(e,(r,n)=>{n.push({from:r.from,insert:e.facet(qE)})}),{userEvent:"input.indent"})),!0),rYe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ede(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Cp(s,e.tabSize),i=0,l=kA(e,Math.max(0,a-hS(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),RGt=e=>(e.setTabFocusMode(),!0),PGt=[{key:"Ctrl-b",run:AZe,shift:zZe,preventDefault:!0},{key:"Ctrl-f",run:IZe,shift:BZe},{key:"Ctrl-p",run:MZe,shift:qZe},{key:"Ctrl-n",run:DZe,shift:HZe},{key:"Ctrl-a",run:JWt,shift:dGt},{key:"Ctrl-e",run:eGt,shift:fGt},{key:"Ctrl-d",run:ZZe},{key:"Ctrl-h",run:fse},{key:"Ctrl-k",run:xGt},{key:"Ctrl-Alt-h",run:XZe},{key:"Ctrl-o",run:OGt},{key:"Ctrl-t",run:kGt},{key:"Ctrl-v",run:dse}],MGt=[{key:"ArrowLeft",run:AZe,shift:zZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:qWt,shift:nGt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:XWt,shift:cGt,preventDefault:!0},{key:"ArrowRight",run:IZe,shift:BZe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:HWt,shift:sGt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:KWt,shift:uGt,preventDefault:!0},{key:"ArrowUp",run:MZe,shift:qZe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Qke,shift:Gke},{mac:"Ctrl-ArrowUp",run:Vke,shift:qke},{key:"ArrowDown",run:DZe,shift:HZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Wke,shift:Zke},{mac:"Ctrl-ArrowDown",run:dse,shift:Hke},{key:"PageUp",run:Vke,shift:qke},{key:"PageDown",run:dse,shift:Hke},{key:"Home",run:YWt,shift:lGt,preventDefault:!0},{key:"Mod-Home",run:Qke,shift:Gke},{key:"End",run:ZWt,shift:oGt,preventDefault:!0},{key:"Mod-End",run:Wke,shift:Zke},{key:"Enter",run:Yke,shift:Yke},{key:"Mod-a",run:hGt},{key:"Backspace",run:fse,shift:fse,preventDefault:!0},{key:"Delete",run:ZZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:XZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:bGt,preventDefault:!0},{mac:"Mod-Backspace",run:wGt,preventDefault:!0},{mac:"Mod-Delete",run:SGt,preventDefault:!0}].concat(PGt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),DGt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:WWt,shift:aGt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:GWt,shift:iGt},{key:"Alt-ArrowUp",run:_Gt},{key:"Shift-Alt-ArrowUp",run:CGt},{key:"Alt-ArrowDown",run:EGt},{key:"Shift-Alt-ArrowDown",run:jGt},{key:"Mod-Alt-ArrowUp",run:gGt},{key:"Mod-Alt-ArrowDown",run:yGt},{key:"Escape",run:vGt},{key:"Mod-Enter",run:AGt},{key:"Alt-l",mac:"Ctrl-l",run:pGt},{key:"Mod-i",run:mGt,preventDefault:!0},{key:"Mod-[",run:rYe},{key:"Mod-]",run:tYe},{key:"Mod-Alt-\\",run:IGt},{key:"Shift-Mod-k",run:TGt},{key:"Shift-Mod-\\",run:rGt},{key:"Mod-/",run:_Wt},{key:"Alt-A",run:CWt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:RGt}].concat(MGt),LGt={key:"Tab",run:tYe,shift:rYe},Xke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Gy{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(Xke(l)):Xke,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 Pu(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=tue(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=Om(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"&&(Gy.prototype[Symbol.iterator]=function(){return this});const nYe={from:-1,to:-1,match:/.*/.exec("")},tde="gm"+(/x/.unicode==null?"":"u");class sYe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=nYe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new aYe(t,r,n,s,a);this.re=new RegExp(r,tde+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=t5(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=t5(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 CV=new WeakMap;class Hk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=CV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Hk(r,t.sliceString(r,n));return CV.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)),CV.set(t,new Hk(i,a)),new Hk(r,a.slice(r-i,n-i))}}class aYe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=nYe,this.matchPos=t5(t,s),this.re=new RegExp(r,tde+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Hk.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=t5(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Hk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(sYe.prototype[Symbol.iterator]=aYe.prototype[Symbol.iterator]=function(){return this});function $Gt(e){try{return new RegExp(e,tde),!0}catch{return!1}}function t5(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 FGt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=_Ut(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},zGt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},BGt=Kt.define({combine(e){return xg(e,zGt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function UGt(e){return[WGt,QGt]}const VGt=er.mark({class:"cm-selectionMatch"}),qGt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Kke(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 HGt(e,t,r,n){return e(t.sliceDoc(r,r+1))==xi.Word&&e(t.sliceDoc(n-1,n))==xi.Word}const QGt=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(BGt),{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),!(Kke(i,r,s.from,s.to)&&HGt(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 Gy(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Kke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(qGt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(VGt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),WGt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),GGt=({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 ZGt(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 Gy(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new Gy(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 YGt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return GGt({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=ZGt(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},GE=Kt.define({combine(e){return xg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new uZt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class iYe{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||$Gt(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 rZt(this):new JGt(this)}getCursor(t,r=0,n){let s=t.doc?t:zn.create({doc:t});return n==null&&(n=s.doc.length),this.regexp?HO(this,s,r,n):qO(this,s,r,n)}}class oYe{constructor(t){this.spec=t}}function XGt(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 qO(e,t,r,n){let s;return e.wholeWord&&(s=KGt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(s=XGt(e.test,t,s)),new Gy(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:a=>a.toLowerCase(),s)}function KGt(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(r5(s,r-a))!=xi.Word||t(n5(s,r-a))!=xi.Word)&&(t(n5(s,n-a))!=xi.Word||t(r5(s,n-a))!=xi.Word))}class JGt extends oYe{constructor(t){super(t)}nextMatch(t,r,n){let s=qO(this.spec,t,n,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,r+this.spec.unquoted.length);s=qO(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=qO(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=qO(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=qO(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 eZt(e,t,r){return(n,s,a)=>(!r||r(n,s,a))&&e(a[0],t,n,s)}function HO(e,t,r,n){let s;return e.wholeWord&&(s=tZt(t.charCategorizer(t.selection.main.head))),e.test&&(s=eZt(e.test,t,s)),new sYe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},r,n)}function r5(e,t){return e.slice(xl(e,t,!1),t)}function n5(e,t){return e.slice(t,xl(e,t))}function tZt(e){return(t,r,n)=>!n[0].length||(e(r5(n.input,n.index))!=xi.Word||e(n5(n.input,n.index))!=xi.Word)&&(e(n5(n.input,n.index+n[0].length))!=xi.Word||e(r5(n.input,n.index+n[0].length))!=xi.Word)}class rZt extends oYe{nextMatch(t,r,n){let s=HO(this.spec,t,n,t.doc.length).next();return s.done&&(s=HO(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=HO(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=HO(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=HO(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 PA=rn.define(),rde=rn.define(),Qb=Oo.define({create(e){return new jV(hse(e).create(),null)},update(e,t){for(let r of t.effects)r.is(PA)?e=new jV(r.value.create(),e.panel):r.is(rde)&&(e=new jV(e.query,r.value?nde:null));return e},provide:e=>OA.from(e,t=>t.panel)});class jV{constructor(t,r){this.query=t,this.panel=r}}const nZt=er.mark({class:"cm-searchMatch"}),sZt=er.mark({class:"cm-searchMatch cm-searchMatch-selected"}),aZt=Oi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Qb))}update(e){let t=e.state.field(Qb);(t!=e.startState.field(Qb)||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 ou;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?sZt:nZt)})}return n.finish()}},{decorations:e=>e.decorations});function ZR(e){return t=>{let r=t.state.field(Qb,!1);return r&&r.query.spec.valid?e(t,r):uYe(t)}}const s5=ZR((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(GE);return e.dispatch({selection:s,effects:[sde(e,n),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),cYe(e),!0}),a5=ZR((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(GE);return e.dispatch({selection:a,effects:[sde(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),cYe(e),!0}),iZt=ZR((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)}),oZt=({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 Gy(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},Jke=ZR((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(sde(e,i)),d.push(r.facet(GE).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),lZt=ZR((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 nde(e){return e.state.facet(GE).createPanel(e)}function hse(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(GE);return new iYe({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 lYe(e){let t=vue(e,nde);return t&&t.dom.querySelector("[main-field]")}function cYe(e){let t=lYe(e);t&&t==e.root.activeElement&&t.select()}const uYe=e=>{let t=e.state.field(Qb,!1);if(t&&t.panel){let r=lYe(e);if(r&&r!=e.root.activeElement){let n=hse(e.state,t.query.spec);n.valid&&e.dispatch({effects:PA.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[rde.of(!0),t?PA.of(hse(e.state,t.query.spec)):rn.appendConfig.of(fZt)]});return!0},dYe=e=>{let t=e.state.field(Qb,!1);if(!t||!t.panel)return!1;let r=vue(e,nde);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:rde.of(!1)}),!0},cZt=[{key:"Mod-f",run:uYe,scope:"editor search-panel"},{key:"F3",run:s5,shift:a5,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:s5,shift:a5,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:dYe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:oZt},{key:"Mod-Alt-g",run:FGt},{key:"Mod-d",run:YGt,preventDefault:!0}];class uZt{constructor(t){this.view=t;let r=this.query=t.state.field(Qb).query.spec;this.commit=this.commit.bind(this),this.searchField=Ca("input",{value:r.search,placeholder:kd(t,"Find"),"aria-label":kd(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:kd(t,"Replace"),"aria-label":kd(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",()=>s5(t),[kd(t,"next")]),n("prev",()=>a5(t),[kd(t,"previous")]),n("select",()=>iZt(t),[kd(t,"all")]),Ca("label",null,[this.caseField,kd(t,"match case")]),Ca("label",null,[this.reField,kd(t,"regexp")]),Ca("label",null,[this.wordField,kd(t,"by word")]),...t.state.readOnly?[]:[Ca("br"),this.replaceField,n("replace",()=>Jke(t),[kd(t,"replace")]),n("replaceAll",()=>lZt(t),[kd(t,"replace all")])],Ca("button",{name:"close",onclick:()=>dYe(t),"aria-label":kd(t,"close"),type:"button"},["×"])])}commit(){let t=new iYe({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:PA.of(t)}))}keydown(t){D7t(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?a5:s5)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Jke(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(PA)&&!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(GE).top}}function kd(e,t){return e.state.phrase(t)}const cD=30,uD=/[\s\.,:;?!]/;function sde(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-cD),i=Math.min(s,r+cD),l=e.state.sliceDoc(a,i);if(a!=n.from){for(let c=0;c<cD;c++)if(!uD.test(l[c+1])&&uD.test(l[c])){l=l.slice(c);break}}if(i!=s){for(let c=l.length-1;c>l.length-cD;c--)if(!uD.test(l[c-1])&&uD.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 dZt=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"}}),fZt=[Qb,$p.low(aZt),dZt];class e_e{constructor(t,r,n){this.from=t,this.to=r,this.diagnostic=n}}class vw{constructor(t,r,n){this.diagnostics=t,this.panel=r,this.selected=n}static init(t,r,n){let s=n.facet(MA).markerFilter;s&&(t=s(t,n));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new ou,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=_Zt(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 wZt(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 vw(u,r,M_(u))}}function M_(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 e_e(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new e_e(n.from,a,n.diagnostic)}}),n}function hZt(e,t){let r=t.pos,n=t.end||r,s=e.state.facet(MA).hideOn(e,r,n);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(fYe))||e.changes.touchesRange(a.from,Math.max(a.to,n)))}function pZt(e,t){return e.field(Qd,!1)?t:t.concat(rn.appendConfig.of(EZt))}const fYe=rn.define(),ade=rn.define(),hYe=rn.define(),Qd=Oo.define({create(){return new vw(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=M_(r,e.selected.diagnostic,a)||M_(r,null,a)}!r.size&&s&&t.state.facet(MA).autoPanel&&(s=null),e=new vw(r,s,n)}for(let r of t.effects)if(r.is(fYe)){let n=t.state.facet(MA).autoPanel?r.value.length?DA.open:null:e.panel;e=vw.init(r.value,n,t.state)}else r.is(ade)?e=new vw(e.diagnostics,r.value?DA.open:null,e.selected):r.is(hYe)&&(e=new vw(e.diagnostics,e.panel,r.value));return e},provide:e=>[OA.from(e,t=>t.panel),ft.decorations.from(e,t=>t.diagnostics)]}),mZt=er.mark({class:"cm-lintRange cm-lintRange-active"});function gZt(e,t,r){let{diagnostics:n}=e.state.field(Qd),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(MA).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:yZt(e,s)}}}:null}function yZt(e,t){return Ca("ul",{class:"cm-tooltip-lint"},t.map(r=>mYe(e,r,!1)))}const vZt=e=>{let t=e.state.field(Qd,!1);(!t||!t.panel)&&e.dispatch({effects:pZt(e.state,[ade.of(!0)])});let r=vue(e,DA.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},t_e=e=>{let t=e.state.field(Qd,!1);return!t||!t.panel?!1:(e.dispatch({effects:ade.of(!1)}),!0)},bZt=e=>{let t=e.state.field(Qd,!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)},xZt=[{key:"Mod-Shift-m",run:vZt,preventDefault:!0},{key:"F8",run:bZt}],MA=Kt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...xg(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:r_e,tooltipFilter:r_e,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 r_e(e,t){return e?t?(r,n)=>t(e(r,n),n):e:t}function pYe(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 mYe(e,t,r){var n;let s=r?pYe(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=M_(e.state.field(Qd).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 wZt extends kf{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 n_e{constructor(t,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=mYe(t,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class DA{constructor(t){this.view=t,this.items=[];let r=s=>{if(s.keyCode==27)t_e(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=pYe(a.actions);for(let l=0;l<i.length;l++)if(i[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=M_(this.view.state.field(Qd).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:()=>t_e(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Qd).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(Qd),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 n_e(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 n_e(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(Qd),n=M_(r.diagnostics,this.items[t].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:hYe.of(n)})}static open(t){return new DA(t)}}function SZt(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 dD(e){return SZt(`<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 OZt=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:dD("#d11")},".cm-lintRange-warning":{backgroundImage:dD("orange")},".cm-lintRange-info":{backgroundImage:dD("#999")},".cm-lintRange-hint":{backgroundImage:dD("#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 kZt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function _Zt(e){let t="hint",r=1;for(let n of e){let s=kZt(n.severity);s>r&&(r=s,t=n.severity)}return t}const EZt=[Qd,ft.decorations.compute([Qd],e=>{let{selected:t,panel:r}=e.field(Qd);return!t||!r||t.from==t.to?er.none:er.set([mZt.range(t.from,t.to)])}),OUt(gZt,{hideOn:hZt}),OZt];var s_e=function(t){t===void 0&&(t={});var{crosshairCursor:r=!1}=t,n=[];t.closeBracketsKeymap!==!1&&(n=n.concat(xqt)),t.defaultKeymap!==!1&&(n=n.concat(DGt)),t.searchKeymap!==!1&&(n=n.concat(cZt)),t.historyKeymap!==!1&&(n=n.concat(VWt)),t.foldKeymap!==!1&&(n=n.concat(aVt)),t.completionKeymap!==!1&&(n=n.concat(rGe)),t.lintKeymap!==!1&&(n=n.concat(xZt));var s=[];return t.lineNumbers!==!1&&s.push(MUt()),t.highlightActiveLineGutter!==!1&&s.push($Ut()),t.highlightSpecialChars!==!1&&s.push(K7t()),t.history!==!1&&s.push(PWt()),t.foldGutter!==!1&&s.push(cVt()),t.drawSelection!==!1&&s.push(U7t()),t.dropCursor!==!1&&s.push(W7t()),t.allowMultipleSelections!==!1&&s.push(zn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(XUt()),t.syntaxHighlighting!==!1&&s.push(Jx(hVt,{fallback:!0})),t.bracketMatching!==!1&&s.push(xVt()),t.closeBrackets!==!1&&s.push(gqt()),t.autocompletion!==!1&&s.push(tGe()),t.rectangularSelection!==!1&&s.push(fUt()),r!==!1&&s.push(mUt()),t.highlightActiveLine!==!1&&s.push(sUt()),t.highlightSelectionMatches!==!1&&s.push(UGt()),t.tabSize&&typeof t.tabSize=="number"&&s.push(qE.of(" ".repeat(t.tabSize))),s.concat([VE.of(n.flat())]).filter(Boolean)};const CZt="#e5c07b",a_e="#e06c75",jZt="#56b6c2",TZt="#ffffff",m$="#abb2bf",pse="#7d8799",NZt="#61afef",AZt="#98c379",i_e="#d19a66",IZt="#c678dd",RZt="#21252b",o_e="#2c313a",l_e="#282c34",TV="#353a42",PZt="#3E4451",c_e="#528bff",MZt=ft.theme({"&":{color:m$,backgroundColor:l_e},".cm-content":{caretColor:c_e},".cm-cursor, .cm-dropCursor":{borderLeftColor:c_e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:PZt},".cm-panels":{backgroundColor:RZt,color:m$},".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:l_e,color:pse,border:"none"},".cm-activeLineGutter":{backgroundColor:o_e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:TV},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:TV,borderBottomColor:TV},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:o_e,color:m$}}},{dark:!0}),DZt=Fp.define([{tag:ne.keyword,color:IZt},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:a_e},{tag:[ne.function(ne.variableName),ne.labelName],color:NZt},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:i_e},{tag:[ne.definition(ne.name),ne.separator],color:m$},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:CZt},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:jZt},{tag:[ne.meta,ne.comment],color:pse},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:pse,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:a_e},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:i_e},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:AZt},{tag:ne.invalid,color:TZt}]),LZt=[MZt,Jx(DZt)];var $Zt=ft.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),FZt=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(VE.of([LGt])),l&&(typeof l=="boolean"?c.unshift(s_e()):c.unshift(s_e(l))),i&&c.unshift(lUt(i)),a){case"light":c.push($Zt);break;case"dark":c.push(LZt);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]},zZt=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 BZt{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 u_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 NV=null,UZt=()=>typeof window>"u"?new u_e:(NV||(NV=new u_e),NV),d_e=bg.define(),VZt=200,qZt=[];function HZt(e){var{value:t,selection:r,onChange:n,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:l=qZt,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(d_e))){B.current?B.current.reset():(B.current=new BZt(()=>{if(D.current){var V=D.current;D.current=null,V()}B.current=null},VZt),UZt().add(B.current));var L=Q.state.doc,Z=L.toString();n(Z,Q)}s&&s(zZt(Q))}),z=FZt({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:[d_e.of(!0)]})};L?D.current=Z:Z()}}},[t,N]),{state:P,setState:R,view:N,setView:I,container:T,setContainer:j}}var QZt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],wc=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=Xue(e,QZt),I=b.useRef(null),{state:P,view:R,container:B,setContainer:D}=HZt({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",kx({ref:$,className:""+U+(r?" "+r:"")},N))});wc.displayName="CodeMirror";function WZt(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 GZt=e=>{switch(e){case"success":return XZt;case"info":return JZt;case"warning":return KZt;case"error":return eYt;default:return null}},ZZt=Array(12).fill(0),YZt=({visible:e,className:t})=>je.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},je.createElement("div",{className:"sonner-spinner"},ZZt.map((r,n)=>je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),XZt=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"})),KZt=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"})),JZt=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"})),eYt=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"})),tYt=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"})),rYt=()=>{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 mse=1;class nYt{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:mse++,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(aYt(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||mse++;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 Nu=new nYt,sYt=(e,t)=>{const r=t?.id||mse++;return Nu.addToast({title:e,...t,id:r}),r},aYt=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",iYt=sYt,oYt=()=>Nu.toasts,lYt=()=>Nu.getActiveToasts(),vc=Object.assign(iYt,{success:Nu.success,info:Nu.info,warning:Nu.warning,error:Nu.error,custom:Nu.custom,message:Nu.message,promise:Nu.promise,dismiss:Nu.dismiss,loading:Nu.loading},{getHistory:oYt,getToasts:lYt});WZt("[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 fD(e){return e.label!==void 0}const cYt=3,uYt="24px",dYt="16px",f_e=4e3,fYt=356,hYt=14,pYt=45,mYt=200;function am(...e){return e.filter(Boolean).join(" ")}function gYt(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const yYt=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),[fe,X]=je.useState(!1),[se,le]=je.useState(0),[xe,ue]=je.useState(0),ce=je.useRef(f.duration||R||f_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||f_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=rYt(),Le=f.invert||d,Re=oe==="loading";Fe.current=je.useMemo(()=>ye*D+qe,[ye,qe]),je.useEffect(()=>{ce.current=ge},[ge]),je.useEffect(()=>{W(!0)},[]),je.useEffect(()=>{const tt=we.current;if(tt){const Jt=tt.getBoundingClientRect().height;return ue(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,ue(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)},mYt)},[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;ce.current=ce.current-ir}ct.current=new Date().getTime()})():ce.current!==1/0&&(Ee.current=new Date().getTime(),tt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),it()},ce.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:am(U?.loader,f==null||(Jt=f.classNames)==null?void 0:Jt.loader,"sonner-loader"),"data-visible":oe==="loading"},z.loading)}return je.createElement(YZt,{className:am(U?.loader,f==null||(tt=f.classNames)==null?void 0:tt.loader),visible:oe==="loading"})}const ht=f.icon||z?.[oe]||GZt(oe);var Ut,$r;return je.createElement("li",{tabIndex:0,ref:we,className:am(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":fe,"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,xn=Math.abs(It)/Ur;if(Math.abs(It)>=pYt||xn>.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 xn;const Er=(xn=e.swipeDirections)!=null?xn:gYt(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:am(U?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},($r=z?.close)!=null?$r:tYt):null,(oe||f.icon||f.promise)&&f.icon!==null&&(z?.[oe]!==null||f.icon)?je.createElement("div",{"data-icon":"",className:am(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:am(U?.content,f==null||(a=f.classNames)==null?void 0:a.content)},je.createElement("div",{"data-title":"",className:am(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:am(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&&fD(f.cancel)?je.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:tt=>{fD(f.cancel)&&be&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,tt),it())},className:am(U?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,je.isValidElement(f.action)?f.action:f.action&&fD(f.action)?je.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||N,onClick:tt=>{fD(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,tt),!tt.defaultPrevented&&it())},className:am(U?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function h_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 vYt(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?dYt:uYt;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 gYe=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=cYt,toastOptions:x,dir:w=h_e(),gap:S=hYt,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||Nu.dismiss(M.id),W.filter(({id:J})=>J!==M.id)})},[]);return je.useEffect(()=>Nu.subscribe(M=>{if(M.dismiss){requestAnimationFrame(()=>{T(W=>W.map(G=>G.id===M.id?{...G,delete:!0}:G))});return}setTimeout(()=>{vce.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"?h_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":`${fYt}px`,"--gap":`${S}px`,...g,...vYt(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,fe;return je.createElement(yYt,{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:(fe=x?.closeButton)!=null?fe: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 AV="focusScope.autoFocusOnMount",IV="focusScope.autoFocusOnUnmount",p_e={bubbles:!1,cancelable:!0},bYt="FocusScope",YR=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:gb(f.current,{select:!0})},y=function(S){if(p.paused||!l)return;const k=S.relatedTarget;k!==null&&(l.contains(k)||gb(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const _ of S)_.removedNodes.length>0&&gb(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){g_e.add(p);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(AV,p_e);l.addEventListener(AV,u),l.dispatchEvent(x),x.defaultPrevented||(xYt(_Yt(yYe(l)),{select:!0}),document.activeElement===g&&gb(l))}return()=>{l.removeEventListener(AV,u),setTimeout(()=>{const x=new CustomEvent(IV,p_e);l.addEventListener(IV,d),l.dispatchEvent(x),x.defaultPrevented||gb(g??document.body,{select:!0}),l.removeEventListener(IV,d),g_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]=wYt(w);S&&k?!g.shiftKey&&x===k?(g.preventDefault(),r&&gb(S,{select:!0})):g.shiftKey&&x===S&&(g.preventDefault(),r&&gb(k,{select:!0})):x===w&&g.preventDefault()}},[r,n,p.paused]);return o.jsx(wr.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});YR.displayName=bYt;function xYt(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(gb(n,{select:t}),document.activeElement!==r)return}function wYt(e){const t=yYe(e),r=m_e(t,e),n=m_e(t.reverse(),e);return[r,n]}function yYe(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 m_e(e,t){for(const r of e)if(!SYt(r,{upTo:t}))return r}function SYt(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 OYt(e){return e instanceof HTMLInputElement&&"select"in e}function gb(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&OYt(e)&&t&&e.select()}}var g_e=kYt();function kYt(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=y_e(e,t),e.unshift(t)},remove(t){e=y_e(e,t),e[0]?.resume()}}}function y_e(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function _Yt(e){return e.filter(t=>t.tagName!=="A")}var RV=0;function XF(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??v_e()),document.body.insertAdjacentElement("beforeend",e[1]??v_e()),RV++,()=>{RV===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),RV--}},[])}function v_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 _m=function(){return _m=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},_m.apply(this,arguments)};function vYe(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 EYt(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 g$="right-scroll-bar-position",y$="width-before-scroll-bar",CYt="with-scroll-bars-hidden",jYt="--removed-body-scroll-bar-size";function PV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function TYt(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 NYt=typeof window<"u"?b.useLayoutEffect:b.useEffect,b_e=new WeakMap;function AYt(e,t){var r=TYt(null,function(n){return e.forEach(function(s){return PV(s,n)})});return NYt(function(){var n=b_e.get(r);if(n){var s=new Set(n),a=new Set(e),i=r.current;s.forEach(function(l){a.has(l)||PV(l,null)}),a.forEach(function(l){s.has(l)||PV(l,i)})}b_e.set(r,e)},[e]),r}function IYt(e){return e}function RYt(e,t){t===void 0&&(t=IYt);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 PYt(e){e===void 0&&(e={});var t=RYt(null);return t.options=_m({async:!0,ssr:!1},e),t}var bYe=function(e){var t=e.sideCar,r=vYe(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,_m({},r))};bYe.isSideCarExport=!0;function MYt(e,t){return e.useMedium(t),bYe}var xYe=PYt(),MV=function(){},KF=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:MV,onWheelCapture:MV,onTouchMoveCapture:MV}),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=vYe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,E=AYt([r,t]),T=_m(_m({},k),s);return b.createElement(b.Fragment,null,d&&b.createElement(_,{sideCar:xYe,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),_m(_m({},T),{ref:E})):b.createElement(w,_m({},T,{className:c,ref:E}),l))});KF.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};KF.classNames={fullWidth:y$,zeroRight:g$};var DYt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function LYt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DYt();return t&&e.setAttribute("nonce",t),e}function $Yt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function FYt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zYt=function(){var e=0,t=null;return{add:function(r){e==0&&(t=LYt())&&($Yt(t,r),FYt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},BYt=function(){var e=zYt();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},wYe=function(){var e=BYt(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},UYt={left:0,top:0,right:0,gap:0},DV=function(e){return parseInt(e||"",10)||0},VYt=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[DV(r),DV(n),DV(s)]},qYt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return UYt;var t=VYt(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])}},HYt=wYe(),Qk="data-scroll-locked",QYt=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(CYt,` {
|
|
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(cNe||(cNe=Cw(["L",",","Z"])),t,r);return w},vOr={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},kit=e=>{var t=od(e,vOr),{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=xa("recharts-sector",f),p=a-s,m=Cx(i,p,0,!0),g;return m>0&&Math.abs(u-d)<360?g=yOr({cx:r,cy:n,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=Oit({cx:r,cy:n,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d}),b.createElement("path",Lae({},lu(t),{className:h,d:g}))};function bOr(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(lat(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:a,outerRadius:i,angle:l}=t,c=Hl(n,s,a,l),u=Hl(n,s,i,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return Sit(t)}}var $H={},FH={},zH={},uNe;function xOr(){return uNe||(uNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vat();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(zH)),zH}var dNe;function wOr(){return dNe||(dNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xOr();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})(FH)),FH}var fNe;function SOr(){return fNe||(fNe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bat(),r=wOr();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})($H)),$H}var BH,hNe;function OOr(){return hNe||(hNe=1,BH=SOr().range),BH}var kOr=OOr();const _it=Uo(kOr);var o0=e=>e.chartData,_Or=Xe([o0],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Ihe=(e,t,r,n)=>n?_Or(e):o0(e);function Zm(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(zs(t)&&zs(r))return!0}return!1}function pNe(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function Eit(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(Zm(i))return i}}function EOr(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Zm(n))return pNe(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"&&cTe.test(s)){var c=cTe.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"&&uTe.test(a)){var d=uTe.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(Zm(h))return t==null?h:pNe(h,t,r)}}}var sC=1e9,COr={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Phe,wi=!0,Th="[DecimalError] ",Hw=Th+"Invalid argument: ",Rhe=Th+"Exponent out of range: ",aC=Math.floor,cw=Math.pow,jOr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ud,fl=1e7,ci=7,Cit=9007199254740991,c4=aC(Cit/ci),fr={};fr.absoluteValue=fr.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};fr.comparedTo=fr.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};fr.decimalPlaces=fr.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ci;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};fr.dividedBy=fr.div=function(e){return $y(this,new this.constructor(e))};fr.dividedToIntegerBy=fr.idiv=function(e){var t=this,r=t.constructor;return Fa($y(t,new r(e),0,1),r.precision)};fr.equals=fr.eq=function(e){return!this.cmp(e)};fr.exponent=function(){return Lo(this)};fr.greaterThan=fr.gt=function(e){return this.cmp(e)>0};fr.greaterThanOrEqualTo=fr.gte=function(e){return this.cmp(e)>=0};fr.isInteger=fr.isint=function(){return this.e>this.d.length-2};fr.isNegative=fr.isneg=function(){return this.s<0};fr.isPositive=fr.ispos=function(){return this.s>0};fr.isZero=function(){return this.s===0};fr.lessThan=fr.lt=function(e){return this.cmp(e)<0};fr.lessThanOrEqualTo=fr.lte=function(e){return this.cmp(e)<1};fr.logarithm=fr.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(Ud))throw Error(Th+"NaN");if(r.s<1)throw Error(Th+(r.s?"NaN":"-Infinity"));return r.eq(Ud)?new n(0):(wi=!1,t=$y(aI(r,a),aI(e,a),a),wi=!0,Fa(t,s))};fr.minus=fr.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Nit(t,e):jit(t,(e.s=-e.s,e))};fr.modulo=fr.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(Th+"NaN");return r.s?(wi=!1,t=$y(r,e,0,1).times(e),wi=!0,r.minus(t)):Fa(new n(r),s)};fr.naturalExponential=fr.exp=function(){return Tit(this)};fr.naturalLogarithm=fr.ln=function(){return aI(this)};fr.negated=fr.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};fr.plus=fr.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?jit(t,e):Nit(t,(e.s=-e.s,e))};fr.precision=fr.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Hw+e);if(t=Lo(s)+1,n=s.d.length-1,r=n*ci+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};fr.squareRoot=fr.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(Th+"NaN")}for(e=Lo(l),wi=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=$m(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=aC((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($y(l,a,i+2)).times(.5),$m(a.d).slice(0,i)===(t=$m(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)};fr.times=fr.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};fr.toDecimalPlaces=fr.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(og(e,0,sC),t===void 0?t=n.rounding:og(t,0,8),Fa(r,e+Lo(r)+1,t))};fr.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=AS(n,!0):(og(e,0,sC),t===void 0?t=s.rounding:og(t,0,8),n=Fa(new s(n),e+1,t),r=AS(n,!0,e+1)),r};fr.toFixed=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?AS(s):(og(e,0,sC),t===void 0?t=a.rounding:og(t,0,8),n=Fa(new a(s),e+Lo(s)+1,t),r=AS(n.abs(),!1,e+Lo(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};fr.toInteger=fr.toint=function(){var e=this,t=e.constructor;return Fa(new t(e),Lo(e)+1,t.rounding)};fr.toNumber=function(){return+this};fr.toPower=fr.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(Ud);if(l=new c(l),!l.s){if(e.s<1)throw Error(Th+"Infinity");return l}if(l.eq(Ud))return l;if(n=c.precision,e.eq(Ud))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)<=Cit){for(s=new c(Ud),t=Math.ceil(n/ci+4),wi=!1;r%2&&(s=s.times(l),gNe(s.d,t)),r=aC(r/2),r!==0;)l=l.times(l),gNe(l.d,t);return wi=!0,e.s<0?new c(Ud).div(s):Fa(s,n)}}else if(a<0)throw Error(Th+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,wi=!1,s=e.times(aI(l,n+u)),wi=!0,s=Tit(s),s.s=a,s};fr.toPrecision=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?(r=Lo(s),n=AS(s,r<=a.toExpNeg||r>=a.toExpPos)):(og(e,1,sC),t===void 0?t=a.rounding:og(t,0,8),s=Fa(new a(s),e,t),r=Lo(s),n=AS(s,e<=r||r<=a.toExpNeg,e)),n};fr.toSignificantDigits=fr.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(og(e,1,sC),t===void 0?t=n.rounding:og(t,0,8)),Fa(new n(r),e,t)};fr.toString=fr.valueOf=fr.val=fr.toJSON=fr[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Lo(e),r=e.constructor;return AS(e,t<=r.toExpNeg||t>=r.toExpPos)};function jit(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/ci),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 og(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Hw+e)}function $m(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=ci-n.length,r&&(a+=Ob(r)),a+=n;i=e[t],n=i+"",r=ci-n.length,r&&(a+=Ob(r))}else if(i===0)return"0";for(;i%10===0;)i/=10;return a+i}var $y=(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(Th+"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/ci+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 Tit(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(Rhe+Lo(e));if(!e.s)return new d(Ud);for(wi=!1,l=f,i=new d(.03125);e.abs().gte(.1);)e=e.times(i),u+=5;for(n=Math.log(cw(2,u))/Math.LN10*2+5|0,l+=n,r=s=a=new d(Ud),d.precision=l;;){if(s=Fa(s.times(e),l),r=r.times(++c),i=a.plus($y(s,r,l)),$m(i.d).slice(0,l)===$m(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*ci,r=e.d[0];r>=10;r/=10)t++;return t}function UH(e,t,r){if(t>e.LN10.sd())throw wi=!0,r&&(e.precision=r),Error(Th+"LN10 precision limit exceeded");return Fa(new e(e.LN10),t)}function Ob(e){for(var t="";e--;)t+="0";return t}function aI(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(Th+(p.s?"NaN":"-Infinity"));if(p.eq(Ud))return new g(0);if(t==null?(wi=!1,u=y):u=t,p.eq(10))return t==null&&(wi=!0),UH(g,u);if(u+=h,g.precision=u,r=$m(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=$m(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=UH(g,u+2,y).times(a+""),p=aI(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=$y(p.minus(Ud),p.plus(Ud),u),d=Fa(p.times(p),u),s=3;;){if(i=Fa(i.times(d),u),c=l.plus($y(i,new g(s),u)),$m(c.d).slice(0,u)===$m(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(UH(g,u+2,y).times(a+""))),l=$y(l,new g(f),u),g.precision=y,t==null?(wi=!0,Fa(l,y)):l;l=c,s+=2}}function mNe(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=aC(r/ci),e.d=[],n=(r+1)%ci,r<0&&(n+=ci),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=ci;n<s;)e.d.push(+t.slice(n,n+=ci));t=t.slice(n),n=ci-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),wi&&(e.e>c4||e.e<-c4))throw Error(Rhe+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+=ci,s=t,u=f[d=0];else{if(d=Math.ceil((n+1)/ci),a=f.length,d>=a)return e;for(u=a=f[d],i=1;a>=10;a/=10)i++;n%=ci,s=n-ci+i}if(r!==void 0&&(a=cw(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/cw(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]=cw(10,(ci-t%ci)%ci),e.e=aC(-t/ci)||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=cw(10,ci-n),f[d]=s>0?(u/cw(10,i-s)%cw(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>c4||e.e<-c4))throw Error(Rhe+Lo(e));return e}function Nit(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/ci),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 AS(e,t,r){var n,s=Lo(e),a=$m(e.d),i=a.length;return t?(r&&(n=r-i)>0?a=a.charAt(0)+"."+a.slice(1)+Ob(n):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+Ob(-s-1)+a,r&&(n=r-i)>0&&(a+=Ob(n))):s>=i?(a+=Ob(s+1-i),r&&(n=r-s-1)>0&&(a=a+"."+Ob(n))):((n=s+1)<i&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-i)>0&&(s+1===i&&(a+="."),a+=Ob(n))),e.s<0?"-"+a:a}function gNe(e,t){if(e.length>t)return e.length=t,!0}function Ait(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(Hw+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 mNe(i,a.toString())}else if(typeof a!="string")throw Error(Hw+a);if(a.charCodeAt(0)===45?(a=a.slice(1),i.s=-1):i.s=1,jOr.test(a))mNe(i,a);else throw Error(Hw+a)}if(s.prototype=fr,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=Ait,s.config=s.set=TOr,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 TOr(e){if(!e||typeof e!="object")throw Error(Th+"Object expected");var t,r,n,s=["precision",1,sC,"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(aC(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Hw+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Hw+r+": "+n);return this}var Phe=Ait(COr);Ud=new Phe(1);const bs=Phe;function Iit(e){var t;return e===0?t=1:t=Math.floor(new bs(e).abs().log(10).toNumber())+1,t}function Rit(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 Pit=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},Mhe=(e,t,r)=>{if(e.lte(0))return new bs(0);var n=Iit(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()))},Mit=(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()))},NOr=(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(Iit(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},Dit=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]:Mhe;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?Dit(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))})},yNe=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]=Pit([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 NOr(c,s,a);var f=i==="snap125"?Mit:Mhe,{step:h,tickMin:p,tickMax:m}=Dit(c,u,l,a,0,f),g=Rit(p,m.add(new bs(.1).mul(h)),h);return r>n?g.reverse():g},vNe=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]=Pit([n,s]);if(l===-1/0||c===1/0)return[n,s];if(l===c)return[l];var u=i==="snap125"?Mit:Mhe,d=Math.max(r,2),f=u(new bs(c).sub(l).div(d-1),a,0),h=[...Rit(new bs(l),new bs(c),f),c];return a===!1&&(h=h.map(p=>Math.round(p))),n>s?h.reverse():h},AOr=e=>e.rootProps.barCategoryGap,m9=e=>e.rootProps.stackOffset,Lit=e=>e.rootProps.reverseStackOrder,Dhe=e=>e.options.chartName,Lhe=e=>e.rootProps.syncId,$it=e=>e.rootProps.syncMethod,$he=e=>e.options.eventEmitter,Jc={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},U0={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},om={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},g9=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function y9(e,t,r){if(r!=="auto")return r;if(e!=null)return yv(e,t)?"category":"number"}function bNe(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 u4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bNe(Object(r),!0).forEach(function(n){IOr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IOr(e,t,r){return(t=ROr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ROr(e){var t=POr(e,"string");return typeof t=="symbol"?t:t+""}function POr(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 xNe={allowDataOverflow:U0.allowDataOverflow,allowDecimals:U0.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:U0.angleAxisId,includeHidden:!1,name:void 0,reversed:U0.reversed,scale:U0.scale,tick:U0.tick,tickCount:void 0,ticks:void 0,type:U0.type,unit:void 0,niceTicks:"auto"},wNe={allowDataOverflow:om.allowDataOverflow,allowDecimals:om.allowDecimals,allowDuplicatedCategory:om.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:om.radiusAxisId,includeHidden:om.includeHidden,name:void 0,reversed:om.reversed,scale:om.scale,tick:om.tick,tickCount:om.tickCount,ticks:void 0,type:om.type,unit:void 0,niceTicks:"auto"},MOr=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Fhe=Xe([MOr,iit],(e,t)=>{var r;if(e!=null)return e;var n=(r=y9(t,"angleAxis",xNe.type))!==null&&r!==void 0?r:"category";return u4(u4({},xNe),{},{type:n})}),DOr=(e,t)=>e.polarAxis.radiusAxis[t],zhe=Xe([DOr,iit],(e,t)=>{var r;if(e!=null)return e;var n=(r=y9(t,"radiusAxis",wNe.type))!==null&&r!==void 0?r:"category";return u4(u4({},wNe),{},{type:n})}),v9=e=>e.polarOptions,Bhe=Xe([vv,bv,ec],uOr),Fit=Xe([v9,Bhe],(e,t)=>{if(e!=null)return Cx(e.innerRadius,t,0)}),zit=Xe([v9,Bhe],(e,t)=>{if(e!=null)return Cx(e.outerRadius,t,t*.8)}),LOr=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},Bit=Xe([v9],LOr);Xe([Fhe,Bit],g9);var Uit=Xe([Bhe,Fit,zit],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Xe([zhe,Uit],g9);var Vit=Xe([Fi,v9,Fit,zit,vv,bv],(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:Cx(i,s,s/2),cy:Cx(l,a,a/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:u,clockWise:!1}}}),Cl=(e,t)=>t,b9=(e,t,r)=>r;function qit(e){return e?.id}function Hit(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=qit(l);u.forEach((f,h)=>{var p=a==null||s?h:String(Yl(f,a,null)),m=Yl(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 Uhe(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var x9=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function w9(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function $Or(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 jl=e=>{var t=Fi(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},iC=e=>e.tooltip.settings.axisId;function Vhe(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 FOr=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Zm(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 Kb(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zOr(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qhe(e){let t,r,n;e.length!==2?(t=Kb,r=(l,c)=>Kb(e(l),c),n=(l,c)=>e(l)-c):(t=e===Kb||e===zOr?e:BOr,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 BOr(){return 0}function Qit(e){return e===null?NaN:+e}function*UOr(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const VOr=qhe(Kb),_P=VOr.right;qhe(Qit).center;class SNe extends Map{constructor(t,r=QOr){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(ONe(this,t))}has(t){return super.has(ONe(this,t))}set(t,r){return super.set(qOr(this,t),r)}delete(t){return super.delete(HOr(this,t))}}function ONe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function qOr({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function HOr({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function QOr(e){return e!==null&&typeof e=="object"?e.valueOf():e}function WOr(e=Kb){if(e===Kb)return Wit;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 Wit(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const GOr=Math.sqrt(50),ZOr=Math.sqrt(10),YOr=Math.sqrt(2);function d4(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>=GOr?10:a>=ZOr?5:a>=YOr?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?d4(e,t,r*2):[l,c,u]}function $ae(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?d4(t,e,r):d4(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 Fae(e,t,r){return t=+t,e=+e,r=+r,d4(e,t,r)[2]}function zae(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?Fae(t,e,r):Fae(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function kNe(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function _Ne(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Git(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?Wit:WOr(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));Git(e,t,p,m,s)}const a=e[t];let i=r,l=n;for(rT(e,r,t),s(e[n],a)>0&&rT(e,r,n);i<l;){for(rT(e,i,l),++i,--l;s(e[i],a)<0;)++i;for(;s(e[l],a)>0;)--l}s(e[r],a)===0?rT(e,r,l):(++l,rT(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function rT(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function XOr(e,t,r){if(e=Float64Array.from(UOr(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return _Ne(e);if(t>=1)return kNe(e);var n,s=(n-1)*t,a=Math.floor(s),i=kNe(Git(e,a).subarray(0,a+1)),l=_Ne(e.subarray(a+1));return i+(l-i)*(s-a)}}function KOr(e,t,r=Qit){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 JOr(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 Bh(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function xv(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 Bae=Symbol("implicit");function Hhe(){var e=new SNe,t=[],r=[],n=Bae;function s(a){let i=e.get(a);if(i===void 0){if(n!==Bae)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 SNe;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 Hhe(t,r).unknown(n)},Bh.apply(s,arguments),s}function Qhe(){var e=Hhe().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=JOr(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 Qhe(t(),[n,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},Bh.apply(f(),arguments)}function Zit(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Zit(t())},e}function ekr(){return Zit(Qhe.apply(null,arguments).paddingInner(1))}function Whe(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Yit(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function EP(){}var iI=.7,f4=1/iI,Jk="\\s*([+-]?\\d+)\\s*",oI="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ym="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tkr=/^#([0-9a-f]{3,8})$/,rkr=new RegExp(`^rgb\\(${Jk},${Jk},${Jk}\\)$`),nkr=new RegExp(`^rgb\\(${Ym},${Ym},${Ym}\\)$`),skr=new RegExp(`^rgba\\(${Jk},${Jk},${Jk},${oI}\\)$`),akr=new RegExp(`^rgba\\(${Ym},${Ym},${Ym},${oI}\\)$`),ikr=new RegExp(`^hsl\\(${oI},${Ym},${Ym}\\)$`),okr=new RegExp(`^hsla\\(${oI},${Ym},${Ym},${oI}\\)$`),ENe={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};Whe(EP,IS,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:CNe,formatHex:CNe,formatHex8:lkr,formatHsl:ckr,formatRgb:jNe,toString:jNe});function CNe(){return this.rgb().formatHex()}function lkr(){return this.rgb().formatHex8()}function ckr(){return Xit(this).formatHsl()}function jNe(){return this.rgb().formatRgb()}function IS(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=tkr.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?TNe(t):r===3?new Vu(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?HD(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?HD(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=rkr.exec(e))?new Vu(t[1],t[2],t[3],1):(t=nkr.exec(e))?new Vu(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=skr.exec(e))?HD(t[1],t[2],t[3],t[4]):(t=akr.exec(e))?HD(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ikr.exec(e))?INe(t[1],t[2]/100,t[3]/100,1):(t=okr.exec(e))?INe(t[1],t[2]/100,t[3]/100,t[4]):ENe.hasOwnProperty(e)?TNe(ENe[e]):e==="transparent"?new Vu(NaN,NaN,NaN,0):null}function TNe(e){return new Vu(e>>16&255,e>>8&255,e&255,1)}function HD(e,t,r,n){return n<=0&&(e=t=r=NaN),new Vu(e,t,r,n)}function ukr(e){return e instanceof EP||(e=IS(e)),e?(e=e.rgb(),new Vu(e.r,e.g,e.b,e.opacity)):new Vu}function Uae(e,t,r,n){return arguments.length===1?ukr(e):new Vu(e,t,r,n??1)}function Vu(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Whe(Vu,Uae,Yit(EP,{brighter(e){return e=e==null?f4:Math.pow(f4,e),new Vu(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?iI:Math.pow(iI,e),new Vu(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vu(Qw(this.r),Qw(this.g),Qw(this.b),h4(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:NNe,formatHex:NNe,formatHex8:dkr,formatRgb:ANe,toString:ANe}));function NNe(){return`#${jw(this.r)}${jw(this.g)}${jw(this.b)}`}function dkr(){return`#${jw(this.r)}${jw(this.g)}${jw(this.b)}${jw((isNaN(this.opacity)?1:this.opacity)*255)}`}function ANe(){const e=h4(this.opacity);return`${e===1?"rgb(":"rgba("}${Qw(this.r)}, ${Qw(this.g)}, ${Qw(this.b)}${e===1?")":`, ${e})`}`}function h4(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jw(e){return e=Qw(e),(e<16?"0":"")+e.toString(16)}function INe(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new fp(e,t,r,n)}function Xit(e){if(e instanceof fp)return new fp(e.h,e.s,e.l,e.opacity);if(e instanceof EP||(e=IS(e)),!e)return new fp;if(e instanceof fp)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 fp(i,l,c,e.opacity)}function fkr(e,t,r,n){return arguments.length===1?Xit(e):new fp(e,t,r,n??1)}function fp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Whe(fp,fkr,Yit(EP,{brighter(e){return e=e==null?f4:Math.pow(f4,e),new fp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?iI:Math.pow(iI,e),new fp(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 Vu(VH(e>=240?e-240:e+120,s,n),VH(e,s,n),VH(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new fp(RNe(this.h),QD(this.s),QD(this.l),h4(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=h4(this.opacity);return`${e===1?"hsl(":"hsla("}${RNe(this.h)}, ${QD(this.s)*100}%, ${QD(this.l)*100}%${e===1?")":`, ${e})`}`}}));function RNe(e){return e=(e||0)%360,e<0?e+360:e}function QD(e){return Math.max(0,Math.min(1,e||0))}function VH(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 Ghe=e=>()=>e;function hkr(e,t){return function(r){return e+r*t}}function pkr(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 mkr(e){return(e=+e)==1?Kit:function(t,r){return r-t?pkr(t,r,e):Ghe(isNaN(t)?r:t)}}function Kit(e,t){var r=t-e;return r?hkr(e,r):Ghe(isNaN(e)?t:e)}const p4=(function e(t){var r=mkr(t);function n(s,a){var i=r((s=Uae(s)).r,(a=Uae(a)).r),l=r(s.g,a.g),c=r(s.b,a.b),u=Kit(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 gkr(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 ykr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vkr(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]=Fy(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 bkr(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function lp(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function xkr(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]=Fy(e[s],t[s]):n[s]=t[s];return function(a){for(s in r)n[s]=r[s](a);return n}}var Vae=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qH=new RegExp(Vae.source,"g");function wkr(e){return function(){return e}}function Skr(e){return function(t){return e(t)+""}}function Jit(e,t){var r=Vae.lastIndex=qH.lastIndex=0,n,s,a,i=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Vae.exec(e))&&(s=qH.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:lp(n,s)})),r=qH.lastIndex;return r<t.length&&(a=t.slice(r),l[i]?l[i]+=a:l[++i]=a),l.length<2?c[0]?Skr(c[0].x):wkr(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 Fy(e,t){var r=typeof t,n;return t==null||r==="boolean"?Ghe(t):(r==="number"?lp:r==="string"?(n=IS(t))?(t=n,p4):Jit:t instanceof IS?p4:t instanceof Date?bkr:ykr(t)?gkr:Array.isArray(t)?vkr:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?xkr:lp)(e,t)}function Zhe(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var PNe=180/Math.PI,qae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function eot(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)*PNe,skewX:Math.atan(c)*PNe,scaleX:i,scaleY:l}}var WD;function Okr(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qae:eot(t.a,t.b,t.c,t.d,t.e,t.f)}function kkr(e){return e==null||(WD||(WD=document.createElementNS("http://www.w3.org/2000/svg","g")),WD.setAttribute("transform",e),!(e=WD.transform.baseVal.consolidate()))?qae:(e=e.matrix,eot(e.a,e.b,e.c,e.d,e.e,e.f))}function tot(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:lp(u,f)},{i:g-2,x:lp(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:lp(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:lp(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:lp(u,f)},{i:g-2,x:lp(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 _kr=tot(Okr,"px, ","px)","deg)"),Ekr=tot(kkr,", ",")",")"),Ckr=1e-12;function MNe(e){return((e=Math.exp(e))+1/e)/2}function jkr(e){return((e=Math.exp(e))-1/e)/2}function Tkr(e){return((e=Math.exp(2*e))-1)/(e+1)}const j$=(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<Ckr)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=MNe(_),I=u/(r*w)*(N*Tkr(t*j+_)-jkr(_));return[l+I*p,c+I*m,u*N/MNe(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 Nkr(e,t){t===void 0&&(t=e,e=Fy);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 Akr(e){return function(){return e}}function m4(e){return+e}var DNe=[0,1];function eu(e){return e}function Hae(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Akr(isNaN(t)?NaN:.5)}function Ikr(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Rkr(e,t,r){var n=e[0],s=e[1],a=t[0],i=t[1];return s<n?(n=Hae(s,n),a=r(i,a)):(n=Hae(n,s),a=r(a,i)),function(l){return a(n(l))}}function Pkr(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]=Hae(e[i],e[i+1]),a[i]=r(t[i],t[i+1]);return function(l){var c=_P(e,l,1,n)-1;return a[c](s[c](l))}}function CP(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function S9(){var e=DNe,t=DNe,r=Fy,n,s,a,i=eu,l,c,u;function d(){var h=Math.min(e.length,t.length);return i!==eu&&(i=Ikr(e[0],e[h-1])),l=h>2?Pkr:Rkr,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),lp)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,m4),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=Zhe,d()},f.clamp=function(h){return arguments.length?(i=h?!0:eu,d()):i!==eu},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 Yhe(){return S9()(eu,eu)}function Mkr(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function g4(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 Y_(e){return e=g4(Math.abs(e)),e?e[1]:NaN}function Dkr(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 Lkr(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var $kr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lI(e){if(!(t=$kr.exec(e)))throw new Error("invalid format: "+e);var t;return new Xhe({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]})}lI.prototype=Xhe.prototype;function Xhe(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+""}Xhe.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 Fkr(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 y4;function zkr(e,t){var r=g4(e,t);if(!r)return y4=void 0,e.toPrecision(t);var n=r[0],s=r[1],a=s-(y4=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")+g4(e,Math.max(0,t+a-1))[0]}function LNe(e,t){var r=g4(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 $Ne={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Mkr,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)=>LNe(e*100,t),r:LNe,s:zkr,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function FNe(e){return e}var zNe=Array.prototype.map,BNe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Bkr(e){var t=e.grouping===void 0||e.thousands===void 0?FNe:Dkr(zNe.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?FNe:Lkr(zNe.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=lI(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"):$Ne[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=$Ne[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=Fkr(R)),H&&+R==0&&g!=="+"&&(H=!1),B=(H?g==="("?g:l:g==="-"||g==="("?"":g)+B,D=(E==="s"&&!isNaN(R)&&y4!==void 0?BNe[8+y4/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(Y_(h)/3)))*3,m=Math.pow(10,-p),g=u((f=lI(f),f.type="f",f),{suffix:BNe[8+p/3]});return function(y){return g(m*y)}}return{format:u,formatPrefix:d}}var GD,Khe,rot;Ukr({thousands:",",grouping:[3],currency:["$",""]});function Ukr(e){return GD=Bkr(e),Khe=GD.format,rot=GD.formatPrefix,GD}function Vkr(e){return Math.max(0,-Y_(Math.abs(e)))}function qkr(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Y_(t)/3)))*3-Y_(Math.abs(e)))}function Hkr(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Y_(t)-Y_(e))+1}function not(e,t,r,n){var s=zae(e,t,r),a;switch(n=lI(n??",f"),n.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=qkr(s,i))&&(n.precision=a),rot(n,i)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Hkr(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Vkr(s))&&(n.precision=a-(n.type==="%")*2);break}}return Khe(n)}function l0(e){var t=e.domain;return e.ticks=function(r){var n=t();return $ae(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return not(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=Fae(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 sot(){var e=Yhe();return e.copy=function(){return CP(e,sot())},Bh.apply(e,arguments),l0(e)}function aot(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,m4),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return aot(e).unknown(t)},e=arguments.length?Array.from(e,m4):[0,1],l0(r)}function iot(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 UNe(e){return Math.log(e)}function VNe(e){return Math.exp(e)}function Qkr(e){return-Math.log(-e)}function Wkr(e){return-Math.exp(-e)}function Gkr(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Zkr(e){return e===10?Gkr:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ykr(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 qNe(e){return(t,r)=>-e(-t,r)}function Jhe(e){const t=e(UNe,VNe),r=t.domain;let n=10,s,a;function i(){return s=Ykr(n),a=Zkr(n),r()[0]<0?(s=qNe(s),a=qNe(a),e(Qkr,Wkr)):e(UNe,VNe),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=$ae(u,d,y))}else x=$ae(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=lI(c)).precision==null&&(c.trim=!0),c=Khe(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(iot(r(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function oot(){const e=Jhe(S9()).domain([1,10]);return e.copy=()=>CP(e,oot()).base(e.base()),Bh.apply(e,arguments),e}function HNe(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function QNe(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function epe(e){var t=1,r=e(HNe(t),QNe(t));return r.constant=function(n){return arguments.length?e(HNe(t=+n),QNe(t)):t},l0(r)}function lot(){var e=epe(S9());return e.copy=function(){return CP(e,lot()).constant(e.constant())},Bh.apply(e,arguments)}function WNe(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Xkr(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Kkr(e){return e<0?-e*e:e*e}function tpe(e){var t=e(eu,eu),r=1;function n(){return r===1?e(eu,eu):r===.5?e(Xkr,Kkr):e(WNe(r),WNe(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},l0(t)}function rpe(){var e=tpe(S9());return e.copy=function(){return CP(e,rpe()).exponent(e.exponent())},Bh.apply(e,arguments),e}function Jkr(){return rpe.apply(null,arguments).exponent(.5)}function GNe(e){return Math.sign(e)*e*e}function e_r(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function cot(){var e=Yhe(),t=[0,1],r=!1,n;function s(a){var i=e_r(e(a));return isNaN(i)?n:r?Math.round(i):i}return s.invert=function(a){return e.invert(GNe(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,m4)).map(GNe)),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 cot(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Bh.apply(s,arguments),l0(s)}function uot(){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]=KOr(e,i/l);return a}function a(i){return i==null||isNaN(i=+i)?n:t[_P(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(Kb),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 uot().domain(e).range(t).unknown(n)},Bh.apply(a,arguments)}function dot(){var e=0,t=1,r=1,n=[.5],s=[0,1],a;function i(c){return c!=null&&c<=c?s[_P(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 dot().domain([e,t]).range(s).unknown(a)},Bh.apply(l0(i),arguments)}function fot(){var e=[.5],t=[0,1],r,n=1;function s(a){return a!=null&&a<=a?t[_P(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 fot().domain(e).range(t).unknown(r)},Bh.apply(s,arguments)}const HH=new Date,QH=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)=>(HH.setTime(+a),QH.setTime(+i),e(HH),e(QH),Math.floor(r(HH,QH))),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 v4=sl(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);v4.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):v4);v4.range;const Ny=1e3,mh=Ny*60,Ay=mh*60,Jy=Ay*24,npe=Jy*7,ZNe=Jy*30,WH=Jy*365,Tw=sl(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ny)},(e,t)=>(t-e)/Ny,e=>e.getUTCSeconds());Tw.range;const spe=sl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ny)},(e,t)=>{e.setTime(+e+t*mh)},(e,t)=>(t-e)/mh,e=>e.getMinutes());spe.range;const ape=sl(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*mh)},(e,t)=>(t-e)/mh,e=>e.getUTCMinutes());ape.range;const ipe=sl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ny-e.getMinutes()*mh)},(e,t)=>{e.setTime(+e+t*Ay)},(e,t)=>(t-e)/Ay,e=>e.getHours());ipe.range;const ope=sl(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ay)},(e,t)=>(t-e)/Ay,e=>e.getUTCHours());ope.range;const jP=sl(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*mh)/Jy,e=>e.getDate()-1);jP.range;const O9=sl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jy,e=>e.getUTCDate()-1);O9.range;const hot=sl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jy,e=>Math.floor(e/Jy));hot.range;function y1(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())*mh)/npe)}const k9=y1(0),b4=y1(1),t_r=y1(2),r_r=y1(3),X_=y1(4),n_r=y1(5),s_r=y1(6);k9.range;b4.range;t_r.range;r_r.range;X_.range;n_r.range;s_r.range;function v1(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)/npe)}const _9=v1(0),x4=v1(1),a_r=v1(2),i_r=v1(3),K_=v1(4),o_r=v1(5),l_r=v1(6);_9.range;x4.range;a_r.range;i_r.range;K_.range;o_r.range;l_r.range;const lpe=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());lpe.range;const cpe=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());cpe.range;const ev=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());ev.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)});ev.range;const tv=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());tv.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)});tv.range;function pot(e,t,r,n,s,a){const i=[[Tw,1,Ny],[Tw,5,5*Ny],[Tw,15,15*Ny],[Tw,30,30*Ny],[a,1,mh],[a,5,5*mh],[a,15,15*mh],[a,30,30*mh],[s,1,Ay],[s,3,3*Ay],[s,6,6*Ay],[s,12,12*Ay],[n,1,Jy],[n,2,2*Jy],[r,1,npe],[t,1,ZNe],[t,3,3*ZNe],[e,1,WH]];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=qhe(([,,y])=>y).right(i,h);if(p===i.length)return e.every(zae(u/WH,d/WH,f));if(p===0)return v4.every(Math.max(zae(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[c_r,u_r]=pot(tv,cpe,_9,hot,ope,ape),[d_r,f_r]=pot(ev,lpe,k9,jP,ipe,spe);function GH(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 ZH(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 nT(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function h_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=sT(s),d=aT(s),f=sT(a),h=aT(a),p=sT(i),m=aT(i),g=sT(l),y=aT(l),x=sT(c),w=aT(c),S={a:z,A:H,b:Q,B:L,c:null,d:tAe,e:tAe,f:D_r,g:Q_r,G:G_r,H:R_r,I:P_r,j:M_r,L:mot,m:L_r,M:$_r,p:Z,q:V,Q:sAe,s:aAe,S:F_r,u:z_r,U:B_r,V:U_r,w:V_r,W:q_r,x:null,X:null,y:H_r,Y:W_r,Z:Z_r,"%":nAe},k={a:M,A:W,b:G,B:J,c:null,d:rAe,e:rAe,f:J_r,g:cEr,G:dEr,H:Y_r,I:X_r,j:K_r,L:yot,m:eEr,M:tEr,p:ae,q:te,Q:sAe,s:aAe,S:rEr,u:nEr,U:sEr,V:aEr,w:iEr,W:oEr,x:null,X:null,y:lEr,Y:uEr,Z:fEr,"%":nAe},_={a:I,A:P,b:R,B,c:D,d:JNe,e:JNe,f:T_r,g:KNe,G:XNe,H:eAe,I:eAe,j:__r,L:j_r,m:k_r,M:E_r,p:N,q:O_r,Q:A_r,s:I_r,S:C_r,u:v_r,U:b_r,V:x_r,w:y_r,W:w_r,x:$,X:U,y:KNe,Y:XNe,Z:S_r,"%":N_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(fe){var X=[],se=-1,le=0,xe=re.length,ue,ce,ve;for(fe instanceof Date||(fe=new Date(+fe));++se<xe;)re.charCodeAt(se)===37&&(X.push(re.slice(le,se)),(ce=YNe[ue=re.charAt(++se)])!=null?ue=re.charAt(++se):ce=ue==="e"?" ":"0",(ve=ie[ue])&&(ue=ve(fe,ce)),X.push(ue),le=se+1);return X.push(re.slice(le,se)),X.join("")}}function T(re,ie){return function(fe){var X=nT(1900,void 0,1),se=j(X,re,fe+="",0),le,xe;if(se!=fe.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=ZH(nT(X.y,0,1)),xe=le.getUTCDay(),le=xe>4||xe===0?x4.ceil(le):x4(le),le=O9.offset(le,(X.V-1)*7),X.y=le.getUTCFullYear(),X.m=le.getUTCMonth(),X.d=le.getUTCDate()+(X.w+6)%7):(le=GH(nT(X.y,0,1)),xe=le.getDay(),le=xe>4||xe===0?b4.ceil(le):b4(le),le=jP.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?ZH(nT(X.y,0,1)).getUTCDay():GH(nT(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,ZH(X)):GH(X)}}function j(re,ie,fe,X){for(var se=0,le=ie.length,xe=fe.length,ue,ce;se<le;){if(X>=xe)return-1;if(ue=ie.charCodeAt(se++),ue===37){if(ue=ie.charAt(se++),ce=_[ue in YNe?ie.charAt(se++):ue],!ce||(X=ce(re,fe,X))<0)return-1}else if(ue!=fe.charCodeAt(X++))return-1}return X}function N(re,ie,fe){var X=u.exec(ie.slice(fe));return X?(re.p=d.get(X[0].toLowerCase()),fe+X[0].length):-1}function I(re,ie,fe){var X=p.exec(ie.slice(fe));return X?(re.w=m.get(X[0].toLowerCase()),fe+X[0].length):-1}function P(re,ie,fe){var X=f.exec(ie.slice(fe));return X?(re.w=h.get(X[0].toLowerCase()),fe+X[0].length):-1}function R(re,ie,fe){var X=x.exec(ie.slice(fe));return X?(re.m=w.get(X[0].toLowerCase()),fe+X[0].length):-1}function B(re,ie,fe){var X=g.exec(ie.slice(fe));return X?(re.m=y.get(X[0].toLowerCase()),fe+X[0].length):-1}function D(re,ie,fe){return j(re,t,ie,fe)}function $(re,ie,fe){return j(re,r,ie,fe)}function U(re,ie,fe){return j(re,n,ie,fe)}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 YNe={"-":"",_:" ",0:"0"},Tl=/^\s*\d+/,p_r=/^%/,m_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 g_r(e){return e.replace(m_r,"\\$&")}function sT(e){return new RegExp("^(?:"+e.map(g_r).join("|")+")","i")}function aT(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function y_r(e,t,r){var n=Tl.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function v_r(e,t,r){var n=Tl.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function b_r(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function x_r(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function w_r(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function XNe(e,t,r){var n=Tl.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function KNe(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function S_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 O_r(e,t,r){var n=Tl.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function k_r(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function JNe(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function __r(e,t,r){var n=Tl.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function eAe(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function E_r(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function C_r(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function j_r(e,t,r){var n=Tl.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function T_r(e,t,r){var n=Tl.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function N_r(e,t,r){var n=p_r.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function A_r(e,t,r){var n=Tl.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function I_r(e,t,r){var n=Tl.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function tAe(e,t){return Bs(e.getDate(),t,2)}function R_r(e,t){return Bs(e.getHours(),t,2)}function P_r(e,t){return Bs(e.getHours()%12||12,t,2)}function M_r(e,t){return Bs(1+jP.count(ev(e),e),t,3)}function mot(e,t){return Bs(e.getMilliseconds(),t,3)}function D_r(e,t){return mot(e,t)+"000"}function L_r(e,t){return Bs(e.getMonth()+1,t,2)}function $_r(e,t){return Bs(e.getMinutes(),t,2)}function F_r(e,t){return Bs(e.getSeconds(),t,2)}function z_r(e){var t=e.getDay();return t===0?7:t}function B_r(e,t){return Bs(k9.count(ev(e)-1,e),t,2)}function got(e){var t=e.getDay();return t>=4||t===0?X_(e):X_.ceil(e)}function U_r(e,t){return e=got(e),Bs(X_.count(ev(e),e)+(ev(e).getDay()===4),t,2)}function V_r(e){return e.getDay()}function q_r(e,t){return Bs(b4.count(ev(e)-1,e),t,2)}function H_r(e,t){return Bs(e.getFullYear()%100,t,2)}function Q_r(e,t){return e=got(e),Bs(e.getFullYear()%100,t,2)}function W_r(e,t){return Bs(e.getFullYear()%1e4,t,4)}function G_r(e,t){var r=e.getDay();return e=r>=4||r===0?X_(e):X_.ceil(e),Bs(e.getFullYear()%1e4,t,4)}function Z_r(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Bs(t/60|0,"0",2)+Bs(t%60,"0",2)}function rAe(e,t){return Bs(e.getUTCDate(),t,2)}function Y_r(e,t){return Bs(e.getUTCHours(),t,2)}function X_r(e,t){return Bs(e.getUTCHours()%12||12,t,2)}function K_r(e,t){return Bs(1+O9.count(tv(e),e),t,3)}function yot(e,t){return Bs(e.getUTCMilliseconds(),t,3)}function J_r(e,t){return yot(e,t)+"000"}function eEr(e,t){return Bs(e.getUTCMonth()+1,t,2)}function tEr(e,t){return Bs(e.getUTCMinutes(),t,2)}function rEr(e,t){return Bs(e.getUTCSeconds(),t,2)}function nEr(e){var t=e.getUTCDay();return t===0?7:t}function sEr(e,t){return Bs(_9.count(tv(e)-1,e),t,2)}function vot(e){var t=e.getUTCDay();return t>=4||t===0?K_(e):K_.ceil(e)}function aEr(e,t){return e=vot(e),Bs(K_.count(tv(e),e)+(tv(e).getUTCDay()===4),t,2)}function iEr(e){return e.getUTCDay()}function oEr(e,t){return Bs(x4.count(tv(e)-1,e),t,2)}function lEr(e,t){return Bs(e.getUTCFullYear()%100,t,2)}function cEr(e,t){return e=vot(e),Bs(e.getUTCFullYear()%100,t,2)}function uEr(e,t){return Bs(e.getUTCFullYear()%1e4,t,4)}function dEr(e,t){var r=e.getUTCDay();return e=r>=4||r===0?K_(e):K_.ceil(e),Bs(e.getUTCFullYear()%1e4,t,4)}function fEr(){return"+0000"}function nAe(){return"%"}function sAe(e){return+e}function aAe(e){return Math.floor(+e/1e3)}var SO,bot,xot;hEr({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 hEr(e){return SO=h_r(e),bot=SO.format,SO.parse,xot=SO.utcFormat,SO.utcParse,SO}function pEr(e){return new Date(e)}function mEr(e){return e instanceof Date?+e:+new Date(+e)}function upe(e,t,r,n,s,a,i,l,c,u){var d=Yhe(),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,mEr)):h().map(pEr)},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(iot(T,E)):d},d.copy=function(){return CP(d,upe(e,t,r,n,s,a,i,l,c,u))},d}function gEr(){return Bh.apply(upe(d_r,f_r,ev,lpe,k9,jP,ipe,spe,Tw,bot).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function yEr(){return Bh.apply(upe(c_r,u_r,tv,cpe,_9,O9,ope,ape,Tw,xot).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function E9(){var e=0,t=1,r,n,s,a,i=eu,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(Fy),u.rangeRound=d(Zhe),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 c0(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function wot(){var e=l0(E9()(eu));return e.copy=function(){return c0(e,wot())},xv.apply(e,arguments)}function Sot(){var e=Jhe(E9()).domain([1,10]);return e.copy=function(){return c0(e,Sot()).base(e.base())},xv.apply(e,arguments)}function Oot(){var e=epe(E9());return e.copy=function(){return c0(e,Oot()).constant(e.constant())},xv.apply(e,arguments)}function dpe(){var e=tpe(E9());return e.copy=function(){return c0(e,dpe()).exponent(e.exponent())},xv.apply(e,arguments)}function vEr(){return dpe.apply(null,arguments).exponent(.5)}function kot(){var e=[],t=eu;function r(n){if(n!=null&&!isNaN(n=+n))return t((_P(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(Kb),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)=>XOr(e,a/n))},r.copy=function(){return kot(t).domain(e)},xv.apply(r,arguments)}function C9(){var e=0,t=.5,r=1,n=1,s,a,i,l,c,u=eu,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=Nkr(g,[x,w,S]),p):[u(0),u(.5),u(1)]}}return p.range=m(Fy),p.rangeRound=m(Zhe),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 _ot(){var e=l0(C9()(eu));return e.copy=function(){return c0(e,_ot())},xv.apply(e,arguments)}function Eot(){var e=Jhe(C9()).domain([.1,1,10]);return e.copy=function(){return c0(e,Eot()).base(e.base())},xv.apply(e,arguments)}function Cot(){var e=epe(C9());return e.copy=function(){return c0(e,Cot()).constant(e.constant())},xv.apply(e,arguments)}function fpe(){var e=tpe(C9());return e.copy=function(){return c0(e,fpe()).exponent(e.exponent())},xv.apply(e,arguments)}function bEr(){return fpe.apply(null,arguments).exponent(.5)}const QT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Qhe,scaleDiverging:_ot,scaleDivergingLog:Eot,scaleDivergingPow:fpe,scaleDivergingSqrt:bEr,scaleDivergingSymlog:Cot,scaleIdentity:aot,scaleImplicit:Bae,scaleLinear:sot,scaleLog:oot,scaleOrdinal:Hhe,scalePoint:ekr,scalePow:rpe,scaleQuantile:uot,scaleQuantize:dot,scaleRadial:cot,scaleSequential:wot,scaleSequentialLog:Sot,scaleSequentialPow:dpe,scaleSequentialQuantile:kot,scaleSequentialSqrt:vEr,scaleSequentialSymlog:Oot,scaleSqrt:Jkr,scaleSymlog:lot,scaleThreshold:fot,scaleTime:gEr,scaleUtc:yEr,tickFormat:not},Symbol.toStringTag,{value:"Module"}));function xEr(e){if(e in QT)return QT[e]();var t="scale".concat(vP(e));if(t in QT)return QT[t]()}function iAe(e,t,r){if(typeof e=="function")return e.copy().domain(t).range(r);if(e!=null){var n=xEr(e);if(n!=null)return n.domain(t).range(r),n}}function hpe(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?iAe(e.scale,r,n):iAe(t,r,n)}function wEr(e){return"scale".concat(vP(e))}function SEr(e){return wEr(e)in QT}var jot=(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 SEr(n)?n:"point"}};function OEr(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 Tot(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=OEr(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 kEr(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):Tot(e,void 0)}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 w4(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){_Er(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 _Er(e,t,r){return(t=EEr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EEr(e){var t=CEr(e,"string");return typeof t=="symbol"?t:t+""}function CEr(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 Qae=[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"},Not=(e,t)=>e.cartesianAxis.xAxis[t],wv=(e,t)=>{var r=Not(e,t);return r??Yo},Xo={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Qae,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:wP},Aot=(e,t)=>e.cartesianAxis.yAxis[t],Sv=(e,t)=>{var r=Aot(e,t);return r??Xo},jEr={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:""},ppe=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??jEr},mu=(e,t,r)=>{switch(t){case"xAxis":return wv(e,r);case"yAxis":return Sv(e,r);case"zAxis":return ppe(e,r);case"angleAxis":return Fhe(e,r);case"radiusAxis":return zhe(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},TEr=(e,t,r)=>{switch(t){case"xAxis":return wv(e,r);case"yAxis":return Sv(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},TP=(e,t,r)=>{switch(t){case"xAxis":return wv(e,r);case"yAxis":return Sv(e,r);case"angleAxis":return Fhe(e,r);case"radiusAxis":return zhe(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Iot=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Rot(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 Pot=e=>e.graphicalItems.cartesianItems,NEr=Xe([Cl,b9],Rot),Mot=(e,t,r)=>e.filter(r).filter(n=>t?.includeHidden===!0?!0:!n.hide),NP=Xe([Pot,mu,NEr],Mot,{memoizeOptions:{resultEqualityCheck:w9}}),Dot=Xe([NP],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Uhe)),Lot=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),AEr=Xe([NP],Lot),$ot=e=>e.map(t=>t.data).filter(Boolean).flat(1),IEr=Xe([NP],$ot,{memoizeOptions:{resultEqualityCheck:w9}}),Fot=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},mpe=Xe([IEr,Ihe],Fot),zot=(e,t,r)=>t?.dataKey!=null?e.map(n=>({value:Yl(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:Yl(s,n)}))):e.map(n=>({value:n})),AP=Xe([mpe,mu,NP],zot);function e_(e){if(ag(e)||e instanceof Date){var t=Number(e);if(zs(t))return t}}function lAe(e){if(Array.isArray(e)){var t=[e_(e[0]),e_(e[1])];return Zm(t)?t:void 0}var r=e_(e);if(r!=null)return[r,r]}function rv(e){return e.map(e_).filter(Uu)}function REr(e,t){var r=e_(e),n=e_(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var PEr=Xe([AP],e=>e?.map(t=>t.value).sort(REr));function Bot(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function MEr(e,t,r){return!r||typeof t!="number"||Xy(t)?[]:r.length?rv(r.flatMap(n=>{var s=Yl(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=jl(e),r=iC(e);return TP(e,t,r)},IP=Xe([al],e=>e?.dataKey),DEr=Xe([Dot,Ihe,al],Hit),Uot=(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(qit);return[l,{stackedData:Ywr(e,d,r),graphicalItems:u}]}))},LEr=Xe([DEr,Dot,m9,Lit],Uot),Vot=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:a}=t;if(n==null&&r!=="zAxis"){var i=Jwr(e,s,a);if(!(i!=null&&i[0]===0&&i[1]===0))return i}},$Er=Xe([mu],e=>e.allowDataOverflow),gpe=e=>{var t;if(e==null||!("domain"in e))return Qae;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=rv(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:Qae},qot=Xe([mu],gpe),Hot=Xe([qot,$Er],Eit),FEr=Xe([LEr,o0,Cl,Hot],Vot,{memoizeOptions:{resultEqualityCheck:x9}}),ype=e=>e.errorBars,zEr=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>Bot(r,n)),S4=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]}},Qot=(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=>Bot(s,x)),h=Yl(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),p=MEr(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=lAe(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=lAe(Yl(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]},BEr=Xe([mpe,mu,AEr,ype,Cl],Qot,{memoizeOptions:{resultEqualityCheck:x9}});function UEr(e){var{value:t}=e;if(ag(t)||t instanceof Date)return t}var VEr=(e,t,r)=>{var n=e.map(UEr).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&sat(n))?_it(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},Wot=e=>e.referenceElements.dots,oC=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),qEr=Xe([Wot,Cl,b9],oC),Got=e=>e.referenceElements.areas,HEr=Xe([Got,Cl,b9],oC),Zot=e=>e.referenceElements.lines,QEr=Xe([Zot,Cl,b9],oC),Yot=(e,t)=>{if(e!=null){var r=rv(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},WEr=Xe(qEr,Cl,Yot),Xot=(e,t)=>{if(e!=null){var r=rv(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)]}},GEr=Xe([HEr,Cl],Xot);function ZEr(e){var t;if(e.x!=null)return rv([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:rv(r)}function YEr(e){var t;if(e.y!=null)return rv([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:rv(r)}var Kot=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?ZEr(n):YEr(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},XEr=Xe([QEr,Cl],Kot),KEr=Xe(WEr,XEr,GEr,(e,t,r)=>S4(e,r,t)),Jot=(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?S4(n,a,s):S4(a,s);return EOr(t,u,e.allowDataOverflow)},JEr=Xe([mu,qot,Hot,FEr,BEr,KEr,Fi,Cl],Jot,{memoizeOptions:{resultEqualityCheck:x9}}),eCr=[0,1],elt=(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=yv(t,a);if(u&&l==null){var d;return _it(0,(d=r?.length)!==null&&d!==void 0?d:0)}return c==="category"?VEr(n,e,u):s==="expand"?eCr:i}},vpe=Xe([mu,Fi,mpe,AP,m9,Cl,JEr],elt),lC=Xe([mu,Iot,Dhe],jot),tlt=(e,t,r)=>{var{niceTicks:n}=t;if(n!=="none"){var s=gpe(t),a=Array.isArray(s)&&(s[0]==="auto"||s[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&Zm(e)){if(a)return yNe(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return vNe(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(a&&Zm(e))return yNe(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Zm(e))return vNe(e,t.tickCount,t.allowDecimals,"adaptive")}}},bpe=Xe([vpe,TP,lC],tlt),rlt=(e,t,r,n)=>{if(n!=="angleAxis"&&e?.type==="number"&&Zm(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},tCr=Xe([mu,vpe,bpe,Cl],rlt),rCr=Xe(AP,mu,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(rv(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}}),nlt=Xe(rCr,Fi,AOr,ec,(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=Cx(r,e*a),l=e*a/2;return l-i-(l-i)/a*i}return 0}),nCr=(e,t,r)=>{var n=wv(e,t);return n==null||typeof n.padding!="string"?0:nlt(e,"xAxis",t,r,n.padding)},sCr=(e,t,r)=>{var n=Sv(e,t);return n==null||typeof n.padding!="string"?0:nlt(e,"yAxis",t,r,n.padding)},aCr=Xe(wv,nCr,(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}}),iCr=Xe(Sv,sCr,(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}}),oCr=Xe([ec,aCr,c9,l9,(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]}),lCr=Xe([ec,Fi,iCr,c9,l9,(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]}),RP=(e,t,r,n)=>{var s;switch(t){case"xAxis":return oCr(e,r,n);case"yAxis":return lCr(e,r,n);case"zAxis":return(s=ppe(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return Bit(e);case"radiusAxis":return Uit(e,r);default:return}},slt=Xe([mu,RP],g9),cCr=Xe([lC,tCr],FOr),xpe=Xe([mu,lC,cCr,slt],hpe),alt=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:a}=r,i=yv(e,n);if(i&&(s==="number"||a!=="auto"))return t.map(l=>l.value)}},wpe=Xe([Fi,AP,TP,Cl],alt),j9=Xe([xpe],Vhe);Xe([xpe],kEr);Xe([xpe,PEr],Tot);Xe([NP,ype,Cl],zEr);function ilt(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var T9=(e,t)=>t,N9=(e,t,r)=>r,uCr=Xe(i9,T9,N9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(ilt)),dCr=Xe(o9,T9,N9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(ilt)),olt=(e,t)=>({width:e.width,height:t.height}),fCr=(e,t)=>{var r=typeof t.width=="number"?t.width:wP;return{width:r,height:e.height}},hCr=Xe(ec,wv,olt),pCr=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},mCr=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},gCr=Xe(bv,ec,uCr,T9,N9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=olt(t,l);i==null&&(i=pCr(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}),yCr=Xe(vv,ec,dCr,T9,N9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=fCr(t,l);i==null&&(i=mCr(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}),vCr=(e,t)=>{var r=wv(e,t);if(r!=null)return gCr(e,r.orientation,r.mirror)},bCr=Xe([ec,wv,vCr,(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}}}),xCr=(e,t)=>{var r=Sv(e,t);if(r!=null)return yCr(e,r.orientation,r.mirror)},wCr=Xe([ec,Sv,xCr,(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}}}),SCr=Xe(ec,Sv,(e,t)=>{var r=typeof t.width=="number"?t.width:wP;return{width:r,height:e.height}}),llt=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:a,dataKey:i}=r,l=yv(e,n),c=t.map(u=>u.value);if(i&&l&&a==="category"&&s&&sat(c))return c}},Spe=Xe([Fi,AP,mu,Cl],llt),cAe=Xe([Fi,TEr,lC,j9,Spe,wpe,RP,bpe,Cl],(e,t,r,n,s,a,i,l,c)=>{if(t!=null){var u=yv(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}}}),OCr=(e,t,r,n,s,a,i,l,c)=>{if(!(t==null||n==null)){var u=yv(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?hh(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(Uu):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(Uu):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(Uu):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(Uu)}},clt=Xe([Fi,TP,lC,j9,bpe,RP,Spe,wpe,Cl],OCr),kCr=(e,t,r,n,s,a,i)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=yv(e,i),{tickCount:c}=t,u=0;return u=i==="angleAxis"&&n?.length>=2?hh(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(Uu):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(Uu):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(Uu)}},ult=Xe([Fi,TP,j9,RP,Spe,wpe,Cl],kCr),dlt=Xe(mu,j9,(e,t)=>{if(!(e==null||t==null))return w4(w4({},e),{},{scale:t})}),_Cr=Xe([mu,lC,vpe,slt],hpe),ECr=Xe([_Cr],Vhe);Xe((e,t,r)=>ppe(e,r),ECr,(e,t)=>{if(!(e==null||t==null))return w4(w4({},e),{},{scale:t})});var CCr=Xe([Fi,i9,o9],(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}}),jCr=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};Xe([jCr],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 flt=e=>e.options.defaultTooltipEventType,hlt=e=>e.options.validateTooltipEventTypes;function plt(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Ope(e,t){var r=flt(e),n=hlt(e);return plt(t,r,n)}function TCr(e){return en(t=>Ope(t,e))}var mlt=(e,t)=>{var r,n=Number(t);if(!(Xy(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},NCr=e=>e.tooltip.settings,Tb={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},ACr={itemInteraction:{click:Tb,hover:Tb},axisInteraction:{click:Tb,hover:Tb},keyboardInteraction:Tb,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}},glt=Tc({name:"tooltip",initialState:ACr,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:li()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:li()},removeTooltipEntrySettings:{reducer(e,t){var r=ph(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:li()},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:ICr,replaceTooltipEntrySettings:RCr,removeTooltipEntrySettings:PCr,setTooltipSettingsState:MCr,setActiveMouseOverItemIndex:DCr,mouseLeaveItem:BPn,mouseLeaveChart:ylt,setActiveClickItemIndex:UPn,setMouseOverAxisIndex:vlt,setMouseClickAxisIndex:LCr,setSyncInteraction:Wae,setKeyboardInteraction:O4}=glt.actions,$Cr=glt.reducer;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 ZD(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){FCr(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 FCr(e,t,r){return(t=zCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zCr(e){var t=BCr(e,"string");return typeof t=="symbol"?t:t+""}function BCr(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 UCr(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function VCr(e){return e.index!=null}var blt=(e,t,r,n)=>{if(t==null)return Tb;var s=UCr(e,t,r);if(s==null)return Tb;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(VCr(s)){if(a)return ZD(ZD({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return ZD(ZD({},Tb),{},{coordinate:s.coordinate})};function qCr(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 HCr(e,t){var r=qCr(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 QCr(e,t,r){if(r==null||t==null)return!0;var n=Yl(e,t);return n==null||!Zm(r)?!0:HCr(n,r)}var kpe=(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||QCr(u,r,n)?String(c):null},xlt=(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}}},wlt=(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})},Slt=e=>e.options.tooltipPayloadSearcher,cC=e=>e.tooltip;function dAe(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 fAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dAe(Object(r),!0).forEach(function(n){WCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function WCr(e,t,r){return(t=GCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GCr(e){var t=ZCr(e,"string");return typeof t=="symbol"?t:t+""}function ZCr(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 YCr(e){if(typeof e=="string"||typeof e=="number")return e}function XCr(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function KCr(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function hAe(e){if(typeof e=="string")return e}function JCr(e){if(!(e==null||typeof e!="object")){var t="name"in e?YCr(e.name):void 0,r="unit"in e?XCr(e.unit):void 0,n="dataKey"in e?KCr(e.dataKey):void 0,s="payload"in e?e.payload:void 0,a="color"in e?hAe(e.color):void 0,i="fill"in e?hAe(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:s,color:a,fill:i}}}function ejr(e,t){return e??t}var Olt=(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=ejr(g,l),w=Array.isArray(x)?Wat(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"?_=aat(w,n,s):_=a(w,t,c,k),Array.isArray(_))_.forEach(T=>{var j,N,I=JCr(T),P=I?.name,R=I?.dataKey,B=I?.payload,D=fAe(fAe({},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(dTe({tooltipEntrySettings:D,dataKey:R,payload:B,value:Yl(B,R),name:P==null?void 0:String(P)}))});else{var E;h.push(dTe({tooltipEntrySettings:y,dataKey:S,payload:_,value:Yl(_,S),name:(E=Yl(_,k))!==null&&E!==void 0?E:y?.name}))}return h},f)}},_pe=Xe([al,Iot,Dhe],jot),tjr=Xe([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),rjr=Xe([jl,iC],Rot),uC=Xe([tjr,al,rjr],Mot,{memoizeOptions:{resultEqualityCheck:w9}}),njr=Xe([uC],e=>e.filter(Uhe)),sjr=Xe([uC],$ot,{memoizeOptions:{resultEqualityCheck:w9}}),dC=Xe([sjr,o0],Fot),ajr=Xe([njr,o0,al],Hit),Epe=Xe([dC,al,uC],zot),klt=Xe([al],gpe),ijr=Xe([al],e=>e.allowDataOverflow),_lt=Xe([klt,ijr],Eit),ojr=Xe([uC],e=>e.filter(Uhe)),ljr=Xe([ajr,ojr,m9,Lit],Uot),cjr=Xe([ljr,o0,jl,_lt],Vot),ujr=Xe([uC],Lot),djr=Xe([dC,al,ujr,ype,jl],Qot,{memoizeOptions:{resultEqualityCheck:x9}}),fjr=Xe([Wot,jl,iC],oC),hjr=Xe([fjr,jl],Yot),pjr=Xe([Got,jl,iC],oC),mjr=Xe([pjr,jl],Xot),gjr=Xe([Zot,jl,iC],oC),yjr=Xe([gjr,jl],Kot),vjr=Xe([hjr,yjr,mjr],S4),bjr=Xe([al,klt,_lt,cjr,djr,vjr,Fi,jl],Jot),PP=Xe([al,Fi,dC,Epe,m9,jl,bjr],elt),xjr=Xe([PP,al,_pe],tlt),wjr=Xe([al,PP,xjr,jl],rlt),Elt=e=>{var t=jl(e),r=iC(e),n=!1;return RP(e,t,r,n)},Clt=Xe([al,Elt],g9),Sjr=Xe([al,_pe,wjr,Clt],hpe),jlt=Xe([Sjr],Vhe),Ojr=Xe([Fi,Epe,al,jl],llt),kjr=Xe([Fi,Epe,al,jl],alt),_jr=(e,t,r,n,s,a,i,l)=>{if(t){var{type:c}=t,u=yv(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?hh(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(Uu):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(Uu)}}},Ov=Xe([Fi,al,_pe,jlt,Elt,Ojr,kjr,jl],_jr),Cpe=Xe([flt,hlt,NCr],(e,t,r)=>plt(r.shared,e,t)),Tlt=e=>e.tooltip.settings.trigger,jpe=e=>e.tooltip.settings.defaultIndex,MP=Xe([cC,Cpe,Tlt,jpe],blt),cI=Xe([MP,dC,IP,PP],kpe),Nlt=Xe([Ov,cI],mlt),Ejr=Xe([MP],e=>{if(e)return e.dataKey}),Cjr=Xe([MP],e=>{if(e)return e.graphicalItemId}),Alt=Xe([cC,Cpe,Tlt,jpe],wlt),jjr=Xe([vv,bv,Fi,ec,Ov,jpe,Alt],xlt),Tjr=Xe([MP,jjr],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Njr=Xe([MP],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),Ajr=Xe([Alt,cI,o0,IP,Nlt,Slt,Cpe],Olt),Ijr=Xe([Ajr],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function pAe(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 mAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pAe(Object(r),!0).forEach(function(n){Rjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rjr(e,t,r){return(t=Pjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pjr(e){var t=Mjr(e,"string");return typeof t=="symbol"?t:t+""}function Mjr(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 Djr=()=>en(al),Ljr=()=>{var e=Djr(),t=en(Ov),r=en(jlt);return J5(!e||!r?void 0:mAe(mAe({},e),{},{scale:r}),t)};function gAe(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 OO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gAe(Object(r),!0).forEach(function(n){$jr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gAe(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=(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}},Ujr=(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 OO(OO(OO({},n),Hl(n.cx,n.cy,i,a)),{},{angle:a,radius:i})}var l=s.coordinate,{angle:c}=n;return OO(OO(OO({},n),Hl(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 Vjr(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 Ilt=(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(hh(m-p)!==hh(g-m)){var x=[];if(hh(g-m)===hh(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},qjr=()=>en(Dhe),Tpe=(e,t)=>t,Rlt=(e,t,r)=>r,Npe=(e,t,r,n)=>n,Hjr=Xe(Ov,e=>Yz(e,t=>t.coordinate)),Ape=Xe([cC,Tpe,Rlt,Npe],blt),Ipe=Xe([Ape,dC,IP,PP],kpe),Qjr=(e,t,r)=>{if(t!=null){var n=cC(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},Plt=Xe([cC,Tpe,Rlt,Npe],wlt),k4=Xe([vv,bv,Fi,ec,Ov,Npe,Plt],xlt),Wjr=Xe([Ape,k4],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),Mlt=Xe([Ov,Ipe],mlt),Gjr=Xe([Plt,Ipe,o0,IP,Mlt,Slt,Tpe],Olt),Zjr=Xe([Ape,Ipe],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Yjr=(e,t,r,n,s,a,i)=>{if(!(!e||!r||!n||!s)&&Vjr(e,i)){var l=eSr(e,t),c=Ilt(l,a,s,r,n),u=Bjr(t,s,c,e);return{activeIndex:String(c),activeCoordinate:u}}},Xjr=(e,t,r,n,s,a,i)=>{if(!(!e||!n||!s||!a||!r)){var l=mOr(e,r);if(l){var c=tSr(l,t),u=Ilt(c,i,a,n,s),d=Ujr(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},Kjr=(e,t,r,n,s,a,i,l)=>{if(!(!e||!t||!n||!s||!a))return t==="horizontal"||t==="vertical"?Yjr(e,t,n,s,a,i,l):Xjr(e,t,r,n,s,a,i)},Jjr=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}}),eTr=Xe(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(Jc)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:$Or}});function yAe(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 vAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yAe(Object(r),!0).forEach(function(n){tTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tTr(e,t,r){return(t=rTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rTr(e){var t=nTr(e,"string");return typeof t=="symbol"?t:t+""}function nTr(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 sTr={},aTr={zIndexMap:Object.values(Jc).reduce((e,t)=>vAe(vAe({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),sTr)},iTr=new Set(Object.values(Jc));function oTr(e){return iTr.has(e)}var Dlt=Tc({name:"zIndex",initialState:aTr,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:li()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!oTr(r)&&delete e.zIndexMap[r])},prepare:li()},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:li()},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:li()}}}),{registerZIndexPortal:lTr,unregisterZIndexPortal:cTr,registerZIndexPortalElement:uTr,unregisterZIndexPortalElement:dTr}=Dlt.actions,fTr=Dlt.reducer;function kv(e){var{zIndex:t,children:r}=e,n=PSr(),s=n&&t!==void 0&&t!==0,a=ld(),i=Vo();b.useLayoutEffect(()=>s?(i(lTr({zIndex:t})),()=>{i(cTr({zIndex:t}))}):g1,[i,t,s]);var l=en(c=>Jjr(c,t,a));return s?l?hu.createPortal(r,l):null:r}function Gae(){return Gae=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},Gae.apply(null,arguments)}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 YD(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){hTr(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 hTr(e,t,r){return(t=pTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pTr(e){var t=mTr(e,"string");return typeof t=="symbol"?t:t+""}function mTr(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 gTr(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return b.isValidElement(t)?b.cloneElement(t,n):b.createElement(r,n)}function yTr(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=T1r,y=Jc.cursorLine;else if(d==="BarChart")m=N1r(l,f,a,i),g=wit,y=Jc.cursorRectangle;else if(l==="radial"&&lat(f)){var{cx:x,cy:w,radius:S,startAngle:k,endAngle:_}=Sit(f);m={cx:x,cy:w,startAngle:k,endAngle:_,innerRadius:S,outerRadius:S},g=kit,y=Jc.cursorLine}else m={points:bOr(l,f,a)},g=git,y=Jc.cursorLine;var E=typeof c=="object"&&"className"in c?c.className:void 0,T=YD(YD(YD(YD({stroke:"#ccc",pointerEvents:"none"},a),m),Hz(c)),{},{payload:h,payloadIndex:p,className:xa("recharts-tooltip-cursor",E)});return b.createElement(kv,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:y},b.createElement(gTr,{cursor:c,cursorComp:g,cursorProps:T}))}function vTr(e){var t=Ljr(),r=rit(),n=nC(),s=qjr();return t==null||r==null||n==null||s==null?null:b.createElement(yTr,Gae({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var Llt=b.createContext(null),bTr=()=>b.useContext(Llt),YH={exports:{}},xAe;function xTr(){return xAe||(xAe=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})(YH)),YH.exports}var wTr=xTr();const STr=Uo(wTr);var uI=new STr,Zae="recharts.syncEvent.tooltip",wAe="recharts.syncEvent.brush",OTr=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Xy(r))return e[r]}},kTr={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},$lt=Tc({name:"options",initialState:kTr,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),_Tr=$lt.reducer,{createEventEmitter:ETr}=$lt.actions;function CTr(e){return e.tooltip.syncInteraction}var jTr={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Flt=Tc({name:"chartData",initialState:jTr,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:SAe,setDataStartEndIndexes:TTr,setComputedData:VPn}=Flt.actions,NTr=Flt.reducer,ATr=["x","y"];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 kO(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){ITr(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 ITr(e,t,r){return(t=RTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RTr(e){var t=PTr(e,"string");return typeof t=="symbol"?t:t+""}function PTr(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 MTr(e,t){if(e==null)return{};var r,n,s=DTr(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 DTr(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 LTr(){var e=en(Lhe),t=en($he),r=Vo(),n=en($it),s=en(Ov),a=nC(),i=u9(),l=en(c=>c.rootProps.className);b.useEffect(()=>{if(e==null)return g1;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=MTr(p,ATr),{x,y:w,width:S,height:k}=d.payload.sourceViewBox,_=kO(kO({},y),{},{x:i.x+(S?(m-x)/S:0)*i.width,y:i.y+(k?(g-w)/k:0)*i.height});r(kO(kO({},d),{},{payload:kO(kO({},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(Wae({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},$=Wae({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 uI.on(Zae,c),()=>{uI.off(Zae,c)}},[l,r,t,e,n,s,a,i])}function $Tr(){var e=en(Lhe),t=en($he),r=Vo();b.useEffect(()=>{if(e==null)return g1;var n=(s,a,i)=>{t!==i&&e===s&&r(TTr(a))};return uI.on(wAe,n),()=>{uI.off(wAe,n)}},[r,t,e])}function FTr(){var e=Vo();b.useEffect(()=>{e(ETr())},[e]),LTr(),$Tr()}function zTr(e,t,r,n,s,a){var i=en(m=>Qjr(m,e,t)),l=en(Cjr),c=en($he),u=en(Lhe),d=en($it),f=en(CTr),h=f?.active,p=u9();b.useEffect(()=>{if(!h&&u!=null&&c!=null){var m=Wae({active:a,coordinate:r,dataKey:i,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:p,graphicalItemId:l});uI.emit(Zae,u,m,c)}},[h,r,i,l,s,n,c,u,d,a,p])}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 _Ae(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){BTr(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 BTr(e,t,r){return(t=UTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UTr(e){var t=VTr(e,"string");return typeof t=="symbol"?t:t+""}function VTr(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 qTr(e){return e.dataKey}function HTr(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(s1r,t)}var EAe=[],QTr={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 WTr(e){var t,r,n=od(e,QTr),{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(MCr({shared:w,trigger:S,axisId:E,active:s,defaultIndex:j}))},[T,w,S,E,s,j]);var N=u9(),I=mit(),P=TCr(w),{activeIndex:R,isActive:B}=(t=en(te=>Zjr(te,P,S,j)))!==null&&t!==void 0?t:{},D=en(te=>Gjr(te,P,S,j)),$=en(te=>Mlt(te,P,S,j)),U=en(te=>Wjr(te,P,S,j)),z=D,H=bTr(),Q=(r=s??B)!==null&&r!==void 0?r:!1,[L,Z]=Q0r([z,Q]),V=P==="axis"?$:void 0;zTr(P,S,U,V,R,Q);var M=_??H;if(M==null||N==null||P==null)return null;var W=z??EAe;Q||(W=EAe),u&&W.length&&(W=R0r(W.filter(te=>te.value!=null&&(te.hide!==!0||n.includeHidden)),h,qTr));var G=W.length>0,J=_Ae(_Ae({},n),{},{payload:W,label:V,active:Q,activeIndex:R,coordinate:U,accessibilityLayer:I}),ae=b.createElement(m1r,{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:!!_},HTr(c,J));return b.createElement(b.Fragment,null,hu.createPortal(ae,M),Q&&b.createElement(vTr,{cursor:x,tooltipEventType:P,coordinate:U,payload:W,index:R}))}function GTr(e,t,r){return(t=ZTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZTr(e){var t=YTr(e,"string");return typeof t=="symbol"?t:t+""}function YTr(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 XTr{constructor(t){GTr(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 CAe(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 KTr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CAe(Object(r),!0).forEach(function(n){JTr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}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)}var rNr={cacheSize:2e3,enableCache:!0},zlt=KTr({},rNr),jAe=new XTr(zlt.cacheSize),nNr={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},TAe="recharts_measurement_span";function sNr(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 NAe=(e,t)=>{try{var r=document.getElementById(TAe);r||(r=document.createElement("span"),r.setAttribute("id",TAe),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,nNr,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},AN=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||kP.isSsr)return{width:0,height:0};if(!zlt.enableCache)return NAe(t,r);var n=sNr(t,r),s=jAe.get(n);if(s)return s;var a=NAe(t,r);return jAe.set(n,a),a},Blt;function aNr(e,t,r){return(t=iNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iNr(e){var t=oNr(e,"string");return typeof t=="symbol"?t:t+""}function oNr(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 AAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,IAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,lNr=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,cNr=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,uNr={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},dNr=["cm","mm","pt","pc","in","Q","px"];function fNr(e){return dNr.includes(e)}var gk="NaN";function hNr(e,t){return e*uNr[t]}class $l{static parse(t){var r,[,n,s]=(r=cNr.exec(t))!==null&&r!==void 0?r:[];return n==null?$l.NaN:new $l(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Xy(t)&&(this.unit=""),r!==""&&!lNr.test(r)&&(this.num=NaN,this.unit=""),fNr(r)&&(this.num=hNr(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new $l(NaN,""):new $l(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new $l(NaN,""):new $l(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new $l(NaN,""):new $l(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new $l(NaN,""):new $l(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Xy(this.num)}}Blt=$l;aNr($l,"NaN",new Blt(NaN,""));function Ult(e){if(e==null||e.includes(gk))return gk;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,a]=(r=AAe.exec(t))!==null&&r!==void 0?r:[],i=$l.parse(n??""),l=$l.parse(a??""),c=s==="*"?i.multiply(l):i.divide(l);if(c.isNaN())return gk;t=t.replace(AAe,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,h]=(u=IAe.exec(t))!==null&&u!==void 0?u:[],p=$l.parse(d??""),m=$l.parse(h??""),g=f==="+"?p.add(m):p.subtract(m);if(g.isNaN())return gk;t=t.replace(IAe,g.toString())}return t}var RAe=/\(([^()]*)\)/;function pNr(e){for(var t=e,r;(r=RAe.exec(t))!=null;){var[,n]=r;t=t.replace(RAe,Ult(n))}return t}function mNr(e){var t=e.replace(/\s+/g,"");return t=pNr(t),t=Ult(t),t}function gNr(e){try{return mNr(e)}catch{return gk}}function XH(e){var t=gNr(e.slice(5,-1));return t===gk?"":t}var yNr=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],vNr=["dx","dy","angle","className","breakAll"];function Yae(){return Yae=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},Yae.apply(null,arguments)}function PAe(e,t){if(e==null)return{};var r,n,s=bNr(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 bNr(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 Vlt=/[ \f\n\r\t\v\u2028\u2029]+/,qlt=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];_l(t)||(r?s=t.toString().split(""):s=t.toString().split(Vlt));var a=s.map(l=>({word:l,width:AN(l,n).width})),i=r?0:AN(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:i}}catch{return null}};function Hlt(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function xNr(e){return _l(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Qlt=(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},[]),Wlt=e=>e.reduce((t,r)=>t.width>r.width?t:r),wNr="…",MAe=(e,t,r,n,s,a,i,l)=>{var c=e.slice(0,t),u=qlt({breakAll:r,style:n,children:c+wNr});if(!u)return[!1,[]];var d=Qlt(u.wordsWithComputedWidth,a,i,l),f=d.length>s||Wlt(d).width>Number(a);return[f,d]},SNr=(e,t,r,n,s)=>{var{maxLines:a,children:i,style:l,breakAll:c}=e,u=qr(a),d=String(i),f=Qlt(t,n,r,s);if(!u||s)return f;var h=f.length>a||Wlt(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]=MAe(d,w,c,l,a,n,r,s),[_]=MAe(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},DAe=e=>{var t=_l(e)?[]:e.toString().split(Vlt);return[{words:t,width:void 0}]},ONr=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:a,maxLines:i}=e;if((t||r)&&!kP.isSsr){var l,c,u=qlt({breakAll:a,children:n,style:s});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return DAe(n);return SNr({breakAll:a,children:n,maxLines:i,style:s},l,c,t,!!r)}return DAe(n)},Glt="#808080",kNr={angle:0,breakAll:!1,capHeight:"0.71em",fill:Glt,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Rpe=b.forwardRef((e,t)=>{var r=od(e,kNr),{x:n,y:s,lineHeight:a,capHeight:i,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=r,f=PAe(r,yNr),h=b.useMemo(()=>ONr({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=PAe(f,vNr);if(!ag(n)||!ag(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":_=XH("calc(".concat(i,")"));break;case"middle":_=XH("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(i," / 2))"));break;default:_=XH("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",Yae({},lu(w),{ref:t,x:S,y:k,className:xa("recharts-text",y),textAnchor:u,fill:l.includes("url")?Glt: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)}))});Rpe.displayName="Text";function LAe(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 lm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LAe(Object(r),!0).forEach(function(n){_Nr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _Nr(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=CNr(e,"string");return typeof t=="symbol"?t:t+""}function CNr(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 jNr=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:a,y:i,height:l,upperWidth:c,lowerWidth:u}=Che(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"?lm({x:h+k,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideRight"?lm({x:h+p-k,y:i+l/2,horizontalAnchor:_,verticalAnchor:"middle"},R):r==="insideTop"?lm({x:d+c/2,y:i+y,horizontalAnchor:"middle",verticalAnchor:w},R):r==="insideBottom"?lm({x:f+u/2,y:i+l-y,horizontalAnchor:"middle",verticalAnchor:x},R):r==="insideTopLeft"?lm({x:d+k,y:i+y,horizontalAnchor:E,verticalAnchor:w},R):r==="insideTopRight"?lm({x:d+c-k,y:i+y,horizontalAnchor:_,verticalAnchor:w},R):r==="insideBottomLeft"?lm({x:f+k,y:i+l-y,horizontalAnchor:E,verticalAnchor:x},R):r==="insideBottomRight"?lm({x:f+u-k,y:i+l-y,horizontalAnchor:_,verticalAnchor:x},R):r&&typeof r=="object"&&(qr(r.x)||CS(r.x))&&(qr(r.y)||CS(r.y))?lm({x:a+Cx(r.x,p),y:i+Cx(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},R):lm({x:m,y:i+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},TNr=["labelRef"],NNr=["content"];function $Ae(e,t){if(e==null)return{};var r,n,s=ANr(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 ANr(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 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 WT(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){INr(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 INr(e,t,r){return(t=RNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RNr(e){var t=PNr(e,"string");return typeof t=="symbol"?t:t+""}function PNr(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 Ey(){return Ey=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},Ey.apply(null,arguments)}var Zlt=b.createContext(null),MNr=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(Zlt.Provider,{value:c},l)},Ylt=()=>{var e=b.useContext(Zlt),t=u9();return e||(t?Che(t):void 0)},DNr=b.createContext(null),LNr=()=>{var e=b.useContext(DNr),t=en(Vit);return e||t},$Nr=e=>{var{value:t,formatter:r}=e,n=_l(e.children)?t:e.children;return typeof r=="function"?r(n):n},Ppe=e=>e!=null&&typeof e=="function",FNr=(e,t)=>{var r=hh(t-e),n=Math.min(Math.abs(t-e),360);return r*n},zNr=(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=FNr(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=Hl(l,c,m,x),k=Hl(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=_l(e.id)?XA("recharts-radial-line-"):e.id;return b.createElement("text",Ey({},n,{dominantBaseline:"central",className:xa("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},BNr=(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}=Hl(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}=Hl(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},T$=e=>e!=null&&"cx"in e&&qr(e.cx),UNr={angle:0,offset:5,zIndex:Jc.label,position:"middle",textBreakAll:!1};function VNr(e){if(!T$(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 kb(e){var t=od(e,UNr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=LNr(),h=Ylt(),p=s==="center"?h:f??h,m,g,y;r==null?m=p:T$(r)?m=r:m=Che(r);var x=VNr(m);if(!m||_l(a)&&_l(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=WT(WT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=$Ae(w,TNr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=$Ae(w,NNr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=$Nr(t);var T=lu(t);if(T$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return zNr(t,s,g,T,m);y=BNr(m,t.offset,t.position)}else{if(!x)return null;var j=jNr({viewBox:x,position:s,offset:t.offset,parentViewBox:T$(n)?void 0:n});y=WT(WT({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(kv,{zIndex:t.zIndex},b.createElement(Rpe,Ey({ref:d,className:xa("recharts-label",c)},T,y,{textAnchor:Hlt(T.textAnchor)?T.textAnchor:y.textAnchor,breakAll:u}),g))}kb.displayName="Label";var qNr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(kb,Ey({key:"label-implicit"},n)):ag(e)?b.createElement(kb,Ey({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===kb?b.cloneElement(e,WT({key:"label-implicit"},n)):b.createElement(kb,Ey({key:"label-implicit",content:e},n)):Ppe(e)?b.createElement(kb,Ey({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(kb,Ey({},e,{key:"label-implicit"},n)):null};function HNr(e){var{label:t,labelRef:r}=e,n=Ylt();return qNr(t,n,r)||null}var QNr=["valueAccessor"],WNr=["dataKey","clockWise","id","textBreakAll","zIndex"];function _4(){return _4=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},_4.apply(null,arguments)}function zAe(e,t){if(e==null)return{};var r,n,s=GNr(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 GNr(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 ZNr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(xNr(t))return t},Xlt=b.createContext(void 0),YNr=Xlt.Provider,Klt=b.createContext(void 0);Klt.Provider;function XNr(){return b.useContext(Xlt)}function KNr(){return b.useContext(Klt)}function N$(e){var{valueAccessor:t=ZNr}=e,r=zAe(e,QNr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=zAe(r,WNr),u=XNr(),d=KNr(),f=u||d;return!f||!f.length?null:b.createElement(kv,{zIndex:l??Jc.label},b.createElement(Yy,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=_l(n)?t(h,p):Yl(h.payload,n),y=_l(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(kb,_4({key:"label-".concat(p)},lu(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}))})))}N$.displayName="LabelList";function JNr(e){var{label:t}=e;return t?t===!0?b.createElement(N$,{key:"labelList-implicit"}):b.isValidElement(t)||Ppe(t)?b.createElement(N$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(N$,_4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Xae(){return Xae=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},Xae.apply(null,arguments)}var Jlt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=xa("recharts-dot",s);return qr(t)&&qr(r)&&qr(n)?b.createElement("circle",Xae({},sg(e),vhe(e),{className:a,cx:t,cy:r,r:n})):null},eAr={radiusAxis:{},angleAxis:{}},ect=Tc({name:"polarAxis",initialState:eAr,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:HPn,addAngleAxis:QPn,removeAngleAxis:WPn}=ect.actions,tAr=ect.reducer;function rAr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var KH={exports:{}},Ks={};var BAe;function nAr(){if(BAe)return Ks;BAe=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 Ks.ContextConsumer=i,Ks.ContextProvider=a,Ks.Element=e,Ks.ForwardRef=c,Ks.Fragment=r,Ks.Lazy=h,Ks.Memo=f,Ks.Portal=t,Ks.Profiler=s,Ks.StrictMode=n,Ks.Suspense=u,Ks.SuspenseList=d,Ks.isAsyncMode=function(){return!1},Ks.isConcurrentMode=function(){return!1},Ks.isContextConsumer=function(y){return g(y)===i},Ks.isContextProvider=function(y){return g(y)===a},Ks.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Ks.isForwardRef=function(y){return g(y)===c},Ks.isFragment=function(y){return g(y)===r},Ks.isLazy=function(y){return g(y)===h},Ks.isMemo=function(y){return g(y)===f},Ks.isPortal=function(y){return g(y)===t},Ks.isProfiler=function(y){return g(y)===s},Ks.isStrictMode=function(y){return g(y)===n},Ks.isSuspense=function(y){return g(y)===u},Ks.isSuspenseList=function(y){return g(y)===d},Ks.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)},Ks.typeOf=g,Ks}var UAe;function sAr(){return UAe||(UAe=1,KH.exports=nAr()),KH.exports}sAr();var tct=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,JH={},VAe;function aAr(){return VAe||(VAe=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})(JH)),JH}var eQ,qAe;function iAr(){return qAe||(qAe=1,eQ=aAr().isPlainObject),eQ}var oAr=iAr();const lAr=Uo(oAr);var HAe,QAe,WAe,GAe,ZAe;function YAe(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 XAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YAe(Object(r),!0).forEach(function(n){cAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cAr(e,t,r){return(t=uAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uAr(e){var t=dAr(e,"string");return typeof t=="symbol"?t:t+""}function dAr(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 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)}function iT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var KAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(HAe||(HAe=iT(["M ",",",""])),e,t),i+=Qi(QAe||(QAe=iT(["L ",",",""])),e+r,t),i+=Qi(WAe||(WAe=iT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(GAe||(GAe=iT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(ZAe||(ZAe=iT(["L ",","," Z"])),e,t),i},fAr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hAr=e=>{var t=od(e,fAr),{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=Ahe(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 _=xa("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",E4({},lu(t),{className:_,d:KAe(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=yit(["strokeDasharray"],u,c);return b.createElement(Nhe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},D=>{var $=Fu(E,s,D),U=Fu(T,a,D),z=Fu(j,i,D),H=Fu(N,r,D),Q=Fu(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",E4({},lu(t),{className:_,d:KAe(H,Q,$,U,z),ref:h,style:XAe(XAe({},L),t.style)}))})},pAr=["option","shapeType","activeClassName","inActiveClassName"];function mAr(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 JAe(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 C4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JAe(Object(r),!0).forEach(function(n){yAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yAr(e,t,r){return(t=vAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vAr(e){var t=bAr(e,"string");return typeof t=="symbol"?t:t+""}function bAr(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 xAr(e,t){return C4(C4({},t),e)}function wAr(e,t){return e==="symbols"}function eIe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(wit,r);case"trapezoid":return b.createElement(hAr,r);case"sector":return b.createElement(kit,r);case"symbols":if(wAr(t))return b.createElement(oat,r);break;case"curve":return b.createElement(git,r);default:return null}}function SAr(e){return b.isValidElement(e)?e.props:e}function OAr(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=mAr(e,pAr),i;if(b.isValidElement(t))i=b.cloneElement(t,C4(C4({},a),SAr(t)));else if(typeof t=="function")i=t(a,a.index);else if(lAr(t)&&typeof t!="boolean"){var l=xAr(t,a);i=b.createElement(eIe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(eIe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Yy,{className:n},i):b.createElement(Yy,{className:s},i)}function kAr(e){var{tooltipEntrySettings:t}=e,r=Vo(),n=ld(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(ICr(t)):s.current!==t&&r(RCr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(PCr(s.current)),s.current=null)},[r]),null}function _Ar(e){var{legendPayload:t}=e,r=Vo(),n=ld(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(WSr(t)):s.current!==t&&r(GSr({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(ZSr(s.current)),s.current=null)},[r]),null}var tQ,EAr=()=>{var[e]=b.useState(()=>XA("uid-"));return e},CAr=(tQ=JS.useId)!==null&&tQ!==void 0?tQ:EAr;function jAr(e,t){var r=CAr();return t||(e?"".concat(e,"-").concat(r):r)}var TAr=b.createContext(void 0),NAr=e=>{var{id:t,type:r,children:n}=e,s=jAr("recharts-".concat(r),t);return b.createElement(TAr.Provider,{value:s},n(s))},AAr={cartesianItems:[],polarItems:[]},rct=Tc({name:"graphicalItems",initialState:AAr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:li()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:li()},removeCartesianGraphicalItem:{reducer(e,t){var r=ph(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:li()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:li()},removePolarGraphicalItem:{reducer(e,t){var r=ph(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:li()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:li()}}}),{addCartesianGraphicalItem:IAr,replaceCartesianGraphicalItem:RAr,removeCartesianGraphicalItem:PAr,addPolarGraphicalItem:GPn,removePolarGraphicalItem:ZPn,replacePolarGraphicalItem:YPn}=rct.actions,MAr=rct.reducer,DAr=e=>{var t=Vo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(IAr(e)):r.current!==e&&t(RAr({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(PAr(r.current)),r.current=null)},[t]),null},LAr=b.memo(DAr),$Ar=["points"];function tIe(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 rQ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tIe(Object(r),!0).forEach(function(n){FAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FAr(e,t,r){return(t=zAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zAr(e){var t=BAr(e,"string");return typeof t=="symbol"?t:t+""}function BAr(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 j4(){return j4=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},j4.apply(null,arguments)}function UAr(e,t){if(e==null)return{};var r,n,s=VAr(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 VAr(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 qAr(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=xa(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=UAr(a,$Ar);return b.createElement(Jlt,j4({},l,{className:s}))}function HAr(e,t){return e==null?!1:t?!0:e.length===1}function QAr(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Jc.scatter}=e;if(!HAr(t,r))return null;var d=tct(r),f=sxr(r),h=t.map((m,g)=>{var y,x,w=rQ(rQ(rQ({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(qAr,{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(kv,{zIndex:u},b.createElement(Yy,j4({className:n},p),h))}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 nIe(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){WAr(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 WAr(e,t,r){return(t=GAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GAr(e){var t=ZAr(e,"string");return typeof t=="symbol"?t:t+""}function ZAr(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 YAr={xAxis:{},yAxis:{},zAxis:{}},nct=Tc({name:"cartesianAxis",initialState:YAr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:li()},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:li()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:li()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:li()},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:li()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:li()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:li()},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:li()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:li()},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]=nIe(nIe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:XAr,replaceXAxis:KAr,removeXAxis:JAr,addYAxis:eIr,replaceYAxis:tIr,removeYAxis:rIr,addZAxis:XPn,replaceZAxis:KPn,removeZAxis:JPn,updateYAxisWidth:nIr}=nct.actions,sIr=nct.reducer,aIr=Xe([ec],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),iIr=Xe([aIr,vv,bv],(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)}}),Mpe=()=>en(iIr),oIr=()=>en(Ijr);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 nQ(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){lIr(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 lIr(e,t,r){return(t=cIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cIr(e){var t=uIr(e,"string");return typeof t=="symbol"?t:t+""}function uIr(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 dIr=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=nQ(nQ(nQ({},l),Hz(s)),vhe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Jlt,c),b.createElement(Yy,{className:"recharts-active-dot",clipPath:i},u)};function fIr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=Jc.activeDot}=e,l=en(cI),c=oIr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return _l(u)?null:b.createElement(kv,{zIndex:i},b.createElement(dIr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var hIr=e=>{var{chartData:t}=e,r=Vo(),n=ld();return b.useEffect(()=>n?()=>{}:(r(SAe(t)),()=>{r(SAe(void 0))}),[t,r,n]),null},aIe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},sct=Tc({name:"brush",initialState:aIe,reducers:{setBrushSettings(e,t){return t.payload==null?aIe:t.payload}}}),{setBrushSettings:eMn}=sct.actions,pIr=sct.reducer;function mIr(e){return(e%180+180)%180}var gIr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=mIr(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)},yIr={dots:[],areas:[],lines:[]},act=Tc({name:"referenceElements",initialState:yIr,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=ph(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=ph(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=ph(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:tMn,removeDot:rMn,addArea:nMn,removeArea:sMn,addLine:aMn,removeLine:iMn}=act.actions,vIr=act.reducer,bIr=b.createContext(void 0),xIr=e=>{var{children:t}=e,[r]=b.useState("".concat(XA("recharts"),"-clip")),n=Mpe();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(bIr.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 ict(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 wIr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return gIr(n,r)}function SIr(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 dI(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 OIr(e,t){return ict(e,t+1)}function kIr(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:ict(n,u)};var g=c,y,x=()=>(y===void 0&&(y=r(m,g)),y),w=m.coordinate,S=c===0||dI(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 _Ir(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||dI(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 iIe(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 ic(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iIe(Object(r),!0).forEach(function(n){EIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EIr(e,t,r){return(t=CIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CIr(e){var t=jIr(e,"string");return typeof t=="symbol"?t:t+""}function jIr(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 TIr(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=ic(ic({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=ic(ic({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=dI(e,m.tickCoord,y,l,c);w&&(c=m.tickCoord-e*(y()/2+s),a[h]=ic(ic({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function NIr(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=ic(ic({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=dI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=ic(ic({},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=ic(ic({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=ic(ic({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=dI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=ic(ic({},k),{},{isShow:!0}))}},y=0;y<m;y++)g(y);return i}function Dpe(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)||kP.isSsr){var h;return(h=OIr(s,qr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?AN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?wIr(AN(T,{fontSize:t,letterSpacing:r}),g,f):AN(T,{fontSize:t,letterSpacing:r})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?hh(w.coordinate-x.coordinate):1,k=SIr(a,S,m);return c==="equidistantPreserveStart"?kIr(S,k,y,s,i):c==="equidistantPreserveEnd"?_Ir(S,k,y,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=NIr(S,k,y,s,i,c==="preserveStartEnd"):p=TIr(S,k,y,s,i),p.filter(_=>_.isShow))}var AIr=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},IIr={xAxis:{},yAxis:{}},oct=Tc({name:"renderedTicks",initialState:IIr,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:RIr,removeRenderedTicks:PIr}=oct.actions,MIr=oct.reducer,DIr=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function LIr(e,t){if(e==null)return{};var r,n,s=$Ir(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 $Ir(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 RS(){return RS=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},RS.apply(null,arguments)}function oIe(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?oIe(Object(r),!0).forEach(function(n){FIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FIr(e,t,r){return(t=zIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zIr(e){var t=BIr(e,"string");return typeof t=="symbol"?t:t+""}function BIr(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 zy={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:Jc.axis};function UIr(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),sg(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",RS({},u,{className:xa("recharts-cartesian-axis-line",Zz(l,"className"))}))}function VIr(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 qIr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function HIr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function QIr(e){var{option:t,tickProps:r,value:n}=e,s,a=xa(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=xa(i,rAr(t))),s=b.createElement(Rpe,RS({},r,{className:i}),n)}return s}function WIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Vo();return b.useEffect(()=>{if(n==null||r==null)return g1;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(RIr({ticks:a,axisId:n,axisType:r})),()=>{s(PIr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var GIr=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=Dpe(Hi(Hi({},k),{},{ticks:r}),w,S),N=sg(k),I=Hz(n),P=Hlt(N.textAnchor)?N.textAnchor:qIr(d,f),R=HIr(d,f),B={};typeof s=="object"&&(B=s);var D=Hi(Hi({},N),{},{fill:"none"},B),$=j.map(H=>Hi({entry:H},VIr(H,h,p,m,g,d,y,f,x))),U=$.map(H=>{var{entry:Q,line:L}=H;return b.createElement(Yy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&b.createElement("line",RS({},D,L,{className:xa("recharts-cartesian-axis-tick-line",Zz(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(Yy,RS({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},l0r(_,V,Q)),n&&b.createElement(QIr,{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(WIr,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(kv,{zIndex:Jc.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))}),ZIr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=LIr(e,DIr),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return AIr({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(kv,{zIndex:e.zIndex},b.createElement(Yy,{className:xa("recharts-cartesian-axis",a)},b.createElement(UIr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:sg(e)}),b.createElement(GIr,{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(MNr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(HNr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Lpe=b.forwardRef((e,t)=>{var r=od(e,zy);return b.createElement(ZIr,RS({},r,{ref:t}))});Lpe.displayName="CartesianAxis";var YIr=["x1","y1","x2","y2","key"],XIr=["offset"],KIr=["xAxisId","yAxisId"],JIr=["xAxisId","yAxisId"];function lIe(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 fc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lIe(Object(r),!0).forEach(function(n){eRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eRr(e,t,r){return(t=tRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tRr(e){var t=rRr(e,"string");return typeof t=="symbol"?t:t+""}function rRr(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 Nw(){return Nw=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},Nw.apply(null,arguments)}function T4(e,t){if(e==null)return{};var r,n,s=nRr(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 nRr(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=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 lct(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=T4(r,YIr),f=(s=sg(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=T4(f,XIr);n=b.createElement("line",Nw({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function aRr(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=T4(e,KIr),c=s.map((u,d)=>{var f=fc(fc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(lct,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function iRr(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=T4(e,JIr),c=s.map((u,d)=>{var f=fc(fc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(lct,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function oRr(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 lRr(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 cRr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return Gat(Dpe(fc(fc(fc({},zy),r),{},{ticks:Zat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},uRr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return Gat(Dpe(fc(fc(fc({},zy),r),{},{ticks:Zat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},dRr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Jc.grid};function cct(e){var t=nit(),r=sit(),n=rit(),s=fc(fc({},od(e,dRr)),{},{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=ld(),g=en(N=>cAe(N,"xAxis",a,m)),y=en(N=>cAe(N,"yAxis",i,m));if(!ig(u)||!ig(d)||!qr(l)||!qr(c))return null;var x=s.verticalCoordinatesGenerator||cRr,w=s.horizontalCoordinatesGenerator||uRr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:y?fc(fc({},y),{},{ticks:_?h:y.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);e4(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?fc(fc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);e4(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(kv,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(sRr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(oRr,Nw({},s,{horizontalPoints:S})),b.createElement(lRr,Nw({},s,{verticalPoints:k})),b.createElement(aRr,Nw({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:y})),b.createElement(iRr,Nw({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:y}))))}cct.displayName="CartesianGrid";var fRr={},uct=Tc({name:"errorBars",initialState:fRr,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:oMn,replaceErrorBar:lMn,removeErrorBar:cMn}=uct.actions,hRr=uct.reducer,pRr=["children"];function mRr(e,t){if(e==null)return{};var r,n,s=gRr(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 gRr(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 yRr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},vRr=b.createContext(yRr);function bRr(e){var{children:t}=e,r=mRr(e,pRr);return b.createElement(vRr.Provider,{value:r},t)}function dct(e,t){var r,n,s=en(u=>wv(u,e)),a=en(u=>Sv(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 xRr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=Mpe(),{needClipX:a,needClipY:i,needClip:l}=dct(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 fct=(e,t,r,n)=>dlt(e,"xAxis",t,n),hct=(e,t,r,n)=>ult(e,"xAxis",t,n),pct=(e,t,r,n)=>dlt(e,"yAxis",r,n),mct=(e,t,r,n)=>ult(e,"yAxis",r,n),wRr=Xe([Fi,fct,pct,hct,mct],(e,t,r,n,s)=>yv(e,"xAxis")?J5(t,n,!1):J5(r,s,!1)),SRr=(e,t,r,n,s)=>s;function ORr(e){return e.type==="line"}var kRr=Xe([Pot,SRr],(e,t)=>e.filter(ORr).find(r=>r.id===t)),_Rr=Xe([Fi,fct,pct,hct,mct,kRr,wRr,Ihe],(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 QRr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function ERr(e){var t=Hz(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 CRr=["id"],jRr=["type","layout","connectNulls","needClip","shape"],TRr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function fI(){return fI=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},fI.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 bm(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){NRr(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 NRr(e,t,r){return(t=ARr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ARr(e){var t=IRr(e,"string");return typeof t=="symbol"?t:t+""}function IRr(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 $pe(e,t){if(e==null)return{};var r,n,s=RRr(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 RRr(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 PRr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:Yat(r,t),payload:e}]},MRr=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:g1,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Yat(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(kAr,{tooltipEntrySettings:f})}),gct=(e,t)=>"".concat(t,"px ").concat(e,"px");function DRr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var LRr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return gct(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[...DRr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function $Rr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=$pe(n,CRr),u=sg(c);return b.createElement(QAr,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function FRr(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 bm(bm({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(YNr,{value:t?s:void 0},r)}function uIe(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=$pe(a,jRr),h=bm(bm({},lu(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(OAr,fI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement($Rr,{points:n,clipPathId:t,props:a}))}function zRr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function BRr(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=Ahe(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=zRr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(FRr,{points:i,showLabels:E},r.children,b.createElement(Nhe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Fu(P,N+P,R),D=Math.min(B,N),$;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Q=>parseFloat(Q));$=LRr(D,N,U)}else $=gct(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 bm(bm({},Q),{},{x:Fu(V.x,Q.x,R),y:Fu(V.y,Q.y,R)})}return h?bm(bm({},Q),{},{x:Fu(p*2,Q.x,R),y:Fu(m/2,Q.y,R)}):bm(bm({},Q),{},{x:Q.x,y:Q.y})});return s.current=H,b.createElement(uIe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:$})}return b.createElement(uIe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:$})}),b.createElement(JNr,{label:r.label}))}function URr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(BRr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var VRr=(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:Yl(e.payload,t)}};class qRr 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=xa("recharts-line",s),g=f,{r:y,strokeWidth:x}=ERr(r),w=tct(r),S=y*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(kv,{zIndex:p},b.createElement(Yy,{className:m},h&&b.createElement("defs",null,b.createElement(xRr,{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(bRr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:VRr,errorBarOffset:0},b.createElement(URr,{props:this.props,clipPathId:g}))),b.createElement(fIr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var yct={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:Jc.line,type:"linear"};function HRr(e){var t=od(e,yct),{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=$pe(t,TRr),{needClip:x}=dct(p,m),w=Mpe(),S=nC(),k=ld(),_=en(I=>_Rr(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(qRr,fI({},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 QRr(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=Yl(u,i);if(t==="horizontal"){var h=lTe({axis:r,ticks:s,bandSize:l,entry:u,index:d}),p=_l(f)?null:n.scale.map(f);return{x:h,y:p??null,value:f,payload:u}}var m=_l(f)?null:r.scale.map(f),g=lTe({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 WRr(e){var t=od(e,yct),r=ld();return b.createElement(NAr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(_Ar,{legendPayload:PRr(t)}),b.createElement(MRr,{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(LAr,{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(HRr,fI({},t,{id:n}))))}var vct=b.memo(WRr,p9);vct.displayName="Line";var GRr=["domain","range"],ZRr=["domain","range"];function dIe(e,t){if(e==null)return{};var r,n,s=YRr(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 YRr(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 fIe(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 bct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=dIe(e,GRr),{domain:a,range:i}=t,l=dIe(t,ZRr);return!fIe(r,a)||!fIe(n,i)?!1:p9(s,l)}var XRr=["type"],KRr=["dangerouslySetInnerHTML","ticks","scale"],JRr=["id","scale"];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 hIe(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 pIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hIe(Object(r),!0).forEach(function(n){ePr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ePr(e,t,r){return(t=tPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tPr(e){var t=rPr(e,"string");return typeof t=="symbol"?t:t+""}function rPr(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 Jae(e,t){if(e==null)return{};var r,n,s=nPr(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 nPr(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 sPr(e){var t=Vo(),r=b.useRef(null),n=ait(),{type:s}=e,a=Jae(e,XRr),i=y9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return pIe(pIe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(XAr(l)):r.current!==l&&t(KAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(JAr(r.current)),r.current=null)},[t]),null}var aPr=e=>{var{xAxisId:t,className:r}=e,n=en(Kat),s=ld(),a="xAxis",i=en(x=>clt(x,a,t,s)),l=en(x=>hCr(x,t)),c=en(x=>bCr(x,t)),u=en(x=>Not(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Jae(e,KRr),{id:m,scale:g}=u,y=Jae(u,JRr);return b.createElement(Lpe,Kae({},p,y,{x:c.x,y:c.y,width:l.width,height:l.height,className:xa("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},iPr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:zy.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:zy.tickLine,tickSize:zy.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,xAxisId:0},oPr=e=>{var t=od(e,iPr);return b.createElement(b.Fragment,null,b.createElement(sPr,{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(aPr,t))},xct=b.memo(oPr,bct);xct.displayName="XAxis";var lPr=["type"],cPr=["dangerouslySetInnerHTML","ticks","scale"],uPr=["id","scale"];function eie(){return eie=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},eie.apply(null,arguments)}function mIe(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 gIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mIe(Object(r),!0).forEach(function(n){dPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dPr(e,t,r){return(t=fPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fPr(e){var t=hPr(e,"string");return typeof t=="symbol"?t:t+""}function hPr(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 tie(e,t){if(e==null)return{};var r,n,s=pPr(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 pPr(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 mPr(e){var t=Vo(),r=b.useRef(null),n=ait(),{type:s}=e,a=tie(e,lPr),i=y9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return gIe(gIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(eIr(l)):r.current!==l&&t(tIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(rIr(r.current)),r.current=null)},[t]),null}function gPr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(Kat),c=ld(),u=Vo(),d="yAxis",f=en(E=>SCr(E,t)),h=en(E=>wCr(E,t)),p=en(E=>clt(E,d,t,c)),m=en(E=>Aot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Ppe(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(nIr({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=tie(e,cPr),{id:S,scale:k}=m,_=tie(m,uPr);return b.createElement(Lpe,eie({},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:xa("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var yPr={allowDataOverflow:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:Xo.allowDuplicatedCategory,angle:Xo.angle,axisLine:zy.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:zy.tickLine,tickSize:zy.tickSize,type:Xo.type,niceTicks:Xo.niceTicks,width:Xo.width,yAxisId:0},vPr=e=>{var t=od(e,yPr);return b.createElement(b.Fragment,null,b.createElement(mPr,{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(gPr,t))},wct=b.memo(vPr,bct);wct.displayName="YAxis";var bPr=(e,t)=>t,Fpe=Xe([bPr,Fi,Vit,jl,Clt,Ov,Hjr,ec],Kjr);function xPr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function zpe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(xPr(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 Sct=df("mouseClick"),Oct=xP();Oct.startListening({actionCreator:Sct,effect:(e,t)=>{var r=e.payload,n=Fpe(t.getState(),zpe(r));n?.activeIndex!=null&&t.dispatch(LCr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var rie=df("mouseMove"),kct=xP(),_O=null,V0=null,sQ=null;kct.startListening({actionCreator:rie,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");_O!==null&&(cancelAnimationFrame(_O),_O=null),V0!==null&&(typeof s!="number"||!i)&&(clearTimeout(V0),V0=null),sQ=zpe(r);var l=()=>{var c=t.getState(),u=Ope(c,c.tooltip.settings.shared);if(!sQ){_O=null,V0=null;return}if(u==="axis"){var d=Fpe(c,sQ);d?.activeIndex!=null?t.dispatch(vlt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(ylt())}_O=null,V0=null};if(!i){l();return}s==="raf"?_O=requestAnimationFrame(l):typeof s=="number"&&V0===null&&(V0=setTimeout(l,s))}});function wPr(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 yIe={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},_ct=Tc({name:"rootProps",initialState:yIe,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:yIe.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}}}),SPr=_ct.reducer,{updateOptions:OPr}=_ct.actions,kPr=null,_Pr={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)},Ect=Tc({name:"polarOptions",initialState:kPr,reducers:_Pr}),{updatePolarOptions:uMn}=Ect.actions,EPr=Ect.reducer,Cct=df("keyDown"),jct=df("focus"),Tct=df("blur"),A9=xP(),EO=null,q0=null,XD=null;A9.startListening({actionCreator:Cct,effect:(e,t)=>{XD=e.payload,EO!==null&&(cancelAnimationFrame(EO),EO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");q0!==null&&(typeof n!="number"||!a)&&(clearTimeout(q0),q0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=XD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=kpe(u,dC(l),IP(l),PP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=Ov(l);if(d==="Enter"){var m=k4(l,"axis","hover",String(u.index));t.dispatch(O4({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=CCr(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=k4(l,"axis","hover",String(w));t.dispatch(O4({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{EO=null,q0=null}};if(!a){i();return}n==="raf"?EO=requestAnimationFrame(i):typeof n=="number"&&q0===null&&(i(),XD=null,q0=setTimeout(()=>{XD?i():(q0=null,EO=null)},n))}});A9.startListening({actionCreator:jct,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=k4(r,"axis","hover",String(a));t.dispatch(O4({active:!0,activeIndex:a,activeCoordinate:i}))}}}});A9.startListening({actionCreator:Tct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(O4({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function Nct(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 Xf=df("externalEvent"),Act=xP(),KD=new Map,oT=new Map,aQ=new Map;Act.startListening({actionCreator:Xf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=Nct(n);aQ.set(s,{handler:r,reactEvent:a});var i=KD.get(s);i!==void 0&&(cancelAnimationFrame(i),KD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=oT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),oT.delete(s));var p=()=>{var y=aQ.get(s);try{if(!y)return;var{handler:x,reactEvent:w}=y,S=t.getState(),k={activeCoordinate:Tjr(S),activeDataKey:Ejr(S),activeIndex:cI(S),activeLabel:Nlt(S),activeTooltipIndex:cI(S),isTooltipActive:Njr(S)};x&&x(k,w)}finally{KD.delete(s),oT.delete(s),aQ.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);KD.set(s,m)}else if(typeof c=="number"){if(!oT.has(s)){p();var g=setTimeout(p,c);oT.set(s,g)}}else p()}}});var CPr=Xe([cC],e=>e.tooltipItemPayloads),jPr=Xe([CPr,(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)}}}),Ict=df("touchMove"),Rct=xP(),H0=null,ob=null,vIe=null,lT=null;Rct.startListening({actionCreator:Ict,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){lT=Nct(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");H0!==null&&(cancelAnimationFrame(H0),H0=null),ob!==null&&(typeof s!="number"||!i)&&(clearTimeout(ob),ob=null),vIe=Array.from(r.touches).map(c=>zpe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(lT!=null){var c=t.getState(),u=Ope(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=vIe)===null||d===void 0?void 0:d[0];if(f==null){H0=null,ob=null;return}var h=Fpe(c,f);h?.activeIndex!=null&&t.dispatch(vlt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=lT.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(nSr),x=(p=g.getAttribute(sSr))!==null&&p!==void 0?p:void 0,w=uC(c).find(_=>_.id===x);if(y==null||w==null||x==null)return;var{dataKey:S}=w,k=jPr(c,y,x);t.dispatch(DCr({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:x}))}H0=null,ob=null}};if(!i){l();return}s==="raf"?H0=requestAnimationFrame(l):typeof s=="number"&&ob===null&&(l(),lT=null,ob=setTimeout(()=>{lT?l():(ob=null,H0=null)},s))}}});var Pct={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Mct=Tc({name:"eventSettings",initialState:Pct,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:TPr}=Mct.actions,NPr=Mct.reducer,APr=dnt({brush:pIr,cartesianAxis:sIr,chartData:NTr,errorBars:hRr,eventSettings:NPr,graphicalItems:MAr,layout:Uwr,legend:YSr,options:_Tr,polarAxis:tAr,polarOptions:EPr,referenceElements:vIr,renderedTicks:MIr,rootProps:SPr,tooltip:$Cr,zIndex:fTr}),IPr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return hwr({reducer:APr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([Oct.middleware,kct.middleware,A9.middleware,Act.middleware,Rct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(Pat({type:"raf"}))},devTools:{serialize:{replacer:wPr},name:"recharts-".concat(r)}})};function RPr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=ld(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=IPr(t,n));var i=xhe;return b.createElement(xnt,{context:i,store:a.current},r)}function PPr(e){var{layout:t,margin:r}=e,n=Vo(),s=ld();return b.useEffect(()=>{s||(n(Fwr(t)),n($wr(r)))},[n,s,t,r]),null}var MPr=b.memo(PPr,p9);function DPr(e){var t=Vo();return b.useEffect(()=>{t(OPr(e))},[t,e]),null}var LPr=e=>{var t=Vo();return b.useEffect(()=>{t(TPr(e))},[t,e]),null},$Pr=b.memo(LPr,p9);function bIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Vo();return b.useLayoutEffect(()=>(n.current&&s(uTr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(dTr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function xIe(e){var{children:t,isPanorama:r}=e,n=en(eTr);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(bIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(bIe,{key:i,zIndex:i,isPanorama:r})))}var FPr=["children"];function zPr(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 N4(){return N4=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},N4.apply(null,arguments)}var UPr={width:"100%",height:"100%",display:"block"},VPr=b.forwardRef((e,t)=>{var r=nit(),n=sit(),s=mit();if(!ig(r)||!ig(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(zst,N4({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:UPr,ref:t}),a)}),qPr=e=>{var{children:t}=e,r=en(c9);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(zst,{width:n,height:s,x:i,y:a},t)},wIe=b.forwardRef((e,t)=>{var{children:r}=e,n=zPr(e,FPr),s=ld();return s?b.createElement(qPr,null,b.createElement(xIe,{isPanorama:!0},r)):b.createElement(VPr,N4({ref:t},n),b.createElement(xIe,{isPanorama:!1},r))});function HPr(){var e=Vo(),[t,r]=b.useState(null),n=en(rSr);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(Bwr(a))}},[t,e,n]),r}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 QPr(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){WPr(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 WPr(e,t,r){return(t=GPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GPr(e){var t=ZPr(e,"string");return typeof t=="symbol"?t:t+""}function ZPr(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 Jb(){return Jb=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},Jb.apply(null,arguments)}var YPr=()=>(FTr(),null);function A4(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var XPr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:A4((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:A4((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(SP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Jb({ref:c},e)))}),KPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:A4(r),containerHeight:A4(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(SP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Jb({ref:l},e)))}),JPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(SP,{width:r,height:n}),b.createElement("div",Jb({ref:t},e)))}),eMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(KPr,Jb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(JPr,Jb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(SP,{width:r,height:n}),b.createElement("div",Jb({ref:t},e)))});function tMr(e){return e?XPr:eMr}var rMr=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=HPr(),P=Ehe(),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=>{_(Sct(ie)),_(Xf({handler:a,reactEvent:ie}))},[_,a]),U=b.useCallback(ie=>{_(rie(ie)),_(Xf({handler:u,reactEvent:ie}))},[_,u]),z=b.useCallback(ie=>{_(ylt()),_(Xf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(rie(ie)),_(Xf({handler:f,reactEvent:ie}))},[_,f]),Q=b.useCallback(()=>{_(jct())},[_]),L=b.useCallback(()=>{_(Tct())},[_]),Z=b.useCallback(ie=>{_(Cct(ie.key))},[_]),V=b.useCallback(ie=>{_(Xf({handler:i,reactEvent:ie}))},[_,i]),M=b.useCallback(ie=>{_(Xf({handler:l,reactEvent:ie}))},[_,l]),W=b.useCallback(ie=>{_(Xf({handler:c,reactEvent:ie}))},[_,c]),G=b.useCallback(ie=>{_(Xf({handler:h,reactEvent:ie}))},[_,h]),J=b.useCallback(ie=>{_(Xf({handler:g,reactEvent:ie}))},[_,g]),ae=b.useCallback(ie=>{S&&_(Ict(ie)),_(Xf({handler:m,reactEvent:ie}))},[_,S,m]),te=b.useCallback(ie=>{_(Xf({handler:p,reactEvent:ie}))},[_,p]),re=tMr(w);return b.createElement(Llt.Provider,{value:E},b.createElement(dxr.Provider,{value:j},b.createElement(re,{width:R??y?.width,height:B??y?.height,className:xa("recharts-wrapper",n),style:QPr({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(YPr,null),r)))}),nMr=["width","height","responsive","children","className","style","compact","title","desc"];function sMr(e,t){if(e==null)return{};var r,n,s=aMr(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 aMr(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 iMr=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=sMr(e,nMr),h=sg(f);return c?b.createElement(b.Fragment,null,b.createElement(SP,{width:r,height:n}),b.createElement(wIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(rMr,{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(wIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(xIr,null,a)))});function nie(){return nie=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},nie.apply(null,arguments)}function OIe(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 oMr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OIe(Object(r),!0).forEach(function(n){lMr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lMr(e,t,r){return(t=cMr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cMr(e){var t=uMr(e,"string");return typeof t=="symbol"?t:t+""}function uMr(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 dMr={top:5,right:5,bottom:5,left:5},fMr=oMr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:dMr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Pct),hMr=b.forwardRef(function(t,r){var n,s=od(t.categoricalChartProps,fMr),{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(RPr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(hIr,{chartData:u.data}),b.createElement(MPr,{layout:s.layout,margin:s.margin}),b.createElement($Pr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(DPr,{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(iMr,nie({},s,{ref:r})))}),pMr=["axis"],mMr=b.forwardRef((e,t)=>b.createElement(hMr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:pMr,tooltipPayloadSearcher:OTr,categoricalChartProps:e,ref:t}));function gMr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function yMr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function vMr(e){return e/100*window.innerHeight}function bMr(e){return e/100*window.innerWidth}function xMr(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 GT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=xMr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=yMr(t,s);break}case"em":{n=gMr(t,s);break}case"vh":{n=vMr(s);break}case"vw":{n=bMr(s);break}}return n}function qu(e){return parseFloat(e.toFixed(3))}function J_({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 sie(e){const{panels:t}=e,r=J_({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=GT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=qu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=GT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=qu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=GT({groupSize:r,panelElement:s,styleProp:a.minSize});c=qu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=GT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=qu(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 aie(e,t){return Array.from(t).sort(e==="horizontal"?wMr:SMr)}function wMr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function SMr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Dct(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Lct(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 OMr({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}=Lct(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return ja(s,"No rect found"),s}let JD;function kMr(){return JD===void 0&&(typeof matchMedia=="function"?JD=!!matchMedia("(pointer:coarse)").matches:JD=!1),JD}function $ct(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=aie(r,Array.from(t.children).filter(Dct).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=OMr({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=kMr()?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:J_({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 Fct=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)}}},Fm=new Map;const zct=new Fct;function _Mr(e){Fm=new Map(Fm),Fm.delete(e)}function kIe(e,t){for(const[r]of Fm)if(r.id===e)return r}function ex(e,t){for(const[r,n]of Fm)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function b1(){return Fm}function Bpe(e,t){return zct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function nv(e,t){const r=Fm.get(e);Fm=new Map(Fm),Fm.set(e,t),zct.emit("groupChange",{group:e,prev:r,next:t})}function EMr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=Lct(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 CMr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function jMr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:CIe(e),b:CIe(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:EIe(_Ie(r.a)),b:EIe(_Ie(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 TMr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function NMr(e){const t=getComputedStyle(Bct(e)??e).display;return t==="flex"||t==="inline-flex"}function AMr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||NMr(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"||TMr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function _Ie(e){let t=e.length;for(;t--;){const r=e[t];if(ja(r,"Missing node"),AMr(r))return r}return null}function EIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function CIe(e){const t=[];for(;e;)t.push(e),e=Bct(e);return t}function Bct(e){const{parentNode:t}=e;return CMr(t)?t.host:t}function IMr(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 RMr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Dct(r)||r.contains(e)||e.contains(r))return!0;if(jMr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(IMr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function Upe(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=$ct(s),i=EMr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&RMr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function PMr(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 Wc(e,t,r=0){return Math.abs(qu(e)-qu(t))<=r}function mm(e,t){return Wc(e,t)?0:e>t?1:-1}function yk({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(mm(n,c)<0)if(a){const u=(s+c)/2;mm(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=qu(n),n}function hI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(Wc(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}`),Wc(k,x)){const _=S-k;mm(_,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}`),Wc(k,S)){const _=k-x;mm(_,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&&mm(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;mm(T,k)<0&&(e=mm(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;mm(T,k)<0&&(e=mm(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=yk({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=yk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!Wc(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(PMr(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=yk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:y,size:x});if(u[g]=w,!Wc(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=yk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(Wc(_,T)||(S-=T-_,u[k]=T),Wc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,y)=>y+g,0);if(!Wc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,y,x)=>(g[m[x]]=y,g),{})}function PS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||mm(e[r],t[r])!==0)return!1;return!0}function MS({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(!Wc(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=yk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!Wc(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=yk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,Wc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function Uct({groupId:e,panelId:t}){const r=()=>{const l=b1();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=hI({delta:y?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:y?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=MS({layout:x,panelConstraints:d});PS(p,w)||nv(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&&Wc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=J_({group:c}),f=GT({groupSize:d,panelElement:u,styleProp:l}),h=qu(f/d*100);i(h)}}}function jIe(e){if(e.defaultPrevented)return;const t=b1();Upe(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=Uct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function A$(e){const t=b1();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 Vct({groupId:e}){const t=()=>{const r=b1();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=MS({layout:r,panelConstraints:s});return n?l:(PS(l,u)||nv(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function Q0(e,t){const r=A$(e),n=ex(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=Vct({groupId:r.id}).getLayout(),c=hI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=MS({layout:c,panelConstraints:n.derivedPanelConstraints});PS(l,u)||nv(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function TIe(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=A$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&Q0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&Q0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&Q0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&Q0(t,-5);break}case"End":{e.preventDefault(),Q0(t,100);break}case"Enter":{e.preventDefault();const n=A$(t),s=ex(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;Q0(t,p-h)}break}case"F6":{e.preventDefault();const n=A$(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(),Q0(t,-100);break}}}let t_={cursorFlags:0,state:"inactive"};const Vpe=new Fct;function DS(){return t_}function MMr(e){return Vpe.addListener("change",e)}function DMr(e){const t=t_,r={...t_};r.cursorFlags=e,t_=r,Vpe.emit("change",{prev:t,next:r})}function r_(e){const t=t_;t_=e,Vpe.emit("change",{prev:t,next:e})}function NIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=b1(),r=Upe(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)}),r_({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const LMr=e=>e,iQ=()=>{},qct=1,Hct=2,Qct=4,Wct=8,AIe=3,IIe=12;let eL;function RIe(){return eL===void 0&&(eL=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(eL=!0)),eL}function $Mr({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&&RIe()){const a=(e&qct)!==0,i=(e&Hct)!==0,l=(e&Qct)!==0,c=(e&Wct)!==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 RIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const PIe=new WeakMap;function qpe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=PIe.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=DS();switch(n.state){case"active":case"hover":{const s=$Mr({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}}PIe.set(e,{prevStyle:t,styleSheet:r})}function Gct({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=hI({delta:g,initialLayout:y,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(PS(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?qct:Hct;break}case"vertical":{l|=g<0?Qct:Wct;break}}}else nv(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&AIe:c|=l&AIe,t.movementY===0?c|=i&IIe:c|=l&IIe,DMr(c),qpe(e)}function MIe(e){const t=b1(),r=DS();r.state==="active"&&Gct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function DIe(e){if(e.defaultPrevented)return;const t=DS(),r=b1();switch(t.state){case"active":{if(e.buttons===0){r_({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=ex(n.group.id,!0);nv(n.group,s)});return}Gct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=Upe(e,r);n.length===0?t.state!=="inactive"&&r_({cursorFlags:0,state:"inactive"}):r_({cursorFlags:0,hitRegions:n,state:"hover"}),qpe(e.currentTarget);break}}}function LIe(e){e.relatedTarget instanceof HTMLIFrameElement&&DS().state==="hover"&&r_({cursorFlags:0,state:"inactive"})}function $Ie(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=DS();t.state==="active"&&(r_({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(qpe(e.currentTarget),t.hitRegions.forEach(r=>{const n=ex(r.group.id,!0);nv(r.group,n)}),e.preventDefault()))}function FIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=qu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=qu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function FMr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=J_({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:qu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function zMr(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 BMr({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=qu(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]=qu(h/a*u)}else{const f=qu(u/c.length);for(const h of c)d[h]=f}return d}function UMr(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 CO=new Map;function VMr(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=J_({group:e});if(w===0)return;const S=ex(e.id);if(!S)return;const k=sie(e),_=S.defaultLayoutDeferred?FIe(k):S.layout,E=BMr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=MS({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&PS(S.layout,T)&&zMr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;nv(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else FMr(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=J_({group:e}),l=sie(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(UMr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??FIe(l),f=MS({layout:d,panelConstraints:l}),h=e.element.ownerDocument;CO.set(h,(CO.get(h)??0)+1);const p=new Map;return $ct(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),nv(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",TIe)}),CO.get(h)===1&&(h.addEventListener("dblclick",jIe,!0),h.addEventListener("pointerdown",NIe,!0),h.addEventListener("pointerleave",MIe),h.addEventListener("pointermove",DIe),h.addEventListener("pointerout",LIe),h.addEventListener("pointerup",$Ie,!0)),function(){t=!1,CO.set(h,Math.max(0,(CO.get(h)??0)-1)),_Mr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",TIe)}),CO.get(h)||(h.removeEventListener("dblclick",jIe,!0),h.removeEventListener("pointerdown",NIe,!0),h.removeEventListener("pointerleave",MIe),h.removeEventListener("pointermove",DIe),h.removeEventListener("pointerout",LIe),h.removeEventListener("pointerup",$Ie,!0)),a.disconnect()}}function qMr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Hpe(e){const t=b.useId();return`${e??t}`}const x1=typeof window<"u"?b.useLayoutEffect:b.useEffect;function IN(e){const t=b.useRef(e);return x1(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function Qpe(...e){return IN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Wpe(e){const t=b.useRef({...e});return x1(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Zct=b.createContext(null);function HMr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:LMr});b.useImperativeHandle(t,()=>r.current,[]),x1(()=>{Object.assign(r.current,Vct({groupId:e}))})}function I9({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=IN(P=>{PS(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),y=IN(P=>{PS(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Hpe(l),w=b.useRef(null),[S,k]=qMr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=Qpe(w,a);HMr(x,i);const T=IN((P,R)=>{const B=DS(),D=kIe(P),$=ex(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=Wpe({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=aie(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(B=>B!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=aie(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=kIe(x),$=ex(x);D&&$&&nv(D,{...$,derivedPanelConstraints:sie(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 x1(()=>{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 $=VMr(D),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:H}=ex(D.id,!0);!U&&z.length>0&&(g(H),y(H));const Q=Bpe(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=Wc(J.collapsedSize,M[J.panelId]),re=Wc(J.collapsedSize,ae[J.panelId]);te&&!re&&(D.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const G=DS().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(Zct.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})})}I9.displayName="Group";function oQ(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function Gpe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=oQ(a,t??[]),l=b.useSyncExternalStore(QMr,()=>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=oQ(a,Object.keys(p)):m=oQ(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 QMr(){return function(){}}function Zpe(){const e=b.useContext(Zct);return ja(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function WMr(e,t){const{id:r}=Zpe(),n=b.useRef({collapse:iQ,expand:iQ,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:iQ});b.useImperativeHandle(t,()=>n.current,[]),x1(()=>{Object.assign(n.current,Uct({groupId:r,panelId:e}))})}function eE({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=Hpe(c),x=Wpe({disabled:a}),w=b.useRef(null),S=Qpe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=Zpe(),N=f!==null,I=IN((R,B,D)=>{f?.(R,c,D)});x1(()=>{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]),WMr(y,h);const P=b.useSyncExternalStore(R=>Bpe(_,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:{...GMr,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})})}eE.displayName="Panel";const GMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function ZMr(){return b.useRef(null)}function YMr({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=MS({layout:hI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=MS({layout:hI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function Yct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Hpe(s),c=Wpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=Qpe(p,n),{disableCursor:g,id:y,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=Zpe(),k=x==="horizontal"?"vertical":"horizontal";x1(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=MMr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Bpe(y,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:D}=P.next,$=D.get(T);if($){const U=$[0],z=$.indexOf(U);d(YMr({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})}Yct.displayName="Separator";const zIe=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},XMr=(e=>e?zIe(e):zIe),KMr=e=>e;function JMr(e,t=KMr){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 BIe=e=>{const t=XMr(e),r=n=>JMr(t,n);return Object.assign(r,t),r},Ype=(e=>e?BIe(e):BIe);function e2r(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 iie=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return iie(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return iie(n)(r)}}}},t2r=(e,t)=>(r,n,s)=>{let a={storage:e2r(()=>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 iie(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},r2r=t2r;var w1=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(){}},n2r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},s2r=class{#e=n2r;#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)}},Aw=new s2r;function a2r(e){setTimeout(e,0)}var LS=typeof window>"u"||"Deno"in globalThis;function uc(){}function i2r(e,t){return typeof e=="function"?e(t):e}function oie(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xct(e,t){return Math.max(e+(t||0)-Date.now(),0)}function tx(e,t){return typeof e=="function"?e(t):e}function eh(e,t){return typeof e=="function"?e(t):e}function UIe(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Xpe(i,t.options))return!1}else if(!pI(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 VIe(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if($S(t.options.mutationKey)!==$S(a))return!1}else if(!pI(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Xpe(e,t){return(t?.queryKeyHashFn||$S)(e)}function $S(e){return JSON.stringify(e,(t,r)=>lie(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function pI(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pI(e[r],t[r])):!1}var o2r=Object.prototype.hasOwnProperty;function Kpe(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=qIe(e)&&qIe(t);if(!n&&!(lie(e)&&lie(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:o2r.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const m=Kpe(h,p,r+1);c[f]=m,m===h&&u++}return a===l&&u===a?e:c}function mI(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 qIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lie(e){if(!HIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!HIe(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function HIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function l2r(e){return new Promise(t=>{Aw.setTimeout(t,e)})}function cie(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Kpe(e,t):t}function c2r(e){return e}function u2r(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function d2r(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Jpe=Symbol();function Kct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Jpe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eme(e,t){return typeof e=="function"?e(...t):!!e}function f2r(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 h2r=class extends w1{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!LS&&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"}},tme=new h2r;function uie(){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 p2r=a2r;function m2r(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=p2r;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=m2r(),g2r=class extends w1{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!LS&&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}},I4=new g2r;function y2r(e){return Math.min(1e3*2**e,3e4)}function Jct(e){return(e??"online")==="online"?I4.isOnline():!0}var die=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function eut(e){let t=!1,r=0,n;const s=uie(),a=()=>s.status!=="pending",i=g=>{if(!a()){const y=new die(g);h(y),e.onCancel?.(y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>tme.isFocused()&&(e.networkMode==="always"||I4.isOnline())&&e.canRun(),d=()=>Jct(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??(LS?0:3),S=e.retryDelay??y2r,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),l2r(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 tut=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oie(this.gcTime)&&(this.#e=Aw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(LS?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Aw.clearTimeout(this.#e),this.#e=void 0)}},v2r=class extends tut{#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=WIe(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=WIe(this.options);t.data!==void 0&&(this.setState(QIe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=cie(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(uc).catch(uc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>eh(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Jpe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>tx(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:!Xct(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=Kct(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=eut({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof die&&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 die){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,...rut(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...QIe(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 rut(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jct(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function QIe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function WIe(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 R9=class extends w1{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=uie(),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),GIe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fie(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 eh(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&&!mI(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&ZIe(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||eh(this.options.enabled,this.#t)!==eh(t.enabled,this.#t)||tx(this.options.staleTime,this.#t)!==tx(t.staleTime,this.#t))&&this.#g();const s=this.#y();n&&(this.#t!==r||eh(this.options.enabled,this.#t)!==eh(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 x2r(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(uc)),t}#g(){this.#x();const e=tx(this.options.staleTime,this.#t);if(LS||this.#s.isStale||!oie(e))return;const r=Xct(this.#s.dataUpdatedAt,e)+1;this.#c=Aw.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,!(LS||eh(this.options.enabled,this.#t)===!1||!oie(this.#l)||this.#l===0)&&(this.#u=Aw.setInterval(()=>{(this.options.refetchIntervalInBackground||tme.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(Aw.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Aw.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&&GIe(e,t),I=j&&ZIe(e,r,t,n);(N||I)&&(d={...d,...rut(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=cie(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=cie(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:rme(e,t),refetch:this.refetch,promise:this.#o,isEnabled:eh(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=uie();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),mI(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 b2r(e,t){return eh(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function GIe(e,t){return b2r(e,t)||e.state.data!==void 0&&fie(e,t,t.refetchOnMount)}function fie(e,t,r){if(eh(t.enabled,e)!==!1&&tx(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&rme(e,t)}return!1}function ZIe(e,t,r,n){return(e!==t||eh(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&rme(e,r)}function rme(e,t){return eh(t.enabled,e)!==!1&&e.isStaleByTime(tx(t.staleTime,e))}function x2r(e,t){return!mI(e.getCurrentResult(),t)}function R4(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=>{f2r(m,()=>t.signal,()=>d=!0)},h=Kct(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?d2r:u2r;return{pages:_(m.pages,S,k),pageParams:_(m.pageParams,g,k)}};if(s&&a.length){const m=s==="backward",g=m?nut:hie,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:hie(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 hie(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 nut(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function w2r(e,t){return t?hie(e,t)!=null:!1}function S2r(e,t){return!t||!e.getPreviousPageParam?!1:nut(e,t)!=null}var O2r=class extends R9{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:R4()})}getOptimisticResult(e){return e.behavior=R4(),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:w2r(t,r.data),hasPreviousPage:S2r(t,r.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!h}}},k2r=class extends tut{#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||sut(),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=eut({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 sut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _2r=class extends w1{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 k2r({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=tL(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=tL(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=tL(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=tL(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=>VIe(t,r))}findAll(e={}){return this.getAll().filter(t=>VIe(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(uc))))}};function tL(e){return e.options.scope?.id}var E2r=class extends w1{#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),mI(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&$S(r.mutationKey)!==$S(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??sut();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 YIe(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function C2r(e,t,r){const n=e.slice(0);return n[t]=r,n}var j2r=class extends w1{#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||!mI(d,h)});!c&&!u||(c&&(this.#d=n,this.#n=s),this.#t=a,this.hasListeners()&&(c&&(YIe(r,s).forEach(d=>{d.destroy()}),YIe(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=Kpe(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 R9(this.#e,s);r.push({defaultedQueryOptions:s,observer:i})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#t=C2r(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)})})}}},T2r=class extends w1{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Xpe(n,t);let a=this.get(s);return a||(a=new v2r({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=>UIe(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>UIe(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()})})}},N2r=class{#e;#t;#r;#s;#n;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new T2r,this.#t=e.mutationCache||new _2r,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=tme.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=I4.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(tx(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=i2r(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(uc).catch(uc)}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(uc)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(uc)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(tx(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(uc).catch(uc)}fetchInfiniteQuery(e){return e.behavior=R4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(uc).catch(uc)}ensureInfiniteQueryData(e){return e.behavior=R4(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return I4.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($S(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{pI(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set($S(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{pI(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=Xpe(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===Jpe&&(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()}},aut=b.createContext(void 0),wa=e=>{const t=b.useContext(aut);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},A2r=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(aut.Provider,{value:e,children:t})),iut=b.createContext(!1),out=()=>b.useContext(iut);iut.Provider;function I2r(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var R2r=b.createContext(I2r()),lut=()=>b.useContext(R2r),cut=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?eme(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},uut=e=>{b.useEffect(()=>{e.clearReset()},[e])},dut=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||eme(r,[e.error,n])),fut=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))}},P2r=(e,t)=>e.isLoading&&e.isFetching&&!t,pie=(e,t)=>e?.suspense&&t.isPending,mie=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function M2r({queries:e,...t},r){const n=wa(),s=out(),a=lut(),i=b.useMemo(()=>e.map(g=>{const y=n.defaultQueryOptions(g);return y._optimisticResults=s?"isRestoring":"optimistic",y}),[e,n,s]);i.forEach(g=>{fut(g);const y=n.getQueryCache().get(g.queryHash);cut(g,a,y)}),uut(a);const[l]=b.useState(()=>new j2r(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)):uc,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=c.some((g,y)=>pie(i[y],g))?c.flatMap((g,y)=>{const x=i[y];if(x&&pie(x,g)){const w=new R9(n,x);return mie(x,w,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=c.find((g,y)=>{const x=i[y];return x&&dut({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 hut(e,t,r){const n=out(),s=lut(),a=wa(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",fut(i),cut(i,s,l),uut(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)):uc;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),pie(i,d))throw mie(i,u,s);if(dut({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&&!LS&&P2r(d,n)&&(c?mie(i,u,s):l?.promise)?.catch(uc).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function kt(e,t){return hut(e,R9)}function Kr(e,t){const r=wa(),[n]=b.useState(()=>new E2r(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(uc)},[n]);if(s.error&&eme(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function u0(e,t){return hut(e,O2r)}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||{});t1().describe("Database record creation time");var D2r=t1().describe("Database record last update time");D2r.nullable();var P9=_e({page:iSe().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:iSe().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),M9=_e({total:St().describe("Total number of items available"),page:St().describe("Current page"),perPage:Hr([St(),zt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:yo().describe("True if more pages are available")}),L2r=_e({start:oSe().optional().describe("Start of date range (inclusive by default)"),end:oSe().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"),D9=So(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),Eg=So(["sum","avg","min","max","count","last"]).describe("Aggregation function"),S1=So(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),nme=So(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),O1=Et(he()).min(1).describe("Fields to group by"),sme=Et(St().min(0).max(1)).min(1).describe("Percentile values (0-1)"),ame={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")},ime=Ws(he(),he().nullable()).describe("Dimension values for this group"),fC=St().describe("Aggregated value"),hC=t1().describe("Bucket timestamp"),ome=St().describe("Percentile value"),lme=St().describe("Percentile value at this bucket"),pC=nce(Do).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),$2r=he().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),put=he().describe("Name of the entity"),mut=he().describe("Human end-user who triggered execution"),gut=he().describe("Multi-tenant organization/account"),yut=he().describe("Broader resource context (Mastra memory compatibility)"),vut=he().describe("Unique execution run identifier"),but=he().describe("Session identifier for grouping traces"),xut=he().describe("Conversation thread identifier"),wut=he().describe("HTTP request ID for log correlation"),Sut=he().describe('Environment (e.g., "production" | "staging" | "development")'),F2r=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),Out=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),kut=he().describe("Name of the service"),_ut=nce(Do).describe("Entity type of the parent entity"),z2r=he().describe("ID of the parent entity"),Eut=he().describe("Name of the parent entity"),Cut=nce(Do).describe("Entity type of the root entity"),B2r=he().describe("ID of the root entity"),jut=he().describe("Name of the root entity"),Tut=he().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),Nut=he().describe("Version ID of the parent entity that produced this signal"),Aut=he().describe("Version ID of the root entity that produced this signal"),L9=he().describe("Experiment or eval run identifier"),U2r=Ws(he(),Ia()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),Iut=Ws(he(),Ia()).describe("User-defined metadata for custom filtering"),Rut=Et(he()).describe("Labels for filtering"),V2r={entityType:pC.nullish(),entityId:$2r.nullish(),entityName:put.nullish(),parentEntityType:_ut.nullish(),parentEntityId:z2r.nullish(),parentEntityName:Eut.nullish(),rootEntityType:Cut.nullish(),rootEntityId:B2r.nullish(),rootEntityName:jut.nullish(),userId:mut.nullish(),organizationId:gut.nullish(),resourceId:yut.nullish(),runId:vut.nullish(),sessionId:but.nullish(),threadId:xut.nullish(),requestId:wut.nullish(),environment:Sut.nullish(),serviceName:kut.nullish(),scope:U2r.nullish(),entityVersionId:Tut.nullish(),parentEntityVersionId:Nut.nullish(),rootEntityVersionId:Aut.nullish(),experimentId:L9.nullish()},$9={...V2r,executionSource:Out.nullish(),tags:Rut.nullish()};F2r.nullish();var F9={timestamp:L2r.optional().describe("Filter by timestamp range"),traceId:he().optional().describe("Filter by trace ID"),spanId:he().optional().describe("Filter by span ID"),entityType:pC.optional(),entityName:put.optional(),entityVersionId:Tut.optional(),parentEntityVersionId:Nut.optional(),rootEntityVersionId:Aut.optional(),userId:mut.optional(),organizationId:gut.optional(),experimentId:L9.optional(),serviceName:kut.optional(),environment:Sut.optional(),parentEntityType:_ut.optional(),parentEntityName:Eut.optional(),rootEntityType:Cut.optional(),rootEntityName:jut.optional(),resourceId:yut.optional(),runId:vut.optional(),sessionId:but.optional(),threadId:xut.optional(),requestId:wut.optional(),executionSource:Out.optional(),tags:Et(he()).optional().describe("Filter by tags (must have all specified tags)")},z9=he().describe("Unique trace identifier"),B9=he().describe("Unique span identifier within a trace"),P4=So(["debug","info","warn","error","fatal"]),Put=he().describe("Log message"),Mut=Ws(he(),Ia()).describe("Structured data attached to the log"),Dut=_e({logId:he().nullish().describe("Unique id for this log event"),timestamp:t1().describe("When the log was created"),level:P4.describe("Log severity level"),message:Put,data:Mut.nullish(),traceId:z9.nullish(),spanId:B9.nullish(),...$9,source:he().nullish().describe("Execution source"),metadata:Iut.nullish()}).describe("Log record as stored in the database");_e({level:P4,message:Put,data:Mut.optional(),tags:Rut.optional()}).describe("User-provided log input");var q2r=Dut;_e({logs:Et(q2r)}).describe("Arguments for batch creating logs");var H2r=_e({...F9,source:he().optional().describe("Filter by execution source"),level:Hr([P4,Et(P4)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),Q2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),W2r=_e({field:Q2r.default("timestamp").describe("Field to order by"),direction:D9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:H2r.optional().describe("Optional filters to apply"),pagination:P9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:W2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");_e({pagination:M9,logs:Et(Dut)});var mC=he().describe("Identifier of the scorer (e.g., relevance, accuracy)"),Lut=he().describe("Display name of the scorer"),$ut=he().describe("Version of the scorer"),lg=he().describe("How the score was produced (e.g., manual, automated, experiment)"),Fut=St().describe("Score value (range defined by scorer)"),zut=he().describe("Explanation for the score"),But=_e({scoreId:he().nullish().describe("Unique id for this score event"),timestamp:t1().describe("When the score was recorded"),traceId:z9.nullish().describe("Trace that anchors the scored target when available"),spanId:B9.nullish().describe("Span ID this score applies to"),scorerId:mC,scorerName:Lut.nullish(),scorerVersion:$ut.nullish(),scoreSource:lg.nullish(),source:lg.nullish(),score:Fut,reason:zut.nullish(),...$9,scoreTraceId:he().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:Ws(he(),Ia()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");_e({scorerId:mC,scorerName:Lut.optional(),scorerVersion:$ut.optional(),scoreSource:lg.optional(),source:lg.optional(),score:Fut,reason:zut.optional(),metadata:Ws(he(),Ia()).optional().describe("Additional scorer-specific metadata"),experimentId:L9.optional(),scoreTraceId:he().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:pC.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var cme=But;_e({score:cme}).describe("Arguments for creating a score");_e({score:cme.omit({timestamp:!0})}).describe("Arguments for creating a score");_e({success:yo()}).describe("Response from creating a score");_e({scores:Et(cme)}).describe("Arguments for batch recording scores");var DP=_e({...F9,scorerId:Hr([he(),Et(he())]).optional().describe("Filter by scorer ID(s)"),scoreSource:lg.optional().describe("Filter by how the score was produced"),source:lg.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),G2r=So(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),Z2r=_e({field:G2r.default("timestamp").describe("Field to order by"),direction:D9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:DP.optional(),pagination:P9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Z2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");_e({pagination:M9,scores:Et(But)});_e({scorerId:mC,scoreSource:lg.optional(),aggregation:Eg,filters:DP.optional(),comparePeriod:nme.optional()}).describe("Arguments for getting a score aggregate");_e(ame);_e({scorerId:mC,scoreSource:lg.optional(),groupBy:O1,aggregation:Eg,filters:DP.optional()}).describe("Arguments for getting a score breakdown");_e({groups:Et(_e({dimensions:ime,value:fC}))});_e({scorerId:mC,scoreSource:lg.optional(),interval:S1,aggregation:Eg,filters:DP.optional(),groupBy:O1.optional()}).describe("Arguments for getting score time series");_e({series:Et(_e({name:he().describe("Series name (scorer ID or group key)"),points:Et(_e({timestamp:hC,value:fC}))}))});_e({scorerId:mC,scoreSource:lg.optional(),percentiles:sme,interval:S1,filters:DP.optional()}).describe("Arguments for getting score percentiles");_e({series:Et(_e({percentile:ome,points:Et(_e({timestamp:hC,value:lme}))}))});var cg=he().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),gC=he().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),Uut=Hr([St(),he()]).describe("Feedback value (rating number or correction text)"),Vut=he().describe("Additional comment or context"),M4=he().describe("User who provided the feedback");function ume(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 U9=_e({feedbackId:he().nullish().describe("Unique id for this feedback event"),timestamp:t1().describe("When the feedback was recorded"),traceId:z9.nullish().describe("Trace that anchors the feedback target when available"),spanId:B9.nullish().describe("Span ID this feedback applies to"),feedbackSource:cg.nullish(),source:cg.nullish(),feedbackType:gC,value:Uut,comment:Vut.nullish(),feedbackUserId:M4.nullish(),...$9,sourceId:he().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:Ws(he(),Ia()).nullish().describe("User-defined metadata")}),Y2r=_e(U9.shape).describe("Feedback record as stored in the database"),X2r=_e({feedbackSource:cg.optional(),source:cg.optional(),feedbackType:gC,value:Uut,comment:Vut.optional(),feedbackUserId:M4.optional(),userId:M4.optional(),metadata:Ws(he(),Ia()).optional().describe("Additional feedback-specific metadata"),experimentId:L9.optional(),sourceId:he().optional().describe("ID of the source record this feedback is linked to")});_e(X2r.shape).describe("User-provided feedback input");_e({feedback:oce(ume,U9)}).describe("Arguments for creating feedback");_e({feedback:U9.omit({timestamp:!0})}).describe("Arguments for creating feedback");_e({success:yo()}).describe("Response from creating feedback");_e({feedbacks:Et(oce(ume,U9))}).describe("Arguments for batch recording feedback");var qut=_e({...F9,feedbackType:Hr([he(),Et(he())]).optional().describe("Filter by feedback type(s)"),feedbackSource:cg.optional(),source:cg.optional(),feedbackUserId:M4.optional()}),V9=_e(qut.shape).describe("Filters for querying feedback"),K2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),J2r=_e({field:K2r.default("timestamp").describe("Field to order by"),direction:D9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:oce(ume,qut).optional().describe("Optional filters to apply"),pagination:P9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:J2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");_e({pagination:M9,feedback:Et(Y2r)});_e({feedbackType:gC,feedbackSource:cg.optional(),aggregation:Eg,filters:V9.optional(),comparePeriod:nme.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");_e(ame);_e({feedbackType:gC,feedbackSource:cg.optional(),groupBy:O1,aggregation:Eg,filters:V9.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");_e({groups:Et(_e({dimensions:ime,value:fC}))});_e({feedbackType:gC,feedbackSource:cg.optional(),interval:S1,aggregation:Eg,filters:V9.optional(),groupBy:O1.optional()}).describe("Arguments for getting feedback time series over numeric values");_e({series:Et(_e({name:he().describe("Series name (feedback type or group key)"),points:Et(_e({timestamp:hC,value:fC}))}))});_e({feedbackType:gC,feedbackSource:cg.optional(),percentiles:sme,interval:S1,filters:V9.optional()}).describe("Arguments for getting feedback percentiles over numeric values");_e({series:Et(_e({percentile:ome,points:Et(_e({timestamp:hC,value:lme}))}))});So(["counter","gauge","histogram"]);var Hut=he().describe("Metric name (e.g., mastra_agent_duration_ms)"),Qut=St().describe("Metric value"),Wut=Ws(he(),he()).describe("Metric labels for dimensional filtering"),Gut=he().describe("Model provider"),Zut=he().describe("Model"),eDr=St().describe("Estimated cost"),Yut=he().describe("Unit for the estimated cost (e.g., usd)"),tDr=Ws(he(),Ia()).nullish().describe("Structured costing metadata"),Xut=_e({metricId:he().nullish().describe("Unique id for this metric event"),timestamp:t1().describe("When the metric was recorded"),name:Hut,value:Qut,traceId:z9.nullish(),spanId:B9.nullish(),...$9,source:he().nullish().describe("Execution source"),provider:Gut.nullish(),model:Zut.nullish(),estimatedCost:eDr.nullish(),costUnit:Yut.nullish(),costMetadata:tDr.nullish(),labels:Wut.default({}),metadata:Iut.nullish()}).describe("Metric record as stored in the database");_e({name:Hut,value:Qut,labels:Wut.optional()}).describe("User-provided metric input");var rDr=Xut;_e({metrics:Et(rDr)}).describe("Arguments for batch recording metrics");_e({type:Eg,interval:S1.optional(),groupBy:O1.optional()}).describe("Metrics aggregation configuration");var LP=_e({...F9,name:Et(he()).nonempty().optional().describe("Filter by metric name(s)"),source:he().optional().describe("Filter by execution source"),provider:Gut.optional(),model:Zut.optional(),costUnit:Yut.optional(),labels:Ws(he(),he()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),nDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),sDr=_e({field:nDr.default("timestamp").describe("Field to order by"),direction:D9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:LP.optional(),pagination:P9.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 metrics");_e({pagination:M9,metrics:Et(Xut)});_e({name:Et(he()).nonempty().describe("Metric name(s) to aggregate"),aggregation:Eg,filters:LP.optional(),comparePeriod:nme.optional()}).describe("Arguments for getting a metric aggregate");_e({...ame,estimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:he().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(he()).nonempty().describe("Metric name(s) to break down"),groupBy:O1,aggregation:Eg,filters:LP.optional()}).describe("Arguments for getting a metric breakdown");_e({groups:Et(_e({dimensions:ime,value:fC,estimatedCost:St().nullable().optional().describe("Summed estimated cost for this group"),costUnit:he().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});_e({name:Et(he()).nonempty().describe("Metric name(s)"),interval:S1,aggregation:Eg,filters:LP.optional(),groupBy:O1.optional()}).describe("Arguments for getting metric time series");_e({series:Et(_e({name:he().describe("Series name (metric name or group key)"),costUnit:he().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Et(_e({timestamp:hC,value:fC,estimatedCost:St().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});_e({name:he().describe("Metric name"),percentiles:sme,interval:S1,filters:LP.optional()}).describe("Arguments for getting metric percentiles");_e({series:Et(_e({percentile:ome,points:Et(_e({timestamp:hC,value:lme}))}))});_e({prefix:he().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(he()).describe("Distinct metric names")});_e({metricName:he().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");_e({keys:Et(he()).describe("Distinct label keys for the metric")});_e({metricName:he().describe("Metric name"),labelKey:he().describe("Label key to get values for"),prefix:he().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(he()).describe("Distinct label values")});_e({}).describe("Arguments for getting entity types");_e({entityTypes:Et(pC).describe("Distinct entity types")});_e({entityType:pC.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");_e({names:Et(he()).describe("Distinct entity names")});_e({}).describe("Arguments for getting service names");_e({serviceNames:Et(he()).describe("Distinct service names")});_e({}).describe("Arguments for getting environments");_e({environments:Et(he()).describe("Distinct environments")});_e({entityType:pC.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");_e({tags:Et(he()).describe("Distinct tags")});const Ql={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},$P="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",aDr="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",iDr="rounded-md",dme="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",fme="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",hme="disabled:opacity-50 disabled:cursor-not-allowed";function Kut(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=Kut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Jut(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Kut(e))&&(n&&(n+=" "),n+=t);return n}const oDr=(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},lDr=(e,t)=>({classGroupId:e,validator:t}),edt=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),D4="-",XIe=[],cDr="arbitrary..",uDr=e=>{const t=fDr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return dDr(i);const l=i.split(D4),c=l[0]===""&&l.length>1?1:0;return tdt(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?oDr(u,c):c:u||XIe}return r[i]||XIe}}},tdt=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=tdt(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(D4):e.slice(t).join(D4),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},dDr=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?cDr+n:void 0})(),fDr=e=>{const{theme:t,classGroups:r}=e;return hDr(r,t)},hDr=(e,t)=>{const r=edt();for(const n in e){const s=e[n];pme(s,r,n,t)}return r},pme=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];pDr(i,t,r,n)}},pDr=(e,t,r,n)=>{if(typeof e=="string"){mDr(e,t,r);return}if(typeof e=="function"){gDr(e,t,r,n);return}yDr(e,t,r,n)},mDr=(e,t,r)=>{const n=e===""?t:rdt(t,e);n.classGroupId=r},gDr=(e,t,r,n)=>{if(vDr(e)){pme(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(lDr(r,e))},yDr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];pme(c,rdt(t,l),r,n)}},rdt=(e,t)=>{let r=e;const n=t.split(D4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=edt(),r.nextPart.set(i,l)),r=l}return r},vDr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,bDr=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)}}},gie="!",KIe=":",xDr=[],JIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),wDr=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===KIe){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(gie)?(h=f.slice(0,-1),p=!0):f.startsWith(gie)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return JIe(a,p,h,m)};if(t){const s=t+KIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):JIe(xDr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},SDr=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}},ODr=e=>({cache:bDr(e.cacheSize),parseClassName:wDr(e),sortModifiers:SDr(e),...uDr(e)}),kDr=/\s+/,_Dr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(kDr);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+gie: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},EDr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=ndt(r))&&(s&&(s+=" "),s+=n);return s},ndt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=ndt(e[n]))&&(r&&(r+=" "),r+=t);return r},eRe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=ODr(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=_Dr(c,r);return s(c,d),d};return a=i,(...c)=>a(EDr(...c))},CDr=[],Go=e=>{const t=r=>r[e]||CDr;return t.isThemeGetter=!0,t},sdt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,adt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jDr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TDr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NDr=/\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$/,ADr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IDr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RDr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lb=e=>jDr.test(e),qn=e=>!!e&&!Number.isNaN(Number(e)),cb=e=>!!e&&Number.isInteger(Number(e)),lQ=e=>e.endsWith("%")&&qn(e.slice(0,-1)),sy=e=>TDr.test(e),idt=()=>!0,PDr=e=>NDr.test(e)&&!ADr.test(e),mme=()=>!1,MDr=e=>IDr.test(e),DDr=e=>RDr.test(e),LDr=e=>!vr(e)&&!kr(e),$Dr=e=>d0(e,cdt,mme),vr=e=>sdt.test(e),W0=e=>d0(e,udt,PDr),tRe=e=>d0(e,QDr,qn),FDr=e=>d0(e,fdt,idt),zDr=e=>d0(e,ddt,mme),rRe=e=>d0(e,odt,mme),BDr=e=>d0(e,ldt,DDr),rL=e=>d0(e,hdt,MDr),kr=e=>adt.test(e),cT=e=>k1(e,udt),UDr=e=>k1(e,ddt),nRe=e=>k1(e,odt),VDr=e=>k1(e,cdt),qDr=e=>k1(e,ldt),nL=e=>k1(e,hdt,!0),HDr=e=>k1(e,fdt,!0),d0=(e,t,r)=>{const n=sdt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},k1=(e,t,r=!1)=>{const n=adt.exec(e);return n?n[1]?t(n[1]):r:!1},odt=e=>e==="position"||e==="percentage",ldt=e=>e==="image"||e==="url",cdt=e=>e==="length"||e==="size"||e==="bg-size",udt=e=>e==="length",QDr=e=>e==="number",ddt=e=>e==="family-name",fdt=e=>e==="number"||e==="weight",hdt=e=>e==="shadow",sRe=()=>{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=()=>[lb,"full","auto",...j()],I=()=>[cb,"none","subgrid",kr,vr],P=()=>["auto",{span:["full",cb,kr,vr]},cb,kr,vr],R=()=>[cb,"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=()=>[lb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[lb,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Q=()=>[lb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,vr],Z=()=>[...k(),nRe,rRe,{position:[kr,vr]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",VDr,$Dr,{size:[kr,vr]}],W=()=>[lQ,cT,W0],G=()=>["","none","full",u,kr,vr],J=()=>["",qn,cT,W0],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,lQ,nRe,rRe],ie=()=>["","none",m,kr,vr],fe=()=>["none",qn,kr,vr],X=()=>["none",qn,kr,vr],se=()=>[qn,kr,vr],le=()=>[lb,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sy],breakpoint:[sy],color:[idt],container:[sy],"drop-shadow":[sy],ease:["in","out","in-out"],font:[LDr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sy],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sy],shadow:[sy],spacing:["px",qn],text:[sy],"text-shadow":[sy],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",lb,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:[cb,"auto",kr,vr]}],basis:[{basis:[lb,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qn,lb,"auto","initial","none",vr]}],grow:[{grow:["",qn,kr,vr]}],shrink:[{shrink:["",qn,kr,vr]}],order:[{order:[cb,"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,cT,W0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,HDr,FDr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lQ,vr]}],"font-family":[{font:[UDr,zDr,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,tRe]}],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,W0]}],"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"]},cb,kr,vr],radial:["",kr,vr],conic:[cb,kr,vr]},qDr,BDr]}],"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,cT,W0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,nL,rL]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,nL,rL]}],"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,W0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,nL,rL]}],"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,nL,rL]}],"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:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],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,cT,W0,tRe]}],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"]}},WDr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(ZT(e,"cacheSize",t),ZT(e,"prefix",r),ZT(e,"experimentalParseClassName",n),sL(e.theme,a.theme),sL(e.classGroups,a.classGroups),sL(e.conflictingClassGroups,a.conflictingClassGroups),sL(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),ZT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),aL(e.theme,s.theme),aL(e.classGroups,s.classGroups),aL(e.conflictingClassGroups,s.conflictingClassGroups),aL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),pdt(e,s,"orderSensitiveModifiers"),e),ZT=(e,t,r)=>{r!==void 0&&(e[t]=r)},sL=(e,t)=>{if(t)for(const r in t)ZT(e,r,t[r])},aL=(e,t)=>{if(t)for(const r in t)pdt(e,t,r)},pdt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},GDr=(e,...t)=>typeof e=="function"?eRe(sRe,e,...t):eRe(()=>WDr(sRe(),e),...t),ZDr=Object.keys({...$b,...H9t}),YDr=Object.keys(X9t),XDr=Object.keys(Q9t),KDr=Object.keys(W9t),JDr=Object.keys(q9t),G0=Object.keys(Y9t),eLr=Object.keys(G9t).concat(Object.keys(Z9t)),tLr=GDr({extend:{theme:{color:ZDr,spacing:YDr,radius:JDr,leading:KDr,shadow:eLr},classGroups:{"font-size":[{text:XDr}],h:[{h:G0}],w:[{w:G0}],size:[{size:G0}],"min-h":[{"min-h":G0}],"min-w":[{"min-w":G0}],"max-h":[{"max-h":G0}],"max-w":[{"max-w":G0}]}}});function Y(...e){return tLr(Jut(e))}const rLr={sm:`${Ql.sm} text-ui-sm px-[.75em]`,md:`${Ql.md} text-ui-md px-[.75em]`,default:`${Ql.default} text-ui-md px-[.85em] `,lg:`${Ql.lg} text-ui-lg px-[1em] `},nLr={default:"bg-surface3 border-2 border-border1 hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral5",primary:"bg-surface4 border-2 border-border2 hover:text-neutral6 hover:bg-surface5 active:bg-surface6 text-neutral6",cta:"bg-accent1/50 hover:bg-accent1/80 text-neutral5 font-semibold",ghost:"bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",inputLike:dme,light:"",outline:"",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"},sLr=Y("flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100",hme,fme),aLr={light:"default",outline:"default"};function iLr(e){return aLr[e]??e}function yC(e){const t=iLr(e?.variant||"default"),r=e?.size||"default";return Y(sLr,rLr[r],nLr[t],e?.iconOnly&&"[&>svg]:opacity-75")}function mdt(e){const t=[];return je.Children.forEach(e,r=>{je.isValidElement(r)&&r.type===je.Fragment?t.push(...mdt(r.props.children)):t.push(r)}),t}function oLr(e){const t=mdt(e);return t.length>0&&t.every(r=>je.isValidElement(r))}const me=je.forwardRef(({className:e,as:t,size:r="default",variant:n="default",disabled:s,children:a,...i},l)=>{const c=t||"button",u=oLr(a);return o.jsx(c,{ref:l,disabled:s,className:Y(yC({variant:n,size:r,iconOnly:u}),e),...i,children:a})});me.displayName="Button";const cd=p5t,Yr=m5t,Xr=g5t,Wr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(y5t,{children:o.jsxs(Dqe,{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(v5t,{className:"fill-surface3"})]})}));Wr.displayName=Dqe.displayName;const Cn=je.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{ref:r,...t})}),e&&o.jsx(Wr,{children:e})]}));Cn.displayName="ButtonWithTooltip";const lLr={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",lLr[r],t),...n,children:e}),an={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"},f0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},gdt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),L4=({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",an.colors,n),children:e}),ydt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),$4=({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",an.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),vdt=({onClick:e})=>o.jsx(me,{variant:"ghost",className:Y("shrink-0 opacity-0",an.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(Xl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),cLr={"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"},uLr={mono:"font-mono"},pe=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Y(cLr[r],n&&uLr[n],t),...s}),ga=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"})]}),dLr=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"})]}),gme=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"})]}),yme=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"})]}),h0=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"})}),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.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)"})})})]}),xdt=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)"})})})]}),fLr=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"})]}),q9=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"})}),vme=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"})}),hLr=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"})}),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"})}),vC=e=>o.jsx(U9t,{...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"})}),bl=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"})]}),H9=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 hp(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 wdt=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)"})})})]}),pLr=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"})}),mLr=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"})})}),Sdt=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}})}),gLr=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"})]})]}),yLr=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"})})]}),vLr=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"})}),bLr=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"})]}),xLr=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"})})})]}),aRe=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"})}),wLr=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"})]})}),SLr={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},OLr={warning:zE,destructive:PF,info:UR},pl=({children:e,variant:t="destructive",className:r})=>{const n=OLr[t];return o.jsx("div",{className:Y(SLr[t],"p-3 rounded-md border shadow-sm",an.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",r),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(Ce,{className:"mt-0.5 shrink-0",children:o.jsx(n,{})}),o.jsx("div",{className:"text-neutral4",children:e})]})})},ml=({children:e,as:t="h5"})=>o.jsx(pe,{as:t,variant:"ui-md",className:"font-semibold",children:e}),Xc=({children:e,as:t="p"})=>o.jsx(pe,{as:t,variant:"ui-sm",children:e}),kLr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},Odt=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Y(kLr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",an.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(pe,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),_Lr={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"},ELr={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",an.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":_Lr[t],r),...s,children:[e&&o.jsx("span",{className:ELr[t],children:o.jsx(Ce,{children:e})}),n]}),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",an.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",an.colors),children:o.jsx(hLr,{})})})]})};function CLr(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 jLr(e){const t=CLr(e);return tGe({override:[TLr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function TLr(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 NLr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,ALr=er.mark({class:"cm-variable-highlight"}),iRe=new mWe({regexp:NLr,decoration:()=>ALr}),ILr=Oi.fromClass(class{decorations;constructor(e){this.decorations=iRe.createDeco(e)}update(e){this.decorations=iRe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),RLr=ILr,PLr={duration:5e3,cancel:{label:o.jsx(Ce,{children:o.jsx(Xl,{})}),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 nf(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=>vc(r,nf(t)));if(je.isValidElement(e))return vc(e,nf(t));if(typeof e=="string")return vc(e,nf(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(Izt,{})}),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 vc.success(e,nf(r));case"object":return e.forEach(n=>vc.success(n,nf(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent2 shrink-0",children:o.jsx(PHe,{})}),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 vc.error(e,nf(r));case"object":return e.forEach(n=>vc.error(n,nf(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent6 shrink-0",children:o.jsx(PF,{})}),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 vc.warning(e,nf(r));case"object":return e.forEach(n=>vc.warning(n,nf(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent3 shrink-0",children:o.jsx(UR,{})}),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 vc.info(e,nf(r));case"object":return e.forEach(n=>vc.info(n,nf(r)))}};ze.custom=(e,t={})=>vc(e,nf(t));ze.dismiss=e=>{e&&vc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>vc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...nf(i)});function hf({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 ta({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=hf({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(hv,{}):o.jsx(DHe,{})})}),o.jsx(Wr,{children:a?"Copied!":r})]})}const MLr="mastra-theme",DLr="mastra-playground-store",yie=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 yie(n)?n:void 0}catch{return}},$Lr=(e=MLr)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(yie(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}yie(n.newValue)&&t(n.newValue)}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}),kdt=b.createContext(null),_dt="(prefers-color-scheme: dark)",FLr=typeof window>"u"?b.useEffect:b.useLayoutEffect,Edt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(_dt).matches?"dark":"light",Cdt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(_dt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},zLr=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},jdt=({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(Cdt,Edt,()=>"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(kdt.Provider,{value:d,children:e})},BLr=()=>{},bC=()=>{const e=b.useContext(kdt),t=b.useSyncExternalStore(Cdt,Edt,()=>"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=Fp.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,Jx(t)]}const _v=()=>{const e=bC().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=_v(),g=e?JSON.stringify(e,null,2):t??"",y=b.useMemo(()=>{const x=[];return a==="json"?x.push(Kd):a==="markdown"&&(x.push(Yue({base:mS,codeLanguages:OZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(RLr),c&&a==="markdown"&&x.push(jLr(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(ta,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(wc,{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-CD13sPVm.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 _f=({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}),Tdt=({children:e,className:t,style:r})=>o.jsx(Ce,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),Ef=({children:e,className:t})=>o.jsx(pe,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),Cf=({children:e,className:t})=>o.jsx(pe,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),jf=({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(j9t,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function sa({title:e,description:t,className:r}){const[n,s]=b.useState(!1),a=Ge(),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(w9t,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(me,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const En=({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}),Yu=({children:e})=>o.jsx(pe,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),gu=({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}),rx=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})}),oRe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lRe=Jut,xC=(e,t)=>r=>{var n;if(t?.variants==null)return lRe(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=oRe(d)||oRe(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 lRe(e,i,c,r?.class,r?.className)},JLr=xC(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(dme,fme,hme),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"}}),bc=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}));bc.displayName="Textarea";const e$r=NXt,t$r=AXt,Ndt=IXt;function Bt({open:e,onOpenChange:t,children:r}){return o.jsx(e$r,{open:e,onOpenChange:t,children:r})}const bme=b.forwardRef(({className:e,...t},r)=>o.jsx(nXe,{className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-150",e),...t,ref:r}));bme.displayName=nXe.displayName;const Adt=b.forwardRef(({className:e,...t},r)=>o.jsxs(Ndt,{children:[o.jsx(bme,{}),o.jsx(sXe,{ref:r,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border1 bg-surface3 p-6 shadow-dialog rounded-md","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=closed]:duration-150",e),...t})]}));Adt.displayName=sXe.displayName;const Idt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});Idt.displayName="AlertDialogHeader";const Rdt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rdt.displayName="AlertDialogFooter";const Pdt=b.forwardRef(({className:e,...t},r)=>o.jsx(oXe,{ref:r,className:Y("text-lg font-semibold",e),...t}));Pdt.displayName=oXe.displayName;const Mdt=b.forwardRef(({className:e,...t},r)=>o.jsx(lXe,{ref:r,className:Y("text-sm text-neutral3",e),...t}));Mdt.displayName=lXe.displayName;const Ddt=b.forwardRef(({className:e,...t},r)=>o.jsx(aXe,{ref:r,className:Y(yC({variant:"primary",size:"default"}),e),...t}));Ddt.displayName=aXe.displayName;const Ldt=b.forwardRef(({className:e,...t},r)=>o.jsx(iXe,{ref:r,className:Y(yC({variant:"default",size:"default"}),"mt-2 sm:mt-0",e),...t}));Ldt.displayName=iXe.displayName;Bt.Trigger=t$r;Bt.Portal=Ndt;Bt.Overlay=bme;Bt.Content=Adt;Bt.Header=Idt;Bt.Footer=Rdt;Bt.Title=Pdt;Bt.Description=Mdt;Bt.Action=Ddt;Bt.Cancel=Ldt;const fi=b.forwardRef(({className:e,...t},r)=>o.jsx(ude,{ref:r,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",an.all,"hover:border-neutral5 hover:shadow-md",$P,"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(fXe,{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(hv,{className:"h-3.5 w-3.5 stroke-3"})})}));fi.displayName=ude.displayName;const Ip=zXt,Nh=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(fde,{ref:n,className:Y("-outline-offset-2",an.colors,f0.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));Nh.displayName=fde.displayName;const Ah=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(pde,{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}));Ah.displayName=pde.displayName;const gn={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",an.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",an.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",an.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",an.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",an.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 Kl({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="inputLike",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:gn.root,children:[o.jsxs(mKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(OKe,{className:Y(yC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(yer,{placeholder:n})]}),o.jsx(RF,{className:gn.chevron})]}),o.jsx(CKe,{container:h,children:o.jsx(NKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(AKe,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(k_,{className:gn.searchIcon}),o.jsx(SKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(DKe,{className:gn.empty,children:a}),o.jsx(_Ke,{className:gn.list,children:y=>o.jsxs(MKe,{value:y,className:Y(gn.item,gn.itemSelected),children:[o.jsx("span",{className:gn.checkContainer,children:o.jsx(str,{children:o.jsx(hv,{className:gn.checkIcon})})}),o.jsxs("span",{className:gn.optionContent,children:[y.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:y.label}),y.description&&o.jsx("span",{className:gn.optionDescription,children:y.description})]}),y.end?o.jsx("div",{className:gn.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}function $dt({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:gn.root,children:[o.jsxs(mKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(OKe,{className:Y(yC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&gn.placeholder),children:y}),o.jsx(RF,{className:gn.chevron})]}),o.jsx(CKe,{container:h,children:o.jsx(NKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(AKe,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(k_,{className:gn.searchIcon}),o.jsx(SKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(DKe,{className:gn.empty,children:a}),o.jsx(_Ke,{className:gn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(MKe,{value:x,className:gn.item,children:[o.jsx("span",{className:Y(gn.checkbox,w?gn.checkboxSelected:gn.checkboxUnselected),children:w&&o.jsx(hv,{className:gn.checkboxIcon})}),o.jsxs("span",{className:gn.optionContent,children:[x.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:gn.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:gn.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}const Sn=tz,Fdt=VYe,r$r=rz,n$r=eP,zdt=b.forwardRef(({className:e,...t},r)=>o.jsx(KR,{ref:r,className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));zdt.displayName=KR.displayName;const yn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(r$r,{children:[o.jsx(zdt,{}),o.jsxs(JR,{ref:n,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]","gap-4 border border-border1 bg-surface3 py-6 shadow-dialog rounded-lg","duration-slow","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-[state=closed]:slide-out-to-bottom-4","data-[state=open]:slide-in-from-bottom-4",e),...r,children:[t,o.jsxs(eP,{className:Y("absolute right-4 top-4 rounded-md p-1","text-neutral3 hover:text-neutral6 hover:bg-surface4","transition-all duration-normal ease-out-custom","focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","disabled:pointer-events-none"),children:[o.jsx(Xl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yn.displayName=JR.displayName;const On=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});On.displayName="DialogHeader";const pf=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pf.displayName="DialogFooter";const Bn=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-6 max-h-[50vh]",e),...t});Bn.displayName="DialogBody";const vn=b.forwardRef(({className:e,...t},r)=>o.jsx(nz,{ref:r,className:Y("text-ui-md font-medium",e),...t}));vn.displayName=nz.displayName;const qs=b.forwardRef(({className:e,...t},r)=>o.jsx(sz,{ref:r,className:Y("sr-only",e),...t}));qs.displayName=sz.displayName;const Bdt=b.forwardRef(({className:e,...t},r)=>o.jsx(id,{ref:r,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));Bdt.displayName=id.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(Sn,{...n,children:o.jsxs(yn,{className:"overflow-hidden p-0",children:[o.jsx(vn,{className:"sr-only",children:t}),o.jsx(qs,{className:"sr-only",children:r}),o.jsx(Bdt,{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})]})})},Udt=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",an.colors),"cmdk-input-wrapper":"",children:[o.jsx(k_,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",an.colors)}),o.jsx(id.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",an.colors,e),...t})]}));Udt.displayName=id.Input.displayName;const Vdt=b.forwardRef(({className:e,...t},r)=>o.jsx(id.List,{ref:r,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Vdt.displayName=id.List.displayName;const qdt=b.forwardRef((e,t)=>o.jsx(id.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));qdt.displayName=id.Empty.displayName;const yb=b.forwardRef(({className:e,...t},r)=>o.jsx(id.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}));yb.displayName=id.Group.displayName;const uw=b.forwardRef(({className:e,...t},r)=>o.jsx(id.Separator,{ref:r,className:Y("-mx-1 h-px bg-border1",e),...t}));uw.displayName=id.Separator.displayName;const Zo=b.forwardRef(({className:e,...t},r)=>o.jsx(id.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",an.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=id.Item.displayName;const Hdt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});Hdt.displayName="CommandShortcut";function Qdt({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=tnr,i$r=rnr,o$r=cP,l$r=anr,c$r=nnr,xme=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"),Wdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(FJe,{ref:n,className:Y("cursor-pointer",e),...r,children:t}));Wdt.displayName=FJe.displayName;const Gdt=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(QJe,{ref:s,className:Y(xme,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(Hce,{className:"-rotate-90 opacity-50"})})]}));Gdt.displayName=QJe.displayName;const Zdt=b.forwardRef(({className:e,...t},r)=>o.jsx(cP,{children:o.jsx(yz,{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})}));Zdt.displayName=yz.displayName;const Ydt=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(cP,{container:t,children:o.jsx(zJe,{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})}));Ydt.displayName=zJe.displayName;const Xdt=b.forwardRef(({className:e,...t},r)=>o.jsx(UJe,{ref:r,className:Y(xme,e),...t}));Xdt.displayName=UJe.displayName;const Kdt=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(VJe,{ref:s,className:Y(xme,"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(hv,{})}),t]}));Kdt.displayName=VJe.displayName;const Jdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(qJe,{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(snr,{children:o.jsx(MHe,{className:"h-2 w-2 fill-current"})})}),t]}));Jdt.displayName=qJe.displayName;const eft=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(BJe,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));eft.displayName=BJe.displayName;const tft=b.forwardRef(({className:e,...t},r)=>o.jsx(HJe,{ref:r,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));tft.displayName=HJe.displayName;const rft=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});rft.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=Wdt;yt.Content=Ydt;yt.Group=i$r;yt.Portal=o$r;yt.Item=Xdt;yt.CheckboxItem=Kdt;yt.RadioItem=Jdt;yt.Label=eft;yt.Separator=tft;yt.Shortcut=rft;yt.Sub=l$r;yt.SubContent=Zdt;yt.SubTrigger=Gdt;yt.RadioGroup=c$r;const iL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Ln({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 nft=({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(Ln,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(pe,{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(zE,{})," ",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=xC(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(dme,fme,hme),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Ql.sm} text-ui-sm px-[.75em]`,md:`${Ql.md} text-ui-md px-[.75em]`,default:`${Ql.default} text-ui-md px-[.85em]`,lg:`${Ql.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 jx({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(Ju,{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 Tx({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(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(k_,{})})}),o.jsx(Wr,{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(Ju,{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(k_,{"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(me,{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(Xl,{})})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const hi=Pnr,pi=Mnr,ei=b.forwardRef(({className:e,children:t,variant:r="inputLike",size:n="default",...s},a)=>o.jsxs(vet,{ref:a,className:Y(yC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(Dnr,{asChild:!0,children:o.jsx(Hce,{className:Y("h-4 w-4 text-neutral3",an.colors)})})]}));ei.displayName=vet.displayName;const ti=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(Lnr,{children:o.jsx(bet,{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($nr,{className:Y("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ti.displayName=bet.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(xet,{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",an.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(znr,{children:o.jsx(hv,{className:"h-4 w-4 text-accent1"})})}),o.jsx(Fnr,{children:t})]}));ss.displayName=xet.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(Ju,{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(hi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(ei,{size:a,children:o.jsx(pi,{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={sm:`${Ql.sm} w-form-sm`,md:`${Ql.md} w-form-md`,lg:`${Ql.lg} w-form-lg`,default:`${Ql.default}`},b$r={sm:"sm",md:"default",lg:"lg",default:"default"},x$r={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none"},w$r="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",jn=je.forwardRef(({className:e,children:t,tooltip:r,size:n="md",variant:s="default",disabled:a,...i},l)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("button",{ref:l,disabled:a,"aria-label":typeof r=="string"?r:void 0,className:Y(w$r,$P,x$r[s],v$r[n],a&&"active:scale-100",e),...i,children:o.jsx(Ce,{size:b$r[n],children:t})})}),o.jsx(Wr,{children:r})]}));jn.displayName="IconButton";const S$r=xC("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(Oet,{ref:r,className:Y(S$r(),e),...t}));xt.displayName=Oet.displayName;function tE({children:e}){const t=e.replace(/\\n/g,`
|
|
293
|
+
`).concat(k.x,",").concat(k.y),E=_l(e.id)?XA("recharts-radial-line-"):e.id;return b.createElement("text",Ey({},n,{dominantBaseline:"central",className:xa("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},BNr=(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}=Hl(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}=Hl(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},T$=e=>e!=null&&"cx"in e&&qr(e.cx),UNr={angle:0,offset:5,zIndex:Jc.label,position:"middle",textBreakAll:!1};function VNr(e){if(!T$(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 kb(e){var t=od(e,UNr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=LNr(),h=Ylt(),p=s==="center"?h:f??h,m,g,y;r==null?m=p:T$(r)?m=r:m=Che(r);var x=VNr(m);if(!m||_l(a)&&_l(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=WT(WT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=$Ae(w,TNr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=$Ae(w,NNr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=$Nr(t);var T=lu(t);if(T$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return zNr(t,s,g,T,m);y=BNr(m,t.offset,t.position)}else{if(!x)return null;var j=jNr({viewBox:x,position:s,offset:t.offset,parentViewBox:T$(n)?void 0:n});y=WT(WT({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(kv,{zIndex:t.zIndex},b.createElement(Rpe,Ey({ref:d,className:xa("recharts-label",c)},T,y,{textAnchor:Hlt(T.textAnchor)?T.textAnchor:y.textAnchor,breakAll:u}),g))}kb.displayName="Label";var qNr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(kb,Ey({key:"label-implicit"},n)):ag(e)?b.createElement(kb,Ey({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===kb?b.cloneElement(e,WT({key:"label-implicit"},n)):b.createElement(kb,Ey({key:"label-implicit",content:e},n)):Ppe(e)?b.createElement(kb,Ey({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(kb,Ey({},e,{key:"label-implicit"},n)):null};function HNr(e){var{label:t,labelRef:r}=e,n=Ylt();return qNr(t,n,r)||null}var QNr=["valueAccessor"],WNr=["dataKey","clockWise","id","textBreakAll","zIndex"];function _4(){return _4=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},_4.apply(null,arguments)}function zAe(e,t){if(e==null)return{};var r,n,s=GNr(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 GNr(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 ZNr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(xNr(t))return t},Xlt=b.createContext(void 0),YNr=Xlt.Provider,Klt=b.createContext(void 0);Klt.Provider;function XNr(){return b.useContext(Xlt)}function KNr(){return b.useContext(Klt)}function N$(e){var{valueAccessor:t=ZNr}=e,r=zAe(e,QNr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=zAe(r,WNr),u=XNr(),d=KNr(),f=u||d;return!f||!f.length?null:b.createElement(kv,{zIndex:l??Jc.label},b.createElement(Yy,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=_l(n)?t(h,p):Yl(h.payload,n),y=_l(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(kb,_4({key:"label-".concat(p)},lu(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}))})))}N$.displayName="LabelList";function JNr(e){var{label:t}=e;return t?t===!0?b.createElement(N$,{key:"labelList-implicit"}):b.isValidElement(t)||Ppe(t)?b.createElement(N$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(N$,_4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Xae(){return Xae=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},Xae.apply(null,arguments)}var Jlt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=xa("recharts-dot",s);return qr(t)&&qr(r)&&qr(n)?b.createElement("circle",Xae({},sg(e),vhe(e),{className:a,cx:t,cy:r,r:n})):null},eAr={radiusAxis:{},angleAxis:{}},ect=Tc({name:"polarAxis",initialState:eAr,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:HPn,addAngleAxis:QPn,removeAngleAxis:WPn}=ect.actions,tAr=ect.reducer;function rAr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var KH={exports:{}},Ks={};var BAe;function nAr(){if(BAe)return Ks;BAe=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 Ks.ContextConsumer=i,Ks.ContextProvider=a,Ks.Element=e,Ks.ForwardRef=c,Ks.Fragment=r,Ks.Lazy=h,Ks.Memo=f,Ks.Portal=t,Ks.Profiler=s,Ks.StrictMode=n,Ks.Suspense=u,Ks.SuspenseList=d,Ks.isAsyncMode=function(){return!1},Ks.isConcurrentMode=function(){return!1},Ks.isContextConsumer=function(y){return g(y)===i},Ks.isContextProvider=function(y){return g(y)===a},Ks.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Ks.isForwardRef=function(y){return g(y)===c},Ks.isFragment=function(y){return g(y)===r},Ks.isLazy=function(y){return g(y)===h},Ks.isMemo=function(y){return g(y)===f},Ks.isPortal=function(y){return g(y)===t},Ks.isProfiler=function(y){return g(y)===s},Ks.isStrictMode=function(y){return g(y)===n},Ks.isSuspense=function(y){return g(y)===u},Ks.isSuspenseList=function(y){return g(y)===d},Ks.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)},Ks.typeOf=g,Ks}var UAe;function sAr(){return UAe||(UAe=1,KH.exports=nAr()),KH.exports}sAr();var tct=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,JH={},VAe;function aAr(){return VAe||(VAe=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})(JH)),JH}var eQ,qAe;function iAr(){return qAe||(qAe=1,eQ=aAr().isPlainObject),eQ}var oAr=iAr();const lAr=Uo(oAr);var HAe,QAe,WAe,GAe,ZAe;function YAe(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 XAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YAe(Object(r),!0).forEach(function(n){cAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cAr(e,t,r){return(t=uAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uAr(e){var t=dAr(e,"string");return typeof t=="symbol"?t:t+""}function dAr(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 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)}function iT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var KAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(HAe||(HAe=iT(["M ",",",""])),e,t),i+=Qi(QAe||(QAe=iT(["L ",",",""])),e+r,t),i+=Qi(WAe||(WAe=iT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(GAe||(GAe=iT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(ZAe||(ZAe=iT(["L ",","," Z"])),e,t),i},fAr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hAr=e=>{var t=od(e,fAr),{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=Ahe(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 _=xa("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",E4({},lu(t),{className:_,d:KAe(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=yit(["strokeDasharray"],u,c);return b.createElement(Nhe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},D=>{var $=Fu(E,s,D),U=Fu(T,a,D),z=Fu(j,i,D),H=Fu(N,r,D),Q=Fu(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",E4({},lu(t),{className:_,d:KAe(H,Q,$,U,z),ref:h,style:XAe(XAe({},L),t.style)}))})},pAr=["option","shapeType","activeClassName","inActiveClassName"];function mAr(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 JAe(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 C4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JAe(Object(r),!0).forEach(function(n){yAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yAr(e,t,r){return(t=vAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vAr(e){var t=bAr(e,"string");return typeof t=="symbol"?t:t+""}function bAr(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 xAr(e,t){return C4(C4({},t),e)}function wAr(e,t){return e==="symbols"}function eIe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(wit,r);case"trapezoid":return b.createElement(hAr,r);case"sector":return b.createElement(kit,r);case"symbols":if(wAr(t))return b.createElement(oat,r);break;case"curve":return b.createElement(git,r);default:return null}}function SAr(e){return b.isValidElement(e)?e.props:e}function OAr(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=mAr(e,pAr),i;if(b.isValidElement(t))i=b.cloneElement(t,C4(C4({},a),SAr(t)));else if(typeof t=="function")i=t(a,a.index);else if(lAr(t)&&typeof t!="boolean"){var l=xAr(t,a);i=b.createElement(eIe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(eIe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Yy,{className:n},i):b.createElement(Yy,{className:s},i)}function kAr(e){var{tooltipEntrySettings:t}=e,r=Vo(),n=ld(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(ICr(t)):s.current!==t&&r(RCr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(PCr(s.current)),s.current=null)},[r]),null}function _Ar(e){var{legendPayload:t}=e,r=Vo(),n=ld(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(WSr(t)):s.current!==t&&r(GSr({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(ZSr(s.current)),s.current=null)},[r]),null}var tQ,EAr=()=>{var[e]=b.useState(()=>XA("uid-"));return e},CAr=(tQ=JS.useId)!==null&&tQ!==void 0?tQ:EAr;function jAr(e,t){var r=CAr();return t||(e?"".concat(e,"-").concat(r):r)}var TAr=b.createContext(void 0),NAr=e=>{var{id:t,type:r,children:n}=e,s=jAr("recharts-".concat(r),t);return b.createElement(TAr.Provider,{value:s},n(s))},AAr={cartesianItems:[],polarItems:[]},rct=Tc({name:"graphicalItems",initialState:AAr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:li()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:li()},removeCartesianGraphicalItem:{reducer(e,t){var r=ph(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:li()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:li()},removePolarGraphicalItem:{reducer(e,t){var r=ph(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:li()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:li()}}}),{addCartesianGraphicalItem:IAr,replaceCartesianGraphicalItem:RAr,removeCartesianGraphicalItem:PAr,addPolarGraphicalItem:GPn,removePolarGraphicalItem:ZPn,replacePolarGraphicalItem:YPn}=rct.actions,MAr=rct.reducer,DAr=e=>{var t=Vo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(IAr(e)):r.current!==e&&t(RAr({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(PAr(r.current)),r.current=null)},[t]),null},LAr=b.memo(DAr),$Ar=["points"];function tIe(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 rQ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tIe(Object(r),!0).forEach(function(n){FAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FAr(e,t,r){return(t=zAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zAr(e){var t=BAr(e,"string");return typeof t=="symbol"?t:t+""}function BAr(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 j4(){return j4=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},j4.apply(null,arguments)}function UAr(e,t){if(e==null)return{};var r,n,s=VAr(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 VAr(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 qAr(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=xa(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=UAr(a,$Ar);return b.createElement(Jlt,j4({},l,{className:s}))}function HAr(e,t){return e==null?!1:t?!0:e.length===1}function QAr(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Jc.scatter}=e;if(!HAr(t,r))return null;var d=tct(r),f=sxr(r),h=t.map((m,g)=>{var y,x,w=rQ(rQ(rQ({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(qAr,{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(kv,{zIndex:u},b.createElement(Yy,j4({className:n},p),h))}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 nIe(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){WAr(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 WAr(e,t,r){return(t=GAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GAr(e){var t=ZAr(e,"string");return typeof t=="symbol"?t:t+""}function ZAr(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 YAr={xAxis:{},yAxis:{},zAxis:{}},nct=Tc({name:"cartesianAxis",initialState:YAr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:li()},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:li()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:li()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:li()},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:li()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:li()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:li()},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:li()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:li()},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]=nIe(nIe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:XAr,replaceXAxis:KAr,removeXAxis:JAr,addYAxis:eIr,replaceYAxis:tIr,removeYAxis:rIr,addZAxis:XPn,replaceZAxis:KPn,removeZAxis:JPn,updateYAxisWidth:nIr}=nct.actions,sIr=nct.reducer,aIr=Xe([ec],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),iIr=Xe([aIr,vv,bv],(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)}}),Mpe=()=>en(iIr),oIr=()=>en(Ijr);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 nQ(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){lIr(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 lIr(e,t,r){return(t=cIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cIr(e){var t=uIr(e,"string");return typeof t=="symbol"?t:t+""}function uIr(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 dIr=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=nQ(nQ(nQ({},l),Hz(s)),vhe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Jlt,c),b.createElement(Yy,{className:"recharts-active-dot",clipPath:i},u)};function fIr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=Jc.activeDot}=e,l=en(cI),c=oIr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return _l(u)?null:b.createElement(kv,{zIndex:i},b.createElement(dIr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var hIr=e=>{var{chartData:t}=e,r=Vo(),n=ld();return b.useEffect(()=>n?()=>{}:(r(SAe(t)),()=>{r(SAe(void 0))}),[t,r,n]),null},aIe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},sct=Tc({name:"brush",initialState:aIe,reducers:{setBrushSettings(e,t){return t.payload==null?aIe:t.payload}}}),{setBrushSettings:eMn}=sct.actions,pIr=sct.reducer;function mIr(e){return(e%180+180)%180}var gIr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=mIr(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)},yIr={dots:[],areas:[],lines:[]},act=Tc({name:"referenceElements",initialState:yIr,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=ph(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=ph(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=ph(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:tMn,removeDot:rMn,addArea:nMn,removeArea:sMn,addLine:aMn,removeLine:iMn}=act.actions,vIr=act.reducer,bIr=b.createContext(void 0),xIr=e=>{var{children:t}=e,[r]=b.useState("".concat(XA("recharts"),"-clip")),n=Mpe();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(bIr.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 ict(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 wIr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return gIr(n,r)}function SIr(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 dI(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 OIr(e,t){return ict(e,t+1)}function kIr(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:ict(n,u)};var g=c,y,x=()=>(y===void 0&&(y=r(m,g)),y),w=m.coordinate,S=c===0||dI(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 _Ir(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||dI(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 iIe(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 ic(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iIe(Object(r),!0).forEach(function(n){EIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EIr(e,t,r){return(t=CIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CIr(e){var t=jIr(e,"string");return typeof t=="symbol"?t:t+""}function jIr(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 TIr(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=ic(ic({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=ic(ic({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=dI(e,m.tickCoord,y,l,c);w&&(c=m.tickCoord-e*(y()/2+s),a[h]=ic(ic({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function NIr(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=ic(ic({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=dI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=ic(ic({},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=ic(ic({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=ic(ic({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=dI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=ic(ic({},k),{},{isShow:!0}))}},y=0;y<m;y++)g(y);return i}function Dpe(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)||kP.isSsr){var h;return(h=OIr(s,qr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?AN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?wIr(AN(T,{fontSize:t,letterSpacing:r}),g,f):AN(T,{fontSize:t,letterSpacing:r})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?hh(w.coordinate-x.coordinate):1,k=SIr(a,S,m);return c==="equidistantPreserveStart"?kIr(S,k,y,s,i):c==="equidistantPreserveEnd"?_Ir(S,k,y,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=NIr(S,k,y,s,i,c==="preserveStartEnd"):p=TIr(S,k,y,s,i),p.filter(_=>_.isShow))}var AIr=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},IIr={xAxis:{},yAxis:{}},oct=Tc({name:"renderedTicks",initialState:IIr,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:RIr,removeRenderedTicks:PIr}=oct.actions,MIr=oct.reducer,DIr=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function LIr(e,t){if(e==null)return{};var r,n,s=$Ir(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 $Ir(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 RS(){return RS=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},RS.apply(null,arguments)}function oIe(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?oIe(Object(r),!0).forEach(function(n){FIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FIr(e,t,r){return(t=zIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zIr(e){var t=BIr(e,"string");return typeof t=="symbol"?t:t+""}function BIr(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 zy={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:Jc.axis};function UIr(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),sg(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",RS({},u,{className:xa("recharts-cartesian-axis-line",Zz(l,"className"))}))}function VIr(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 qIr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function HIr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function QIr(e){var{option:t,tickProps:r,value:n}=e,s,a=xa(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=xa(i,rAr(t))),s=b.createElement(Rpe,RS({},r,{className:i}),n)}return s}function WIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Vo();return b.useEffect(()=>{if(n==null||r==null)return g1;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(RIr({ticks:a,axisId:n,axisType:r})),()=>{s(PIr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var GIr=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=Dpe(Hi(Hi({},k),{},{ticks:r}),w,S),N=sg(k),I=Hz(n),P=Hlt(N.textAnchor)?N.textAnchor:qIr(d,f),R=HIr(d,f),B={};typeof s=="object"&&(B=s);var D=Hi(Hi({},N),{},{fill:"none"},B),$=j.map(H=>Hi({entry:H},VIr(H,h,p,m,g,d,y,f,x))),U=$.map(H=>{var{entry:Q,line:L}=H;return b.createElement(Yy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&b.createElement("line",RS({},D,L,{className:xa("recharts-cartesian-axis-tick-line",Zz(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(Yy,RS({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},l0r(_,V,Q)),n&&b.createElement(QIr,{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(WIr,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(kv,{zIndex:Jc.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))}),ZIr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=LIr(e,DIr),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return AIr({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(kv,{zIndex:e.zIndex},b.createElement(Yy,{className:xa("recharts-cartesian-axis",a)},b.createElement(UIr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:sg(e)}),b.createElement(GIr,{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(MNr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(HNr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Lpe=b.forwardRef((e,t)=>{var r=od(e,zy);return b.createElement(ZIr,RS({},r,{ref:t}))});Lpe.displayName="CartesianAxis";var YIr=["x1","y1","x2","y2","key"],XIr=["offset"],KIr=["xAxisId","yAxisId"],JIr=["xAxisId","yAxisId"];function lIe(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 fc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lIe(Object(r),!0).forEach(function(n){eRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eRr(e,t,r){return(t=tRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tRr(e){var t=rRr(e,"string");return typeof t=="symbol"?t:t+""}function rRr(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 Nw(){return Nw=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},Nw.apply(null,arguments)}function T4(e,t){if(e==null)return{};var r,n,s=nRr(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 nRr(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=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 lct(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=T4(r,YIr),f=(s=sg(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=T4(f,XIr);n=b.createElement("line",Nw({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function aRr(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=T4(e,KIr),c=s.map((u,d)=>{var f=fc(fc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(lct,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function iRr(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=T4(e,JIr),c=s.map((u,d)=>{var f=fc(fc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(lct,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function oRr(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 lRr(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 cRr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return Gat(Dpe(fc(fc(fc({},zy),r),{},{ticks:Zat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},uRr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return Gat(Dpe(fc(fc(fc({},zy),r),{},{ticks:Zat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},dRr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Jc.grid};function cct(e){var t=nit(),r=sit(),n=rit(),s=fc(fc({},od(e,dRr)),{},{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=ld(),g=en(N=>cAe(N,"xAxis",a,m)),y=en(N=>cAe(N,"yAxis",i,m));if(!ig(u)||!ig(d)||!qr(l)||!qr(c))return null;var x=s.verticalCoordinatesGenerator||cRr,w=s.horizontalCoordinatesGenerator||uRr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:y?fc(fc({},y),{},{ticks:_?h:y.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);e4(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?fc(fc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);e4(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(kv,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(sRr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(oRr,Nw({},s,{horizontalPoints:S})),b.createElement(lRr,Nw({},s,{verticalPoints:k})),b.createElement(aRr,Nw({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:y})),b.createElement(iRr,Nw({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:y}))))}cct.displayName="CartesianGrid";var fRr={},uct=Tc({name:"errorBars",initialState:fRr,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:oMn,replaceErrorBar:lMn,removeErrorBar:cMn}=uct.actions,hRr=uct.reducer,pRr=["children"];function mRr(e,t){if(e==null)return{};var r,n,s=gRr(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 gRr(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 yRr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},vRr=b.createContext(yRr);function bRr(e){var{children:t}=e,r=mRr(e,pRr);return b.createElement(vRr.Provider,{value:r},t)}function dct(e,t){var r,n,s=en(u=>wv(u,e)),a=en(u=>Sv(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 xRr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=Mpe(),{needClipX:a,needClipY:i,needClip:l}=dct(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 fct=(e,t,r,n)=>dlt(e,"xAxis",t,n),hct=(e,t,r,n)=>ult(e,"xAxis",t,n),pct=(e,t,r,n)=>dlt(e,"yAxis",r,n),mct=(e,t,r,n)=>ult(e,"yAxis",r,n),wRr=Xe([Fi,fct,pct,hct,mct],(e,t,r,n,s)=>yv(e,"xAxis")?J5(t,n,!1):J5(r,s,!1)),SRr=(e,t,r,n,s)=>s;function ORr(e){return e.type==="line"}var kRr=Xe([Pot,SRr],(e,t)=>e.filter(ORr).find(r=>r.id===t)),_Rr=Xe([Fi,fct,pct,hct,mct,kRr,wRr,Ihe],(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 QRr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function ERr(e){var t=Hz(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 CRr=["id"],jRr=["type","layout","connectNulls","needClip","shape"],TRr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function fI(){return fI=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},fI.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 bm(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){NRr(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 NRr(e,t,r){return(t=ARr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ARr(e){var t=IRr(e,"string");return typeof t=="symbol"?t:t+""}function IRr(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 $pe(e,t){if(e==null)return{};var r,n,s=RRr(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 RRr(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 PRr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:Yat(r,t),payload:e}]},MRr=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:g1,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Yat(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(kAr,{tooltipEntrySettings:f})}),gct=(e,t)=>"".concat(t,"px ").concat(e,"px");function DRr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var LRr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return gct(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[...DRr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function $Rr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=$pe(n,CRr),u=sg(c);return b.createElement(QAr,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function FRr(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 bm(bm({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(YNr,{value:t?s:void 0},r)}function uIe(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=$pe(a,jRr),h=bm(bm({},lu(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(OAr,fI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement($Rr,{points:n,clipPathId:t,props:a}))}function zRr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function BRr(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=Ahe(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=zRr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(FRr,{points:i,showLabels:E},r.children,b.createElement(Nhe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Fu(P,N+P,R),D=Math.min(B,N),$;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Q=>parseFloat(Q));$=LRr(D,N,U)}else $=gct(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 bm(bm({},Q),{},{x:Fu(V.x,Q.x,R),y:Fu(V.y,Q.y,R)})}return h?bm(bm({},Q),{},{x:Fu(p*2,Q.x,R),y:Fu(m/2,Q.y,R)}):bm(bm({},Q),{},{x:Q.x,y:Q.y})});return s.current=H,b.createElement(uIe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:$})}return b.createElement(uIe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:$})}),b.createElement(JNr,{label:r.label}))}function URr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(BRr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var VRr=(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:Yl(e.payload,t)}};class qRr 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=xa("recharts-line",s),g=f,{r:y,strokeWidth:x}=ERr(r),w=tct(r),S=y*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(kv,{zIndex:p},b.createElement(Yy,{className:m},h&&b.createElement("defs",null,b.createElement(xRr,{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(bRr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:VRr,errorBarOffset:0},b.createElement(URr,{props:this.props,clipPathId:g}))),b.createElement(fIr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var yct={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:Jc.line,type:"linear"};function HRr(e){var t=od(e,yct),{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=$pe(t,TRr),{needClip:x}=dct(p,m),w=Mpe(),S=nC(),k=ld(),_=en(I=>_Rr(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(qRr,fI({},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 QRr(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=Yl(u,i);if(t==="horizontal"){var h=lTe({axis:r,ticks:s,bandSize:l,entry:u,index:d}),p=_l(f)?null:n.scale.map(f);return{x:h,y:p??null,value:f,payload:u}}var m=_l(f)?null:r.scale.map(f),g=lTe({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 WRr(e){var t=od(e,yct),r=ld();return b.createElement(NAr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(_Ar,{legendPayload:PRr(t)}),b.createElement(MRr,{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(LAr,{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(HRr,fI({},t,{id:n}))))}var vct=b.memo(WRr,p9);vct.displayName="Line";var GRr=["domain","range"],ZRr=["domain","range"];function dIe(e,t){if(e==null)return{};var r,n,s=YRr(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 YRr(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 fIe(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 bct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=dIe(e,GRr),{domain:a,range:i}=t,l=dIe(t,ZRr);return!fIe(r,a)||!fIe(n,i)?!1:p9(s,l)}var XRr=["type"],KRr=["dangerouslySetInnerHTML","ticks","scale"],JRr=["id","scale"];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 hIe(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 pIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hIe(Object(r),!0).forEach(function(n){ePr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ePr(e,t,r){return(t=tPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tPr(e){var t=rPr(e,"string");return typeof t=="symbol"?t:t+""}function rPr(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 Jae(e,t){if(e==null)return{};var r,n,s=nPr(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 nPr(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 sPr(e){var t=Vo(),r=b.useRef(null),n=ait(),{type:s}=e,a=Jae(e,XRr),i=y9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return pIe(pIe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(XAr(l)):r.current!==l&&t(KAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(JAr(r.current)),r.current=null)},[t]),null}var aPr=e=>{var{xAxisId:t,className:r}=e,n=en(Kat),s=ld(),a="xAxis",i=en(x=>clt(x,a,t,s)),l=en(x=>hCr(x,t)),c=en(x=>bCr(x,t)),u=en(x=>Not(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Jae(e,KRr),{id:m,scale:g}=u,y=Jae(u,JRr);return b.createElement(Lpe,Kae({},p,y,{x:c.x,y:c.y,width:l.width,height:l.height,className:xa("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},iPr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:zy.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:zy.tickLine,tickSize:zy.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,xAxisId:0},oPr=e=>{var t=od(e,iPr);return b.createElement(b.Fragment,null,b.createElement(sPr,{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(aPr,t))},xct=b.memo(oPr,bct);xct.displayName="XAxis";var lPr=["type"],cPr=["dangerouslySetInnerHTML","ticks","scale"],uPr=["id","scale"];function eie(){return eie=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},eie.apply(null,arguments)}function mIe(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 gIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mIe(Object(r),!0).forEach(function(n){dPr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dPr(e,t,r){return(t=fPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fPr(e){var t=hPr(e,"string");return typeof t=="symbol"?t:t+""}function hPr(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 tie(e,t){if(e==null)return{};var r,n,s=pPr(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 pPr(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 mPr(e){var t=Vo(),r=b.useRef(null),n=ait(),{type:s}=e,a=tie(e,lPr),i=y9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return gIe(gIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(eIr(l)):r.current!==l&&t(tIr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(rIr(r.current)),r.current=null)},[t]),null}function gPr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(Kat),c=ld(),u=Vo(),d="yAxis",f=en(E=>SCr(E,t)),h=en(E=>wCr(E,t)),p=en(E=>clt(E,d,t,c)),m=en(E=>Aot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Ppe(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(nIr({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=tie(e,cPr),{id:S,scale:k}=m,_=tie(m,uPr);return b.createElement(Lpe,eie({},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:xa("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var yPr={allowDataOverflow:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:Xo.allowDuplicatedCategory,angle:Xo.angle,axisLine:zy.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:zy.tickLine,tickSize:zy.tickSize,type:Xo.type,niceTicks:Xo.niceTicks,width:Xo.width,yAxisId:0},vPr=e=>{var t=od(e,yPr);return b.createElement(b.Fragment,null,b.createElement(mPr,{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(gPr,t))},wct=b.memo(vPr,bct);wct.displayName="YAxis";var bPr=(e,t)=>t,Fpe=Xe([bPr,Fi,Vit,jl,Clt,Ov,Hjr,ec],Kjr);function xPr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function zpe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(xPr(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 Sct=df("mouseClick"),Oct=xP();Oct.startListening({actionCreator:Sct,effect:(e,t)=>{var r=e.payload,n=Fpe(t.getState(),zpe(r));n?.activeIndex!=null&&t.dispatch(LCr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var rie=df("mouseMove"),kct=xP(),_O=null,V0=null,sQ=null;kct.startListening({actionCreator:rie,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");_O!==null&&(cancelAnimationFrame(_O),_O=null),V0!==null&&(typeof s!="number"||!i)&&(clearTimeout(V0),V0=null),sQ=zpe(r);var l=()=>{var c=t.getState(),u=Ope(c,c.tooltip.settings.shared);if(!sQ){_O=null,V0=null;return}if(u==="axis"){var d=Fpe(c,sQ);d?.activeIndex!=null?t.dispatch(vlt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(ylt())}_O=null,V0=null};if(!i){l();return}s==="raf"?_O=requestAnimationFrame(l):typeof s=="number"&&V0===null&&(V0=setTimeout(l,s))}});function wPr(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 yIe={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},_ct=Tc({name:"rootProps",initialState:yIe,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:yIe.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}}}),SPr=_ct.reducer,{updateOptions:OPr}=_ct.actions,kPr=null,_Pr={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)},Ect=Tc({name:"polarOptions",initialState:kPr,reducers:_Pr}),{updatePolarOptions:uMn}=Ect.actions,EPr=Ect.reducer,Cct=df("keyDown"),jct=df("focus"),Tct=df("blur"),A9=xP(),EO=null,q0=null,XD=null;A9.startListening({actionCreator:Cct,effect:(e,t)=>{XD=e.payload,EO!==null&&(cancelAnimationFrame(EO),EO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");q0!==null&&(typeof n!="number"||!a)&&(clearTimeout(q0),q0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=XD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=kpe(u,dC(l),IP(l),PP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=Ov(l);if(d==="Enter"){var m=k4(l,"axis","hover",String(u.index));t.dispatch(O4({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=CCr(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=k4(l,"axis","hover",String(w));t.dispatch(O4({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{EO=null,q0=null}};if(!a){i();return}n==="raf"?EO=requestAnimationFrame(i):typeof n=="number"&&q0===null&&(i(),XD=null,q0=setTimeout(()=>{XD?i():(q0=null,EO=null)},n))}});A9.startListening({actionCreator:jct,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=k4(r,"axis","hover",String(a));t.dispatch(O4({active:!0,activeIndex:a,activeCoordinate:i}))}}}});A9.startListening({actionCreator:Tct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(O4({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function Nct(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 Xf=df("externalEvent"),Act=xP(),KD=new Map,oT=new Map,aQ=new Map;Act.startListening({actionCreator:Xf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=Nct(n);aQ.set(s,{handler:r,reactEvent:a});var i=KD.get(s);i!==void 0&&(cancelAnimationFrame(i),KD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=oT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),oT.delete(s));var p=()=>{var y=aQ.get(s);try{if(!y)return;var{handler:x,reactEvent:w}=y,S=t.getState(),k={activeCoordinate:Tjr(S),activeDataKey:Ejr(S),activeIndex:cI(S),activeLabel:Nlt(S),activeTooltipIndex:cI(S),isTooltipActive:Njr(S)};x&&x(k,w)}finally{KD.delete(s),oT.delete(s),aQ.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);KD.set(s,m)}else if(typeof c=="number"){if(!oT.has(s)){p();var g=setTimeout(p,c);oT.set(s,g)}}else p()}}});var CPr=Xe([cC],e=>e.tooltipItemPayloads),jPr=Xe([CPr,(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)}}}),Ict=df("touchMove"),Rct=xP(),H0=null,ob=null,vIe=null,lT=null;Rct.startListening({actionCreator:Ict,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){lT=Nct(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");H0!==null&&(cancelAnimationFrame(H0),H0=null),ob!==null&&(typeof s!="number"||!i)&&(clearTimeout(ob),ob=null),vIe=Array.from(r.touches).map(c=>zpe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(lT!=null){var c=t.getState(),u=Ope(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=vIe)===null||d===void 0?void 0:d[0];if(f==null){H0=null,ob=null;return}var h=Fpe(c,f);h?.activeIndex!=null&&t.dispatch(vlt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=lT.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(nSr),x=(p=g.getAttribute(sSr))!==null&&p!==void 0?p:void 0,w=uC(c).find(_=>_.id===x);if(y==null||w==null||x==null)return;var{dataKey:S}=w,k=jPr(c,y,x);t.dispatch(DCr({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:x}))}H0=null,ob=null}};if(!i){l();return}s==="raf"?H0=requestAnimationFrame(l):typeof s=="number"&&ob===null&&(l(),lT=null,ob=setTimeout(()=>{lT?l():(ob=null,H0=null)},s))}}});var Pct={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Mct=Tc({name:"eventSettings",initialState:Pct,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:TPr}=Mct.actions,NPr=Mct.reducer,APr=dnt({brush:pIr,cartesianAxis:sIr,chartData:NTr,errorBars:hRr,eventSettings:NPr,graphicalItems:MAr,layout:Uwr,legend:YSr,options:_Tr,polarAxis:tAr,polarOptions:EPr,referenceElements:vIr,renderedTicks:MIr,rootProps:SPr,tooltip:$Cr,zIndex:fTr}),IPr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return hwr({reducer:APr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([Oct.middleware,kct.middleware,A9.middleware,Act.middleware,Rct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(Pat({type:"raf"}))},devTools:{serialize:{replacer:wPr},name:"recharts-".concat(r)}})};function RPr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=ld(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=IPr(t,n));var i=xhe;return b.createElement(xnt,{context:i,store:a.current},r)}function PPr(e){var{layout:t,margin:r}=e,n=Vo(),s=ld();return b.useEffect(()=>{s||(n(Fwr(t)),n($wr(r)))},[n,s,t,r]),null}var MPr=b.memo(PPr,p9);function DPr(e){var t=Vo();return b.useEffect(()=>{t(OPr(e))},[t,e]),null}var LPr=e=>{var t=Vo();return b.useEffect(()=>{t(TPr(e))},[t,e]),null},$Pr=b.memo(LPr,p9);function bIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Vo();return b.useLayoutEffect(()=>(n.current&&s(uTr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(dTr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function xIe(e){var{children:t,isPanorama:r}=e,n=en(eTr);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(bIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(bIe,{key:i,zIndex:i,isPanorama:r})))}var FPr=["children"];function zPr(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 N4(){return N4=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},N4.apply(null,arguments)}var UPr={width:"100%",height:"100%",display:"block"},VPr=b.forwardRef((e,t)=>{var r=nit(),n=sit(),s=mit();if(!ig(r)||!ig(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(zst,N4({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:UPr,ref:t}),a)}),qPr=e=>{var{children:t}=e,r=en(c9);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(zst,{width:n,height:s,x:i,y:a},t)},wIe=b.forwardRef((e,t)=>{var{children:r}=e,n=zPr(e,FPr),s=ld();return s?b.createElement(qPr,null,b.createElement(xIe,{isPanorama:!0},r)):b.createElement(VPr,N4({ref:t},n),b.createElement(xIe,{isPanorama:!1},r))});function HPr(){var e=Vo(),[t,r]=b.useState(null),n=en(rSr);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(Bwr(a))}},[t,e,n]),r}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 QPr(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){WPr(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 WPr(e,t,r){return(t=GPr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GPr(e){var t=ZPr(e,"string");return typeof t=="symbol"?t:t+""}function ZPr(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 Jb(){return Jb=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},Jb.apply(null,arguments)}var YPr=()=>(FTr(),null);function A4(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var XPr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:A4((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:A4((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(SP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Jb({ref:c},e)))}),KPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:A4(r),containerHeight:A4(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(SP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Jb({ref:l},e)))}),JPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(SP,{width:r,height:n}),b.createElement("div",Jb({ref:t},e)))}),eMr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(KPr,Jb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(JPr,Jb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(SP,{width:r,height:n}),b.createElement("div",Jb({ref:t},e)))});function tMr(e){return e?XPr:eMr}var rMr=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=HPr(),P=Ehe(),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=>{_(Sct(ie)),_(Xf({handler:a,reactEvent:ie}))},[_,a]),U=b.useCallback(ie=>{_(rie(ie)),_(Xf({handler:u,reactEvent:ie}))},[_,u]),z=b.useCallback(ie=>{_(ylt()),_(Xf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(rie(ie)),_(Xf({handler:f,reactEvent:ie}))},[_,f]),Q=b.useCallback(()=>{_(jct())},[_]),L=b.useCallback(()=>{_(Tct())},[_]),Z=b.useCallback(ie=>{_(Cct(ie.key))},[_]),V=b.useCallback(ie=>{_(Xf({handler:i,reactEvent:ie}))},[_,i]),M=b.useCallback(ie=>{_(Xf({handler:l,reactEvent:ie}))},[_,l]),W=b.useCallback(ie=>{_(Xf({handler:c,reactEvent:ie}))},[_,c]),G=b.useCallback(ie=>{_(Xf({handler:h,reactEvent:ie}))},[_,h]),J=b.useCallback(ie=>{_(Xf({handler:g,reactEvent:ie}))},[_,g]),ae=b.useCallback(ie=>{S&&_(Ict(ie)),_(Xf({handler:m,reactEvent:ie}))},[_,S,m]),te=b.useCallback(ie=>{_(Xf({handler:p,reactEvent:ie}))},[_,p]),re=tMr(w);return b.createElement(Llt.Provider,{value:E},b.createElement(dxr.Provider,{value:j},b.createElement(re,{width:R??y?.width,height:B??y?.height,className:xa("recharts-wrapper",n),style:QPr({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(YPr,null),r)))}),nMr=["width","height","responsive","children","className","style","compact","title","desc"];function sMr(e,t){if(e==null)return{};var r,n,s=aMr(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 aMr(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 iMr=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=sMr(e,nMr),h=sg(f);return c?b.createElement(b.Fragment,null,b.createElement(SP,{width:r,height:n}),b.createElement(wIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(rMr,{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(wIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(xIr,null,a)))});function nie(){return nie=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},nie.apply(null,arguments)}function OIe(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 oMr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OIe(Object(r),!0).forEach(function(n){lMr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lMr(e,t,r){return(t=cMr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cMr(e){var t=uMr(e,"string");return typeof t=="symbol"?t:t+""}function uMr(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 dMr={top:5,right:5,bottom:5,left:5},fMr=oMr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:dMr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Pct),hMr=b.forwardRef(function(t,r){var n,s=od(t.categoricalChartProps,fMr),{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(RPr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(hIr,{chartData:u.data}),b.createElement(MPr,{layout:s.layout,margin:s.margin}),b.createElement($Pr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(DPr,{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(iMr,nie({},s,{ref:r})))}),pMr=["axis"],mMr=b.forwardRef((e,t)=>b.createElement(hMr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:pMr,tooltipPayloadSearcher:OTr,categoricalChartProps:e,ref:t}));function gMr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function yMr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function vMr(e){return e/100*window.innerHeight}function bMr(e){return e/100*window.innerWidth}function xMr(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 GT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=xMr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=yMr(t,s);break}case"em":{n=gMr(t,s);break}case"vh":{n=vMr(s);break}case"vw":{n=bMr(s);break}}return n}function qu(e){return parseFloat(e.toFixed(3))}function J_({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 sie(e){const{panels:t}=e,r=J_({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=GT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=qu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=GT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=qu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=GT({groupSize:r,panelElement:s,styleProp:a.minSize});c=qu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=GT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=qu(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 aie(e,t){return Array.from(t).sort(e==="horizontal"?wMr:SMr)}function wMr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function SMr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function Dct(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Lct(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 OMr({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}=Lct(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return ja(s,"No rect found"),s}let JD;function kMr(){return JD===void 0&&(typeof matchMedia=="function"?JD=!!matchMedia("(pointer:coarse)").matches:JD=!1),JD}function $ct(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=aie(r,Array.from(t.children).filter(Dct).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=OMr({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=kMr()?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:J_({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 Fct=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)}}},Fm=new Map;const zct=new Fct;function _Mr(e){Fm=new Map(Fm),Fm.delete(e)}function kIe(e,t){for(const[r]of Fm)if(r.id===e)return r}function ex(e,t){for(const[r,n]of Fm)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function b1(){return Fm}function Bpe(e,t){return zct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function nv(e,t){const r=Fm.get(e);Fm=new Map(Fm),Fm.set(e,t),zct.emit("groupChange",{group:e,prev:r,next:t})}function EMr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=Lct(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 CMr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function jMr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:CIe(e),b:CIe(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:EIe(_Ie(r.a)),b:EIe(_Ie(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 TMr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function NMr(e){const t=getComputedStyle(Bct(e)??e).display;return t==="flex"||t==="inline-flex"}function AMr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||NMr(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"||TMr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function _Ie(e){let t=e.length;for(;t--;){const r=e[t];if(ja(r,"Missing node"),AMr(r))return r}return null}function EIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function CIe(e){const t=[];for(;e;)t.push(e),e=Bct(e);return t}function Bct(e){const{parentNode:t}=e;return CMr(t)?t.host:t}function IMr(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 RMr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!Dct(r)||r.contains(e)||e.contains(r))return!0;if(jMr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(IMr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function Upe(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=$ct(s),i=EMr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&RMr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function PMr(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 Wc(e,t,r=0){return Math.abs(qu(e)-qu(t))<=r}function mm(e,t){return Wc(e,t)?0:e>t?1:-1}function yk({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(mm(n,c)<0)if(a){const u=(s+c)/2;mm(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=qu(n),n}function hI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(Wc(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}`),Wc(k,x)){const _=S-k;mm(_,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}`),Wc(k,S)){const _=k-x;mm(_,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&&mm(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;mm(T,k)<0&&(e=mm(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;mm(T,k)<0&&(e=mm(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=yk({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=yk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!Wc(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(PMr(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=yk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:y,size:x});if(u[g]=w,!Wc(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=yk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(Wc(_,T)||(S-=T-_,u[k]=T),Wc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,y)=>y+g,0);if(!Wc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,y,x)=>(g[m[x]]=y,g),{})}function PS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||mm(e[r],t[r])!==0)return!1;return!0}function MS({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(!Wc(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=yk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!Wc(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=yk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,Wc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function Uct({groupId:e,panelId:t}){const r=()=>{const l=b1();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=hI({delta:y?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:y?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=MS({layout:x,panelConstraints:d});PS(p,w)||nv(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&&Wc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=J_({group:c}),f=GT({groupSize:d,panelElement:u,styleProp:l}),h=qu(f/d*100);i(h)}}}function jIe(e){if(e.defaultPrevented)return;const t=b1();Upe(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=Uct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function A$(e){const t=b1();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 Vct({groupId:e}){const t=()=>{const r=b1();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=MS({layout:r,panelConstraints:s});return n?l:(PS(l,u)||nv(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function Q0(e,t){const r=A$(e),n=ex(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=Vct({groupId:r.id}).getLayout(),c=hI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=MS({layout:c,panelConstraints:n.derivedPanelConstraints});PS(l,u)||nv(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function TIe(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=A$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&Q0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&Q0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&Q0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&Q0(t,-5);break}case"End":{e.preventDefault(),Q0(t,100);break}case"Enter":{e.preventDefault();const n=A$(t),s=ex(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;Q0(t,p-h)}break}case"F6":{e.preventDefault();const n=A$(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(),Q0(t,-100);break}}}let t_={cursorFlags:0,state:"inactive"};const Vpe=new Fct;function DS(){return t_}function MMr(e){return Vpe.addListener("change",e)}function DMr(e){const t=t_,r={...t_};r.cursorFlags=e,t_=r,Vpe.emit("change",{prev:t,next:r})}function r_(e){const t=t_;t_=e,Vpe.emit("change",{prev:t,next:e})}function NIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=b1(),r=Upe(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)}),r_({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const LMr=e=>e,iQ=()=>{},qct=1,Hct=2,Qct=4,Wct=8,AIe=3,IIe=12;let eL;function RIe(){return eL===void 0&&(eL=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(eL=!0)),eL}function $Mr({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&&RIe()){const a=(e&qct)!==0,i=(e&Hct)!==0,l=(e&Qct)!==0,c=(e&Wct)!==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 RIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const PIe=new WeakMap;function qpe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=PIe.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=DS();switch(n.state){case"active":case"hover":{const s=$Mr({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}}PIe.set(e,{prevStyle:t,styleSheet:r})}function Gct({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=hI({delta:g,initialLayout:y,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(PS(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?qct:Hct;break}case"vertical":{l|=g<0?Qct:Wct;break}}}else nv(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&AIe:c|=l&AIe,t.movementY===0?c|=i&IIe:c|=l&IIe,DMr(c),qpe(e)}function MIe(e){const t=b1(),r=DS();r.state==="active"&&Gct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function DIe(e){if(e.defaultPrevented)return;const t=DS(),r=b1();switch(t.state){case"active":{if(e.buttons===0){r_({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=ex(n.group.id,!0);nv(n.group,s)});return}Gct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=Upe(e,r);n.length===0?t.state!=="inactive"&&r_({cursorFlags:0,state:"inactive"}):r_({cursorFlags:0,hitRegions:n,state:"hover"}),qpe(e.currentTarget);break}}}function LIe(e){e.relatedTarget instanceof HTMLIFrameElement&&DS().state==="hover"&&r_({cursorFlags:0,state:"inactive"})}function $Ie(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=DS();t.state==="active"&&(r_({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(qpe(e.currentTarget),t.hitRegions.forEach(r=>{const n=ex(r.group.id,!0);nv(r.group,n)}),e.preventDefault()))}function FIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=qu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=qu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function FMr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=J_({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:qu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function zMr(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 BMr({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=qu(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]=qu(h/a*u)}else{const f=qu(u/c.length);for(const h of c)d[h]=f}return d}function UMr(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 CO=new Map;function VMr(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=J_({group:e});if(w===0)return;const S=ex(e.id);if(!S)return;const k=sie(e),_=S.defaultLayoutDeferred?FIe(k):S.layout,E=BMr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=MS({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&PS(S.layout,T)&&zMr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;nv(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else FMr(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=J_({group:e}),l=sie(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(UMr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??FIe(l),f=MS({layout:d,panelConstraints:l}),h=e.element.ownerDocument;CO.set(h,(CO.get(h)??0)+1);const p=new Map;return $ct(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),nv(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",TIe)}),CO.get(h)===1&&(h.addEventListener("dblclick",jIe,!0),h.addEventListener("pointerdown",NIe,!0),h.addEventListener("pointerleave",MIe),h.addEventListener("pointermove",DIe),h.addEventListener("pointerout",LIe),h.addEventListener("pointerup",$Ie,!0)),function(){t=!1,CO.set(h,Math.max(0,(CO.get(h)??0)-1)),_Mr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",TIe)}),CO.get(h)||(h.removeEventListener("dblclick",jIe,!0),h.removeEventListener("pointerdown",NIe,!0),h.removeEventListener("pointerleave",MIe),h.removeEventListener("pointermove",DIe),h.removeEventListener("pointerout",LIe),h.removeEventListener("pointerup",$Ie,!0)),a.disconnect()}}function qMr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Hpe(e){const t=b.useId();return`${e??t}`}const x1=typeof window<"u"?b.useLayoutEffect:b.useEffect;function IN(e){const t=b.useRef(e);return x1(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function Qpe(...e){return IN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Wpe(e){const t=b.useRef({...e});return x1(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Zct=b.createContext(null);function HMr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:LMr});b.useImperativeHandle(t,()=>r.current,[]),x1(()=>{Object.assign(r.current,Vct({groupId:e}))})}function I9({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=IN(P=>{PS(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),y=IN(P=>{PS(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Hpe(l),w=b.useRef(null),[S,k]=qMr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=Qpe(w,a);HMr(x,i);const T=IN((P,R)=>{const B=DS(),D=kIe(P),$=ex(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=Wpe({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=aie(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(B=>B!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=aie(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=kIe(x),$=ex(x);D&&$&&nv(D,{...$,derivedPanelConstraints:sie(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 x1(()=>{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 $=VMr(D),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:H}=ex(D.id,!0);!U&&z.length>0&&(g(H),y(H));const Q=Bpe(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=Wc(J.collapsedSize,M[J.panelId]),re=Wc(J.collapsedSize,ae[J.panelId]);te&&!re&&(D.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const G=DS().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(Zct.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})})}I9.displayName="Group";function oQ(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function Gpe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=oQ(a,t??[]),l=b.useSyncExternalStore(QMr,()=>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=oQ(a,Object.keys(p)):m=oQ(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 QMr(){return function(){}}function Zpe(){const e=b.useContext(Zct);return ja(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function WMr(e,t){const{id:r}=Zpe(),n=b.useRef({collapse:iQ,expand:iQ,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:iQ});b.useImperativeHandle(t,()=>n.current,[]),x1(()=>{Object.assign(n.current,Uct({groupId:r,panelId:e}))})}function eE({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=Hpe(c),x=Wpe({disabled:a}),w=b.useRef(null),S=Qpe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=Zpe(),N=f!==null,I=IN((R,B,D)=>{f?.(R,c,D)});x1(()=>{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]),WMr(y,h);const P=b.useSyncExternalStore(R=>Bpe(_,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:{...GMr,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})})}eE.displayName="Panel";const GMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function ZMr(){return b.useRef(null)}function YMr({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=MS({layout:hI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=MS({layout:hI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function Yct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Hpe(s),c=Wpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=Qpe(p,n),{disableCursor:g,id:y,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=Zpe(),k=x==="horizontal"?"vertical":"horizontal";x1(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=MMr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Bpe(y,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:D}=P.next,$=D.get(T);if($){const U=$[0],z=$.indexOf(U);d(YMr({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})}Yct.displayName="Separator";const zIe=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},XMr=(e=>e?zIe(e):zIe),KMr=e=>e;function JMr(e,t=KMr){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 BIe=e=>{const t=XMr(e),r=n=>JMr(t,n);return Object.assign(r,t),r},Ype=(e=>e?BIe(e):BIe);function e2r(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 iie=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return iie(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return iie(n)(r)}}}},t2r=(e,t)=>(r,n,s)=>{let a={storage:e2r(()=>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 iie(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},r2r=t2r;var w1=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(){}},n2r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},s2r=class{#e=n2r;#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)}},Aw=new s2r;function a2r(e){setTimeout(e,0)}var LS=typeof window>"u"||"Deno"in globalThis;function uc(){}function i2r(e,t){return typeof e=="function"?e(t):e}function oie(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xct(e,t){return Math.max(e+(t||0)-Date.now(),0)}function tx(e,t){return typeof e=="function"?e(t):e}function eh(e,t){return typeof e=="function"?e(t):e}function UIe(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(n){if(t.queryHash!==Xpe(i,t.options))return!1}else if(!pI(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 VIe(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if($S(t.options.mutationKey)!==$S(a))return!1}else if(!pI(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Xpe(e,t){return(t?.queryKeyHashFn||$S)(e)}function $S(e){return JSON.stringify(e,(t,r)=>lie(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function pI(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pI(e[r],t[r])):!1}var o2r=Object.prototype.hasOwnProperty;function Kpe(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=qIe(e)&&qIe(t);if(!n&&!(lie(e)&&lie(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:o2r.call(e,f))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){c[f]=p;continue}const m=Kpe(h,p,r+1);c[f]=m,m===h&&u++}return a===l&&u===a?e:c}function mI(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 qIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lie(e){if(!HIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!HIe(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function HIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function l2r(e){return new Promise(t=>{Aw.setTimeout(t,e)})}function cie(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Kpe(e,t):t}function c2r(e){return e}function u2r(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function d2r(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Jpe=Symbol();function Kct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Jpe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eme(e,t){return typeof e=="function"?e(...t):!!e}function f2r(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 h2r=class extends w1{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!LS&&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"}},tme=new h2r;function uie(){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 p2r=a2r;function m2r(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=p2r;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=m2r(),g2r=class extends w1{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!LS&&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}},I4=new g2r;function y2r(e){return Math.min(1e3*2**e,3e4)}function Jct(e){return(e??"online")==="online"?I4.isOnline():!0}var die=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function eut(e){let t=!1,r=0,n;const s=uie(),a=()=>s.status!=="pending",i=g=>{if(!a()){const y=new die(g);h(y),e.onCancel?.(y)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>tme.isFocused()&&(e.networkMode==="always"||I4.isOnline())&&e.canRun(),d=()=>Jct(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??(LS?0:3),S=e.retryDelay??y2r,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),l2r(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 tut=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oie(this.gcTime)&&(this.#e=Aw.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(LS?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Aw.clearTimeout(this.#e),this.#e=void 0)}},v2r=class extends tut{#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=WIe(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=WIe(this.options);t.data!==void 0&&(this.setState(QIe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=cie(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(uc).catch(uc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>eh(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Jpe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>tx(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:!Xct(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=Kct(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=eut({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof die&&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 die){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,...rut(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...QIe(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 rut(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jct(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function QIe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function WIe(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 R9=class extends w1{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=uie(),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),GIe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fie(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 eh(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&&!mI(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&ZIe(this.#t,r,this.options,t)&&this.#m(),this.updateResult(),n&&(this.#t!==r||eh(this.options.enabled,this.#t)!==eh(t.enabled,this.#t)||tx(this.options.staleTime,this.#t)!==tx(t.staleTime,this.#t))&&this.#g();const s=this.#y();n&&(this.#t!==r||eh(this.options.enabled,this.#t)!==eh(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 x2r(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(uc)),t}#g(){this.#x();const e=tx(this.options.staleTime,this.#t);if(LS||this.#s.isStale||!oie(e))return;const r=Xct(this.#s.dataUpdatedAt,e)+1;this.#c=Aw.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,!(LS||eh(this.options.enabled,this.#t)===!1||!oie(this.#l)||this.#l===0)&&(this.#u=Aw.setInterval(()=>{(this.options.refetchIntervalInBackground||tme.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(Aw.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Aw.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&&GIe(e,t),I=j&&ZIe(e,r,t,n);(N||I)&&(d={...d,...rut(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=cie(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=cie(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:rme(e,t),refetch:this.refetch,promise:this.#o,isEnabled:eh(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=uie();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),mI(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 b2r(e,t){return eh(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function GIe(e,t){return b2r(e,t)||e.state.data!==void 0&&fie(e,t,t.refetchOnMount)}function fie(e,t,r){if(eh(t.enabled,e)!==!1&&tx(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&rme(e,t)}return!1}function ZIe(e,t,r,n){return(e!==t||eh(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&rme(e,r)}function rme(e,t){return eh(t.enabled,e)!==!1&&e.isStaleByTime(tx(t.staleTime,e))}function x2r(e,t){return!mI(e.getCurrentResult(),t)}function R4(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=>{f2r(m,()=>t.signal,()=>d=!0)},h=Kct(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?d2r:u2r;return{pages:_(m.pages,S,k),pageParams:_(m.pageParams,g,k)}};if(s&&a.length){const m=s==="backward",g=m?nut:hie,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:hie(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 hie(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 nut(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function w2r(e,t){return t?hie(e,t)!=null:!1}function S2r(e,t){return!t||!e.getPreviousPageParam?!1:nut(e,t)!=null}var O2r=class extends R9{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:R4()})}getOptimisticResult(e){return e.behavior=R4(),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:w2r(t,r.data),hasPreviousPage:S2r(t,r.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!h}}},k2r=class extends tut{#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||sut(),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=eut({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 sut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _2r=class extends w1{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 k2r({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=tL(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=tL(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=tL(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=tL(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=>VIe(t,r))}findAll(e={}){return this.getAll().filter(t=>VIe(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(uc))))}};function tL(e){return e.options.scope?.id}var E2r=class extends w1{#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),mI(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&$S(r.mutationKey)!==$S(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??sut();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 YIe(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function C2r(e,t,r){const n=e.slice(0);return n[t]=r,n}var j2r=class extends w1{#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||!mI(d,h)});!c&&!u||(c&&(this.#d=n,this.#n=s),this.#t=a,this.hasListeners()&&(c&&(YIe(r,s).forEach(d=>{d.destroy()}),YIe(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=Kpe(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 R9(this.#e,s);r.push({defaultedQueryOptions:s,observer:i})}),r}#l(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#t=C2r(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)})})}}},T2r=class extends w1{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const n=t.queryKey,s=t.queryHash??Xpe(n,t);let a=this.get(s);return a||(a=new v2r({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=>UIe(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>UIe(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()})})}},N2r=class{#e;#t;#r;#s;#n;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new T2r,this.#t=e.mutationCache||new _2r,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=tme.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=I4.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(tx(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=i2r(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(uc).catch(uc)}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(uc)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(uc)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(tx(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(uc).catch(uc)}fetchInfiniteQuery(e){return e.behavior=R4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(uc).catch(uc)}ensureInfiniteQueryData(e){return e.behavior=R4(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return I4.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($S(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{pI(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set($S(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{pI(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=Xpe(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===Jpe&&(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()}},aut=b.createContext(void 0),wa=e=>{const t=b.useContext(aut);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},A2r=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(aut.Provider,{value:e,children:t})),iut=b.createContext(!1),out=()=>b.useContext(iut);iut.Provider;function I2r(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var R2r=b.createContext(I2r()),lut=()=>b.useContext(R2r),cut=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?eme(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},uut=e=>{b.useEffect(()=>{e.clearReset()},[e])},dut=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||eme(r,[e.error,n])),fut=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))}},P2r=(e,t)=>e.isLoading&&e.isFetching&&!t,pie=(e,t)=>e?.suspense&&t.isPending,mie=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function M2r({queries:e,...t},r){const n=wa(),s=out(),a=lut(),i=b.useMemo(()=>e.map(g=>{const y=n.defaultQueryOptions(g);return y._optimisticResults=s?"isRestoring":"optimistic",y}),[e,n,s]);i.forEach(g=>{fut(g);const y=n.getQueryCache().get(g.queryHash);cut(g,a,y)}),uut(a);const[l]=b.useState(()=>new j2r(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)):uc,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=c.some((g,y)=>pie(i[y],g))?c.flatMap((g,y)=>{const x=i[y];if(x&&pie(x,g)){const w=new R9(n,x);return mie(x,w,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=c.find((g,y)=>{const x=i[y];return x&&dut({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 hut(e,t,r){const n=out(),s=lut(),a=wa(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",fut(i),cut(i,s,l),uut(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)):uc;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),pie(i,d))throw mie(i,u,s);if(dut({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&&!LS&&P2r(d,n)&&(c?mie(i,u,s):l?.promise)?.catch(uc).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function kt(e,t){return hut(e,R9)}function Kr(e,t){const r=wa(),[n]=b.useState(()=>new E2r(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(uc)},[n]);if(s.error&&eme(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function u0(e,t){return hut(e,O2r)}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||{});t1().describe("Database record creation time");var D2r=t1().describe("Database record last update time");D2r.nullable();var P9=_e({page:iSe().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:iSe().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),M9=_e({total:St().describe("Total number of items available"),page:St().describe("Current page"),perPage:Hr([St(),zt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:yo().describe("True if more pages are available")}),L2r=_e({start:oSe().optional().describe("Start of date range (inclusive by default)"),end:oSe().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"),D9=So(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),Eg=So(["sum","avg","min","max","count","last"]).describe("Aggregation function"),S1=So(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),nme=So(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),O1=Et(he()).min(1).describe("Fields to group by"),sme=Et(St().min(0).max(1)).min(1).describe("Percentile values (0-1)"),ame={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")},ime=Ws(he(),he().nullable()).describe("Dimension values for this group"),fC=St().describe("Aggregated value"),hC=t1().describe("Bucket timestamp"),ome=St().describe("Percentile value"),lme=St().describe("Percentile value at this bucket"),pC=nce(Do).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),$2r=he().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),put=he().describe("Name of the entity"),mut=he().describe("Human end-user who triggered execution"),gut=he().describe("Multi-tenant organization/account"),yut=he().describe("Broader resource context (Mastra memory compatibility)"),vut=he().describe("Unique execution run identifier"),but=he().describe("Session identifier for grouping traces"),xut=he().describe("Conversation thread identifier"),wut=he().describe("HTTP request ID for log correlation"),Sut=he().describe('Environment (e.g., "production" | "staging" | "development")'),F2r=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),Out=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),kut=he().describe("Name of the service"),_ut=nce(Do).describe("Entity type of the parent entity"),z2r=he().describe("ID of the parent entity"),Eut=he().describe("Name of the parent entity"),Cut=nce(Do).describe("Entity type of the root entity"),B2r=he().describe("ID of the root entity"),jut=he().describe("Name of the root entity"),Tut=he().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),Nut=he().describe("Version ID of the parent entity that produced this signal"),Aut=he().describe("Version ID of the root entity that produced this signal"),L9=he().describe("Experiment or eval run identifier"),U2r=Ws(he(),Ia()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),Iut=Ws(he(),Ia()).describe("User-defined metadata for custom filtering"),Rut=Et(he()).describe("Labels for filtering"),V2r={entityType:pC.nullish(),entityId:$2r.nullish(),entityName:put.nullish(),parentEntityType:_ut.nullish(),parentEntityId:z2r.nullish(),parentEntityName:Eut.nullish(),rootEntityType:Cut.nullish(),rootEntityId:B2r.nullish(),rootEntityName:jut.nullish(),userId:mut.nullish(),organizationId:gut.nullish(),resourceId:yut.nullish(),runId:vut.nullish(),sessionId:but.nullish(),threadId:xut.nullish(),requestId:wut.nullish(),environment:Sut.nullish(),serviceName:kut.nullish(),scope:U2r.nullish(),entityVersionId:Tut.nullish(),parentEntityVersionId:Nut.nullish(),rootEntityVersionId:Aut.nullish(),experimentId:L9.nullish()},$9={...V2r,executionSource:Out.nullish(),tags:Rut.nullish()};F2r.nullish();var F9={timestamp:L2r.optional().describe("Filter by timestamp range"),traceId:he().optional().describe("Filter by trace ID"),spanId:he().optional().describe("Filter by span ID"),entityType:pC.optional(),entityName:put.optional(),entityVersionId:Tut.optional(),parentEntityVersionId:Nut.optional(),rootEntityVersionId:Aut.optional(),userId:mut.optional(),organizationId:gut.optional(),experimentId:L9.optional(),serviceName:kut.optional(),environment:Sut.optional(),parentEntityType:_ut.optional(),parentEntityName:Eut.optional(),rootEntityType:Cut.optional(),rootEntityName:jut.optional(),resourceId:yut.optional(),runId:vut.optional(),sessionId:but.optional(),threadId:xut.optional(),requestId:wut.optional(),executionSource:Out.optional(),tags:Et(he()).optional().describe("Filter by tags (must have all specified tags)")},z9=he().describe("Unique trace identifier"),B9=he().describe("Unique span identifier within a trace"),P4=So(["debug","info","warn","error","fatal"]),Put=he().describe("Log message"),Mut=Ws(he(),Ia()).describe("Structured data attached to the log"),Dut=_e({logId:he().nullish().describe("Unique id for this log event"),timestamp:t1().describe("When the log was created"),level:P4.describe("Log severity level"),message:Put,data:Mut.nullish(),traceId:z9.nullish(),spanId:B9.nullish(),...$9,source:he().nullish().describe("Execution source"),metadata:Iut.nullish()}).describe("Log record as stored in the database");_e({level:P4,message:Put,data:Mut.optional(),tags:Rut.optional()}).describe("User-provided log input");var q2r=Dut;_e({logs:Et(q2r)}).describe("Arguments for batch creating logs");var H2r=_e({...F9,source:he().optional().describe("Filter by execution source"),level:Hr([P4,Et(P4)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),Q2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),W2r=_e({field:Q2r.default("timestamp").describe("Field to order by"),direction:D9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:H2r.optional().describe("Optional filters to apply"),pagination:P9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:W2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");_e({pagination:M9,logs:Et(Dut)});var mC=he().describe("Identifier of the scorer (e.g., relevance, accuracy)"),Lut=he().describe("Display name of the scorer"),$ut=he().describe("Version of the scorer"),lg=he().describe("How the score was produced (e.g., manual, automated, experiment)"),Fut=St().describe("Score value (range defined by scorer)"),zut=he().describe("Explanation for the score"),But=_e({scoreId:he().nullish().describe("Unique id for this score event"),timestamp:t1().describe("When the score was recorded"),traceId:z9.nullish().describe("Trace that anchors the scored target when available"),spanId:B9.nullish().describe("Span ID this score applies to"),scorerId:mC,scorerName:Lut.nullish(),scorerVersion:$ut.nullish(),scoreSource:lg.nullish(),source:lg.nullish(),score:Fut,reason:zut.nullish(),...$9,scoreTraceId:he().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:Ws(he(),Ia()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");_e({scorerId:mC,scorerName:Lut.optional(),scorerVersion:$ut.optional(),scoreSource:lg.optional(),source:lg.optional(),score:Fut,reason:zut.optional(),metadata:Ws(he(),Ia()).optional().describe("Additional scorer-specific metadata"),experimentId:L9.optional(),scoreTraceId:he().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:pC.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var cme=But;_e({score:cme}).describe("Arguments for creating a score");_e({score:cme.omit({timestamp:!0})}).describe("Arguments for creating a score");_e({success:yo()}).describe("Response from creating a score");_e({scores:Et(cme)}).describe("Arguments for batch recording scores");var DP=_e({...F9,scorerId:Hr([he(),Et(he())]).optional().describe("Filter by scorer ID(s)"),scoreSource:lg.optional().describe("Filter by how the score was produced"),source:lg.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),G2r=So(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),Z2r=_e({field:G2r.default("timestamp").describe("Field to order by"),direction:D9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:DP.optional(),pagination:P9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Z2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");_e({pagination:M9,scores:Et(But)});_e({scorerId:mC,scoreSource:lg.optional(),aggregation:Eg,filters:DP.optional(),comparePeriod:nme.optional()}).describe("Arguments for getting a score aggregate");_e(ame);_e({scorerId:mC,scoreSource:lg.optional(),groupBy:O1,aggregation:Eg,filters:DP.optional()}).describe("Arguments for getting a score breakdown");_e({groups:Et(_e({dimensions:ime,value:fC}))});_e({scorerId:mC,scoreSource:lg.optional(),interval:S1,aggregation:Eg,filters:DP.optional(),groupBy:O1.optional()}).describe("Arguments for getting score time series");_e({series:Et(_e({name:he().describe("Series name (scorer ID or group key)"),points:Et(_e({timestamp:hC,value:fC}))}))});_e({scorerId:mC,scoreSource:lg.optional(),percentiles:sme,interval:S1,filters:DP.optional()}).describe("Arguments for getting score percentiles");_e({series:Et(_e({percentile:ome,points:Et(_e({timestamp:hC,value:lme}))}))});var cg=he().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),gC=he().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),Uut=Hr([St(),he()]).describe("Feedback value (rating number or correction text)"),Vut=he().describe("Additional comment or context"),M4=he().describe("User who provided the feedback");function ume(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 U9=_e({feedbackId:he().nullish().describe("Unique id for this feedback event"),timestamp:t1().describe("When the feedback was recorded"),traceId:z9.nullish().describe("Trace that anchors the feedback target when available"),spanId:B9.nullish().describe("Span ID this feedback applies to"),feedbackSource:cg.nullish(),source:cg.nullish(),feedbackType:gC,value:Uut,comment:Vut.nullish(),feedbackUserId:M4.nullish(),...$9,sourceId:he().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:Ws(he(),Ia()).nullish().describe("User-defined metadata")}),Y2r=_e(U9.shape).describe("Feedback record as stored in the database"),X2r=_e({feedbackSource:cg.optional(),source:cg.optional(),feedbackType:gC,value:Uut,comment:Vut.optional(),feedbackUserId:M4.optional(),userId:M4.optional(),metadata:Ws(he(),Ia()).optional().describe("Additional feedback-specific metadata"),experimentId:L9.optional(),sourceId:he().optional().describe("ID of the source record this feedback is linked to")});_e(X2r.shape).describe("User-provided feedback input");_e({feedback:oce(ume,U9)}).describe("Arguments for creating feedback");_e({feedback:U9.omit({timestamp:!0})}).describe("Arguments for creating feedback");_e({success:yo()}).describe("Response from creating feedback");_e({feedbacks:Et(oce(ume,U9))}).describe("Arguments for batch recording feedback");var qut=_e({...F9,feedbackType:Hr([he(),Et(he())]).optional().describe("Filter by feedback type(s)"),feedbackSource:cg.optional(),source:cg.optional(),feedbackUserId:M4.optional()}),V9=_e(qut.shape).describe("Filters for querying feedback"),K2r=So(["timestamp"]).describe("Field to order by: 'timestamp'"),J2r=_e({field:K2r.default("timestamp").describe("Field to order by"),direction:D9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:oce(ume,qut).optional().describe("Optional filters to apply"),pagination:P9.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:J2r.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");_e({pagination:M9,feedback:Et(Y2r)});_e({feedbackType:gC,feedbackSource:cg.optional(),aggregation:Eg,filters:V9.optional(),comparePeriod:nme.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");_e(ame);_e({feedbackType:gC,feedbackSource:cg.optional(),groupBy:O1,aggregation:Eg,filters:V9.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");_e({groups:Et(_e({dimensions:ime,value:fC}))});_e({feedbackType:gC,feedbackSource:cg.optional(),interval:S1,aggregation:Eg,filters:V9.optional(),groupBy:O1.optional()}).describe("Arguments for getting feedback time series over numeric values");_e({series:Et(_e({name:he().describe("Series name (feedback type or group key)"),points:Et(_e({timestamp:hC,value:fC}))}))});_e({feedbackType:gC,feedbackSource:cg.optional(),percentiles:sme,interval:S1,filters:V9.optional()}).describe("Arguments for getting feedback percentiles over numeric values");_e({series:Et(_e({percentile:ome,points:Et(_e({timestamp:hC,value:lme}))}))});So(["counter","gauge","histogram"]);var Hut=he().describe("Metric name (e.g., mastra_agent_duration_ms)"),Qut=St().describe("Metric value"),Wut=Ws(he(),he()).describe("Metric labels for dimensional filtering"),Gut=he().describe("Model provider"),Zut=he().describe("Model"),eDr=St().describe("Estimated cost"),Yut=he().describe("Unit for the estimated cost (e.g., usd)"),tDr=Ws(he(),Ia()).nullish().describe("Structured costing metadata"),Xut=_e({metricId:he().nullish().describe("Unique id for this metric event"),timestamp:t1().describe("When the metric was recorded"),name:Hut,value:Qut,traceId:z9.nullish(),spanId:B9.nullish(),...$9,source:he().nullish().describe("Execution source"),provider:Gut.nullish(),model:Zut.nullish(),estimatedCost:eDr.nullish(),costUnit:Yut.nullish(),costMetadata:tDr.nullish(),labels:Wut.default({}),metadata:Iut.nullish()}).describe("Metric record as stored in the database");_e({name:Hut,value:Qut,labels:Wut.optional()}).describe("User-provided metric input");var rDr=Xut;_e({metrics:Et(rDr)}).describe("Arguments for batch recording metrics");_e({type:Eg,interval:S1.optional(),groupBy:O1.optional()}).describe("Metrics aggregation configuration");var LP=_e({...F9,name:Et(he()).nonempty().optional().describe("Filter by metric name(s)"),source:he().optional().describe("Filter by execution source"),provider:Gut.optional(),model:Zut.optional(),costUnit:Yut.optional(),labels:Ws(he(),he()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),nDr=So(["timestamp"]).describe("Field to order by: 'timestamp'"),sDr=_e({field:nDr.default("timestamp").describe("Field to order by"),direction:D9.default("DESC").describe("Sort direction")}).describe("Order by configuration");_e({filters:LP.optional(),pagination:P9.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 metrics");_e({pagination:M9,metrics:Et(Xut)});_e({name:Et(he()).nonempty().describe("Metric name(s) to aggregate"),aggregation:Eg,filters:LP.optional(),comparePeriod:nme.optional()}).describe("Arguments for getting a metric aggregate");_e({...ame,estimatedCost:St().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:he().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(he()).nonempty().describe("Metric name(s) to break down"),groupBy:O1,aggregation:Eg,filters:LP.optional()}).describe("Arguments for getting a metric breakdown");_e({groups:Et(_e({dimensions:ime,value:fC,estimatedCost:St().nullable().optional().describe("Summed estimated cost for this group"),costUnit:he().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});_e({name:Et(he()).nonempty().describe("Metric name(s)"),interval:S1,aggregation:Eg,filters:LP.optional(),groupBy:O1.optional()}).describe("Arguments for getting metric time series");_e({series:Et(_e({name:he().describe("Series name (metric name or group key)"),costUnit:he().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Et(_e({timestamp:hC,value:fC,estimatedCost:St().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});_e({name:he().describe("Metric name"),percentiles:sme,interval:S1,filters:LP.optional()}).describe("Arguments for getting metric percentiles");_e({series:Et(_e({percentile:ome,points:Et(_e({timestamp:hC,value:lme}))}))});_e({prefix:he().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(he()).describe("Distinct metric names")});_e({metricName:he().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");_e({keys:Et(he()).describe("Distinct label keys for the metric")});_e({metricName:he().describe("Metric name"),labelKey:he().describe("Label key to get values for"),prefix:he().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(he()).describe("Distinct label values")});_e({}).describe("Arguments for getting entity types");_e({entityTypes:Et(pC).describe("Distinct entity types")});_e({entityType:pC.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");_e({names:Et(he()).describe("Distinct entity names")});_e({}).describe("Arguments for getting service names");_e({serviceNames:Et(he()).describe("Distinct service names")});_e({}).describe("Arguments for getting environments");_e({environments:Et(he()).describe("Distinct environments")});_e({entityType:pC.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");_e({tags:Et(he()).describe("Distinct tags")});const Ql={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},$P="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",aDr="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",iDr="rounded-md",dme="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",fme="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",hme="disabled:opacity-50 disabled:cursor-not-allowed";function Kut(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=Kut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Jut(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Kut(e))&&(n&&(n+=" "),n+=t);return n}const oDr=(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},lDr=(e,t)=>({classGroupId:e,validator:t}),edt=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),D4="-",XIe=[],cDr="arbitrary..",uDr=e=>{const t=fDr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return dDr(i);const l=i.split(D4),c=l[0]===""&&l.length>1?1:0;return tdt(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?oDr(u,c):c:u||XIe}return r[i]||XIe}}},tdt=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=tdt(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(D4):e.slice(t).join(D4),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},dDr=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?cDr+n:void 0})(),fDr=e=>{const{theme:t,classGroups:r}=e;return hDr(r,t)},hDr=(e,t)=>{const r=edt();for(const n in e){const s=e[n];pme(s,r,n,t)}return r},pme=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];pDr(i,t,r,n)}},pDr=(e,t,r,n)=>{if(typeof e=="string"){mDr(e,t,r);return}if(typeof e=="function"){gDr(e,t,r,n);return}yDr(e,t,r,n)},mDr=(e,t,r)=>{const n=e===""?t:rdt(t,e);n.classGroupId=r},gDr=(e,t,r,n)=>{if(vDr(e)){pme(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(lDr(r,e))},yDr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];pme(c,rdt(t,l),r,n)}},rdt=(e,t)=>{let r=e;const n=t.split(D4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=edt(),r.nextPart.set(i,l)),r=l}return r},vDr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,bDr=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)}}},gie="!",KIe=":",xDr=[],JIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),wDr=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===KIe){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(gie)?(h=f.slice(0,-1),p=!0):f.startsWith(gie)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return JIe(a,p,h,m)};if(t){const s=t+KIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):JIe(xDr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},SDr=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}},ODr=e=>({cache:bDr(e.cacheSize),parseClassName:wDr(e),sortModifiers:SDr(e),...uDr(e)}),kDr=/\s+/,_Dr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(kDr);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+gie: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},EDr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=ndt(r))&&(s&&(s+=" "),s+=n);return s},ndt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=ndt(e[n]))&&(r&&(r+=" "),r+=t);return r},eRe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=ODr(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=_Dr(c,r);return s(c,d),d};return a=i,(...c)=>a(EDr(...c))},CDr=[],Go=e=>{const t=r=>r[e]||CDr;return t.isThemeGetter=!0,t},sdt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,adt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jDr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TDr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NDr=/\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$/,ADr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IDr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RDr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lb=e=>jDr.test(e),qn=e=>!!e&&!Number.isNaN(Number(e)),cb=e=>!!e&&Number.isInteger(Number(e)),lQ=e=>e.endsWith("%")&&qn(e.slice(0,-1)),sy=e=>TDr.test(e),idt=()=>!0,PDr=e=>NDr.test(e)&&!ADr.test(e),mme=()=>!1,MDr=e=>IDr.test(e),DDr=e=>RDr.test(e),LDr=e=>!vr(e)&&!kr(e),$Dr=e=>d0(e,cdt,mme),vr=e=>sdt.test(e),W0=e=>d0(e,udt,PDr),tRe=e=>d0(e,QDr,qn),FDr=e=>d0(e,fdt,idt),zDr=e=>d0(e,ddt,mme),rRe=e=>d0(e,odt,mme),BDr=e=>d0(e,ldt,DDr),rL=e=>d0(e,hdt,MDr),kr=e=>adt.test(e),cT=e=>k1(e,udt),UDr=e=>k1(e,ddt),nRe=e=>k1(e,odt),VDr=e=>k1(e,cdt),qDr=e=>k1(e,ldt),nL=e=>k1(e,hdt,!0),HDr=e=>k1(e,fdt,!0),d0=(e,t,r)=>{const n=sdt.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},k1=(e,t,r=!1)=>{const n=adt.exec(e);return n?n[1]?t(n[1]):r:!1},odt=e=>e==="position"||e==="percentage",ldt=e=>e==="image"||e==="url",cdt=e=>e==="length"||e==="size"||e==="bg-size",udt=e=>e==="length",QDr=e=>e==="number",ddt=e=>e==="family-name",fdt=e=>e==="number"||e==="weight",hdt=e=>e==="shadow",sRe=()=>{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=()=>[lb,"full","auto",...j()],I=()=>[cb,"none","subgrid",kr,vr],P=()=>["auto",{span:["full",cb,kr,vr]},cb,kr,vr],R=()=>[cb,"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=()=>[lb,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[lb,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Q=()=>[lb,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,vr],Z=()=>[...k(),nRe,rRe,{position:[kr,vr]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",VDr,$Dr,{size:[kr,vr]}],W=()=>[lQ,cT,W0],G=()=>["","none","full",u,kr,vr],J=()=>["",qn,cT,W0],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,lQ,nRe,rRe],ie=()=>["","none",m,kr,vr],fe=()=>["none",qn,kr,vr],X=()=>["none",qn,kr,vr],se=()=>[qn,kr,vr],le=()=>[lb,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sy],breakpoint:[sy],color:[idt],container:[sy],"drop-shadow":[sy],ease:["in","out","in-out"],font:[LDr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sy],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sy],shadow:[sy],spacing:["px",qn],text:[sy],"text-shadow":[sy],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",lb,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:[cb,"auto",kr,vr]}],basis:[{basis:[lb,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qn,lb,"auto","initial","none",vr]}],grow:[{grow:["",qn,kr,vr]}],shrink:[{shrink:["",qn,kr,vr]}],order:[{order:[cb,"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,cT,W0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,HDr,FDr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lQ,vr]}],"font-family":[{font:[UDr,zDr,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,tRe]}],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,W0]}],"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"]},cb,kr,vr],radial:["",kr,vr],conic:[cb,kr,vr]},qDr,BDr]}],"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,cT,W0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,nL,rL]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,nL,rL]}],"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,W0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,nL,rL]}],"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,nL,rL]}],"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:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],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,cT,W0,tRe]}],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"]}},WDr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(ZT(e,"cacheSize",t),ZT(e,"prefix",r),ZT(e,"experimentalParseClassName",n),sL(e.theme,a.theme),sL(e.classGroups,a.classGroups),sL(e.conflictingClassGroups,a.conflictingClassGroups),sL(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),ZT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),aL(e.theme,s.theme),aL(e.classGroups,s.classGroups),aL(e.conflictingClassGroups,s.conflictingClassGroups),aL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),pdt(e,s,"orderSensitiveModifiers"),e),ZT=(e,t,r)=>{r!==void 0&&(e[t]=r)},sL=(e,t)=>{if(t)for(const r in t)ZT(e,r,t[r])},aL=(e,t)=>{if(t)for(const r in t)pdt(e,t,r)},pdt=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},GDr=(e,...t)=>typeof e=="function"?eRe(sRe,e,...t):eRe(()=>WDr(sRe(),e),...t),ZDr=Object.keys({...$b,...H9t}),YDr=Object.keys(X9t),XDr=Object.keys(Q9t),KDr=Object.keys(W9t),JDr=Object.keys(q9t),G0=Object.keys(Y9t),eLr=Object.keys(G9t).concat(Object.keys(Z9t)),tLr=GDr({extend:{theme:{color:ZDr,spacing:YDr,radius:JDr,leading:KDr,shadow:eLr},classGroups:{"font-size":[{text:XDr}],h:[{h:G0}],w:[{w:G0}],size:[{size:G0}],"min-h":[{"min-h":G0}],"min-w":[{"min-w":G0}],"max-h":[{"max-h":G0}],"max-w":[{"max-w":G0}]}}});function Y(...e){return tLr(Jut(e))}const rLr={sm:`${Ql.sm} text-ui-sm px-[.75em]`,md:`${Ql.md} text-ui-md px-[.75em]`,default:`${Ql.default} text-ui-md px-[.85em] `,lg:`${Ql.lg} text-ui-lg px-[1em] `},nLr={default:"bg-surface3 border-2 border-border1 hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral5",primary:"bg-surface4 border-2 border-border2 hover:text-neutral6 hover:bg-surface5 active:bg-surface6 text-neutral6",cta:"bg-accent1/50 hover:bg-accent1/80 text-neutral5 font-semibold",ghost:"bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",inputLike:dme,light:"",outline:"",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"},sLr=Y("flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100",hme,fme),aLr={light:"default",outline:"default"};function iLr(e){return aLr[e]??e}function yC(e){const t=iLr(e?.variant||"default"),r=e?.size||"default";return Y(sLr,rLr[r],nLr[t],e?.iconOnly&&"[&>svg]:opacity-75")}function mdt(e){const t=[];return je.Children.forEach(e,r=>{je.isValidElement(r)&&r.type===je.Fragment?t.push(...mdt(r.props.children)):t.push(r)}),t}function oLr(e){const t=mdt(e);return t.length>0&&t.every(r=>je.isValidElement(r))}const me=je.forwardRef(({className:e,as:t,size:r="default",variant:n="default",disabled:s,children:a,...i},l)=>{const c=t||"button",u=oLr(a);return o.jsx(c,{ref:l,disabled:s,className:Y(yC({variant:n,size:r,iconOnly:u}),e),...i,children:a})});me.displayName="Button";const cd=p5t,Yr=m5t,Xr=g5t,Wr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(y5t,{children:o.jsxs(Dqe,{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(v5t,{className:"fill-surface3"})]})}));Wr.displayName=Dqe.displayName;const Cn=je.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{ref:r,...t})}),e&&o.jsx(Wr,{children:e})]}));Cn.displayName="ButtonWithTooltip";const lLr={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",lLr[r],t),...n,children:e}),an={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"},f0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},gdt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),L4=({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",an.colors,n),children:e}),ydt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),$4=({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",an.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),vdt=({onClick:e})=>o.jsx(me,{variant:"ghost",className:Y("shrink-0 opacity-0",an.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(Xl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),cLr={"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"},uLr={mono:"font-mono"},pe=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Y(cLr[r],n&&uLr[n],t),...s}),ga=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"})]}),dLr=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"})]}),gme=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"})]}),yme=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"})]}),h0=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"})}),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.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)"})})})]}),xdt=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)"})})})]}),fLr=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"})]}),q9=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"})}),vme=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"})}),hLr=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"})}),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"})}),vC=e=>o.jsx(U9t,{...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"})}),bl=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"})]}),H9=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 hp(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 wdt=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)"})})})]}),pLr=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"})}),mLr=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"})})}),Sdt=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}})}),gLr=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"})]})]}),yLr=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"})})]}),vLr=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"})}),bLr=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"})]}),xLr=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"})})})]}),aRe=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"})}),wLr=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"})]})}),SLr={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},OLr={warning:zE,destructive:PF,info:UR},pl=({children:e,variant:t="destructive",className:r})=>{const n=OLr[t];return o.jsx("div",{className:Y(SLr[t],"p-3 rounded-md border shadow-sm",an.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",r),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(Ce,{className:"mt-0.5 shrink-0",children:o.jsx(n,{})}),o.jsx("div",{className:"text-neutral4",children:e})]})})},ml=({children:e,as:t="h5"})=>o.jsx(pe,{as:t,variant:"ui-md",className:"font-semibold",children:e}),Xc=({children:e,as:t="p"})=>o.jsx(pe,{as:t,variant:"ui-sm",children:e}),kLr={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},Odt=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Y(kLr[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",an.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(pe,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),_Lr={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"},ELr={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",an.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":_Lr[t],r),...s,children:[e&&o.jsx("span",{className:ELr[t],children:o.jsx(Ce,{children:e})}),n]}),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",an.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",an.colors),children:o.jsx(hLr,{})})})]})};function CLr(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 jLr(e){const t=CLr(e);return tGe({override:[TLr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function TLr(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 NLr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,ALr=er.mark({class:"cm-variable-highlight"}),iRe=new mWe({regexp:NLr,decoration:()=>ALr}),ILr=Oi.fromClass(class{decorations;constructor(e){this.decorations=iRe.createDeco(e)}update(e){this.decorations=iRe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),RLr=ILr,PLr={duration:5e3,cancel:{label:o.jsx(Ce,{children:o.jsx(Xl,{})}),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 nf(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=>vc(r,nf(t)));if(je.isValidElement(e))return vc(e,nf(t));if(typeof e=="string")return vc(e,nf(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(Izt,{})}),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 vc.success(e,nf(r));case"object":return e.forEach(n=>vc.success(n,nf(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent2 shrink-0",children:o.jsx(PHe,{})}),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 vc.error(e,nf(r));case"object":return e.forEach(n=>vc.error(n,nf(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent6 shrink-0",children:o.jsx(PF,{})}),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 vc.warning(e,nf(r));case"object":return e.forEach(n=>vc.warning(n,nf(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(Ce,{className:"text-accent3 shrink-0",children:o.jsx(UR,{})}),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 vc.info(e,nf(r));case"object":return e.forEach(n=>vc.info(n,nf(r)))}};ze.custom=(e,t={})=>vc(e,nf(t));ze.dismiss=e=>{e&&vc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>vc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...nf(i)});function hf({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 ta({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=hf({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(hv,{}):o.jsx(DHe,{})})}),o.jsx(Wr,{children:a?"Copied!":r})]})}const MLr="mastra-theme",DLr="mastra-playground-store",yie=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 yie(n)?n:void 0}catch{return}},$Lr=(e=MLr)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(yie(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}yie(n.newValue)&&t(n.newValue)}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}),kdt=b.createContext(null),_dt="(prefers-color-scheme: dark)",FLr=typeof window>"u"?b.useEffect:b.useLayoutEffect,Edt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(_dt).matches?"dark":"light",Cdt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(_dt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},zLr=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},jdt=({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(Cdt,Edt,()=>"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(kdt.Provider,{value:d,children:e})},BLr=()=>{},bC=()=>{const e=b.useContext(kdt),t=b.useSyncExternalStore(Cdt,Edt,()=>"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=Fp.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,Jx(t)]}const _v=()=>{const e=bC().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=_v(),g=e?JSON.stringify(e,null,2):t??"",y=b.useMemo(()=>{const x=[];return a==="json"?x.push(Kd):a==="markdown"&&(x.push(Yue({base:mS,codeLanguages:OZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(RLr),c&&a==="markdown"&&x.push(jLr(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(ta,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(wc,{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-Czr-BRha.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 _f=({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}),Tdt=({children:e,className:t,style:r})=>o.jsx(Ce,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),Ef=({children:e,className:t})=>o.jsx(pe,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),Cf=({children:e,className:t})=>o.jsx(pe,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),jf=({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(j9t,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function sa({title:e,description:t,className:r}){const[n,s]=b.useState(!1),a=Ge(),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(w9t,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(me,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const En=({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}),Yu=({children:e})=>o.jsx(pe,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),gu=({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}),rx=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})}),oRe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lRe=Jut,xC=(e,t)=>r=>{var n;if(t?.variants==null)return lRe(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=oRe(d)||oRe(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 lRe(e,i,c,r?.class,r?.className)},JLr=xC(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(dme,fme,hme),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"}}),bc=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}));bc.displayName="Textarea";const e$r=NXt,t$r=AXt,Ndt=IXt;function Bt({open:e,onOpenChange:t,children:r}){return o.jsx(e$r,{open:e,onOpenChange:t,children:r})}const bme=b.forwardRef(({className:e,...t},r)=>o.jsx(nXe,{className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-150",e),...t,ref:r}));bme.displayName=nXe.displayName;const Adt=b.forwardRef(({className:e,...t},r)=>o.jsxs(Ndt,{children:[o.jsx(bme,{}),o.jsx(sXe,{ref:r,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border1 bg-surface3 p-6 shadow-dialog rounded-md","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=closed]:duration-150",e),...t})]}));Adt.displayName=sXe.displayName;const Idt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col space-y-2 text-center sm:text-left",e),...t});Idt.displayName="AlertDialogHeader";const Rdt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rdt.displayName="AlertDialogFooter";const Pdt=b.forwardRef(({className:e,...t},r)=>o.jsx(oXe,{ref:r,className:Y("text-lg font-semibold",e),...t}));Pdt.displayName=oXe.displayName;const Mdt=b.forwardRef(({className:e,...t},r)=>o.jsx(lXe,{ref:r,className:Y("text-sm text-neutral3",e),...t}));Mdt.displayName=lXe.displayName;const Ddt=b.forwardRef(({className:e,...t},r)=>o.jsx(aXe,{ref:r,className:Y(yC({variant:"primary",size:"default"}),e),...t}));Ddt.displayName=aXe.displayName;const Ldt=b.forwardRef(({className:e,...t},r)=>o.jsx(iXe,{ref:r,className:Y(yC({variant:"default",size:"default"}),"mt-2 sm:mt-0",e),...t}));Ldt.displayName=iXe.displayName;Bt.Trigger=t$r;Bt.Portal=Ndt;Bt.Overlay=bme;Bt.Content=Adt;Bt.Header=Idt;Bt.Footer=Rdt;Bt.Title=Pdt;Bt.Description=Mdt;Bt.Action=Ddt;Bt.Cancel=Ldt;const fi=b.forwardRef(({className:e,...t},r)=>o.jsx(ude,{ref:r,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",an.all,"hover:border-neutral5 hover:shadow-md",$P,"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(fXe,{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(hv,{className:"h-3.5 w-3.5 stroke-3"})})}));fi.displayName=ude.displayName;const Ip=zXt,Nh=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(fde,{ref:n,className:Y("-outline-offset-2",an.colors,f0.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...r,children:t}));Nh.displayName=fde.displayName;const Ah=je.forwardRef(({className:e,children:t,...r},n)=>o.jsx(pde,{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}));Ah.displayName=pde.displayName;const gn={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",an.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",an.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",an.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",an.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",an.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 Kl({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="inputLike",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:gn.root,children:[o.jsxs(mKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(OKe,{className:Y(yC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(yer,{placeholder:n})]}),o.jsx(RF,{className:gn.chevron})]}),o.jsx(CKe,{container:h,children:o.jsx(NKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(AKe,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(k_,{className:gn.searchIcon}),o.jsx(SKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(DKe,{className:gn.empty,children:a}),o.jsx(_Ke,{className:gn.list,children:y=>o.jsxs(MKe,{value:y,className:Y(gn.item,gn.itemSelected),children:[o.jsx("span",{className:gn.checkContainer,children:o.jsx(str,{children:o.jsx(hv,{className:gn.checkIcon})})}),o.jsxs("span",{className:gn.optionContent,children:[y.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:y.label}),y.description&&o.jsx("span",{className:gn.optionDescription,children:y.description})]}),y.end?o.jsx("div",{className:gn.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}function $dt({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:gn.root,children:[o.jsxs(mKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(OKe,{className:Y(yC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&gn.placeholder),children:y}),o.jsx(RF,{className:gn.chevron})]}),o.jsx(CKe,{container:h,children:o.jsx(NKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(AKe,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(k_,{className:gn.searchIcon}),o.jsx(SKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(DKe,{className:gn.empty,children:a}),o.jsx(_Ke,{className:gn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(MKe,{value:x,className:gn.item,children:[o.jsx("span",{className:Y(gn.checkbox,w?gn.checkboxSelected:gn.checkboxUnselected),children:w&&o.jsx(hv,{className:gn.checkboxIcon})}),o.jsxs("span",{className:gn.optionContent,children:[x.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:gn.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:gn.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}const Sn=tz,Fdt=VYe,r$r=rz,n$r=eP,zdt=b.forwardRef(({className:e,...t},r)=>o.jsx(KR,{ref:r,className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));zdt.displayName=KR.displayName;const yn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(r$r,{children:[o.jsx(zdt,{}),o.jsxs(JR,{ref:n,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]","gap-4 border border-border1 bg-surface3 py-6 shadow-dialog rounded-lg","duration-slow","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-[state=closed]:slide-out-to-bottom-4","data-[state=open]:slide-in-from-bottom-4",e),...r,children:[t,o.jsxs(eP,{className:Y("absolute right-4 top-4 rounded-md p-1","text-neutral3 hover:text-neutral6 hover:bg-surface4","transition-all duration-normal ease-out-custom","focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","disabled:pointer-events-none"),children:[o.jsx(Xl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yn.displayName=JR.displayName;const On=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});On.displayName="DialogHeader";const pf=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pf.displayName="DialogFooter";const Bn=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-6 max-h-[50vh]",e),...t});Bn.displayName="DialogBody";const vn=b.forwardRef(({className:e,...t},r)=>o.jsx(nz,{ref:r,className:Y("text-ui-md font-medium",e),...t}));vn.displayName=nz.displayName;const qs=b.forwardRef(({className:e,...t},r)=>o.jsx(sz,{ref:r,className:Y("sr-only",e),...t}));qs.displayName=sz.displayName;const Bdt=b.forwardRef(({className:e,...t},r)=>o.jsx(id,{ref:r,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));Bdt.displayName=id.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(Sn,{...n,children:o.jsxs(yn,{className:"overflow-hidden p-0",children:[o.jsx(vn,{className:"sr-only",children:t}),o.jsx(qs,{className:"sr-only",children:r}),o.jsx(Bdt,{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})]})})},Udt=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",an.colors),"cmdk-input-wrapper":"",children:[o.jsx(k_,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",an.colors)}),o.jsx(id.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",an.colors,e),...t})]}));Udt.displayName=id.Input.displayName;const Vdt=b.forwardRef(({className:e,...t},r)=>o.jsx(id.List,{ref:r,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Vdt.displayName=id.List.displayName;const qdt=b.forwardRef((e,t)=>o.jsx(id.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));qdt.displayName=id.Empty.displayName;const yb=b.forwardRef(({className:e,...t},r)=>o.jsx(id.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}));yb.displayName=id.Group.displayName;const uw=b.forwardRef(({className:e,...t},r)=>o.jsx(id.Separator,{ref:r,className:Y("-mx-1 h-px bg-border1",e),...t}));uw.displayName=id.Separator.displayName;const Zo=b.forwardRef(({className:e,...t},r)=>o.jsx(id.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",an.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=id.Item.displayName;const Hdt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});Hdt.displayName="CommandShortcut";function Qdt({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=tnr,i$r=rnr,o$r=cP,l$r=anr,c$r=nnr,xme=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"),Wdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(FJe,{ref:n,className:Y("cursor-pointer",e),...r,children:t}));Wdt.displayName=FJe.displayName;const Gdt=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(QJe,{ref:s,className:Y(xme,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(Hce,{className:"-rotate-90 opacity-50"})})]}));Gdt.displayName=QJe.displayName;const Zdt=b.forwardRef(({className:e,...t},r)=>o.jsx(cP,{children:o.jsx(yz,{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})}));Zdt.displayName=yz.displayName;const Ydt=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(cP,{container:t,children:o.jsx(zJe,{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})}));Ydt.displayName=zJe.displayName;const Xdt=b.forwardRef(({className:e,...t},r)=>o.jsx(UJe,{ref:r,className:Y(xme,e),...t}));Xdt.displayName=UJe.displayName;const Kdt=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(VJe,{ref:s,className:Y(xme,"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(hv,{})}),t]}));Kdt.displayName=VJe.displayName;const Jdt=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(qJe,{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(snr,{children:o.jsx(MHe,{className:"h-2 w-2 fill-current"})})}),t]}));Jdt.displayName=qJe.displayName;const eft=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(BJe,{ref:n,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));eft.displayName=BJe.displayName;const tft=b.forwardRef(({className:e,...t},r)=>o.jsx(HJe,{ref:r,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));tft.displayName=HJe.displayName;const rft=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});rft.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=Wdt;yt.Content=Ydt;yt.Group=i$r;yt.Portal=o$r;yt.Item=Xdt;yt.CheckboxItem=Kdt;yt.RadioItem=Jdt;yt.Label=eft;yt.Separator=tft;yt.Shortcut=rft;yt.Sub=l$r;yt.SubContent=Zdt;yt.SubTrigger=Gdt;yt.RadioGroup=c$r;const iL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Ln({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 nft=({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(Ln,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(pe,{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(zE,{})," ",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=xC(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(dme,fme,hme),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Ql.sm} text-ui-sm px-[.75em]`,md:`${Ql.md} text-ui-md px-[.75em]`,default:`${Ql.default} text-ui-md px-[.85em]`,lg:`${Ql.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 jx({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(Ju,{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 Tx({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(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(k_,{})})}),o.jsx(Wr,{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(Ju,{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(k_,{"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(me,{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(Xl,{})})]}),t&&o.jsx(mo.HelpText,{children:t}),r&&o.jsx(mo.ErrorMsg,{children:r})]})]})}const hi=Pnr,pi=Mnr,ei=b.forwardRef(({className:e,children:t,variant:r="inputLike",size:n="default",...s},a)=>o.jsxs(vet,{ref:a,className:Y(yC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(Dnr,{asChild:!0,children:o.jsx(Hce,{className:Y("h-4 w-4 text-neutral3",an.colors)})})]}));ei.displayName=vet.displayName;const ti=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(Lnr,{children:o.jsx(bet,{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($nr,{className:Y("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ti.displayName=bet.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(xet,{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",an.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(znr,{children:o.jsx(hv,{className:"h-4 w-4 text-accent1"})})}),o.jsx(Fnr,{children:t})]}));ss.displayName=xet.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(Ju,{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(hi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(ei,{size:a,children:o.jsx(pi,{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={sm:`${Ql.sm} w-form-sm`,md:`${Ql.md} w-form-md`,lg:`${Ql.lg} w-form-lg`,default:`${Ql.default}`},b$r={sm:"sm",md:"default",lg:"lg",default:"default"},x$r={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none"},w$r="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",jn=je.forwardRef(({className:e,children:t,tooltip:r,size:n="md",variant:s="default",disabled:a,...i},l)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("button",{ref:l,disabled:a,"aria-label":typeof r=="string"?r:void 0,className:Y(w$r,$P,x$r[s],v$r[n],a&&"active:scale-100",e),...i,children:o.jsx(Ce,{size:b$r[n],children:t})})}),o.jsx(Wr,{children:r})]}));jn.displayName="IconButton";const S$r=xC("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(Oet,{ref:r,className:Y(S$r(),e),...t}));xt.displayName=Oet.displayName;function tE({children:e}){const t=e.replace(/\\n/g,`
|
|
294
294
|
`);return o.jsx(Zet,{remarkPlugins:[btt],components:k$r,className:"space-y-3",children:t})}const sft=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})});sft.displayName="HighlightedCode";const O$r=({children:e,className:t,language:r,...n})=>{const s=typeof e=="string"?e:vie(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(sft,{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(ta,{content:s,copyMessage:"Copied code to clipboard"})})]})};function vie(e){if(typeof e=="string")return e;if(e?.props?.children){let t=e.props.children;return Array.isArray(t)?t.map(r=>vie(r)).join(""):vie(t)}return""}const k$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(O$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 _$r({children:e,className:t}){return o.jsx("div",{className:Y("overflow-x-auto ",t),children:e})}function aft({children:e,className:t}){return o.jsx("p",{className:Y("text-ui-md text-neutral2 leading-tight mt-0.5",t),children:e})}function E$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 C$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",C$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 j$r({className:e}){return o.jsx("div",{className:Y("flex items-center justify-center",e),children:o.jsx(Dt,{size:"md",color:$b.neutral1})})}function T$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 cRe({children:e,className:t}){return o.jsx(Qdt,{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 N$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 ift({children:e,className:t,as:r="h2"}){return o.jsx(r,{className:Y("text-ui-md font-normal text-neutral4",t),children:e})}function A$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(ift,{as:n,children:t}),r&&o.jsx(aft,{children:r})]})}function I$r({children:e,className:t}){return o.jsx("div",{className:Y("grid grid-cols-[1fr_auto] gap-4",t),children:e})}function R$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($9t,{}):o.jsx(D9t,{})}),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 P$r({message:e="Failed to load data",className:t}){return o.jsx("span",{className:Y("text-ui-sm text-accent2",t),children:e})}function M$r({children:e,className:t}){return o.jsx("span",{className:Y("text-ui-md text-neutral3 leading-relaxed",t),children:e})}function D$r({className:e}){return o.jsx("span",{className:Y("text-sm",e),children:o.jsx(Dt,{size:"md",color:$b.neutral1})})}function L$r({message:e="No previous value to compare",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function $$r({message:e="No data yet",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function F$r({children:e,className:t}){return o.jsx(Qdt,{className:Y("flex-1 min-w-60",t),children:o.jsx("div",{className:"grid gap-1",children:e})})}function z$r({children:e,className:t}){return o.jsx("strong",{className:Y("text-header-lg text-neutral4 font-semibold",t),children:e})}const _n=Object.assign(F$r,{Label:M$r,Value:z$r,Change:R$r,NoChange:L$r,NoData:$$r,Error:P$r,Loading:D$r}),Qt=Object.assign(cRe,{Root:cRe,Kpi:_n,TopBar:I$r,TitleAndDescription:A$r,Title:ift,Description:aft,Summary:N$r,Loading:j$r,Error:E$r,Content:_$r,NoData:T$r});function bie({children:e,className:t}){return o.jsx("div",{className:Y("flex flex-wrap gap-8",t),children:e})}const Tf=Ncr,ud=Acr,yu=b.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(Icr,{children:o.jsx(Ntt,{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})}));yu.displayName=Ntt.displayName;function oft({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(Tf,{open:r,onOpenChange:n,...t,children:o.jsx("span",{onMouseEnter:a,onMouseLeave:i,onFocusCapture:a,onBlurCapture:i,style:{display:"contents"},children:e})})}function lft({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(me,{disabled:e,size:"md",onClick:()=>t(),children:[o.jsx(Xl,{}),"Clear"]}),a&&o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(me,{disabled:e,size:"md","aria-label":"More filter actions",children:o.jsx(Wzt,{})})}),o.jsxs(yt.Content,{align:"end",children:[r&&o.jsxs(yt.Item,{onSelect:()=>r(),children:[o.jsx(Xl,{}),"Remove all filters"]}),r&&(n||s)&&o.jsx(yt.Separator,{}),n&&o.jsxs(yt.Item,{onSelect:()=>n(),children:[o.jsx($He,{}),"Save filters for next time"]}),s&&o.jsxs(yt.Item,{onSelect:()=>s(),children:[o.jsx(FHe,{}),"Remove saved filters"]})]})]})]})}const wC=b.forwardRef(({className:e,...t},r)=>o.jsx(Vtt,{className:Y("grid gap-2",e),...t,ref:r}));wC.displayName=Vtt.displayName;const tu=b.forwardRef(({className:e,...t},r)=>o.jsx(qtt,{ref:r,className:Y("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",an.all,"hover:border-neutral5 hover:shadow-md",$P,"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(Ucr,{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(MHe,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));tu.displayName=qtt.displayName;function cft({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(fi,{"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(wC,{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(tu,{"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(tu,{"data-pick-multi-item":"",value:"Any",className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:"Any"})]})]})]})}function uft(e){return Array.isArray(e)?e.length===0?"Any":e.join(", "):e}const wme="inline-flex",dft=`${Ql.md} border-y-2 border-border1 px-[.75em] text-neutral3 whitespace-nowrap flex items-center`,Sme=`${dft} text-ui-md rounded-l-lg border-l-2 border-r-1`,Ome=`${dft} text-ui-md `,kme="rounded-tl-none rounded-bl-none border-l-transparent",B$r="rounded-none",U$r="rounded-none";function V$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:wme,children:[o.jsx("span",{className:Sme,children:e.label}),o.jsx("span",{className:Ome,children:"is"}),o.jsx(ar,{ref:c,size:"md",disabled:s,value:i,placeholder:e.placeholder??`Enter ${e.label}`,className:B$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(me,{type:"button",disabled:s,"aria-label":`Remove ${e.label} filter`,className:kme,size:"md",onMouseDown:u=>u.preventDefault(),onClick:n,children:o.jsx(Xl,{})})]})}function q$r({field:e,token:t,tokens:r,onChange:n,onRemove:s,disabled:a}){const[i,l]=b.useState(!1);return o.jsxs("div",{className:wme,children:[o.jsx("span",{className:Sme,children:e.label}),o.jsx("span",{className:Ome,children:"is"}),o.jsxs(Tf,{open:i,onOpenChange:l,children:[o.jsx(ud,{asChild:!0,children:o.jsx(me,{type:"button",disabled:a,size:"md",className:U$r,children:uft(t.value)})}),o.jsx(yu,{align:"start",sideOffset:8,className:"w-64 p-2","data-pick-multi-panel":!0,children:o.jsx(cft,{field:e,tokens:r,onChange:n})})]}),o.jsx(me,{type:"button",disabled:a,"aria-label":`Remove ${e.label} filter`,className:kme,size:"md",onClick:s,children:o.jsx(Xl,{})})]})}function fft({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(V$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(q$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:wme,children:[o.jsx("span",{className:Sme,children:u.label}),o.jsx("span",{className:Ome,children:"is"}),o.jsx("span",{className:"px-2.5 py-1.5 max-w-[20rem] truncate",children:uft(l.value)}),o.jsx(me,{type:"button",disabled:n,size:"md","aria-label":`Remove ${u.label} filter`,className:kme,onClick:()=>i(c),children:o.jsx(Xl,{})})]},`${l.fieldId}-${c}`):null})})}function hft({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(Tf,{open:l,onOpenChange:c,children:[o.jsx(ud,{asChild:!0,children:o.jsxs(me,{variant:"outline",size:a,disabled:s,children:[o.jsx(g9t,{}),n]})}),o.jsx(yu,{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(FE,{className:"h-4 w-4"})}),o.jsx(o9t,{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(H$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(Zce,{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($dt,{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(me,{variant:"ghost",size:"md",onClick:()=>c(!1),children:"Cancel"}),o.jsx(me,{variant:"outline",size:"md",onClick:P,children:"Add filter"})]})]})})]})}function H$r({field:e,tokens:t,onChange:r,open:n,onToggle:s,onClose:a}){const i=b.useRef(null);return o.jsxs(Tf,{open:n,onOpenChange:l=>{l?s(e.id):a()},children:[o.jsx(ud,{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(Qce,{className:"h-4 w-4 text-neutral3 shrink-0"}),o.jsx("span",{className:"truncate",children:e.label}),!n&&o.jsx(O_,{className:"h-4 w-4 ml-auto text-neutral3 shrink-0"})]})}),o.jsx(yu,{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(cft,{field:e,tokens:t,onChange:r})})]})}const pft=(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 pft(c,{enabled:s}),o.jsxs(nrt,{ref:l,className:Y("relative overflow-hidden",e),...i,children:[o.jsx(eur,{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(xie,{orientation:"vertical"}),(a==="horizontal"||a==="both")&&o.jsx(xie,{orientation:"horizontal"}),a==="both"&&o.jsx(tur,{})]})});Ms.displayName=nrt.displayName;const xie=b.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(sfe,{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(Ktt,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));xie.displayName=sfe.displayName;const uRe={sm:Ql.sm,md:Ql.md,lg:Ql.lg,default:Ql.default},Tm=({onSearch:e,label:t,placeholder:r,debounceMs:n=300,size:s="md"})=>{const a=b.useId(),i=b.useRef(null),l=p1(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",iDr,aDr,an.all,"hover:border-neutral2",uRe[s]),children:[o.jsx(k_,{className:Y("text-neutral3 h-4 w-4",an.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",uRe[s]),name:a,ref:i,onChange:c})]})]})},Q$r=({children:e})=>o.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e}),F4=b.forwardRef(({className:e,...t},r)=>o.jsxs(brt,{ref:r,className:Y("relative flex w-full touch-none select-none items-center group",e),...t,children:[o.jsx(bur,{className:Y("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",an.colors),children:o.jsx(xur,{className:Y("absolute h-full bg-accent1",an.all)})}),o.jsx(wur,{className:Y("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",$P,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));F4.displayName=brt.displayName;const Sc=b.forwardRef(({className:e,...t},r)=>o.jsx(_rt,{className:Y("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent",an.all,$P,"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(Eur,{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")})}));Sc.displayName=_rt.displayName;function W$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(pe,{as:i,className:a,...l,children:c});const f=o.jsxs(pe,{as:"span",className:"cursor-default",variant:l.variant,font:l.font,children:[u,"..."]});return o.jsxs(pe,{as:i,className:Y("group inline-flex items-center gap-1",a),...l,children:[s?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:f}),o.jsx(Wr,{children:c})]}):f,n&&o.jsx(ta,{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=mft("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 mf({children:e,className:t,isCentered:r=!1,isDivided:n=!1,hasLeftServiceColumn:s=!1,style:a}){const i=mft("MainContentContent"),l=_me({isCentered:r,isDivided:n,hasLeftServiceColumn:s,className:t});return o.jsx("div",{className:l,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const _me=({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 mft(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 G$r({children:e,className:t}){return o.jsx("div",{className:Y("grid content-start",t),children:e})}function Z$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 Y$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 X$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(Y$r,{Title:X$r,Description:Z$r,Column:G$r});function Nx({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-12",t),children:e})}const gft=({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 z4({className:e,classNames:t,showOutsideDays:r=!0,...n}){return o.jsx(lpr,{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 cQ=["12","1","2","3","4","5","6","7","8","9","10","11"],oL=["00","15","30","45","59"],lL=["AM","PM"];function wie({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(`${cQ[+h]}:${a} ${l}`.trim())},d=h=>{i(oL[+h]),t(`${n}:${oL[+h]} ${l}`.trim())},f=h=>{c(lL[+h]),t(`${n}:${a} ${lL[+h]}`.trim())};return o.jsxs("div",{className:Y("flex gap-2 items-center",r),children:[o.jsxs(hi,{name:"hour",value:cQ.indexOf(n).toString(),onValueChange:u,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:cQ.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),":",o.jsxs(hi,{name:"minute",value:oL.indexOf(a).toString(),onValueChange:d,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:oL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),o.jsxs(hi,{name:"period",value:lL.indexOf(l).toString(),onValueChange:f,children:[o.jsx(ei,{size:"sm",children:o.jsx(pi,{placeholder:"Select..."})}),o.jsx(ti,{children:lL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]})]})}const dRe=({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(Tf,{open:u,onOpenChange:d,children:[o.jsx(ud,{asChild:!0,children:a||o.jsx(J$r,{value:e,placeholder:l,className:i,"data-testid":"datepicker-button"})}),o.jsx(yu,{className:"backdrop-blur-4xl w-auto p-0! bg-surface4 max-w-[16.5rem]",align:"start","data-testid":"datepicker-calendar",children:o.jsx(K$r,{value:e,minValue:t,maxValue:r,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:n,...c})})]})};function cL({date:e,timeStr:t=""}){if(!Ty(e))return null;if(t){const r=tr(e,"yyyy-MM-dd"),n=new Date(`${r} ${t}`);if(Ty(n))return n}return e}const K$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(cL({date:e,timeStr:l})||"","PP p"):""),[p,m]=b.useState(l||""),[g,y]=b.useState(e?new Date(e):void 0),x=p1(B=>{Ty(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=>{Ty(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),_=Ty(k),E=_&&k.getTime()!==e?.getTime(),T=B=>{if(y(B),B){const D=cL({date:B,timeStr:p});S(D||"")}else S("")},j=B=>{if(y(B),B){const D=cL({date:B,timeStr:p});S(D||"")}else S("")},N=B=>{if(m(B),_){const D=cL({date:k,timeStr:B});S(D||"")}},I=()=>{s?.(!1)},P=()=>{Ty(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(jx,{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(PF,{})," ",u]}),o.jsx(z4,{mode:"single",month:g,selected:g,onMonthChange:j,onSelect:T,...c}),o.jsx(wie,{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(me,{tabIndex:0,size:"md",onClick:R,type:"button",children:"Clear"}),o.jsx(me,{tabIndex:0,type:"button",size:"md",variant:E?"primary":"default",onClick:()=>{_?P():I()},children:E?"Apply":"Cancel"})]})]})},J$r=b.forwardRef(({value:e,placeholder:t,className:r,...n},s)=>o.jsxs(me,{ref:s,className:Y("justify-start",r),variant:"inputLike",...n,children:[o.jsx(lne,{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 yft({children:e}){return o.jsx("ul",{className:"grid bg-surface3 overflow-y-auto",children:e})}function vft(e){return!e||e.length===0?"":e?.map(t=>t.size).join(" ")}function bft({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",an.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",an.colors,f0.visible,{"hover:bg-surface4":e&&!t}),style:{gridTemplateColumns:vft(s)},disabled:!e,children:n})})}function e3r({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 t3r({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(Ju,{children:["Status: ",e||"not provided"]})]})}function xft({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:vft(e)},children:e?.map(t=>o.jsx("span",{children:t.label||t.name},t.name))})})}function r3r({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(zE,{}):o.jsx(UR,{})," ",t]}):e})}function n3r({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 s3r({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(FE,{}),"Previous"]}),t&&o.jsxs("button",{onClick:r,children:["Next",o.jsx(Wm,{})]})]})]})}function a3r({children:e}){return o.jsx("div",{className:"grid",children:e})}function wft({children:e}){return o.jsx("div",{className:Y("rounded-lg border border-border1 overflow-clip"),children:e})}const ha=Object.assign(a3r,{Header:xft,Trim:wft,Entries:yft,Entry:bft,Message:r3r,NextPageLoading:n3r,Pagination:s3r,EntryText:e3r,EntryStatus:t3r}),fRe=["75%","50%","65%","90%","60%","80%"];function i3r({columns:e,numberOfRows:t=3}){const r=(n,s)=>{const a=(n+s+(e?.length||0)+(t||0))%fRe.length;return fRe[a]};return o.jsx(yft,{children:Array.from({length:t}).map((n,s)=>o.jsx(bft,{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 Sft({columns:e,numberOfRows:t}){return o.jsx(ha,{children:o.jsxs(wft,{children:[o.jsx(xft,{columns:e}),o.jsx(i3r,{columns:e,numberOfRows:t})]})})}function Oft({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 kft({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 _ft({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(Ju,{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(hi,{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(pi,{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 Eft=b.createContext(null);function o3r({children:e,value:t}){return o.jsx(Eft.Provider,{value:t,children:e})}function Q9(){const e=b.useContext(Eft);if(!e)throw new Error("useJSONSchemaForm must be used within a JSONSchemaForm.Root");return e}let l3r=0;function W9(e={}){return{id:`field-${Date.now()}-${l3r++}`,name:"",type:"string",nullable:!1,optional:!1,...e}}function c3r(e){return e==="text"?"string":e}function Cft(e){const t=c3r(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}=jft(e.properties);n.properties=s,a.length>0&&(n.required=a)}return e.type==="array"&&e.items&&(n.items=Cft(e.items)),n}function jft(e){const t={},r=[];for(const n of e)n.name.trim()&&(t[n.name]=Cft(n),n.optional||r.push(n.name));return{properties:t,required:r}}function u3r(e){const{properties:t,required:r}=jft(e),n={type:"object",properties:t};return r.length>0&&(n.required=r),n}function Tft(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 Nft(e){return["string","number","boolean","object","array"].includes(e)?e:"string"}function Aft(e){const{type:t,nullable:r}=Tft(e.type);return W9({name:"",type:Nft(t),description:e.description,nullable:r,optional:!1,properties:e.properties?G9({properties:e.properties,required:e.required}):void 0,items:e.items?Aft(e.items):void 0})}function G9(e){if(!e?.properties)return[];const t=new Set(e.required||[]);return Object.entries(e.properties).map(([r,n])=>{const{type:s,nullable:a}=Tft(n.type);return W9({name:r,type:Nft(s),description:n.description,nullable:a,optional:!t.has(r),properties:n.properties?G9({properties:n.properties,required:n.required}):void 0,items:n.items?Aft(n.items):void 0})})}function Sie(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:Sie(i.properties||[],a,r,n)}:i.type==="array"&&i.items?{...i,items:{...i.items,properties:Sie(i.items.properties||[],a,r,n)}}:i)}function Oie(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:Oie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:Oie(a.items.properties||[],s,r)}}:a)}function kie(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:kie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:kie(a.items.properties||[],s,r)}}:a)}function d3r({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=u3r(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=W9();l(g=>Oie(g,p,m))},[]),d=b.useCallback((p,m)=>{l(g=>kie(g,p,m))},[]),f=b.useCallback((p,m,g)=>{l(y=>Sie(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(o3r,{value:h,children:o.jsx("div",{className:Y(s),children:a})})}const Ift=b.createContext(null);function f3r({children:e,value:t}){return o.jsx(Ift.Provider,{value:t,children:e})}function SC(){const e=b.useContext(Ift);if(!e)throw new Error("useJSONSchemaFormField must be used within a JSONSchemaForm.Field");return e}function h3r({field:e,parentPath:t=[],depth:r=0,className:n,children:s}){const{updateField:a,removeField:i}=Q9(),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(f3r,{value:u,children:o.jsx("div",{className:Y(n),children:s})})}const Rft=b.createContext(null);function p3r({children:e,value:t}){return o.jsx(Rft.Provider,{value:t,children:e})}function Pft(){return b.useContext(Rft)}function m3r({className:e,children:t}){const{fields:r}=Q9(),n=Pft(),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 g3r(e){const{field:t,update:r}=SC(),n=b.useCallback(s=>{r({name:s.target.value})},[r]);return o.jsx(jx,{...e,size:"md",labelIsHidden:!0,name:`field-name-${t.id}`,value:t.name,onChange:n})}const y3r=[{value:"string",label:"String",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Xce,{})})},{value:"number",label:"Number",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Wce,{})})},{value:"boolean",label:"Boolean",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Yce,{})})},{value:"text",label:"Text",icon:o.jsx(Ce,{size:"sm",children:o.jsx(hA,{})})},{value:"object",label:"Object",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Lb,{})})},{value:"array",label:"Array",icon:o.jsx(Ce,{size:"sm",children:o.jsx(Gce,{})})}];function v3r({className:e,...t}){const{field:r,update:n}=SC(),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:y3r,size:"md",...t})}function b3r({label:e="Optional",labelClassName:t,className:r,...n}){const{field:s,update:a}=SC(),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(fi,{...n,className:r,checked:s.optional,onCheckedChange:i}),e]})}function x3r({label:e="Nullable",labelClassName:t,className:r,...n}){const{field:s,update:a}=SC(),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(fi,{...n,className:r,checked:s.nullable,onCheckedChange:i}),e]})}function w3r({children:e,tooltip:t="Remove field",...r}){const{remove:n}=SC();return o.jsx(Cn,{tooltipContent:t,onClick:n,size:"md",...r,children:e||o.jsx(FHe,{})})}function S3r({className:e,children:t}){const{maxDepth:r,updateField:n}=Q9(),{field:s,parentPath:a,depth:i}=SC(),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:W9({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(p3r,{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 O3r({children:e,...t}){const{addField:r}=Q9(),n=Pft(),s=n?n.parentPath:[],a=b.useCallback(()=>{r(s)},[r,s]);return o.jsx(me,{type:"button",...t,onClick:a,children:e||"Add field"})}const vi={Root:d3r,Field:h3r,FieldList:m3r,FieldName:g3r,FieldType:v3r,FieldOptional:b3r,FieldNullable:x3r,FieldRemove:w3r,NestedFields:S3r,AddField:O3r};function _1({data:e,className:t,labelsAreHidden:r,isLoading:n,LinkComponent:s}){const a=({children:i})=>r?o.jsx(Ju,{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(hRe,{description:h.description,children:o.jsxs(s,{href:h.path,children:[h?.name," ",o.jsx(O_,{})]})},h.id):h.path?o.jsx(hRe,{description:h.description,children:o.jsxs("a",{href:h.path,children:[h?.name," ",o.jsx(O_,{})]})},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 hRe({description:e,children:t}){return e?o.jsxs(Tfe,{openDelay:250,children:[o.jsx(Nfe,{asChild:!0,children:t}),o.jsx(Afe,{children:o.jsxs(Ife,{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(Rfe,{className:"fill-surface5"})]})})]}):t}function k3r({children:e,className:t}){return o.jsx("div",{className:Y("mt-auto",t),children:e})}function _3r({children:e,className:t}){return o.jsx("nav",{className:Y("",t),children:e})}function Mft({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 E3r({children:e,className:t,state:r="default",href:n,isActive:s,LinkComponent:a}){const i=r==="default",l=i?e:o.jsx(Ju,{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(Mft,{})]})}function C3r({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(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsxs(a,{href:e.url,...u,children:[e.icon&&e.icon,i?o.jsx(Ju,{children:e.name}):e.name," ",r]})}),o.jsx(Wr,{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(Ju,{children:e.name}):e.name," ",r,e.isExperimental&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(PF,{className:"ml-auto stroke-accent5"})}),o.jsx(Wr,{side:"right",align:"center",className:"ml-4",children:"Experimental Feature"})]})]})}):r})}function j3r({children:e,className:t}){return o.jsx("ul",{className:Y("grid gap-1 items-start content-center",t),children:e})}function T3r({children:e,className:t}){return o.jsx("section",{className:Y("grid items-start content-center relative",t),children:e})}const Dft="sidebar:state",Eme=je.createContext(null);function Cme(){const e=je.useContext(Eme);if(!e)throw new Error("useMainSidebar must be used within a MainSidebarProvider.");return e}function N3r(){return je.useContext(Eme)}const A3r=e=>{window.localStorage.setItem(Dft,e.toString())};function I3r({children:e}){const[t,r]=je.useState(()=>"default");je.useLayoutEffect(()=>{const a=window.localStorage.getItem(Dft);(a==="collapsed"||a==="default")&&r(a)},[]);const n=je.useCallback(()=>{A3r(t==="default"?"collapsed":"default"),r(t==="default"?"collapsed":"default")},[t]),s=je.useMemo(()=>({state:t,toggleSidebar:n}),[t,n]);return o.jsx(Eme.Provider,{value:s,children:e})}function R3r({children:e,className:t}){const{state:r,toggleSidebar:n}=Cme(),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 P3r({className:e}){const{state:t,toggleSidebar:r}=Cme(),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(Yr,{children:[o.jsx(Xr,{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(O9t,{className:Y({"rotate-180":n})})})}),o.jsxs(Wr,{children:["Toggle Sidebar",o.jsxs("div",{className:"flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]",children:[o.jsx(h9t,{})," Ctrl+B"]})]})]})}const Yh=Object.assign(R3r,{Bottom:k3r,Nav:_3r,NavSection:T3r,NavLink:C3r,NavHeader:E3r,NavList:j3r,NavSeparator:Mft,Trigger:P3r});function uQ({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",an.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(zE,{className:"h-4 w-4"}):o.jsx(UR,{className:"h-4 w-4"})}),o.jsx("div",{className:"flex gap-2 items-start min-w-0",children:e}),a&&o.jsxs(me,{variant:"ghost",className:Y("h-6 w-6 p-0 shrink-0",an.colors,"hover:bg-surface5"),onClick:f,children:[o.jsx(Xl,{className:"h-4 w-4"}),o.jsx(Ju,{children:"Dismiss"})]})]})}function Lft({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 $ft({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 M3r({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($ft,{isLoading:a,children:[s," ",r]}),n!==void 0&&o.jsx(Lft,{isLoading:a,children:n})]}):e})}const bn=Object.assign(M3r,{Title:$ft,Description:Lft});function D3r({children:e,className:t}){return o.jsx("header",{className:Y("grid items-center grid-cols-[1fr_auto]",t),children:e})}function L3r({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 Fft({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-4",t),children:e})}function E1({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-2",t),children:e})}const gl=Object.assign(Fft,{Header:D3r,Heading:L3r});function $3r(){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 F3r(){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=Fp.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,Jx(t)]}const z3r=()=>{const e=bC().resolvedTheme==="dark";return b.useMemo(()=>e?$3r():F3r(),[e])};function B3r({codeStr:e="",title:t,icon:r,simplified:n=!1}){const s=z3r(),[a,i]=b.useState(!1),l=b.useMemo(()=>{try{const u=JSON.parse(e);return _ie(u||"")}catch{return!1}},[e]),c=a?e?.replace(/\\n/g,`
|
|
296
296
|
`):e;return o.jsxs(gl,{children:[o.jsxs(gl.Header,{children:[o.jsxs(gl.Heading,{children:[r,t]}),o.jsxs(ps,{children:[o.jsx(ta,{content:e||"No content"}),l&&o.jsx(me,{onClick:()=>i(!a),children:a?o.jsx(hA,{}):o.jsx(T3,{})})]})]}),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(wc,{extensions:[A_(),ft.lineWrapping],theme:s,value:c})})]})}function _ie(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 nNn({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(Eh,{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 sNn({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}=cTn(),{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(rNn,{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(nNn,{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(tNn,{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(me,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(me,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(me,{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(me,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(Sn,{open:t,onOpenChange:_,children:o.jsxs(yn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(On,{children:[o.jsx(vn,{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(pf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function aNn({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(y_,{})," Created at ",e?.createdAt?tr(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Zx,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(Yr,{children:[o.jsx(Xr,{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(Wr,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(me,{disabled:!0,tabIndex:-1,children:[o.jsx(gx,{}),"Run Experiment"]})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(me,{onClick:l,children:[o.jsx(gx,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(me,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(wVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(uv,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(au,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(sd,{})," Delete Dataset"]})]})]})]})})]})}const U1t=e=>{const t=Ge(),{data:r}=kR(e),n=r?.experiments;return kt({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})},iNn=e=>{const t=Ge(),{data:r}=kR(e),n=r?.experiments;return kt({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 oNn(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 lNn=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 F8e({className:e,children:t,...r}){return o.jsx(cP,{children:o.jsx(yz,{className:Y(lNn,e),...r,children:t})})}function cNn({datasetId:e}){const t=Ge(),{data:r}=Pg(e),{data:n,isLoading:s}=U1t(e),{data:a,isLoading:i}=iNn(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]),fe=b.useMemo(()=>[...h].filter(ge=>ie.has(ge)).length,[h,ie]),X=te.length>0&&fe===te.length,se=fe>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]),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,ge])}},[U,h,M]),ce=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(Sn,{open:w,onOpenChange:S,children:o.jsxs(yn,{children:[o.jsxs(On,{children:[o.jsx(vn,{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(Mg,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Dg,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(pe,{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(bc,{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(pf,{children:[o.jsx(me,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(me,{onClick:K,disabled:!E||!j||y,children:[y?o.jsx(Dt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(Sn,{open:R,onOpenChange:B,children:o.jsxs(yn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(On,{children:[o.jsx(vn,{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(fi,{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(pe,{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(P1t,{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(pe,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ge.reason})]})]})},ge.itemId)})}),o.jsxs(pf,{children:[o.jsx(me,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(me,{onClick:oe,disabled:I.filter(ge=>ge.accepted).length===0,children:["Accept ",I.filter(ge=>ge.accepted).length," proposals"]})]})]})}),o.jsxs(af,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(mr,{children:[o.jsxs(mr.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(me,{variant:"outline",size:"md",children:[o.jsx(SVe,{}),"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(F8e,{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(F8e,{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(me,{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(R1t,{selectedCount:h.size,vocabulary:z,onApplyTag:ue,onRemoveTag:ce,onNewTag:ge=>ue(ge)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(me,{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(nS,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:we,children:[o.jsx(Ce,{size:"sm",children:o.jsx(sd,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Ne,children:[o.jsx(Ce,{size:"sm",children:o.jsx(x_,{})}),"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(pe,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(pe,{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(fi,{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(fi,{checked:h.has(ge.id),onCheckedChange:()=>le(ge.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ge.id}`})}),o.jsx(Se.NameCell,{children:oNn(ge.input,80)}),o.jsx(Se.Cell,{children:ge.comment?o.jsx(pe,{variant:"ui-xs",className:"text-neutral3 truncate",children:ge.comment}):o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Se.Cell,{children:ge.tags.length>0?o.jsx(pe,{variant:"ui-xs",className:"text-neutral4 truncate",children:ge.tags.join(", ")}):o.jsx(pe,{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(mce,{})}),ge.rating==="negative"&&o.jsx(Ce,{size:"sm",className:"text-negative1",children:o.jsx(pce,{})}),!ge.rating&&o.jsx(pe,{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(pe,{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(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ge.id)})})]})]}),Ae&&o.jsx(I1t,{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 uNn({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]=nur(Z,300),[W,G]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=Pg(e),{data:ie=[],total:fe,isLoading:X,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe}=CE(e,M||void 0,ae),{data:ue=[],total:ce,isLoading:ve}=CE(e,void 0,ae),[we,Ne]=b.useState({}),{data:K,isLoading:oe}=kR(e,void 0,we),{data:be}=kR(e),{deleteItems:Ae}=ni(),$e=K?.experiments??[],ye=be?.experiments??[],ke=CTn({hasSearchQuery:!!M,filteredItemsLength:ie.length,unfilteredItemsTotal:ce,itemsTotal:fe}),{data:ge}=U1t(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",an.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(aNn,{dataset:te,isLoading:re,onEditClick:r,onDuplicateClick:()=>U(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!ve&&ue.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(Nf,{defaultTab:"items",value:h,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(Af,{children:[o.jsxs(hs,{value:"items",children:["Items ",o.jsx(za,{color:"gray",children:ke})]}),o.jsxs(hs,{value:"experiments",children:["Experiments",o.jsx(za,{color:"gray",children:$e.length})]}),o.jsxs(hs,{value:"review",children:["Review",Ee>0&&o.jsx(za,{color:"orange",children:Ee})]})]}),o.jsx(Ns,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(eNn,{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(Ns,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(VTn,{experiments:$e,allExperiments:ye,isLoading:oe,datasetId:e,filters:we,onFiltersChange:Ne})}),o.jsx(Ns,{value:"review",className:"overflow-auto mt-0",children:o.jsx(cNn,{datasetId:e})})]})})]})})}),o.jsx(MTn,{datasetId:e,open:g,onOpenChange:y}),o.jsx(sNn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(wTn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(STn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(OTn,{open:$,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx(Bt,{open:P,onOpenChange:R,children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Items"}),o.jsxs(Bt.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:it,children:Ae.isPending?"Deleting...":"Delete"})]})]})})]})}function dNn(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 z8e({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 fNn({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=dNn(_);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(Sn,{open:t,onOpenChange:r,children:o.jsxs(yn,{className:"max-w-lg",children:[o.jsx(On,{children:o.jsx(vn,{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(z8e,{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(z8e,{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(me,{type:"button",onClick:y,children:"Cancel"}),o.jsx(me,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function hNn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=hd(),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($dt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const pNn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function mNn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Ag(),{data:l,isLoading:c}=p0(),{data:u,isLoading:d}=hd(),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(Kl,{options:pNn,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(Kl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function gNn({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});vc.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";vc.error(w)}},y=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(Sn,{open:r,onOpenChange:y,children:o.jsxs(yn,{ref:a,children:[o.jsxs(On,{children:[o.jsx(vn,{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(mNn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(hNn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(pf,{className:"px-6 pt-4",children:[o.jsx(me,{onClick:y,disabled:m,children:"Cancel"}),o.jsx(me,{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 V1t=e=>{const t=Ge();return kt({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},B8e=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function yNn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=lre(e?.input),d=lre(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(kC,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(me,{onClick:a,disabled:!e.traceId,children:[o.jsx(hce,{}),"Show Trace"]}),o.jsx(me,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(An,{})})]})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(gx,{})," ",e.id]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(px,{})," ",e.itemId]})})]})}),c&&o.jsxs(yl,{variant:"destructive",children:[o.jsx(ADt,{}),o.jsxs(yl.Message,{children:[o.jsx("strong",{children:"Error: "}),lre(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:B8e,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:B8e,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(PE,{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(px,{}),codeStr:u}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Yd,{}),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(y_,{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 lre(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function vNn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(mx,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Yd,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(_h,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Attributes",icon:o.jsx(_h,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function bNn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=FS(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(kC,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(me,{onClick:s,"aria-label":"Close span details",children:o.jsx(An,{})})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(_h,{})," Span ",sf(t)]})})}),o.jsx(vNn,{span:i})]})]})}const xNn=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 q1t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...q1t(r))}),t}const U8e=["agent","workflow","model","mcp","tool","workspace","other"];function H1t(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(ga,{}),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(Am,{}),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(bl,{}),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(H9,{}),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 wNn({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(V8e,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(dVe,{}):o.jsx(Gx,{}):o.jsx(as,{})]}),a>(l??0)&&!i&&o.jsxs(V8e,{onClick:()=>s?.(),children:[a," ",o.jsx(uVe,{})]})]}):null})}function V8e({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 SNn({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(pVe,{}):o.jsx(hVe,{})})})}function ONn({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(SNn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function Q1t({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=q1t(e),y=g.length,x=t===0,w=H1t(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(ONn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(wNn,{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(Q1t,{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 kNn({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(Q1t,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function _Nn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=U8e.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!U8e.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=srt(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(Tx,{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(gft,{children:[c.map(h=>{const p=H1t(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(me,{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(me,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ce,{children:o.jsx(dF,{})}),"Other"]}),o.jsx(me,{onClick:n,disabled:t?.length===0,children:o.jsx(Ce,{children:o.jsx(An,{})})})]})]})}function ENn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=V1t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>xNn(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(mr.Toolbar,{children:o.jsx(me,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(An,{})})}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(xo,{})," Trace ",sf(e)]})})}),o.jsx(_Nn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(kNn,{hierarchicalSpans:g,onSpanClick:y,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function CNn({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(Yr,{children:[o.jsx(Xr,{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(Wr,{children:h?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:TNn(jNn(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(pe,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function jNn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function TNn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function NNn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function ANn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=NNn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(kC,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(me,{onClick:n,"aria-label":"Close score details",children:o.jsx(An,{})})]}),o.jsxs(mr.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(Nx,{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(px,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Yd,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(lc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(lc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(lc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(lc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const q8e=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function INn({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:q8e,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:q8e,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 W1t({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}=O1t(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}=V1t(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(Nf,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(Af,{children:[o.jsx(hs,{value:"summary",children:"Summary"}),o.jsx(hs,{value:"results",children:"Results"})]}),o.jsx(Ns,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(INn,{scoresByItemId:y,experimentStatus:t})}),o.jsx(Ns,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(af,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(mr,{children:o.jsx(CNn,{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(n5r,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(yNn,{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(mr,{withLeftSeparator:!0,children:o.jsx(ANn,{score:R,onNext:D(),onPrevious:$(),onClose:()=>m(null)})}),g&&u&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(ENn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(bNn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const RNn={pending:o.jsx(NE,{}),running:o.jsx(x3,{}),completed:o.jsx(ra,{}),failed:o.jsx(An,{})};function PNn({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:RNn[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 G1t({experimentId:e,experiment:t}){const{Link:r,paths:n}=or(),{data:s}=Ag(),{data:a}=p0(),{data:i}=hd(),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(gVe,{}),e," ",e&&o.jsx(ta,{content:e})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(y_,{})," Created at ",tr(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(Zn,{children:[o.jsx(y_,{})," 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(s2t,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(Zn,{children:[o.jsx(hF,{})," 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(ta,{content:t.agentVersion})]})]})]}),o.jsx(Ir.Column,{children:o.jsx(PNn,{experiment:t})})]})}function Lve({delta:e}){const t=e>0?o.jsx(za,{size:"small",color:"green",intensity:"muted",children:o.jsx(lce,{})}):e<0?o.jsx(za,{size:"small",color:"red",intensity:"muted",children:o.jsx(oVe,{})}):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 qL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function MNn({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(mr,{withLeftSeparator:!0,children:[o.jsxs(mr.Toolbar,{children:[o.jsx(kC,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(me,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(An,{})})})]}),o.jsxs(mr.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(px,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(Nx,{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(Lve,{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(Yd,{}),codeStr:qL(c?.output)}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(Yd,{}),codeStr:qL(u?.output)}),o.jsx(Vt.CodeSection,{title:"Item Input",icon:o.jsx(mx,{}),codeStr:qL(e.input)}),o.jsx(Vt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(PVe,{}),codeStr:qL(e.groundTruth)})]})}):o.jsxs(yl,{variant:"warning",children:[o.jsx(Eh,{}),o.jsx(yl.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. Comparison is not available."]})})()})]})]})]})}function DNn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(mr,{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(Lve,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const LNn={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 H8e({datasetId:e,experiment:t,type:r}){const{Link:n}=or(),{label:s,color:a,customStyle:i}=LNn[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(zw,{})]}),o.jsx(me,{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(Ep,{})," ",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(PVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(Zn,{children:[o.jsx(OVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(Zn,{children:[o.jsx(lVe,{})," ",tr(l,"MMM d, yyyy HH:mm")]})]})]})}function $Nn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=Jjn(e,t,r),{data:u}=K6(e,t),{data:d}=K6(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.jsxs(yl,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(yl.Column,{children:[o.jsx(yl.Title,{children:"Error loading comparison"}),o.jsx(yl.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(H8e,{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(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{onClick:n,children:"VS"})}),o.jsx(Wr,{children:"Switch the order"})]})})}),o.jsx(H8e,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsxs(yl,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(yl.Message,{children:[o.jsx("strong",{children:"Version mismatch!"})," 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(gRe,{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(gRe,{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(Lve,{delta:I}):"-"})]},T))})})]}),o.jsxs(af,{className:Y({"grid-cols-[1fr_2fr]":!!y}),children:[o.jsx(DNn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!y&&o.jsx(MNn,{item:y,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function FNn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=Dve(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(mr,{className:"min-w-56",children:[l?o.jsx(mr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(me,{onClick:m,children:"Cancel"}),o.jsx(Cn,{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(mr.Toolbar,{children:o.jsxs(me,{onClick:g,className:"w-full",children:[o.jsx(Hm,{})," Compare Ver."]})})}),i?o.jsx(zNn,{}):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(fi,{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 zNn(){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 BNn(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 UNn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=Pve(e),a=(s??[]).map(i=>({value:String(i.version),label:`${BNn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(mr.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 VNn=[{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"}],qNn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(us,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(IVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(m2t,{}),tooltip:"Same in both versions"}};function cre({red:e=!1,tooltip:t}){return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(GPt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Wr,{children:t})]})}function nw({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}=qNn[e];return o.jsxs(Yr,{children:[o.jsx(Xr,{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(Wr,{children:s})]})}function HNn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function QNn({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=HNn(u,d);return o.jsxs(Pt.Row,{columns:VNn,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(nw,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(nw,{variant:"changed",version:u.datasetVersion}):o.jsx(nw,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(cre,{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(nw,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(nw,{variant:"changed",version:d.datasetVersion}):o.jsx(nw,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(cre,{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(nw,{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(cre,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const Q8e={needsReview:"#facc15",complete:"#22c55e"},WNn=[{label:"Needs Review",color:Q8e.needsReview},{label:"Reviewed",color:Q8e.complete}];function GNn({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(Qt,{children:[o.jsxs(Qt.TopBar,{children:[o.jsx(Qt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Qt.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Qt.Loading,{}):s?o.jsx(Qt.Error,{message:"Failed to load review data"}):o.jsx(Qt.Content,{children:c?o.jsx(rE,{data:a,segments:WNn,maxVal:i,fmt:u=>String(u)}):o.jsx(Qt.NoData,{message:"No items have been sent to review yet"})})]})}function $ve(){const e=Ge();return kt({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function Z1t(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 ZNn(e,t){const r=new Map,n=Z1t(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 YNn(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 XNn=10;function KNn(){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}=Uh({page:d,perPage:XNn}),{data:g,isLoading:y,error:x}=o8(),{data:w}=$ve(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>yTn(S),[S]),T=b.useMemo(()=>ZNn(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(sa,{})});if(N&&Os(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(vu,{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(vTn,{onCreateClick:I})}),o.jsx($le,{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(bn,{children:o.jsxs(bn.Title,{isLoading:j,children:[o.jsx(Na,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(us,{})}),o.jsx(Cn,{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(xTn,{search:r,onSearchChange:B,targetFilter:s,onTargetFilterChange:D,experimentFilter:i,onExperimentFilterChange:$,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:H,hasActiveFilters:z})]}),o.jsx(pTn,{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($le,{open:e,onOpenChange:t})]})}const JNn=new Set(["items","experiments","review"]);function eAn(){const{datasetId:e}=na(),t=pu(),[r,n]=ao(),s=r.get("tab"),a=s&&JNn.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}=Pg(e??"");if(!e)return o.jsx(zr,{children:o.jsx(mf,{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(sa,{})})});if(w&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(ETn,{value:e,variant:"ghost"})})]})}),o.jsxs(mf,{className:"content-stretch",children:[o.jsx(uNn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(me,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(gx,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(gNn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(fNn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(kTn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(_Tn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function tAn(){const{datasetId:e,experimentId:t}=na(),{data:r}=Pg(e??""),{data:n,isLoading:s,error:a}=K6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=i8({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(sa,{})})}):a&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,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(G1t,{experimentId:t,experiment:n}),o.jsx(W1t,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function rAn(){const{datasetId:e}=na(),[t,r]=ao(),{data:n,error:s}=Pg(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(sa,{})})}):s&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,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(Hm,{})}),"Compare Experiments"]})]})}),o.jsx(mf,{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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(Hm,{})}),"Experiments Comparison"]})]})}),o.jsx(mf,{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(Hm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ir.Description,{children:["Comparing"," ",o.jsx(dr,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(dr,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(Ir.Column,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Ep,{}),"Back to Dataset"]})})]}),o.jsx($Nn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function nAn(){const{datasetId:e,itemId:t}=na(),{Link:r}=or(),n=pu(),{data:s,isLoading:a,error:i}=Dve(e??"",t??""),{updateItem:l,deleteItem:c}=ni(),{data:u}=Pg(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(sa,{})})}):i&&Os(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(mf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,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(px,{}),t," ",o.jsx(ta,{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(y_,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Zx,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ir.Column,{children:!y&&!f&&o.jsxs(ps,{children:[o.jsxs(me,{onClick:$,disabled:D,title:D?"Return to latest version to edit":void 0,children:[o.jsx(IVe,{})," Edit"]}),o.jsxs(me,{onClick:U,disabled:D,title:D?"Return to latest version to delete":void 0,children:[o.jsx(sd,{})," Delete"]})]})})]}),o.jsxs(af,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(mr,{withRightSeparator:!y,children:[f&&d&&o.jsxs(yl,{variant:"destructive",children:[o.jsx(Eh,{}),o.jsxs(yl.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&D&&h&&o.jsx(o.Fragment,{children:o.jsxs(yl,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(yl.Message,{children:["Viewing version v",h.datasetVersion]}),o.jsxs(yl.Button,{onClick:B,children:[o.jsx(gw,{})," Return to the latest version"]})]})}),y?o.jsx(z1t,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:l.isPending}):Z?o.jsx(l8,{item:Z,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&o.jsx(mr,{children:o.jsx(FNn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{n(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:h?.datasetVersion??null})})]})]})})]}),o.jsx(Bt,{open:I,onOpenChange:P,children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Item"}),o.jsx(Bt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:Q,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function W8e(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function sAn(){const{datasetId:e}=na(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Pg(e??""),{Link:i}=or(),[l,c]=b.useState(!1),{data:u}=Mle(e??"",n[0]??""),{data:d}=Mle(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(sa,{})})}):a&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(mf,{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(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(Ep,{})}),"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(Hm,{}),"Compare Dataset Items"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",n.length," items of"," ",o.jsx(dr,{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(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Ep,{}),"Back to Dataset"]}),o.jsx(me,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(xVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(o2t,{})," Diff View"]})})]})})]}),o.jsx(af,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(aAn,{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(Bft,{codeA:W8e(u),codeB:W8e(d)})]})})]})}function aAn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Mle(e,t),{data:u}=CE(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(mr,{children:[o.jsxs(mr.Toolbar,{className:"flex gap-4",children:[o.jsx(lge,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(me,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Zx,{}),"Versions"]})]}),i&&o.jsx(mr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(B1t,{item:l}),o.jsx(l8,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function G8e(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function iAn(){const{datasetId:e,itemId:t}=na(),[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}=Pg(e??""),{Link:u}=or(),{data:d}=Dve(e??"",t??""),{data:f}=zle(e??"",t??"",i[0]??0,l?.version),{data:h}=zle(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(sa,{})})}):c&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(mf,{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(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:l?.name}),o.jsx(jr,{as:dr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(Ep,{})}),"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(Hm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",i.length," versions of"," ",o.jsx(dr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(me,{as:dr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Ep,{}),"Back to Item"]}),o.jsx(me,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(xVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(q2t,{})," Diff View"]})})]})})]}),o.jsx(af,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(oAn,{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(Bft,{codeA:G8e(f),codeB:G8e(h)})]})})]})}function oAn({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}=zle(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(mr,{children:[o.jsxs(mr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Zx,{className:"w-6 h-6 opacity-50"}),o.jsx(lge,{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(mr.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(l8,{item:m,Link:i})})]})}function lAn(){const{datasetId:e}=na(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=pu(),{data:s,error:a}=Pg(e??""),i=CE(e??"",void 0,r[0]??null),l=CE(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(sa,{})})});if(a&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(mf,{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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(xSe,{})}),"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(xSe,{})," Compare Dataset Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(Zx,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ir.Column,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Ep,{}),"Back to Dataset"]})})]}),o.jsx(af,{children:o.jsxs(mr,{children:[o.jsx(UNn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(QNn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function cAn(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 uAn({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=cAn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Scorers"}),i?o.jsx(_n.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(f)}),o.jsx(_n.NoChange,{message:"Static count"})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Datasets"}),l?o.jsx(_n.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(h)}),o.jsx(_n.NoChange,{message:"Static count"})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Avg Score"}),u?o.jsx(_n.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(n)}),m?o.jsx(_n.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(_n.NoChange,{})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Experiments"}),c?o.jsx(_n.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(p)}),g?o.jsx(_n.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(_n.NoChange,{})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Needs Review"}),d?o.jsx(_n.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(a)}),a>0?o.jsx(_n.NoChange,{message:"items pending review"}):o.jsx(_n.NoChange,{message:"All caught up"})]}):o.jsx(_n.NoData,{})]})]})}const dAn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],Z8e="auto 1fr auto auto auto auto auto auto auto";function fAn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const hAn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function pAn({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(wh,{columns:Z8e}):o.jsxs(Se,{columns:Z8e,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(BP,{variant:hAn[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:fAn(h.createdAt)})]},h.id)})]})}function mAn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const HL={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},gAn=[{label:"Completed",color:HL.completed},{label:"Running",color:HL.running},{label:"Pending",color:HL.pending},{label:"Failed",color:HL.failed}];function yAn({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(Qt,{children:[o.jsxs(Qt.TopBar,{children:[o.jsx(Qt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Qt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Qt.Loading,{}):n?o.jsx(Qt.Error,{message:"Failed to load experiments data"}):o.jsx(Qt.Content,{children:i?o.jsx(rE,{data:s,segments:gAn,maxVal:a,fmt:l=>String(l)}):o.jsx(Qt.NoData,{message:"No experiments have been run yet"})})]})}const vAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(ba,{})]})})})});function bAn({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(Cg,{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:[...dAn],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(me,{onClick:l,size:"sm",variant:"light",children:[o.jsx(An,{className:"size-3"})," Reset"]})]})]})}function xAn(){const{data:e,isLoading:t,error:r}=hd(),{data:n,isLoading:s,error:a}=Uh(),{data:i,isLoading:l,error:c}=o8(),{data:u,isLoading:d,isError:f,error:h}=_On(),{data:p,isLoading:m,isError:g,error:y}=$ve(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>YNn(p),[p]),k=r||a||c||h||y;return k&&Ps(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(sa,{})}):k&&Os(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(Zs,{resource:"evaluation"})}):k?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(vu,{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(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(Ru,{})," Evaluation"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(bie,{children:o.jsx(uAn,{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(pOn,{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(bTn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(yAn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(GNn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function wAn(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=Uh(),{data:u,isLoading:d,error:f}=o8(),{data:h}=$ve(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>mAn(p),[p]),y=b.useMemo(()=>Z1t(h),[h]),x=l||d,w=f||c;if(w&&Ps(w))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(sa,{})});if(f&&Os(f))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Zs,{resource:"experiments"})});if(c&&Os(c))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Zs,{resource:"datasets"})});if(w)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(vu,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(vAn,{})});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(bn,{children:o.jsxs(bn.Title,{isLoading:x,children:[o.jsx(Ru,{})," Experiments"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(bAn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(pAn,{experiments:m,datasets:p,reviewByExperiment:y,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function SAn(){const{experimentId:e}=na(),{data:t,isLoading:r}=o8(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=K6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=i8({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(sa,{})})}):l&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/experiments",children:[o.jsx(Ce,{children:o.jsx(Ru,{})}),"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(G1t,{experimentId:e,experiment:a}),o.jsx(W1t,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h})]})})]}):null}function Y1t({redirectUri:e,onSuccess:t,initialMode:r="signin",errorMessage:n}){const{data:s,isLoading:a}=_C(),{mutate:i,isPending:l,error:c}=jjn(),{mutate:u,isPending:d,error:f}=Tjn(),{mutate:h,isPending:p}=L1t(),[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(rx,{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(_Ve,{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(me,{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(me,{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 OAn(){const[e]=ao(),t=pu(),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(Y1t,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}function kAn(){const[e,t]=ao(),r=Dzr(e,t),n=Fzr(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=Aht(),{data:d=[],isPending:f}=Iht({entityType:r.selectedEntityOption?.entityType,rootOnly:!0}),{data:h=[],isPending:p}=Rht(),{data:m=[],isPending:g}=Pht(),y=b.useMemo(()=>Tzr({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(()=>Rzr({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}=Ozr({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=Uzr(w,r.featuredLogId,r.handleFeaturedChange,r.featuredTraceId),{data:B,isLoading:D}=Fme(r.featuredTraceId??null),{data:$,isLoading:U}=FS(r.featuredTraceId??"",r.featuredSpanId??""),z=b.useCallback(()=>r.applyFilterTokens(Pzr(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(e$,{}),children:o.jsx(pzr,{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(e$,{}),children:o.jsx(bzr,{})}):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(bn,{children:o.jsxs(bn.Title,{isLoading:S,children:[o.jsx(e$,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(uht,{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(hft,{fields:y,tokens:r.filterTokens,onTokensChange:r.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Cn,{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(yzr,{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(mzr,{logCollapsed:i,listSlot:o.jsx(gzr,{logs:w,isLoading:S,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:r.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(hzr,{log:N,onClose:H,onTraceClick:Q,onSpanClick:L,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:r.featuredTraceId?o.jsx(LFr,{traceId:r.featuredTraceId,spans:B?.spans,isLoading:D,onClose:Z,onSpanSelect:M,selectedSpanId:r.featuredSpanId}):null,spanPanelSlot:r.featuredTraceId&&r.featuredSpanId?o.jsx(DFr,{spanId:r.featuredSpanId,span:$?.span,isLoading:U,onClose:V}):null})]})}const X1t=e=>{const t=Ge();return kt({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 _An({server:e}){const{paths:t,Link:r}=or(),s=Ge().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=X1t(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=Ih(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 EAn({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(wh,{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(ga,{}),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(_An,{server:s},s.id))]})}const CAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(ba,{})]})})}),jAn=()=>{const{data:e=[],isLoading:t,error:r}=mM(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(bl,{}),children:o.jsx(sa,{})}):r&&Os(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(bl,{}),children:o.jsx(Zs,{resource:"MCP servers"})}):r?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(bl,{}),children:o.jsx(vu,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(bl,{}),children:o.jsx(CAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(bl,{})," MCP Servers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(Cg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(EAn,{mcpServers:e,isLoading:t,search:n})]})},TAn=(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 NAn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=or(),i=b.useMemo(()=>TAn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(wh,{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(ga,{}),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=Ih(c.id,50),d=Ih(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 AAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(ba,{})]})})}),IAn=()=>{const e=Ge();return Kr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new g_;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}}})},RAn=({toolId:e})=>{const{canExecute:t}=Cv(),r=t("tools"),{data:n={}}=Ag(),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}=Ykn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=IAn(),{requestContext:h}=ks();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?hg(ug(sv(c?.inputSchema))):Gn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(kve,{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(pe,{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(pe,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function PAn({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="inputLike"}){const{data:c={},isLoading:u,isError:d,error:f}=s8(),{data:h={},isLoading:p,isError:m,error:g}=Ag(),{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(Kl,{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 MAn=({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(mf,{children:o.jsx(pe,{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(mf,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(pe,{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(H9,{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(pe,{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(pe,{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(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{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(pe,{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(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{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(pe,{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(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(DAn,{server:t})})]})},DAn=({server:e})=>{const{data:t={},isLoading:r}=X1t(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(bl,{})}),o.jsx(pe,{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(LAn,{tool:a,serverId:e.id},s)})})]})},LAn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=or(),a=zSt[e.toolType||"tool"];return o.jsxs(_f,{onClick:()=>r.current?.click(),children:[o.jsx(Tdt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(jf,{children:[o.jsx(Ef,{children:o.jsx(n,{ref:r,href:s.mcpServerToolLink(t,e.id),children:e.id})}),o.jsx(Cf,{children:e.description})]})]})},$An=()=>{const{serverId:e}=na(),{data:t=[],isLoading:r}=mM(),n=t.find(s=>s.id===e);return o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(bl,{})}),"MCP Servers"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(r1t,{value:e,variant:"ghost"})})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(h0,{}),"MCP documentation"]})})]}),o.jsx(MAn,{isLoading:r,server:n})]})},K1t=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return kt({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},FAn=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return Kr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},zAn=({toolId:e,serverId:t})=>{const{canExecute:r}=Cv(),n=r("tools"),{data:s,isLoading:a,error:i}=K1t(t,e),{mutateAsync:l,isPending:c,data:u}=FAn(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(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{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(pe,{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(pe,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=hg(ug(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Gn({})}return o.jsx(kve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},BAn=()=>{const{data:e}=mM(),{serverId:t,toolId:r}=na(),{data:n,isLoading:s}=K1t(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(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(bl,{})}),"MCP Servers"]}),o.jsx(jr,{as:dr,to:`/mcps/${t}`,children:l}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(h0,{}),"MCP documentation"]})})]}),o.jsx(zAn,{toolId:r,serverId:t})]})};function UAn(){const{data:e,isLoading:t,isError:r}=yFr();return o.jsx(iFr,{data:e,isLoading:t,isError:r})}function VAn(){const{data:e,isLoading:t,isError:r}=Oht();return o.jsx(tB,{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 qAn(){const{data:e,isLoading:t,isError:r}=pFr();return o.jsx(tB,{label:"Total Model Cost",value:e?.cost!=null?Ww(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Ww(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:r})}function HAn(){const{data:e,isLoading:t,isError:r}=mFr();return o.jsx(tB,{label:"Total Tokens",value:e?.value!=null?zm(e.value):null,prevValue:e?.previousValue!=null?zm(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function QAn(){const{data:e,isLoading:t,isError:r}=hFr();return o.jsx(tB,{label:"Avg Score",value:e?.value!=null?String(e.value):null,prevValue:e?.previousValue!=null?String(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function WAn(){const{data:e,isLoading:t,isError:r}=gFr();return o.jsx(oFr,{rows:e,isLoading:t,isError:r})}function GAn(){const{data:e,isLoading:t,isError:r}=bFr();return o.jsx(lFr,{data:e,isLoading:t,isError:r})}function ZAn(){const{data:e,isLoading:t,isError:r}=xFr();return o.jsx(uFr,{data:e,isLoading:t,isError:r})}function YAn(){const{data:e,isLoading:t,isError:r}=vFr();return o.jsx(dFr,{data:e,isLoading:t,isError:r})}const XAn=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),ure="period";function KAn(){const[e,t]=ao(),r=e.get(ure),n=xht(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(ure):l.set(ure,a),l},{replace:!0})},[t]);return o.jsx(nFr,{initialPreset:n,onPresetChange:s,children:o.jsx(JAn,{})})}function JAn(){const{error:e}=Oht(),{data:t,isLoading:r}=YB(),n=t?.observabilityStorageType,s=n?XAn.has(n):!1,a=n==="ObservabilityInMemory";return e&&Ps(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(ok,{}),children:o.jsx(sa,{})}):e&&Os(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(ok,{}),children:o.jsx(Zs,{resource:"metrics"})}):e?o.jsx(Jr,{title:"Metrics",icon:o.jsx(ok,{}),children:o.jsx(vu,{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(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(ok,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(sFr,{}),o.jsx(Cn,{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.jsxs(pl,{variant:"info",children:[o.jsx(ml,{children:"Metrics are not persisted"}),o.jsx(Xc,{as:"p",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(bie,{children:[o.jsx(VAn,{}),o.jsx(qAn,{}),o.jsx(HAn,{}),o.jsx(QAn,{})]}),o.jsxs(bie,{children:[o.jsx(WAn,{}),o.jsx(ZAn,{}),o.jsx(GAn,{}),o.jsx(YAn,{}),o.jsx(UAn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(ba,{})]})})})]})}const eIn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:ok,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:xo,href:"/observability"}];function tIn(){return o.jsxs(vk,{children:[o.jsx(vk.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:eIn.map(e=>o.jsxs(dr,{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 rIn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:ga,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:sS,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:bl,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:oc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:IE,href:"/request-context"}];function nIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(X2t,{})," 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:rIn.map(e=>o.jsxs(dr,{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 sIn(){const{paths:e}=or(),{data:t,isLoading:r,error:n}=QSt(),{isCmsAvailable:s}=pM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ps(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(sa,{})}):n&&Os(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(vu,{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(zkn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:r,children:[o.jsx(Yi,{})," Prompts"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{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(me,{as:dr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(us,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Cg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(Fkn,{promptBlocks:l,isLoading:r,search:a})]})}function aIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(IE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(n1n,{children:o.jsx(kSt,{})})})]})}const iIn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:f2t,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:ba,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:aA,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:bVe,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:iMt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function oIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.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:iIn.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(ba,{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 lIn(){const{data:e={},isLoading:t,error:r}=hd(),[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(sa,{})});if(r&&Os(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(vu,{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(gOn,{})});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(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(La,{})," Scorers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(vOn,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(mOn,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function cIn(){const{scorerId:e}=na(),[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}=fOn(e),{data:f={},isLoading:h,error:p}=Ag(),{isLoading:m,error:g}=p0(),{data:y=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=dOn({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&&Os(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:dr,to:"/scorers",children:"Scorers"}),o.jsx(hOn,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(bn,{children:[o.jsxs(bn.Title,{isLoading:u,children:[o.jsx(La,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(bn.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Cn,{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(me,{variant:"light",as:dr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(uv,{})," 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(sa,{}):D?o.jsx(Zs,{resource:"scorers"}):$?o.jsx(vu,{title:"Failed to load scorer",message:L}):o.jsx(sOn,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(oOn,{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(nOn,{scores:y,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const uIn=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],dIn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=hve(),{theme:n,setTheme:s}=bC();return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(vme,{})," 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(_ft,{name:"theme",label:"Theme mode",value:n,onValueChange:a=>s(a),options:uIn.map(a=>({...a}))})]})}),o.jsx(CSt,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r}})]})]})};function fIn(){const[e]=ao(),t=pu(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(Y1t,{redirectUri:r,onSuccess:n,initialMode:"signup"})}function hIn(e){return e.replace(/\/$/,"").split("/").pop()}function c8({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 pIn({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(ga,{})," ",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(jVe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(yF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(bl,{})," ",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(bdt,{})," ",hIn(a.githubUrl)]})})]},a.slug)})})}function mIn({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(Tx,{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(me,{onClick:c,children:["Reset ",o.jsx(An,{})]})]})}function gIn(){const{data:e,isLoading:t}=Yzr(),{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(En,{children:o.jsxs(Yu,{children:[o.jsx(Ce,{children:o.jsx(Hb,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(mIn,{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(pIn,{templates:y,linkComponent:dr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const yIn="1.29.1-alpha.2";function vIn({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(Eh,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(F2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(c8,{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 bIn({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(c8,{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(TVe,{})]}),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(jx,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(jx,{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(_St,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(me,{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(zw,{})]})})]})})}function xIn({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(Hb,{}),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(qy,{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(hF,{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(bdt,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(_1,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function wIn({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(c8,{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(X3r,{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(RDt,{}),i||"Something went wrong"]}),c&&o.jsx(Y3r,{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 SIn({name:e,installedEntities:t}){return o.jsxs(c8,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(TVe,{}),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(_1,{data:t})]})}function OIn(){const{templateSlug:e}=na(),[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}=Xzr({repoOrSlug:e,owner:"mastra-ai"}),R=yIn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:D}=Kzr({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:$,isLoading:U}=Jzr(),{mutateAsync:z,isPending:H}=e9r(),{mutateAsync:Q}=t9r(),{streamInstall:L,streamResult:Z,isStreaming:V}=n9r($),{observeInstall:M,streamResult:W,isStreaming:G}=s9r($);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:ce,errors:ve}=xe.result.validationResults,we=`Template installation completed but ${ce} validation issue${ce>1?"s":""} remain unresolved.`;m(we),j(ve||[])}else{const ce=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof ce=="string"?ce:String(ce))}}).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(ue=>{if(ue.snapshot?.status==="running")return M.mutateAsync({runId:se})}).then(()=>{r(ue=>{const ce=new URLSearchParams(ue);return ce.delete("resume"),ce})}).catch(ue=>{console.error("❌ Failed to resume template installation:",ue),ue.message?.includes("404")||ue.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(ue){console.error("❌ Auto-resume failed with error:",ue),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(ga,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(se=>se).join(", "):"n/a",icon:o.jsx(yF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Am,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(PE,{})}],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"}),fe=async()=>{const se=Object.entries(u).reduce((le,[xe,ue])=>(ue===""&&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:ue}=await z({});w(ue),r(ce=>{const ve=new URLSearchParams(ce);return ve.set("runId",ue),ve.set("resume","true"),ve.set("provider",n||"openai"),ve}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:ue})}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(ue=>[...ue,le]):h(ue=>ue.filter(ce=>ce!==le)),d(ue=>({...ue,[le]:xe}))};return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/templates",children:[o.jsx(Ce,{children:o.jsx(Hb,{})}),"Templates"]}),o.jsx(jr,{as:dr,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(xIn,{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(wIn,{name:N.title,streamResult:G?W:Z,runId:x,workflowInfo:$}),g&&o.jsx(SIn,{name:N.title,installedEntities:te,linkComponent:dr}),p&&o.jsx(vIn,{errorMsg:p,validationErrors:T.length>0?T:Z?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!p&&o.jsx(bIn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:fe,handleVariableChange:X,isLoadingEnvVars:D||U,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const kIn=()=>{const{toolId:e,agentId:t}=na();return o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ga,{})}),"Agents"]}),o.jsx(jr,{as:dr,to:`/agents/${t}/chat`,children:t}),o.jsx(jr,{as:dr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(h0,{})}),"Tools documentation"]})})]}),o.jsx(HOn,{toolId:e,agentId:t})]})},_In=()=>{const{toolId:e}=na();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/tools",children:[o.jsx(Ce,{children:o.jsx(Mi,{})}),"Tools"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(PAn,{value:e,variant:"ghost"})})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(h0,{}),"Tools documentation"]})})]}),o.jsx(RAn,{toolId:e})]})};function EIn(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 CIn({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(aA,{})," 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(aA,{})," Feedback"]}),e?.traceId&&o.jsxs(Zn,{children:[o.jsx(b_,{})," ",e.traceId]})]}),o.jsxs(Nx,{children:[o.jsx(_1,{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?EIn(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(b_,{}),codeStr:a,simplified:!0})]})]})]})}const QL=[{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 jIn(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 TIn(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function J1t({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(Sft,{columns:QL});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(ha,{children:[o.jsxs(ha.Trim,{children:[o.jsx(ha.Header,{columns:QL}),l.length>0?o.jsx(ha.Entries,{children:l.map((h,p)=>{const m=new Date(h.timestamp),g=_g(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:jIn(h),comment:TIn(h)};return o.jsx(ha.Entry,{columns:QL,onClick:()=>c(p),entry:y,children:QL.map(x=>o.jsx(ha.EntryText,{children:String(y[x.name]??"")},`col-${x.name}`))},y.id)})}):o.jsx(ha.Message,{message:"No feedback found",type:"info"})]}),o.jsx(ha.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(CIn,{feedback:a,isOpen:n,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const eOt=({traceId:e="",page:t})=>{const r=Ge(),n=t??0;return kt({queryKey:["trace-feedback",e,n],queryFn:()=>r.listFeedback({filters:{traceId:e},pagination:{page:n,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})},Y8e="auto auto auto auto 1fr";function tOt({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(eB,{columns:Y8e}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Pc,{columns:Y8e,className:"min-w-0",children:[o.jsxs(Pc.Top,{children:[o.jsx(Pc.TopCell,{children:"ID"}),o.jsx(Pc.TopCell,{children:"Date"}),o.jsx(Pc.TopCell,{children:"Time"}),o.jsx(Pc.TopCell,{children:"Score"}),o.jsx(Pc.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=_g(a);return o.jsxs(Pc.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Pc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:sf(s?.id)||"n/a"}),o.jsx(Pc.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":tr(a,"MMM dd")}),o.jsx(Pc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:tr(a,"h:mm:ss aaa")}),o.jsx(Pc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Pc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Pc.NoMatch,{message:"No scores found"})]}),o.jsx(Pc.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>r?.((e?.pagination?.page||0)-1)})]})}function NIn(){const[e,t]=ao(),[r,n]=b.useState(!1),s=lzr(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}=hd(),{data:g,isLoading:y}=Sve({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}=eOt({traceId:s.traceIdParam,page:x}),{data:_,isLoading:E}=Fme(s.traceIdParam??null),T=b.useMemo(()=>_?.spans,[_?.spans]),{data:j,isLoading:N}=FS(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ce=>ce.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=Aht(),{data:B=[],isPending:D}=Iht({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:$=[],isPending:U}=Rht(),{data:z=[],isPending:H}=Pht(),Q=b.useMemo(()=>ezr({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(()=>szr({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}=WFr({filters:L}),ae=b.useMemo(()=>Z?.spans??[],[Z?.spans]),te=Z?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=Mht(T,s.spanIdParam??null,ce=>s.handleSpanChange(ce)),fe=dzr(e,t),X=b.useCallback(()=>s.applyFilterTokens(azr(Q,s.filterTokens)),[Q,s]),{handlePreviousTrace:se,handleNextTrace:le}=izr(ae,s.traceIdParam,s.handleTraceClick),xe=b.useCallback(()=>{const ce=T?.find(ve=>ve.parentSpanId==null);ce&&(s.handleSpanChange(ce.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(Jr,{title:"Traces",icon:o.jsx(xo,{}),children:o.jsx(Nht,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const ue=!!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(bn,{children:o.jsxs(bn.Title,{isLoading:V,children:[o.jsx(xo,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(uht,{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(hft,{fields:Q,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Cn,{disabled:V,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ce=>!ce),children:r?o.jsx(b3,{}):o.jsx(kVe,{})}),o.jsx(Cn,{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(NFr,{isLoading:V,filterFields:Q,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:fe.handleSave,onRemoveSaved:fe.hasSavedFilters?fe.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx($Fr,{traceCollapsed:u,listSlot:o.jsx(zFr,{traces:ae,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,filtersApplied:ue,featuredTraceId:s.traceIdParam,onTraceClick:ce=>s.handleTraceClick(s.traceIdParam===ce.traceId?"":ce.traceId),groupByThread:r,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(jht,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ce=>s.handleSpanChange(ce??null),onEvaluateTrace:xe,onSaveAsDatasetItem:ce=>h(ce),initialSpanId:s.spanIdParam,onPrevious:se,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:AB,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(Tht,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ce=>s.handleSpanTabChange(ce),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(J1t,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:k}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ce,traceId:ve,spanId:we})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Ave,{traceId:ve,isTopLevelSpan:!ce.parentSpanId,spanId:we,entityType:ce.attributes?.agentId||ce.entityType===Do.AGENT?"Agent":ce.attributes?.workflowId||ce.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:p,isLoadingScorers:m}),o.jsx(tOt,{scoresData:g,onPageChange:c,isLoadingScoresData:y,onScoreSelect:Ne=>s.handleScoreChange(Ne.id)})]})}):null,scorePanelSlot:I?o.jsx(xve,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(Ive,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>h(null)})]})}function AIn(){const{traceId:e}=na(),[t,r]=ao(),n=pu(),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}=Fme(e),_=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>_.find(re=>re.parentSpanId==null),[_]),{data:T,isLoading:j}=FS(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=hd(),{data:P,isLoading:R}=Sve({traceId:e,spanId:c??void 0,page:m}),[B,D]=b.useState(0);b.useEffect(()=>D(0),[e,c]);const{data:$,isLoading:U}=eOt({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[fe,X]of Object.entries(re))X===null||X===""?ie.delete(fe):ie.set(fe,X);r(ie,{replace:!0})},[t,r]),H=b.useCallback(re=>{const ie=re??null,fe=ie===c;u(ie),fe||(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}=Mht(_,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(me,{as:AB,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(Ep,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.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(Cn,{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(Cn,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(v3,{}),"Evaluate"]}),o.jsxs(Cn,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(xc,{}),"Save"]})]})]})})]}),E&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(_ht,{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(Nht,{error:k,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:te}),o.jsx(Ive,{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(jht,{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(Tht,{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(J1t,{feedbackData:$,onPageChange:D,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:fe})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Ave,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:fe,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(tOt,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(xve,{score:d,onClose:G})]})]})]})}function IIn(){const{data:e,isLoading:t,error:r}=p0(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(sa,{})}):r&&Os(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(vu,{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(gpn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(Di,{})," Workflows"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(Cg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(mpn,{workflows:e||{},isLoading:t,search:n})]})}const X8e=()=>{const{workflowId:e}=na(),{data:t,isLoading:r,error:n}=HP(e);return n&&Ps(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})}):n&&Os(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workflows"})}):o.jsx(Mwt,{workflowId:e,workflow:t??void 0,isLoading:r})};function RIn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(wdt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(xdt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(Sdt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(SU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(qre,{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(oc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(qre,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(SU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(SU,{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?RIn(s):t?o.jsx(AE,{className:"h-4 w-4 text-amber-400"}):o.jsx(oc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(px,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(TR,{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(dce,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(cce,{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 PIn(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 MIn({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(AE,{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 DIn({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(MIn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(me,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(NR,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(me,{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(fF,{className:"h-4 w-4"})}),l&&o.jsx(me,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(gF,{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(sA,{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:PIn(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(cd,{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(AE,{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(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(sA,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Wr,{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(Yr,{children:[o.jsx(Xr,{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(Wr,{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(sd,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx(Bt,{open:!!h,onOpenChange:w=>!f&&!w&&p(null),children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Item"}),o.jsxs(Bt.Description,{children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{disabled:f,children:"Cancel"}),o.jsxs(Bt.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 LIn(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 $In({content:e,language:t}){return o.jsx(ove,{language:t,style:lve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function FIn({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=LIn(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(ta,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(me,{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($In,{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 zIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),BIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(ZMt,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),UIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(sA,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),dre={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(x_,{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(MLt,{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 VIn({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(RE,{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(me,{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=dre[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>h(g),className:`
|
|
550
|
+
]`})]})]})}function nNn({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(Eh,{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 sNn({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}=cTn(),{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(rNn,{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(nNn,{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(tNn,{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(me,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(me,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(me,{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(me,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(Sn,{open:t,onOpenChange:_,children:o.jsxs(yn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(On,{children:[o.jsx(vn,{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(pf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function aNn({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(y_,{})," Created at ",e?.createdAt?tr(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Zx,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(Yr,{children:[o.jsx(Xr,{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(Wr,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(me,{disabled:!0,tabIndex:-1,children:[o.jsx(gx,{}),"Run Experiment"]})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(me,{onClick:l,children:[o.jsx(gx,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(me,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(wVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(uv,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(au,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(sd,{})," Delete Dataset"]})]})]})]})})]})}const U1t=e=>{const t=Ge(),{data:r}=kR(e),n=r?.experiments;return kt({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})},iNn=e=>{const t=Ge(),{data:r}=kR(e),n=r?.experiments;return kt({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 oNn(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 lNn=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 F8e({className:e,children:t,...r}){return o.jsx(cP,{children:o.jsx(yz,{className:Y(lNn,e),...r,children:t})})}function cNn({datasetId:e}){const t=Ge(),{data:r}=Pg(e),{data:n,isLoading:s}=U1t(e),{data:a,isLoading:i}=iNn(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]),fe=b.useMemo(()=>[...h].filter(ge=>ie.has(ge)).length,[h,ie]),X=te.length>0&&fe===te.length,se=fe>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]),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,ge])}},[U,h,M]),ce=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(Sn,{open:w,onOpenChange:S,children:o.jsxs(yn,{children:[o.jsxs(On,{children:[o.jsx(vn,{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(Mg,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Dg,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(pe,{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(bc,{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(pf,{children:[o.jsx(me,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(me,{onClick:K,disabled:!E||!j||y,children:[y?o.jsx(Dt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(Sn,{open:R,onOpenChange:B,children:o.jsxs(yn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(On,{children:[o.jsx(vn,{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(fi,{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(pe,{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(P1t,{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(pe,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ge.reason})]})]})},ge.itemId)})}),o.jsxs(pf,{children:[o.jsx(me,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(me,{onClick:oe,disabled:I.filter(ge=>ge.accepted).length===0,children:["Accept ",I.filter(ge=>ge.accepted).length," proposals"]})]})]})}),o.jsxs(af,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(mr,{children:[o.jsxs(mr.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(me,{variant:"outline",size:"md",children:[o.jsx(SVe,{}),"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(F8e,{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(F8e,{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(me,{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(R1t,{selectedCount:h.size,vocabulary:z,onApplyTag:ue,onRemoveTag:ce,onNewTag:ge=>ue(ge)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(me,{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(nS,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:we,children:[o.jsx(Ce,{size:"sm",children:o.jsx(sd,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Ne,children:[o.jsx(Ce,{size:"sm",children:o.jsx(x_,{})}),"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(pe,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(pe,{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(fi,{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(fi,{checked:h.has(ge.id),onCheckedChange:()=>le(ge.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ge.id}`})}),o.jsx(Se.NameCell,{children:oNn(ge.input,80)}),o.jsx(Se.Cell,{children:ge.comment?o.jsx(pe,{variant:"ui-xs",className:"text-neutral3 truncate",children:ge.comment}):o.jsx(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Se.Cell,{children:ge.tags.length>0?o.jsx(pe,{variant:"ui-xs",className:"text-neutral4 truncate",children:ge.tags.join(", ")}):o.jsx(pe,{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(mce,{})}),ge.rating==="negative"&&o.jsx(Ce,{size:"sm",className:"text-negative1",children:o.jsx(pce,{})}),!ge.rating&&o.jsx(pe,{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(pe,{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(pe,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ge.id)})})]})]}),Ae&&o.jsx(I1t,{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 uNn({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]=nur(Z,300),[W,G]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=Pg(e),{data:ie=[],total:fe,isLoading:X,setEndOfListElement:se,isFetchingNextPage:le,hasNextPage:xe}=CE(e,M||void 0,ae),{data:ue=[],total:ce,isLoading:ve}=CE(e,void 0,ae),[we,Ne]=b.useState({}),{data:K,isLoading:oe}=kR(e,void 0,we),{data:be}=kR(e),{deleteItems:Ae}=ni(),$e=K?.experiments??[],ye=be?.experiments??[],ke=CTn({hasSearchQuery:!!M,filteredItemsLength:ie.length,unfilteredItemsTotal:ce,itemsTotal:fe}),{data:ge}=U1t(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",an.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(aNn,{dataset:te,isLoading:re,onEditClick:r,onDuplicateClick:()=>U(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!ve&&ue.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(Nf,{defaultTab:"items",value:h,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(Af,{children:[o.jsxs(hs,{value:"items",children:["Items ",o.jsx(za,{color:"gray",children:ke})]}),o.jsxs(hs,{value:"experiments",children:["Experiments",o.jsx(za,{color:"gray",children:$e.length})]}),o.jsxs(hs,{value:"review",children:["Review",Ee>0&&o.jsx(za,{color:"orange",children:Ee})]})]}),o.jsx(Ns,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(eNn,{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(Ns,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(VTn,{experiments:$e,allExperiments:ye,isLoading:oe,datasetId:e,filters:we,onFiltersChange:Ne})}),o.jsx(Ns,{value:"review",className:"overflow-auto mt-0",children:o.jsx(cNn,{datasetId:e})})]})})]})})}),o.jsx(MTn,{datasetId:e,open:g,onOpenChange:y}),o.jsx(sNn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(wTn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(STn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(OTn,{open:$,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx(Bt,{open:P,onOpenChange:R,children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Items"}),o.jsxs(Bt.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:it,children:Ae.isPending?"Deleting...":"Delete"})]})]})})]})}function dNn(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 z8e({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 fNn({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=dNn(_);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(Sn,{open:t,onOpenChange:r,children:o.jsxs(yn,{className:"max-w-lg",children:[o.jsx(On,{children:o.jsx(vn,{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(z8e,{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(z8e,{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(me,{type:"button",onClick:y,children:"Cancel"}),o.jsx(me,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function hNn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=hd(),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($dt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const pNn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function mNn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Ag(),{data:l,isLoading:c}=p0(),{data:u,isLoading:d}=hd(),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(Kl,{options:pNn,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(Kl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function gNn({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});vc.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";vc.error(w)}},y=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(Sn,{open:r,onOpenChange:y,children:o.jsxs(yn,{ref:a,children:[o.jsxs(On,{children:[o.jsx(vn,{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(mNn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(hNn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(pf,{className:"px-6 pt-4",children:[o.jsx(me,{onClick:y,disabled:m,children:"Cancel"}),o.jsx(me,{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 V1t=e=>{const t=Ge();return kt({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},B8e=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function yNn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=lre(e?.input),d=lre(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(kC,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(me,{onClick:a,disabled:!e.traceId,children:[o.jsx(hce,{}),"Show Trace"]}),o.jsx(me,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(An,{})})]})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsxs(Ir.Column,{children:[o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(gx,{})," ",e.id]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(px,{})," ",e.itemId]})})]})}),c&&o.jsxs(yl,{variant:"destructive",children:[o.jsx(ADt,{}),o.jsxs(yl.Message,{children:[o.jsx("strong",{children:"Error: "}),lre(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:B8e,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:B8e,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(PE,{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(px,{}),codeStr:u}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Yd,{}),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(y_,{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 lre(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function vNn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Input",icon:o.jsx(mx,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Yd,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Metadata",icon:o.jsx(_h,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Vt.CodeSection,{title:"Attributes",icon:o.jsx(_h,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function bNn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=FS(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(kC,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(me,{onClick:s,"aria-label":"Close span details",children:o.jsx(An,{})})]}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(_h,{})," Span ",sf(t)]})})}),o.jsx(vNn,{span:i})]})]})}const xNn=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 q1t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...q1t(r))}),t}const U8e=["agent","workflow","model","mcp","tool","workspace","other"];function H1t(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(ga,{}),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(Am,{}),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(bl,{}),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(H9,{}),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 wNn({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(V8e,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(dVe,{}):o.jsx(Gx,{}):o.jsx(as,{})]}),a>(l??0)&&!i&&o.jsxs(V8e,{onClick:()=>s?.(),children:[a," ",o.jsx(uVe,{})]})]}):null})}function V8e({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 SNn({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(pVe,{}):o.jsx(hVe,{})})})}function ONn({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(SNn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function Q1t({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=q1t(e),y=g.length,x=t===0,w=H1t(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(ONn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(wNn,{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(Q1t,{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 kNn({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(Q1t,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function _Nn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=U8e.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!U8e.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=srt(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(Tx,{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(gft,{children:[c.map(h=>{const p=H1t(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(me,{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(me,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ce,{children:o.jsx(dF,{})}),"Other"]}),o.jsx(me,{onClick:n,disabled:t?.length===0,children:o.jsx(Ce,{children:o.jsx(An,{})})})]})]})}function ENn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=V1t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>xNn(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(mr.Toolbar,{children:o.jsx(me,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(An,{})})}),o.jsxs(mr.Content,{children:[o.jsx(Ir,{withMargins:!1,children:o.jsx(Ir.Column,{children:o.jsxs(Ir.Title,{size:"smaller",children:[o.jsx(xo,{})," Trace ",sf(e)]})})}),o.jsx(_Nn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(kNn,{hierarchicalSpans:g,onSpanClick:y,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function CNn({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(Yr,{children:[o.jsx(Xr,{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(Wr,{children:h?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(Se.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:TNn(jNn(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(pe,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function jNn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function TNn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function NNn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function ANn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=NNn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(mr.Toolbar,{children:[o.jsx(kC,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(me,{onClick:n,"aria-label":"Close score details",children:o.jsx(An,{})})]}),o.jsxs(mr.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(Nx,{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(px,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Vt.CodeSection,{title:"Output",icon:o.jsx(Yd,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Vt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(lc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(lc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(lc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Vt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(lc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const q8e=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function INn({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:q8e,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:q8e,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 W1t({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}=O1t(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}=V1t(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(Nf,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(Af,{children:[o.jsx(hs,{value:"summary",children:"Summary"}),o.jsx(hs,{value:"results",children:"Results"})]}),o.jsx(Ns,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(INn,{scoresByItemId:y,experimentStatus:t})}),o.jsx(Ns,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(af,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(mr,{children:o.jsx(CNn,{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(n5r,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(yNn,{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(mr,{withLeftSeparator:!0,children:o.jsx(ANn,{score:R,onNext:D(),onPrevious:$(),onClose:()=>m(null)})}),g&&u&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(ENn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(mr,{withLeftSeparator:!0,children:o.jsx(bNn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const RNn={pending:o.jsx(NE,{}),running:o.jsx(x3,{}),completed:o.jsx(ra,{}),failed:o.jsx(An,{})};function PNn({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:RNn[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 G1t({experimentId:e,experiment:t}){const{Link:r,paths:n}=or(),{data:s}=Ag(),{data:a}=p0(),{data:i}=hd(),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(gVe,{}),e," ",e&&o.jsx(ta,{content:e})]}),o.jsxs(Ir.Description,{children:[o.jsxs(Zn,{children:[o.jsx(y_,{})," Created at ",tr(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(Zn,{children:[o.jsx(y_,{})," 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(s2t,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(Zn,{children:[o.jsx(hF,{})," 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(ta,{content:t.agentVersion})]})]})]}),o.jsx(Ir.Column,{children:o.jsx(PNn,{experiment:t})})]})}function Lve({delta:e}){const t=e>0?o.jsx(za,{size:"small",color:"green",intensity:"muted",children:o.jsx(lce,{})}):e<0?o.jsx(za,{size:"small",color:"red",intensity:"muted",children:o.jsx(oVe,{})}):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 qL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function MNn({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(mr,{withLeftSeparator:!0,children:[o.jsxs(mr.Toolbar,{children:[o.jsx(kC,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(me,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(An,{})})})]}),o.jsxs(mr.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(px,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(Nx,{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(Lve,{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(Yd,{}),codeStr:qL(c?.output)}),o.jsx(Vt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(za,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(Yd,{}),codeStr:qL(u?.output)}),o.jsx(Vt.CodeSection,{title:"Item Input",icon:o.jsx(mx,{}),codeStr:qL(e.input)}),o.jsx(Vt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(PVe,{}),codeStr:qL(e.groundTruth)})]})}):o.jsxs(yl,{variant:"warning",children:[o.jsx(Eh,{}),o.jsx(yl.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. Comparison is not available."]})})()})]})]})]})}function DNn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(mr,{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(Lve,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const LNn={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 H8e({datasetId:e,experiment:t,type:r}){const{Link:n}=or(),{label:s,color:a,customStyle:i}=LNn[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(zw,{})]}),o.jsx(me,{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(Ep,{})," ",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(PVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(Zn,{children:[o.jsx(OVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(Zn,{children:[o.jsx(lVe,{})," ",tr(l,"MMM d, yyyy HH:mm")]})]})]})}function $Nn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=Jjn(e,t,r),{data:u}=K6(e,t),{data:d}=K6(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.jsxs(yl,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(yl.Column,{children:[o.jsx(yl.Title,{children:"Error loading comparison"}),o.jsx(yl.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(H8e,{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(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(me,{onClick:n,children:"VS"})}),o.jsx(Wr,{children:"Switch the order"})]})})}),o.jsx(H8e,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsxs(yl,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(yl.Message,{children:[o.jsx("strong",{children:"Version mismatch!"})," 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(gRe,{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(gRe,{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(Lve,{delta:I}):"-"})]},T))})})]}),o.jsxs(af,{className:Y({"grid-cols-[1fr_2fr]":!!y}),children:[o.jsx(DNn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!y&&o.jsx(MNn,{item:y,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function FNn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=Dve(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(mr,{className:"min-w-56",children:[l?o.jsx(mr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(me,{onClick:m,children:"Cancel"}),o.jsx(Cn,{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(mr.Toolbar,{children:o.jsxs(me,{onClick:g,className:"w-full",children:[o.jsx(Hm,{})," Compare Ver."]})})}),i?o.jsx(zNn,{}):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(fi,{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 zNn(){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 BNn(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 UNn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=Pve(e),a=(s??[]).map(i=>({value:String(i.version),label:`${BNn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(mr.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 VNn=[{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"}],qNn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(us,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(IVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(m2t,{}),tooltip:"Same in both versions"}};function cre({red:e=!1,tooltip:t}){return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(GPt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Wr,{children:t})]})}function nw({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}=qNn[e];return o.jsxs(Yr,{children:[o.jsx(Xr,{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(Wr,{children:s})]})}function HNn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function QNn({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=HNn(u,d);return o.jsxs(Pt.Row,{columns:VNn,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(nw,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(nw,{variant:"changed",version:u.datasetVersion}):o.jsx(nw,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(cre,{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(nw,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(nw,{variant:"changed",version:d.datasetVersion}):o.jsx(nw,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(cre,{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(nw,{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(cre,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const Q8e={needsReview:"#facc15",complete:"#22c55e"},WNn=[{label:"Needs Review",color:Q8e.needsReview},{label:"Reviewed",color:Q8e.complete}];function GNn({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(Qt,{children:[o.jsxs(Qt.TopBar,{children:[o.jsx(Qt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Qt.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Qt.Loading,{}):s?o.jsx(Qt.Error,{message:"Failed to load review data"}):o.jsx(Qt.Content,{children:c?o.jsx(rE,{data:a,segments:WNn,maxVal:i,fmt:u=>String(u)}):o.jsx(Qt.NoData,{message:"No items have been sent to review yet"})})]})}function $ve(){const e=Ge();return kt({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function Z1t(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 ZNn(e,t){const r=new Map,n=Z1t(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 YNn(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 XNn=10;function KNn(){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}=Uh({page:d,perPage:XNn}),{data:g,isLoading:y,error:x}=o8(),{data:w}=$ve(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>yTn(S),[S]),T=b.useMemo(()=>ZNn(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(sa,{})});if(N&&Os(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(vu,{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(vTn,{onCreateClick:I})}),o.jsx($le,{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(bn,{children:o.jsxs(bn.Title,{isLoading:j,children:[o.jsx(Na,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(us,{})}),o.jsx(Cn,{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(xTn,{search:r,onSearchChange:B,targetFilter:s,onTargetFilterChange:D,experimentFilter:i,onExperimentFilterChange:$,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:H,hasActiveFilters:z})]}),o.jsx(pTn,{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($le,{open:e,onOpenChange:t})]})}const JNn=new Set(["items","experiments","review"]);function eAn(){const{datasetId:e}=na(),t=pu(),[r,n]=ao(),s=r.get("tab"),a=s&&JNn.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}=Pg(e??"");if(!e)return o.jsx(zr,{children:o.jsx(mf,{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(sa,{})})});if(w&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(ETn,{value:e,variant:"ghost"})})]})}),o.jsxs(mf,{className:"content-stretch",children:[o.jsx(uNn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(me,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(gx,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(gNn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(fNn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(kTn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(_Tn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function tAn(){const{datasetId:e,experimentId:t}=na(),{data:r}=Pg(e??""),{data:n,isLoading:s,error:a}=K6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=i8({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(sa,{})})}):a&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,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(G1t,{experimentId:t,experiment:n}),o.jsx(W1t,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function rAn(){const{datasetId:e}=na(),[t,r]=ao(),{data:n,error:s}=Pg(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(sa,{})})}):s&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,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(Hm,{})}),"Compare Experiments"]})]})}),o.jsx(mf,{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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(Hm,{})}),"Experiments Comparison"]})]})}),o.jsx(mf,{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(Hm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ir.Description,{children:["Comparing"," ",o.jsx(dr,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(dr,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(Ir.Column,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Ep,{}),"Back to Dataset"]})})]}),o.jsx($Nn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function nAn(){const{datasetId:e,itemId:t}=na(),{Link:r}=or(),n=pu(),{data:s,isLoading:a,error:i}=Dve(e??"",t??""),{updateItem:l,deleteItem:c}=ni(),{data:u}=Pg(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(sa,{})})}):i&&Os(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(mf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,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(px,{}),t," ",o.jsx(ta,{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(y_,{})," Created at"," ",d?.createdAt?tr(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(Zn,{children:[o.jsx(Zx,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ir.Column,{children:!y&&!f&&o.jsxs(ps,{children:[o.jsxs(me,{onClick:$,disabled:D,title:D?"Return to latest version to edit":void 0,children:[o.jsx(IVe,{})," Edit"]}),o.jsxs(me,{onClick:U,disabled:D,title:D?"Return to latest version to delete":void 0,children:[o.jsx(sd,{})," Delete"]})]})})]}),o.jsxs(af,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(mr,{withRightSeparator:!y,children:[f&&d&&o.jsxs(yl,{variant:"destructive",children:[o.jsx(Eh,{}),o.jsxs(yl.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&D&&h&&o.jsx(o.Fragment,{children:o.jsxs(yl,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(yl.Message,{children:["Viewing version v",h.datasetVersion]}),o.jsxs(yl.Button,{onClick:B,children:[o.jsx(gw,{})," Return to the latest version"]})]})}),y?o.jsx(z1t,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:l.isPending}):Z?o.jsx(l8,{item:Z,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&o.jsx(mr,{children:o.jsx(FNn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{n(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:h?.datasetVersion??null})})]})]})})]}),o.jsx(Bt,{open:I,onOpenChange:P,children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Item"}),o.jsx(Bt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:Q,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function W8e(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function sAn(){const{datasetId:e}=na(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Pg(e??""),{Link:i}=or(),[l,c]=b.useState(!1),{data:u}=Mle(e??"",n[0]??""),{data:d}=Mle(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(sa,{})})}):a&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(mf,{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(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(Ep,{})}),"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(Hm,{}),"Compare Dataset Items"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",n.length," items of"," ",o.jsx(dr,{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(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Ep,{}),"Back to Dataset"]}),o.jsx(me,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(xVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(o2t,{})," Diff View"]})})]})})]}),o.jsx(af,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(aAn,{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(Bft,{codeA:W8e(u),codeB:W8e(d)})]})})]})}function aAn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Mle(e,t),{data:u}=CE(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(mr,{children:[o.jsxs(mr.Toolbar,{className:"flex gap-4",children:[o.jsx(lge,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(me,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Zx,{}),"Versions"]})]}),i&&o.jsx(mr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(B1t,{item:l}),o.jsx(l8,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function G8e(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function iAn(){const{datasetId:e,itemId:t}=na(),[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}=Pg(e??""),{Link:u}=or(),{data:d}=Dve(e??"",t??""),{data:f}=zle(e??"",t??"",i[0]??0,l?.version),{data:h}=zle(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(sa,{})})}):c&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(mf,{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(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:l?.name}),o.jsx(jr,{as:dr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ce,{children:o.jsx(Ep,{})}),"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(Hm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:["Comparing ",i.length," versions of"," ",o.jsx(dr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ir.Column,{children:o.jsxs(ps,{children:[o.jsxs(me,{as:dr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Ep,{}),"Back to Item"]}),o.jsx(me,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(xVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(q2t,{})," Diff View"]})})]})})]}),o.jsx(af,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(oAn,{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(Bft,{codeA:G8e(f),codeB:G8e(h)})]})})]})}function oAn({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}=zle(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(mr,{children:[o.jsxs(mr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Zx,{className:"w-6 h-6 opacity-50"}),o.jsx(lge,{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(mr.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(l8,{item:m,Link:i})})]})}function lAn(){const{datasetId:e}=na(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=pu(),{data:s,error:a}=Pg(e??""),i=CE(e??"",void 0,r[0]??null),l=CE(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(sa,{})})});if(a&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(mf,{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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/datasets",children:[o.jsx(Ce,{children:o.jsx(Na,{})}),"Datasets"]}),o.jsx(jr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(jr,{isCurrent:!0,as:"span",children:[o.jsx(Ce,{children:o.jsx(xSe,{})}),"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(xSe,{})," Compare Dataset Versions"]}),o.jsx(Ir.Description,{children:o.jsxs(Zn,{children:[o.jsx(Zx,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ir.Column,{children:o.jsxs(me,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Ep,{}),"Back to Dataset"]})})]}),o.jsx(af,{children:o.jsxs(mr,{children:[o.jsx(UNn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(QNn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function cAn(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 uAn({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=cAn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Scorers"}),i?o.jsx(_n.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(f)}),o.jsx(_n.NoChange,{message:"Static count"})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Datasets"}),l?o.jsx(_n.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(h)}),o.jsx(_n.NoChange,{message:"Static count"})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Avg Score"}),u?o.jsx(_n.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(n)}),m?o.jsx(_n.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(_n.NoChange,{})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Total Experiments"}),c?o.jsx(_n.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(p)}),g?o.jsx(_n.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(_n.NoChange,{})]}):o.jsx(_n.NoData,{})]}),o.jsxs(_n,{children:[o.jsx(_n.Label,{children:"Needs Review"}),d?o.jsx(_n.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(_n.Value,{children:String(a)}),a>0?o.jsx(_n.NoChange,{message:"items pending review"}):o.jsx(_n.NoChange,{message:"All caught up"})]}):o.jsx(_n.NoData,{})]})]})}const dAn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],Z8e="auto 1fr auto auto auto auto auto auto auto";function fAn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const hAn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function pAn({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(wh,{columns:Z8e}):o.jsxs(Se,{columns:Z8e,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(BP,{variant:hAn[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:fAn(h.createdAt)})]},h.id)})]})}function mAn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const HL={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},gAn=[{label:"Completed",color:HL.completed},{label:"Running",color:HL.running},{label:"Pending",color:HL.pending},{label:"Failed",color:HL.failed}];function yAn({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(Qt,{children:[o.jsxs(Qt.TopBar,{children:[o.jsx(Qt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Qt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Qt.Loading,{}):n?o.jsx(Qt.Error,{message:"Failed to load experiments data"}):o.jsx(Qt.Content,{children:i?o.jsx(rE,{data:s,segments:gAn,maxVal:a,fmt:l=>String(l)}):o.jsx(Qt.NoData,{message:"No experiments have been run yet"})})]})}const vAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(ba,{})]})})})});function bAn({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(Cg,{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:[...dAn],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(me,{onClick:l,size:"sm",variant:"light",children:[o.jsx(An,{className:"size-3"})," Reset"]})]})]})}function xAn(){const{data:e,isLoading:t,error:r}=hd(),{data:n,isLoading:s,error:a}=Uh(),{data:i,isLoading:l,error:c}=o8(),{data:u,isLoading:d,isError:f,error:h}=_On(),{data:p,isLoading:m,isError:g,error:y}=$ve(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>YNn(p),[p]),k=r||a||c||h||y;return k&&Ps(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(sa,{})}):k&&Os(k)?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(Zs,{resource:"evaluation"})}):k?o.jsx(Jr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(vu,{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(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(Ru,{})," Evaluation"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(bie,{children:o.jsx(uAn,{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(pOn,{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(bTn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(yAn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(GNn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function wAn(){const[e,t]=b.useState(""),[r,n]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=Uh(),{data:u,isLoading:d,error:f}=o8(),{data:h}=$ve(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>mAn(p),[p]),y=b.useMemo(()=>Z1t(h),[h]),x=l||d,w=f||c;if(w&&Ps(w))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(sa,{})});if(f&&Os(f))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Zs,{resource:"experiments"})});if(c&&Os(c))return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Zs,{resource:"datasets"})});if(w)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(vu,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(Jr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(vAn,{})});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(bn,{children:o.jsxs(bn.Title,{isLoading:x,children:[o.jsx(Ru,{})," Experiments"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(bAn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(pAn,{experiments:m,datasets:p,reviewByExperiment:y,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function SAn(){const{experimentId:e}=na(),{data:t,isLoading:r}=o8(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=K6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=i8({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(sa,{})})}):l&&Os(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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/experiments",children:[o.jsx(Ce,{children:o.jsx(Ru,{})}),"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(G1t,{experimentId:e,experiment:a}),o.jsx(W1t,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h})]})})]}):null}function Y1t({redirectUri:e,onSuccess:t,initialMode:r="signin",errorMessage:n}){const{data:s,isLoading:a}=_C(),{mutate:i,isPending:l,error:c}=jjn(),{mutate:u,isPending:d,error:f}=Tjn(),{mutate:h,isPending:p}=L1t(),[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(rx,{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(_Ve,{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(me,{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(me,{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 OAn(){const[e]=ao(),t=pu(),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(Y1t,{redirectUri:r,onSuccess:i,initialMode:s,errorMessage:a})}function kAn(){const[e,t]=ao(),r=Dzr(e,t),n=Fzr(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=Aht(),{data:d=[],isPending:f}=Iht({entityType:r.selectedEntityOption?.entityType,rootOnly:!0}),{data:h=[],isPending:p}=Rht(),{data:m=[],isPending:g}=Pht(),y=b.useMemo(()=>Tzr({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(()=>Rzr({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}=Ozr({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=Uzr(w,r.featuredLogId,r.handleFeaturedChange,r.featuredTraceId),{data:B,isLoading:D}=Fme(r.featuredTraceId??null),{data:$,isLoading:U}=FS(r.featuredTraceId??"",r.featuredSpanId??""),z=b.useCallback(()=>r.applyFilterTokens(Pzr(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(e$,{}),children:o.jsx(pzr,{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(e$,{}),children:o.jsx(bzr,{})}):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(bn,{children:o.jsxs(bn.Title,{isLoading:S,children:[o.jsx(e$,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(uht,{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(hft,{fields:y,tokens:r.filterTokens,onTokensChange:r.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Cn,{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(yzr,{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(mzr,{logCollapsed:i,listSlot:o.jsx(gzr,{logs:w,isLoading:S,isFetchingNextPage:_,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:r.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(hzr,{log:N,onClose:H,onTraceClick:Q,onSpanClick:L,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:r.featuredTraceId?o.jsx(LFr,{traceId:r.featuredTraceId,spans:B?.spans,isLoading:D,onClose:Z,onSpanSelect:M,selectedSpanId:r.featuredSpanId}):null,spanPanelSlot:r.featuredTraceId&&r.featuredSpanId?o.jsx(DFr,{spanId:r.featuredSpanId,span:$?.span,isLoading:U,onClose:V}):null})]})}const X1t=e=>{const t=Ge();return kt({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 _An({server:e}){const{paths:t,Link:r}=or(),s=Ge().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=X1t(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=Ih(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 EAn({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(wh,{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(ga,{}),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(_An,{server:s},s.id))]})}const CAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(ba,{})]})})}),jAn=()=>{const{data:e=[],isLoading:t,error:r}=mM(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(bl,{}),children:o.jsx(sa,{})}):r&&Os(r)?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(bl,{}),children:o.jsx(Zs,{resource:"MCP servers"})}):r?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(bl,{}),children:o.jsx(vu,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(Jr,{title:"MCP Servers",icon:o.jsx(bl,{}),children:o.jsx(CAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(bl,{})," MCP Servers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(Cg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(EAn,{mcpServers:e,isLoading:t,search:n})]})},TAn=(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 NAn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=or(),i=b.useMemo(()=>TAn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(wh,{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(ga,{}),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=Ih(c.id,50),d=Ih(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 AAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(ba,{})]})})}),IAn=()=>{const e=Ge();return Kr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new g_;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}}})},RAn=({toolId:e})=>{const{canExecute:t}=Cv(),r=t("tools"),{data:n={}}=Ag(),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}=Ykn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=IAn(),{requestContext:h}=ks();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?hg(ug(sv(c?.inputSchema))):Gn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(kve,{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(pe,{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(pe,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function PAn({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="inputLike"}){const{data:c={},isLoading:u,isError:d,error:f}=s8(),{data:h={},isLoading:p,isError:m,error:g}=Ag(),{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(Kl,{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 MAn=({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(mf,{children:o.jsx(pe,{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(mf,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(pe,{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(H9,{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(pe,{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(pe,{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(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{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(pe,{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(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{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(pe,{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(pe,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(ta,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(DAn,{server:t})})]})},DAn=({server:e})=>{const{data:t={},isLoading:r}=X1t(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(bl,{})}),o.jsx(pe,{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(LAn,{tool:a,serverId:e.id},s)})})]})},LAn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=or(),a=zSt[e.toolType||"tool"];return o.jsxs(_f,{onClick:()=>r.current?.click(),children:[o.jsx(Tdt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(jf,{children:[o.jsx(Ef,{children:o.jsx(n,{ref:r,href:s.mcpServerToolLink(t,e.id),children:e.id})}),o.jsx(Cf,{children:e.description})]})]})},$An=()=>{const{serverId:e}=na(),{data:t=[],isLoading:r}=mM(),n=t.find(s=>s.id===e);return o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(bl,{})}),"MCP Servers"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(r1t,{value:e,variant:"ghost"})})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(h0,{}),"MCP documentation"]})})]}),o.jsx(MAn,{isLoading:r,server:n})]})},K1t=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return kt({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},FAn=(e,t)=>{const{requestContext:r}=ks(),n=Ge();return Kr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},zAn=({toolId:e,serverId:t})=>{const{canExecute:r}=Cv(),n=r("tools"),{data:s,isLoading:a,error:i}=K1t(t,e),{mutateAsync:l,isPending:c,data:u}=FAn(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(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{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(pe,{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(pe,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=hg(ug(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Gn({})}return o.jsx(kve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},BAn=()=>{const{data:e}=mM(),{serverId:t,toolId:r}=na(),{data:n,isLoading:s}=K1t(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(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/mcps",children:[o.jsx(Ce,{children:o.jsx(bl,{})}),"MCP Servers"]}),o.jsx(jr,{as:dr,to:`/mcps/${t}`,children:l}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(h0,{}),"MCP documentation"]})})]}),o.jsx(zAn,{toolId:r,serverId:t})]})};function UAn(){const{data:e,isLoading:t,isError:r}=yFr();return o.jsx(iFr,{data:e,isLoading:t,isError:r})}function VAn(){const{data:e,isLoading:t,isError:r}=Oht();return o.jsx(tB,{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 qAn(){const{data:e,isLoading:t,isError:r}=pFr();return o.jsx(tB,{label:"Total Model Cost",value:e?.cost!=null?Ww(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Ww(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:r})}function HAn(){const{data:e,isLoading:t,isError:r}=mFr();return o.jsx(tB,{label:"Total Tokens",value:e?.value!=null?zm(e.value):null,prevValue:e?.previousValue!=null?zm(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function QAn(){const{data:e,isLoading:t,isError:r}=hFr();return o.jsx(tB,{label:"Avg Score",value:e?.value!=null?String(e.value):null,prevValue:e?.previousValue!=null?String(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:r})}function WAn(){const{data:e,isLoading:t,isError:r}=gFr();return o.jsx(oFr,{rows:e,isLoading:t,isError:r})}function GAn(){const{data:e,isLoading:t,isError:r}=bFr();return o.jsx(lFr,{data:e,isLoading:t,isError:r})}function ZAn(){const{data:e,isLoading:t,isError:r}=xFr();return o.jsx(uFr,{data:e,isLoading:t,isError:r})}function YAn(){const{data:e,isLoading:t,isError:r}=vFr();return o.jsx(dFr,{data:e,isLoading:t,isError:r})}const XAn=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),ure="period";function KAn(){const[e,t]=ao(),r=e.get(ure),n=xht(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(ure):l.set(ure,a),l},{replace:!0})},[t]);return o.jsx(nFr,{initialPreset:n,onPresetChange:s,children:o.jsx(JAn,{})})}function JAn(){const{error:e}=Oht(),{data:t,isLoading:r}=YB(),n=t?.observabilityStorageType,s=n?XAn.has(n):!1,a=n==="ObservabilityInMemory";return e&&Ps(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(ok,{}),children:o.jsx(sa,{})}):e&&Os(e)?o.jsx(Jr,{title:"Metrics",icon:o.jsx(ok,{}),children:o.jsx(Zs,{resource:"metrics"})}):e?o.jsx(Jr,{title:"Metrics",icon:o.jsx(ok,{}),children:o.jsx(vu,{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(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(ok,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(sFr,{}),o.jsx(Cn,{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.jsxs(pl,{variant:"info",children:[o.jsx(ml,{children:"Metrics are not persisted"}),o.jsx(Xc,{as:"p",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(bie,{children:[o.jsx(VAn,{}),o.jsx(qAn,{}),o.jsx(HAn,{}),o.jsx(QAn,{})]}),o.jsxs(bie,{children:[o.jsx(WAn,{}),o.jsx(ZAn,{}),o.jsx(GAn,{}),o.jsx(YAn,{}),o.jsx(UAn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(ba,{})]})})})]})}const eIn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:ok,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:xo,href:"/observability"}];function tIn(){return o.jsxs(vk,{children:[o.jsx(vk.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:eIn.map(e=>o.jsxs(dr,{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 rIn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:ga,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:sS,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:bl,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:oc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:IE,href:"/request-context"}];function nIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(X2t,{})," 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:rIn.map(e=>o.jsxs(dr,{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 sIn(){const{paths:e}=or(),{data:t,isLoading:r,error:n}=QSt(),{isCmsAvailable:s}=pM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ps(n)?o.jsx(Jr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(sa,{})}):n&&Os(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(vu,{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(zkn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:r,children:[o.jsx(Yi,{})," Prompts"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{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(me,{as:dr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(us,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Cg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(Fkn,{promptBlocks:l,isLoading:r,search:a})]})}function aIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(IE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(n1n,{children:o.jsx(kSt,{})})})]})}const iIn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:f2t,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:ba,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:aA,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:bVe,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:iMt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function oIn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.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:iIn.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(ba,{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 lIn(){const{data:e={},isLoading:t,error:r}=hd(),[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(sa,{})});if(r&&Os(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(vu,{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(gOn,{})});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(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(La,{})," Scorers"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(vOn,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(mOn,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function cIn(){const{scorerId:e}=na(),[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}=fOn(e),{data:f={},isLoading:h,error:p}=Ag(),{isLoading:m,error:g}=p0(),{data:y=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=dOn({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&&Os(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:dr,to:"/scorers",children:"Scorers"}),o.jsx(hOn,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(bn,{children:[o.jsxs(bn.Title,{isLoading:u,children:[o.jsx(La,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(bn.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Cn,{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(me,{variant:"light",as:dr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(uv,{})," 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(sa,{}):D?o.jsx(Zs,{resource:"scorers"}):$?o.jsx(vu,{title:"Failed to load scorer",message:L}):o.jsx(sOn,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(oOn,{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(nOn,{scores:y,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const uIn=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],dIn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=hve(),{theme:n,setTheme:s}=bC();return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{children:[o.jsx(vme,{})," 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(_ft,{name:"theme",label:"Theme mode",value:n,onValueChange:a=>s(a),options:uIn.map(a=>({...a}))})]})}),o.jsx(CSt,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r}})]})]})};function fIn(){const[e]=ao(),t=pu(),r=e.get("redirect")||"/",n=()=>{r.startsWith("http")?window.location.href=r:t(r,{replace:!0})};return o.jsx(Y1t,{redirectUri:r,onSuccess:n,initialMode:"signup"})}function hIn(e){return e.replace(/\/$/,"").split("/").pop()}function c8({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 pIn({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(ga,{})," ",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(jVe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(yF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(bl,{})," ",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(bdt,{})," ",hIn(a.githubUrl)]})})]},a.slug)})})}function mIn({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(Tx,{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(me,{onClick:c,children:["Reset ",o.jsx(An,{})]})]})}function gIn(){const{data:e,isLoading:t}=Yzr(),{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(En,{children:o.jsxs(Yu,{children:[o.jsx(Ce,{children:o.jsx(Hb,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(mIn,{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(pIn,{templates:y,linkComponent:dr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const yIn="1.29.1";function vIn({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(Eh,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(F2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(c8,{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 bIn({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(c8,{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(TVe,{})]}),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(jx,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(jx,{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(_St,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(me,{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(zw,{})]})})]})})}function xIn({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(Hb,{}),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(qy,{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(hF,{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(bdt,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(_1,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function wIn({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(c8,{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(X3r,{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(RDt,{}),i||"Something went wrong"]}),c&&o.jsx(Y3r,{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 SIn({name:e,installedEntities:t}){return o.jsxs(c8,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(TVe,{}),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(_1,{data:t})]})}function OIn(){const{templateSlug:e}=na(),[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}=Xzr({repoOrSlug:e,owner:"mastra-ai"}),R=yIn?.includes("beta")??!1?"beta":"main",{data:B,isLoading:D}=Kzr({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:$,isLoading:U}=Jzr(),{mutateAsync:z,isPending:H}=e9r(),{mutateAsync:Q}=t9r(),{streamInstall:L,streamResult:Z,isStreaming:V}=n9r($),{observeInstall:M,streamResult:W,isStreaming:G}=s9r($);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:ce,errors:ve}=xe.result.validationResults,we=`Template installation completed but ${ce} validation issue${ce>1?"s":""} remain unresolved.`;m(we),j(ve||[])}else{const ce=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof ce=="string"?ce:String(ce))}}).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(ue=>{if(ue.snapshot?.status==="running")return M.mutateAsync({runId:se})}).then(()=>{r(ue=>{const ce=new URLSearchParams(ue);return ce.delete("resume"),ce})}).catch(ue=>{console.error("❌ Failed to resume template installation:",ue),ue.message?.includes("404")||ue.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(ue){console.error("❌ Auto-resume failed with error:",ue),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(ga,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(se=>se).join(", "):"n/a",icon:o.jsx(yF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Am,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(PE,{})}],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"}),fe=async()=>{const se=Object.entries(u).reduce((le,[xe,ue])=>(ue===""&&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:ue}=await z({});w(ue),r(ce=>{const ve=new URLSearchParams(ce);return ve.set("runId",ue),ve.set("resume","true"),ve.set("provider",n||"openai"),ve}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:ue})}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(ue=>[...ue,le]):h(ue=>ue.filter(ce=>ce!==le)),d(ue=>({...ue,[le]:xe}))};return o.jsxs(zr,{children:[o.jsx(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/templates",children:[o.jsx(Ce,{children:o.jsx(Hb,{})}),"Templates"]}),o.jsx(jr,{as:dr,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(xIn,{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(wIn,{name:N.title,streamResult:G?W:Z,runId:x,workflowInfo:$}),g&&o.jsx(SIn,{name:N.title,installedEntities:te,linkComponent:dr}),p&&o.jsx(vIn,{errorMsg:p,validationErrors:T.length>0?T:Z?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!p&&o.jsx(bIn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:fe,handleVariableChange:X,isLoadingEnvVars:D||U,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const kIn=()=>{const{toolId:e,agentId:t}=na();return o.jsxs(zr,{children:[o.jsxs(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ga,{})}),"Agents"]}),o.jsx(jr,{as:dr,to:`/agents/${t}/chat`,children:t}),o.jsx(jr,{as:dr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(h0,{})}),"Tools documentation"]})})]}),o.jsx(HOn,{toolId:e,agentId:t})]})},_In=()=>{const{toolId:e}=na();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/tools",children:[o.jsx(Ce,{children:o.jsx(Mi,{})}),"Tools"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(PAn,{value:e,variant:"ghost"})})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(h0,{}),"Tools documentation"]})})]}),o.jsx(RAn,{toolId:e})]})};function EIn(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 CIn({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(aA,{})," 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(aA,{})," Feedback"]}),e?.traceId&&o.jsxs(Zn,{children:[o.jsx(b_,{})," ",e.traceId]})]}),o.jsxs(Nx,{children:[o.jsx(_1,{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?EIn(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(b_,{}),codeStr:a,simplified:!0})]})]})]})}const QL=[{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 jIn(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 TIn(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function J1t({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(Sft,{columns:QL});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(ha,{children:[o.jsxs(ha.Trim,{children:[o.jsx(ha.Header,{columns:QL}),l.length>0?o.jsx(ha.Entries,{children:l.map((h,p)=>{const m=new Date(h.timestamp),g=_g(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:jIn(h),comment:TIn(h)};return o.jsx(ha.Entry,{columns:QL,onClick:()=>c(p),entry:y,children:QL.map(x=>o.jsx(ha.EntryText,{children:String(y[x.name]??"")},`col-${x.name}`))},y.id)})}):o.jsx(ha.Message,{message:"No feedback found",type:"info"})]}),o.jsx(ha.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(CIn,{feedback:a,isOpen:n,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const eOt=({traceId:e="",page:t})=>{const r=Ge(),n=t??0;return kt({queryKey:["trace-feedback",e,n],queryFn:()=>r.listFeedback({filters:{traceId:e},pagination:{page:n,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})},Y8e="auto auto auto auto 1fr";function tOt({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(eB,{columns:Y8e}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Pc,{columns:Y8e,className:"min-w-0",children:[o.jsxs(Pc.Top,{children:[o.jsx(Pc.TopCell,{children:"ID"}),o.jsx(Pc.TopCell,{children:"Date"}),o.jsx(Pc.TopCell,{children:"Time"}),o.jsx(Pc.TopCell,{children:"Score"}),o.jsx(Pc.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=_g(a);return o.jsxs(Pc.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Pc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:sf(s?.id)||"n/a"}),o.jsx(Pc.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":tr(a,"MMM dd")}),o.jsx(Pc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:tr(a,"h:mm:ss aaa")}),o.jsx(Pc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Pc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Pc.NoMatch,{message:"No scores found"})]}),o.jsx(Pc.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>r?.((e?.pagination?.page||0)+1),onPrevPage:()=>r?.((e?.pagination?.page||0)-1)})]})}function NIn(){const[e,t]=ao(),[r,n]=b.useState(!1),s=lzr(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}=hd(),{data:g,isLoading:y}=Sve({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}=eOt({traceId:s.traceIdParam,page:x}),{data:_,isLoading:E}=Fme(s.traceIdParam??null),T=b.useMemo(()=>_?.spans,[_?.spans]),{data:j,isLoading:N}=FS(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ce=>ce.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=Aht(),{data:B=[],isPending:D}=Iht({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:$=[],isPending:U}=Rht(),{data:z=[],isPending:H}=Pht(),Q=b.useMemo(()=>ezr({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(()=>szr({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}=WFr({filters:L}),ae=b.useMemo(()=>Z?.spans??[],[Z?.spans]),te=Z?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=Mht(T,s.spanIdParam??null,ce=>s.handleSpanChange(ce)),fe=dzr(e,t),X=b.useCallback(()=>s.applyFilterTokens(azr(Q,s.filterTokens)),[Q,s]),{handlePreviousTrace:se,handleNextTrace:le}=izr(ae,s.traceIdParam,s.handleTraceClick),xe=b.useCallback(()=>{const ce=T?.find(ve=>ve.parentSpanId==null);ce&&(s.handleSpanChange(ce.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(Jr,{title:"Traces",icon:o.jsx(xo,{}),children:o.jsx(Nht,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const ue=!!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(bn,{children:o.jsxs(bn.Title,{isLoading:V,children:[o.jsx(xo,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(uht,{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(hft,{fields:Q,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Cn,{disabled:V,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ce=>!ce),children:r?o.jsx(b3,{}):o.jsx(kVe,{})}),o.jsx(Cn,{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(NFr,{isLoading:V,filterFields:Q,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:fe.handleSave,onRemoveSaved:fe.hasSavedFilters?fe.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx($Fr,{traceCollapsed:u,listSlot:o.jsx(zFr,{traces:ae,isLoading:V,isFetchingNextPage:M,hasNextPage:W,setEndOfListElement:G,filtersApplied:ue,featuredTraceId:s.traceIdParam,onTraceClick:ce=>s.handleTraceClick(s.traceIdParam===ce.traceId?"":ce.traceId),groupByThread:r,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(jht,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ce=>s.handleSpanChange(ce??null),onEvaluateTrace:xe,onSaveAsDatasetItem:ce=>h(ce),initialSpanId:s.spanIdParam,onPrevious:se,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:AB,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(Tht,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ce=>s.handleSpanTabChange(ce),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(J1t,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:k}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ce,traceId:ve,spanId:we})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Ave,{traceId:ve,isTopLevelSpan:!ce.parentSpanId,spanId:we,entityType:ce.attributes?.agentId||ce.entityType===Do.AGENT?"Agent":ce.attributes?.workflowId||ce.entityType===Do.WORKFLOW_RUN?"Workflow":void 0,scorers:p,isLoadingScorers:m}),o.jsx(tOt,{scoresData:g,onPageChange:c,isLoadingScoresData:y,onScoreSelect:Ne=>s.handleScoreChange(Ne.id)})]})}):null,scorePanelSlot:I?o.jsx(xve,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(Ive,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>h(null)})]})}function AIn(){const{traceId:e}=na(),[t,r]=ao(),n=pu(),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}=Fme(e),_=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>_.find(re=>re.parentSpanId==null),[_]),{data:T,isLoading:j}=FS(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=hd(),{data:P,isLoading:R}=Sve({traceId:e,spanId:c??void 0,page:m}),[B,D]=b.useState(0);b.useEffect(()=>D(0),[e,c]);const{data:$,isLoading:U}=eOt({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[fe,X]of Object.entries(re))X===null||X===""?ie.delete(fe):ie.set(fe,X);r(ie,{replace:!0})},[t,r]),H=b.useCallback(re=>{const ie=re??null,fe=ie===c;u(ie),fe||(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}=Mht(_,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(me,{as:AB,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(Ep,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.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(Cn,{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(Cn,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(v3,{}),"Evaluate"]}),o.jsxs(Cn,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(xc,{}),"Save"]})]})]})})]}),E&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(_ht,{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(Nht,{error:k,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:te}),o.jsx(Ive,{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(jht,{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(Tht,{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(J1t,{feedbackData:$,onPageChange:D,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:fe})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(Ave,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:fe,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(tOt,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(xve,{score:d,onClose:G})]})]})]})}function IIn(){const{data:e,isLoading:t,error:r}=p0(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Workflows",icon:o.jsx(Di,{}),children:o.jsx(sa,{})}):r&&Os(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(vu,{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(gpn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(Di,{})," Workflows"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(Cg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(mpn,{workflows:e||{},isLoading:t,search:n})]})}const X8e=()=>{const{workflowId:e}=na(),{data:t,isLoading:r,error:n}=HP(e);return n&&Ps(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})}):n&&Os(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Zs,{resource:"workflows"})}):o.jsx(Mwt,{workflowId:e,workflow:t??void 0,isLoading:r})};function RIn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(wdt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(xdt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(Sdt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(SU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(qre,{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(oc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(qre,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(SU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(SU,{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?RIn(s):t?o.jsx(AE,{className:"h-4 w-4 text-amber-400"}):o.jsx(oc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(px,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(TR,{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(dce,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(cce,{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 PIn(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 MIn({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(AE,{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 DIn({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(MIn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(me,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(NR,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(me,{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(fF,{className:"h-4 w-4"})}),l&&o.jsx(me,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(gF,{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(sA,{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:PIn(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(cd,{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(AE,{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(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(sA,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Wr,{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(Yr,{children:[o.jsx(Xr,{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(Wr,{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(sd,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx(Bt,{open:!!h,onOpenChange:w=>!f&&!w&&p(null),children:o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Delete Item"}),o.jsxs(Bt.Description,{children:['Are you sure you want to delete "',h,'"? This action cannot be undone.']})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{disabled:f,children:"Cancel"}),o.jsxs(Bt.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 LIn(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 $In({content:e,language:t}){return o.jsx(ove,{language:t,style:lve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function FIn({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=LIn(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(ta,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(me,{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($In,{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 zIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),BIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(ZMt,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),UIn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(sA,{}),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(me,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(ba,{})]})})}),dre={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(x_,{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(MLt,{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 VIn({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(RE,{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(me,{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=dre[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 ${dre[r.mode].color}`,children:dre[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(AE,{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 HIn({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(RE,{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(me,{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(QIn,{result:f,onClick:()=>n?.(f)},`${f.skillName}-${f.source}-${h}`))})]})]})}function QIn({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(vC,{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 WIn({skillName:e,onUpdate:t,isUpdating:r}){return o.jsx(jn,{variant:"light",size:"sm",disabled:r,tooltip:`Update ${e}`,onClick:t,children:r?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(Rk,{className:"h-4 w-4"})})}function GIn({skillName:e,onRemove:t,isRemoving:r}){return o.jsxs(Bt,{children:[o.jsx(Bt.Trigger,{asChild:!0,children:o.jsx(jn,{variant:"light",size:"sm",disabled:r,tooltip:`Remove ${e}`,children:r?o.jsx(Aa,{className:"h-4 w-4 animate-spin"}):o.jsx(sd,{className:"h-4 w-4"})})}),o.jsxs(Bt.Content,{children:[o.jsxs(Bt.Header,{children:[o.jsx(Bt.Title,{children:"Remove Skill"}),o.jsxs(Bt.Description,{children:['Are you sure you want to remove the skill "',e,'"? This action cannot be undone.']})]}),o.jsxs(Bt.Footer,{children:[o.jsx(Bt.Cancel,{children:"Cancel"}),o.jsx(Bt.Action,{onClick:t,children:"Remove"})]})]})]})}const ZIn=".agents/skills/",Fve=[{name:"name",label:"Skill",size:"1fr"},{name:"description",label:"Description",size:"2fr"}],iOt=[...Fve,{name:"actions",label:"",size:"48px"}];function YIn(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 XIn({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(ZIn)??!1,m=e.some(p),g=!!l||!!i,y=g&&m,x=y?iOt:Fve;return!r&&!t?o.jsx(JIn,{onAddSkill:a}):t?o.jsx(KIn,{hasRowActions:g}):o.jsxs("div",{className:"space-y-4",children:[a&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(me,{variant:"default",size:"sm",onClick:a,children:[o.jsx(Ce,{children:o.jsx(us,{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(Eh,{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(ha,{children:o.jsxs(ha.Trim,{children:[o.jsx(ha.Header,{columns:x}),e.length>0?o.jsx(ha.Entries,{children:e.map(w=>{const S={id:w.path,name:w.name,description:w.description||"—"},k=h?YIn(w.path,d):null;return o.jsxs(ha.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(vC,{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(ha.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(WIn,{skillName:w.name,onUpdate:()=>i(w.name),isUpdating:c===w.name}),l&&o.jsx(GIn,{skillName:w.name,onRemove:()=>l(w.name),isRemoving:u===w.name})]})})]},w.path)})}):o.jsx(ha.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 KIn({hasRowActions:e}){const t=e?iOt:Fve;return o.jsx(ha,{children:o.jsxs(ha.Trim,{children:[o.jsx(ha.Header,{columns:t}),o.jsx(ha.Entries,{children:Array.from({length:3}).map((r,n)=>o.jsxs(ha.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 JIn({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(vC,{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(me,{size:"lg",variant:"default",onClick:e,children:[o.jsx(Ce,{children:o.jsx(us,{className:"h-4 w-4"})}),"Add Skill from skills.sh"]}),o.jsxs(me,{size:"lg",variant:"light",as:"a",href:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(YPt,{className:"h-4 w-4"})}),"Learn about Skills"]})]})]})})}function eRn(e){switch(e.type){case"external":return{icon:o.jsx(Hb,{className:"h-3.5 w-3.5"}),label:"External Package",path:e.packagePath};case"local":return{icon:o.jsx(nDt,{className:"h-3.5 w-3.5"}),label:"Local Project",path:e.projectPath};case"managed":return{icon:o.jsx(t$,{className:"h-3.5 w-3.5"}),label:"Managed",path:e.mastraPath}}}function tRn({skill:e,rawSkillMd:t,onReferenceClick:r}){const[n,s]=b.useState(new Set(["instructions"])),[a,i]=b.useState(!1),l=eRn(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(vC,{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(NT,{label:"Source",value:l.label,icon:l.icon}),o.jsx(NT,{label:"Path",value:e.path,icon:o.jsx(AE,{className:"h-3.5 w-3.5"})}),e.license&&o.jsx(NT,{label:"License",value:e.license}),e.compatibility!=null&&o.jsx(NT,{label:"Compatibility",value:e.compatibility}),o.jsx(NT,{label:"References",value:`${e.references.length} files`,icon:o.jsx(Yi,{className:"h-3.5 w-3.5"})})]}),o.jsx(WL,{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(w2t,{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(ove,{language:"markdown",style:lve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},children:t??e.instructions})}):o.jsx(tE,{children:e.instructions})}),e.references.length>0&&o.jsx(WL,{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(WL,{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(WMt,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.assets.length>0&&o.jsx(WL,{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(dce,{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 NT({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 WL({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 rRn({open:e,onOpenChange:t,skillName:r,referencePath:n,content:s,isLoading:a,error:i}){const{isCopied:l,copyToClipboard:c}=UB({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(me,{size:"md",variant:"light",onClick:u,disabled:!s||a,children:[o.jsx(Ce,{children:l?o.jsx(ra,{className:"h-3.5 w-3.5 text-green-400"}):o.jsx(au,{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 K8e(e){return`${e.topSource}/${e.name}`}function J8e(e){const t=p1t(e.topSource,e.name);return t?`${t.owner}/${t.repo}/${e.name}`:null}function nRn({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}=sEn(r),x=nEn(r),w=b.useMemo(()=>f?.topSource?p1t(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:_}=aEn(r,w?.owner,w?.repo,f?.name,{enabled:!!w&&!!f}),E=p1(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=J8e(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(Sn,{open:e,onOpenChange:B,children:o.jsxs(yn,{className:"max-w-4xl h-[80vh] flex flex-col",children:[o.jsxs(On,{children:[o.jsx(vn,{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(RE,{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(Hb,{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 $=K8e(D),U=J8e(D),z=U&&a.includes(U)||i.includes(D.name),H=f?K8e(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(ra,{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(Rk,{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(vC,{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(W2t,{className:"h-3 w-3"}),f.topSource]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Rk,{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(ba,{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(tE,{children:k})})}):o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-neutral4",children:[o.jsx(Hb,{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(ba,{className:"h-3 w-3"})]})]})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-neutral4",children:[o.jsx(Hb,{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(oc,{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(me,{variant:"light",onClick:()=>B(!1),children:"Cancel"}),o.jsx(me,{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(ra,{className:"h-4 w-4 mr-2"}),"Already Installed"]}):o.jsxs(o.Fragment,{children:[o.jsx(Rk,{className:"h-4 w-4 mr-2"}),"Install"]})})]})]})]})]})})}function e7e(){const{workspaceId:e}=na(),[t,r]=ao(),n=pu(),[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}=f1t(),_=w?.workspaces??[],E=e??_[0]?.id,{data:T,isLoading:j,error:N}=W_n(E),I=Ps(S)||Ps(N),P=Os(S)||Os(N),R=t.get("path")||".",B=Ale(S)||Ale(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}=G_n(L,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:E}),J=Y_n(),ae=X_n(),{data:te,isLoading:re}=h1t(Z??"",{enabled:!!Z,workspaceId:E}),{data:ie,isLoading:fe,refetch:X}=J_n({workspaceId:E}),se=iEn(),le=oEn(),xe=lEn(),ue=T?.isWorkspaceConfigured??!1,ce=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=ce&&!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"&&ce?"files":x==="skills"&&ve?"skills":ce?"files":ve?"skills":"files",ct=ie?.skills??[],wt=ie?.isSkillsConfigured??!1,lr=V?.entries??[],Ve=ce&&(we||Ne),qe=ve&&wt&&ct.length>0,Ie=Ve||qe;if(k)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(Dt,{})});if(I)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(sa,{})});if(P)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(Zs,{resource:"workspaces"})});if(B)return o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(UIn,{})});const Le=S||N;return Le?o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(vu,{title:"Failed to load workspace",message:Le.message})}):!k&&_.length===0?o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(zIn,{})}):!j&&!k&&!ue?o.jsx(Jr,{title:"Workspace",icon:o.jsx(oc,{}),children:o.jsx(BIn,{})}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsxs(bn,{children:[o.jsxs(bn.Title,{children:[o.jsx(oc,{})," Workspace"]}),o.jsx(bn.Description,{children:"Manage files, skills, and search your workspace"})]})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[Ie&&o.jsx(Cn,{onClick:()=>a(!s),tooltipContent:"Search workspace","aria-label":"Search workspace",children:o.jsx(RE,{})}),o.jsx(Cn,{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(JL,{className:"h-4 w-4 text-accent1"}):o.jsx(t$,{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(JL,{className:"h-4 w-4 text-accent1 shrink-0"}):o.jsx(t$,{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(JL,{className:"h-4 w-4 text-accent1"}):o.jsx(t$,{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(sRn,{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:[ce&&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(w3,{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"&&ce&&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(DIn,{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(FIn,{path:Z,content:te?.content??"",isLoading:re,mimeType:te?.mimeType,onClose:()=>H(null)})]})}),Fe==="skills"&&ve&&o.jsx(XIn,{skills:ct,isLoading:fe,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}),!ce&&!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(nRn,{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 sRn({workspaceId:e,canSearchFiles:t,canSearchSkills:r,canBM25:n,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:l}){const c=K_n(),u=rEn();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(VIn,{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(w3,{className:"h-4 w-4"}),"Search Skills"]}),o.jsx(HIn,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>l(d.skillName,d.skillPath)})]})]})}function aRn(e,t){return e==null||t==null?null:e in t?e:null}function iRn(){const{skillName:e,workspaceId:t}=na(),[r]=ao(),n=wa(),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=aRn(c,d),h=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[p,m]=b.useState(null),{data:g,isLoading:y,error:x}=eEn(s,{workspaceId:t,path:i}),{data:w}=h1t(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:S,isLoading:k}=tEn(s,p??"",{enabled:!!p,workspaceId:t,path:i}),_=E=>f?o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:h,children:[o.jsx(Ce,{children:o.jsx(JL,{className:"h-4 w-4"})}),f]}),o.jsxs(jr,{as:"span",to:"",isCurrent:!0,children:[o.jsx(Ce,{children:o.jsx(w3,{className:"h-4 w-4"})}),E]})]}):o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:h,children:[o.jsx(Ce,{children:o.jsx(oc,{className:"h-4 w-4"})}),"Workspace"]}),o.jsxs(jr,{as:dr,to:h,children:[o.jsx(Ce,{children:o.jsx(w3,{className:"h-4 w-4"})}),"Skills"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:E})]});return y?o.jsxs(zr,{children:[o.jsx(En,{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(En,{children:_("Session Expired")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(sa,{})})]}):x&&Os(x)?o.jsxs(zr,{children:[o.jsx(En,{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(En,{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(En,{children:[_(g.name),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ce,{children:o.jsx(h0,{})}),"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(tRn,{skill:g,rawSkillMd:w?.content,onReferenceClick:m})})}),o.jsx(rRn,{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}},oRn=[{key:"primitives",title:"Primitives",href:"/primitives",links:[{name:"Agents",url:"/agents",icon:o.jsx(ga,{}),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(sS,{}),isOnMastraPlatform:!1,indent:!0,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:o.jsx(bl,{}),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(oc,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:o.jsx(IE,{}),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(Ru,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]}]},{key:"observability",title:"Observability",href:"/observability-overview",links:[{name:"Metrics",url:"/metrics",icon:o.jsx(ok,{}),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(e$,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"}]},{key:"bottom",separator:!0,links:[{name:"Settings",url:"/settings",icon:o.jsx(vme,{}),isOnMastraPlatform:!1},{name:"Resources",url:"/resources",icon:o.jsx(Li,{}),isOnMastraPlatform:!0}]}];function t7e(e,t){const r=n=>t===n||t.startsWith(n+"/");return r(e.url)?!0:e.activePaths?.some(r)??!1}function lRn(){const{Link:e}=or(),{state:t}=Cme(),n=Ec().pathname,{isMastraPlatform:s}=lOt(),{data:a}=_C(),{isCmsAvailable:i,isLoading:l}=pM(),{hasPermission:c,hasAnyPermission:u,rbacEnabled:d,isAuthenticated:f,isLoading:h}=Cv(),p=a&&YP(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(Yh,{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(rx,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),p&&o.jsx(Fle,{})]}):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(rx,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),o.jsx(Fle,{})]}):o.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[o.jsx(rx,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),o.jsx(Yh.Nav,{children:oRn.map(y=>{const x=y.links.filter(g),w=x.length>0&&y?.separator,S=x.some(_=>t7e(_,n)),k=!!(y.href&&n===y.href&&!S);return o.jsxs(Yh.NavSection,{children:[y?.title?o.jsx(Yh.NavHeader,{LinkComponent:e,state:t,href:y.href,isActive:k,children:y.title}):o.jsx(o.Fragment,{children:w&&o.jsx(Yh.NavSeparator,{})}),o.jsx(Yh.NavList,{children:x.map(_=>{const E=t7e(_,n);return o.jsx(Yh.NavLink,{LinkComponent:e,state:t,link:_,isActive:E},_.name)})})]},y.key)})}),o.jsxs(Yh.Bottom,{children:[t!=="collapsed"&&o.jsxs(o.Fragment,{children:[o.jsx(Yh.NavSeparator,{}),o.jsx(G1n,{collapsed:!1})]}),o.jsx(Yh.NavSeparator,{}),o.jsx("div",{className:"flex justify-end pb-3",children:o.jsx(Yh.Trigger,{})})]})]})}function cOt({children:e,loginUrl:t="/login",signupUrl:r="/signup"}){const{data:n,isLoading:s}=_C();if(s)return o.jsx(o.Fragment,{children:e});if(!n?.enabled)return o.jsx(o.Fragment,{children:e});if(YP(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(rx,{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(rx,{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(_Ve,{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($1t,{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",cRn=je.createContext(null);function uRn(e,t){const r=window.localStorage.getItem(uOt+e);return r&&t.has(r)?r:dOt}function dRn({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]=uRn(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(cRn.Provider,{value:l,children:t})}const fRn=[{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"}]}],hRn=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"}),pRn=()=>{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}},zve=()=>{const{requestContext:e}=ks(),t=Ge();return kt({queryKey:["processors"],queryFn:()=>t.listProcessors(e)})},fOt=(e,t)=>{const r=Ge(),{requestContext:n}=ks();return kt({queryKey:["processor",e],queryFn:()=>r.getProcessor(e).details(n),enabled:!!e})},mRn=()=>{const e=Ge(),{requestContext:t}=ks();return Kr({mutationFn:async({processorId:r,phase:n,messages:s,agentId:a})=>e.getProcessor(r).execute({phase:n,messages:s,agentId:a,requestContext:t})})},gRn=()=>{const{open:e,setOpen:t}=pRn(),{navigate:r,paths:n}=or(),{isMastraPlatform:s}=lOt(),a=N3r(),{data:i={}}=Ag(),{data:l={}}=p0(),{data:c={}}=s8(),{data:u={}}=zve(),{data:d=[]}=mM(),{data:f={}}=hd(),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(Udt,{placeholder:"Search or navigate..."}),o.jsxs(Vdt,{children:[o.jsx(qdt,{children:"No results found."}),o.jsxs(yb,{heading:"Navigation",children:[a&&o.jsxs(Zo,{value:"toggle sidebar collapse expand",onSelect:()=>{a.toggleSidebar(),t(!1)},children:[o.jsx(NVe,{className:"text-neutral3"}),o.jsx("span",{children:"Toggle Sidebar"}),o.jsx(Hdt,{children:"Ctrl+B"})]}),o.jsxs(Zo,{value:"all agents",onSelect:()=>h("/agents"),children:[o.jsx(ga,{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(sS,{className:"text-neutral3"}),o.jsx("span",{children:"All Processors"})]}),o.jsxs(Zo,{value:"all mcp servers",onSelect:()=>h("/mcps"),children:[o.jsx(bl,{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(vme,{className:"text-neutral3"}),o.jsx("span",{children:"Settings"})]}),o.jsxs(Zo,{value:"templates",onSelect:()=>h("/templates"),children:[o.jsx(Hb,{className:"text-neutral3"}),o.jsx("span",{children:"Templates"})]})]})]}),p.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(uw,{}),o.jsx(yb,{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(ga,{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(uw,{}),o.jsx(yb,{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(uw,{}),o.jsx(yb,{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(uw,{}),o.jsx(yb,{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(uw,{}),o.jsx(yb,{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(sS,{className:"text-neutral3"}),o.jsx("span",{children:S})]},w.id)})})]}),d.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(uw,{}),o.jsx(yb,{heading:"MCP Servers",children:d.map(w=>o.jsxs(Zo,{value:`mcp server ${w.name}`,onSelect:()=>h(n.mcpServerLink(w.id)),children:[o.jsx(bl,{className:"text-neutral3"}),o.jsx("span",{children:w.name})]},w.id))})]})]})]})};function yRn({children:e}){const{data:t,isFetched:r}=_C(),{pathname:n}=Ec(),s=r&&t?.enabled&&!YP(t),a=r&&!s;return o.jsxs(o.Fragment,{children:[o.jsx(gRn,{}),o.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&o.jsx(lRn,{}),o.jsx("div",{className:Y("bg-transparent overflow-y-auto",{"h-[calc(100%-1.5rem)]":s}),children:o.jsx(cOt,{children:o.jsx(N4r,{resetKeys:[n],children:e})})})]})]})}const vRn=({children:e})=>{const{experimentalUIEnabled:t}=hRn();return o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(gYe,{position:"bottom-right"}),o.jsx(jdt,{defaultTheme:"dark",children:o.jsx(cd,{delayDuration:0,children:o.jsx(dRn,{experiments:t?fRn:[],children:o.jsx(I3r,{children:o.jsx(yRn,{children:e})})})})})]})},bRn=({children:e})=>o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(gYe,{position:"bottom-right"}),o.jsx(jdt,{defaultTheme:"dark",children:o.jsx(cd,{delayDuration:0,children:o.jsx("div",{className:"h-full overflow-y-auto",children:o.jsx(cOt,{children:e})})})})]});function xRn({agentId:e}){return o.jsxs(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/agents",children:[o.jsx(Ce,{children:o.jsx(ga,{})}),"Agents"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(FOn,{value:e,variant:"ghost"})})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(h0,{}),"Agents documentation"]})})]})}const wRn=({children:e})=>{const{agentId:t}=na(),r=Ec(),{isCmsAvailable:n}=pM(),{hasObservability:s}=K1n(),a=Ble.has("datasets"),i=n&&a,l=s&&a,{data:c}=Pf(t),u=nu(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(xRn,{agentId:t}),o.jsx(UCn,{agentId:t,activeTab:h,showPlayground:i,showObservability:l,rightSlot:p?o.jsx(VCn,{requestContextSchema:f}):void 0}),e]});return o.jsx(qP,{children:o.jsx(YSn,{defaultProvider:u,defaultModel:d,children:o.jsx(TCn,{children:o.jsx(XSn,{children:m})})})})},SRn=({children:e,options:t})=>{const r=new N2r({...t,defaultOptions:{...t?.defaultOptions,queries:{retry:I6r,...t?.defaultOptions?.queries}}});return o.jsx(A2r,{client:r,children:e})},ORn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ja,{iconSlot:o.jsx(wf,{}),titleSlot:"No Processors yet",descriptionSlot:"Configure processors. Add input or output processors to your agents to transform messages.",actionSlot:o.jsxs(me,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:["Processors Documentation ",o.jsx(ba,{})]})})}),kRn=["input","inputStep","outputStep","outputStream","outputResult"];function _Rn({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(wh,{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(mx,{})," Step"]}),tooltip:"Contains Input Step phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Step",short:o.jsxs(o.Fragment,{children:[o.jsx(Yd,{})," Step"]}),tooltip:"Contains Output Step phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Stream",short:o.jsxs(o.Fragment,{children:[o.jsx(Yd,{})," Stream"]}),tooltip:"Contains Output Stream phase",className:"text-center"}),o.jsx(Se.TopCellSmart,{long:"Output Result",short:o.jsxs(o.Fragment,{children:[o.jsx(Yd,{})," 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=Ih(l.name||l.id,50),u=Ih(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}),kRn.map(p=>o.jsx(Se.TextCell,{className:"text-center",children:f.has(p)&&o.jsx(ra,{className:"size-4 mx-auto"})},p)),o.jsx(Se.TextCell,{className:"text-center",children:d||""})]},l.id)})]})}function ERn(){const{data:e={},isLoading:t,error:r}=zve(),[n,s]=b.useState("");return r&&Ps(r)?o.jsx(Jr,{title:"Processors",icon:o.jsx(hp,{}),children:o.jsx(sa,{})}):r&&Os(r)?o.jsx(Jr,{title:"Processors",icon:o.jsx(hp,{}),children:o.jsx(Zs,{resource:"processors"})}):r?o.jsx(Jr,{title:"Processors",icon:o.jsx(hp,{}),children:o.jsx(vu,{title:"Failed to load processors",message:r.message})}):Object.keys(e).length===0&&!t?o.jsx(Jr,{title:"Processors",icon:o.jsx(hp,{}),children:o.jsx(ORn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:t,children:[o.jsx(hp,{})," Processors"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(Cg,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),o.jsx(_Rn,{processors:e,isLoading:t,search:n})]})}function CRn({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="inputLike"}){const{data:c={},isLoading:u,isError:d,error:f}=zve(),{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(Kl,{options:m,value:e,onValueChange:g,placeholder:u?"Loading processors...":r,searchPlaceholder:n,emptyText:s,className:a,disabled:i||u||d,variant:l})}const jRn={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 TRn({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(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]}):n?null:t?o.jsx(NRn,{processor:t}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(pe,{variant:"header-md",className:"text-neutral3",children:"Processor not found"})})}function NRn({processor:e}){const t=_v(),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=mRn(),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(mf,{hasLeftServiceColumn:!0,className:"relative",children:[o.jsxs("div",{className:"bg-surface2 border-r border-border1 w-[22rem] overflow-y-auto",children:[o.jsx(ARn,{processor:e}),o.jsxs("div",{className:"p-5 space-y-5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),o.jsxs(hi,{value:n,onValueChange:y=>s(y),children:[o.jsx(ei,{className:"w-full",children:o.jsx(pi,{placeholder:"Select phase"})}),o.jsx(ti,{children:e.phases.map(y=>o.jsx(ss,{value:y,children:y},y))})]}),o.jsx(pe,{variant:"ui-xs",className:"text-neutral4",children:jRn[n]})]}),e.configurations.length>1&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(pe,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Agent Configuration"}),o.jsxs(hi,{value:a,onValueChange:i,children:[o.jsx(ei,{className:"w-full",children:o.jsx(pi,{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(pe,{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(me,{onClick:m,disabled:p.isPending||n==="outputStream",className:"w-full",children:p.isPending?"Running...":"Run Processor"}),n==="outputStream"&&o.jsx(pe,{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(pe,{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(pe,{variant:"ui-sm",className:"text-accent6 font-medium",children:"Tripwire Reason"}),o.jsx(pe,{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(ta,{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(wc,{value:f||g,editable:!0,theme:t,extensions:[Kd]})})]})}function ARn({processor:e}){return o.jsxs("div",{className:"px-5 pt-5 pb-4 border-b border-border1",children:[o.jsx(pe,{variant:"header-md",className:"text-neutral1 mb-2",children:e.name||e.id}),e.name&&e.name!==e.id&&o.jsx(pe,{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(pe,{variant:"ui-xs",className:"text-neutral4",children:["Attached to ",e.configurations.length," agent",e.configurations.length!==1?"s":""]})})]})}function IRn(){const{processorId:e}=na(),{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(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(hp,{})}),"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(sa,{})})]}):n&&Os(n)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(hp,{})}),"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(gFt,{to:`/workflows/${e}/graph`,replace:!0}):r?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(En,{children:o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(hp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(Ln,{className:"h-6 w-32"})})]})}),o.jsxs("div",{className:"p-6",children:[o.jsx(Ln,{className:"h-8 w-48 mb-4"}),o.jsx(Ln,{className:"h-32 w-full"})]})]}):o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Xa,{children:[o.jsxs(jr,{as:dr,to:"/processors",children:[o.jsx(Ce,{children:o.jsx(hp,{})}),"Processors"]}),o.jsx(jr,{as:"span",to:"",isCurrent:!0,children:o.jsx(CRn,{value:e,variant:"ghost"})})]}),o.jsx(gu,{children:o.jsxs(me,{as:dr,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[o.jsx(h0,{}),"Processors documentation"]})})]}),o.jsx(TRn,{processorId:e})]})}function RRn(){const{data:e={},isLoading:t,error:r}=Ag(),{data:n={},isLoading:s,error:a}=s8(),[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(sa,{})}):u&&Os(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(vu,{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(AAn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(bn,{children:o.jsxs(bn.Title,{isLoading:c,children:[o.jsx(Mi,{})," Tools"]})})}),o.jsx(bt.Column,{className:"flex justify-end gap-2",children:o.jsx(Cn,{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(Cg,{onSearch:l,label:"Filter tools",placeholder:"Filter by name"})})]}),o.jsx(NAn,{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}`},PRn=()=>{const e=pu(),t=r=>e(r,{viewTransition:!0});return o.jsx($ht,{Link:AB,navigate:t,paths:hOt,children:o.jsx(vRn,{children:o.jsx(S_,{})})})},MRn=()=>{const e=pu(),t=r=>e(r,{viewTransition:!0});return o.jsx($ht,{Link:AB,navigate:t,paths:hOt,children:o.jsx(bRn,{children:o.jsx(S_,{})})})},DRn=!!window.MASTRA_CLOUD_API_ENDPOINT,r7e=Ble.has("datasets"),n7e=[{index:!0,element:o.jsx(Fjn,{})},{path:"instruction-blocks",element:o.jsx(zjn,{})},{path:"tools",element:o.jsx(qjn,{})},{path:"agents",element:o.jsx(Djn,{})},{path:"scorers",element:o.jsx(Ujn,{})},{path:"workflows",element:o.jsx(Qjn,{})},{path:"skills",element:o.jsx(Vjn,{})},{path:"memory",element:o.jsx(Bjn,{})},{path:"variables",element:o.jsx(Hjn,{})}],LRn=[{path:"/login",element:o.jsx(OAn,{})},{path:"/signup",element:o.jsx(fIn,{})},{element:o.jsx(MRn,{}),children:[{path:"/agents/:agentId/session",element:o.jsx(_8e,{})},{path:"/agents/:agentId/session/:threadId",element:o.jsx(_8e,{})}]},{element:o.jsx(PRn,{}),children:[...DRn?[]:[{path:"/settings",element:o.jsx(dIn,{})},{path:"/templates",element:o.jsx(gIn,{})},{path:"/templates/:templateSlug",element:o.jsx(OIn,{})}],{path:"/logs",element:o.jsx(kAn,{})},{path:"/primitives",element:o.jsx(nIn,{})},{path:"/evaluation",element:o.jsx(xAn,{})},{path:"/scorers",element:o.jsx(lIn,{})},{path:"/scorers/:scorerId",element:o.jsx(cIn,{})},{path:"/metrics",element:o.jsx(KAn,{})},{path:"/observability-overview",element:o.jsx(tIn,{})},{path:"/observability",element:o.jsx(NIn,{})},{path:"/traces/:traceId",element:o.jsx(AIn,{})},{path:"/resources",element:o.jsx(oIn,{})},{path:"/agents",element:o.jsx($Kr,{})},{path:"/cms/agents/create",element:o.jsx(Ljn,{}),children:n7e},{path:"/cms/agents/:agentId/edit",element:o.jsx($jn,{}),children:n7e},{path:"/cms/scorers/create",element:o.jsx(Yjn,{})},{path:"/cms/scorers/:scorerId/edit",element:o.jsx(Kjn,{})},{path:"/prompts",element:o.jsx(sIn,{})},{path:"/cms/prompts/create",element:o.jsx(Wjn,{})},{path:"/cms/prompts/:promptBlockId/edit",element:o.jsx(Zjn,{})},{path:"/agents/:agentId/tools/:toolId",element:o.jsx(kIn,{})},{path:"/agents/:agentId",element:o.jsx(wRn,{children:o.jsx(S_,{})}),children:[{index:!0,loader:({params:e})=>PU(`/agents/${e.agentId}/chat`)},{path:"chat",element:o.jsx(O8e,{})},{path:"chat/:threadId",element:o.jsx(O8e,{})},...r7e?[{path:"editor",element:o.jsx(Rjn,{})},{path:"evaluate",element:o.jsx(Ijn,{})},{path:"review",element:o.jsx(Pjn,{})}]:[],{path:"traces",element:o.jsx(Mjn,{})}]},{path:"/tools",element:o.jsx(RRn,{})},{path:"/tools/:toolId",element:o.jsx(_In,{})},{path:"/processors",element:o.jsx(ERn,{})},{path:"/processors/:processorId",element:o.jsx(IRn,{})},{path:"/mcps",element:o.jsx(jAn,{})},{path:"/mcps/:serverId",element:o.jsx($An,{})},{path:"/mcps/:serverId/tools/:toolId",element:o.jsx(BAn,{})},{path:"/workspaces",element:o.jsx(e7e,{})},{path:"/workspaces/:workspaceId",element:o.jsx(e7e,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:o.jsx(iRn,{})},{path:"/workflows",element:o.jsx(IIn,{})},{path:"/workflows/:workflowId",element:o.jsx(xYr,{children:o.jsx(S_,{})}),children:[{index:!0,loader:({params:e})=>PU(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:o.jsx(X8e,{})},{path:"graph/:runId",element:o.jsx(X8e,{})}]},...r7e?[{path:"/datasets",element:o.jsx(KNn,{})},{path:"/datasets/:datasetId",element:o.jsx(eAn,{})},{path:"/datasets/:datasetId/items/:itemId",element:o.jsx(nAn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:o.jsx(iAn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:o.jsx(tAn,{})},{path:"/experiments",element:o.jsx(wAn,{})},{path:"/experiments/:experimentId",element:o.jsx(SAn,{})},{path:"/datasets/:datasetId/experiments",element:o.jsx(rAn,{})},{path:"/datasets/:datasetId/items",element:o.jsx(sAn,{})},{path:"/datasets/:datasetId/versions",element:o.jsx(lAn,{})}]:[],{index:!0,loader:()=>PU("/agents")},{path:"/request-context",element:o.jsx(aIn,{})}]}];function $Rn(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:r,apiPrefix:n,isLoading:s}=hve(),a=b.useMemo(()=>t?kjn(t,n):void 0,[t,n]);if(s)return null;if(!t)return o.jsx(X1n,{});const i=UFt(LRn,{basename:e});return o.jsx(h4t,{baseUrl:t,headers:r,apiPrefix:n,customFetch:a,children:o.jsx(NKr,{children:o.jsx(hFt,{router:i})})})}function FRn(){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(SRn,{children:o.jsx(g1n,{endpoint:i,defaultApiPrefix:n,children:o.jsx($Rn,{})})})}k_t.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(FRn,{})}));const $Mn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{HHe as A,zGe as B,WHe as C,FWe as D,Of as E,vh as F,$Mn as G,Js as I,uS as L,qHe as N,b5t as a,M5t as b,LMn as c,YSe as d,fS as e,A5t as f,Vk as g,P5t as h,c1 as i,u1 as j,l1 as k,PVt as l,QWe as m,iS as n,Ra as o,ZUt as p,GUt as q,Sue as r,Nce as s,ne as t,R3 as u,ju as v,k5t as w,ft as x,nt as y,cZe as z};
|