@mastra/deployer-cloud 1.28.0-alpha.1 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/studio/assets/{index-eJruj9zP.js → index-BR1-CN8-.js} +1 -1
  3. package/dist/studio/assets/{index-Fp-jSoe4.js → index-BT1M4Tvm.js} +1 -1
  4. package/dist/studio/assets/{index-jCaV9unU.js → index-BZhvsxnW.js} +1 -1
  5. package/dist/studio/assets/{index-Dxa-PRih.js → index-BceBaibN.js} +1 -1
  6. package/dist/studio/assets/{index-CpMM209E.js → index-BnpFxttj.js} +1 -1
  7. package/dist/studio/assets/{index-DRTkUPRL.js → index-CL4WKYIM.js} +1 -1
  8. package/dist/studio/assets/{index-DZfyhNgm.js → index-CUFhG44G.js} +1 -1
  9. package/dist/studio/assets/{index-CIfWC49x.js → index-Cvyi01vl.js} +1 -1
  10. package/dist/studio/assets/{index-xd0CinT-.js → index-CwmEzW2b.js} +1 -1
  11. package/dist/studio/assets/{index-C6m2-uD_.js → index-D93D1PwR.js} +1 -1
  12. package/dist/studio/assets/{index-Dl9ozwva.js → index-DEkXmX_Q.js} +1 -1
  13. package/dist/studio/assets/{index-nRHqCrbi.js → index-DLVxKTWV.js} +1 -1
  14. package/dist/studio/assets/{index-BIVFlF-F.js → index-DdSK5DLd.js} +1 -1
  15. package/dist/studio/assets/{index-BIKsjXRb.js → index-DyXMr5Sr.js} +1 -1
  16. package/dist/studio/assets/{index-Df38TZCF.js → index-IwjxwEgz.js} +1 -1
  17. package/dist/studio/assets/{index-Bq5Vt_Xq.js → index-QkfdAm36.js} +1 -1
  18. package/dist/studio/assets/{index-D6NfrWho.js → index-cqQUVS11.js} +1 -1
  19. package/dist/studio/assets/{index-B0eYshLo.js → index-vEgxgSsB.js} +1 -1
  20. package/dist/studio/assets/{main--pxG1oJb.js → main-SFRlLrky.js} +5 -5
  21. package/dist/studio/index.html +1 -1
  22. package/package.json +6 -6
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BIKsjXRb.js","./index-jCaV9unU.js","./index-eJruj9zP.js","./index-Bq5Vt_Xq.js","./index-Df38TZCF.js","./index-BIVFlF-F.js","./index-DZfyhNgm.js","./index-CpMM209E.js","./index-DRTkUPRL.js","./index-Dl9ozwva.js","./index-Fp-jSoe4.js","./index-Dxa-PRih.js","./index-CIfWC49x.js","./index-nRHqCrbi.js","./index-xd0CinT-.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-C6m2-uD_.js","./index-B0eYshLo.js","./index-D6NfrWho.js"])))=>i.map(i=>d[i]);
2
- import{_ as Ke}from"./index-jCaV9unU.js";function WBe(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 q$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eU={exports:{}},bj={};var twe;function Zkt(){if(twe)return bj;twe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return bj.Fragment=t,bj.jsx=r,bj.jsxs=r,bj}var rwe;function Ykt(){return rwe||(rwe=1,eU.exports=Zkt()),eU.exports}var o=Ykt(),tU={exports:{}},mn={},nwe;function Xkt(){if(nwe)return mn;nwe=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(q){return q===null||typeof q!="object"?null:(q=p&&q[p]||q["@@iterator"],typeof q=="function"?q:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,x={};function w(q,M,Q){this.props=q,this.context=M,this.refs=x,this.updater=Q||g}w.prototype.isReactComponent={},w.prototype.setState=function(q,M){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,M,"setState")},w.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(q,M,Q){this.props=q,this.context=M,this.refs=x,this.updater=Q||g}var _=k.prototype=new S;_.constructor=k,v(_,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(q,M,Q){var G=Q.ref;return{$$typeof:t,type:q,key:M,ref:G!==void 0?G:null,props:Q}}function P(q,M){return I(q.type,M,q.props)}function R(q){return typeof q=="object"&&q!==null&&q.$$typeof===t}function z(q){var M={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(Q){return M[Q]})}var D=/\/+/g;function U(q,M){return typeof q=="object"&&q!==null&&q.key!=null?z(""+q.key):M.toString(36)}function F(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(T,T):(q.status="pending",q.then(function(M){q.status==="pending"&&(q.status="fulfilled",q.value=M)},function(M){q.status==="pending"&&(q.status="rejected",q.reason=M)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function B(q,M,Q,G,J){var ne=typeof q;(ne==="undefined"||ne==="boolean")&&(q=null);var ee=!1;if(q===null)ee=!0;else switch(ne){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(q.$$typeof){case t:case r:ee=!0;break;case f:return ee=q._init,B(ee(q._payload),M,Q,G,J)}}if(ee)return J=J(q),ee=G===""?"."+U(q,0):G,E(J)?(Q="",ee!=null&&(Q=ee.replace(D,"$&/")+"/"),B(J,M,Q,"",function(ce){return ce})):J!=null&&(R(J)&&(J=P(J,Q+(J.key==null||q&&q.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+ee)),M.push(J)),1;ee=0;var re=G===""?".":G+":";if(E(q))for(var ie=0;ie<q.length;ie++)G=q[ie],ne=re+U(G,ie),ee+=B(G,M,Q,ne,J);else if(ie=m(q),typeof ie=="function")for(q=ie.call(q),ie=0;!(G=q.next()).done;)G=G.value,ne=re+U(G,ie++),ee+=B(G,M,Q,ne,J);else if(ne==="object"){if(typeof q.then=="function")return B(F(q),M,Q,G,J);throw M=String(q),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return ee}function H(q,M,Q){if(q==null)return q;var G=[],J=0;return B(q,G,"","",function(ne){return M.call(Q,ne,J++)}),G}function W(q){if(q._status===-1){var M=q._result;M=M(),M.then(function(Q){(q._status===0||q._status===-1)&&(q._status=1,q._result=Q)},function(Q){(q._status===0||q._status===-1)&&(q._status=2,q._result=Q)}),q._status===-1&&(q._status=0,q._result=M)}if(q._status===1)return q._result.default;throw q._result}var L=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(M))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",q);return}console.error(q)},Y={map:H,forEach:function(q,M,Q){H(q,function(){M.apply(this,arguments)},Q)},count:function(q){var M=0;return H(q,function(){M++}),M},toArray:function(q){return H(q,function(M){return M})||[]},only:function(q){if(!R(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return mn.Activity=h,mn.Children=Y,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(q){return j.H.useMemoCache(q)}},mn.cache=function(q){return function(){return q.apply(null,arguments)}},mn.cacheSignal=function(){return null},mn.cloneElement=function(q,M,Q){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var G=v({},q.props),J=q.key;if(M!=null)for(ne in M.key!==void 0&&(J=""+M.key),M)!N.call(M,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&M.ref===void 0||(G[ne]=M[ne]);var ne=arguments.length-2;if(ne===1)G.children=Q;else if(1<ne){for(var ee=Array(ne),re=0;re<ne;re++)ee[re]=arguments[re+2];G.children=ee}return I(q.type,J,G)},mn.createContext=function(q){return q={$$typeof:l,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:i,_context:q},q},mn.createElement=function(q,M,Q){var G,J={},ne=null;if(M!=null)for(G in M.key!==void 0&&(ne=""+M.key),M)N.call(M,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=M[G]);var ee=arguments.length-2;if(ee===1)J.children=Q;else if(1<ee){for(var re=Array(ee),ie=0;ie<ee;ie++)re[ie]=arguments[ie+2];J.children=re}if(q&&q.defaultProps)for(G in ee=q.defaultProps,ee)J[G]===void 0&&(J[G]=ee[G]);return I(q,ne,J)},mn.createRef=function(){return{current:null}},mn.forwardRef=function(q){return{$$typeof:c,render:q}},mn.isValidElement=R,mn.lazy=function(q){return{$$typeof:f,_payload:{_status:-1,_result:q},_init:W}},mn.memo=function(q,M){return{$$typeof:d,type:q,compare:M===void 0?null:M}},mn.startTransition=function(q){var M=j.T,Q={};j.T=Q;try{var G=q(),J=j.S;J!==null&&J(Q,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(ne){L(ne)}finally{M!==null&&Q.types!==null&&(M.types=Q.types),j.T=M}},mn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},mn.use=function(q){return j.H.use(q)},mn.useActionState=function(q,M,Q){return j.H.useActionState(q,M,Q)},mn.useCallback=function(q,M){return j.H.useCallback(q,M)},mn.useContext=function(q){return j.H.useContext(q)},mn.useDebugValue=function(){},mn.useDeferredValue=function(q,M){return j.H.useDeferredValue(q,M)},mn.useEffect=function(q,M){return j.H.useEffect(q,M)},mn.useEffectEvent=function(q){return j.H.useEffectEvent(q)},mn.useId=function(){return j.H.useId()},mn.useImperativeHandle=function(q,M,Q){return j.H.useImperativeHandle(q,M,Q)},mn.useInsertionEffect=function(q,M){return j.H.useInsertionEffect(q,M)},mn.useLayoutEffect=function(q,M){return j.H.useLayoutEffect(q,M)},mn.useMemo=function(q,M){return j.H.useMemo(q,M)},mn.useOptimistic=function(q,M){return j.H.useOptimistic(q,M)},mn.useReducer=function(q,M,Q){return j.H.useReducer(q,M,Q)},mn.useRef=function(q){return j.H.useRef(q)},mn.useState=function(q){return j.H.useState(q)},mn.useSyncExternalStore=function(q,M,Q){return j.H.useSyncExternalStore(q,M,Q)},mn.useTransition=function(){return j.H.useTransition()},mn.version="19.2.5",mn}var swe;function EE(){return swe||(swe=1,tU.exports=Xkt()),tU.exports}var b=EE();const Te=Bo(b),YS=WBe({__proto__:null,default:Te},[b]);var rU={exports:{}},xj={},nU={exports:{}},sU={};var awe;function Kkt(){return awe||(awe=1,(function(e){function t(F,B){var H=F.length;F.push(B);e:for(;0<H;){var W=H-1>>>1,L=F[W];if(0<s(L,B))F[W]=B,F[H]=L,H=W;else break e}}function r(F){return F.length===0?null:F[0]}function n(F){if(F.length===0)return null;var B=F[0],H=F.pop();if(H!==B){F[0]=H;e:for(var W=0,L=F.length,Y=L>>>1;W<Y;){var q=2*(W+1)-1,M=F[q],Q=q+1,G=F[Q];if(0>s(M,H))Q<L&&0>s(G,M)?(F[W]=G,F[Q]=H,W=Q):(F[W]=M,F[q]=H,W=q);else if(Q<L&&0>s(G,H))F[W]=G,F[Q]=H,W=Q;else break e}}return B}function s(F,B){var H=F.sortIndex-B.sortIndex;return H!==0?H:F.id-B.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,v=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(F){for(var B=r(u);B!==null;){if(B.callback===null)n(u);else if(B.startTime<=F)n(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=r(u)}}function _(F){if(g=!1,k(F),!m)if(r(c)!==null)m=!0,E||(E=!0,R());else{var B=r(u);B!==null&&U(_,B.startTime-F)}}var E=!1,T=-1,j=5,N=-1;function I(){return v?!0:!(e.unstable_now()-N<j)}function P(){if(v=!1,E){var F=e.unstable_now();N=F;var B=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),p=!0;var H=h;try{t:{for(k(F),f=r(c);f!==null&&!(f.expirationTime>F&&I());){var W=f.callback;if(typeof W=="function"){f.callback=null,h=f.priorityLevel;var L=W(f.expirationTime<=F);if(F=e.unstable_now(),typeof L=="function"){f.callback=L,k(F),B=!0;break t}f===r(c)&&n(c),k(F)}else n(c);f=r(c)}if(f!==null)B=!0;else{var Y=r(u);Y!==null&&U(_,Y.startTime-F),B=!1}}break e}finally{f=null,h=H,p=!1}B=void 0}}finally{B?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,D=z.port2;z.port1.onmessage=P,R=function(){D.postMessage(null)}}else R=function(){x(P,0)};function U(F,B){T=x(function(){F(e.unstable_now())},B)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(F){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var H=h;h=B;try{return F()}finally{h=H}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(F,B){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var H=h;h=F;try{return B()}finally{h=H}},e.unstable_scheduleCallback=function(F,B,H){var W=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?W+H:W):H=W,F){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,F={id:d++,callback:B,priorityLevel:F,startTime:H,expirationTime:L,sortIndex:-1},H>W?(F.sortIndex=H,t(u,F),r(c)===null&&F===r(u)&&(g?(w(T),T=-1):g=!0,U(_,H-W))):(F.sortIndex=L,t(c,F),m||p||(m=!0,E||(E=!0,R()))),F},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(F){var B=h;return function(){var H=h;h=B;try{return F.apply(this,arguments)}finally{h=H}}}})(sU)),sU}var iwe;function Jkt(){return iwe||(iwe=1,nU.exports=Kkt()),nU.exports}var aU={exports:{}},nc={};var owe;function e_t(){if(owe)return nc;owe=1;var e=EE();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 nc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,nc.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)},nc.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()}},nc.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))},nc.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},nc.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})}},nc.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)},nc.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})}},nc.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)},nc.requestFormReset=function(c){n.d.r(c)},nc.unstable_batchedUpdates=function(c,u){return c(u)},nc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},nc.useFormStatus=function(){return i.H.useHostTransitionStatus()},nc.version="19.2.5",nc}var lwe;function GBe(){if(lwe)return aU.exports;lwe=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(),aU.exports=e_t(),aU.exports}var cwe;function t_t(){if(cwe)return xj;cwe=1;var e={env:{}};var t=Jkt(),r=EE(),n=GBe();function s(y){var O="https://react.dev/errors/"+y;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 #"+y+"; visit "+O+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function i(y){var O=y,C=y;if(y.alternate)for(;O.return;)O=O.return;else{y=O;do O=y,(O.flags&4098)!==0&&(C=O.return),y=O.return;while(y)}return O.tag===3?C:null}function l(y){if(y.tag===13){var O=y.memoizedState;if(O===null&&(y=y.alternate,y!==null&&(O=y.memoizedState)),O!==null)return O.dehydrated}return null}function c(y){if(y.tag===31){var O=y.memoizedState;if(O===null&&(y=y.alternate,y!==null&&(O=y.memoizedState)),O!==null)return O.dehydrated}return null}function u(y){if(i(y)!==y)throw Error(s(188))}function d(y){var O=y.alternate;if(!O){if(O=i(y),O===null)throw Error(s(188));return O!==y?null:y}for(var C=y,A=O;;){var $=C.return;if($===null)break;var V=$.alternate;if(V===null){if(A=$.return,A!==null){C=A;continue}break}if($.child===V.child){for(V=$.child;V;){if(V===C)return u($),y;if(V===A)return u($),O;V=V.sibling}throw Error(s(188))}if(C.return!==A.return)C=$,A=V;else{for(var te=!1,de=$.child;de;){if(de===C){te=!0,C=$,A=V;break}if(de===A){te=!0,A=$,C=V;break}de=de.sibling}if(!te){for(de=V.child;de;){if(de===C){te=!0,C=V,A=$;break}if(de===A){te=!0,A=V,C=$;break}de=de.sibling}if(!te)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?y:O}function f(y){var O=y.tag;if(O===5||O===26||O===27||O===6)return y;for(y=y.child;y!==null;){if(O=f(y),O!==null)return O;y=y.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=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 z(y){return y===null||typeof y!="object"?null:(y=R&&y[R]||y["@@iterator"],typeof y=="function"?y:null)}var D=Symbol.for("react.client.reference");function U(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===D?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case v:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof y=="object")switch(y.$$typeof){case g:return"Portal";case k:return y.displayName||"Context";case S:return(y._context.displayName||"Context")+".Consumer";case _:var O=y.render;return y=y.displayName,y||(y=O.displayName||O.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case j:return O=y.displayName||null,O!==null?O:U(y.type)||"Memo";case N:O=y._payload,y=y._init;try{return U(y(O))}catch{}}return null}var F=Array.isArray,B=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,W={pending:!1,data:null,method:null,action:null},L=[],Y=-1;function q(y){return{current:y}}function M(y){0>Y||(y.current=L[Y],L[Y]=null,Y--)}function Q(y,O){Y++,L[Y]=y.current,y.current=O}var G=q(null),J=q(null),ne=q(null),ee=q(null);function re(y,O){switch(Q(ne,O),Q(J,y),Q(G,null),O.nodeType){case 9:case 11:y=(y=O.documentElement)&&(y=y.namespaceURI)?k0e(y):0;break;default:if(y=O.tagName,O=O.namespaceURI)O=k0e(O),y=_0e(O,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}M(G),Q(G,y)}function ie(){M(G),M(J),M(ne)}function ce(y){y.memoizedState!==null&&Q(ee,y);var O=G.current,C=_0e(O,y.type);O!==C&&(Q(J,y),Q(G,C))}function K(y){J.current===y&&(M(G),M(J)),ee.current===y&&(M(ee),mj._currentValue=W)}var ae,le;function xe(y){if(ae===void 0)try{throw Error()}catch(C){var O=C.stack.trim().match(/\n( *(at )?)/);ae=O&&O[1]||"",le=-1<C.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DyXMr5Sr.js","./index-BZhvsxnW.js","./index-BR1-CN8-.js","./index-QkfdAm36.js","./index-IwjxwEgz.js","./index-DdSK5DLd.js","./index-CUFhG44G.js","./index-BnpFxttj.js","./index-CL4WKYIM.js","./index-DEkXmX_Q.js","./index-BT1M4Tvm.js","./index-BceBaibN.js","./index-Cvyi01vl.js","./index-DLVxKTWV.js","./index-CwmEzW2b.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-D93D1PwR.js","./index-vEgxgSsB.js","./index-cqQUVS11.js"])))=>i.map(i=>d[i]);
2
+ import{_ as Ke}from"./index-BZhvsxnW.js";function WBe(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 q$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eU={exports:{}},bj={};var twe;function Zkt(){if(twe)return bj;twe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:a}}return bj.Fragment=t,bj.jsx=r,bj.jsxs=r,bj}var rwe;function Ykt(){return rwe||(rwe=1,eU.exports=Zkt()),eU.exports}var o=Ykt(),tU={exports:{}},mn={},nwe;function Xkt(){if(nwe)return mn;nwe=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(q){return q===null||typeof q!="object"?null:(q=p&&q[p]||q["@@iterator"],typeof q=="function"?q:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,x={};function w(q,M,Q){this.props=q,this.context=M,this.refs=x,this.updater=Q||g}w.prototype.isReactComponent={},w.prototype.setState=function(q,M){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,M,"setState")},w.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function S(){}S.prototype=w.prototype;function k(q,M,Q){this.props=q,this.context=M,this.refs=x,this.updater=Q||g}var _=k.prototype=new S;_.constructor=k,v(_,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(q,M,Q){var G=Q.ref;return{$$typeof:t,type:q,key:M,ref:G!==void 0?G:null,props:Q}}function P(q,M){return I(q.type,M,q.props)}function R(q){return typeof q=="object"&&q!==null&&q.$$typeof===t}function z(q){var M={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(Q){return M[Q]})}var D=/\/+/g;function U(q,M){return typeof q=="object"&&q!==null&&q.key!=null?z(""+q.key):M.toString(36)}function F(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(T,T):(q.status="pending",q.then(function(M){q.status==="pending"&&(q.status="fulfilled",q.value=M)},function(M){q.status==="pending"&&(q.status="rejected",q.reason=M)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function B(q,M,Q,G,J){var ne=typeof q;(ne==="undefined"||ne==="boolean")&&(q=null);var ee=!1;if(q===null)ee=!0;else switch(ne){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(q.$$typeof){case t:case r:ee=!0;break;case f:return ee=q._init,B(ee(q._payload),M,Q,G,J)}}if(ee)return J=J(q),ee=G===""?"."+U(q,0):G,E(J)?(Q="",ee!=null&&(Q=ee.replace(D,"$&/")+"/"),B(J,M,Q,"",function(ce){return ce})):J!=null&&(R(J)&&(J=P(J,Q+(J.key==null||q&&q.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+ee)),M.push(J)),1;ee=0;var re=G===""?".":G+":";if(E(q))for(var ie=0;ie<q.length;ie++)G=q[ie],ne=re+U(G,ie),ee+=B(G,M,Q,ne,J);else if(ie=m(q),typeof ie=="function")for(q=ie.call(q),ie=0;!(G=q.next()).done;)G=G.value,ne=re+U(G,ie++),ee+=B(G,M,Q,ne,J);else if(ne==="object"){if(typeof q.then=="function")return B(F(q),M,Q,G,J);throw M=String(q),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return ee}function H(q,M,Q){if(q==null)return q;var G=[],J=0;return B(q,G,"","",function(ne){return M.call(Q,ne,J++)}),G}function W(q){if(q._status===-1){var M=q._result;M=M(),M.then(function(Q){(q._status===0||q._status===-1)&&(q._status=1,q._result=Q)},function(Q){(q._status===0||q._status===-1)&&(q._status=2,q._result=Q)}),q._status===-1&&(q._status=0,q._result=M)}if(q._status===1)return q._result.default;throw q._result}var L=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(M))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",q);return}console.error(q)},Y={map:H,forEach:function(q,M,Q){H(q,function(){M.apply(this,arguments)},Q)},count:function(q){var M=0;return H(q,function(){M++}),M},toArray:function(q){return H(q,function(M){return M})||[]},only:function(q){if(!R(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return mn.Activity=h,mn.Children=Y,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(q){return j.H.useMemoCache(q)}},mn.cache=function(q){return function(){return q.apply(null,arguments)}},mn.cacheSignal=function(){return null},mn.cloneElement=function(q,M,Q){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var G=v({},q.props),J=q.key;if(M!=null)for(ne in M.key!==void 0&&(J=""+M.key),M)!N.call(M,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&M.ref===void 0||(G[ne]=M[ne]);var ne=arguments.length-2;if(ne===1)G.children=Q;else if(1<ne){for(var ee=Array(ne),re=0;re<ne;re++)ee[re]=arguments[re+2];G.children=ee}return I(q.type,J,G)},mn.createContext=function(q){return q={$$typeof:l,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:i,_context:q},q},mn.createElement=function(q,M,Q){var G,J={},ne=null;if(M!=null)for(G in M.key!==void 0&&(ne=""+M.key),M)N.call(M,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=M[G]);var ee=arguments.length-2;if(ee===1)J.children=Q;else if(1<ee){for(var re=Array(ee),ie=0;ie<ee;ie++)re[ie]=arguments[ie+2];J.children=re}if(q&&q.defaultProps)for(G in ee=q.defaultProps,ee)J[G]===void 0&&(J[G]=ee[G]);return I(q,ne,J)},mn.createRef=function(){return{current:null}},mn.forwardRef=function(q){return{$$typeof:c,render:q}},mn.isValidElement=R,mn.lazy=function(q){return{$$typeof:f,_payload:{_status:-1,_result:q},_init:W}},mn.memo=function(q,M){return{$$typeof:d,type:q,compare:M===void 0?null:M}},mn.startTransition=function(q){var M=j.T,Q={};j.T=Q;try{var G=q(),J=j.S;J!==null&&J(Q,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,L)}catch(ne){L(ne)}finally{M!==null&&Q.types!==null&&(M.types=Q.types),j.T=M}},mn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},mn.use=function(q){return j.H.use(q)},mn.useActionState=function(q,M,Q){return j.H.useActionState(q,M,Q)},mn.useCallback=function(q,M){return j.H.useCallback(q,M)},mn.useContext=function(q){return j.H.useContext(q)},mn.useDebugValue=function(){},mn.useDeferredValue=function(q,M){return j.H.useDeferredValue(q,M)},mn.useEffect=function(q,M){return j.H.useEffect(q,M)},mn.useEffectEvent=function(q){return j.H.useEffectEvent(q)},mn.useId=function(){return j.H.useId()},mn.useImperativeHandle=function(q,M,Q){return j.H.useImperativeHandle(q,M,Q)},mn.useInsertionEffect=function(q,M){return j.H.useInsertionEffect(q,M)},mn.useLayoutEffect=function(q,M){return j.H.useLayoutEffect(q,M)},mn.useMemo=function(q,M){return j.H.useMemo(q,M)},mn.useOptimistic=function(q,M){return j.H.useOptimistic(q,M)},mn.useReducer=function(q,M,Q){return j.H.useReducer(q,M,Q)},mn.useRef=function(q){return j.H.useRef(q)},mn.useState=function(q){return j.H.useState(q)},mn.useSyncExternalStore=function(q,M,Q){return j.H.useSyncExternalStore(q,M,Q)},mn.useTransition=function(){return j.H.useTransition()},mn.version="19.2.5",mn}var swe;function EE(){return swe||(swe=1,tU.exports=Xkt()),tU.exports}var b=EE();const Te=Bo(b),YS=WBe({__proto__:null,default:Te},[b]);var rU={exports:{}},xj={},nU={exports:{}},sU={};var awe;function Kkt(){return awe||(awe=1,(function(e){function t(F,B){var H=F.length;F.push(B);e:for(;0<H;){var W=H-1>>>1,L=F[W];if(0<s(L,B))F[W]=B,F[H]=L,H=W;else break e}}function r(F){return F.length===0?null:F[0]}function n(F){if(F.length===0)return null;var B=F[0],H=F.pop();if(H!==B){F[0]=H;e:for(var W=0,L=F.length,Y=L>>>1;W<Y;){var q=2*(W+1)-1,M=F[q],Q=q+1,G=F[Q];if(0>s(M,H))Q<L&&0>s(G,M)?(F[W]=G,F[Q]=H,W=Q):(F[W]=M,F[q]=H,W=q);else if(Q<L&&0>s(G,H))F[W]=G,F[Q]=H,W=Q;else break e}}return B}function s(F,B){var H=F.sortIndex-B.sortIndex;return H!==0?H:F.id-B.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,v=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(F){for(var B=r(u);B!==null;){if(B.callback===null)n(u);else if(B.startTime<=F)n(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=r(u)}}function _(F){if(g=!1,k(F),!m)if(r(c)!==null)m=!0,E||(E=!0,R());else{var B=r(u);B!==null&&U(_,B.startTime-F)}}var E=!1,T=-1,j=5,N=-1;function I(){return v?!0:!(e.unstable_now()-N<j)}function P(){if(v=!1,E){var F=e.unstable_now();N=F;var B=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),p=!0;var H=h;try{t:{for(k(F),f=r(c);f!==null&&!(f.expirationTime>F&&I());){var W=f.callback;if(typeof W=="function"){f.callback=null,h=f.priorityLevel;var L=W(f.expirationTime<=F);if(F=e.unstable_now(),typeof L=="function"){f.callback=L,k(F),B=!0;break t}f===r(c)&&n(c),k(F)}else n(c);f=r(c)}if(f!==null)B=!0;else{var Y=r(u);Y!==null&&U(_,Y.startTime-F),B=!1}}break e}finally{f=null,h=H,p=!1}B=void 0}}finally{B?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,D=z.port2;z.port1.onmessage=P,R=function(){D.postMessage(null)}}else R=function(){x(P,0)};function U(F,B){T=x(function(){F(e.unstable_now())},B)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(F){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var H=h;h=B;try{return F()}finally{h=H}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(F,B){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var H=h;h=F;try{return B()}finally{h=H}},e.unstable_scheduleCallback=function(F,B,H){var W=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?W+H:W):H=W,F){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,F={id:d++,callback:B,priorityLevel:F,startTime:H,expirationTime:L,sortIndex:-1},H>W?(F.sortIndex=H,t(u,F),r(c)===null&&F===r(u)&&(g?(w(T),T=-1):g=!0,U(_,H-W))):(F.sortIndex=L,t(c,F),m||p||(m=!0,E||(E=!0,R()))),F},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(F){var B=h;return function(){var H=h;h=B;try{return F.apply(this,arguments)}finally{h=H}}}})(sU)),sU}var iwe;function Jkt(){return iwe||(iwe=1,nU.exports=Kkt()),nU.exports}var aU={exports:{}},nc={};var owe;function e_t(){if(owe)return nc;owe=1;var e=EE();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 nc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,nc.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)},nc.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()}},nc.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))},nc.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},nc.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})}},nc.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)},nc.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})}},nc.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)},nc.requestFormReset=function(c){n.d.r(c)},nc.unstable_batchedUpdates=function(c,u){return c(u)},nc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},nc.useFormStatus=function(){return i.H.useHostTransitionStatus()},nc.version="19.2.5",nc}var lwe;function GBe(){if(lwe)return aU.exports;lwe=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(),aU.exports=e_t(),aU.exports}var cwe;function t_t(){if(cwe)return xj;cwe=1;var e={env:{}};var t=Jkt(),r=EE(),n=GBe();function s(y){var O="https://react.dev/errors/"+y;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 #"+y+"; visit "+O+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function i(y){var O=y,C=y;if(y.alternate)for(;O.return;)O=O.return;else{y=O;do O=y,(O.flags&4098)!==0&&(C=O.return),y=O.return;while(y)}return O.tag===3?C:null}function l(y){if(y.tag===13){var O=y.memoizedState;if(O===null&&(y=y.alternate,y!==null&&(O=y.memoizedState)),O!==null)return O.dehydrated}return null}function c(y){if(y.tag===31){var O=y.memoizedState;if(O===null&&(y=y.alternate,y!==null&&(O=y.memoizedState)),O!==null)return O.dehydrated}return null}function u(y){if(i(y)!==y)throw Error(s(188))}function d(y){var O=y.alternate;if(!O){if(O=i(y),O===null)throw Error(s(188));return O!==y?null:y}for(var C=y,A=O;;){var $=C.return;if($===null)break;var V=$.alternate;if(V===null){if(A=$.return,A!==null){C=A;continue}break}if($.child===V.child){for(V=$.child;V;){if(V===C)return u($),y;if(V===A)return u($),O;V=V.sibling}throw Error(s(188))}if(C.return!==A.return)C=$,A=V;else{for(var te=!1,de=$.child;de;){if(de===C){te=!0,C=$,A=V;break}if(de===A){te=!0,A=$,C=V;break}de=de.sibling}if(!te){for(de=V.child;de;){if(de===C){te=!0,C=V,A=$;break}if(de===A){te=!0,A=V,C=$;break}de=de.sibling}if(!te)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?y:O}function f(y){var O=y.tag;if(O===5||O===26||O===27||O===6)return y;for(y=y.child;y!==null;){if(O=f(y),O!==null)return O;y=y.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=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 z(y){return y===null||typeof y!="object"?null:(y=R&&y[R]||y["@@iterator"],typeof y=="function"?y:null)}var D=Symbol.for("react.client.reference");function U(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===D?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case v:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof y=="object")switch(y.$$typeof){case g:return"Portal";case k:return y.displayName||"Context";case S:return(y._context.displayName||"Context")+".Consumer";case _:var O=y.render;return y=y.displayName,y||(y=O.displayName||O.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case j:return O=y.displayName||null,O!==null?O:U(y.type)||"Memo";case N:O=y._payload,y=y._init;try{return U(y(O))}catch{}}return null}var F=Array.isArray,B=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,W={pending:!1,data:null,method:null,action:null},L=[],Y=-1;function q(y){return{current:y}}function M(y){0>Y||(y.current=L[Y],L[Y]=null,Y--)}function Q(y,O){Y++,L[Y]=y.current,y.current=O}var G=q(null),J=q(null),ne=q(null),ee=q(null);function re(y,O){switch(Q(ne,O),Q(J,y),Q(G,null),O.nodeType){case 9:case 11:y=(y=O.documentElement)&&(y=y.namespaceURI)?k0e(y):0;break;default:if(y=O.tagName,O=O.namespaceURI)O=k0e(O),y=_0e(O,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}M(G),Q(G,y)}function ie(){M(G),M(J),M(ne)}function ce(y){y.memoizedState!==null&&Q(ee,y);var O=G.current,C=_0e(O,y.type);O!==C&&(Q(J,y),Q(G,C))}function K(y){J.current===y&&(M(G),M(J)),ee.current===y&&(M(ee),mj._currentValue=W)}var ae,le;function xe(y){if(ae===void 0)try{throw Error()}catch(C){var O=C.stack.trim().match(/\n( *(at )?)/);ae=O&&O[1]||"",le=-1<C.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+ae+y+le}var fe=!1;function he(y,O){if(!y||fe)return"";fe=!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(y,[],ut)}else{try{ut.call()}catch(et){Ze=et}y.call(ut.prototype)}}else{try{throw Error()}catch(et){Ze=et}(ut=y())&&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 $=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");$&&$.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var V=A.DetermineComponentFrameRoot(),te=V[0],de=V[1];if(te&&de){var Ne=te.split(`
5
5
  `),We=de.split(`
@@ -109,7 +109,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
109
109
  constructor(\${params}) {
110
110
  \${}
111
111
  }
112
- }`,{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"})],IGe=Nue.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"})]),vke=new IHe,RGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ij(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const YHt=["FunctionDeclaration"],XHt={FunctionDeclaration:Ij("function"),ClassDeclaration:Ij("class"),ClassExpression:()=>!0,EnumDeclaration:Ij("constant"),TypeAliasDeclaration:Ij("type"),NamespaceDeclaration:Ij("namespace"),VariableDefinition(e,t){e.matchContext(YHt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function PGe(e,t){let r=vke.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=XHt[i.name];if(l&&l(i,a)||RGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of PGe(e,i.node))n.push(l);return!1}}),vke.set(t,n),n}const U3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Aue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function MGe(e){let t=Aa(e.state).resolveInner(e.pos,-1);if(Aue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&U3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)RGe.has(s.name)&&(n=n.concat(PGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:U3}}function iV(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 DGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Aa(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?iV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?iV(t,r.parent,""):Aue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&U3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?iV(t,r,""):e.explicit?{path:[],name:""}:null}function KHt(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 JHt(e){let t=new Map;return r=>{let n=DGe(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=KHt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:U3}}}const bh=aS.define({name:"javascript",parser:ZHt.configure({props:[i1.add({IfStatement:zk({except:/^\s*({|else\b)/}),TryStatement:zk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Z7t,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:G7t({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":zk({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),o1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":uue,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:"$"}}),LGe={test:e=>/^JSX/.test(e.name),facet:TF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Iue=bh.configure({dialect:"ts"},"typescript"),Rue=bh.configure({dialect:"jsx",props:[oue.add(e=>e.isTop?[LGe]:void 0)]}),Pue=bh.configure({dialect:"jsx ts",props:[oue.add(e=>e.isTop?[LGe]:void 0)]},"typescript");let $Ge=e=>({label:e,type:"keyword"});const FGe="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($Ge),eQt=FGe.concat(["declare","implements","private","protected","public"].map($Ge));function V3(e={}){let t=e.jsx?e.typescript?Pue:Rue:e.typescript?Iue:bh,r=e.typescript?IGe.concat(eQt):Nue.concat(FGe);return new oS(t,[bh.data.of({autocomplete:PUt(Aue,PWe(r))}),bh.data.of({autocomplete:MGe}),e.jsx?zGe:[]])}function tQt(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 yke(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 rQt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),zGe=ft.inputHandler.of((e,t,r,n,s)=>{if((rQt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!bh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=Aa(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=yke(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=tQt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=yke(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 nQt(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 bh.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(sQt(u,n.doc,c))}return s}}function bke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function sQt(e,t,r){let n=bke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?bke(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,l=a[0]+r.pos-n,c=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const rD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:zGe,completionPath:DGe,esLint:nQt,javascript:V3,javascriptLanguage:bh,jsxLanguage:Rue,localCompletionSource:MGe,scopeCompletionSource:JHt,snippets:Nue,tsxLanguage:Pue,typescriptLanguage:Iue,typescriptSnippets:IGe},Symbol.toStringTag,{value:"Module"})),Rj=["_blank","_self","_top","_parent"],oV=["ascii","utf-8","utf-16","latin1","latin1"],lV=["get","post","put","delete"],cV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],_d=["true","false"],Mr={},aQt={a:{attrs:{href:null,ping:null,type:null,media:null,target:Rj,hreflang:null}},abbr:Mr,address:Mr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Mr,aside:Mr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Mr,base:{attrs:{href:null,target:Rj}},bdi:Mr,bdo:Mr,blockquote:{attrs:{cite:null}},body:Mr,br:Mr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:cV,formmethod:lV,formnovalidate:["novalidate"],formtarget:Rj,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Mr,center:Mr,cite:Mr,code:Mr,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:Mr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Mr,div:Mr,dl:Mr,dt:Mr,em:Mr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Mr,figure:Mr,footer:Mr,form:{attrs:{action:null,name:null,"accept-charset":oV,autocomplete:["on","off"],enctype:cV,method:lV,novalidate:["novalidate"],target:Rj}},h1:Mr,h2:Mr,h3:Mr,h4:Mr,h5:Mr,h6:Mr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Mr,hgroup:Mr,hr:Mr,html:{attrs:{manifest:null}},i:Mr,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:cV,formmethod:lV,formnovalidate:["novalidate"],formtarget:Rj,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:Mr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Mr,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:Mr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:oV,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:Mr,noscript:Mr,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:Mr,param:{attrs:{name:null,value:null}},pre:Mr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Mr,rt:Mr,ruby:Mr,samp:Mr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:oV}},section:Mr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Mr,source:{attrs:{src:null,type:null,media:null}},span:Mr,strong:Mr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Mr,summary:Mr,sup:Mr,table:Mr,tbody:Mr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Mr,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:Mr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Mr,time:{attrs:{datetime:null}},title:Mr,tr:Mr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Mr,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:Mr},BGe={accesskey:null,class:null,contenteditable:_d,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:_d,autocorrect:_d,autocapitalize:_d,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":_d,"aria-autocomplete":["inline","list","both","none"],"aria-busy":_d,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":_d,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":_d,"aria-hidden":_d,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":_d,"aria-multiselectable":_d,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":_d,"aria-relevant":null,"aria-required":_d,"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},UGe="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 UGe)BGe[e]=null;let TA=class{constructor(t,r){this.tags={...aQt,...t},this.globalAttrs={...BGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};TA.default=new TA;function T_(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 N_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function VGe(e,t,r){let n=r.tags[T_(e,N_(t))];return n?.children||r.allTags}function Mue(e,t){let r=[];for(let n=N_(t);n&&!n.type.isTop;n=N_(n.parent)){let s=T_(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 qGe=/^[:\-\.\w\u00b7-\uffff]*$/;function xke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=N_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:VGe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Mue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function wke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Mue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:qGe}}function iQt(e,t,r,n){let s=[],a=0;for(let i of VGe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Mue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function oQt(e,t,r,n,s){let a=N_(r),i=a?t.tags[T_(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:qGe}}function lQt(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=N_(r),h=f?t.tags[T_(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 HGe(e,t){let{state:r,pos:n}=t,s=Aa(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)?wke(r,s,s.from,n):xke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?xke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?wke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?oQt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?lQt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?iQt(r,e,s,n):null}function QGe(e){return HGe(TA.default,e)}function WGe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new TA(t,r):TA.default;return s=>HGe(n,s)}const cQt=bh.parser.configure({top:"SingleExpression"}),GGe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Iue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Rue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Pue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:cQt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:bh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:jA.parser}],ZGe=[{name:"style",parser:jA.parser.configure({top:"Styles"})}].concat(UGe.map(e=>({name:e,parser:bh.parser}))),YGe=aS.define({name:"html",parser:$qt.configure({props:[i1.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}}),o1.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}}}),CWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),bN=YGe.configure({wrap:SGe(GGe,ZGe)});function XGe(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=SGe((e.nestedLanguages||[]).concat(GGe),(e.nestedAttributes||[]).concat(ZGe)));let n=r?YGe.configure({wrap:r,dialect:t}):t?bN.configure({dialect:t}):bN;return new oS(n,[bN.data.of({autocomplete:WGe(e)}),e.autoCloseTags!==!1?KGe:[],V3().support,NGe().support])}const Ske=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),KGe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!bN.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=Aa(i).resolveInner(p,-1),g;if(h&&n==">"&&m.name=="EndTag"){let v=m.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=T_(i.doc,v.parent,p))&&!Ske.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 v=m.parent;if(m.from==p-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=T_(i.doc,v,p))&&!Ske.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)}),uQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:KGe,html:XGe,htmlCompletionSource:QGe,htmlCompletionSourceWith:WGe,htmlLanguage:bN},Symbol.toStringTag,{value:"Module"})),JGe=TF({commentTokens:{block:{open:"<!--",close:"-->"}}}),eZe=new hn,tZe=zVt.configure({props:[o1.add(e=>!e.is("Block")||e.is("Document")||Wne(e)!=null||dQt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),eZe.add(Wne),i1.add({Document:()=>null}),Lb.add({Document:JGe})]});function Wne(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function dQt(e){return e.name=="OrderedList"||e.name=="BulletList"}function fQt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=Wne(n.type))!=null&&s<=t)break;r=n}return r.to}const hQt=mWe.of((e,t,r)=>{for(let n=Aa(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(eZe);if(s==null)continue;let a=fQt(n,s);if(a>r)return{from:r,to:a}}return null});function Due(e){return new Wd(JGe,e,[],"markdown")}const rZe=Due(tZe),pQt=tZe.configure([XVt,JVt,KVt,eqt,{props:[o1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),uS=Due(pQt);function mQt(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:iS.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class uV{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(+sZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function nZe(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 uV(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 uV(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 uV(a.parent,c,c+d,i[1],u,f,a))}}return n}function sZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function dV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=sZe(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 Lue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(UE)!=" ")return e;let n=Ap(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const aZe=(e={})=>({state:t,dispatch:r})=>{let n=Aa(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!uS.isActiveAt(t,l.from,-1)&&!uS.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=nZe(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"&&dV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&dV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=kke(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"&&dV(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?Ap(u.text,4,d[x+1].from)-g.length:null);let v=c;for(;v>u.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return g=Lue(g,t),gQt(f.node,t.doc)&&(g=kke(d,t,u)+t.lineBreak+g),p.push({from:v,to:c,insert:t.lineBreak+g}),{range:nt.cursor(v+g.length+1),changes:p}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},iZe=aZe();function Oke(e){return e.name=="QuoteMark"||e.name=="ListMark"}function gQt(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 kke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Ap(r.text,4,e[s+1].from)-n.length:null,s<a);return Lue(n,t)}function vQt(e,t){let r=e.resolveInner(t,-1),n=t;Oke(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Oke(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const oZe=({state:e,dispatch:t})=>{let r=Aa(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&uS.isActiveAt(e,a.from)){let c=l.lineAt(i),u=nZe(vQt(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(Ap(c.text,4,d.to)-Ap(c.text,4,d.from));return h==c.from&&(p=Lue(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)},lZe=[{key:"Enter",run:iZe},{key:"Backspace",run:oZe}],cZe=XGe({matchClosingTags:!1});function $ue(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=rZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=cZe}=e;if(!(s instanceof RF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,hQt],d;i&&u.push(uZe),r instanceof oS?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?mQt(t,d):void 0;c.push(UVt({codeParser:f,htmlParser:l.language.parser})),n&&u.push(Up.high(BE.of(lZe)));let h=Due(s.configure(c));return a&&u.push(h.data.of({autocomplete:yQt})),new oS(h,u)}function yQt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Aa(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:bQt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let fV=null;function bQt(){if(fV)return fV;let e=QGe(new pue(Fn.create({extensions:cZe}),0,!0));return fV=e?e.options:[]}const xQt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,uZe=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),!uS.isActiveAt(t.state,n.from,1)))return!1;let a=Aa(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||xQt.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)}}),wQt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:rZe,deleteMarkupBackward:oZe,insertNewlineContinueMarkup:iZe,insertNewlineContinueMarkupCommand:aZe,markdown:$ue,markdownKeymap:lZe,markdownLanguage:uS,pasteURLAsLink:uZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new oS(due.define(e))}function ib(e){return Ke(()=>import("./index-BIKsjXRb.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const dZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-eJruj9zP.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-eJruj9zP.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ib("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>yHt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-Bq5Vt_Xq.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(()=>uQt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-Df38TZCF.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-BIVFlF-F.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(()=>IUt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-DZfyhNgm.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-CpMM209E.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return ib("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>wQt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return ib("MSSQL")}}),Ye.of({name:"MySQL",load(){return ib("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-DRTkUPRL.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return ib("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return ib("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-Dl9ozwva.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-Fp-jSoe4.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-Dxa-PRih.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-Dxa-PRih.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return ib("StandardSQL")}}),Ye.of({name:"SQLite",load(){return ib("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-CIfWC49x.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-nRHqCrbi.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-xd0CinT-.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-C6m2-uD_.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-B0eYshLo.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function wx(){return wx=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},wx.apply(null,arguments)}var SQt=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=Vp.define(n),u=[l,Qx(c)];return u},OQt={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)"},kQt=[{tag:se.comment,color:"#6272a4"},{tag:se.string,color:"#f1fa8c"},{tag:se.atom,color:"#bd93f9"},{tag:se.meta,color:"#f8f8f2"},{tag:[se.keyword,se.operator,se.tagName],color:"#ff79c6"},{tag:[se.function(se.propertyName),se.propertyName],color:"#66d9ef"},{tag:[se.definition(se.variableName),se.function(se.variableName),se.className,se.attributeName],color:"#50fa7b"},{tag:se.atom,color:"#bd93f9"}],qE=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return SQt({theme:t,settings:wx({},OQt,r),styles:[...kQt,...n]})};qE();function Fue(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 _Qt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Bue(e.state,r.from);return n.line?EQt(e):n.block?jQt(e):!1};function zue(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 EQt=zue(AQt,0),CQt=zue(fZe,0),jQt=zue((e,t)=>fZe(e,t,NQt(t)),0);function Bue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Pj=50;function TQt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Pj,n),i=e.sliceDoc(s,s+Pj),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*Pj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Pj),f=e.sliceDoc(s-Pj,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 NQt(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 fZe(e,t,r=t.selection.ranges){let n=r.map(a=>Bue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>TQt(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 AQt(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=Bue(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 Gne=xg.define(),IQt=xg.define(),RQt=Kt.define(),hZe=Kt.define({combine(e){return wg(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)})}}),pZe=Oo.define({create(){return $m.empty},update(e,t){let r=t.state.facet(hZe),n=t.annotation(Gne);if(n){let c=Uu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=q3(d,d.length,r.minDepth,c):d=vZe(d,t.startState.selection),new $m(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(IQt);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=Uu.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 $m(e.done.map(Uu.fromJSON),e.undone.map(Uu.fromJSON))}});function PQt(e={}){return[pZe,hZe.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?mZe:t.inputType=="historyRedo"?Zne:null;return n?(t.preventDefault(),n(r)):!1}})]}function PF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(pZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const mZe=PF(0,!1),Zne=PF(1,!1),MQt=PF(0,!0),DQt=PF(1,!0);class Uu{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 Uu(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 Uu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Zm.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(RQt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new Uu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,dh)}static selection(t){return new Uu(void 0,dh,void 0,void 0,t)}}function q3(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 LQt(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 $Qt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function gZe(e,t){return e.length?t.length?e.concat(t):e:t}const dh=[],FQt=200;function vZe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-FQt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),q3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[Uu.selection([t])]}function zQt(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 hV(e,t){if(!e.length)return e;let r=e.length,n=dh;for(;r;){let s=BQt(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?[Uu.selection(n)]:dh}function BQt(e,t,r){let n=gZe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):dh,r);if(!e.changes)return Uu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Uu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const UQt=/^(input\.type|delete)($|\.)/;class $m{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 $m(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||UQt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,LQt(l.changes,t.changes))||n=="input.type.compose")?i=q3(i,i.length-1,s.minDepth,new Uu(t.changes.compose(l.changes),gZe(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,dh)):i=q3(i,i.length,s.minDepth,t),new $m(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)&&$Qt(a[a.length-1],t)?this:new $m(vZe(this.done,t),this.undone,r,n)}addMapping(t){return new $m(hV(this.done,t),hV(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:Gne.of({side:t,rest:zQt(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=hV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:Gne.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}$m.empty=new $m(dh,dh);const VQt=[{key:"Mod-z",run:mZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Zne,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Zne,preventDefault:!0},{key:"Mod-u",run:MQt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:DQt,preventDefault:!0}];function HE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function qp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Hp({state:e,dispatch:t},r){let n=HE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(qp(e,n)),!0)}function MF(e,t){return nt.cursor(t?e.to:e.from)}function yZe(e,t){return Hp(e,r=>r.empty?e.moveByChar(r,t):MF(r,t))}function Tc(e){return e.textDirectionAt(e.state.selection.main.head)==Da.LTR}const bZe=e=>yZe(e,!Tc(e)),xZe=e=>yZe(e,Tc(e));function wZe(e,t){return Hp(e,r=>r.empty?e.moveByGroup(r,t):MF(r,t))}const qQt=e=>wZe(e,!Tc(e)),HQt=e=>wZe(e,Tc(e));function QQt(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 DF(e,t,r){let n=Aa(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;QQt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Lm(e,n.from,1):Lm(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 WQt=e=>Hp(e,t=>DF(e.state,t,!Tc(e))),GQt=e=>Hp(e,t=>DF(e.state,t,Tc(e)));function SZe(e,t){return Hp(e,r=>{if(!r.empty)return MF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const OZe=e=>SZe(e,!1),kZe=e=>SZe(e,!0);function _Ze(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 EZe(e,t){let r=_Ze(e),{state:n}=e,s=HE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):MF(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(qp(n,s),{effects:a}),!0}const _ke=e=>EZe(e,!1),Yne=e=>EZe(e,!0);function Wx(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 ZQt=e=>Hp(e,t=>Wx(e,t,!0)),YQt=e=>Hp(e,t=>Wx(e,t,!1)),XQt=e=>Hp(e,t=>Wx(e,t,!Tc(e))),KQt=e=>Hp(e,t=>Wx(e,t,Tc(e))),JQt=e=>Hp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),eWt=e=>Hp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function tWt(e,t,r){let n=!1,s=HE(e.selection,a=>{let i=Lm(e,a.head,-1)||Lm(e,a.head,1)||a.head>0&&Lm(e,a.head-1,1)||a.head<e.doc.length&&Lm(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(qp(e,s)),!0):!1}const rWt=({state:e,dispatch:t})=>tWt(e,t);function Fh(e,t){let r=HE(e.state.selection,n=>{let s=t(n);return nt.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(qp(e.state,r)),!0)}function CZe(e,t){return Fh(e,r=>e.moveByChar(r,t))}const jZe=e=>CZe(e,!Tc(e)),TZe=e=>CZe(e,Tc(e));function NZe(e,t){return Fh(e,r=>e.moveByGroup(r,t))}const nWt=e=>NZe(e,!Tc(e)),sWt=e=>NZe(e,Tc(e)),aWt=e=>Fh(e,t=>DF(e.state,t,!Tc(e))),iWt=e=>Fh(e,t=>DF(e.state,t,Tc(e)));function AZe(e,t){return Fh(e,r=>e.moveVertically(r,t))}const IZe=e=>AZe(e,!1),RZe=e=>AZe(e,!0);function PZe(e,t){return Fh(e,r=>e.moveVertically(r,t,_Ze(e).height))}const Eke=e=>PZe(e,!1),Cke=e=>PZe(e,!0),oWt=e=>Fh(e,t=>Wx(e,t,!0)),lWt=e=>Fh(e,t=>Wx(e,t,!1)),cWt=e=>Fh(e,t=>Wx(e,t,!Tc(e))),uWt=e=>Fh(e,t=>Wx(e,t,Tc(e))),dWt=e=>Fh(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),fWt=e=>Fh(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),jke=({state:e,dispatch:t})=>(t(qp(e,{anchor:0})),!0),Tke=({state:e,dispatch:t})=>(t(qp(e,{anchor:e.doc.length})),!0),Nke=({state:e,dispatch:t})=>(t(qp(e,{anchor:e.selection.main.anchor,head:0})),!0),Ake=({state:e,dispatch:t})=>(t(qp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),hWt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),pWt=({state:e,dispatch:t})=>{let r=LF(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},mWt=({state:e,dispatch:t})=>{let r=HE(e.selection,n=>{let s=Aa(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(qp(e,r)),!0)};function MZe(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(qp(r,nt.create(s,s.length-1))),!0)}const gWt=e=>MZe(e,!1),vWt=e=>MZe(e,!0),yWt=({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(qp(e,n)),!0):!1};function UR(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(r="delete.backward",c=nD(e,c,!1)):c>i&&(r="delete.forward",c=nD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=nD(e,i,!1),l=nD(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:nt.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ft.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function nD(e,t,r){if(e instanceof ft)for(let n of e.state.facet(ft.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const DZe=(e,t,r)=>UR(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=Ap(l,a.tabSize),d=u%lS(a)||lS(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=bl(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=bl(i.text,c-i.from,!1,!1)+i.from);return c}),Xne=e=>DZe(e,!1,!0),LZe=e=>DZe(e,!0,!1),$Ze=(e,t)=>UR(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=bl(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}),FZe=e=>$Ze(e,!1),bWt=e=>$Ze(e,!0),xWt=e=>UR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),wWt=e=>UR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),SWt=e=>UR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),OWt=({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},kWt=({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:bl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:bl(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 LF(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function zZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of LF(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 _Wt=({state:e,dispatch:t})=>zZe(e,t,!1),EWt=({state:e,dispatch:t})=>zZe(e,t,!0);function BZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of LF(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 CWt=({state:e,dispatch:t})=>BZe(e,t,!1),jWt=({state:e,dispatch:t})=>BZe(e,t,!0),TWt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(LF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=HE(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),l=e.coordsAtPos(s.head,s.assoc||1);l&&(a=i.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function NWt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Aa(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 Ike=UZe(!1),AWt=UZe(!0);function UZe(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&&NWt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new NF(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=lue(u,a);for(d==null&&(d=Ap(/^\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=["",xA(t,d)];return c&&f.push(xA(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 Uue(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 IWt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new NF(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=Uue(e,(a,i,l)=>{let c=lue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=xA(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},VZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Uue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(UE)})}),{userEvent:"input.indent"})),!0),qZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Uue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Ap(s,e.tabSize),i=0,l=xA(e,Math.max(0,a-lS(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),RWt=e=>(e.setTabFocusMode(),!0),PWt=[{key:"Ctrl-b",run:bZe,shift:jZe,preventDefault:!0},{key:"Ctrl-f",run:xZe,shift:TZe},{key:"Ctrl-p",run:OZe,shift:IZe},{key:"Ctrl-n",run:kZe,shift:RZe},{key:"Ctrl-a",run:JQt,shift:dWt},{key:"Ctrl-e",run:eWt,shift:fWt},{key:"Ctrl-d",run:LZe},{key:"Ctrl-h",run:Xne},{key:"Ctrl-k",run:xWt},{key:"Ctrl-Alt-h",run:FZe},{key:"Ctrl-o",run:OWt},{key:"Ctrl-t",run:kWt},{key:"Ctrl-v",run:Yne}],MWt=[{key:"ArrowLeft",run:bZe,shift:jZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:qQt,shift:nWt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:XQt,shift:cWt,preventDefault:!0},{key:"ArrowRight",run:xZe,shift:TZe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:HQt,shift:sWt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:KQt,shift:uWt,preventDefault:!0},{key:"ArrowUp",run:OZe,shift:IZe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:jke,shift:Nke},{mac:"Ctrl-ArrowUp",run:_ke,shift:Eke},{key:"ArrowDown",run:kZe,shift:RZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Tke,shift:Ake},{mac:"Ctrl-ArrowDown",run:Yne,shift:Cke},{key:"PageUp",run:_ke,shift:Eke},{key:"PageDown",run:Yne,shift:Cke},{key:"Home",run:YQt,shift:lWt,preventDefault:!0},{key:"Mod-Home",run:jke,shift:Nke},{key:"End",run:ZQt,shift:oWt,preventDefault:!0},{key:"Mod-End",run:Tke,shift:Ake},{key:"Enter",run:Ike,shift:Ike},{key:"Mod-a",run:hWt},{key:"Backspace",run:Xne,shift:Xne,preventDefault:!0},{key:"Delete",run:LZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:FZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:bWt,preventDefault:!0},{mac:"Mod-Backspace",run:wWt,preventDefault:!0},{mac:"Mod-Delete",run:SWt,preventDefault:!0}].concat(PWt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),DWt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:WQt,shift:aWt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:GQt,shift:iWt},{key:"Alt-ArrowUp",run:_Wt},{key:"Shift-Alt-ArrowUp",run:CWt},{key:"Alt-ArrowDown",run:EWt},{key:"Shift-Alt-ArrowDown",run:jWt},{key:"Mod-Alt-ArrowUp",run:gWt},{key:"Mod-Alt-ArrowDown",run:vWt},{key:"Escape",run:yWt},{key:"Mod-Enter",run:AWt},{key:"Alt-l",mac:"Ctrl-l",run:pWt},{key:"Mod-i",run:mWt,preventDefault:!0},{key:"Mod-[",run:qZe},{key:"Mod-]",run:VZe},{key:"Mod-Alt-\\",run:IWt},{key:"Shift-Mod-k",run:TWt},{key:"Shift-Mod-\\",run:rWt},{key:"Mod-/",run:_Qt},{key:"Alt-A",run:CQt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:RWt}].concat(MWt),LWt={key:"Tab",run:VZe,shift:qZe},Rke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Gv{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(Rke(l)):Rke,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=Vce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=Cm(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"&&(Gv.prototype[Symbol.iterator]=function(){return this});const HZe={from:-1,to:-1,match:/.*/.exec("")},Vue="gm"+(/x/.unicode==null?"":"u");class QZe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=HZe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new WZe(t,r,n,s,a);this.re=new RegExp(r,Vue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=H3(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=H3(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 pV=new WeakMap;class Uk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=pV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Uk(r,t.sliceString(r,n));return pV.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)),pV.set(t,new Uk(i,a)),new Uk(r,a.slice(r-i,n-i))}}class WZe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=HZe,this.matchPos=H3(t,s),this.re=new RegExp(r,Vue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Uk.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=H3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Uk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(QZe.prototype[Symbol.iterator]=WZe.prototype[Symbol.iterator]=function(){return this});function $Wt(e){try{return new RegExp(e,Vue),!0}catch{return!1}}function H3(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 FWt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=_7t(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 v=p/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*v)}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},zWt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},BWt=Kt.define({combine(e){return wg(e,zWt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function UWt(e){return[WWt,QWt]}const VWt=er.mark({class:"cm-selectionMatch"}),qWt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Pke(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=bi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=bi.Word)}function HWt(e,t,r,n){return e(t.sliceDoc(r,r+1))==bi.Word&&e(t.sliceDoc(n-1,n))==bi.Word}const QWt=Si.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(BWt),{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),!(Pke(i,r,s.from,s.to)&&HWt(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 Gv(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Pke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(qWt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(VWt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),WWt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),GWt=({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 ZWt(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 Gv(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new Gv(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 YWt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return GWt({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=ZWt(e,n);return s?(t(e.update({selection:e.selection.addRange(nt.range(s.from,s.to),!1),effects:ft.scrollIntoView(s.to)})),!0):!1},QE=Kt.define({combine(e){return wg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new uGt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class GZe{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||$Wt(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"?`
112
+ }`,{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"})],IGe=Nue.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"})]),vke=new IHe,RGe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ij(e){return(t,r)=>{let n=t.node.getChild("VariableDefinition");return n&&r(n,e),!0}}const YHt=["FunctionDeclaration"],XHt={FunctionDeclaration:Ij("function"),ClassDeclaration:Ij("class"),ClassExpression:()=>!0,EnumDeclaration:Ij("constant"),TypeAliasDeclaration:Ij("type"),NamespaceDeclaration:Ij("namespace"),VariableDefinition(e,t){e.matchContext(YHt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function PGe(e,t){let r=vke.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=XHt[i.name];if(l&&l(i,a)||RGe.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of PGe(e,i.node))n.push(l);return!1}}),vke.set(t,n),n}const U3=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Aue=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function MGe(e){let t=Aa(e.state).resolveInner(e.pos,-1);if(Aue.indexOf(t.name)>-1)return null;let r=t.name=="VariableName"||t.to-t.from<20&&U3.test(e.state.sliceDoc(t.from,t.to));if(!r&&!e.explicit)return null;let n=[];for(let s=t;s;s=s.parent)RGe.has(s.name)&&(n=n.concat(PGe(e.state.doc,s)));return{options:n,from:r?t.from:e.pos,validFor:U3}}function iV(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 DGe(e){let t=n=>e.state.doc.sliceString(n.from,n.to),r=Aa(e.state).resolveInner(e.pos,-1);return r.name=="PropertyName"?iV(t,r.parent,t(r)):(r.name=="."||r.name=="?.")&&r.parent.name=="MemberExpression"?iV(t,r.parent,""):Aue.indexOf(r.name)>-1?null:r.name=="VariableName"||r.to-r.from<20&&U3.test(t(r))?{path:[],name:t(r)}:r.name=="MemberExpression"?iV(t,r,""):e.explicit?{path:[],name:""}:null}function KHt(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 JHt(e){let t=new Map;return r=>{let n=DGe(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=KHt(s,!n.path.length)),{from:r.pos-n.name.length,options:a,validFor:U3}}}const bh=aS.define({name:"javascript",parser:ZHt.configure({props:[i1.add({IfStatement:zk({except:/^\s*({|else\b)/}),TryStatement:zk({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Z7t,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:G7t({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":zk({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),o1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":uue,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:"$"}}),LGe={test:e=>/^JSX/.test(e.name),facet:TF({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Iue=bh.configure({dialect:"ts"},"typescript"),Rue=bh.configure({dialect:"jsx",props:[oue.add(e=>e.isTop?[LGe]:void 0)]}),Pue=bh.configure({dialect:"jsx ts",props:[oue.add(e=>e.isTop?[LGe]:void 0)]},"typescript");let $Ge=e=>({label:e,type:"keyword"});const FGe="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($Ge),eQt=FGe.concat(["declare","implements","private","protected","public"].map($Ge));function V3(e={}){let t=e.jsx?e.typescript?Pue:Rue:e.typescript?Iue:bh,r=e.typescript?IGe.concat(eQt):Nue.concat(FGe);return new oS(t,[bh.data.of({autocomplete:PUt(Aue,PWe(r))}),bh.data.of({autocomplete:MGe}),e.jsx?zGe:[]])}function tQt(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 yke(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 rQt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),zGe=ft.inputHandler.of((e,t,r,n,s)=>{if((rQt?e.composing:e.compositionStarted)||e.state.readOnly||t!=r||n!=">"&&n!="/"||!bh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=Aa(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=yke(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=tQt(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(h=yke(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 nQt(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 bh.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(sQt(u,n.doc,c))}return s}}function bke(e,t,r,n){return r.line(e+n.line).from+t+(e==1?n.col-1:-1)}function sQt(e,t,r){let n=bke(e.line,e.column,t,r),s={from:n,to:e.endLine!=null&&e.endColumn!=1?bke(e.endLine,e.endColumn,t,r):n,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:a,text:i}=e.fix,l=a[0]+r.pos-n,c=a[1]+r.pos-n;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const rD=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:zGe,completionPath:DGe,esLint:nQt,javascript:V3,javascriptLanguage:bh,jsxLanguage:Rue,localCompletionSource:MGe,scopeCompletionSource:JHt,snippets:Nue,tsxLanguage:Pue,typescriptLanguage:Iue,typescriptSnippets:IGe},Symbol.toStringTag,{value:"Module"})),Rj=["_blank","_self","_top","_parent"],oV=["ascii","utf-8","utf-16","latin1","latin1"],lV=["get","post","put","delete"],cV=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],_d=["true","false"],Mr={},aQt={a:{attrs:{href:null,ping:null,type:null,media:null,target:Rj,hreflang:null}},abbr:Mr,address:Mr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Mr,aside:Mr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Mr,base:{attrs:{href:null,target:Rj}},bdi:Mr,bdo:Mr,blockquote:{attrs:{cite:null}},body:Mr,br:Mr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:cV,formmethod:lV,formnovalidate:["novalidate"],formtarget:Rj,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Mr,center:Mr,cite:Mr,code:Mr,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:Mr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Mr,div:Mr,dl:Mr,dt:Mr,em:Mr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Mr,figure:Mr,footer:Mr,form:{attrs:{action:null,name:null,"accept-charset":oV,autocomplete:["on","off"],enctype:cV,method:lV,novalidate:["novalidate"],target:Rj}},h1:Mr,h2:Mr,h3:Mr,h4:Mr,h5:Mr,h6:Mr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Mr,hgroup:Mr,hr:Mr,html:{attrs:{manifest:null}},i:Mr,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:cV,formmethod:lV,formnovalidate:["novalidate"],formtarget:Rj,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:Mr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Mr,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:Mr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:oV,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:Mr,noscript:Mr,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:Mr,param:{attrs:{name:null,value:null}},pre:Mr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Mr,rt:Mr,ruby:Mr,samp:Mr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:oV}},section:Mr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Mr,source:{attrs:{src:null,type:null,media:null}},span:Mr,strong:Mr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Mr,summary:Mr,sup:Mr,table:Mr,tbody:Mr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Mr,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:Mr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Mr,time:{attrs:{datetime:null}},title:Mr,tr:Mr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Mr,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:Mr},BGe={accesskey:null,class:null,contenteditable:_d,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:_d,autocorrect:_d,autocapitalize:_d,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":_d,"aria-autocomplete":["inline","list","both","none"],"aria-busy":_d,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":_d,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":_d,"aria-hidden":_d,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":_d,"aria-multiselectable":_d,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":_d,"aria-relevant":null,"aria-required":_d,"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},UGe="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 UGe)BGe[e]=null;let TA=class{constructor(t,r){this.tags={...aQt,...t},this.globalAttrs={...BGe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};TA.default=new TA;function T_(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 N_(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function VGe(e,t,r){let n=r.tags[T_(e,N_(t))];return n?.children||r.allTags}function Mue(e,t){let r=[];for(let n=N_(t);n&&!n.type.isTop;n=N_(n.parent)){let s=T_(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 qGe=/^[:\-\.\w\u00b7-\uffff]*$/;function xke(e,t,r,n,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=N_(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:s,options:VGe(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(Mue(e.doc,r).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function wke(e,t,r,n){let s=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:Mue(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:qGe}}function iQt(e,t,r,n){let s=[],a=0;for(let i of VGe(e.doc,r,t))s.push({label:"<"+i,type:"type"});for(let i of Mue(e.doc,r))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function oQt(e,t,r,n,s){let a=N_(r),i=a?t.tags[T_(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:qGe}}function lQt(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=N_(r),h=f?t.tags[T_(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 HGe(e,t){let{state:r,pos:n}=t,s=Aa(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)?wke(r,s,s.from,n):xke(r,e,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?xke(r,e,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?wke(r,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?oQt(r,e,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?lQt(r,e,s,s.name=="Is"?n:s.from,n):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?iQt(r,e,s,n):null}function QGe(e){return HGe(TA.default,e)}function WGe(e){let{extraTags:t,extraGlobalAttributes:r}=e,n=r||t?new TA(t,r):TA.default;return s=>HGe(n,s)}const cQt=bh.parser.configure({top:"SingleExpression"}),GGe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Iue.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Rue.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Pue.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:cQt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:bh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:jA.parser}],ZGe=[{name:"style",parser:jA.parser.configure({top:"Styles"})}].concat(UGe.map(e=>({name:e,parser:bh.parser}))),YGe=aS.define({name:"html",parser:$qt.configure({props:[i1.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}}),o1.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}}}),CWe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),bN=YGe.configure({wrap:SGe(GGe,ZGe)});function XGe(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=SGe((e.nestedLanguages||[]).concat(GGe),(e.nestedAttributes||[]).concat(ZGe)));let n=r?YGe.configure({wrap:r,dialect:t}):t?bN.configure({dialect:t}):bN;return new oS(n,[bN.data.of({autocomplete:WGe(e)}),e.autoCloseTags!==!1?KGe:[],V3().support,NGe().support])}const Ske=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),KGe=ft.inputHandler.of((e,t,r,n,s)=>{if(e.composing||e.state.readOnly||t!=r||n!=">"&&n!="/"||!bN.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=Aa(i).resolveInner(p,-1),g;if(h&&n==">"&&m.name=="EndTag"){let v=m.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=T_(i.doc,v.parent,p))&&!Ske.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 v=m.parent;if(m.from==p-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=T_(i.doc,v,p))&&!Ske.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)}),uQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:KGe,html:XGe,htmlCompletionSource:QGe,htmlCompletionSourceWith:WGe,htmlLanguage:bN},Symbol.toStringTag,{value:"Module"})),JGe=TF({commentTokens:{block:{open:"<!--",close:"-->"}}}),eZe=new hn,tZe=zVt.configure({props:[o1.add(e=>!e.is("Block")||e.is("Document")||Wne(e)!=null||dQt(e)?void 0:(t,r)=>({from:r.doc.lineAt(t.from).to,to:t.to})),eZe.add(Wne),i1.add({Document:()=>null}),Lb.add({Document:JGe})]});function Wne(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function dQt(e){return e.name=="OrderedList"||e.name=="BulletList"}function fQt(e,t){let r=e;for(;;){let n=r.nextSibling,s;if(!n||(s=Wne(n.type))!=null&&s<=t)break;r=n}return r.to}const hQt=mWe.of((e,t,r)=>{for(let n=Aa(e).resolveInner(r,-1);n&&!(n.from<t);n=n.parent){let s=n.type.prop(eZe);if(s==null)continue;let a=fQt(n,s);if(a>r)return{from:r,to:a}}return null});function Due(e){return new Wd(JGe,e,[],"markdown")}const rZe=Due(tZe),pQt=tZe.configure([XVt,JVt,KVt,eqt,{props:[o1.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),uS=Due(pQt);function mQt(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:iS.getSkippingParser(n.load());if(n)return n.parser}return t?t.parser:null}}class uV{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(+sZe(this.item,t)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function nZe(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 uV(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 uV(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 uV(a.parent,c,c+d,i[1],u,f,a))}}return n}function sZe(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function dV(e,t,r,n=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=sZe(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 Lue(e,t){let r=/^[ \t]*/.exec(e)[0].length;if(!r||t.facet(UE)!=" ")return e;let n=Ap(e,4,r),s="";for(let a=n;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(r)}const aZe=(e={})=>({state:t,dispatch:r})=>{let n=Aa(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!uS.isActiveAt(t,l.from,-1)&&!uS.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=nZe(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"&&dV(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&dV(S.item,s,E),{range:nt.cursor(k+_.length),changes:E}}else{let S=kke(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"&&dV(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?Ap(u.text,4,d[x+1].from)-g.length:null);let v=c;for(;v>u.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return g=Lue(g,t),gQt(f.node,t.doc)&&(g=kke(d,t,u)+t.lineBreak+g),p.push({from:v,to:c,insert:t.lineBreak+g}),{range:nt.cursor(v+g.length+1),changes:p}});return a?!1:(r(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},iZe=aZe();function Oke(e){return e.name=="QuoteMark"||e.name=="ListMark"}function gQt(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 kke(e,t,r){let n="";for(let s=0,a=e.length-2;s<=a;s++)n+=e[s].blank(s<a?Ap(r.text,4,e[s+1].from)-n.length:null,s<a);return Lue(n,t)}function vQt(e,t){let r=e.resolveInner(t,-1),n=t;Oke(r)&&(n=r.from,r=r.parent);for(let s;s=r.childBefore(n);)if(Oke(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")r=s.lastChild,n=r.to;else break;return r}const oZe=({state:e,dispatch:t})=>{let r=Aa(e),n=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&uS.isActiveAt(e,a.from)){let c=l.lineAt(i),u=nZe(vQt(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(Ap(c.text,4,d.to)-Ap(c.text,4,d.from));return h==c.from&&(p=Lue(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)},lZe=[{key:"Enter",run:iZe},{key:"Backspace",run:oZe}],cZe=XGe({matchClosingTags:!1});function $ue(e={}){let{codeLanguages:t,defaultCodeLanguage:r,addKeymap:n=!0,base:{parser:s}=rZe,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=cZe}=e;if(!(s instanceof RF))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,hQt],d;i&&u.push(uZe),r instanceof oS?(u.push(r.support),d=r.language):r&&(d=r);let f=t||d?mQt(t,d):void 0;c.push(UVt({codeParser:f,htmlParser:l.language.parser})),n&&u.push(Up.high(BE.of(lZe)));let h=Due(s.configure(c));return a&&u.push(h.data.of({autocomplete:yQt})),new oS(h,u)}function yQt(e){let{state:t,pos:r}=e,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(r-25,r));if(!n)return null;let s=Aa(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:bQt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let fV=null;function bQt(){if(fV)return fV;let e=QGe(new pue(Fn.create({extensions:cZe}),0,!0));return fV=e?e.options:[]}const xQt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,uZe=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),!uS.isActiveAt(t.state,n.from,1)))return!1;let a=Aa(t.state),i=!1;return a.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||xQt.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)}}),wQt=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:rZe,deleteMarkupBackward:oZe,insertNewlineContinueMarkup:iZe,insertNewlineContinueMarkupCommand:aZe,markdown:$ue,markdownKeymap:lZe,markdownLanguage:uS,pasteURLAsLink:uZe},Symbol.toStringTag,{value:"Module"}));function pt(e){return new oS(due.define(e))}function ib(e){return Ke(()=>import("./index-DyXMr5Sr.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const dZe=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return Ke(()=>import("./index-BR1-CN8-.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-BR1-CN8-.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ib("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return Ke(()=>Promise.resolve().then(()=>yHt),void 0,import.meta.url).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return Ke(()=>import("./index-QkfdAm36.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(()=>uQt),void 0,import.meta.url).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return Ke(()=>import("./index-IwjxwEgz.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Ke(()=>import("./index-DdSK5DLd.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(()=>IUt),void 0,import.meta.url).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return Ke(()=>import("./index-CUFhG44G.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return Ke(()=>import("./index-BnpFxttj.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return ib("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Ke(()=>Promise.resolve().then(()=>wQt),void 0,import.meta.url).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return ib("MSSQL")}}),Ye.of({name:"MySQL",load(){return ib("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Ke(()=>import("./index-CL4WKYIM.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return ib("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return ib("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Ke(()=>import("./index-DEkXmX_Q.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return Ke(()=>import("./index-BT1M4Tvm.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return Ke(()=>import("./index-BceBaibN.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-BceBaibN.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return ib("StandardSQL")}}),Ye.of({name:"SQLite",load(){return ib("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Ke(()=>Promise.resolve().then(()=>rD),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Ke(()=>import("./index-Cvyi01vl.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-DLVxKTWV.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-CwmEzW2b.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-D93D1PwR.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return Ke(()=>import("./index-vEgxgSsB.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function wx(){return wx=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},wx.apply(null,arguments)}var SQt=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=Vp.define(n),u=[l,Qx(c)];return u},OQt={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)"},kQt=[{tag:se.comment,color:"#6272a4"},{tag:se.string,color:"#f1fa8c"},{tag:se.atom,color:"#bd93f9"},{tag:se.meta,color:"#f8f8f2"},{tag:[se.keyword,se.operator,se.tagName],color:"#ff79c6"},{tag:[se.function(se.propertyName),se.propertyName],color:"#66d9ef"},{tag:[se.definition(se.variableName),se.function(se.variableName),se.className,se.attributeName],color:"#50fa7b"},{tag:se.atom,color:"#bd93f9"}],qE=e=>{var{theme:t="dark",settings:r={},styles:n=[]}=e||{};return SQt({theme:t,settings:wx({},OQt,r),styles:[...kQt,...n]})};qE();function Fue(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 _Qt=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=Bue(e.state,r.from);return n.line?EQt(e):n.block?jQt(e):!1};function zue(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 EQt=zue(AQt,0),CQt=zue(fZe,0),jQt=zue((e,t)=>fZe(e,t,NQt(t)),0);function Bue(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const Pj=50;function TQt(e,{open:t,close:r},n,s){let a=e.sliceDoc(n-Pj,n),i=e.sliceDoc(s,s+Pj),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*Pj?d=f=e.sliceDoc(n,s):(d=e.sliceDoc(n,n+Pj),f=e.sliceDoc(s-Pj,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 NQt(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 fZe(e,t,r=t.selection.ranges){let n=r.map(a=>Bue(t,a.from).block);if(!n.every(a=>a))return null;let s=r.map((a,i)=>TQt(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 AQt(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=Bue(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 Gne=xg.define(),IQt=xg.define(),RQt=Kt.define(),hZe=Kt.define({combine(e){return wg(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)})}}),pZe=Oo.define({create(){return $m.empty},update(e,t){let r=t.state.facet(hZe),n=t.annotation(Gne);if(n){let c=Uu.fromTransaction(t,n.selection),u=n.side,d=u==0?e.undone:e.done;return c?d=q3(d,d.length,r.minDepth,c):d=vZe(d,t.startState.selection),new $m(u==0?n.rest:d,u==0?d:n.rest)}let s=t.annotation(IQt);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=Uu.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 $m(e.done.map(Uu.fromJSON),e.undone.map(Uu.fromJSON))}});function PQt(e={}){return[pZe,hZe.of(e),ft.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?mZe:t.inputType=="historyRedo"?Zne:null;return n?(t.preventDefault(),n(r)):!1}})]}function PF(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let s=r.field(pZe,!1);if(!s)return!1;let a=s.pop(e,r,t);return a?(n(a),!0):!1}}const mZe=PF(0,!1),Zne=PF(1,!1),MQt=PF(0,!0),DQt=PF(1,!0);class Uu{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 Uu(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 Uu(t.changes&&Io.fromJSON(t.changes),[],t.mapped&&Zm.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(RQt)){let a=s(t);a.length&&(n=n.concat(a))}return!n.length&&t.changes.empty?null:new Uu(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,dh)}static selection(t){return new Uu(void 0,dh,void 0,void 0,t)}}function q3(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 LQt(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 $Qt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function gZe(e,t){return e.length?t.length?e.concat(t):e:t}const dh=[],FQt=200;function vZe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-FQt));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),q3(e,e.length-1,1e9,r.setSelAfter(n)))}else return[Uu.selection([t])]}function zQt(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 hV(e,t){if(!e.length)return e;let r=e.length,n=dh;for(;r;){let s=BQt(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?[Uu.selection(n)]:dh}function BQt(e,t,r){let n=gZe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):dh,r);if(!e.changes)return Uu.selection(n);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Uu(s,rn.mapEffects(e.effects,t),i,e.startSelection.map(a),n)}const UQt=/^(input\.type|delete)($|\.)/;class $m{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 $m(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||UQt.test(n))&&(!l.selectionsAfter.length&&r-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,LQt(l.changes,t.changes))||n=="input.type.compose")?i=q3(i,i.length-1,s.minDepth,new Uu(t.changes.compose(l.changes),gZe(rn.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,dh)):i=q3(i,i.length,s.minDepth,t),new $m(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)&&$Qt(a[a.length-1],t)?this:new $m(vZe(this.done,t),this.undone,r,n)}addMapping(t){return new $m(hV(this.done,t),hV(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:Gne.of({side:t,rest:zQt(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=hV(l,a.mapped)),r.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:Gne.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}$m.empty=new $m(dh,dh);const VQt=[{key:"Mod-z",run:mZe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Zne,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Zne,preventDefault:!0},{key:"Mod-u",run:MQt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:DQt,preventDefault:!0}];function HE(e,t){return nt.create(e.ranges.map(t),e.mainIndex)}function qp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Hp({state:e,dispatch:t},r){let n=HE(e.selection,r);return n.eq(e.selection,!0)?!1:(t(qp(e,n)),!0)}function MF(e,t){return nt.cursor(t?e.to:e.from)}function yZe(e,t){return Hp(e,r=>r.empty?e.moveByChar(r,t):MF(r,t))}function Tc(e){return e.textDirectionAt(e.state.selection.main.head)==Da.LTR}const bZe=e=>yZe(e,!Tc(e)),xZe=e=>yZe(e,Tc(e));function wZe(e,t){return Hp(e,r=>r.empty?e.moveByGroup(r,t):MF(r,t))}const qQt=e=>wZe(e,!Tc(e)),HQt=e=>wZe(e,Tc(e));function QQt(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 DF(e,t,r){let n=Aa(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;QQt(e,u,s)?n=u:c=r?u.to:u.from}let a=n.type.prop(s),i,l;return a&&(i=r?Lm(e,n.from,1):Lm(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 WQt=e=>Hp(e,t=>DF(e.state,t,!Tc(e))),GQt=e=>Hp(e,t=>DF(e.state,t,Tc(e)));function SZe(e,t){return Hp(e,r=>{if(!r.empty)return MF(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const OZe=e=>SZe(e,!1),kZe=e=>SZe(e,!0);function _Ze(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 EZe(e,t){let r=_Ze(e),{state:n}=e,s=HE(n.selection,i=>i.empty?e.moveVertically(i,t,r.height):MF(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(qp(n,s),{effects:a}),!0}const _ke=e=>EZe(e,!1),Yne=e=>EZe(e,!0);function Wx(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 ZQt=e=>Hp(e,t=>Wx(e,t,!0)),YQt=e=>Hp(e,t=>Wx(e,t,!1)),XQt=e=>Hp(e,t=>Wx(e,t,!Tc(e))),KQt=e=>Hp(e,t=>Wx(e,t,Tc(e))),JQt=e=>Hp(e,t=>nt.cursor(e.lineBlockAt(t.head).from,1)),eWt=e=>Hp(e,t=>nt.cursor(e.lineBlockAt(t.head).to,-1));function tWt(e,t,r){let n=!1,s=HE(e.selection,a=>{let i=Lm(e,a.head,-1)||Lm(e,a.head,1)||a.head>0&&Lm(e,a.head-1,1)||a.head<e.doc.length&&Lm(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(qp(e,s)),!0):!1}const rWt=({state:e,dispatch:t})=>tWt(e,t);function Fh(e,t){let r=HE(e.state.selection,n=>{let s=t(n);return nt.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(qp(e.state,r)),!0)}function CZe(e,t){return Fh(e,r=>e.moveByChar(r,t))}const jZe=e=>CZe(e,!Tc(e)),TZe=e=>CZe(e,Tc(e));function NZe(e,t){return Fh(e,r=>e.moveByGroup(r,t))}const nWt=e=>NZe(e,!Tc(e)),sWt=e=>NZe(e,Tc(e)),aWt=e=>Fh(e,t=>DF(e.state,t,!Tc(e))),iWt=e=>Fh(e,t=>DF(e.state,t,Tc(e)));function AZe(e,t){return Fh(e,r=>e.moveVertically(r,t))}const IZe=e=>AZe(e,!1),RZe=e=>AZe(e,!0);function PZe(e,t){return Fh(e,r=>e.moveVertically(r,t,_Ze(e).height))}const Eke=e=>PZe(e,!1),Cke=e=>PZe(e,!0),oWt=e=>Fh(e,t=>Wx(e,t,!0)),lWt=e=>Fh(e,t=>Wx(e,t,!1)),cWt=e=>Fh(e,t=>Wx(e,t,!Tc(e))),uWt=e=>Fh(e,t=>Wx(e,t,Tc(e))),dWt=e=>Fh(e,t=>nt.cursor(e.lineBlockAt(t.head).from)),fWt=e=>Fh(e,t=>nt.cursor(e.lineBlockAt(t.head).to)),jke=({state:e,dispatch:t})=>(t(qp(e,{anchor:0})),!0),Tke=({state:e,dispatch:t})=>(t(qp(e,{anchor:e.doc.length})),!0),Nke=({state:e,dispatch:t})=>(t(qp(e,{anchor:e.selection.main.anchor,head:0})),!0),Ake=({state:e,dispatch:t})=>(t(qp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),hWt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),pWt=({state:e,dispatch:t})=>{let r=LF(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},mWt=({state:e,dispatch:t})=>{let r=HE(e.selection,n=>{let s=Aa(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(qp(e,r)),!0)};function MZe(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(qp(r,nt.create(s,s.length-1))),!0)}const gWt=e=>MZe(e,!1),vWt=e=>MZe(e,!0),yWt=({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(qp(e,n)),!0):!1};function UR(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,s=n.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(r="delete.backward",c=nD(e,c,!1)):c>i&&(r="delete.forward",c=nD(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=nD(e,i,!1),l=nD(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:nt.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(n.update(s,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?ft.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function nD(e,t,r){if(e instanceof ft)for(let n of e.state.facet(ft.atomicRanges).map(s=>s(e)))n.between(t,t,(s,a)=>{s<t&&a>t&&(t=r?a:s)});return t}const DZe=(e,t,r)=>UR(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=Ap(l,a.tabSize),d=u%lS(a)||lS(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=bl(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=bl(i.text,c-i.from,!1,!1)+i.from);return c}),Xne=e=>DZe(e,!1,!0),LZe=e=>DZe(e,!0,!1),$Ze=(e,t)=>UR(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=bl(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}),FZe=e=>$Ze(e,!1),bWt=e=>$Ze(e,!0),xWt=e=>UR(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),wWt=e=>UR(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),SWt=e=>UR(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),OWt=({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},kWt=({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:bl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:bl(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 LF(e){let t=[],r=-1;for(let n of e.selection.ranges){let s=e.doc.lineAt(n.from),a=e.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=e.doc.lineAt(n.to-1)),r>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(n)}else t.push({from:s.from,to:a.to,ranges:[n]});r=a.number+1}return t}function zZe(e,t,r){if(e.readOnly)return!1;let n=[],s=[];for(let a of LF(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 _Wt=({state:e,dispatch:t})=>zZe(e,t,!1),EWt=({state:e,dispatch:t})=>zZe(e,t,!0);function BZe(e,t,r){if(e.readOnly)return!1;let n=[];for(let a of LF(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 CWt=({state:e,dispatch:t})=>BZe(e,t,!1),jWt=({state:e,dispatch:t})=>BZe(e,t,!0),TWt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(LF(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),n=HE(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),l=e.coordsAtPos(s.head,s.assoc||1);l&&(a=i.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function NWt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=Aa(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 Ike=UZe(!1),AWt=UZe(!0);function UZe(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&&NWt(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new NF(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=lue(u,a);for(d==null&&(d=Ap(/^\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=["",xA(t,d)];return c&&f.push(xA(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 Uue(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 IWt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new NF(e,{overrideIndentation:a=>{let i=r[a];return i??-1}}),s=Uue(e,(a,i,l)=>{let c=lue(n,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=xA(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},VZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Uue(e,(r,n)=>{n.push({from:r.from,insert:e.facet(UE)})}),{userEvent:"input.indent"})),!0),qZe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Uue(e,(r,n)=>{let s=/^\s*/.exec(r.text)[0];if(!s)return;let a=Ap(s,e.tabSize),i=0,l=xA(e,Math.max(0,a-lS(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),RWt=e=>(e.setTabFocusMode(),!0),PWt=[{key:"Ctrl-b",run:bZe,shift:jZe,preventDefault:!0},{key:"Ctrl-f",run:xZe,shift:TZe},{key:"Ctrl-p",run:OZe,shift:IZe},{key:"Ctrl-n",run:kZe,shift:RZe},{key:"Ctrl-a",run:JQt,shift:dWt},{key:"Ctrl-e",run:eWt,shift:fWt},{key:"Ctrl-d",run:LZe},{key:"Ctrl-h",run:Xne},{key:"Ctrl-k",run:xWt},{key:"Ctrl-Alt-h",run:FZe},{key:"Ctrl-o",run:OWt},{key:"Ctrl-t",run:kWt},{key:"Ctrl-v",run:Yne}],MWt=[{key:"ArrowLeft",run:bZe,shift:jZe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:qQt,shift:nWt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:XQt,shift:cWt,preventDefault:!0},{key:"ArrowRight",run:xZe,shift:TZe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:HQt,shift:sWt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:KQt,shift:uWt,preventDefault:!0},{key:"ArrowUp",run:OZe,shift:IZe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:jke,shift:Nke},{mac:"Ctrl-ArrowUp",run:_ke,shift:Eke},{key:"ArrowDown",run:kZe,shift:RZe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Tke,shift:Ake},{mac:"Ctrl-ArrowDown",run:Yne,shift:Cke},{key:"PageUp",run:_ke,shift:Eke},{key:"PageDown",run:Yne,shift:Cke},{key:"Home",run:YQt,shift:lWt,preventDefault:!0},{key:"Mod-Home",run:jke,shift:Nke},{key:"End",run:ZQt,shift:oWt,preventDefault:!0},{key:"Mod-End",run:Tke,shift:Ake},{key:"Enter",run:Ike,shift:Ike},{key:"Mod-a",run:hWt},{key:"Backspace",run:Xne,shift:Xne,preventDefault:!0},{key:"Delete",run:LZe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:FZe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:bWt,preventDefault:!0},{mac:"Mod-Backspace",run:wWt,preventDefault:!0},{mac:"Mod-Delete",run:SWt,preventDefault:!0}].concat(PWt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),DWt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:WQt,shift:aWt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:GQt,shift:iWt},{key:"Alt-ArrowUp",run:_Wt},{key:"Shift-Alt-ArrowUp",run:CWt},{key:"Alt-ArrowDown",run:EWt},{key:"Shift-Alt-ArrowDown",run:jWt},{key:"Mod-Alt-ArrowUp",run:gWt},{key:"Mod-Alt-ArrowDown",run:vWt},{key:"Escape",run:yWt},{key:"Mod-Enter",run:AWt},{key:"Alt-l",mac:"Ctrl-l",run:pWt},{key:"Mod-i",run:mWt,preventDefault:!0},{key:"Mod-[",run:qZe},{key:"Mod-]",run:VZe},{key:"Mod-Alt-\\",run:IWt},{key:"Shift-Mod-k",run:TWt},{key:"Shift-Mod-\\",run:rWt},{key:"Mod-/",run:_Qt},{key:"Alt-A",run:CQt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:RWt}].concat(MWt),LWt={key:"Tab",run:VZe,shift:qZe},Rke=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Gv{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(Rke(l)):Rke,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=Vce(t),n=this.bufferStart+this.bufferPos;this.bufferPos+=Cm(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"&&(Gv.prototype[Symbol.iterator]=function(){return this});const HZe={from:-1,to:-1,match:/.*/.exec("")},Vue="gm"+(/x/.unicode==null?"":"u");class QZe{constructor(t,r,n,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=HZe,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new WZe(t,r,n,s,a);this.re=new RegExp(r,Vue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=H3(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=H3(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 pV=new WeakMap;class Uk{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,n){let s=pV.get(t);if(!s||s.from>=n||s.to<=r){let l=new Uk(r,t.sliceString(r,n));return pV.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)),pV.set(t,new Uk(i,a)),new Uk(r,a.slice(r-i,n-i))}}class WZe{constructor(t,r,n,s,a){this.text=t,this.to=a,this.done=!1,this.value=HZe,this.matchPos=H3(t,s),this.re=new RegExp(r,Vue+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=Uk.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t&&(this.re.lastIndex=t+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,s=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,r)))return this.value={from:n,to:s,match:r},this.matchPos=H3(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Uk.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(QZe.prototype[Symbol.iterator]=WZe.prototype[Symbol.iterator]=function(){return this});function $Wt(e){try{return new RegExp(e,Vue),!0}catch{return!1}}function H3(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 FWt=e=>{let{state:t}=e,r=String(t.doc.lineAt(e.state.selection.main.head).number),{close:n,result:s}=_7t(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 v=p/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*v)}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},zWt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},BWt=Kt.define({combine(e){return wg(e,zWt,{highlightWordAroundCursor:(t,r)=>t||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function UWt(e){return[WWt,QWt]}const VWt=er.mark({class:"cm-selectionMatch"}),qWt=er.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Pke(e,t,r,n){return(r==0||e(t.sliceDoc(r-1,r))!=bi.Word)&&(n==t.doc.length||e(t.sliceDoc(n,n+1))!=bi.Word)}function HWt(e,t,r,n){return e(t.sliceDoc(r,r+1))==bi.Word&&e(t.sliceDoc(n-1,n))==bi.Word}const QWt=Si.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(BWt),{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),!(Pke(i,r,s.from,s.to)&&HWt(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 Gv(r.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||Pke(i,r,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(qWt.range(d,f)):(d>=s.to||f<=s.from)&&l.push(VWt.range(d,f)),l.length>t.maxMatches))return er.none}}return er.set(l)}},{decorations:e=>e.decorations}),WWt=ft.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),GWt=({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 ZWt(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 Gv(e.doc,t,n[n.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new Gv(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 YWt=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some(a=>a.from===a.to))return GWt({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=ZWt(e,n);return s?(t(e.update({selection:e.selection.addRange(nt.range(s.from,s.to),!1),effects:ft.scrollIntoView(s.to)})),!0):!1},QE=Kt.define({combine(e){return wg(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new uGt(t),scrollToMatch:t=>ft.scrollIntoView(t)})}});class GZe{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||$Wt(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"?`
113
113
  `: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 rGt(this):new JWt(this)}getCursor(t,r=0,n){let s=t.doc?t:Fn.create({doc:t});return n==null&&(n=s.doc.length),this.regexp?BO(this,s,r,n):zO(this,s,r,n)}}class ZZe{constructor(t){this.spec=t}}function XWt(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 zO(e,t,r,n){let s;return e.wholeWord&&(s=KWt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(s=XWt(e.test,t,s)),new Gv(t.doc,e.unquoted,r,n,e.caseSensitive?void 0:a=>a.toLowerCase(),s)}function KWt(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(Q3(s,r-a))!=bi.Word||t(W3(s,r-a))!=bi.Word)&&(t(W3(s,n-a))!=bi.Word||t(Q3(s,n-a))!=bi.Word))}class JWt extends ZZe{constructor(t){super(t)}nextMatch(t,r,n){let s=zO(this.spec,t,n,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,r+this.spec.unquoted.length);s=zO(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=zO(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=zO(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=zO(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 eGt(e,t,r){return(n,s,a)=>(!r||r(n,s,a))&&e(a[0],t,n,s)}function BO(e,t,r,n){let s;return e.wholeWord&&(s=tGt(t.charCategorizer(t.selection.main.head))),e.test&&(s=eGt(e.test,t,s)),new QZe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},r,n)}function Q3(e,t){return e.slice(bl(e,t,!1),t)}function W3(e,t){return e.slice(t,bl(e,t))}function tGt(e){return(t,r,n)=>!n[0].length||(e(Q3(n.input,n.index))!=bi.Word||e(W3(n.input,n.index))!=bi.Word)&&(e(W3(n.input,n.index+n[0].length))!=bi.Word||e(Q3(n.input,n.index+n[0].length))!=bi.Word)}class rGt extends ZZe{nextMatch(t,r,n){let s=BO(this.spec,t,n,t.doc.length).next();return s.done&&(s=BO(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=BO(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=BO(this.spec,t,0,t.doc.length),s=[];for(;!n.next().done;){if(s.length>=r)return null;s.push(n.value)}return s}highlight(t,r,n,s){let a=BO(this.spec,t,Math.max(0,r-250),Math.min(n+250,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}const NA=rn.define(),que=rn.define(),Vb=Oo.define({create(e){return new mV(Kne(e).create(),null)},update(e,t){for(let r of t.effects)r.is(NA)?e=new mV(r.value.create(),e.panel):r.is(que)&&(e=new mV(e.query,r.value?Hue:null));return e},provide:e=>bA.from(e,t=>t.panel)});class mV{constructor(t,r){this.query=t,this.panel=r}}const nGt=er.mark({class:"cm-searchMatch"}),sGt=er.mark({class:"cm-searchMatch cm-searchMatch-selected"}),aGt=Si.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Vb))}update(e){let t=e.state.field(Vb);(t!=e.startState.field(Vb)||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 lu;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?sGt:nGt)})}return n.finish()}},{decorations:e=>e.decorations});function VR(e){return t=>{let r=t.state.field(Vb,!1);return r&&r.query.spec.valid?e(t,r):KZe(t)}}const G3=VR((e,{query:t})=>{let{to:r}=e.state.selection.main,n=t.nextMatch(e.state,r,r);if(!n)return!1;let s=nt.single(n.from,n.to),a=e.state.facet(QE);return e.dispatch({selection:s,effects:[Que(e,n),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),XZe(e),!0}),Z3=VR((e,{query:t})=>{let{state:r}=e,{from:n}=r.selection.main,s=t.prevMatch(r,n,n);if(!s)return!1;let a=nt.single(s.from,s.to),i=e.state.facet(QE);return e.dispatch({selection:a,effects:[Que(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),XZe(e),!0}),iGt=VR((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)}),oGt=({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 Gv(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},Mke=VR((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(Que(e,i)),d.push(r.facet(QE).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),lGt=VR((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 Hue(e){return e.state.facet(QE).createPanel(e)}function Kne(e,t){var r,n,s,a,i;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(QE);return new GZe({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 YZe(e){let t=iue(e,Hue);return t&&t.dom.querySelector("[main-field]")}function XZe(e){let t=YZe(e);t&&t==e.root.activeElement&&t.select()}const KZe=e=>{let t=e.state.field(Vb,!1);if(t&&t.panel){let r=YZe(e);if(r&&r!=e.root.activeElement){let n=Kne(e.state,t.query.spec);n.valid&&e.dispatch({effects:NA.of(n)}),r.focus(),r.select()}}else e.dispatch({effects:[que.of(!0),t?NA.of(Kne(e.state,t.query.spec)):rn.appendConfig.of(fGt)]});return!0},JZe=e=>{let t=e.state.field(Vb,!1);if(!t||!t.panel)return!1;let r=iue(e,Hue);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:que.of(!1)}),!0},cGt=[{key:"Mod-f",run:KZe,scope:"editor search-panel"},{key:"F3",run:G3,shift:Z3,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:G3,shift:Z3,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:JZe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:oGt},{key:"Mod-Alt-g",run:FWt},{key:"Mod-d",run:YWt,preventDefault:!0}];class uGt{constructor(t){this.view=t;let r=this.query=t.state.field(Vb).query.spec;this.commit=this.commit.bind(this),this.searchField=_a("input",{value:r.search,placeholder:Ed(t,"Find"),"aria-label":Ed(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=_a("input",{value:r.replace,placeholder:Ed(t,"Replace"),"aria-label":Ed(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=_a("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=_a("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=_a("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(s,a,i){return _a("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=_a("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>G3(t),[Ed(t,"next")]),n("prev",()=>Z3(t),[Ed(t,"previous")]),n("select",()=>iGt(t),[Ed(t,"all")]),_a("label",null,[this.caseField,Ed(t,"match case")]),_a("label",null,[this.reField,Ed(t,"regexp")]),_a("label",null,[this.wordField,Ed(t,"by word")]),...t.state.readOnly?[]:[_a("br"),this.replaceField,n("replace",()=>Mke(t),[Ed(t,"replace")]),n("replaceAll",()=>lGt(t),[Ed(t,"replace all")])],_a("button",{name:"close",onclick:()=>JZe(t),"aria-label":Ed(t,"close"),type:"button"},["×"])])}commit(){let t=new GZe({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:NA.of(t)}))}keydown(t){DBt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Z3:G3)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Mke(this.view))}update(t){for(let r of t.transactions)for(let n of r.effects)n.is(NA)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(QE).top}}function Ed(e,t){return e.state.phrase(t)}const sD=30,aD=/[\s\.,:;?!]/;function Que(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),s=e.state.doc.lineAt(r).to,a=Math.max(n.from,t-sD),i=Math.min(s,r+sD),l=e.state.sliceDoc(a,i);if(a!=n.from){for(let c=0;c<sD;c++)if(!aD.test(l[c+1])&&aD.test(l[c])){l=l.slice(c);break}}if(i!=s){for(let c=l.length-1;c>l.length-sD;c--)if(!aD.test(l[c-1])&&aD.test(l[c])){l=l.slice(0,c);break}}return ft.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${n.number}.`)}const dGt=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"}}),fGt=[Vb,Up.low(aGt),dGt];class Dke{constructor(t,r,n){this.from=t,this.to=r,this.diagnostic=n}}class fw{constructor(t,r,n){this.diagnostics=t,this.panel=r,this.selected=n}static init(t,r,n){let s=n.facet(AA).markerFilter;s&&(t=s(t,n));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new lu,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,v)=>Math.min(g,v.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=_Gt(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 wGt(m),diagnostics:l.slice()}));else{let g=l.reduce((v,x)=>x.markClass?v+" "+x.markClass:v,"");i.add(h,p,er.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:l.slice(),inclusiveEnd:l.some(v=>v.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 fw(u,r,A_(u))}}function A_(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 Dke(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new Dke(n.from,a,n.diagnostic)}}),n}function hGt(e,t){let r=t.pos,n=t.end||r,s=e.state.facet(AA).hideOn(e,r,n);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(eYe))||e.changes.touchesRange(a.from,Math.max(a.to,n)))}function pGt(e,t){return e.field(Gd,!1)?t:t.concat(rn.appendConfig.of(EGt))}const eYe=rn.define(),Wue=rn.define(),tYe=rn.define(),Gd=Oo.define({create(){return new fw(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=A_(r,e.selected.diagnostic,a)||A_(r,null,a)}!r.size&&s&&t.state.facet(AA).autoPanel&&(s=null),e=new fw(r,s,n)}for(let r of t.effects)if(r.is(eYe)){let n=t.state.facet(AA).autoPanel?r.value.length?IA.open:null:e.panel;e=fw.init(r.value,n,t.state)}else r.is(Wue)?e=new fw(e.diagnostics,r.value?IA.open:null,e.selected):r.is(tYe)&&(e=new fw(e.diagnostics,e.panel,r.value));return e},provide:e=>[bA.from(e,t=>t.panel),ft.decorations.from(e,t=>t.diagnostics)]}),mGt=er.mark({class:"cm-lintRange cm-lintRange-active"});function gGt(e,t,r){let{diagnostics:n}=e.state.field(Gd),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(AA).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:vGt(e,s)}}}:null}function vGt(e,t){return _a("ul",{class:"cm-tooltip-lint"},t.map(r=>nYe(e,r,!1)))}const yGt=e=>{let t=e.state.field(Gd,!1);(!t||!t.panel)&&e.dispatch({effects:pGt(e.state,[Wue.of(!0)])});let r=iue(e,IA.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},Lke=e=>{let t=e.state.field(Gd,!1);return!t||!t.panel?!1:(e.dispatch({effects:Wue.of(!1)}),!0)},bGt=e=>{let t=e.state.field(Gd,!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)},xGt=[{key:"Mod-Shift-m",run:yGt,preventDefault:!0},{key:"F8",run:bGt}],AA=Kt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...wg(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:$ke,tooltipFilter:$ke,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 $ke(e,t){return e?t?(r,n)=>t(e(r,n),n):e:t}function rYe(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 nYe(e,t,r){var n;let s=r?rYe(t.actions):[];return _a("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},_a("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=A_(e.state.field(Gd).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),_a("u",u.slice(d,d+1)),u.slice(d+1)],h=a.markClass?" "+a.markClass:"";return _a("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[i]})"`}.`},f)}),t.source&&_a("div",{class:"cm-diagnosticSource"},t.source))}class wGt extends kf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return _a("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Fke{constructor(t,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=nYe(t,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class IA{constructor(t){this.view=t,this.items=[];let r=s=>{if(s.keyCode==27)Lke(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=rYe(a.actions);for(let l=0;l<i.length;l++)if(i[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=A_(this.view.state.field(Gd).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=_a("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:r,onclick:n}),this.dom=_a("div",{class:"cm-panel-lint"},this.list,_a("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Lke(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Gd).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(Gd),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 Fke(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 Fke(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(Gd),n=A_(r.diagnostics,this.items[t].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:tYe.of(n)})}static open(t){return new IA(t)}}function SGt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function iD(e){return SGt(`<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 OGt=ft.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:iD("#d11")},".cm-lintRange-warning":{backgroundImage:iD("orange")},".cm-lintRange-info":{backgroundImage:iD("#999")},".cm-lintRange-hint":{backgroundImage:iD("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function kGt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function _Gt(e){let t="hint",r=1;for(let n of e){let s=kGt(n.severity);s>r&&(r=s,t=n.severity)}return t}const EGt=[Gd,ft.decorations.compute([Gd],e=>{let{selected:t,panel:r}=e.field(Gd);return!t||!r||t.from==t.to?er.none:er.set([mGt.range(t.from,t.to)])}),O7t(gGt,{hideOn:hGt}),OGt];var zke=function(t){t===void 0&&(t={});var{crosshairCursor:r=!1}=t,n=[];t.closeBracketsKeymap!==!1&&(n=n.concat(xVt)),t.defaultKeymap!==!1&&(n=n.concat(DWt)),t.searchKeymap!==!1&&(n=n.concat(cGt)),t.historyKeymap!==!1&&(n=n.concat(VQt)),t.foldKeymap!==!1&&(n=n.concat(aUt)),t.completionKeymap!==!1&&(n=n.concat(qWe)),t.lintKeymap!==!1&&(n=n.concat(xGt));var s=[];return t.lineNumbers!==!1&&s.push(M7t()),t.highlightActiveLineGutter!==!1&&s.push($7t()),t.highlightSpecialChars!==!1&&s.push(KBt()),t.history!==!1&&s.push(PQt()),t.foldGutter!==!1&&s.push(cUt()),t.drawSelection!==!1&&s.push(UBt()),t.dropCursor!==!1&&s.push(WBt()),t.allowMultipleSelections!==!1&&s.push(Fn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(X7t()),t.syntaxHighlighting!==!1&&s.push(Qx(hUt,{fallback:!0})),t.bracketMatching!==!1&&s.push(xUt()),t.closeBrackets!==!1&&s.push(gVt()),t.autocompletion!==!1&&s.push(VWe()),t.rectangularSelection!==!1&&s.push(f7t()),r!==!1&&s.push(m7t()),t.highlightActiveLine!==!1&&s.push(s7t()),t.highlightSelectionMatches!==!1&&s.push(UWt()),t.tabSize&&typeof t.tabSize=="number"&&s.push(UE.of(" ".repeat(t.tabSize))),s.concat([BE.of(n.flat())]).filter(Boolean)};const CGt="#e5c07b",Bke="#e06c75",jGt="#56b6c2",TGt="#ffffff",i$="#abb2bf",Jne="#7d8799",NGt="#61afef",AGt="#98c379",Uke="#d19a66",IGt="#c678dd",RGt="#21252b",Vke="#2c313a",qke="#282c34",gV="#353a42",PGt="#3E4451",Hke="#528bff",MGt=ft.theme({"&":{color:i$,backgroundColor:qke},".cm-content":{caretColor:Hke},".cm-cursor, .cm-dropCursor":{borderLeftColor:Hke},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:PGt},".cm-panels":{backgroundColor:RGt,color:i$},".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:qke,color:Jne,border:"none"},".cm-activeLineGutter":{backgroundColor:Vke},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:gV},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:gV,borderBottomColor:gV},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Vke,color:i$}}},{dark:!0}),DGt=Vp.define([{tag:se.keyword,color:IGt},{tag:[se.name,se.deleted,se.character,se.propertyName,se.macroName],color:Bke},{tag:[se.function(se.variableName),se.labelName],color:NGt},{tag:[se.color,se.constant(se.name),se.standard(se.name)],color:Uke},{tag:[se.definition(se.name),se.separator],color:i$},{tag:[se.typeName,se.className,se.number,se.changed,se.annotation,se.modifier,se.self,se.namespace],color:CGt},{tag:[se.operator,se.operatorKeyword,se.url,se.escape,se.regexp,se.link,se.special(se.string)],color:jGt},{tag:[se.meta,se.comment],color:Jne},{tag:se.strong,fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:se.link,color:Jne,textDecoration:"underline"},{tag:se.heading,fontWeight:"bold",color:Bke},{tag:[se.atom,se.bool,se.special(se.variableName)],color:Uke},{tag:[se.processingInstruction,se.string,se.inserted],color:AGt},{tag:se.invalid,color:TGt}]),LGt=[MGt,Qx(DGt)];var $Gt=ft.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),FGt=function(t){t===void 0&&(t={});var{indentWithTab:r=!0,editable:n=!0,readOnly:s=!1,theme:a="light",placeholder:i="",basicSetup:l=!0}=t,c=[];switch(r&&c.unshift(BE.of([LWt])),l&&(typeof l=="boolean"?c.unshift(zke()):c.unshift(zke(l))),i&&c.unshift(l7t(i)),a){case"light":c.push($Gt);break;case"dark":c.push(LGt);break;case"none":break;default:c.push(a);break}return n===!1&&c.push(ft.editable.of(!1)),s&&c.push(Fn.readOnly.of(!0)),[...c]},zGt=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 BGt{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 Qke=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 vV=null,UGt=()=>typeof window>"u"?new Qke:(vV||(vV=new Qke),vV),Wke=xg.define(),VGt=200,qGt=[];function HGt(e){var{value:t,selection:r,onChange:n,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:l=qGt,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:h=null,width:p=null,minWidth:m=null,maxWidth:g=null,placeholder:v="",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(),z=b.useState(()=>({current:null}))[0],D=b.useState(()=>({current:null}))[0],U=ft.theme({"&":{height:d,minHeight:f,maxHeight:h,width:p,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),F=ft.updateListener.of(W=>{if(W.docChanged&&typeof n=="function"&&!W.transactions.some(q=>q.annotation(Wke))){z.current?z.current.reset():(z.current=new BGt(()=>{if(D.current){var q=D.current;D.current=null,q()}z.current=null},VGt),UGt().add(z.current));var L=W.state.doc,Y=L.toString();n(Y,W)}s&&s(zGt(W))}),B=FGt({theme:u,editable:x,readOnly:w,placeholder:v,indentWithTab:S,basicSetup:k}),H=[F,U,...B];return i&&typeof i=="function"&&H.push(ft.updateListener.of(i)),H=H.concat(l),b.useLayoutEffect(()=>{if(T&&!P){var W={doc:t,selection:r,extensions:H},L=E?Fn.fromJSON(E.json,W,E.fields):Fn.create(W);if(R(L),!N){var Y=new ft({state:L,parent:T,root:_});I(Y),a&&a(Y,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)),z.current&&(z.current.cancel(),z.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,v,x,w,S,k,n,i]),b.useEffect(()=>{if(t!==void 0){var W=N?N.state.doc.toString():"";if(N&&t!==W){var L=z.current&&!z.current.isDone,Y=()=>{N&&t!==N.state.doc.toString()&&N.dispatch({changes:{from:0,to:N.state.doc.toString().length,insert:t||""},annotations:[Wke.of(!0)]})};L?D.current=Y:Y()}}},[t,N]),{state:P,setState:R,view:N,setView:I,container:T,setContainer:j}}var QGt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Oc=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:v,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:k,editable:_,readOnly:E,root:T,initialState:j}=e,N=Fue(e,QGt),I=b.useRef(null),{state:P,view:R,container:z,setContainer:D}=HGt({root:T,value:n,autoFocus:d,theme:f,height:h,minHeight:p,maxHeight:m,width:g,minWidth:v,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,z,P,R]);var U=b.useCallback(B=>{I.current=B,D(B)},[D]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var F=typeof f=="string"?"cm-theme-"+f:"cm-theme";return o.jsx("div",wx({ref:U,className:""+F+(r?" "+r:"")},N))});Oc.displayName="CodeMirror";function WGt(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 GGt=e=>{switch(e){case"success":return XGt;case"info":return JGt;case"warning":return KGt;case"error":return eZt;default:return null}},ZGt=Array(12).fill(0),YGt=({visible:e,className:t})=>Te.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Te.createElement("div",{className:"sonner-spinner"},ZGt.map((r,n)=>Te.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),XGt=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Te.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"})),KGt=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Te.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"})),JGt=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Te.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"})),eZt=Te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Te.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"})),tZt=Te.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"},Te.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Te.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rZt=()=>{const[e,t]=Te.useState(document.hidden);return Te.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let ese=1;class nZt{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:ese++,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],Te.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(aZt(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"&&!Te.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"&&!Te.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"&&!Te.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"&&!Te.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||ese++;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 nZt,sZt=(e,t)=>{const r=t?.id||ese++;return Nu.addToast({title:e,...t,id:r}),r},aZt=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",iZt=sZt,oZt=()=>Nu.toasts,lZt=()=>Nu.getActiveToasts(),xc=Object.assign(iZt,{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:oZt,getToasts:lZt});WGt("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function oD(e){return e.label!==void 0}const cZt=3,uZt="24px",dZt="16px",Gke=4e3,fZt=356,hZt=14,pZt=45,mZt=200;function cm(...e){return e.filter(Boolean).join(" ")}function gZt(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const vZt=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:v,index:x,toasts:w,expanded:S,removeToast:k,defaultRichColors:_,closeButton:E,style:T,cancelButtonStyle:j,actionButtonStyle:N,className:I="",descriptionClassName:P="",duration:R,position:z,gap:D,expandByDefault:U,classNames:F,icons:B,closeButtonAriaLabel:H="Close toast"}=e,[W,L]=Te.useState(null),[Y,q]=Te.useState(null),[M,Q]=Te.useState(!1),[G,J]=Te.useState(!1),[ne,ee]=Te.useState(!1),[re,ie]=Te.useState(!1),[ce,K]=Te.useState(!1),[ae,le]=Te.useState(0),[xe,fe]=Te.useState(0),he=Te.useRef(f.duration||R||Gke),me=Te.useRef(null),ue=Te.useRef(null),Se=x===0,X=x+1<=g,oe=f.type,we=f.dismissible!==!1,Ae=f.className||"",$e=f.descriptionClassName||"",be=Te.useMemo(()=>v.findIndex(tt=>tt.toastId===f.id)||0,[v,f.id]),_e=Te.useMemo(()=>{var tt;return(tt=f.closeButton)!=null?tt:E},[f.closeButton,E]),ye=Te.useMemo(()=>f.duration||R||Gke,[f.duration,R]),Ce=Te.useRef(0),Fe=Te.useRef(0),ct=Te.useRef(0),wt=Te.useRef(null),[or,Ve]=z.split("-"),qe=Te.useMemo(()=>v.reduce((tt,Jt,jr)=>jr>=be?tt:tt+Jt.height,0),[v,be]),Ie=rZt(),Le=f.invert||d,Re=oe==="loading";Fe.current=Te.useMemo(()=>be*D+qe,[be,qe]),Te.useEffect(()=>{he.current=ye},[ye]),Te.useEffect(()=>{Q(!0)},[]),Te.useEffect(()=>{const tt=ue.current;if(tt){const Jt=tt.getBoundingClientRect().height;return fe(Jt),m(jr=>[{toastId:f.id,height:Jt,position:f.position},...jr]),()=>m(jr=>jr.filter(ar=>ar.toastId!==f.id))}},[m,f.id]),Te.useLayoutEffect(()=>{if(!M)return;const tt=ue.current,Jt=tt.style.height;tt.style.height="auto";const jr=tt.getBoundingClientRect().height;tt.style.height=Jt,fe(jr),m(ar=>ar.find(Br=>Br.toastId===f.id)?ar.map(Br=>Br.toastId===f.id?{...Br,height:jr}:Br):[{toastId:f.id,height:jr,position:f.position},...ar])},[M,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const it=Te.useCallback(()=>{J(!0),le(Fe.current),m(tt=>tt.filter(Jt=>Jt.toastId!==f.id)),setTimeout(()=>{k(f)},mZt)},[f,k,m,Fe]);Te.useEffect(()=>{if(f.promise&&oe==="loading"||f.duration===1/0||f.type==="loading")return;let tt;return S||p||Ie?(()=>{if(ct.current<Ce.current){const ar=new Date().getTime()-Ce.current;he.current=he.current-ar}ct.current=new Date().getTime()})():he.current!==1/0&&(Ce.current=new Date().getTime(),tt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),it()},he.current)),()=>clearTimeout(tt)},[S,p,f,oe,Ie,it]),Te.useEffect(()=>{f.delete&&(it(),f.onDismiss==null||f.onDismiss.call(f,f))},[it,f.delete]);function rt(){var tt;if(B?.loading){var Jt;return Te.createElement("div",{className:cm(F?.loader,f==null||(Jt=f.classNames)==null?void 0:Jt.loader,"sonner-loader"),"data-visible":oe==="loading"},B.loading)}return Te.createElement(YGt,{className:cm(F?.loader,f==null||(tt=f.classNames)==null?void 0:tt.loader),visible:oe==="loading"})}const ht=f.icon||B?.[oe]||GGt(oe);var Ut,Lr;return Te.createElement("li",{tabIndex:0,ref:ue,className:cm(I,Ae,F?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,F?.default,F?.[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":ce,"data-removed":G,"data-visible":X,"data-y-position":or,"data-x-position":Ve,"data-index":x,"data-front":Se,"data-swiping":ne,"data-dismissible":we,"data-type":oe,"data-invert":Le,"data-swipe-out":re,"data-swipe-direction":Y,"data-expanded":!!(S||U&&M),"data-testid":f.testId,style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${G?ae:Fe.current}px`,"--initial-height":U?"auto":`${xe}px`,...T,...f.style},onDragEnd:()=>{ee(!1),L(null),wt.current=null},onPointerDown:tt=>{tt.button!==2&&(Re||!we||(me.current=new Date,le(Fe.current),tt.target.setPointerCapture(tt.pointerId),tt.target.tagName!=="BUTTON"&&(ee(!0),wt.current={x:tt.clientX,y:tt.clientY})))},onPointerUp:()=>{var tt,Jt,jr;if(re||!we)return;wt.current=null;const ar=Number(((tt=ue.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ln=Number(((Jt=ue.current)==null?void 0:Jt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Br=new Date().getTime()-((jr=me.current)==null?void 0:jr.getTime()),It=W==="x"?ar:Ln,yn=Math.abs(It)/Br;if(Math.abs(It)>=pZt||yn>.11){le(Fe.current),f.onDismiss==null||f.onDismiss.call(f,f),q(W==="x"?ar>0?"right":"left":Ln>0?"down":"up"),it(),ie(!0);return}else{var Er,ke;(Er=ue.current)==null||Er.style.setProperty("--swipe-amount-x","0px"),(ke=ue.current)==null||ke.style.setProperty("--swipe-amount-y","0px")}K(!1),ee(!1),L(null)},onPointerMove:tt=>{var Jt,jr,ar;if(!wt.current||!we||((Jt=window.getSelection())==null?void 0:Jt.toString().length)>0)return;const Br=tt.clientY-wt.current.y,It=tt.clientX-wt.current.x;var yn;const Er=(yn=e.swipeDirections)!=null?yn:gZt(z);!W&&(Math.abs(It)>1||Math.abs(Br)>1)&&L(Math.abs(It)>Math.abs(Br)?"x":"y");let ke={x:0,y:0};const Me=Ue=>1/(1.5+Math.abs(Ue)/20);if(W==="y"){if(Er.includes("top")||Er.includes("bottom"))if(Er.includes("top")&&Br<0||Er.includes("bottom")&&Br>0)ke.y=Br;else{const Ue=Br*Me(Br);ke.y=Math.abs(Ue)<Math.abs(Br)?Ue:Br}}else if(W==="x"&&(Er.includes("left")||Er.includes("right")))if(Er.includes("left")&&It<0||Er.includes("right")&&It>0)ke.x=It;else{const Ue=It*Me(It);ke.x=Math.abs(Ue)<Math.abs(It)?Ue:It}(Math.abs(ke.x)>0||Math.abs(ke.y)>0)&&K(!0),(jr=ue.current)==null||jr.style.setProperty("--swipe-amount-x",`${ke.x}px`),(ar=ue.current)==null||ar.style.setProperty("--swipe-amount-y",`${ke.y}px`)}},_e&&!f.jsx&&oe!=="loading"?Te.createElement("button",{"aria-label":H,"data-disabled":Re,"data-close-button":!0,onClick:Re||!we?()=>{}:()=>{it(),f.onDismiss==null||f.onDismiss.call(f,f)},className:cm(F?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(Lr=B?.close)!=null?Lr:tZt):null,(oe||f.icon||f.promise)&&f.icon!==null&&(B?.[oe]!==null||f.icon)?Te.createElement("div",{"data-icon":"",className:cm(F?.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,Te.createElement("div",{"data-content":"",className:cm(F?.content,f==null||(a=f.classNames)==null?void 0:a.content)},Te.createElement("div",{"data-title":"",className:cm(F?.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?Te.createElement("div",{"data-description":"",className:cm(P,$e,F?.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),Te.isValidElement(f.cancel)?f.cancel:f.cancel&&oD(f.cancel)?Te.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:tt=>{oD(f.cancel)&&we&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,tt),it())},className:cm(F?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Te.isValidElement(f.action)?f.action:f.action&&oD(f.action)?Te.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||N,onClick:tt=>{oD(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,tt),!tt.defaultPrevented&&it())},className:cm(F?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function Zke(){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 yZt(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?dZt:uZt;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 sYe=Te.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:v=cZt,toastOptions:x,dir:w=Zke(),gap:S=hZt,icons:k,containerAriaLabel:_="Notifications"}=t,[E,T]=Te.useState([]),j=Te.useMemo(()=>n?E.filter(M=>M.toasterId===n):E.filter(M=>!M.toasterId),[E,n]),N=Te.useMemo(()=>Array.from(new Set([a].concat(j.filter(M=>M.position).map(M=>M.position)))),[j,a]),[I,P]=Te.useState([]),[R,z]=Te.useState(!1),[D,U]=Te.useState(!1),[F,B]=Te.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=Te.useRef(null),W=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=Te.useRef(null),Y=Te.useRef(!1),q=Te.useCallback(M=>{T(Q=>{var G;return(G=Q.find(J=>J.id===M.id))!=null&&G.delete||Nu.dismiss(M.id),Q.filter(({id:J})=>J!==M.id)})},[]);return Te.useEffect(()=>Nu.subscribe(M=>{if(M.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(G=>G.id===M.id?{...G,delete:!0}:G))});return}setTimeout(()=>{ace.flushSync(()=>{T(Q=>{const G=Q.findIndex(J=>J.id===M.id);return G!==-1?[...Q.slice(0,G),{...Q[G],...M},...Q.slice(G+1)]:[M,...Q]})})})}),[E]),Te.useEffect(()=>{if(h!=="system"){B(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:Q})=>{B(Q?"dark":"light")})}catch{M.addListener(({matches:G})=>{try{B(G?"dark":"light")}catch(J){console.error(J)}})}},[h]),Te.useEffect(()=>{E.length<=1&&z(!1)},[E]),Te.useEffect(()=>{const M=Q=>{var G;if(i.every(ee=>Q[ee]||Q.code===ee)){var ne;z(!0),(ne=H.current)==null||ne.focus()}Q.code==="Escape"&&(document.activeElement===H.current||(G=H.current)!=null&&G.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i]),Te.useEffect(()=>{if(H.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Y.current=!1)}},[H.current]),Te.createElement("section",{ref:r,"aria-label":`${_} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((M,Q)=>{var G;const[J,ne]=M.split("-");return j.length?Te.createElement("ol",{key:M,dir:w==="auto"?Zke():w,tabIndex:-1,ref:H,className:u,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":J,"data-x-position":ne,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${fZt}px`,"--gap":`${S}px`,...g,...yZt(d,f)},onBlur:ee=>{Y.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(Y.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,L.current=ee.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{D||z(!1)},onDragEnd:()=>z(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},j.filter(ee=>!ee.position&&Q===0||ee.position===M).map((ee,re)=>{var ie,ce;return Te.createElement(vZt,{key:ee.id,icons:k,index:re,toast:ee,defaultRichColors:p,duration:(ie=x?.duration)!=null?ie:m,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:s,visibleToasts:v,closeButton:(ce=x?.closeButton)!=null?ce:c,interacting:D,position:M,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:q,toasts:j.filter(K=>K.position==ee.position),heights:I.filter(K=>K.position==ee.position),setHeights:P,expandByDefault:l,gap:S,expanded:R,swipeDirections:t.swipeDirections})})):null}))}),Yke=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},bZt=(e=>e?Yke(e):Yke),xZt=e=>e;function wZt(e,t=xZt){const r=Te.useSyncExternalStore(e.subscribe,Te.useCallback(()=>t(e.getState()),[e,t]),Te.useCallback(()=>t(e.getInitialState()),[e,t]));return Te.useDebugValue(r),r}const Xke=e=>{const t=bZt(e),r=n=>wZt(t,n);return Object.assign(r,t),r},Gue=(e=>e?Xke(e):Xke);function SZt(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 tse=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return tse(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return tse(n)(r)}}}},OZt=(e,t)=>(r,n,s)=>{let a={storage:SZt(()=>window.localStorage),partialize:v=>v,version:0,merge:(v,x)=>({...x,...v}),...t},i=!1,l=0;const c=new Set,u=new Set;let d=a.storage;if(!d)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,s);const f=()=>{const v=a.partialize({...n()});return d.setItem(a.name,{state:v,version:a.version})},h=s.setState;s.setState=(v,x)=>(h(v,x),f());const p=e((...v)=>(r(...v),f()),n,s);s.getInitialState=()=>p;let m;const g=()=>{var v,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,(v=n())!=null?v:p))||void 0;return tse(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:v=>{a={...a,...v},v.storage&&(d=v.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:v=>(c.add(v),()=>{c.delete(v)}),onFinishHydration:v=>(u.add(v),()=>{u.delete(v)})},a.skipHydration||g(),m||p},kZt=OZt;var yV="focusScope.autoFocusOnMount",bV="focusScope.autoFocusOnUnmount",Kke={bubbles:!1,cancelable:!0},_Zt="FocusScope",qR=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=e,[l,c]=b.useState(null),u=yi(s),d=yi(a),f=b.useRef(null),h=zr(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:yb(f.current,{select:!0})},v=function(S){if(p.paused||!l)return;const k=S.relatedTarget;k!==null&&(l.contains(k)||yb(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const _ of S)_.removedNodes.length>0&&yb(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const w=new MutationObserver(x);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),w.disconnect()}}},[n,l,p.paused]),b.useEffect(()=>{if(l){e_e.add(p);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(yV,Kke);l.addEventListener(yV,u),l.dispatchEvent(x),x.defaultPrevented||(EZt(AZt(aYe(l)),{select:!0}),document.activeElement===g&&yb(l))}return()=>{l.removeEventListener(yV,u),setTimeout(()=>{const x=new CustomEvent(bV,Kke);l.addEventListener(bV,d),l.dispatchEvent(x),x.defaultPrevented||yb(g??document.body,{select:!0}),l.removeEventListener(bV,d),e_e.remove(p)},0)}}},[l,u,d,p]);const m=b.useCallback(g=>{if(!r&&!n||p.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(v&&x){const w=g.currentTarget,[S,k]=CZt(w);S&&k?!g.shiftKey&&x===k?(g.preventDefault(),r&&yb(S,{select:!0})):g.shiftKey&&x===S&&(g.preventDefault(),r&&yb(k,{select:!0})):x===w&&g.preventDefault()}},[r,n,p.paused]);return o.jsx(wr.div,{tabIndex:-1,...i,ref:h,onKeyDown:m})});qR.displayName=_Zt;function EZt(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(yb(n,{select:t}),document.activeElement!==r)return}function CZt(e){const t=aYe(e),r=Jke(t,e),n=Jke(t.reverse(),e);return[r,n]}function aYe(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 Jke(e,t){for(const r of e)if(!jZt(r,{upTo:t}))return r}function jZt(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 TZt(e){return e instanceof HTMLInputElement&&"select"in e}function yb(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&TZt(e)&&t&&e.select()}}var e_e=NZt();function NZt(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=t_e(e,t),e.unshift(t)},remove(t){e=t_e(e,t),e[0]?.resume()}}}function t_e(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function AZt(e){return e.filter(t=>t.tagName!=="A")}var xV=0;function $F(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??r_e()),document.body.insertAdjacentElement("beforeend",e[1]??r_e()),xV++,()=>{xV===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xV--}},[])}function r_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 Tm=function(){return Tm=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},Tm.apply(this,arguments)};function iYe(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 IZt(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 o$="right-scroll-bar-position",l$="width-before-scroll-bar",RZt="with-scroll-bars-hidden",PZt="--removed-body-scroll-bar-size";function wV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MZt(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 DZt=typeof window<"u"?b.useLayoutEffect:b.useEffect,n_e=new WeakMap;function LZt(e,t){var r=MZt(null,function(n){return e.forEach(function(s){return wV(s,n)})});return DZt(function(){var n=n_e.get(r);if(n){var s=new Set(n),a=new Set(e),i=r.current;s.forEach(function(l){a.has(l)||wV(l,null)}),a.forEach(function(l){s.has(l)||wV(l,i)})}n_e.set(r,e)},[e]),r}function $Zt(e){return e}function FZt(e,t){t===void 0&&(t=$Zt);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 zZt(e){e===void 0&&(e={});var t=FZt(null);return t.options=Tm({async:!0,ssr:!1},e),t}var oYe=function(e){var t=e.sideCar,r=iYe(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,Tm({},r))};oYe.isSideCarExport=!0;function BZt(e,t){return e.useMedium(t),oYe}var lYe=zZt(),SV=function(){},FF=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:SV,onWheelCapture:SV,onTouchMoveCapture:SV}),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,v=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,k=iYe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,E=LZt([r,t]),T=Tm(Tm({},k),s);return b.createElement(b.Fragment,null,d&&b.createElement(_,{sideCar:lYe,removeScrollBar:u,shards:f,noRelative:p,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:S}),i?b.cloneElement(b.Children.only(l),Tm(Tm({},T),{ref:E})):b.createElement(w,Tm({},T,{className:c,ref:E}),l))});FF.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};FF.classNames={fullWidth:l$,zeroRight:o$};var UZt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VZt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=UZt();return t&&e.setAttribute("nonce",t),e}function qZt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HZt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QZt=function(){var e=0,t=null;return{add:function(r){e==0&&(t=VZt())&&(qZt(t,r),HZt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WZt=function(){var e=QZt();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},cYe=function(){var e=WZt(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},GZt={left:0,top:0,right:0,gap:0},OV=function(e){return parseInt(e||"",10)||0},ZZt=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[OV(r),OV(n),OV(s)]},YZt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GZt;var t=ZZt(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])}},XZt=cYe(),Vk="data-scroll-locked",KZt=function(e,t,r,n){var s=e.left,a=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
114
114
  .`.concat(RZt,` {
115
115
  overflow: hidden `).concat(n,`;
@@ -287,7 +287,7 @@ ${J.current.stack}
287
287
  A`,",",",0,",",",",",",",`
288
288
  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(GTe||(GTe=ww(["L",",","Z"])),t,r);return w},_1r={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},fit=e=>{var t=cd(e,_1r),{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=ya("recharts-sector",f),p=a-s,m=kx(i,p,0,!0),g;return m>0&&Math.abs(u-d)<360?g=k1r({cx:r,cy:n,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=dit({cx:r,cy:n,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d}),b.createElement("path",Oae({},cu(t),{className:h,d:g}))};function E1r(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(Yst(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:a,outerRadius:i,angle:l}=t,c=Ql(n,s,a,l),u=Ql(n,s,i,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return uit(t)}}var _H={},EH={},CH={},ZTe;function C1r(){return ZTe||(ZTe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iat();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(CH)),CH}var YTe;function j1r(){return YTe||(YTe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=C1r();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})(EH)),EH}var XTe;function T1r(){return XTe||(XTe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oat(),r=j1r();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 jH,KTe;function N1r(){return KTe||(KTe=1,jH=T1r().range),jH}var A1r=N1r();const hit=Bo(A1r);var e0=e=>e.chartData,I1r=Xe([e0],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),whe=(e,t,r,n)=>n?I1r(e):e0(e);function Ym(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(zs(t)&&zs(r))return!0}return!1}function JTe(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function pit(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(Ym(i))return i}}function R1r(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Ym(n))return JTe(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(Vr(s))i=s;else if(typeof s=="function")try{t!=null&&(i=s(t?.[0]))}catch{}else if(typeof s=="string"&&Gje.test(s)){var c=Gje.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(Vr(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t?.[1]))}catch{}else if(typeof a=="string"&&Zje.test(a)){var d=Zje.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(Ym(h))return t==null?h:JTe(h,t,r)}}}var tC=1e9,P1r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ohe,xi=!0,Th="[DecimalError] ",Bw=Th+"Invalid argument: ",She=Th+"Exponent out of range: ",rC=Math.floor,sw=Math.pow,M1r=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,qd,fl=1e7,li=7,mit=9007199254740991,J5=rC(mit/li),hr={};hr.absoluteValue=hr.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};hr.comparedTo=hr.cmp=function(e){var t,r,n,s,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===s?0:n>s^a.s<0?1:-1};hr.decimalPlaces=hr.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*li;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};hr.dividedBy=hr.div=function(e){return $v(this,new this.constructor(e))};hr.dividedToIntegerBy=hr.idiv=function(e){var t=this,r=t.constructor;return La($v(t,new r(e),0,1),r.precision)};hr.equals=hr.eq=function(e){return!this.cmp(e)};hr.exponent=function(){return Do(this)};hr.greaterThan=hr.gt=function(e){return this.cmp(e)>0};hr.greaterThanOrEqualTo=hr.gte=function(e){return this.cmp(e)>=0};hr.isInteger=hr.isint=function(){return this.e>this.d.length-2};hr.isNegative=hr.isneg=function(){return this.s<0};hr.isPositive=hr.ispos=function(){return this.s>0};hr.isZero=function(){return this.s===0};hr.lessThan=hr.lt=function(e){return this.cmp(e)<0};hr.lessThanOrEqualTo=hr.lte=function(e){return this.cmp(e)<1};hr.logarithm=hr.log=function(e){var t,r=this,n=r.constructor,s=n.precision,a=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(qd))throw Error(Th+"NaN");if(r.s<1)throw Error(Th+(r.s?"NaN":"-Infinity"));return r.eq(qd)?new n(0):(xi=!1,t=$v(tI(r,a),tI(e,a),a),xi=!0,La(t,s))};hr.minus=hr.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?yit(t,e):git(t,(e.s=-e.s,e))};hr.modulo=hr.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(Th+"NaN");return r.s?(xi=!1,t=$v(r,e,0,1).times(e),xi=!0,r.minus(t)):La(new n(r),s)};hr.naturalExponential=hr.exp=function(){return vit(this)};hr.naturalLogarithm=hr.ln=function(){return tI(this)};hr.negated=hr.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};hr.plus=hr.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?git(t,e):yit(t,(e.s=-e.s,e))};hr.precision=hr.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Bw+e);if(t=Do(s)+1,n=s.d.length-1,r=n*li+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};hr.squareRoot=hr.sqrt=function(){var e,t,r,n,s,a,i,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Th+"NaN")}for(e=Do(l),xi=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=zm(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=rC((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($v(l,a,i+2)).times(.5),zm(a.d).slice(0,i)===(t=zm(n.d)).slice(0,i)){if(t=t.slice(i-3,i+1),s==i&&t=="4999"){if(La(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(t!="9999")break;i+=4}return xi=!0,La(n,r)};hr.times=hr.mul=function(e){var t,r,n,s,a,i,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=p.length,c<u&&(a=h,h=p,p=a,i=c,c=u,u=i),a=[],i=c+u,n=i;n--;)a.push(0);for(n=u;--n>=0;){for(t=0,s=c+n;s>n;)l=a[s]+p[n]*h[s-n-1]+t,a[s--]=l%fl|0,t=l/fl|0;a[s]=(a[s]+t)%fl|0}for(;!a[--i];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,xi?La(e,f.precision):e};hr.toDecimalPlaces=hr.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(lg(e,0,tC),t===void 0?t=n.rounding:lg(t,0,8),La(r,e+Do(r)+1,t))};hr.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=ES(n,!0):(lg(e,0,tC),t===void 0?t=s.rounding:lg(t,0,8),n=La(new s(n),e+1,t),r=ES(n,!0,e+1)),r};hr.toFixed=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?ES(s):(lg(e,0,tC),t===void 0?t=a.rounding:lg(t,0,8),n=La(new a(s),e+Do(s)+1,t),r=ES(n.abs(),!1,e+Do(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};hr.toInteger=hr.toint=function(){var e=this,t=e.constructor;return La(new t(e),Do(e)+1,t.rounding)};hr.toNumber=function(){return+this};hr.toPower=hr.pow=function(e){var t,r,n,s,a,i,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(qd);if(l=new c(l),!l.s){if(e.s<1)throw Error(Th+"Infinity");return l}if(l.eq(qd))return l;if(n=c.precision,e.eq(qd))return La(l,n);if(t=e.e,r=e.d.length-1,i=t>=r,a=l.s,i){if((r=d<0?-d:d)<=mit){for(s=new c(qd),t=Math.ceil(n/li+4),xi=!1;r%2&&(s=s.times(l),tNe(s.d,t)),r=rC(r/2),r!==0;)l=l.times(l),tNe(l.d,t);return xi=!0,e.s<0?new c(qd).div(s):La(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,xi=!1,s=e.times(tI(l,n+u)),xi=!0,s=vit(s),s.s=a,s};hr.toPrecision=function(e,t){var r,n,s=this,a=s.constructor;return e===void 0?(r=Do(s),n=ES(s,r<=a.toExpNeg||r>=a.toExpPos)):(lg(e,1,tC),t===void 0?t=a.rounding:lg(t,0,8),s=La(new a(s),e,t),r=Do(s),n=ES(s,e<=r||r<=a.toExpNeg,e)),n};hr.toSignificantDigits=hr.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(lg(e,1,tC),t===void 0?t=n.rounding:lg(t,0,8)),La(new n(r),e,t)};hr.toString=hr.valueOf=hr.val=hr.toJSON=hr[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Do(e),r=e.constructor;return ES(e,t<=r.toExpNeg||t>=r.toExpPos)};function git(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)),xi?La(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/li),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,xi?La(t,f):t}function lg(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Bw+e)}function zm(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=li-n.length,r&&(a+=kb(r)),a+=n;i=e[t],n=i+"",r=li-n.length,r&&(a+=kb(r))}else if(i===0)return"0";for(;i%10===0;)i/=10;return a+i}var $v=(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,v,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+(Do(n)-Do(s))+1:w=a,w<0)return new N(0);if(w=w/li+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),v=g.length;v<T;)g[v++]=0;j=R.slice(),j.unshift(0),E=R[0],R[1]>=fl/2&&++E;do d=0,l=t(R,g,T,v),l<0?(x=g[0],T!=v&&(x=x*fl+(g[1]||0)),d=x/E|0,d>1?(d>=fl&&(d=fl-1),f=e(R,d),h=f.length,v=g.length,l=t(f,g,h,v),l==1&&(d--,r(f,T<h?j:R,h))):(d==0&&(l=d=1),f=R.slice()),h=f.length,h<v&&f.unshift(0),r(g,f,v),l==-1&&(v=g.length,l=t(R,g,T,v),l<1&&(d++,r(g,T<v?j:R,v))),v=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[v++]=P[k]||0:(g=[P[k]],v=1);while((k++<_||g[0]!==void 0)&&w--)}return m[0]||m.shift(),p.e=c,La(p,i?a+Do(p)+1:a)}})();function vit(e,t){var r,n,s,a,i,l,c=0,u=0,d=e.constructor,f=d.precision;if(Do(e)>16)throw Error(She+Do(e));if(!e.s)return new d(qd);for(xi=!1,l=f,i=new d(.03125);e.abs().gte(.1);)e=e.times(i),u+=5;for(n=Math.log(sw(2,u))/Math.LN10*2+5|0,l+=n,r=s=a=new d(qd),d.precision=l;;){if(s=La(s.times(e),l),r=r.times(++c),i=a.plus($v(s,r,l)),zm(i.d).slice(0,l)===zm(a.d).slice(0,l)){for(;u--;)a=La(a.times(a),l);return d.precision=f,t==null?(xi=!0,La(a,f)):a}a=i}}function Do(e){for(var t=e.e*li,r=e.d[0];r>=10;r/=10)t++;return t}function TH(e,t,r){if(t>e.LN10.sd())throw xi=!0,r&&(e.precision=r),Error(Th+"LN10 precision limit exceeded");return La(new e(e.LN10),t)}function kb(e){for(var t="";e--;)t+="0";return t}function tI(e,t){var r,n,s,a,i,l,c,u,d,f=1,h=10,p=e,m=p.d,g=p.constructor,v=g.precision;if(p.s<1)throw Error(Th+(p.s?"NaN":"-Infinity"));if(p.eq(qd))return new g(0);if(t==null?(xi=!1,u=v):u=t,p.eq(10))return t==null&&(xi=!0),TH(g,u);if(u+=h,g.precision=u,r=zm(m),n=r.charAt(0),a=Do(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=zm(p.d),n=r.charAt(0),f++;a=Do(p),n>1?(p=new g("0."+r),a++):p=new g(n+"."+r.slice(1))}else return c=TH(g,u+2,v).times(a+""),p=tI(new g(n+"."+r.slice(1)),u-h).plus(c),g.precision=v,t==null?(xi=!0,La(p,v)):p;for(l=i=p=$v(p.minus(qd),p.plus(qd),u),d=La(p.times(p),u),s=3;;){if(i=La(i.times(d),u),c=l.plus($v(i,new g(s),u)),zm(c.d).slice(0,u)===zm(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(TH(g,u+2,v).times(a+""))),l=$v(l,new g(f),u),g.precision=v,t==null?(xi=!0,La(l,v)):l;l=c,s+=2}}function eNe(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=rC(r/li),e.d=[],n=(r+1)%li,r<0&&(n+=li),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=li;n<s;)e.d.push(+t.slice(n,n+=li));t=t.slice(n),n=li-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),xi&&(e.e>J5||e.e<-J5))throw Error(She+r)}else e.s=0,e.e=0,e.d=[0];return e}function La(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+=li,s=t,u=f[d=0];else{if(d=Math.ceil((n+1)/li),a=f.length,d>=a)return e;for(u=a=f[d],i=1;a>=10;a/=10)i++;n%=li,s=n-li+i}if(r!==void 0&&(a=sw(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/sw(10,i-s):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(a=Do(e),f.length=1,t=t-a-1,f[0]=sw(10,(li-t%li)%li),e.e=rC(-t/li)||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=sw(10,li-n),f[d]=s>0?(u/sw(10,i-s)%sw(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(xi&&(e.e>J5||e.e<-J5))throw Error(She+Do(e));return e}function yit(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),xi?La(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/li),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,xi?La(t,p):t):new h(0)}function ES(e,t,r){var n,s=Do(e),a=zm(e.d),i=a.length;return t?(r&&(n=r-i)>0?a=a.charAt(0)+"."+a.slice(1)+kb(n):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+kb(-s-1)+a,r&&(n=r-i)>0&&(a+=kb(n))):s>=i?(a+=kb(s+1-i),r&&(n=r-s-1)>0&&(a=a+"."+kb(n))):((n=s+1)<i&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-i)>0&&(s+1===i&&(a+="."),a+=kb(n))),e.s<0?"-"+a:a}function tNe(e,t){if(e.length>t)return e.length=t,!0}function bit(e){var t,r,n;function s(a){var i=this;if(!(i instanceof s))return new s(a);if(i.constructor=s,a instanceof s){i.s=a.s,i.e=a.e,i.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Bw+a);if(a>0)i.s=1;else if(a<0)a=-a,i.s=-1;else{i.s=0,i.e=0,i.d=[0];return}if(a===~~a&&a<1e7){i.e=0,i.d=[a];return}return eNe(i,a.toString())}else if(typeof a!="string")throw Error(Bw+a);if(a.charCodeAt(0)===45?(a=a.slice(1),i.s=-1):i.s=1,M1r.test(a))eNe(i,a);else throw Error(Bw+a)}if(s.prototype=hr,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=bit,s.config=s.set=D1r,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 D1r(e){if(!e||typeof e!="object")throw Error(Th+"Object expected");var t,r,n,s=["precision",1,tC,"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(rC(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Bw+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Bw+r+": "+n);return this}var Ohe=bit(P1r);qd=new Ohe(1);const xs=Ohe;function xit(e){var t;return e===0?t=1:t=Math.floor(new xs(e).abs().log(10).toNumber())+1,t}function wit(e,t,r){for(var n=new xs(e),s=0,a=[];n.lt(t)&&s<1e5;)a.push(n.toNumber()),n=n.add(r),s++;return a}var Sit=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},khe=(e,t,r)=>{if(e.lte(0))return new xs(0);var n=xit(e.toNumber()),s=new xs(10).pow(n),a=e.div(s),i=n!==1?.05:.1,l=new xs(Math.ceil(a.div(i).toNumber())).add(r).mul(i),c=l.mul(s);return t?new xs(c.toNumber()):new xs(Math.ceil(c.toNumber()))},Oit=(e,t,r)=>{var n;if(e.lte(0))return new xs(0);var s=[1,2,2.5,5],a=e.toNumber(),i=Math.floor(new xs(a).abs().log(10).toNumber()),l=new xs(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 xs(10).pow(d))}var f=(n=s[u])!==null&&n!==void 0?n:1,h=new xs(f).mul(l);return t?h:new xs(Math.ceil(h.toNumber()))},L1r=(e,t,r)=>{var n=new xs(1),s=new xs(e);if(!s.isint()&&r){var a=Math.abs(e);a<1?(n=new xs(10).pow(xit(e)-1),s=new xs(Math.floor(s.div(n).toNumber())).mul(n)):a>1&&(s=new xs(Math.floor(e)))}else e===0?s=new xs(Math.floor((t-1)/2)):r||(s=new xs(Math.floor(e)));for(var i=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new xs(c-i).mul(n)).toNumber());return l},kit=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]:khe;if(!Number.isFinite((r-t)/(n-1)))return{step:new xs(0),tickMin:new xs(0),tickMax:new xs(0)};var l=i(new xs(r).sub(t).div(n-1),s,a),c;t<=0&&r>=0?c=new xs(0):(c=new xs(t).add(r).div(2),c=c.sub(new xs(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),d=Math.ceil(new xs(r).sub(c).div(l).toNumber()),f=u+d+1;return f>n?kit(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 xs(u).mul(l)),tickMax:c.add(new xs(d).mul(l))})},rNe=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]=Sit([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 L1r(c,s,a);var f=i==="snap125"?Oit:khe,{step:h,tickMin:p,tickMax:m}=kit(c,u,l,a,0,f),g=wit(p,m.add(new xs(.1).mul(h)),h);return r>n?g.reverse():g},nNe=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]=Sit([n,s]);if(l===-1/0||c===1/0)return[n,s];if(l===c)return[l];var u=i==="snap125"?Oit:khe,d=Math.max(r,2),f=u(new xs(c).sub(l).div(d-1),a,0),h=[...wit(new xs(l),new xs(c),f),c];return a===!1&&(h=h.map(p=>Math.round(p))),n>s?h.reverse():h},$1r=e=>e.rootProps.barCategoryGap,r9=e=>e.rootProps.stackOffset,_it=e=>e.rootProps.reverseStackOrder,_he=e=>e.options.chartName,Ehe=e=>e.rootProps.syncId,Eit=e=>e.rootProps.syncMethod,Che=e=>e.options.eventEmitter,eu={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},M0={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},dm={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},n9=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function s9(e,t,r){if(r!=="auto")return r;if(e!=null)return by(e,t)?"category":"number"}function sNe(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 e4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sNe(Object(r),!0).forEach(function(n){F1r(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function F1r(e,t,r){return(t=z1r(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z1r(e){var t=B1r(e,"string");return typeof t=="symbol"?t:t+""}function B1r(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 aNe={allowDataOverflow:M0.allowDataOverflow,allowDecimals:M0.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:M0.angleAxisId,includeHidden:!1,name:void 0,reversed:M0.reversed,scale:M0.scale,tick:M0.tick,tickCount:void 0,ticks:void 0,type:M0.type,unit:void 0,niceTicks:"auto"},iNe={allowDataOverflow:dm.allowDataOverflow,allowDecimals:dm.allowDecimals,allowDuplicatedCategory:dm.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:dm.radiusAxisId,includeHidden:dm.includeHidden,name:void 0,reversed:dm.reversed,scale:dm.scale,tick:dm.tick,tickCount:dm.tickCount,ticks:void 0,type:dm.type,unit:void 0,niceTicks:"auto"},U1r=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},jhe=Xe([U1r,Gat],(e,t)=>{var r;if(e!=null)return e;var n=(r=s9(t,"angleAxis",aNe.type))!==null&&r!==void 0?r:"category";return e4(e4({},aNe),{},{type:n})}),V1r=(e,t)=>e.polarAxis.radiusAxis[t],The=Xe([V1r,Gat],(e,t)=>{var r;if(e!=null)return e;var n=(r=s9(t,"radiusAxis",iNe.type))!==null&&r!==void 0?r:"category";return e4(e4({},iNe),{},{type:n})}),a9=e=>e.polarOptions,Nhe=Xe([xy,wy,tc],v1r),Cit=Xe([a9,Nhe],(e,t)=>{if(e!=null)return kx(e.innerRadius,t,0)}),jit=Xe([a9,Nhe],(e,t)=>{if(e!=null)return kx(e.outerRadius,t,t*.8)}),q1r=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},Tit=Xe([a9],q1r);Xe([jhe,Tit],n9);var Nit=Xe([Nhe,Cit,jit],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Xe([The,Nit],n9);var Ait=Xe([Fi,a9,Cit,jit,xy,wy],(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:kx(i,s,s/2),cy:kx(l,a,a/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:u,clockWise:!1}}}),Cl=(e,t)=>t,i9=(e,t,r)=>r;function Iit(e){return e?.id}function Rit(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=Iit(l);u.forEach((f,h)=>{var p=a==null||s?h:String(Xl(f,a,null)),m=Xl(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 Ahe(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var o9=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function l9(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function H1r(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"},nC=e=>e.tooltip.settings.axisId;function Ihe(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 Q1r=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ym(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 Zb(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function W1r(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Rhe(e){let t,r,n;e.length!==2?(t=Zb,r=(l,c)=>Zb(e(l),c),n=(l,c)=>e(l)-c):(t=e===Zb||e===W1r?e:G1r,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 G1r(){return 0}function Pit(e){return e===null?NaN:+e}function*Z1r(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Y1r=Rhe(Zb),bP=Y1r.right;Rhe(Pit).center;class oNe extends Map{constructor(t,r=J1r){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(lNe(this,t))}has(t){return super.has(lNe(this,t))}set(t,r){return super.set(X1r(this,t),r)}delete(t){return super.delete(K1r(this,t))}}function lNe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function X1r({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function K1r({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function J1r(e){return e!==null&&typeof e=="object"?e.valueOf():e}function eOr(e=Zb){if(e===Zb)return Mit;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 Mit(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const tOr=Math.sqrt(50),rOr=Math.sqrt(10),nOr=Math.sqrt(2);function t4(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>=tOr?10:a>=rOr?5:a>=nOr?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?t4(e,t,r*2):[l,c,u]}function kae(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?t4(t,e,r):t4(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 _ae(e,t,r){return t=+t,e=+e,r=+r,t4(e,t,r)[2]}function Eae(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?_ae(t,e,r):_ae(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function cNe(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function uNe(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Dit(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?Mit:eOr(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));Dit(e,t,p,m,s)}const a=e[t];let i=r,l=n;for(Xj(e,r,t),s(e[n],a)>0&&Xj(e,r,n);i<l;){for(Xj(e,i,l),++i,--l;s(e[i],a)<0;)++i;for(;s(e[l],a)>0;)--l}s(e[r],a)===0?Xj(e,r,l):(++l,Xj(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Xj(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function sOr(e,t,r){if(e=Float64Array.from(Z1r(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return uNe(e);if(t>=1)return cNe(e);var n,s=(n-1)*t,a=Math.floor(s),i=cNe(Dit(e,a).subarray(0,a+1)),l=uNe(e.subarray(a+1));return i+(l-i)*(s-a)}}function aOr(e,t,r=Pit){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 iOr(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 Sy(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 Cae=Symbol("implicit");function Phe(){var e=new oNe,t=[],r=[],n=Cae;function s(a){let i=e.get(a);if(i===void 0){if(n!==Cae)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 oNe;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 Phe(t,r).unknown(n)},Bh.apply(s,arguments),s}function Mhe(){var e=Phe().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 v=iOr(h).map(function(x){return m+a*x});return r(p?v.reverse():v)}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 Mhe(t(),[n,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},Bh.apply(f(),arguments)}function Lit(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Lit(t())},e}function oOr(){return Lit(Mhe.apply(null,arguments).paddingInner(1))}function Dhe(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function $it(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function xP(){}var rI=.7,r4=1/rI,Yk="\\s*([+-]?\\d+)\\s*",nI="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lOr=/^#([0-9a-f]{3,8})$/,cOr=new RegExp(`^rgb\\(${Yk},${Yk},${Yk}\\)$`),uOr=new RegExp(`^rgb\\(${Xm},${Xm},${Xm}\\)$`),dOr=new RegExp(`^rgba\\(${Yk},${Yk},${Yk},${nI}\\)$`),fOr=new RegExp(`^rgba\\(${Xm},${Xm},${Xm},${nI}\\)$`),hOr=new RegExp(`^hsl\\(${nI},${Xm},${Xm}\\)$`),pOr=new RegExp(`^hsla\\(${nI},${Xm},${Xm},${nI}\\)$`),dNe={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};Dhe(xP,CS,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:fNe,formatHex:fNe,formatHex8:mOr,formatHsl:gOr,formatRgb:hNe,toString:hNe});function fNe(){return this.rgb().formatHex()}function mOr(){return this.rgb().formatHex8()}function gOr(){return Fit(this).formatHsl()}function hNe(){return this.rgb().formatRgb()}function CS(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=lOr.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?pNe(t):r===3?new qu(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?zD(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?zD(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=cOr.exec(e))?new qu(t[1],t[2],t[3],1):(t=uOr.exec(e))?new qu(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dOr.exec(e))?zD(t[1],t[2],t[3],t[4]):(t=fOr.exec(e))?zD(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hOr.exec(e))?vNe(t[1],t[2]/100,t[3]/100,1):(t=pOr.exec(e))?vNe(t[1],t[2]/100,t[3]/100,t[4]):dNe.hasOwnProperty(e)?pNe(dNe[e]):e==="transparent"?new qu(NaN,NaN,NaN,0):null}function pNe(e){return new qu(e>>16&255,e>>8&255,e&255,1)}function zD(e,t,r,n){return n<=0&&(e=t=r=NaN),new qu(e,t,r,n)}function vOr(e){return e instanceof xP||(e=CS(e)),e?(e=e.rgb(),new qu(e.r,e.g,e.b,e.opacity)):new qu}function jae(e,t,r,n){return arguments.length===1?vOr(e):new qu(e,t,r,n??1)}function qu(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Dhe(qu,jae,$it(xP,{brighter(e){return e=e==null?r4:Math.pow(r4,e),new qu(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rI:Math.pow(rI,e),new qu(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qu(Uw(this.r),Uw(this.g),Uw(this.b),n4(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:mNe,formatHex:mNe,formatHex8:yOr,formatRgb:gNe,toString:gNe}));function mNe(){return`#${Sw(this.r)}${Sw(this.g)}${Sw(this.b)}`}function yOr(){return`#${Sw(this.r)}${Sw(this.g)}${Sw(this.b)}${Sw((isNaN(this.opacity)?1:this.opacity)*255)}`}function gNe(){const e=n4(this.opacity);return`${e===1?"rgb(":"rgba("}${Uw(this.r)}, ${Uw(this.g)}, ${Uw(this.b)}${e===1?")":`, ${e})`}`}function n4(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sw(e){return e=Uw(e),(e<16?"0":"")+e.toString(16)}function vNe(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new hp(e,t,r,n)}function Fit(e){if(e instanceof hp)return new hp(e.h,e.s,e.l,e.opacity);if(e instanceof xP||(e=CS(e)),!e)return new hp;if(e instanceof hp)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 hp(i,l,c,e.opacity)}function bOr(e,t,r,n){return arguments.length===1?Fit(e):new hp(e,t,r,n??1)}function hp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Dhe(hp,bOr,$it(xP,{brighter(e){return e=e==null?r4:Math.pow(r4,e),new hp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rI:Math.pow(rI,e),new hp(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 qu(NH(e>=240?e-240:e+120,s,n),NH(e,s,n),NH(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new hp(yNe(this.h),BD(this.s),BD(this.l),n4(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=n4(this.opacity);return`${e===1?"hsl(":"hsla("}${yNe(this.h)}, ${BD(this.s)*100}%, ${BD(this.l)*100}%${e===1?")":`, ${e})`}`}}));function yNe(e){return e=(e||0)%360,e<0?e+360:e}function BD(e){return Math.max(0,Math.min(1,e||0))}function NH(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 Lhe=e=>()=>e;function xOr(e,t){return function(r){return e+r*t}}function wOr(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 SOr(e){return(e=+e)==1?zit:function(t,r){return r-t?wOr(t,r,e):Lhe(isNaN(t)?r:t)}}function zit(e,t){var r=t-e;return r?xOr(e,r):Lhe(isNaN(e)?t:e)}const s4=(function e(t){var r=SOr(t);function n(s,a){var i=r((s=jae(s)).r,(a=jae(a)).r),l=r(s.g,a.g),c=r(s.b,a.b),u=zit(s.opacity,a.opacity);return function(d){return s.r=i(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return n.gamma=e,n})(1);function OOr(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 kOr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _Or(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]=Fv(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 EOr(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function cp(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function COr(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]=Fv(e[s],t[s]):n[s]=t[s];return function(a){for(s in r)n[s]=r[s](a);return n}}var Tae=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,AH=new RegExp(Tae.source,"g");function jOr(e){return function(){return e}}function TOr(e){return function(t){return e(t)+""}}function Bit(e,t){var r=Tae.lastIndex=AH.lastIndex=0,n,s,a,i=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Tae.exec(e))&&(s=AH.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:cp(n,s)})),r=AH.lastIndex;return r<t.length&&(a=t.slice(r),l[i]?l[i]+=a:l[++i]=a),l.length<2?c[0]?TOr(c[0].x):jOr(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 Fv(e,t){var r=typeof t,n;return t==null||r==="boolean"?Lhe(t):(r==="number"?cp:r==="string"?(n=CS(t))?(t=n,s4):Bit:t instanceof CS?s4:t instanceof Date?EOr:kOr(t)?OOr:Array.isArray(t)?_Or:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?COr:cp)(e,t)}function $he(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var bNe=180/Math.PI,Nae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Uit(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)*bNe,skewX:Math.atan(c)*bNe,scaleX:i,scaleY:l}}var UD;function NOr(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Nae:Uit(t.a,t.b,t.c,t.d,t.e,t.f)}function AOr(e){return e==null||(UD||(UD=document.createElementNS("http://www.w3.org/2000/svg","g")),UD.setAttribute("transform",e),!(e=UD.transform.baseVal.consolidate()))?Nae:(e=e.matrix,Uit(e.a,e.b,e.c,e.d,e.e,e.f))}function Vit(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:cp(u,f)},{i:g-2,x:cp(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:cp(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:cp(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:cp(u,f)},{i:g-2,x:cp(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,v;++m<g;)f[(v=h[m]).i]=v.x(p);return f.join("")}}}var IOr=Vit(NOr,"px, ","px)","deg)"),ROr=Vit(AOr,", ",")",")"),POr=1e-12;function xNe(e){return((e=Math.exp(e))+1/e)/2}function MOr(e){return((e=Math.exp(e))-1/e)/2}function DOr(e){return((e=Math.exp(2*e))-1)/(e+1)}const b$=(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,v,x;if(g<POr)x=Math.log(h/u)/t,v=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,v=function(T){var j=T*x,N=xNe(_),I=u/(r*w)*(N*DOr(t*j+_)-MOr(_));return[l+I*p,c+I*m,u*N/xNe(t*j+_)]}}return v.duration=x*1e3*t/Math.SQRT2,v}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 LOr(e,t){t===void 0&&(t=e,e=Fv);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 $Or(e){return function(){return e}}function a4(e){return+e}var wNe=[0,1];function tu(e){return e}function Aae(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:$Or(isNaN(t)?NaN:.5)}function FOr(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function zOr(e,t,r){var n=e[0],s=e[1],a=t[0],i=t[1];return s<n?(n=Aae(s,n),a=r(i,a)):(n=Aae(n,s),a=r(a,i)),function(l){return a(n(l))}}function BOr(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]=Aae(e[i],e[i+1]),a[i]=r(t[i],t[i+1]);return function(l){var c=bP(e,l,1,n)-1;return a[c](s[c](l))}}function wP(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function c9(){var e=wNe,t=wNe,r=Fv,n,s,a,i=tu,l,c,u;function d(){var h=Math.min(e.length,t.length);return i!==tu&&(i=FOr(e[0],e[h-1])),l=h>2?BOr:zOr,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),cp)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,a4),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=$he,d()},f.clamp=function(h){return arguments.length?(i=h?!0:tu,d()):i!==tu},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 Fhe(){return c9()(tu,tu)}function UOr(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function i4(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 Q_(e){return e=i4(Math.abs(e)),e?e[1]:NaN}function VOr(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 qOr(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var HOr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sI(e){if(!(t=HOr.exec(e)))throw new Error("invalid format: "+e);var t;return new zhe({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]})}sI.prototype=zhe.prototype;function zhe(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+""}zhe.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 QOr(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 o4;function WOr(e,t){var r=i4(e,t);if(!r)return o4=void 0,e.toPrecision(t);var n=r[0],s=r[1],a=s-(o4=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")+i4(e,Math.max(0,t+a-1))[0]}function SNe(e,t){var r=i4(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 ONe={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:UOr,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)=>SNe(e*100,t),r:SNe,s:WOr,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function kNe(e){return e}var _Ne=Array.prototype.map,ENe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function GOr(e){var t=e.grouping===void 0||e.thousands===void 0?kNe:VOr(_Ne.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?kNe:qOr(_Ne.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=sI(f);var p=f.fill,m=f.align,g=f.sign,v=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"):ONe[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:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),j=(v==="$"?n:/[%p]/.test(E)?i:"")+(h&&h.suffix!==void 0?h.suffix:""),N=ONe[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 z=T,D=j,U,F,B;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=QOr(R)),H&&+R==0&&g!=="+"&&(H=!1),z=(H?g==="("?g:l:g==="-"||g==="("?"":g)+z,D=(E==="s"&&!isNaN(R)&&o4!==void 0?ENe[8+o4/3]:"")+D+(H&&g==="("?")":""),I){for(U=-1,F=R.length;++U<F;)if(B=R.charCodeAt(U),48>B||B>57){D=(B===46?s+R.slice(U+1):R.slice(U))+D,R=R.slice(0,U);break}}}S&&!x&&(R=t(R,1/0));var W=z.length+R.length+D.length,L=W<w?new Array(w-W+1).join(p):"";switch(S&&x&&(R=t(L+R,L.length?w-D.length:1/0),L=""),m){case"<":R=z+R+D+L;break;case"=":R=z+L+R+D;break;case"^":R=L.slice(0,W=L.length>>1)+z+R+D+L.slice(W);break;default:R=L+z+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(Q_(h)/3)))*3,m=Math.pow(10,-p),g=u((f=sI(f),f.type="f",f),{suffix:ENe[8+p/3]});return function(v){return g(m*v)}}return{format:u,formatPrefix:d}}var VD,Bhe,qit;ZOr({thousands:",",grouping:[3],currency:["$",""]});function ZOr(e){return VD=GOr(e),Bhe=VD.format,qit=VD.formatPrefix,VD}function YOr(e){return Math.max(0,-Q_(Math.abs(e)))}function XOr(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Q_(t)/3)))*3-Q_(Math.abs(e)))}function KOr(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Q_(t)-Q_(e))+1}function Hit(e,t,r,n){var s=Eae(e,t,r),a;switch(n=sI(n??",f"),n.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=XOr(s,i))&&(n.precision=a),qit(n,i)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=KOr(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=YOr(s))&&(n.precision=a-(n.type==="%")*2);break}}return Bhe(n)}function t0(e){var t=e.domain;return e.ticks=function(r){var n=t();return kae(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return Hit(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=_ae(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 Qit(){var e=Fhe();return e.copy=function(){return wP(e,Qit())},Bh.apply(e,arguments),t0(e)}function Wit(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,a4),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Wit(e).unknown(t)},e=arguments.length?Array.from(e,a4):[0,1],t0(r)}function Git(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 CNe(e){return Math.log(e)}function jNe(e){return Math.exp(e)}function JOr(e){return-Math.log(-e)}function ekr(e){return-Math.exp(-e)}function tkr(e){return isFinite(e)?+("1e"+e):e<0?0:e}function rkr(e){return e===10?tkr:e===Math.E?Math.exp:t=>Math.pow(e,t)}function nkr(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 TNe(e){return(t,r)=>-e(-t,r)}function Uhe(e){const t=e(CNe,jNe),r=t.domain;let n=10,s,a;function i(){return s=nkr(n),a=rkr(n),r()[0]<0?(s=TNe(s),a=TNe(a),e(JOr,ekr)):e(CNe,jNe),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 v=l==null?10:+l;let x=[];if(!(n%1)&&p-h<v){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<v&&(x=kae(u,d,v))}else x=kae(h,p,Math.min(p-h,v)).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=sI(c)).precision==null&&(c.trim=!0),c=Bhe(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(Git(r(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function Zit(){const e=Uhe(c9()).domain([1,10]);return e.copy=()=>wP(e,Zit()).base(e.base()),Bh.apply(e,arguments),e}function NNe(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ANe(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Vhe(e){var t=1,r=e(NNe(t),ANe(t));return r.constant=function(n){return arguments.length?e(NNe(t=+n),ANe(t)):t},t0(r)}function Yit(){var e=Vhe(c9());return e.copy=function(){return wP(e,Yit()).constant(e.constant())},Bh.apply(e,arguments)}function INe(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function skr(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function akr(e){return e<0?-e*e:e*e}function qhe(e){var t=e(tu,tu),r=1;function n(){return r===1?e(tu,tu):r===.5?e(skr,akr):e(INe(r),INe(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},t0(t)}function Hhe(){var e=qhe(c9());return e.copy=function(){return wP(e,Hhe()).exponent(e.exponent())},Bh.apply(e,arguments),e}function ikr(){return Hhe.apply(null,arguments).exponent(.5)}function RNe(e){return Math.sign(e)*e*e}function okr(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Xit(){var e=Fhe(),t=[0,1],r=!1,n;function s(a){var i=okr(e(a));return isNaN(i)?n:r?Math.round(i):i}return s.invert=function(a){return e.invert(RNe(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,a4)).map(RNe)),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 Xit(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Bh.apply(s,arguments),t0(s)}function Kit(){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]=aOr(e,i/l);return a}function a(i){return i==null||isNaN(i=+i)?n:t[bP(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(Zb),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 Kit().domain(e).range(t).unknown(n)},Bh.apply(a,arguments)}function Jit(){var e=0,t=1,r=1,n=[.5],s=[0,1],a;function i(c){return c!=null&&c<=c?s[bP(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 Jit().domain([e,t]).range(s).unknown(a)},Bh.apply(t0(i),arguments)}function eot(){var e=[.5],t=[0,1],r,n=1;function s(a){return a!=null&&a<=a?t[bP(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 eot().domain(e).range(t).unknown(r)},Bh.apply(s,arguments)}const IH=new Date,RH=new Date;function nl(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=>nl(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)=>(IH.setTime(+a),RH.setTime(+i),e(IH),e(RH),Math.floor(r(IH,RH))),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 l4=nl(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);l4.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?nl(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):l4);l4.range;const Nv=1e3,mh=Nv*60,Av=mh*60,Jv=Av*24,Qhe=Jv*7,PNe=Jv*30,PH=Jv*365,Ow=nl(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Nv)},(e,t)=>(t-e)/Nv,e=>e.getUTCSeconds());Ow.range;const Whe=nl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Nv)},(e,t)=>{e.setTime(+e+t*mh)},(e,t)=>(t-e)/mh,e=>e.getMinutes());Whe.range;const Ghe=nl(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*mh)},(e,t)=>(t-e)/mh,e=>e.getUTCMinutes());Ghe.range;const Zhe=nl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Nv-e.getMinutes()*mh)},(e,t)=>{e.setTime(+e+t*Av)},(e,t)=>(t-e)/Av,e=>e.getHours());Zhe.range;const Yhe=nl(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Av)},(e,t)=>(t-e)/Av,e=>e.getUTCHours());Yhe.range;const SP=nl(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*mh)/Jv,e=>e.getDate()-1);SP.range;const u9=nl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jv,e=>e.getUTCDate()-1);u9.range;const tot=nl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jv,e=>Math.floor(e/Jv));tot.range;function m1(e){return nl(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)/Qhe)}const d9=m1(0),c4=m1(1),lkr=m1(2),ckr=m1(3),W_=m1(4),ukr=m1(5),dkr=m1(6);d9.range;c4.range;lkr.range;ckr.range;W_.range;ukr.range;dkr.range;function g1(e){return nl(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)/Qhe)}const f9=g1(0),u4=g1(1),fkr=g1(2),hkr=g1(3),G_=g1(4),pkr=g1(5),mkr=g1(6);f9.range;u4.range;fkr.range;hkr.range;G_.range;pkr.range;mkr.range;const Xhe=nl(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());Xhe.range;const Khe=nl(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());Khe.range;const ey=nl(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());ey.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nl(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)});ey.range;const ty=nl(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());ty.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nl(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)});ty.range;function rot(e,t,r,n,s,a){const i=[[Ow,1,Nv],[Ow,5,5*Nv],[Ow,15,15*Nv],[Ow,30,30*Nv],[a,1,mh],[a,5,5*mh],[a,15,15*mh],[a,30,30*mh],[s,1,Av],[s,3,3*Av],[s,6,6*Av],[s,12,12*Av],[n,1,Jv],[n,2,2*Jv],[r,1,Qhe],[t,1,PNe],[t,3,3*PNe],[e,1,PH]];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=Rhe(([,,v])=>v).right(i,h);if(p===i.length)return e.every(Eae(u/PH,d/PH,f));if(p===0)return l4.every(Math.max(Eae(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[gkr,vkr]=rot(ty,Khe,f9,tot,Yhe,Ghe),[ykr,bkr]=rot(ey,Xhe,d9,SP,Zhe,Whe);function MH(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 DH(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 Kj(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function xkr(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=Jj(s),d=eT(s),f=Jj(a),h=eT(a),p=Jj(i),m=eT(i),g=Jj(l),v=eT(l),x=Jj(c),w=eT(c),S={a:B,A:H,b:W,B:L,c:null,d:zNe,e:zNe,f:Vkr,g:Jkr,G:t_r,H:zkr,I:Bkr,j:Ukr,L:not,m:qkr,M:Hkr,p:Y,q,Q:VNe,s:qNe,S:Qkr,u:Wkr,U:Gkr,V:Zkr,w:Ykr,W:Xkr,x:null,X:null,y:Kkr,Y:e_r,Z:r_r,"%":UNe},k={a:M,A:Q,b:G,B:J,c:null,d:BNe,e:BNe,f:i_r,g:g_r,G:y_r,H:n_r,I:s_r,j:a_r,L:aot,m:o_r,M:l_r,p:ne,q:ee,Q:VNe,s:qNe,S:c_r,u:u_r,U:d_r,V:f_r,w:h_r,W:p_r,x:null,X:null,y:m_r,Y:v_r,Z:b_r,"%":UNe},_={a:I,A:P,b:R,B:z,c:D,d:$Ne,e:$Ne,f:Dkr,g:LNe,G:DNe,H:FNe,I:FNe,j:Ikr,L:Mkr,m:Akr,M:Rkr,p:N,q:Nkr,Q:$kr,s:Fkr,S:Pkr,u:_kr,U:Ekr,V:Ckr,w:kkr,W:jkr,x:U,X:F,y:LNe,Y:DNe,Z:Tkr,"%":Lkr};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(ce){var K=[],ae=-1,le=0,xe=re.length,fe,he,me;for(ce instanceof Date||(ce=new Date(+ce));++ae<xe;)re.charCodeAt(ae)===37&&(K.push(re.slice(le,ae)),(he=MNe[fe=re.charAt(++ae)])!=null?fe=re.charAt(++ae):he=fe==="e"?" ":"0",(me=ie[fe])&&(fe=me(ce,he)),K.push(fe),le=ae+1);return K.push(re.slice(le,ae)),K.join("")}}function T(re,ie){return function(ce){var K=Kj(1900,void 0,1),ae=j(K,re,ce+="",0),le,xe;if(ae!=ce.length)return null;if("Q"in K)return new Date(K.Q);if("s"in K)return new Date(K.s*1e3+("L"in K?K.L:0));if(ie&&!("Z"in K)&&(K.Z=0),"p"in K&&(K.H=K.H%12+K.p*12),K.m===void 0&&(K.m="q"in K?K.q:0),"V"in K){if(K.V<1||K.V>53)return null;"w"in K||(K.w=1),"Z"in K?(le=DH(Kj(K.y,0,1)),xe=le.getUTCDay(),le=xe>4||xe===0?u4.ceil(le):u4(le),le=u9.offset(le,(K.V-1)*7),K.y=le.getUTCFullYear(),K.m=le.getUTCMonth(),K.d=le.getUTCDate()+(K.w+6)%7):(le=MH(Kj(K.y,0,1)),xe=le.getDay(),le=xe>4||xe===0?c4.ceil(le):c4(le),le=SP.offset(le,(K.V-1)*7),K.y=le.getFullYear(),K.m=le.getMonth(),K.d=le.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),xe="Z"in K?DH(Kj(K.y,0,1)).getUTCDay():MH(Kj(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(xe+5)%7:K.w+K.U*7-(xe+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,DH(K)):MH(K)}}function j(re,ie,ce,K){for(var ae=0,le=ie.length,xe=ce.length,fe,he;ae<le;){if(K>=xe)return-1;if(fe=ie.charCodeAt(ae++),fe===37){if(fe=ie.charAt(ae++),he=_[fe in MNe?ie.charAt(ae++):fe],!he||(K=he(re,ce,K))<0)return-1}else if(fe!=ce.charCodeAt(K++))return-1}return K}function N(re,ie,ce){var K=u.exec(ie.slice(ce));return K?(re.p=d.get(K[0].toLowerCase()),ce+K[0].length):-1}function I(re,ie,ce){var K=p.exec(ie.slice(ce));return K?(re.w=m.get(K[0].toLowerCase()),ce+K[0].length):-1}function P(re,ie,ce){var K=f.exec(ie.slice(ce));return K?(re.w=h.get(K[0].toLowerCase()),ce+K[0].length):-1}function R(re,ie,ce){var K=x.exec(ie.slice(ce));return K?(re.m=w.get(K[0].toLowerCase()),ce+K[0].length):-1}function z(re,ie,ce){var K=g.exec(ie.slice(ce));return K?(re.m=v.get(K[0].toLowerCase()),ce+K[0].length):-1}function D(re,ie,ce){return j(re,t,ie,ce)}function U(re,ie,ce){return j(re,r,ie,ce)}function F(re,ie,ce){return j(re,n,ie,ce)}function B(re){return i[re.getDay()]}function H(re){return a[re.getDay()]}function W(re){return c[re.getMonth()]}function L(re){return l[re.getMonth()]}function Y(re){return s[+(re.getHours()>=12)]}function q(re){return 1+~~(re.getMonth()/3)}function M(re){return i[re.getUTCDay()]}function Q(re){return a[re.getUTCDay()]}function G(re){return c[re.getUTCMonth()]}function J(re){return l[re.getUTCMonth()]}function ne(re){return s[+(re.getUTCHours()>=12)]}function ee(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 MNe={"-":"",_:" ",0:"0"},Tl=/^\s*\d+/,wkr=/^%/,Skr=/[\\^$*+?|[\]().{}]/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 Okr(e){return e.replace(Skr,"\\$&")}function Jj(e){return new RegExp("^(?:"+e.map(Okr).join("|")+")","i")}function eT(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function kkr(e,t,r){var n=Tl.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function _kr(e,t,r){var n=Tl.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Ekr(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Ckr(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function jkr(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function DNe(e,t,r){var n=Tl.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function LNe(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 Tkr(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 Nkr(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 Akr(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 $Ne(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Ikr(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 FNe(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Rkr(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Pkr(e,t,r){var n=Tl.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Mkr(e,t,r){var n=Tl.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Dkr(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 Lkr(e,t,r){var n=wkr.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function $kr(e,t,r){var n=Tl.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Fkr(e,t,r){var n=Tl.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function zNe(e,t){return Bs(e.getDate(),t,2)}function zkr(e,t){return Bs(e.getHours(),t,2)}function Bkr(e,t){return Bs(e.getHours()%12||12,t,2)}function Ukr(e,t){return Bs(1+SP.count(ey(e),e),t,3)}function not(e,t){return Bs(e.getMilliseconds(),t,3)}function Vkr(e,t){return not(e,t)+"000"}function qkr(e,t){return Bs(e.getMonth()+1,t,2)}function Hkr(e,t){return Bs(e.getMinutes(),t,2)}function Qkr(e,t){return Bs(e.getSeconds(),t,2)}function Wkr(e){var t=e.getDay();return t===0?7:t}function Gkr(e,t){return Bs(d9.count(ey(e)-1,e),t,2)}function sot(e){var t=e.getDay();return t>=4||t===0?W_(e):W_.ceil(e)}function Zkr(e,t){return e=sot(e),Bs(W_.count(ey(e),e)+(ey(e).getDay()===4),t,2)}function Ykr(e){return e.getDay()}function Xkr(e,t){return Bs(c4.count(ey(e)-1,e),t,2)}function Kkr(e,t){return Bs(e.getFullYear()%100,t,2)}function Jkr(e,t){return e=sot(e),Bs(e.getFullYear()%100,t,2)}function e_r(e,t){return Bs(e.getFullYear()%1e4,t,4)}function t_r(e,t){var r=e.getDay();return e=r>=4||r===0?W_(e):W_.ceil(e),Bs(e.getFullYear()%1e4,t,4)}function r_r(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Bs(t/60|0,"0",2)+Bs(t%60,"0",2)}function BNe(e,t){return Bs(e.getUTCDate(),t,2)}function n_r(e,t){return Bs(e.getUTCHours(),t,2)}function s_r(e,t){return Bs(e.getUTCHours()%12||12,t,2)}function a_r(e,t){return Bs(1+u9.count(ty(e),e),t,3)}function aot(e,t){return Bs(e.getUTCMilliseconds(),t,3)}function i_r(e,t){return aot(e,t)+"000"}function o_r(e,t){return Bs(e.getUTCMonth()+1,t,2)}function l_r(e,t){return Bs(e.getUTCMinutes(),t,2)}function c_r(e,t){return Bs(e.getUTCSeconds(),t,2)}function u_r(e){var t=e.getUTCDay();return t===0?7:t}function d_r(e,t){return Bs(f9.count(ty(e)-1,e),t,2)}function iot(e){var t=e.getUTCDay();return t>=4||t===0?G_(e):G_.ceil(e)}function f_r(e,t){return e=iot(e),Bs(G_.count(ty(e),e)+(ty(e).getUTCDay()===4),t,2)}function h_r(e){return e.getUTCDay()}function p_r(e,t){return Bs(u4.count(ty(e)-1,e),t,2)}function m_r(e,t){return Bs(e.getUTCFullYear()%100,t,2)}function g_r(e,t){return e=iot(e),Bs(e.getUTCFullYear()%100,t,2)}function v_r(e,t){return Bs(e.getUTCFullYear()%1e4,t,4)}function y_r(e,t){var r=e.getUTCDay();return e=r>=4||r===0?G_(e):G_.ceil(e),Bs(e.getUTCFullYear()%1e4,t,4)}function b_r(){return"+0000"}function UNe(){return"%"}function VNe(e){return+e}function qNe(e){return Math.floor(+e/1e3)}var vO,oot,lot;x_r({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 x_r(e){return vO=xkr(e),oot=vO.format,vO.parse,lot=vO.utcFormat,vO.utcParse,vO}function w_r(e){return new Date(e)}function S_r(e){return e instanceof Date?+e:+new Date(+e)}function Jhe(e,t,r,n,s,a,i,l,c,u){var d=Fhe(),f=d.invert,h=d.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),v=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?v: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,S_r)):h().map(w_r)},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(Git(T,E)):d},d.copy=function(){return wP(d,Jhe(e,t,r,n,s,a,i,l,c,u))},d}function O_r(){return Bh.apply(Jhe(ykr,bkr,ey,Xhe,d9,SP,Zhe,Whe,Ow,oot).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function k_r(){return Bh.apply(Jhe(gkr,vkr,ty,Khe,f9,u9,Yhe,Ghe,Ow,lot).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function h9(){var e=0,t=1,r,n,s,a,i=tu,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(Fv),u.rangeRound=d($he),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 r0(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function cot(){var e=t0(h9()(tu));return e.copy=function(){return r0(e,cot())},Sy.apply(e,arguments)}function uot(){var e=Uhe(h9()).domain([1,10]);return e.copy=function(){return r0(e,uot()).base(e.base())},Sy.apply(e,arguments)}function dot(){var e=Vhe(h9());return e.copy=function(){return r0(e,dot()).constant(e.constant())},Sy.apply(e,arguments)}function epe(){var e=qhe(h9());return e.copy=function(){return r0(e,epe()).exponent(e.exponent())},Sy.apply(e,arguments)}function __r(){return epe.apply(null,arguments).exponent(.5)}function fot(){var e=[],t=tu;function r(n){if(n!=null&&!isNaN(n=+n))return t((bP(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(Zb),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)=>sOr(e,a/n))},r.copy=function(){return fot(t).domain(e)},Sy.apply(r,arguments)}function p9(){var e=0,t=.5,r=1,n=1,s,a,i,l,c,u=tu,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(v){var x,w,S;return arguments.length?([x,w,S]=v,u=LOr(g,[x,w,S]),p):[u(0),u(.5),u(1)]}}return p.range=m(Fv),p.rangeRound=m($he),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 hot(){var e=t0(p9()(tu));return e.copy=function(){return r0(e,hot())},Sy.apply(e,arguments)}function pot(){var e=Uhe(p9()).domain([.1,1,10]);return e.copy=function(){return r0(e,pot()).base(e.base())},Sy.apply(e,arguments)}function mot(){var e=Vhe(p9());return e.copy=function(){return r0(e,mot()).constant(e.constant())},Sy.apply(e,arguments)}function tpe(){var e=qhe(p9());return e.copy=function(){return r0(e,tpe()).exponent(e.exponent())},Sy.apply(e,arguments)}function E_r(){return tpe.apply(null,arguments).exponent(.5)}const UT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Mhe,scaleDiverging:hot,scaleDivergingLog:pot,scaleDivergingPow:tpe,scaleDivergingSqrt:E_r,scaleDivergingSymlog:mot,scaleIdentity:Wit,scaleImplicit:Cae,scaleLinear:Qit,scaleLog:Zit,scaleOrdinal:Phe,scalePoint:oOr,scalePow:Hhe,scaleQuantile:Kit,scaleQuantize:Jit,scaleRadial:Xit,scaleSequential:cot,scaleSequentialLog:uot,scaleSequentialPow:epe,scaleSequentialQuantile:fot,scaleSequentialSqrt:__r,scaleSequentialSymlog:dot,scaleSqrt:ikr,scaleSymlog:Yit,scaleThreshold:eot,scaleTime:O_r,scaleUtc:k_r,tickFormat:Hit},Symbol.toStringTag,{value:"Module"}));function C_r(e){if(e in UT)return UT[e]();var t="scale".concat(fP(e));if(t in UT)return UT[t]()}function HNe(e,t,r){if(typeof e=="function")return e.copy().domain(t).range(r);if(e!=null){var n=C_r(e);if(n!=null)return n.domain(t).range(r),n}}function rpe(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?HNe(e.scale,r,n):HNe(t,r,n)}function j_r(e){return"scale".concat(fP(e))}function T_r(e){return j_r(e)in UT}var got=(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 T_r(n)?n:"point"}};function N_r(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 vot(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=N_r(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 A_r(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):vot(e,void 0)}function QNe(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 d4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QNe(Object(r),!0).forEach(function(n){I_r(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function I_r(e,t,r){return(t=R_r(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R_r(e){var t=P_r(e,"string");return typeof t=="symbol"?t:t+""}function P_r(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 Iae=[0,"auto"],Zo={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"},yot=(e,t)=>e.cartesianAxis.xAxis[t],Oy=(e,t)=>{var r=yot(e,t);return r??Zo},Yo={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Iae,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:mP},bot=(e,t)=>e.cartesianAxis.yAxis[t],ky=(e,t)=>{var r=bot(e,t);return r??Yo},M_r={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:""},npe=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??M_r},gu=(e,t,r)=>{switch(t){case"xAxis":return Oy(e,r);case"yAxis":return ky(e,r);case"zAxis":return npe(e,r);case"angleAxis":return jhe(e,r);case"radiusAxis":return The(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},D_r=(e,t,r)=>{switch(t){case"xAxis":return Oy(e,r);case"yAxis":return ky(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},OP=(e,t,r)=>{switch(t){case"xAxis":return Oy(e,r);case"yAxis":return ky(e,r);case"angleAxis":return jhe(e,r);case"radiusAxis":return The(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},xot=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function wot(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 Sot=e=>e.graphicalItems.cartesianItems,L_r=Xe([Cl,i9],wot),Oot=(e,t,r)=>e.filter(r).filter(n=>t?.includeHidden===!0?!0:!n.hide),kP=Xe([Sot,gu,L_r],Oot,{memoizeOptions:{resultEqualityCheck:l9}}),kot=Xe([kP],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Ahe)),_ot=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),$_r=Xe([kP],_ot),Eot=e=>e.map(t=>t.data).filter(Boolean).flat(1),F_r=Xe([kP],Eot,{memoizeOptions:{resultEqualityCheck:l9}}),Cot=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},spe=Xe([F_r,whe],Cot),jot=(e,t,r)=>t?.dataKey!=null?e.map(n=>({value:Xl(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:Xl(s,n)}))):e.map(n=>({value:n})),_P=Xe([spe,gu,kP],jot);function Xk(e){if(ig(e)||e instanceof Date){var t=Number(e);if(zs(t))return t}}function WNe(e){if(Array.isArray(e)){var t=[Xk(e[0]),Xk(e[1])];return Ym(t)?t:void 0}var r=Xk(e);if(r!=null)return[r,r]}function ry(e){return e.map(Xk).filter(Vu)}function z_r(e,t){var r=Xk(e),n=Xk(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var B_r=Xe([_P],e=>e?.map(t=>t.value).sort(z_r));function Tot(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function U_r(e,t,r){return!r||typeof t!="number"||Xv(t)?[]:r.length?ry(r.flatMap(n=>{var s=Xl(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 sl=e=>{var t=jl(e),r=nC(e);return OP(e,t,r)},EP=Xe([sl],e=>e?.dataKey),V_r=Xe([kot,whe,sl],Rit),Not=(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(Iit);return[l,{stackedData:nwr(e,d,r),graphicalItems:u}]}))},q_r=Xe([V_r,kot,r9,_it],Not),Aot=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:a}=t;if(n==null&&r!=="zAxis"){var i=iwr(e,s,a);if(!(i!=null&&i[0]===0&&i[1]===0))return i}},H_r=Xe([gu],e=>e.allowDataOverflow),ape=e=>{var t;if(e==null||!("domain"in e))return Iae;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=ry(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:Iae},Iot=Xe([gu],ape),Rot=Xe([Iot,H_r],pit),Q_r=Xe([q_r,e0,Cl,Rot],Aot,{memoizeOptions:{resultEqualityCheck:o9}}),ipe=e=>e.errorBars,W_r=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>Tot(r,n)),f4=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]}},Pot=(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=>Tot(s,x)),h=Xl(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),p=U_r(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 v=WNe(h);v!=null&&(a=a==null?v[0]:Math.min(a,v[0]),i=i==null?v[1]:Math.max(i,v[1]))})}),t?.dataKey!=null&&e.forEach(l=>{var c=WNe(Xl(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]},G_r=Xe([spe,gu,$_r,ipe,Cl],Pot,{memoizeOptions:{resultEqualityCheck:o9}});function Z_r(e){var{value:t}=e;if(ig(t)||t instanceof Date)return t}var Y_r=(e,t,r)=>{var n=e.map(Z_r).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&Qst(n))?hit(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},Mot=e=>e.referenceElements.dots,sC=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),X_r=Xe([Mot,Cl,i9],sC),Dot=e=>e.referenceElements.areas,K_r=Xe([Dot,Cl,i9],sC),Lot=e=>e.referenceElements.lines,J_r=Xe([Lot,Cl,i9],sC),$ot=(e,t)=>{if(e!=null){var r=ry(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},eEr=Xe(X_r,Cl,$ot),Fot=(e,t)=>{if(e!=null){var r=ry(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)]}},tEr=Xe([K_r,Cl],Fot);function rEr(e){var t;if(e.x!=null)return ry([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:ry(r)}function nEr(e){var t;if(e.y!=null)return ry([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:ry(r)}var zot=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?rEr(n):nEr(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},sEr=Xe([J_r,Cl],zot),aEr=Xe(eEr,sEr,tEr,(e,t,r)=>f4(e,r,t)),Bot=(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?f4(n,a,s):f4(a,s);return R1r(t,u,e.allowDataOverflow)},iEr=Xe([gu,Iot,Rot,Q_r,G_r,aEr,Fi,Cl],Bot,{memoizeOptions:{resultEqualityCheck:o9}}),oEr=[0,1],Uot=(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=by(t,a);if(u&&l==null){var d;return hit(0,(d=r?.length)!==null&&d!==void 0?d:0)}return c==="category"?Y_r(n,e,u):s==="expand"?oEr:i}},ope=Xe([gu,Fi,spe,_P,r9,Cl,iEr],Uot),aC=Xe([gu,xot,_he],got),Vot=(e,t,r)=>{var{niceTicks:n}=t;if(n!=="none"){var s=ape(t),a=Array.isArray(s)&&(s[0]==="auto"||s[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&Ym(e)){if(a)return rNe(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return nNe(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(a&&Ym(e))return rNe(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ym(e))return nNe(e,t.tickCount,t.allowDecimals,"adaptive")}}},lpe=Xe([ope,OP,aC],Vot),qot=(e,t,r,n)=>{if(n!=="angleAxis"&&e?.type==="number"&&Ym(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},lEr=Xe([gu,ope,lpe,Cl],qot),cEr=Xe(_P,gu,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(ry(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}}),Hot=Xe(cEr,Fi,$1r,tc,(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=kx(r,e*a),l=e*a/2;return l-i-(l-i)/a*i}return 0}),uEr=(e,t,r)=>{var n=Oy(e,t);return n==null||typeof n.padding!="string"?0:Hot(e,"xAxis",t,r,n.padding)},dEr=(e,t,r)=>{var n=ky(e,t);return n==null||typeof n.padding!="string"?0:Hot(e,"yAxis",t,r,n.padding)},fEr=Xe(Oy,uEr,(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}}),hEr=Xe(ky,dEr,(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}}),pEr=Xe([tc,fEr,Yz,Zz,(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]}),mEr=Xe([tc,Fi,hEr,Yz,Zz,(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]}),CP=(e,t,r,n)=>{var s;switch(t){case"xAxis":return pEr(e,r,n);case"yAxis":return mEr(e,r,n);case"zAxis":return(s=npe(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return Tit(e);case"radiusAxis":return Nit(e,r);default:return}},Qot=Xe([gu,CP],n9),gEr=Xe([aC,lEr],Q1r),cpe=Xe([gu,aC,gEr,Qot],rpe),Wot=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:a}=r,i=by(e,n);if(i&&(s==="number"||a!=="auto"))return t.map(l=>l.value)}},upe=Xe([Fi,_P,OP,Cl],Wot),m9=Xe([cpe],Ihe);Xe([cpe],A_r);Xe([cpe,B_r],vot);Xe([kP,ipe,Cl],W_r);function Got(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var g9=(e,t)=>t,v9=(e,t,r)=>r,vEr=Xe(Wz,g9,v9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(Got)),yEr=Xe(Gz,g9,v9,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(Got)),Zot=(e,t)=>({width:e.width,height:t.height}),bEr=(e,t)=>{var r=typeof t.width=="number"?t.width:mP;return{width:r,height:e.height}},xEr=Xe(tc,Oy,Zot),wEr=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},SEr=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},OEr=Xe(wy,tc,vEr,g9,v9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=Zot(t,l);i==null&&(i=wEr(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}),kEr=Xe(xy,tc,yEr,g9,v9,(e,t,r,n,s)=>{var a={},i;return r.forEach(l=>{var c=bEr(t,l);i==null&&(i=SEr(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}),_Er=(e,t)=>{var r=Oy(e,t);if(r!=null)return OEr(e,r.orientation,r.mirror)},EEr=Xe([tc,Oy,_Er,(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}}}),CEr=(e,t)=>{var r=ky(e,t);if(r!=null)return kEr(e,r.orientation,r.mirror)},jEr=Xe([tc,ky,CEr,(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}}}),TEr=Xe(tc,ky,(e,t)=>{var r=typeof t.width=="number"?t.width:mP;return{width:r,height:e.height}}),Yot=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:a,dataKey:i}=r,l=by(e,n),c=t.map(u=>u.value);if(i&&l&&a==="category"&&s&&Qst(c))return c}},dpe=Xe([Fi,_P,gu,Cl],Yot),GNe=Xe([Fi,D_r,aC,m9,dpe,upe,CP,lpe,Cl],(e,t,r,n,s,a,i,l,c)=>{if(t!=null){var u=by(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}}}),NEr=(e,t,r,n,s,a,i,l,c)=>{if(!(t==null||n==null)){var u=by(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((v,x)=>{var w=i?i.indexOf(v):v,S=n.map(w);return zs(S)?{index:x,coordinate:S+m,value:v,offset:m}:null}).filter(Vu):u&&l?l.map((v,x)=>{var w=n.map(v);return zs(w)?{coordinate:w+m,value:v,index:x,offset:m}:null}).filter(Vu):n.ticks?n.ticks(h).map((v,x)=>{var w=n.map(v);return zs(w)?{coordinate:w+m,value:v,index:x,offset:m}:null}).filter(Vu):n.domain().map((v,x)=>{var w=n.map(v);return zs(w)?{coordinate:w+m,value:i?i[v]:v,index:x,offset:m}:null}).filter(Vu)}},Xot=Xe([Fi,OP,aC,m9,lpe,CP,dpe,upe,Cl],NEr),AEr=(e,t,r,n,s,a,i)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=by(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(Vu):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(Vu):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(Vu)}},Kot=Xe([Fi,OP,m9,CP,dpe,upe,Cl],AEr),Jot=Xe(gu,m9,(e,t)=>{if(!(e==null||t==null))return d4(d4({},e),{},{scale:t})}),IEr=Xe([gu,aC,ope,Qot],rpe),REr=Xe([IEr],Ihe);Xe((e,t,r)=>npe(e,r),REr,(e,t)=>{if(!(e==null||t==null))return d4(d4({},e),{},{scale:t})});var PEr=Xe([Fi,Wz,Gz],(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}}),MEr=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};Xe([MEr],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 elt=e=>e.options.defaultTooltipEventType,tlt=e=>e.options.validateTooltipEventTypes;function rlt(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function fpe(e,t){var r=elt(e),n=tlt(e);return rlt(t,r,n)}function DEr(e){return en(t=>fpe(t,e))}var nlt=(e,t)=>{var r,n=Number(t);if(!(Xv(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},LEr=e=>e.tooltip.settings,Nb={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},$Er={itemInteraction:{click:Nb,hover:Nb},axisInteraction:{click:Nb,hover:Nb},keyboardInteraction:Nb,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}},slt=Ac({name:"tooltip",initialState:$Er,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:oi()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:oi()},removeTooltipEntrySettings:{reducer(e,t){var r=ph(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:oi()},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:FEr,replaceTooltipEntrySettings:zEr,removeTooltipEntrySettings:BEr,setTooltipSettingsState:UEr,setActiveMouseOverItemIndex:VEr,mouseLeaveItem:pRn,mouseLeaveChart:alt,setActiveClickItemIndex:mRn,setMouseOverAxisIndex:ilt,setMouseClickAxisIndex:qEr,setSyncInteraction:Rae,setKeyboardInteraction:h4}=slt.actions,HEr=slt.reducer;function ZNe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZNe(Object(r),!0).forEach(function(n){QEr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QEr(e,t,r){return(t=WEr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WEr(e){var t=GEr(e,"string");return typeof t=="symbol"?t:t+""}function GEr(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 ZEr(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function YEr(e){return e.index!=null}var olt=(e,t,r,n)=>{if(t==null)return Nb;var s=ZEr(e,t,r);if(s==null)return Nb;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(YEr(s)){if(a)return qD(qD({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return qD(qD({},Nb),{},{coordinate:s.coordinate})};function XEr(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 KEr(e,t){var r=XEr(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 JEr(e,t,r){if(r==null||t==null)return!0;var n=Xl(e,t);return n==null||!Ym(r)?!0:KEr(n,r)}var hpe=(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||JEr(u,r,n)?String(c):null},llt=(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}}},clt=(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})},ult=e=>e.options.tooltipPayloadSearcher,iC=e=>e.tooltip;function YNe(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 XNe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YNe(Object(r),!0).forEach(function(n){eCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eCr(e,t,r){return(t=tCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tCr(e){var t=rCr(e,"string");return typeof t=="symbol"?t:t+""}function rCr(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 nCr(e){if(typeof e=="string"||typeof e=="number")return e}function sCr(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function aCr(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function KNe(e){if(typeof e=="string")return e}function iCr(e){if(!(e==null||typeof e!="object")){var t="name"in e?nCr(e.name):void 0,r="unit"in e?sCr(e.unit):void 0,n="dataKey"in e?aCr(e.dataKey):void 0,s="payload"in e?e.payload:void 0,a="color"in e?KNe(e.color):void 0,i="fill"in e?KNe(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:s,color:a,fill:i}}}function oCr(e,t){return e??t}var dlt=(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:v}=p,x=oCr(g,l),w=Array.isArray(x)?Mat(x,u,d):x,S=(m=v?.dataKey)!==null&&m!==void 0?m:n,k=v?.nameKey,_;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&i==="axis"?_=Wst(w,n,s):_=a(w,t,c,k),Array.isArray(_))_.forEach(T=>{var j,N,I=iCr(T),P=I?.name,R=I?.dataKey,z=I?.payload,D=XNe(XNe({},v),{},{name:P,unit:I?.unit,color:(j=I?.color)!==null&&j!==void 0?j:v?.color,fill:(N=I?.fill)!==null&&N!==void 0?N:v?.fill});h.push(Yje({tooltipEntrySettings:D,dataKey:R,payload:z,value:Xl(z,R),name:P==null?void 0:String(P)}))});else{var E;h.push(Yje({tooltipEntrySettings:v,dataKey:S,payload:_,value:Xl(_,S),name:(E=Xl(_,k))!==null&&E!==void 0?E:v?.name}))}return h},f)}},ppe=Xe([sl,xot,_he],got),lCr=Xe([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),cCr=Xe([jl,nC],wot),oC=Xe([lCr,sl,cCr],Oot,{memoizeOptions:{resultEqualityCheck:l9}}),uCr=Xe([oC],e=>e.filter(Ahe)),dCr=Xe([oC],Eot,{memoizeOptions:{resultEqualityCheck:l9}}),lC=Xe([dCr,e0],Cot),fCr=Xe([uCr,e0,sl],Rit),mpe=Xe([lC,sl,oC],jot),flt=Xe([sl],ape),hCr=Xe([sl],e=>e.allowDataOverflow),hlt=Xe([flt,hCr],pit),pCr=Xe([oC],e=>e.filter(Ahe)),mCr=Xe([fCr,pCr,r9,_it],Not),gCr=Xe([mCr,e0,jl,hlt],Aot),vCr=Xe([oC],_ot),yCr=Xe([lC,sl,vCr,ipe,jl],Pot,{memoizeOptions:{resultEqualityCheck:o9}}),bCr=Xe([Mot,jl,nC],sC),xCr=Xe([bCr,jl],$ot),wCr=Xe([Dot,jl,nC],sC),SCr=Xe([wCr,jl],Fot),OCr=Xe([Lot,jl,nC],sC),kCr=Xe([OCr,jl],zot),_Cr=Xe([xCr,kCr,SCr],f4),ECr=Xe([sl,flt,hlt,gCr,yCr,_Cr,Fi,jl],Bot),jP=Xe([sl,Fi,lC,mpe,r9,jl,ECr],Uot),CCr=Xe([jP,sl,ppe],Vot),jCr=Xe([sl,jP,CCr,jl],qot),plt=e=>{var t=jl(e),r=nC(e),n=!1;return CP(e,t,r,n)},mlt=Xe([sl,plt],n9),TCr=Xe([sl,ppe,jCr,mlt],rpe),glt=Xe([TCr],Ihe),NCr=Xe([Fi,mpe,sl,jl],Yot),ACr=Xe([Fi,mpe,sl,jl],Wot),ICr=(e,t,r,n,s,a,i,l)=>{if(t){var{type:c}=t,u=by(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(Vu):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(Vu)}}},_y=Xe([Fi,sl,ppe,glt,plt,NCr,ACr,jl],ICr),gpe=Xe([elt,tlt,LEr],(e,t,r)=>rlt(r.shared,e,t)),vlt=e=>e.tooltip.settings.trigger,vpe=e=>e.tooltip.settings.defaultIndex,TP=Xe([iC,gpe,vlt,vpe],olt),aI=Xe([TP,lC,EP,jP],hpe),ylt=Xe([_y,aI],nlt),RCr=Xe([TP],e=>{if(e)return e.dataKey}),PCr=Xe([TP],e=>{if(e)return e.graphicalItemId}),blt=Xe([iC,gpe,vlt,vpe],clt),MCr=Xe([xy,wy,Fi,tc,_y,vpe,blt],llt),DCr=Xe([TP,MCr],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),LCr=Xe([TP],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),$Cr=Xe([blt,aI,e0,EP,ylt,ult,gpe],dlt),FCr=Xe([$Cr],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function JNe(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 eAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JNe(Object(r),!0).forEach(function(n){zCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JNe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zCr(e,t,r){return(t=BCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BCr(e){var t=UCr(e,"string");return typeof t=="symbol"?t:t+""}function UCr(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 VCr=()=>en(sl),qCr=()=>{var e=VCr(),t=en(_y),r=en(glt);return V5(!e||!r?void 0:eAe(eAe({},e),{},{scale:r}),t)};function tAe(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 yO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tAe(Object(r),!0).forEach(function(n){HCr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HCr(e,t,r){return(t=QCr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QCr(e){var t=WCr(e,"string");return typeof t=="symbol"?t:t+""}function WCr(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 GCr=(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}},ZCr=(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 yO(yO(yO({},n),Ql(n.cx,n.cy,i,a)),{},{angle:a,radius:i})}var l=s.coordinate,{angle:c}=n;return yO(yO(yO({},n),Ql(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 YCr(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 xlt=(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,v=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])){v=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{v=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,(v+m)/2),Math.max(m,(v+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},XCr=()=>en(_he),ype=(e,t)=>t,wlt=(e,t,r)=>r,bpe=(e,t,r,n)=>n,KCr=Xe(_y,e=>Lz(e,t=>t.coordinate)),xpe=Xe([iC,ype,wlt,bpe],olt),wpe=Xe([xpe,lC,EP,jP],hpe),JCr=(e,t,r)=>{if(t!=null){var n=iC(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},Slt=Xe([iC,ype,wlt,bpe],clt),p4=Xe([xy,wy,Fi,tc,_y,bpe,Slt],llt),ejr=Xe([xpe,p4],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),Olt=Xe([_y,wpe],nlt),tjr=Xe([Slt,wpe,e0,EP,Olt,ult,ype],dlt),rjr=Xe([xpe,wpe],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),njr=(e,t,r,n,s,a,i)=>{if(!(!e||!r||!n||!s)&&YCr(e,i)){var l=owr(e,t),c=xlt(l,a,s,r,n),u=GCr(t,s,c,e);return{activeIndex:String(c),activeCoordinate:u}}},sjr=(e,t,r,n,s,a,i)=>{if(!(!e||!n||!s||!a||!r)){var l=S1r(e,r);if(l){var c=lwr(l,t),u=xlt(c,i,a,n,s),d=ZCr(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},ajr=(e,t,r,n,s,a,i,l)=>{if(!(!e||!t||!n||!s||!a))return t==="horizontal"||t==="vertical"?njr(e,t,n,s,a,i,l):sjr(e,t,r,n,s,a,i)},ijr=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}}),ojr=Xe(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(eu)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:H1r}});function rAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function nAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rAe(Object(r),!0).forEach(function(n){ljr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ljr(e,t,r){return(t=cjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cjr(e){var t=ujr(e,"string");return typeof t=="symbol"?t:t+""}function ujr(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={},fjr={zIndexMap:Object.values(eu).reduce((e,t)=>nAe(nAe({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),djr)},hjr=new Set(Object.values(eu));function pjr(e){return hjr.has(e)}var klt=Ac({name:"zIndex",initialState:fjr,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:oi()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!pjr(r)&&delete e.zIndexMap[r])},prepare:oi()},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:oi()},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:oi()}}}),{registerZIndexPortal:mjr,unregisterZIndexPortal:gjr,registerZIndexPortalElement:vjr,unregisterZIndexPortalElement:yjr}=klt.actions,bjr=klt.reducer;function Ey(e){var{zIndex:t,children:r}=e,n=Bwr(),s=n&&t!==void 0&&t!==0,a=ud(),i=Uo();b.useLayoutEffect(()=>s?(i(mjr({zIndex:t})),()=>{i(gjr({zIndex:t}))}):p1,[i,t,s]);var l=en(c=>ijr(c,t,a));return s?l?pu.createPortal(r,l):null:r}function Pae(){return Pae=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},Pae.apply(null,arguments)}function sAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function HD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sAe(Object(r),!0).forEach(function(n){xjr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xjr(e,t,r){return(t=wjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wjr(e){var t=Sjr(e,"string");return typeof t=="symbol"?t:t+""}function Sjr(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 Ojr(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return b.isValidElement(t)?b.cloneElement(t,n):b.createElement(r,n)}function kjr(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,v;if(d==="ScatterChart")m=f,g=DSr,v=eu.cursorLine;else if(d==="BarChart")m=LSr(l,f,a,i),g=cit,v=eu.cursorRectangle;else if(l==="radial"&&Yst(f)){var{cx:x,cy:w,radius:S,startAngle:k,endAngle:_}=uit(f);m={cx:x,cy:w,startAngle:k,endAngle:_,innerRadius:S,outerRadius:S},g=fit,v=eu.cursorLine}else m={points:E1r(l,f,a)},g=sit,v=eu.cursorLine;var E=typeof c=="object"&&"className"in c?c.className:void 0,T=HD(HD(HD(HD({stroke:"#ccc",pointerEvents:"none"},a),m),Iz(c)),{},{payload:h,payloadIndex:p,className:ya("recharts-tooltip-cursor",E)});return b.createElement(Ey,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},b.createElement(Ojr,{cursor:c,cursorComp:g,cursorProps:T}))}function _jr(e){var t=qCr(),r=qat(),n=eC(),s=XCr();return t==null||r==null||n==null||s==null?null:b.createElement(kjr,Pae({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var _lt=b.createContext(null),Ejr=()=>b.useContext(_lt),LH={exports:{}},aAe;function Cjr(){return aAe||(aAe=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 v=this._events[g],x=arguments.length,w,S;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),x){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,h),!0;case 5:return v.fn.call(v.context,d,f,h,p),!0;case 6:return v.fn.call(v.context,d,f,h,p,m),!0}for(S=1,w=new Array(x-1);S<x;S++)w[S-1]=arguments[S];v.fn.apply(v.context,w)}else{var k=v.length,_;for(S=0;S<k;S++)switch(v[S].once&&this.removeListener(u,v[S].fn,void 0,!0),x){case 1:v[S].fn.call(v[S].context);break;case 2:v[S].fn.call(v[S].context,d);break;case 3:v[S].fn.call(v[S].context,d,f);break;case 4:v[S].fn.call(v[S].context,d,f,h);break;default:if(!w)for(_=1,w=new Array(x-1);_<x;_++)w[_-1]=arguments[_];v[S].fn.apply(v[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,v=[],x=m.length;g<x;g++)(m[g].fn!==d||h&&!m[g].once||f&&m[g].context!==f)&&v.push(m[g]);v.length?this._events[p]=v.length===1?v[0]:v: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})(LH)),LH.exports}var jjr=Cjr();const Tjr=Bo(jjr);var iI=new Tjr,Mae="recharts.syncEvent.tooltip",iAe="recharts.syncEvent.brush",Njr=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Xv(r))return e[r]}},Ajr={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Elt=Ac({name:"options",initialState:Ajr,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Ijr=Elt.reducer,{createEventEmitter:Rjr}=Elt.actions;function Pjr(e){return e.tooltip.syncInteraction}var Mjr={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Clt=Ac({name:"chartData",initialState:Mjr,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:oAe,setDataStartEndIndexes:Djr,setComputedData:gRn}=Clt.actions,Ljr=Clt.reducer,$jr=["x","y"];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 bO(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){Fjr(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 Fjr(e,t,r){return(t=zjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zjr(e){var t=Bjr(e,"string");return typeof t=="symbol"?t:t+""}function Bjr(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 Ujr(e,t){if(e==null)return{};var r,n,s=Vjr(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 Vjr(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 qjr(){var e=en(Ehe),t=en(Che),r=Uo(),n=en(Eit),s=en(_y),a=eC(),i=Xz(),l=en(c=>c.rootProps.className);b.useEffect(()=>{if(e==null)return p1;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,v=Ujr(p,$jr),{x,y:w,width:S,height:k}=d.payload.sourceViewBox,_=bO(bO({},v),{},{x:i.x+(S?(m-x)/S:0)*i.width,y:i.y+(k?(g-w)/k:0)*i.height});r(bO(bO({},d),{},{payload:bO(bO({},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(F=>String(F.value)===d.payload.label));var{coordinate:N}=d.payload;if(E==null||d.payload.active===!1||N==null||i==null){r(Rae({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),z=Math.min(P,i.y+i.height),D={x:a==="horizontal"?E.coordinate:R,y:a==="horizontal"?z:E.coordinate},U=Rae({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(U)}}};return iI.on(Mae,c),()=>{iI.off(Mae,c)}},[l,r,t,e,n,s,a,i])}function Hjr(){var e=en(Ehe),t=en(Che),r=Uo();b.useEffect(()=>{if(e==null)return p1;var n=(s,a,i)=>{t!==i&&e===s&&r(Djr(a))};return iI.on(iAe,n),()=>{iI.off(iAe,n)}},[r,t,e])}function Qjr(){var e=Uo();b.useEffect(()=>{e(Rjr())},[e]),qjr(),Hjr()}function Wjr(e,t,r,n,s,a){var i=en(m=>JCr(m,e,t)),l=en(PCr),c=en(Che),u=en(Ehe),d=en(Eit),f=en(Pjr),h=f?.active,p=Xz();b.useEffect(()=>{if(!h&&u!=null&&c!=null){var m=Rae({active:a,coordinate:r,dataKey:i,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:p,graphicalItemId:l});iI.emit(Mae,u,m,c)}},[h,r,i,l,s,n,c,u,d,a,p])}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 uAe(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){Gjr(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 Gjr(e,t,r){return(t=Zjr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zjr(e){var t=Yjr(e,"string");return typeof t=="symbol"?t:t+""}function Yjr(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 Xjr(e){return e.dataKey}function Kjr(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(dSr,t)}var dAe=[],Jjr={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 eTr(e){var t,r,n=cd(e,Jjr),{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:v,cursor:x,shared:w,trigger:S,defaultIndex:k,portal:_,axisId:E}=n,T=Uo(),j=typeof k=="number"?String(k):k;b.useEffect(()=>{T(UEr({shared:w,trigger:S,axisId:E,active:s,defaultIndex:j}))},[T,w,S,E,s,j]);var N=Xz(),I=nit(),P=DEr(w),{activeIndex:R,isActive:z}=(t=en(ee=>rjr(ee,P,S,j)))!==null&&t!==void 0?t:{},D=en(ee=>tjr(ee,P,S,j)),U=en(ee=>Olt(ee,P,S,j)),F=en(ee=>ejr(ee,P,S,j)),B=D,H=Ejr(),W=(r=s??z)!==null&&r!==void 0?r:!1,[L,Y]=Jxr([B,W]),q=P==="axis"?U:void 0;Wjr(P,S,F,q,R,W);var M=_??H;if(M==null||N==null||P==null)return null;var Q=B??dAe;W||(Q=dAe),u&&Q.length&&(Q=zxr(Q.filter(ee=>ee.value!=null&&(ee.hide!==!0||n.includeHidden)),h,Xjr));var G=Q.length>0,J=uAe(uAe({},n),{},{payload:Q,label:q,active:W,activeIndex:R,coordinate:F,accessibilityLayer:I}),ne=b.createElement(SSr,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:W,coordinate:F,hasPayload:G,offset:f,position:p,reverseDirection:m,useTranslate3d:g,viewBox:N,wrapperStyle:v,lastBoundingBox:L,innerRef:Y,hasPortalFromProps:!!_},Kjr(c,J));return b.createElement(b.Fragment,null,pu.createPortal(ne,M),W&&b.createElement(_jr,{cursor:x,tooltipEventType:P,coordinate:F,payload:Q,index:R}))}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)}class sTr{constructor(t){tTr(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 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 aTr(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){iTr(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 iTr(e,t,r){return(t=oTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oTr(e){var t=lTr(e,"string");return typeof t=="symbol"?t:t+""}function lTr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cTr={cacheSize:2e3,enableCache:!0},jlt=aTr({},cTr),hAe=new sTr(jlt.cacheSize),uTr={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},pAe="recharts_measurement_span";function dTr(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 mAe=(e,t)=>{try{var r=document.getElementById(pAe);r||(r=document.createElement("span"),r.setAttribute("id",pAe),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,uTr,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},CN=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||yP.isSsr)return{width:0,height:0};if(!jlt.enableCache)return mAe(t,r);var n=dTr(t,r),s=hAe.get(n);if(s)return s;var a=mAe(t,r);return hAe.set(n,a),a},Tlt;function fTr(e,t,r){return(t=hTr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hTr(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)}var gAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,vAe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,mTr=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,gTr=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,vTr={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},yTr=["cm","mm","pt","pc","in","Q","px"];function bTr(e){return yTr.includes(e)}var hk="NaN";function xTr(e,t){return e*vTr[t]}class Ll{static parse(t){var r,[,n,s]=(r=gTr.exec(t))!==null&&r!==void 0?r:[];return n==null?Ll.NaN:new Ll(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Xv(t)&&(this.unit=""),r!==""&&!mTr.test(r)&&(this.num=NaN,this.unit=""),bTr(r)&&(this.num=xTr(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new Ll(NaN,""):new Ll(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Ll(NaN,""):new Ll(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ll(NaN,""):new Ll(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ll(NaN,""):new Ll(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Xv(this.num)}}Tlt=Ll;fTr(Ll,"NaN",new Tlt(NaN,""));function Nlt(e){if(e==null||e.includes(hk))return hk;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,a]=(r=gAe.exec(t))!==null&&r!==void 0?r:[],i=Ll.parse(n??""),l=Ll.parse(a??""),c=s==="*"?i.multiply(l):i.divide(l);if(c.isNaN())return hk;t=t.replace(gAe,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,h]=(u=vAe.exec(t))!==null&&u!==void 0?u:[],p=Ll.parse(d??""),m=Ll.parse(h??""),g=f==="+"?p.add(m):p.subtract(m);if(g.isNaN())return hk;t=t.replace(vAe,g.toString())}return t}var yAe=/\(([^()]*)\)/;function wTr(e){for(var t=e,r;(r=yAe.exec(t))!=null;){var[,n]=r;t=t.replace(yAe,Nlt(n))}return t}function STr(e){var t=e.replace(/\s+/g,"");return t=wTr(t),t=Nlt(t),t}function OTr(e){try{return STr(e)}catch{return hk}}function $H(e){var t=OTr(e.slice(5,-1));return t===hk?"":t}var kTr=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],_Tr=["dx","dy","angle","className","breakAll"];function Dae(){return Dae=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},Dae.apply(null,arguments)}function bAe(e,t){if(e==null)return{};var r,n,s=ETr(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 ETr(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 Alt=/[ \f\n\r\t\v\u2028\u2029]+/,Ilt=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];_l(t)||(r?s=t.toString().split(""):s=t.toString().split(Alt));var a=s.map(l=>({word:l,width:CN(l,n).width})),i=r?0:CN(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:i}}catch{return null}};function Rlt(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function CTr(e){return _l(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Plt=(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},[]),Mlt=e=>e.reduce((t,r)=>t.width>r.width?t:r),jTr="…",xAe=(e,t,r,n,s,a,i,l)=>{var c=e.slice(0,t),u=Ilt({breakAll:r,style:n,children:c+jTr});if(!u)return[!1,[]];var d=Plt(u.wordsWithComputedWidth,a,i,l),f=d.length>s||Mlt(d).width>Number(a);return[f,d]},TTr=(e,t,r,n,s)=>{var{maxLines:a,children:i,style:l,breakAll:c}=e,u=Vr(a),d=String(i),f=Plt(t,n,r,s);if(!u||s)return f;var h=f.length>a||Mlt(f).width>Number(n);if(!h)return f;for(var p=0,m=d.length-1,g=0,v;p<=m&&g<=d.length-1;){var x=Math.floor((p+m)/2),w=x-1,[S,k]=xAe(d,w,c,l,a,n,r,s),[_]=xAe(d,x,c,l,a,n,r,s);if(!S&&!_&&(p=x+1),S&&_&&(m=x-1),!S&&_){v=k;break}g++}return v||f},wAe=e=>{var t=_l(e)?[]:e.toString().split(Alt);return[{words:t,width:void 0}]},NTr=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:a,maxLines:i}=e;if((t||r)&&!yP.isSsr){var l,c,u=Ilt({breakAll:a,children:n,style:s});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return wAe(n);return TTr({breakAll:a,children:n,maxLines:i,style:s},l,c,t,!!r)}return wAe(n)},Dlt="#808080",ATr={angle:0,breakAll:!1,capHeight:"0.71em",fill:Dlt,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Spe=b.forwardRef((e,t)=>{var r=cd(e,ATr),{x:n,y:s,lineHeight:a,capHeight:i,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=r,f=bAe(r,kTr),h=b.useMemo(()=>NTr({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:v,breakAll:x}=f,w=bAe(f,_Tr);if(!ig(n)||!ig(s)||h.length===0)return null;var S=Number(n)+(Vr(p)?p:0),k=Number(s)+(Vr(m)?m:0);if(!zs(S)||!zs(k))return null;var _;switch(d){case"start":_=$H("calc(".concat(i,")"));break;case"middle":_=$H("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(i," / 2))"));break;default:_=$H("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(Vr(N)&&Vr(j)?N/j:1,")"))}return g&&E.push("rotate(".concat(g,", ").concat(S,", ").concat(k,")")),E.length&&(w.transform=E.join(" ")),b.createElement("text",Dae({},cu(w),{ref:t,x:S,y:k,className:ya("recharts-text",v),textAnchor:u,fill:l.includes("url")?Dlt: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)}))});Spe.displayName="Text";function SAe(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 fm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SAe(Object(r),!0).forEach(function(n){ITr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SAe(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)}var MTr=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:a,y:i,height:l,upperWidth:c,lowerWidth:u}=ghe(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,v=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-v,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+v,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"?fm({x:h+k,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideRight"?fm({x:h+p-k,y:i+l/2,horizontalAnchor:_,verticalAnchor:"middle"},R):r==="insideTop"?fm({x:d+c/2,y:i+v,horizontalAnchor:"middle",verticalAnchor:w},R):r==="insideBottom"?fm({x:f+u/2,y:i+l-v,horizontalAnchor:"middle",verticalAnchor:x},R):r==="insideTopLeft"?fm({x:d+k,y:i+v,horizontalAnchor:E,verticalAnchor:w},R):r==="insideTopRight"?fm({x:d+c-k,y:i+v,horizontalAnchor:_,verticalAnchor:w},R):r==="insideBottomLeft"?fm({x:f+k,y:i+l-v,horizontalAnchor:E,verticalAnchor:x},R):r==="insideBottomRight"?fm({x:f+u-k,y:i+l-v,horizontalAnchor:_,verticalAnchor:x},R):r&&typeof r=="object"&&(Vr(r.x)||SS(r.x))&&(Vr(r.y)||SS(r.y))?fm({x:a+kx(r.x,p),y:i+kx(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},R):fm({x:m,y:i+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},DTr=["labelRef"],LTr=["content"];function OAe(e,t){if(e==null)return{};var r,n,s=$Tr(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 $Tr(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 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 VT(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){FTr(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 FTr(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=BTr(e,"string");return typeof t=="symbol"?t:t+""}function BTr(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 Ev(){return Ev=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},Ev.apply(null,arguments)}var Llt=b.createContext(null),UTr=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(Llt.Provider,{value:c},l)},$lt=()=>{var e=b.useContext(Llt),t=Xz();return e||(t?ghe(t):void 0)},VTr=b.createContext(null),qTr=()=>{var e=b.useContext(VTr),t=en(Ait);return e||t},HTr=e=>{var{value:t,formatter:r}=e,n=_l(e.children)?t:e.children;return typeof r=="function"?r(n):n},Ope=e=>e!=null&&typeof e=="function",QTr=(e,t)=>{var r=hh(t-e),n=Math.min(Math.abs(t-e),360);return r*n},WTr=(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=QTr(f,h),v=g>=0?1:-1,x,w;switch(t){case"insideStart":x=f+v*a,w=p;break;case"insideEnd":x=h-v*a,w=!p;break;case"end":x=h+v*a,w=p;break;default:throw new Error("Unsupported position ".concat(t))}w=g<=0?w:!w;var S=Ql(l,c,m,x),k=Ql(l,c,m,x+(w?1:-1)*359),_="M".concat(S.x,",").concat(S.y,`
289
289
  A`).concat(m,",").concat(m,",0,1,").concat(w?0:1,`,
290
- `).concat(k.x,",").concat(k.y),E=_l(e.id)?WA("recharts-radial-line-"):e.id;return b.createElement("text",Ev({},n,{dominantBaseline:"central",className:ya("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},GTr=(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}=Ql(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}=Ql(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},x$=e=>e!=null&&"cx"in e&&Vr(e.cx),ZTr={angle:0,offset:5,zIndex:eu.label,position:"middle",textBreakAll:!1};function YTr(e){if(!x$(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 _b(e){var t=cd(e,ZTr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=qTr(),h=$lt(),p=s==="center"?h:f??h,m,g,v;r==null?m=p:x$(r)?m=r:m=ghe(r);var x=YTr(m);if(!m||_l(a)&&_l(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=VT(VT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=OAe(w,DTr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=OAe(w,LTr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=HTr(t);var T=cu(t);if(x$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return WTr(t,s,g,T,m);v=GTr(m,t.offset,t.position)}else{if(!x)return null;var j=MTr({viewBox:x,position:s,offset:t.offset,parentViewBox:x$(n)?void 0:n});v=VT(VT({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(Ey,{zIndex:t.zIndex},b.createElement(Spe,Ev({ref:d,className:ya("recharts-label",c)},T,v,{textAnchor:Rlt(T.textAnchor)?T.textAnchor:v.textAnchor,breakAll:u}),g))}_b.displayName="Label";var XTr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(_b,Ev({key:"label-implicit"},n)):ig(e)?b.createElement(_b,Ev({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===_b?b.cloneElement(e,VT({key:"label-implicit"},n)):b.createElement(_b,Ev({key:"label-implicit",content:e},n)):Ope(e)?b.createElement(_b,Ev({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(_b,Ev({},e,{key:"label-implicit"},n)):null};function KTr(e){var{label:t,labelRef:r}=e,n=$lt();return XTr(t,n,r)||null}var JTr=["valueAccessor"],eNr=["dataKey","clockWise","id","textBreakAll","zIndex"];function m4(){return m4=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},m4.apply(null,arguments)}function _Ae(e,t){if(e==null)return{};var r,n,s=tNr(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 tNr(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 rNr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(CTr(t))return t},Flt=b.createContext(void 0),nNr=Flt.Provider,zlt=b.createContext(void 0);zlt.Provider;function sNr(){return b.useContext(Flt)}function aNr(){return b.useContext(zlt)}function w$(e){var{valueAccessor:t=rNr}=e,r=_Ae(e,JTr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=_Ae(r,eNr),u=sNr(),d=aNr(),f=u||d;return!f||!f.length?null:b.createElement(Ey,{zIndex:l??eu.label},b.createElement(Yv,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=_l(n)?t(h,p):Xl(h.payload,n),v=_l(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(_b,m4({key:"label-".concat(p)},cu(h),c,v,{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}))})))}w$.displayName="LabelList";function iNr(e){var{label:t}=e;return t?t===!0?b.createElement(w$,{key:"labelList-implicit"}):b.isValidElement(t)||Ope(t)?b.createElement(w$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(w$,m4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Lae(){return Lae=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},Lae.apply(null,arguments)}var Blt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=ya("recharts-dot",s);return Vr(t)&&Vr(r)&&Vr(n)?b.createElement("circle",Lae({},ag(e),ohe(e),{className:a,cx:t,cy:r,r:n})):null},oNr={radiusAxis:{},angleAxis:{}},Ult=Ac({name:"polarAxis",initialState:oNr,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:vRn,removeRadiusAxis:yRn,addAngleAxis:bRn,removeAngleAxis:xRn}=Ult.actions,lNr=Ult.reducer;function cNr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var FH={exports:{}},Ks={};var EAe;function uNr(){if(EAe)return Ks;EAe=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(v){if(typeof v=="object"&&v!==null){var x=v.$$typeof;switch(x){case e:switch(v=v.type,v){case r:case s:case n:case u:case d:return v;default:switch(v=v&&v.$$typeof,v){case l:case i:case c:case h:case f:case a:return v;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(v){return g(v)===i},Ks.isContextProvider=function(v){return g(v)===a},Ks.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Ks.isForwardRef=function(v){return g(v)===c},Ks.isFragment=function(v){return g(v)===r},Ks.isLazy=function(v){return g(v)===h},Ks.isMemo=function(v){return g(v)===f},Ks.isPortal=function(v){return g(v)===t},Ks.isProfiler=function(v){return g(v)===s},Ks.isStrictMode=function(v){return g(v)===n},Ks.isSuspense=function(v){return g(v)===u},Ks.isSuspenseList=function(v){return g(v)===d},Ks.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===r||v===s||v===n||v===u||v===d||v===p||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===f||v.$$typeof===a||v.$$typeof===i||v.$$typeof===c||v.$$typeof===m||v.getModuleId!==void 0)},Ks.typeOf=g,Ks}var CAe;function dNr(){return CAe||(CAe=1,FH.exports=uNr()),FH.exports}dNr();var Vlt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,zH={},jAe;function fNr(){return jAe||(jAe=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})(zH)),zH}var BH,TAe;function hNr(){return TAe||(TAe=1,BH=fNr().isPlainObject),BH}var pNr=hNr();const mNr=Bo(pNr);var NAe,AAe,IAe,RAe,PAe;function MAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function DAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MAe(Object(r),!0).forEach(function(n){gNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gNr(e,t,r){return(t=vNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vNr(e){var t=yNr(e,"string");return typeof t=="symbol"?t:t+""}function yNr(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 g4(){return g4=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},g4.apply(null,arguments)}function tT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var LAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(NAe||(NAe=tT(["M ",",",""])),e,t),i+=Qi(AAe||(AAe=tT(["L ",",",""])),e+r,t),i+=Qi(IAe||(IAe=tT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(RAe||(RAe=tT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(PAe||(PAe=tT(["L ",","," Z"])),e,t),i},bNr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},xNr=e=>{var t=cd(e,bNr),{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),v=b.useRef(a),x=b.useRef(i),w=b.useRef(r),S=b.useRef(n),k=xhe(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 _=ya("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",g4({},cu(t),{className:_,d:LAe(r,n,s,a,i)})));var E=g.current,T=v.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"),z=ait(["strokeDasharray"],u,c);return b.createElement(bhe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},D=>{var U=Fu(E,s,D),F=Fu(T,a,D),B=Fu(j,i,D),H=Fu(N,r,D),W=Fu(I,n,D);h.current&&(g.current=U,v.current=F,x.current=B,w.current=H,S.current=W);var L=D>0?{transition:z,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",g4({},cu(t),{className:_,d:LAe(H,W,U,F,B),ref:h,style:DAe(DAe({},L),t.style)}))})},wNr=["option","shapeType","activeClassName","inActiveClassName"];function SNr(e,t){if(e==null)return{};var r,n,s=ONr(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 ONr(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 $Ae(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 v4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$Ae(Object(r),!0).forEach(function(n){kNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$Ae(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kNr(e,t,r){return(t=_Nr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _Nr(e){var t=ENr(e,"string");return typeof t=="symbol"?t:t+""}function ENr(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 CNr(e,t){return v4(v4({},t),e)}function jNr(e,t){return e==="symbols"}function FAe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(cit,r);case"trapezoid":return b.createElement(xNr,r);case"sector":return b.createElement(fit,r);case"symbols":if(jNr(t))return b.createElement(Zst,r);break;case"curve":return b.createElement(sit,r);default:return null}}function TNr(e){return b.isValidElement(e)?e.props:e}function NNr(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=SNr(e,wNr),i;if(b.isValidElement(t))i=b.cloneElement(t,v4(v4({},a),TNr(t)));else if(typeof t=="function")i=t(a,a.index);else if(mNr(t)&&typeof t!="boolean"){var l=CNr(t,a);i=b.createElement(FAe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(FAe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Yv,{className:n},i):b.createElement(Yv,{className:s},i)}function ANr(e){var{tooltipEntrySettings:t}=e,r=Uo(),n=ud(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(FEr(t)):s.current!==t&&r(zEr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(BEr(s.current)),s.current=null)},[r]),null}function INr(e){var{legendPayload:t}=e,r=Uo(),n=ud(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(eSr(t)):s.current!==t&&r(tSr({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(rSr(s.current)),s.current=null)},[r]),null}var UH,RNr=()=>{var[e]=b.useState(()=>WA("uid-"));return e},PNr=(UH=YS.useId)!==null&&UH!==void 0?UH:RNr;function MNr(e,t){var r=PNr();return t||(e?"".concat(e,"-").concat(r):r)}var DNr=b.createContext(void 0),LNr=e=>{var{id:t,type:r,children:n}=e,s=MNr("recharts-".concat(r),t);return b.createElement(DNr.Provider,{value:s},n(s))},$Nr={cartesianItems:[],polarItems:[]},qlt=Ac({name:"graphicalItems",initialState:$Nr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:oi()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:oi()},removeCartesianGraphicalItem:{reducer(e,t){var r=ph(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:oi()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:oi()},removePolarGraphicalItem:{reducer(e,t){var r=ph(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:oi()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:oi()}}}),{addCartesianGraphicalItem:FNr,replaceCartesianGraphicalItem:zNr,removeCartesianGraphicalItem:BNr,addPolarGraphicalItem:wRn,removePolarGraphicalItem:SRn,replacePolarGraphicalItem:ORn}=qlt.actions,UNr=qlt.reducer,VNr=e=>{var t=Uo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(FNr(e)):r.current!==e&&t(zNr({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(BNr(r.current)),r.current=null)},[t]),null},qNr=b.memo(VNr),HNr=["points"];function zAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function VH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zAe(Object(r),!0).forEach(function(n){QNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QNr(e,t,r){return(t=WNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WNr(e){var t=GNr(e,"string");return typeof t=="symbol"?t:t+""}function GNr(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 y4(){return y4=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},y4.apply(null,arguments)}function ZNr(e,t){if(e==null)return{};var r,n,s=YNr(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 YNr(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 XNr(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=ya(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=ZNr(a,HNr);return b.createElement(Blt,y4({},l,{className:s}))}function KNr(e,t){return e==null?!1:t?!0:e.length===1}function JNr(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=eu.scatter}=e;if(!KNr(t,r))return null;var d=Vlt(r),f=dbr(r),h=t.map((m,g)=>{var v,x,w=VH(VH(VH({r:3},i),f),{},{index:g,cx:(v=m.x)!==null&&v!==void 0?v: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(XNr,{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(Ey,{zIndex:u},b.createElement(Yv,y4({className:n},p),h))}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 UAe(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){eAr(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 eAr(e,t,r){return(t=tAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tAr(e){var t=rAr(e,"string");return typeof t=="symbol"?t:t+""}function rAr(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 nAr={xAxis:{},yAxis:{},zAxis:{}},Hlt=Ac({name:"cartesianAxis",initialState:nAr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:oi()},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:oi()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:oi()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:oi()},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:oi()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:oi()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:oi()},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:oi()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:oi()},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]=UAe(UAe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:sAr,replaceXAxis:aAr,removeXAxis:iAr,addYAxis:oAr,replaceYAxis:lAr,removeYAxis:cAr,addZAxis:kRn,replaceZAxis:_Rn,removeZAxis:ERn,updateYAxisWidth:uAr}=Hlt.actions,dAr=Hlt.reducer,fAr=Xe([tc],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),hAr=Xe([fAr,xy,wy],(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)}}),kpe=()=>en(hAr),pAr=()=>en(FCr);function VAe(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 qH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VAe(Object(r),!0).forEach(function(n){mAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mAr(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=vAr(e,"string");return typeof t=="symbol"?t:t+""}function vAr(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=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=qH(qH(qH({},l),Iz(s)),ohe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Blt,c),b.createElement(Yv,{className:"recharts-active-dot",clipPath:i},u)};function bAr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=eu.activeDot}=e,l=en(aI),c=pAr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return _l(u)?null:b.createElement(Ey,{zIndex:i},b.createElement(yAr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var xAr=e=>{var{chartData:t}=e,r=Uo(),n=ud();return b.useEffect(()=>n?()=>{}:(r(oAe(t)),()=>{r(oAe(void 0))}),[t,r,n]),null},qAe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Qlt=Ac({name:"brush",initialState:qAe,reducers:{setBrushSettings(e,t){return t.payload==null?qAe:t.payload}}}),{setBrushSettings:CRn}=Qlt.actions,wAr=Qlt.reducer;function SAr(e){return(e%180+180)%180}var OAr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=SAr(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)},kAr={dots:[],areas:[],lines:[]},Wlt=Ac({name:"referenceElements",initialState:kAr,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:jRn,removeDot:TRn,addArea:NRn,removeArea:ARn,addLine:IRn,removeLine:RRn}=Wlt.actions,_Ar=Wlt.reducer,EAr=b.createContext(void 0),CAr=e=>{var{children:t}=e,[r]=b.useState("".concat(WA("recharts"),"-clip")),n=kpe();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(EAr.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 Glt(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 jAr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return OAr(n,r)}function TAr(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 oI(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 NAr(e,t){return Glt(e,t+1)}function AAr(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:Glt(n,u)};var g=c,v,x=()=>(v===void 0&&(v=r(m,g)),v),w=m.coordinate,S=c===0||oI(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 IAr(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||oI(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 v=[],x=d;x<i;x+=u){var w=n[x];w!=null&&v.push(w)}return v}}return[]}function HAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function oc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HAe(Object(r),!0).forEach(function(n){RAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RAr(e,t,r){return(t=PAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PAr(e){var t=MAr(e,"string");return typeof t=="symbol"?t:t+""}function MAr(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 DAr(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,v=()=>(g===void 0&&(g=r(p,h)),g);if(h===i-1){var x=e*(m.coordinate+e*v()/2-c);a[h]=m=oc(oc({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=oc(oc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=oI(e,m.tickCoord,v,l,c);w&&(c=m.tickCoord-e*(v()/2+s),a[h]=oc(oc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function LAr(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=oc(oc({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=oI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=oc(oc({},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=oc(oc({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=oc(oc({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=oI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=oc(oc({},k),{},{isShow:!0}))}},v=0;v<m;v++)g(v);return i}function _pe(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(Vr(c)||yP.isSsr){var h;return(h=NAr(s,Vr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?CN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},v=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?jAr(CN(T,{fontSize:t,letterSpacing:r}),g,f):CN(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=TAr(a,S,m);return c==="equidistantPreserveStart"?AAr(S,k,v,s,i):c==="equidistantPreserveEnd"?IAr(S,k,v,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=LAr(S,k,v,s,i,c==="preserveStartEnd"):p=DAr(S,k,v,s,i),p.filter(_=>_.isShow))}var $Ar=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},FAr={xAxis:{},yAxis:{}},Zlt=Ac({name:"renderedTicks",initialState:FAr,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:zAr,removeRenderedTicks:BAr}=Zlt.actions,UAr=Zlt.reducer,VAr=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function qAr(e,t){if(e==null)return{};var r,n,s=HAr(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 HAr(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 jS(){return jS=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},jS.apply(null,arguments)}function QAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QAe(Object(r),!0).forEach(function(n){QAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QAr(e,t,r){return(t=WAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WAr(e){var t=GAr(e,"string");return typeof t=="symbol"?t:t+""}function GAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zv={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:eu.axis};function ZAr(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),ag(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",jS({},u,{className:ya("recharts-cartesian-axis-line",Dz(l,"className"))}))}function YAr(e,t,r,n,s,a,i,l,c){var u,d,f,h,p,m,g=l?-1:1,v=e.tickSize||i,x=Vr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=r+ +!l*s,f=h-g*v,m=f-g*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!l*n,u=d-g*v,p=u-g*c,m=x;break;case"right":f=h=e.coordinate,d=t+ +l*n,u=d+g*v,p=u+g*c,m=x;break;default:u=d=e.coordinate,h=r+ +l*s,f=h+g*v,m=f+g*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:m}}}function XAr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function KAr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function JAr(e){var{option:t,tickProps:r,value:n}=e,s,a=ya(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=ya(i,cNr(t))),s=b.createElement(Spe,jS({},r,{className:i}),n)}return s}function eIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Uo();return b.useEffect(()=>{if(n==null||r==null)return p1;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(zAr({ticks:a,axisId:n,axisType:r})),()=>{s(BAr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var tIr=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:v,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:k,events:_,axisType:E,axisId:T}=e,j=_pe(Hi(Hi({},k),{},{ticks:r}),w,S),N=ag(k),I=Iz(n),P=Rlt(N.textAnchor)?N.textAnchor:XAr(d,f),R=KAr(d,f),z={};typeof s=="object"&&(z=s);var D=Hi(Hi({},N),{},{fill:"none"},z),U=j.map(H=>Hi({entry:H},YAr(H,h,p,m,g,d,v,f,x))),F=U.map(H=>{var{entry:W,line:L}=H;return b.createElement(Yv,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(W.value,"-").concat(W.coordinate,"-").concat(W.tickCoord)},s&&b.createElement("line",jS({},D,L,{className:ya("recharts-cartesian-axis-tick-line",Dz(s,"className"))})))}),B=U.map((H,W)=>{var L,Y,{entry:q,tick:M}=H,Q=Hi(Hi(Hi(Hi({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},M),{},{index:W,payload:q,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(L=(Y=u?.angle)!==null&&Y!==void 0?Y:N.angle)!==null&&L!==void 0?L:0}),G=Hi(Hi({},Q),I);return b.createElement(Yv,jS({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(q.value,"-").concat(q.coordinate,"-").concat(q.tickCoord)},mxr(_,q,W)),n&&b.createElement(JAr,{option:n,tickProps:G,value:"".concat(typeof i=="function"?i(q.value,W):q.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(eIr,{ticks:j,axisId:T,axisType:E}),B.length>0&&b.createElement(Ey,{zIndex:eu.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},B)),F.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},F))}),rIr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=qAr(e,VAr),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return $Ar({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var v=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(Ey,{zIndex:e.zIndex},b.createElement(Yv,{className:ya("recharts-cartesian-axis",a)},b.createElement(ZAr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:ag(e)}),b.createElement(tIr,{ref:v,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(UTr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(KTr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Epe=b.forwardRef((e,t)=>{var r=cd(e,zv);return b.createElement(rIr,jS({},r,{ref:t}))});Epe.displayName="CartesianAxis";var nIr=["x1","y1","x2","y2","key"],sIr=["offset"],aIr=["xAxisId","yAxisId"],iIr=["xAxisId","yAxisId"];function WAe(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 hc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WAe(Object(r),!0).forEach(function(n){oIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oIr(e,t,r){return(t=lIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lIr(e){var t=cIr(e,"string");return typeof t=="symbol"?t:t+""}function cIr(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 kw(){return kw=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},kw.apply(null,arguments)}function b4(e,t){if(e==null)return{};var r,n,s=uIr(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 uIr(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 dIr=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 Ylt(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=b4(r,nIr),f=(s=ag(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=b4(f,sIr);n=b.createElement("line",kw({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function fIr(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=b4(e,aIr),c=s.map((u,d)=>{var f=hc(hc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(Ylt,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function hIr(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=b4(e,iIr),c=s.map((u,d)=>{var f=hc(hc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(Ylt,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function pIr(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 v=h%t.length;return b.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:g,width:a,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function mIr(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 v=h%r.length;return b.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:g,height:l,stroke:"none",fill:r[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var gIr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return Dat(_pe(hc(hc(hc({},zv),r),{},{ticks:Lat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},vIr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return Dat(_pe(hc(hc(hc({},zv),r),{},{ticks:Lat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},yIr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:eu.grid};function Xlt(e){var t=Hat(),r=Qat(),n=qat(),s=hc(hc({},cd(e,yIr)),{},{x:Vr(e.x)?e.x:n.left,y:Vr(e.y)?e.y:n.top,width:Vr(e.width)?e.width:n.width,height:Vr(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=ud(),g=en(N=>GNe(N,"xAxis",a,m)),v=en(N=>GNe(N,"yAxis",i,m));if(!og(u)||!og(d)||!Vr(l)||!Vr(c))return null;var x=s.verticalCoordinatesGenerator||gIr,w=s.horizontalCoordinatesGenerator||vIr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:v?hc(hc({},v),{},{ticks:_?h:v.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);q5(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?hc(hc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);q5(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(Ey,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(dIr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(pIr,kw({},s,{horizontalPoints:S})),b.createElement(mIr,kw({},s,{verticalPoints:k})),b.createElement(fIr,kw({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:v})),b.createElement(hIr,kw({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:v}))))}Xlt.displayName="CartesianGrid";var bIr={},Klt=Ac({name:"errorBars",initialState:bIr,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:PRn,replaceErrorBar:MRn,removeErrorBar:DRn}=Klt.actions,xIr=Klt.reducer,wIr=["children"];function SIr(e,t){if(e==null)return{};var r,n,s=OIr(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 OIr(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 kIr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},_Ir=b.createContext(kIr);function EIr(e){var{children:t}=e,r=SIr(e,wIr);return b.createElement(_Ir.Provider,{value:r},t)}function Jlt(e,t){var r,n,s=en(u=>Oy(u,e)),a=en(u=>ky(u,t)),i=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Zo.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:Yo.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function CIr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=kpe(),{needClipX:a,needClipY:i,needClip:l}=Jlt(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 ect=(e,t,r,n)=>Jot(e,"xAxis",t,n),tct=(e,t,r,n)=>Kot(e,"xAxis",t,n),rct=(e,t,r,n)=>Jot(e,"yAxis",r,n),nct=(e,t,r,n)=>Kot(e,"yAxis",r,n),jIr=Xe([Fi,ect,rct,tct,nct],(e,t,r,n,s)=>by(e,"xAxis")?V5(t,n,!1):V5(r,s,!1)),TIr=(e,t,r,n,s)=>s;function NIr(e){return e.type==="line"}var AIr=Xe([Sot,TIr],(e,t)=>e.filter(NIr).find(r=>r.id===t)),IIr=Xe([Fi,ect,rct,tct,nct,AIr,jIr,whe],(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 JIr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function RIr(e){var t=Iz(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 PIr=["id"],MIr=["type","layout","connectNulls","needClip","shape"],DIr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function lI(){return lI=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},lI.apply(null,arguments)}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 Om(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){LIr(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 LIr(e,t,r){return(t=$Ir(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Ir(e){var t=FIr(e,"string");return typeof t=="symbol"?t:t+""}function FIr(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 Cpe(e,t){if(e==null)return{};var r,n,s=zIr(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 zIr(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 BIr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:$at(r,t),payload:e}]},UIr=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:p1,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:$at(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(ANr,{tooltipEntrySettings:f})}),sct=(e,t)=>"".concat(t,"px ").concat(e,"px");function VIr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var qIr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return sct(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[...VIr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function HIr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=Cpe(n,PIr),u=ag(c);return b.createElement(JNr,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function QIr(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 Om(Om({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(nNr,{value:t?s:void 0},r)}function ZAe(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=Cpe(a,MIr),h=Om(Om({},cu(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(NNr,lI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement(HIr,{points:n,clipPathId:t,props:a}))}function WIr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function GIr(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:v}=r,x=s.current,w=xhe(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 v=="function"&&v(),_(!0)},[v]),N=WIr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(QIr,{points:i,showLabels:E},r.children,b.createElement(bhe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var z=Fu(P,N+P,R),D=Math.min(z,N),U;if(c)if(l){var F="".concat(l).split(/[,\s]+/gim).map(W=>parseFloat(W));U=qIr(D,N,F)}else U=sct(N,D);else U=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,D)),x){var B=x.length/i.length,H=R===1?i:i.map((W,L)=>{var Y=Math.floor(L*B);if(x[Y]){var q=x[Y];return Om(Om({},W),{},{x:Fu(q.x,W.x,R),y:Fu(q.y,W.y,R)})}return h?Om(Om({},W),{},{x:Fu(p*2,W.x,R),y:Fu(m/2,W.y,R)}):Om(Om({},W),{},{x:W.x,y:W.y})});return s.current=H,b.createElement(ZAe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:U})}return b.createElement(ZAe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:U})}),b.createElement(iNr,{label:r.label}))}function ZIr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(GIr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var YIr=(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:Xl(e.payload,t)}};class XIr 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=ya("recharts-line",s),g=f,{r:v,strokeWidth:x}=RIr(r),w=Vlt(r),S=v*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(Ey,{zIndex:p},b.createElement(Yv,{className:m},h&&b.createElement("defs",null,b.createElement(CIr,{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(EIr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:YIr,errorBarOffset:0},b.createElement(ZIr,{props:this.props,clipPathId:g}))),b.createElement(bAr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var act={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:eu.line,type:"linear"};function KIr(e){var t=cd(e,act),{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,v=Cpe(t,DIr),{needClip:x}=Jlt(p,m),w=kpe(),S=eC(),k=ud(),_=en(I=>IIr(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(XIr,lI({},v,{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 JIr(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=Xl(u,i);if(t==="horizontal"){var h=Wje({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=Wje({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 eRr(e){var t=cd(e,act),r=ud();return b.createElement(LNr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(INr,{legendPayload:BIr(t)}),b.createElement(UIr,{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(qNr,{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(KIr,lI({},t,{id:n}))))}var ict=b.memo(eRr,t9);ict.displayName="Line";var tRr=["domain","range"],rRr=["domain","range"];function YAe(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}function XAe(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 oct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=YAe(e,tRr),{domain:a,range:i}=t,l=YAe(t,rRr);return!XAe(r,a)||!XAe(n,i)?!1:t9(s,l)}var sRr=["type"],aRr=["dangerouslySetInnerHTML","ticks","scale"],iRr=["id","scale"];function $ae(){return $ae=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},$ae.apply(null,arguments)}function KAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function JAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KAe(Object(r),!0).forEach(function(n){oRr(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 oRr(e,t,r){return(t=lRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lRr(e){var t=cRr(e,"string");return typeof t=="symbol"?t:t+""}function cRr(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 Fae(e,t){if(e==null)return{};var r,n,s=uRr(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 uRr(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 dRr(e){var t=Uo(),r=b.useRef(null),n=Wat(),{type:s}=e,a=Fae(e,sRr),i=s9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return JAe(JAe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(sAr(l)):r.current!==l&&t(aAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(iAr(r.current)),r.current=null)},[t]),null}var fRr=e=>{var{xAxisId:t,className:r}=e,n=en(zat),s=ud(),a="xAxis",i=en(x=>Xot(x,a,t,s)),l=en(x=>xEr(x,t)),c=en(x=>EEr(x,t)),u=en(x=>yot(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Fae(e,aRr),{id:m,scale:g}=u,v=Fae(u,iRr);return b.createElement(Epe,$ae({},p,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:ya("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},hRr={allowDataOverflow:Zo.allowDataOverflow,allowDecimals:Zo.allowDecimals,allowDuplicatedCategory:Zo.allowDuplicatedCategory,angle:Zo.angle,axisLine:zv.axisLine,height:Zo.height,hide:!1,includeHidden:Zo.includeHidden,interval:Zo.interval,label:!1,minTickGap:Zo.minTickGap,mirror:Zo.mirror,orientation:Zo.orientation,padding:Zo.padding,reversed:Zo.reversed,scale:Zo.scale,tick:Zo.tick,tickCount:Zo.tickCount,tickLine:zv.tickLine,tickSize:zv.tickSize,type:Zo.type,niceTicks:Zo.niceTicks,xAxisId:0},pRr=e=>{var t=cd(e,hRr);return b.createElement(b.Fragment,null,b.createElement(dRr,{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(fRr,t))},lct=b.memo(pRr,oct);lct.displayName="XAxis";var mRr=["type"],gRr=["dangerouslySetInnerHTML","ticks","scale"],vRr=["id","scale"];function zae(){return zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zae.apply(null,arguments)}function eIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function tIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eIe(Object(r),!0).forEach(function(n){yRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yRr(e,t,r){return(t=bRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bRr(e){var t=xRr(e,"string");return typeof t=="symbol"?t:t+""}function xRr(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 Bae(e,t){if(e==null)return{};var r,n,s=wRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function SRr(e){var t=Uo(),r=b.useRef(null),n=Wat(),{type:s}=e,a=Bae(e,mRr),i=s9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return tIe(tIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(oAr(l)):r.current!==l&&t(lAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(cAr(r.current)),r.current=null)},[t]),null}function ORr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(zat),c=ud(),u=Uo(),d="yAxis",f=en(E=>TEr(E,t)),h=en(E=>jEr(E,t)),p=en(E=>Xot(E,d,t,c)),m=en(E=>bot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Ope(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(uAr({id:t,width:T}))}}},[p,f,u,s,t,n,m]),f==null||h==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:x}=e,w=Bae(e,gRr),{id:S,scale:k}=m,_=Bae(m,vRr);return b.createElement(Epe,zae({},w,_,{ref:a,labelRef:i,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ya("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var kRr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:zv.axisLine,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:zv.tickLine,tickSize:zv.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,width:Yo.width,yAxisId:0},_Rr=e=>{var t=cd(e,kRr);return b.createElement(b.Fragment,null,b.createElement(SRr,{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(ORr,t))},cct=b.memo(_Rr,oct);cct.displayName="YAxis";var ERr=(e,t)=>t,jpe=Xe([ERr,Fi,Ait,jl,mlt,_y,KCr,tc],ajr);function CRr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Tpe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(CRr(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 uct=ff("mouseClick"),dct=pP();dct.startListening({actionCreator:uct,effect:(e,t)=>{var r=e.payload,n=jpe(t.getState(),Tpe(r));n?.activeIndex!=null&&t.dispatch(qEr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Uae=ff("mouseMove"),fct=pP(),xO=null,D0=null,HH=null;fct.startListening({actionCreator:Uae,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");xO!==null&&(cancelAnimationFrame(xO),xO=null),D0!==null&&(typeof s!="number"||!i)&&(clearTimeout(D0),D0=null),HH=Tpe(r);var l=()=>{var c=t.getState(),u=fpe(c,c.tooltip.settings.shared);if(!HH){xO=null,D0=null;return}if(u==="axis"){var d=jpe(c,HH);d?.activeIndex!=null?t.dispatch(ilt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(alt())}xO=null,D0=null};if(!i){l();return}s==="raf"?xO=requestAnimationFrame(l):typeof s=="number"&&D0===null&&(D0=setTimeout(l,s))}});function jRr(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 rIe={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},hct=Ac({name:"rootProps",initialState:rIe,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:rIe.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}}}),TRr=hct.reducer,{updateOptions:NRr}=hct.actions,ARr=null,IRr={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)},pct=Ac({name:"polarOptions",initialState:ARr,reducers:IRr}),{updatePolarOptions:LRn}=pct.actions,RRr=pct.reducer,mct=ff("keyDown"),gct=ff("focus"),vct=ff("blur"),y9=pP(),wO=null,L0=null,QD=null;y9.startListening({actionCreator:mct,effect:(e,t)=>{QD=e.payload,wO!==null&&(cancelAnimationFrame(wO),wO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");L0!==null&&(typeof n!="number"||!a)&&(clearTimeout(L0),L0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=QD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=hpe(u,lC(l),EP(l),jP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=_y(l);if(d==="Enter"){var m=p4(l,"axis","hover",String(u.index));t.dispatch(h4({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=PEr(l),v=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=h+x*v;if(p==null||w>=p.length||w<0)return;var S=p4(l,"axis","hover",String(w));t.dispatch(h4({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{wO=null,L0=null}};if(!a){i();return}n==="raf"?wO=requestAnimationFrame(i):typeof n=="number"&&L0===null&&(i(),QD=null,L0=setTimeout(()=>{QD?i():(L0=null,wO=null)},n))}});y9.startListening({actionCreator:gct,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=p4(r,"axis","hover",String(a));t.dispatch(h4({active:!0,activeIndex:a,activeCoordinate:i}))}}}});y9.startListening({actionCreator:vct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(h4({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function yct(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=ff("externalEvent"),bct=pP(),WD=new Map,rT=new Map,QH=new Map;bct.startListening({actionCreator:Xf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=yct(n);QH.set(s,{handler:r,reactEvent:a});var i=WD.get(s);i!==void 0&&(cancelAnimationFrame(i),WD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=rT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),rT.delete(s));var p=()=>{var v=QH.get(s);try{if(!v)return;var{handler:x,reactEvent:w}=v,S=t.getState(),k={activeCoordinate:DCr(S),activeDataKey:RCr(S),activeIndex:aI(S),activeLabel:ylt(S),activeTooltipIndex:aI(S),isTooltipActive:LCr(S)};x&&x(k,w)}finally{WD.delete(s),rT.delete(s),QH.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);WD.set(s,m)}else if(typeof c=="number"){if(!rT.has(s)){p();var g=setTimeout(p,c);rT.set(s,g)}}else p()}}});var PRr=Xe([iC],e=>e.tooltipItemPayloads),MRr=Xe([PRr,(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)}}}),xct=ff("touchMove"),wct=pP(),$0=null,cb=null,nIe=null,nT=null;wct.startListening({actionCreator:xct,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){nT=yct(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");$0!==null&&(cancelAnimationFrame($0),$0=null),cb!==null&&(typeof s!="number"||!i)&&(clearTimeout(cb),cb=null),nIe=Array.from(r.touches).map(c=>Tpe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(nT!=null){var c=t.getState(),u=fpe(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=nIe)===null||d===void 0?void 0:d[0];if(f==null){$0=null,cb=null;return}var h=jpe(c,f);h?.activeIndex!=null&&t.dispatch(ilt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=nT.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var v=g.getAttribute(uwr),x=(p=g.getAttribute(dwr))!==null&&p!==void 0?p:void 0,w=oC(c).find(_=>_.id===x);if(v==null||w==null||x==null)return;var{dataKey:S}=w,k=MRr(c,v,x);t.dispatch(VEr({activeDataKey:S,activeIndex:v,activeCoordinate:k,activeGraphicalItemId:x}))}$0=null,cb=null}};if(!i){l();return}s==="raf"?$0=requestAnimationFrame(l):typeof s=="number"&&cb===null&&(l(),nT=null,cb=setTimeout(()=>{nT?l():(cb=null,$0=null)},s))}}});var Sct={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Oct=Ac({name:"eventSettings",initialState:Sct,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:DRr}=Oct.actions,LRr=Oct.reducer,$Rr=Jrt({brush:wAr,cartesianAxis:dAr,chartData:Ljr,errorBars:xIr,eventSettings:LRr,graphicalItems:UNr,layout:Z0r,legend:nSr,options:Ijr,polarAxis:lNr,polarOptions:RRr,referenceElements:_Ar,renderedTicks:UAr,rootProps:TRr,tooltip:HEr,zIndex:bjr}),FRr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return x0r({reducer:$Rr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([dct.middleware,fct.middleware,y9.middleware,bct.middleware,wct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(Sat({type:"raf"}))},devTools:{serialize:{replacer:jRr},name:"recharts-".concat(r)}})};function zRr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=ud(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=FRr(t,n));var i=che;return b.createElement(lnt,{context:i,store:a.current},r)}function BRr(e){var{layout:t,margin:r}=e,n=Uo(),s=ud();return b.useEffect(()=>{s||(n(Q0r(t)),n(H0r(r)))},[n,s,t,r]),null}var URr=b.memo(BRr,t9);function VRr(e){var t=Uo();return b.useEffect(()=>{t(NRr(e))},[t,e]),null}var qRr=e=>{var t=Uo();return b.useEffect(()=>{t(DRr(e))},[t,e]),null},HRr=b.memo(qRr,t9);function sIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Uo();return b.useLayoutEffect(()=>(n.current&&s(vjr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(yjr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function aIe(e){var{children:t,isPanorama:r}=e,n=en(ojr);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(sIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(sIe,{key:i,zIndex:i,isPanorama:r})))}var QRr=["children"];function WRr(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}function x4(){return x4=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},x4.apply(null,arguments)}var ZRr={width:"100%",height:"100%",display:"block"},YRr=b.forwardRef((e,t)=>{var r=Hat(),n=Qat(),s=nit();if(!og(r)||!og(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(jst,x4({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:ZRr,ref:t}),a)}),XRr=e=>{var{children:t}=e,r=en(Yz);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(jst,{width:n,height:s,x:i,y:a},t)},iIe=b.forwardRef((e,t)=>{var{children:r}=e,n=WRr(e,QRr),s=ud();return s?b.createElement(XRr,null,b.createElement(aIe,{isPanorama:!0},r)):b.createElement(YRr,x4({ref:t},n),b.createElement(aIe,{isPanorama:!1},r))});function KRr(){var e=Uo(),[t,r]=b.useState(null),n=en(cwr);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(G0r(a))}},[t,e,n]),r}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 JRr(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){ePr(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 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 Yb(){return Yb=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},Yb.apply(null,arguments)}var nPr=()=>(Qjr(),null);function w4(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var sPr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:w4((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:w4((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:v,height:x}=g.contentRect;l(v,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(gP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Yb({ref:c},e)))}),aPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:w4(r),containerHeight:w4(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(gP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Yb({ref:l},e)))}),iPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(gP,{width:r,height:n}),b.createElement("div",Yb({ref:t},e)))}),oPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(aPr,Yb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(iPr,Yb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(gP,{width:r,height:n}),b.createElement("div",Yb({ref:t},e)))});function lPr(e){return e?sPr:oPr}var cPr=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:v,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,k=b.useRef(null),_=Uo(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=KRr(),P=mhe(),R=P?.width>0?P.width:x,z=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]),U=b.useCallback(ie=>{_(uct(ie)),_(Xf({handler:a,reactEvent:ie}))},[_,a]),F=b.useCallback(ie=>{_(Uae(ie)),_(Xf({handler:u,reactEvent:ie}))},[_,u]),B=b.useCallback(ie=>{_(alt()),_(Xf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(Uae(ie)),_(Xf({handler:f,reactEvent:ie}))},[_,f]),W=b.useCallback(()=>{_(gct())},[_]),L=b.useCallback(()=>{_(vct())},[_]),Y=b.useCallback(ie=>{_(mct(ie.key))},[_]),q=b.useCallback(ie=>{_(Xf({handler:i,reactEvent:ie}))},[_,i]),M=b.useCallback(ie=>{_(Xf({handler:l,reactEvent:ie}))},[_,l]),Q=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]),ne=b.useCallback(ie=>{S&&_(xct(ie)),_(Xf({handler:m,reactEvent:ie}))},[_,S,m]),ee=b.useCallback(ie=>{_(Xf({handler:p,reactEvent:ie}))},[_,p]),re=lPr(w);return b.createElement(_lt.Provider,{value:E},b.createElement(ybr.Provider,{value:j},b.createElement(re,{width:R??v?.width,height:z??v?.height,className:ya("recharts-wrapper",n),style:JRr({position:"relative",cursor:"default",width:R,height:z},v),onClick:U,onContextMenu:q,onDoubleClick:M,onFocus:W,onBlur:L,onKeyDown:Y,onMouseDown:Q,onMouseEnter:F,onMouseLeave:B,onMouseMove:H,onMouseUp:G,onTouchEnd:ee,onTouchMove:ne,onTouchStart:J,ref:D},b.createElement(nPr,null),r)))}),uPr=["width","height","responsive","children","className","style","compact","title","desc"];function dPr(e,t){if(e==null)return{};var r,n,s=fPr(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 fPr(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 hPr=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=dPr(e,uPr),h=ag(f);return c?b.createElement(b.Fragment,null,b.createElement(gP,{width:r,height:n}),b.createElement(iIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(cPr,{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(iIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(CAr,null,a)))});function Vae(){return Vae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vae.apply(null,arguments)}function 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 pPr(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){mPr(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 mPr(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=vPr(e,"string");return typeof t=="symbol"?t:t+""}function vPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yPr={top:5,right:5,bottom:5,left:5},bPr=pPr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:yPr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Sct),xPr=b.forwardRef(function(t,r){var n,s=cd(t.categoricalChartProps,bPr),{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(zRr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(xAr,{chartData:u.data}),b.createElement(URr,{layout:s.layout,margin:s.margin}),b.createElement(HRr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(VRr,{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(hPr,Vae({},s,{ref:r})))}),wPr=["axis"],SPr=b.forwardRef((e,t)=>b.createElement(xPr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:wPr,tooltipPayloadSearcher:Njr,categoricalChartProps:e,ref:t}));function OPr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function kPr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function _Pr(e){return e/100*window.innerHeight}function EPr(e){return e/100*window.innerWidth}function CPr(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 qT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=CPr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=kPr(t,s);break}case"em":{n=OPr(t,s);break}case"vh":{n=_Pr(s);break}case"vw":{n=EPr(s);break}}return n}function Hu(e){return parseFloat(e.toFixed(3))}function Z_({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 qae(e){const{panels:t}=e,r=Z_({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=qT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=Hu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=Hu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.minSize});c=Hu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=Hu(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 Ea(e,t="Assertion error"){if(!e)throw Error(t)}function Hae(e,t){return Array.from(t).sort(e==="horizontal"?jPr:TPr)}function jPr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function TPr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function kct(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function _ct(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 NPr({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}=_ct(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return Ea(s,"No rect found"),s}let GD;function APr(){return GD===void 0&&(typeof matchMedia=="function"?GD=!!matchMedia("(pointer:coarse)").matches:GD=!1),GD}function Ect(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=Hae(r,Array.from(t.children).filter(kct).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 v=n.find(x=>x.element===g);if(v){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=NPr({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=APr()?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:Z_({group:e}),panels:[h,v],separator:"width"in k?void 0:k,rect:_}),l=!1}}c=!1,h=v,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const v=s.find(x=>x.element===g);v?p.push(v):(h=void 0,p=[])}else c=!0}return i}let Cct=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)}}},Bm=new Map;const jct=new Cct;function IPr(e){Bm=new Map(Bm),Bm.delete(e)}function cIe(e,t){for(const[r]of Bm)if(r.id===e)return r}function Xb(e,t){for(const[r,n]of Bm)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function v1(){return Bm}function Npe(e,t){return jct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function ny(e,t){const r=Bm.get(e);Bm=new Map(Bm),Bm.set(e,t),jct.emit("groupChange",{group:e,prev:r,next:t})}function RPr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=_ct(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 PPr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function MPr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:fIe(e),b:fIe(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();Ea(n,"Stacking order can only be calculated for elements with a common ancestor");const s={a:dIe(uIe(r.a)),b:dIe(uIe(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 DPr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function LPr(e){const t=getComputedStyle(Tct(e)??e).display;return t==="flex"||t==="inline-flex"}function $Pr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||LPr(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"||DPr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function uIe(e){let t=e.length;for(;t--;){const r=e[t];if(Ea(r,"Missing node"),$Pr(r))return r}return null}function dIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function fIe(e){const t=[];for(;e;)t.push(e),e=Tct(e);return t}function Tct(e){const{parentNode:t}=e;return PPr(t)?t.host:t}function FPr(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 zPr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!kct(r)||r.contains(e)||e.contains(r))return!0;if(MPr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(FPr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function Ape(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=Ect(s),i=RPr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&zPr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function BPr(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 Zc(e,t,r=0){return Math.abs(Hu(e)-Hu(t))<=r}function bm(e,t){return Zc(e,t)?0:e>t?1:-1}function pk({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return r;if(bm(n,c)<0)if(a){const u=(s+c)/2;bm(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=Hu(n),n}function cI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(Zc(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=n;Ea(d!=null,"Invalid first pivot index"),Ea(f!=null,"Invalid second pivot index");let h=0;switch(a){case"keyboard":{{const g=e<0?f:d,v=r[g];Ea(v,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=v;if(w){const k=l[g];if(Ea(k!=null,`Previous layout not found for panel index ${g}`),Zc(k,x)){const _=S-k;bm(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}{const g=e<0?d:f,v=r[g];Ea(v,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=v;if(w){const k=l[g];if(Ea(k!=null,`Previous layout not found for panel index ${g}`),Zc(k,S)){const _=k-x;bm(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}break}default:{const g=e<0?f:d,v=r[g];Ea(v,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:k}=v;if(w&&bm(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;bm(T,k)<0&&(e=bm(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;bm(T,k)<0&&(e=bm(100+e,E)>0?0:-_)}break}}{const g=e<0?1:-1;let v=e<0?f:d,x=0;for(;;){const S=l[v];Ea(S!=null,`Previous layout not found for panel index ${v}`);const k=pk({overrideDisabledPanels:i,panelConstraints:r[v],prevSize:S,size:100})-S;if(x+=k,v+=g,v<0||v>=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 v=Math.abs(e)-Math.abs(h),x=l[g];Ea(x!=null,`Previous layout not found for panel index ${g}`);const w=x-v,S=pk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!Zc(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(BPr(c,u))return s;{const g=e<0?f:d,v=l[g];Ea(v!=null,`Previous layout not found for panel index ${g}`);const x=v+h,w=pk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:v,size:x});if(u[g]=w,!Zc(w,x)){let S=x-w,k=e<0?f:d;for(;k>=0&&k<r.length;){const _=u[k];Ea(_!=null,`Previous layout not found for panel index ${k}`);const E=_+S,T=pk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(Zc(_,T)||(S-=T-_,u[k]=T),Zc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,v)=>v+g,0);if(!Zc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,v,x)=>(g[m[x]]=v,g),{})}function TS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||bm(e[r],t[r])!==0)return!1;return!0}function NS({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(!Zc(s,100)&&n.length>0)for(let l=0;l<t.length;l++){const c=n[l];Ea(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];Ea(c!=null,`No layout data found for index ${l}`);const u=n[l];Ea(u!=null,`No layout data found for index ${l}`);const d=pk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!Zc(a,0))for(let l=0;l<t.length;l++){const c=n[l];Ea(c!=null,`No layout data found for index ${l}`);const u=c+a,d=pk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,Zc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function Nct({groupId:e,panelId:t}){const r=()=>{const l=v1();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),v=g===f.panels.length-1,x=cI({delta:v?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:v?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=NS({layout:x,panelConstraints:d});TS(p,w)||ny(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&&Zc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=Z_({group:c}),f=qT({groupSize:d,panelElement:u,styleProp:l}),h=Hu(f/d*100);i(h)}}}function hIe(e){if(e.defaultPrevented)return;const t=v1();Ape(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=Nct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function S$(e){const t=v1();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 Act({groupId:e}){const t=()=>{const r=v1();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=NS({layout:r,panelConstraints:s});return n?l:(TS(l,u)||ny(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function F0(e,t){const r=S$(e),n=Xb(r.id,!0),s=r.separators.find(d=>d.element===e);Ea(s,"Matching separator not found");const a=n.separatorToPanels.get(s);Ea(a,"Matching panels not found");const i=a.map(d=>r.panels.indexOf(d)),l=Act({groupId:r.id}).getLayout(),c=cI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=NS({layout:c,panelConstraints:n.derivedPanelConstraints});TS(l,u)||ny(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function pIe(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=S$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&F0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&F0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&F0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&F0(t,-5);break}case"End":{e.preventDefault(),F0(t,100);break}case"Enter":{e.preventDefault();const n=S$(t),s=Xb(n.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=n.separators.find(h=>h.element===t);Ea(c,"Matching separator not found");const u=l.get(c);Ea(u,"Matching panels not found");const d=u[0],f=a.find(h=>h.panelId===d.id);if(Ea(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;F0(t,p-h)}break}case"F6":{e.preventDefault();const n=S$(t).separators.map(i=>i.element),s=Array.from(n).findIndex(i=>i===e.currentTarget);Ea(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(),F0(t,-100);break}}}let Kk={cursorFlags:0,state:"inactive"};const Ipe=new Cct;function AS(){return Kk}function UPr(e){return Ipe.addListener("change",e)}function VPr(e){const t=Kk,r={...Kk};r.cursorFlags=e,Kk=r,Ipe.emit("change",{prev:t,next:r})}function Jk(e){const t=Kk;Kk=e,Ipe.emit("change",{prev:t,next:e})}function mIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=v1(),r=Ape(e,t),n=new Map;let s=!1;r.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&n.set(a.group,i.layout)}),Jk({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const qPr=e=>e,WH=()=>{},Ict=1,Rct=2,Pct=4,Mct=8,gIe=3,vIe=12;let ZD;function yIe(){return ZD===void 0&&(ZD=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ZD=!0)),ZD}function HPr({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&&yIe()){const a=(e&Ict)!==0,i=(e&Rct)!==0,l=(e&Pct)!==0,c=(e&Mct)!==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 yIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const bIe=new WeakMap;function Rpe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=bIe.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=AS();switch(n.state){case"active":case"hover":{const s=HPr({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}}bIe.set(e,{prevStyle:t,styleSheet:r})}function Dct({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 v=n.get(d),x=s.get(d);if(!v||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:_,separatorToPanels:E}=x;if(S&&_&&E){const T=cI({delta:g,initialLayout:v,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(TS(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?Ict:Rct;break}case"vertical":{l|=g<0?Pct:Mct;break}}}else ny(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&gIe:c|=l&gIe,t.movementY===0?c|=i&vIe:c|=l&vIe,VPr(c),Rpe(e)}function xIe(e){const t=v1(),r=AS();r.state==="active"&&Dct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function wIe(e){if(e.defaultPrevented)return;const t=AS(),r=v1();switch(t.state){case"active":{if(e.buttons===0){Jk({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=Xb(n.group.id,!0);ny(n.group,s)});return}Dct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=Ape(e,r);n.length===0?t.state!=="inactive"&&Jk({cursorFlags:0,state:"inactive"}):Jk({cursorFlags:0,hitRegions:n,state:"hover"}),Rpe(e.currentTarget);break}}}function SIe(e){e.relatedTarget instanceof HTMLIFrameElement&&AS().state==="hover"&&Jk({cursorFlags:0,state:"inactive"})}function OIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=AS();t.state==="active"&&(Jk({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Rpe(e.currentTarget),t.hitRegions.forEach(r=>{const n=Xb(r.group.id,!0);ny(r.group,n)}),e.preventDefault()))}function kIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=Hu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=Hu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function QPr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=Z_({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:Hu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function WPr(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 GPr({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=Hu(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]=Hu(h/a*u)}else{const f=Hu(u/c.length);for(const h of c)d[h]=f}return d}function ZPr(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 SO=new Map;function YPr(e){let t=!0;Ea(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:v,target:x}=g;if(x===e.element){if(t){const w=Z_({group:e});if(w===0)return;const S=Xb(e.id);if(!S)return;const k=qae(e),_=S.defaultLayoutDeferred?kIe(k):S.layout,E=GPr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=NS({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&TS(S.layout,T)&&WPr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;ny(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else QPr(e,x,v)}});a.observe(e.element),e.panels.forEach(m=>{Ea(!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=Z_({group:e}),l=qae(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(ZPr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??kIe(l),f=NS({layout:d,panelConstraints:l}),h=e.element.ownerDocument;SO.set(h,(SO.get(h)??0)+1);const p=new Map;return Ect(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),ny(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:p}),e.separators.forEach(m=>{Ea(!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",pIe)}),SO.get(h)===1&&(h.addEventListener("dblclick",hIe,!0),h.addEventListener("pointerdown",mIe,!0),h.addEventListener("pointerleave",xIe),h.addEventListener("pointermove",wIe),h.addEventListener("pointerout",SIe),h.addEventListener("pointerup",OIe,!0)),function(){t=!1,SO.set(h,Math.max(0,(SO.get(h)??0)-1)),IPr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",pIe)}),SO.get(h)||(h.removeEventListener("dblclick",hIe,!0),h.removeEventListener("pointerdown",mIe,!0),h.removeEventListener("pointerleave",xIe),h.removeEventListener("pointermove",wIe),h.removeEventListener("pointerout",SIe),h.removeEventListener("pointerup",OIe,!0)),a.disconnect()}}function XPr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Ppe(e){const t=b.useId();return`${e??t}`}const y1=typeof window<"u"?b.useLayoutEffect:b.useEffect;function jN(e){const t=b.useRef(e);return y1(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function Mpe(...e){return jN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Dpe(e){const t=b.useRef({...e});return y1(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Lct=b.createContext(null);function KPr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:qPr});b.useImperativeHandle(t,()=>r.current,[]),y1(()=>{Object.assign(r.current,Act({groupId:e}))})}function b9({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=jN(P=>{TS(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),v=jN(P=>{TS(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Ppe(l),w=b.useRef(null),[S,k]=XPr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=Mpe(w,a);KPr(x,i);const T=jN((P,R)=>{const z=AS(),D=cIe(P),U=Xb(P);if(U){let F=!1;return z.state==="active"&&(F=z.hitRegions.some(B=>B.group===D)),{flexGrow:U.layout[R]??1,pointerEvents:F?"none":void 0}}return{flexGrow:r?.[R]??1}}),j=Dpe({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=Hae(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(z=>z!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=Hae(d,[...R.separators,P]),k(),()=>{R.separators=R.separators.filter(z=>z!==P),k()}},togglePanelDisabled:(P,R)=>{const z=_.current.panels.find(F=>F.id===P);z&&(z.panelConstraints.disabled=R);const D=cIe(x),U=Xb(x);D&&U&&ny(D,{...U,derivedPanelConstraints:qae(D)})},toggleSeparatorDisabled:(P,R)=>{const z=_.current.separators.find(D=>D.id===P);z&&(z.disabled=R)}}),[T,x,k,d,j]),I=b.useRef(null);return y1(()=>{const P=w.current;if(P===null)return;const R=_.current;let z;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){z={};for(const L of R.panels){const Y=j.defaultLayout[L.id];Y!==void 0&&(z[L.id]=Y)}}const D={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:z,disableCursor:!!j.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=D;const U=YPr(D),{defaultLayoutDeferred:F,derivedPanelConstraints:B,layout:H}=Xb(D.id,!0);!F&&B.length>0&&(g(H),v(H));const W=Npe(x,L=>{const{defaultLayoutDeferred:Y,derivedPanelConstraints:q,layout:M}=L.next;if(Y||q.length===0)return;const Q=D.panels.map(({id:J})=>J).join(",");D.mutableState.layouts[Q]=M,q.forEach(J=>{if(J.collapsible){const{layout:ne}=L.prev??{};if(ne){const ee=Zc(J.collapsedSize,M[J.panelId]),re=Zc(J.collapsedSize,ne[J.panelId]);ee&&!re&&(D.mutableState.expandedPanelSizes[J.panelId]=ne[J.panelId])}}});const G=AS().state!=="active";g(M),G&&v(M)});return()=>{I.current=null,U(),W()}},[s,x,v,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=r,P.mutableState.disableCursor=!!n)}),o.jsx(Lct.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})})}b9.displayName="Group";function GH(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function Lpe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=GH(a,t??[]),l=b.useSyncExternalStore(JPr,()=>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=GH(a,Object.keys(p)):m=GH(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 JPr(){return function(){}}function $pe(){const e=b.useContext(Lct);return Ea(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function eMr(e,t){const{id:r}=$pe(),n=b.useRef({collapse:WH,expand:WH,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:WH});b.useImperativeHandle(t,()=>n.current,[]),y1(()=>{Object.assign(n.current,Nct({groupId:r,panelId:e}))})}function Y_({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,v=Ppe(c),x=Dpe({disabled:a}),w=b.useRef(null),S=Mpe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=$pe(),N=f!==null,I=jN((R,z,D)=>{f?.(R,c,D)});y1(()=>{const R=w.current;if(R!==null){const z={element:R,id:v,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(z)}},[l,r,n,s,N,v,g,u,d,I,T,x]),b.useEffect(()=>{j(v,!!a)},[a,v,j]),eMr(v,h);const P=b.useSyncExternalStore(R=>Npe(_,R),()=>JSON.stringify(k(_,v)),()=>JSON.stringify(k(_,v)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":v,id:v,ref:S,style:{...tMr,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})})}Y_.displayName="Panel";const tMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function rMr(){return b.useRef(null)}function nMr({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=NS({layout:cI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=NS({layout:cI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function $ct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Ppe(s),c=Dpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=Mpe(p,n),{disableCursor:g,id:v,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=$pe(),k=x==="horizontal"?"vertical":"horizontal";y1(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=UPr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Npe(v,P=>{const{derivedPanelConstraints:R,layout:z,separatorToPanels:D}=P.next,U=D.get(T);if(U){const F=U[0],B=U.indexOf(F);d(nMr({layout:z,panelConstraints:R,panelId:F.id,panelIndex:B}))}});return()=>{N(),I(),j()}}},[v,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})}$ct.displayName="Separator";const Wl={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},NP="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",sMr="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",aMr="rounded-md",Fpe="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",zpe="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",Bpe="disabled:opacity-50 disabled:cursor-not-allowed";function Fct(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=Fct(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function zct(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Fct(e))&&(n&&(n+=" "),n+=t);return n}const iMr=(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},oMr=(e,t)=>({classGroupId:e,validator:t}),Bct=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),S4="-",_Ie=[],lMr="arbitrary..",cMr=e=>{const t=dMr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return uMr(i);const l=i.split(S4),c=l[0]===""&&l.length>1?1:0;return Uct(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?iMr(u,c):c:u||_Ie}return r[i]||_Ie}}},Uct=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Uct(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(S4):e.slice(t).join(S4),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},uMr=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?lMr+n:void 0})(),dMr=e=>{const{theme:t,classGroups:r}=e;return fMr(r,t)},fMr=(e,t)=>{const r=Bct();for(const n in e){const s=e[n];Upe(s,r,n,t)}return r},Upe=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];hMr(i,t,r,n)}},hMr=(e,t,r,n)=>{if(typeof e=="string"){pMr(e,t,r);return}if(typeof e=="function"){mMr(e,t,r,n);return}gMr(e,t,r,n)},pMr=(e,t,r)=>{const n=e===""?t:Vct(t,e);n.classGroupId=r},mMr=(e,t,r,n)=>{if(vMr(e)){Upe(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(oMr(r,e))},gMr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];Upe(c,Vct(t,l),r,n)}},Vct=(e,t)=>{let r=e;const n=t.split(S4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=Bct(),r.nextPart.set(i,l)),r=l}return r},vMr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,yMr=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)}}},Qae="!",EIe=":",bMr=[],CIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),xMr=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 v=s[g];if(i===0&&l===0){if(v===EIe){a.push(s.slice(c,g)),c=g+1;continue}if(v==="/"){u=g;continue}}v==="["?i++:v==="]"?i--:v==="("?l++:v===")"&&l--}const f=a.length===0?s:s.slice(c);let h=f,p=!1;f.endsWith(Qae)?(h=f.slice(0,-1),p=!0):f.startsWith(Qae)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return CIe(a,p,h,m)};if(t){const s=t+EIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):CIe(bMr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},wMr=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}},SMr=e=>({cache:yMr(e.cacheSize),parseClassName:xMr(e),sortModifiers:wMr(e),...cMr(e)}),OMr=/\s+/,kMr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(OMr);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 v=!!g,x=n(v?m.substring(0,g):m);if(!x){if(!v){c=d+(c.length>0?" "+c:c);continue}if(x=n(m),!x){c=d+(c.length>0?" "+c:c);continue}v=!1}const w=h.length===0?"":h.length===1?h[0]:a(h).join(":"),S=p?w+Qae:w,k=S+x;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(x,v);for(let E=0;E<_.length;++E){const T=_[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},_Mr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=qct(r))&&(s&&(s+=" "),s+=n);return s},qct=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=qct(e[n]))&&(r&&(r+=" "),r+=t);return r},jIe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=SMr(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=kMr(c,r);return s(c,d),d};return a=i,(...c)=>a(_Mr(...c))},EMr=[],Wo=e=>{const t=r=>r[e]||EMr;return t.isThemeGetter=!0,t},Hct=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qct=/^\((?:(\w[\w-]*):)?(.+)\)$/i,CMr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jMr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TMr=/\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$/,NMr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AMr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,IMr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ub=e=>CMr.test(e),Un=e=>!!e&&!Number.isNaN(Number(e)),db=e=>!!e&&Number.isInteger(Number(e)),ZH=e=>e.endsWith("%")&&Un(e.slice(0,-1)),sv=e=>jMr.test(e),Wct=()=>!0,RMr=e=>TMr.test(e)&&!NMr.test(e),Vpe=()=>!1,PMr=e=>AMr.test(e),MMr=e=>IMr.test(e),DMr=e=>!yr(e)&&!kr(e),LMr=e=>n0(e,Yct,Vpe),yr=e=>Hct.test(e),z0=e=>n0(e,Xct,RMr),TIe=e=>n0(e,HMr,Un),$Mr=e=>n0(e,Jct,Wct),FMr=e=>n0(e,Kct,Vpe),NIe=e=>n0(e,Gct,Vpe),zMr=e=>n0(e,Zct,MMr),YD=e=>n0(e,eut,PMr),kr=e=>Qct.test(e),sT=e=>b1(e,Xct),BMr=e=>b1(e,Kct),AIe=e=>b1(e,Gct),UMr=e=>b1(e,Yct),VMr=e=>b1(e,Zct),XD=e=>b1(e,eut,!0),qMr=e=>b1(e,Jct,!0),n0=(e,t,r)=>{const n=Hct.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},b1=(e,t,r=!1)=>{const n=Qct.exec(e);return n?n[1]?t(n[1]):r:!1},Gct=e=>e==="position"||e==="percentage",Zct=e=>e==="image"||e==="url",Yct=e=>e==="length"||e==="size"||e==="bg-size",Xct=e=>e==="length",HMr=e=>e==="number",Kct=e=>e==="family-name",Jct=e=>e==="number"||e==="weight",eut=e=>e==="shadow",IIe=()=>{const e=Wo("color"),t=Wo("font"),r=Wo("text"),n=Wo("font-weight"),s=Wo("tracking"),a=Wo("leading"),i=Wo("breakpoint"),l=Wo("container"),c=Wo("spacing"),u=Wo("radius"),d=Wo("shadow"),f=Wo("inset-shadow"),h=Wo("text-shadow"),p=Wo("drop-shadow"),m=Wo("blur"),g=Wo("perspective"),v=Wo("aspect"),x=Wo("ease"),w=Wo("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,yr],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[kr,yr,c],N=()=>[ub,"full","auto",...j()],I=()=>[db,"none","subgrid",kr,yr],P=()=>["auto",{span:["full",db,kr,yr]},db,kr,yr],R=()=>[db,"auto",kr,yr],z=()=>["auto","min","max","fr",kr,yr],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...j()],B=()=>[ub,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[ub,"screen","full","dvw","lvw","svw","min","max","fit",...j()],W=()=>[ub,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,yr],Y=()=>[...k(),AIe,NIe,{position:[kr,yr]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",UMr,LMr,{size:[kr,yr]}],Q=()=>[ZH,sT,z0],G=()=>["","none","full",u,kr,yr],J=()=>["",Un,sT,z0],ne=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Un,ZH,AIe,NIe],ie=()=>["","none",m,kr,yr],ce=()=>["none",Un,kr,yr],K=()=>["none",Un,kr,yr],ae=()=>[Un,kr,yr],le=()=>[ub,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sv],breakpoint:[sv],color:[Wct],container:[sv],"drop-shadow":[sv],ease:["in","out","in-out"],font:[DMr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sv],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sv],shadow:[sv],spacing:["px",Un],text:[sv],"text-shadow":[sv],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ub,yr,kr,v]}],container:["container"],columns:[{columns:[Un,yr,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:[db,"auto",kr,yr]}],basis:[{basis:[ub,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Un,ub,"auto","initial","none",yr]}],grow:[{grow:["",Un,kr,yr]}],shrink:[{shrink:["",Un,kr,yr]}],order:[{order:[db,"first","last","none",kr,yr]}],"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":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],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:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[l,"screen",...B()]}],"min-w":[{"min-w":[l,"screen","none",...B()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",r,sT,z0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,qMr,$Mr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ZH,yr]}],"font-family":[{font:[BMr,FMr,t]}],"font-features":[{"font-features":[yr]}],"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,yr]}],"line-clamp":[{"line-clamp":[Un,"none",kr,TIe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",kr,yr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kr,yr]}],"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:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Un,"from-font","auto",kr,z0]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Un,"auto",kr,yr]}],"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,yr]}],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,yr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},db,kr,yr],radial:["",kr,yr],conic:[db,kr,yr]},VMr,zMr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"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:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"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:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Un,kr,yr]}],"outline-w":[{outline:["",Un,sT,z0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,XD,YD]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,XD,YD]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Un,z0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,XD,YD]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Un,kr,yr]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":[Un]}],"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,yr]}],"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":[Un]}],"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:Y()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kr,yr]}],filter:[{filter:["","none",kr,yr]}],blur:[{blur:ie()}],brightness:[{brightness:[Un,kr,yr]}],contrast:[{contrast:[Un,kr,yr]}],"drop-shadow":[{"drop-shadow":["","none",p,XD,YD]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Un,kr,yr]}],"hue-rotate":[{"hue-rotate":[Un,kr,yr]}],invert:[{invert:["",Un,kr,yr]}],saturate:[{saturate:[Un,kr,yr]}],sepia:[{sepia:["",Un,kr,yr]}],"backdrop-filter":[{"backdrop-filter":["","none",kr,yr]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Un,kr,yr]}],"backdrop-contrast":[{"backdrop-contrast":[Un,kr,yr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Un,kr,yr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Un,kr,yr]}],"backdrop-invert":[{"backdrop-invert":["",Un,kr,yr]}],"backdrop-opacity":[{"backdrop-opacity":[Un,kr,yr]}],"backdrop-saturate":[{"backdrop-saturate":[Un,kr,yr]}],"backdrop-sepia":[{"backdrop-sepia":["",Un,kr,yr]}],"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,yr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Un,"initial",kr,yr]}],ease:[{ease:["linear","initial",x,kr,yr]}],delay:[{delay:[Un,kr,yr]}],animate:[{animate:["none",w,kr,yr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,kr,yr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[kr,yr,"","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,yr]}],"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,yr]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Un,sT,z0,TIe]}],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"]}},QMr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(HT(e,"cacheSize",t),HT(e,"prefix",r),HT(e,"experimentalParseClassName",n),KD(e.theme,a.theme),KD(e.classGroups,a.classGroups),KD(e.conflictingClassGroups,a.conflictingClassGroups),KD(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),HT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),JD(e.theme,s.theme),JD(e.classGroups,s.classGroups),JD(e.conflictingClassGroups,s.conflictingClassGroups),JD(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),tut(e,s,"orderSensitiveModifiers"),e),HT=(e,t,r)=>{r!==void 0&&(e[t]=r)},KD=(e,t)=>{if(t)for(const r in t)HT(e,r,t[r])},JD=(e,t)=>{if(t)for(const r in t)tut(e,t,r)},tut=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},WMr=(e,...t)=>typeof e=="function"?jIe(IIe,e,...t):jIe(()=>QMr(IIe(),e),...t),GMr=Object.keys({...Mb,...Hzt}),ZMr=Object.keys(Xzt),YMr=Object.keys(Qzt),XMr=Object.keys(Wzt),KMr=Object.keys(qzt),B0=Object.keys(Yzt),JMr=Object.keys(Gzt).concat(Object.keys(Zzt)),e2r=WMr({extend:{theme:{color:GMr,spacing:ZMr,radius:KMr,leading:XMr,shadow:JMr},classGroups:{"font-size":[{text:YMr}],h:[{h:B0}],w:[{w:B0}],size:[{size:B0}],"min-h":[{"min-h":B0}],"min-w":[{"min-w":B0}],"max-h":[{"max-h":B0}],"max-w":[{"max-w":B0}]}}});function Z(...e){return e2r(zct(e))}const t2r={sm:`${Wl.sm} text-ui-sm px-[.75em]`,md:`${Wl.md} text-ui-md px-[.75em]`,default:`${Wl.default} text-ui-md px-[.85em] `,lg:`${Wl.lg} text-ui-lg px-[1em] `},r2r={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:Fpe,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"},n2r=Z("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",Bpe,zpe),s2r={light:"default",outline:"default"};function a2r(e){return s2r[e]??e}function cC(e){const t=a2r(e?.variant||"default"),r=e?.size||"default";return Z(n2r,t2r[r],r2r[t],e?.iconOnly&&"[&>svg]:opacity-75")}function rut(e){const t=[];return Te.Children.forEach(e,r=>{Te.isValidElement(r)&&r.type===Te.Fragment?t.push(...rut(r.props.children)):t.push(r)}),t}function i2r(e){const t=rut(e);return t.length>0&&t.every(r=>Te.isValidElement(r))}const ge=Te.forwardRef(({className:e,as:t,size:r="default",variant:n="default",disabled:s,children:a,...i},l)=>{const c=t||"button",u=i2r(a);return o.jsx(c,{ref:l,disabled:s,className:Z(cC({variant:n,size:r,iconOnly:u}),e),...i,children:a})});ge.displayName="Button";const dd=A3t,Yr=I3t,Xr=R3t,Wr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(P3t,{children:o.jsxs(kqe,{ref:s,sideOffset:t,className:Z("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(M3t,{className:"fill-surface3"})]})}));Wr.displayName=kqe.displayName;const Cn=Te.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ge,{ref:r,...t})}),e&&o.jsx(Wr,{children:e})]}));Cn.displayName="ButtonWithTooltip";const o2r={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"},je=({children:e,className:t,size:r="default",...n})=>o.jsx("span",{className:Z("block",o2r[r],t),...n,children:e}),sn={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"},s0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},nut=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),O4=({children:e,as:t="a",href:r,className:n,prefetch:s,to:a})=>o.jsx(t,{href:r,prefetch:s,to:a,className:Z("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",sn.colors,n),children:e}),sut=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),k4=({children:e,isActive:t,className:r})=>o.jsx("li",{className:Z("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",sn.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),aut=({onClick:e})=>o.jsx(ge,{variant:"ghost",className:Z("shrink-0 opacity-0",sn.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(je,{children:o.jsx(Kl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),l2r={"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"},c2r={mono:"font-mono"},ve=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Z(l2r[r],n&&c2r[n],t),...s}),pa=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"})]}),u2r=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"})]}),qpe=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"})]}),Hpe=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"})]}),a0=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"})}),iut=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)"})})})]}),out=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)"})})})]}),d2r=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"})]}),x9=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"})}),Qpe=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"})}),f2r=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"})}),Pi=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"})}),uC=e=>o.jsx(Uzt,{...e}),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:"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"})}),vl=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"})]}),w9=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 pp(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 lut=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)"})})})]}),h2r=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"})}),p2r=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"})})}),cut=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}})}),m2r=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"})]})]}),g2r=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"})})]}),v2r=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"})}),y2r=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"})]}),b2r=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"})})})]}),RIe=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"})}),x2r=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"})]})}),w2r={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},S2r={warning:$E,destructive:wF,info:DR},Ul=({children:e,variant:t="destructive",className:r})=>{const n=S2r[t];return o.jsx("div",{className:Z(w2r[t],"p-3 rounded-md border shadow-sm",sn.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(je,{className:"mt-0.5 shrink-0",children:o.jsx(n,{})}),o.jsx("div",{className:"text-neutral4",children:e})]})})},Vl=({children:e,as:t="h5"})=>o.jsx(ve,{as:t,variant:"ui-md",className:"font-semibold",children:e}),zu=({children:e,as:t="p"})=>o.jsx(ve,{as:t,variant:"ui-sm",children:e}),O2r={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},uut=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Z(O2r[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",sn.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(ve,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),k2r={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"},_2r={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},gt=({icon:e,variant:t="default",className:r,children:n,...s})=>o.jsxs("div",{className:Z("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",sn.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":k2r[t],r),...s,children:[e&&o.jsx("span",{className:_2r[t],children:o.jsx(je,{children:e})}),n]}),Za=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),Cr=({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:Z("text-ui-md leading-ui-md flex items-center gap-2",sn.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(je,{className:Z("text-neutral2",sn.colors),children:o.jsx(f2r,{})})})]})};function E2r(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 C2r(e){const t=E2r(e);return VWe({override:[j2r(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function j2r(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 T2r=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,N2r=er.mark({class:"cm-variable-highlight"}),PIe=new nWe({regexp:T2r,decoration:()=>N2r}),A2r=Si.fromClass(class{decorations;constructor(e){this.decorations=PIe.createDeco(e)}update(e){this.decorations=PIe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),I2r=A2r,R2r={duration:5e3,cancel:{label:o.jsx(je,{children:o.jsx(Kl,{})}),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 sf(e){const{classNames:t,...r}=R2r,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:Z(t?.title,n?.title),toast:Z(t?.toast,n?.toast),cancelButton:Z(t?.cancelButton,n?.cancelButton),actionButton:Z(t?.actionButton,n?.actionButton),description:Z(t?.description,n?.description)},...s}}const ze=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>xc(r,sf(t)));if(Te.isValidElement(e))return xc(e,sf(t));if(typeof e=="string")return xc(e,sf(t));throw new Error("Invalid message type")};ze.success=(e,t={})=>{const r={...t,icon:o.jsx(je,{className:"text-accent1 shrink-0",children:o.jsx($Ft,{})}),classNames:{...t.classNames,toast:Z("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Z("text-xs text-neutral5",t.classNames?.title),description:Z("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return xc.success(e,sf(r));case"object":return e.forEach(n=>xc.success(n,sf(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(je,{className:"text-accent2 shrink-0",children:o.jsx(kHe,{})}),classNames:{...t.classNames,toast:Z("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Z("text-xs text-neutral5",t.classNames?.title),description:Z("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return xc.error(e,sf(r));case"object":return e.forEach(n=>xc.error(n,sf(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(je,{className:"text-accent6 shrink-0",children:o.jsx(wF,{})}),classNames:{...t.classNames,toast:Z("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Z("text-xs text-neutral5",t.classNames?.title),description:Z("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return xc.warning(e,sf(r));case"object":return e.forEach(n=>xc.warning(n,sf(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(je,{className:"text-accent3 shrink-0",children:o.jsx(DR,{})}),classNames:{...t.classNames,toast:Z("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Z("text-xs text-neutral5",t.classNames?.title),description:Z("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return xc.info(e,sf(r));case"object":return e.forEach(n=>xc.info(n,sf(r)))}};ze.custom=(e,t={})=>xc(e,sf(t));ze.dismiss=e=>{e&&xc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>xc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...sf(i)});function pf({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 Xa({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=pf({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(ge,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(py,{}):o.jsx(EHe,{})})}),o.jsx(Wr,{children:a?"Copied!":r})]})}const Qn=Gue()(kZt(e=>({requestContext:{},theme:"dark",setRequestContext:t=>e({requestContext:t}),setTheme:t=>e({theme:t})}),{name:"mastra-playground-store"})),Wae=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;function P2r(e){return Wae?.addEventListener("change",e),()=>Wae?.removeEventListener("change",e)}function M2r(){return Wae?.matches??!0}function AP(){const e=Qn(r=>r.theme),t=b.useSyncExternalStore(P2r,M2r,()=>!0);return e==="system"?t:e==="dark"}function D2r(){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:[se.className,se.propertyName],color:"var(--neutral6)"},{tag:se.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[se.heading1,se.heading2,se.heading3,se.heading4,se.heading5,se.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:se.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:se.link,color:"var(--accent3)",textDecoration:"underline"},{tag:se.url,color:"var(--accent3)"},{tag:se.monospace,color:"var(--neutral6)"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:se.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 L2r(){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=Vp.define([{tag:[se.comment,se.bracket],color:"var(--neutral2)"},{tag:[se.string,se.meta,se.regexp],color:"var(--accent1)"},{tag:[se.atom,se.bool,se.special(se.variableName)],color:"var(--accent6)"},{tag:[se.keyword,se.operator,se.tagName],color:"var(--accent2)"},{tag:[se.function(se.propertyName),se.propertyName],color:"var(--accent5)"},{tag:[se.definition(se.variableName),se.function(se.variableName),se.className,se.attributeName],color:"var(--accent3)"},{tag:[se.variableName,se.number],color:"var(--accent5)"},{tag:[se.name,se.quote],color:"var(--accent1)"},{tag:se.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[se.heading1,se.heading2,se.heading3,se.heading4,se.heading5,se.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[se.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[se.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:se.link,color:"var(--accent3)",textDecoration:"underline"},{tag:se.url,color:"var(--accent3)"},{tag:se.monospace,color:"var(--neutral6)"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:[se.deleted],color:"var(--accent2)"},{tag:se.invalid,color:"var(--error)"},{tag:[se.standard(se.tagName)],color:"var(--accent1)"}]);return[e,Qx(t)]}const Cy=()=>{const e=AP();return b.useMemo(()=>e?D2r():L2r(),[e])},hs=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=Cy(),g=e?JSON.stringify(e,null,2):t??"",v=b.useMemo(()=>{const x=[];return a==="json"?x.push(Jd):a==="markdown"&&(x.push($ue({base:uS,codeLanguages:dZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(I2r),c&&a==="markdown"&&x.push(C2r(c)),f===!1&&x.push(Fn.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Z("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...h,children:[n&&o.jsx(Xa,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(Oc,{ref:p,value:g,theme:m,extensions:v,onChange:r,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function $2r(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ke(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-D6NfrWho.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 Ka({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return o.jsxs("div",{className:Z("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:Z("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}),dut=({children:e,className:t,style:r})=>o.jsx(je,{size:"lg",className:Z("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),Ef=({children:e,className:t})=>o.jsx(ve,{as:"p",variant:"ui-lg",className:Z("text-neutral6 font-medium",t),children:e}),Cf=({children:e,className:t})=>o.jsx(ve,{as:"div",variant:"ui-sm",className:Z("text-neutral3",t),children:e}),jf=({children:e,className:t})=>o.jsx("div",{className:Z("flex-1 w-full",t),children:e});function Us({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(Ka,{className:s,iconSlot:o.jsx(je,{size:"lg",className:"text-neutral3",children:o.jsx(jzt,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function Ys({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(Ka,{className:r,iconSlot:o.jsx(je,{size:"lg",className:"text-neutral3",children:o.jsx(xzt,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(ge,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const En=({children:e,border:t=!0,className:r})=>o.jsx("header",{className:Z("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},r),children:e}),Xu=({children:e})=>o.jsx(ve,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),vu=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),F2r=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),Kb=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"})}),z2r={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},B2r=({className:e,children:t,size:r="default",style:n})=>o.jsx("table",{className:Z("w-full",z2r[r],e),style:n,children:t}),U2r=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Z("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),V2r=({className:e,children:t,...r})=>o.jsx("th",{className:Z("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}),q2r=({className:e,children:t,...r})=>o.jsx("tbody",{className:Z("",e),...r,children:t}),H2r=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:Z("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})}),Q2r=({className:e,children:t,...r})=>o.jsx("td",{className:Z("text-neutral5 first:pl-3 last:pr-3",e),...r,children:o.jsx("div",{className:Z("flex h-full w-full shrink-0 items-center"),children:t})}),MIe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,DIe=zct,dC=(e,t)=>r=>{var n;if(t?.variants==null)return DIe(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=MIe(d)||MIe(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,v]=m;return Array.isArray(v)?v.includes({...a,...l}[g]):{...a,...l}[g]===v})?[...u,f,h]:u},[]);return DIe(e,i,c,r?.class,r?.className)},W2r=dC(Z("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:Z(Fpe,zpe,Bpe),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"}}),wc=b.forwardRef(({className:e,size:t,testId:r,variant:n,error:s,...a},i)=>o.jsx("textarea",{className:Z(W2r({variant:n,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:i,"aria-invalid":s,...a}));wc.displayName="Textarea";const G2r=DYt,Z2r=LYt,fut=$Yt;function Bt({open:e,onOpenChange:t,children:r}){return o.jsx(G2r,{open:e,onOpenChange:t,children:r})}const Wpe=b.forwardRef(({className:e,...t},r)=>o.jsx(HYe,{className:Z("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}));Wpe.displayName=HYe.displayName;const hut=b.forwardRef(({className:e,...t},r)=>o.jsxs(fut,{children:[o.jsx(Wpe,{}),o.jsx(QYe,{ref:r,className:Z("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})]}));hut.displayName=QYe.displayName;const put=({className:e,...t})=>o.jsx("div",{className:Z("flex flex-col space-y-2 text-center sm:text-left",e),...t});put.displayName="AlertDialogHeader";const mut=({className:e,...t})=>o.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mut.displayName="AlertDialogFooter";const gut=b.forwardRef(({className:e,...t},r)=>o.jsx(ZYe,{ref:r,className:Z("text-lg font-semibold",e),...t}));gut.displayName=ZYe.displayName;const vut=b.forwardRef(({className:e,...t},r)=>o.jsx(YYe,{ref:r,className:Z("text-sm text-neutral3",e),...t}));vut.displayName=YYe.displayName;const yut=b.forwardRef(({className:e,...t},r)=>o.jsx(WYe,{ref:r,className:Z(cC({variant:"primary",size:"default"}),e),...t}));yut.displayName=WYe.displayName;const but=b.forwardRef(({className:e,...t},r)=>o.jsx(GYe,{ref:r,className:Z(cC({variant:"default",size:"default"}),"mt-2 sm:mt-0",e),...t}));but.displayName=GYe.displayName;Bt.Trigger=Z2r;Bt.Portal=fut;Bt.Overlay=Wpe;Bt.Content=hut;Bt.Header=put;Bt.Footer=mut;Bt.Title=gut;Bt.Description=vut;Bt.Action=yut;Bt.Cancel=but;const di=b.forwardRef(({className:e,...t},r)=>o.jsx(Jue,{ref:r,className:Z("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",sn.all,"hover:border-neutral5 hover:shadow-md",NP,"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(eXe,{className:Z("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(py,{className:"h-3.5 w-3.5 stroke-3"})})}));di.displayName=Jue.displayName;const Dp=QYt,Nh=Te.forwardRef(({className:e,children:t,...r},n)=>o.jsx(tde,{ref:n,className:Z("-outline-offset-2",sn.colors,s0.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=tde.displayName;const Ah=Te.forwardRef(({className:e,children:t,...r},n)=>o.jsx(nde,{ref:n,className:Z("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=nde.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:Z("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:Z("flex items-center border-b border-border1 px-3 py-2",sn.colors),searchIcon:Z("mr-2 h-4 w-4 shrink-0 text-neutral3",sn.colors),searchInput:Z("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",sn.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:Z("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",sn.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:Z("h-4 w-4 text-accent1",sn.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 Jl({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(v=>v.value===t)??null,g=v=>{v&&r?.(v.value)};return o.jsxs("div",{className:gn.root,children:[o.jsxs(nKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(dKe,{className:Z(cC({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(OJt,{placeholder:n})]}),o.jsx(OHe,{className:gn.chevron})]}),o.jsx(mKe,{container:h,children:o.jsx(yKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(bKe,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(x_,{className:gn.searchIcon}),o.jsx(uKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(kKe,{className:gn.empty,children:a}),o.jsx(hKe,{className:gn.list,children:v=>o.jsxs(OKe,{value:v,className:Z(gn.item,gn.itemSelected),children:[o.jsx("span",{className:gn.checkContainer,children:o.jsx(uer,{children:o.jsx(py,{className:gn.checkIcon})})}),o.jsxs("span",{className:gn.optionContent,children:[v.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:v.label}),v.description&&o.jsx("span",{className:gn.optionDescription,children:v.description})]}),v.end?o.jsx("div",{className:gn.optionEnd,children:v.end}):null]})]},v.value)})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}function xut({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))},v=m.length===0?n:`${m.length} selected`;return o.jsxs("div",{className:gn.root,children:[o.jsxs(nKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(dKe,{className:Z(cC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsx("span",{className:Z("truncate",m.length===0&&gn.placeholder),children:v}),o.jsx(OHe,{className:gn.chevron})]}),o.jsx(mKe,{container:h,children:o.jsx(yKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(bKe,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(x_,{className:gn.searchIcon}),o.jsx(uKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(kKe,{className:gn.empty,children:a}),o.jsx(hKe,{className:gn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(OKe,{value:x,className:gn.item,children:[o.jsx("span",{className:Z(gn.checkbox,w?gn.checkboxSelected:gn.checkboxUnselected),children:w&&o.jsx(py,{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 kn=UF,wut=AYe,Y2r=VF,X2r=GR,Sut=b.forwardRef(({className:e,...t},r)=>o.jsx(QR,{ref:r,className:Z("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}));Sut.displayName=QR.displayName;const xn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Y2r,{children:[o.jsx(Sut,{}),o.jsxs(WR,{ref:n,className:Z("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(GR,{className:Z("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(Kl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xn.displayName=WR.displayName;const _n=({className:e,...t})=>o.jsx("div",{className:Z("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});_n.displayName="DialogHeader";const mf=({className:e,...t})=>o.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mf.displayName="DialogFooter";const qn=({className:e,...t})=>o.jsx("div",{className:Z("overflow-y-auto px-6 max-h-[50vh]",e),...t});qn.displayName="DialogBody";const wn=b.forwardRef(({className:e,...t},r)=>o.jsx(qF,{ref:r,className:Z("text-ui-md font-medium",e),...t}));wn.displayName=qF.displayName;const ea=b.forwardRef(({className:e,...t},r)=>o.jsx(HF,{ref:r,className:Z("sr-only",e),...t}));ea.displayName=HF.displayName;const Out=b.forwardRef(({className:e,...t},r)=>o.jsx(ld,{ref:r,className:Z("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));Out.displayName=ld.displayName;const K2r=({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(kn,{...n,children:o.jsxs(xn,{className:"overflow-hidden p-0",children:[o.jsx(wn,{className:"sr-only",children:t}),o.jsx(ea,{className:"sr-only",children:r}),o.jsx(Out,{filter:s,onKeyDown:a,className:Z("**:[[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})]})})},kut=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Z("flex items-center border-b border-border1 px-3",sn.colors),"cmdk-input-wrapper":"",children:[o.jsx(x_,{className:Z("mr-2 h-4 w-4 shrink-0 text-neutral3",sn.colors)}),o.jsx(ld.Input,{ref:r,className:Z("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",sn.colors,e),...t})]}));kut.displayName=ld.Input.displayName;const _ut=b.forwardRef(({className:e,...t},r)=>o.jsx(ld.List,{ref:r,className:Z("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));_ut.displayName=ld.List.displayName;const Eut=b.forwardRef((e,t)=>o.jsx(ld.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));Eut.displayName=ld.Empty.displayName;const bb=b.forwardRef(({className:e,...t},r)=>o.jsx(ld.Group,{ref:r,className:Z("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}));bb.displayName=ld.Group.displayName;const aw=b.forwardRef(({className:e,...t},r)=>o.jsx(ld.Separator,{ref:r,className:Z("-mx-1 h-px bg-border1",e),...t}));aw.displayName=ld.Separator.displayName;const Go=b.forwardRef(({className:e,...t},r)=>o.jsx(ld.Item,{ref:r,className:Z("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",sn.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}));Go.displayName=ld.Item.displayName;const Cut=({className:e,...t})=>o.jsx("span",{className:Z("ml-auto text-xs tracking-widest text-neutral3",e),...t});Cut.displayName="CommandShortcut";function jut({children:e,className:t}){return o.jsx("div",{className:Z("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const J2r=orr,eDr=lrr,tDr=nP,rDr=drr,nDr=crr,Gpe=Z("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"),Tut=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(CJe,{ref:n,className:Z("cursor-pointer",e),...r,children:t}));Tut.displayName=CJe.displayName;const Nut=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(PJe,{ref:s,className:Z(Gpe,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(wHe,{className:"-rotate-90 opacity-50"})})]}));Nut.displayName=PJe.displayName;const Aut=b.forwardRef(({className:e,...t},r)=>o.jsx(nP,{children:o.jsx(sz,{ref:r,className:Z("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})}));Aut.displayName=sz.displayName;const Iut=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(nP,{container:t,children:o.jsx(jJe,{ref:s,sideOffset:r,className:Z("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})}));Iut.displayName=jJe.displayName;const Rut=b.forwardRef(({className:e,...t},r)=>o.jsx(NJe,{ref:r,className:Z(Gpe,e),...t}));Rut.displayName=NJe.displayName;const Put=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(AJe,{ref:s,className:Z(Gpe,"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(py,{})}),t]}));Put.displayName=AJe.displayName;const Mut=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(IJe,{ref:n,className:Z("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(urr,{children:o.jsx(_He,{className:"h-2 w-2 fill-current"})})}),t]}));Mut.displayName=IJe.displayName;const Dut=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(TJe,{ref:n,className:Z("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Dut.displayName=TJe.displayName;const Lut=b.forwardRef(({className:e,...t},r)=>o.jsx(RJe,{ref:r,className:Z("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));Lut.displayName=RJe.displayName;const $ut=({className:e,...t})=>o.jsx("span",{className:Z("ml-auto text-xs tracking-widest opacity-60",e),...t});$ut.displayName="DropdownMenuShortcut";function yt({open:e,onOpenChange:t,children:r,modal:n}){return o.jsx(J2r,{modal:n,open:e,onOpenChange:t,children:r})}yt.Trigger=Tut;yt.Content=Iut;yt.Group=eDr;yt.Portal=tDr;yt.Item=Rut;yt.CheckboxItem=Put;yt.RadioItem=Mut;yt.Label=Dut;yt.Separator=Lut;yt.Shortcut=$ut;yt.Sub=rDr;yt.SubContent=Aut;yt.SubTrigger=Nut;yt.RadioGroup=nDr;const eL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(ve,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Mn({className:e,...t}){return o.jsx("div",{className:Z("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 Fut=({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(je,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?o.jsx(Mn,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(ve,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&o.jsx("div",{className:"pt-2",children:n})]});function sDr({children:e,className:t}){return o.jsx("div",{className:Z("grid gap-2 text-neutral4",t),children:e})}function aDr({children:e}){return o.jsxs("p",{className:Z("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx($E,{})," ",e]})}function iDr({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function oDr({children:e,name:t,required:r,size:n="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Z("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 lDr({children:e,className:t,layout:r="vertical",labelColumnWidth:n}){return o.jsx("div",{className:Z("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 go=Object.assign({},{Layout:lDr,Column:sDr,Label:oDr,HelpText:iDr,ErrorMsg:aDr});function cDr({children:e,className:t}){return o.jsx("div",{className:Z("grid gap-6 content-start",t),children:e})}function uDr({children:e,className:t,columns:r=1,gap:n}){return o.jsx("div",{className:Z("grid",{"grid-cols-1":r===1,"grid-cols-2":r===2},n??"gap-6",t),children:e})}Object.assign(uDr,{Column:cDr});const dDr=dC(Z("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:Z(Fpe,zpe,Bpe),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Wl.sm} text-ui-sm px-[.75em]`,md:`${Wl.md} text-ui-md px-[.75em]`,default:`${Wl.default} text-ui-md px-[.85em]`,lg:`${Wl.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),sr=b.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Z(dDr({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:l,"aria-invalid":a,...i}));sr.displayName="Input";function _x({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(go.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(go.Column,{children:o.jsx(go.Label,{name:e,required:l,size:u||"bigger",children:n?o.jsx(ed,{children:r}):r})}):null,o.jsxs(go.Column,{children:[!n&&d==="vertical"?o.jsx(go.Label,{name:e,required:l,size:u||"default",children:r}):null,o.jsx(sr,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":p,size:h,...g}),a&&o.jsx(go.HelpText,{children:a}),i&&o.jsx(go.ErrorMsg,{children:i})]})]})}function Ex({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 v=b.useRef(null);return b.useEffect(()=>{m===!1&&v.current?.focus()},[m]),m?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ge,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(x_,{})})}),o.jsx(Wr,{children:i||"Search"})]}):o.jsxs(go.Layout,{layout:c,className:h,children:[c==="horizontal"?o.jsx(go.Column,{children:o.jsx(go.Label,{name:e,required:n,children:l?o.jsx(ed,{children:i}):i})}):null,o.jsxs(go.Column,{children:[c==="vertical"&&i&&!l?o.jsx(go.Label,{name:e,required:n,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(sr,{ref:v,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:p,className:Z(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(x_,{"aria-hidden":"true",className:Z("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(ge,{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(Kl,{})})]}),t&&o.jsx(go.HelpText,{children:t}),r&&o.jsx(go.ErrorMsg,{children:r})]})]})}const fi=zrr,hi=Brr,Ja=b.forwardRef(({className:e,children:t,variant:r="inputLike",size:n="default",...s},a)=>o.jsxs(aet,{ref:a,className:Z(cC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(Urr,{asChild:!0,children:o.jsx(wHe,{className:Z("h-4 w-4 text-neutral3",sn.colors)})})]}));Ja.displayName=aet.displayName;const ei=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(Vrr,{children:o.jsx(iet,{ref:s,className:Z("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(qrr,{className:Z("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ei.displayName=iet.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(oet,{ref:n,className:Z("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",sn.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(Qrr,{children:o.jsx(py,{className:"h-4 w-4 text-accent1"})})}),o.jsx(Hrr,{children:t})]}));ss.displayName=oet.displayName;function Lo({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(go.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(go.Column,{children:o.jsx(go.Label,{name:e,required:n,children:c?o.jsx(ed,{children:l}):l})}):null,o.jsxs(go.Column,{children:[u==="vertical"&&l&&!c?o.jsx(go.Label,{name:e,required:n,children:l}):null,o.jsxs(fi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(Ja,{size:a,children:o.jsx(hi,{placeholder:h})}),o.jsx(ei,{children:f.map(g=>o.jsx(ss,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(go.HelpText,{children:t}),r&&o.jsx(go.ErrorMsg,{children:r})]})]})}const fDr={sm:`${Wl.sm} w-form-sm`,md:`${Wl.md} w-form-md`,lg:`${Wl.lg} w-form-lg`,default:`${Wl.default}`},hDr={sm:"sm",md:"default",lg:"lg",default:"default"},pDr={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"},mDr="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",Dn=Te.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:Z(mDr,NP,pDr[s],fDr[n],a&&"active:scale-100",e),...i,children:o.jsx(je,{size:hDr[n],children:t})})}),o.jsx(Wr,{children:r})]}));Dn.displayName="IconButton";const gDr=dC("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(uet,{ref:r,className:Z(gDr(),e),...t}));xt.displayName=uet.displayName;function X_({children:e}){const t=e.replace(/\\n/g,`
290
+ `).concat(k.x,",").concat(k.y),E=_l(e.id)?WA("recharts-radial-line-"):e.id;return b.createElement("text",Ev({},n,{dominantBaseline:"central",className:ya("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:_})),b.createElement("textPath",{xlinkHref:"#".concat(E)},r))},GTr=(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}=Ql(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}=Ql(n,s,h,u);return{x:p,y:m,textAnchor:"middle",verticalAnchor:"middle"}},x$=e=>e!=null&&"cx"in e&&Vr(e.cx),ZTr={angle:0,offset:5,zIndex:eu.label,position:"middle",textBreakAll:!1};function YTr(e){if(!x$(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 _b(e){var t=cd(e,ZTr),{viewBox:r,parentViewBox:n,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=qTr(),h=$lt(),p=s==="center"?h:f??h,m,g,v;r==null?m=p:x$(r)?m=r:m=ghe(r);var x=YTr(m);if(!m||_l(a)&&_l(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=VT(VT({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,k=OAe(w,DTr);return b.cloneElement(l,k)}if(typeof l=="function"){var{content:_}=w,E=OAe(w,LTr);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=HTr(t);var T=cu(t);if(x$(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return WTr(t,s,g,T,m);v=GTr(m,t.offset,t.position)}else{if(!x)return null;var j=MTr({viewBox:x,position:s,offset:t.offset,parentViewBox:x$(n)?void 0:n});v=VT(VT({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(Ey,{zIndex:t.zIndex},b.createElement(Spe,Ev({ref:d,className:ya("recharts-label",c)},T,v,{textAnchor:Rlt(T.textAnchor)?T.textAnchor:v.textAnchor,breakAll:u}),g))}_b.displayName="Label";var XTr=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?b.createElement(_b,Ev({key:"label-implicit"},n)):ig(e)?b.createElement(_b,Ev({key:"label-implicit",value:e},n)):b.isValidElement(e)?e.type===_b?b.cloneElement(e,VT({key:"label-implicit"},n)):b.createElement(_b,Ev({key:"label-implicit",content:e},n)):Ope(e)?b.createElement(_b,Ev({key:"label-implicit",content:e},n)):e&&typeof e=="object"?b.createElement(_b,Ev({},e,{key:"label-implicit"},n)):null};function KTr(e){var{label:t,labelRef:r}=e,n=$lt();return XTr(t,n,r)||null}var JTr=["valueAccessor"],eNr=["dataKey","clockWise","id","textBreakAll","zIndex"];function m4(){return m4=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},m4.apply(null,arguments)}function _Ae(e,t){if(e==null)return{};var r,n,s=tNr(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 tNr(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 rNr=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(CTr(t))return t},Flt=b.createContext(void 0),nNr=Flt.Provider,zlt=b.createContext(void 0);zlt.Provider;function sNr(){return b.useContext(Flt)}function aNr(){return b.useContext(zlt)}function w$(e){var{valueAccessor:t=rNr}=e,r=_Ae(e,JTr),{dataKey:n,clockWise:s,id:a,textBreakAll:i,zIndex:l}=r,c=_Ae(r,eNr),u=sNr(),d=aNr(),f=u||d;return!f||!f.length?null:b.createElement(Ey,{zIndex:l??eu.label},b.createElement(Yv,{className:"recharts-label-list"},f.map((h,p)=>{var m,g=_l(n)?t(h,p):Xl(h.payload,n),v=_l(a)?{}:{id:"".concat(a,"-").concat(p)};return b.createElement(_b,m4({key:"label-".concat(p)},cu(h),c,v,{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}))})))}w$.displayName="LabelList";function iNr(e){var{label:t}=e;return t?t===!0?b.createElement(w$,{key:"labelList-implicit"}):b.isValidElement(t)||Ope(t)?b.createElement(w$,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(w$,m4({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Lae(){return Lae=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},Lae.apply(null,arguments)}var Blt=e=>{var{cx:t,cy:r,r:n,className:s}=e,a=ya("recharts-dot",s);return Vr(t)&&Vr(r)&&Vr(n)?b.createElement("circle",Lae({},ag(e),ohe(e),{className:a,cx:t,cy:r,r:n})):null},oNr={radiusAxis:{},angleAxis:{}},Ult=Ac({name:"polarAxis",initialState:oNr,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:vRn,removeRadiusAxis:yRn,addAngleAxis:bRn,removeAngleAxis:xRn}=Ult.actions,lNr=Ult.reducer;function cNr(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var FH={exports:{}},Ks={};var EAe;function uNr(){if(EAe)return Ks;EAe=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(v){if(typeof v=="object"&&v!==null){var x=v.$$typeof;switch(x){case e:switch(v=v.type,v){case r:case s:case n:case u:case d:return v;default:switch(v=v&&v.$$typeof,v){case l:case i:case c:case h:case f:case a:return v;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(v){return g(v)===i},Ks.isContextProvider=function(v){return g(v)===a},Ks.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Ks.isForwardRef=function(v){return g(v)===c},Ks.isFragment=function(v){return g(v)===r},Ks.isLazy=function(v){return g(v)===h},Ks.isMemo=function(v){return g(v)===f},Ks.isPortal=function(v){return g(v)===t},Ks.isProfiler=function(v){return g(v)===s},Ks.isStrictMode=function(v){return g(v)===n},Ks.isSuspense=function(v){return g(v)===u},Ks.isSuspenseList=function(v){return g(v)===d},Ks.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===r||v===s||v===n||v===u||v===d||v===p||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===f||v.$$typeof===a||v.$$typeof===i||v.$$typeof===c||v.$$typeof===m||v.getModuleId!==void 0)},Ks.typeOf=g,Ks}var CAe;function dNr(){return CAe||(CAe=1,FH.exports=uNr()),FH.exports}dNr();var Vlt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,zH={},jAe;function fNr(){return jAe||(jAe=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})(zH)),zH}var BH,TAe;function hNr(){return TAe||(TAe=1,BH=fNr().isPlainObject),BH}var pNr=hNr();const mNr=Bo(pNr);var NAe,AAe,IAe,RAe,PAe;function MAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function DAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MAe(Object(r),!0).forEach(function(n){gNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gNr(e,t,r){return(t=vNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vNr(e){var t=yNr(e,"string");return typeof t=="symbol"?t:t+""}function yNr(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 g4(){return g4=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},g4.apply(null,arguments)}function tT(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var LAe=(e,t,r,n,s)=>{var a=r-n,i;return i=Qi(NAe||(NAe=tT(["M ",",",""])),e,t),i+=Qi(AAe||(AAe=tT(["L ",",",""])),e+r,t),i+=Qi(IAe||(IAe=tT(["L ",",",""])),e+r-a/2,t+s),i+=Qi(RAe||(RAe=tT(["L ",",",""])),e+r-a/2-n,t+s),i+=Qi(PAe||(PAe=tT(["L ",","," Z"])),e,t),i},bNr={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},xNr=e=>{var t=cd(e,bNr),{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),v=b.useRef(a),x=b.useRef(i),w=b.useRef(r),S=b.useRef(n),k=xhe(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 _=ya("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",g4({},cu(t),{className:_,d:LAe(r,n,s,a,i)})));var E=g.current,T=v.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"),z=ait(["strokeDasharray"],u,c);return b.createElement(bhe,{animationId:k,key:k,canBegin:p>0,duration:u,easing:c,isActive:f,begin:d},D=>{var U=Fu(E,s,D),F=Fu(T,a,D),B=Fu(j,i,D),H=Fu(N,r,D),W=Fu(I,n,D);h.current&&(g.current=U,v.current=F,x.current=B,w.current=H,S.current=W);var L=D>0?{transition:z,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",g4({},cu(t),{className:_,d:LAe(H,W,U,F,B),ref:h,style:DAe(DAe({},L),t.style)}))})},wNr=["option","shapeType","activeClassName","inActiveClassName"];function SNr(e,t){if(e==null)return{};var r,n,s=ONr(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 ONr(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 $Ae(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 v4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$Ae(Object(r),!0).forEach(function(n){kNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$Ae(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kNr(e,t,r){return(t=_Nr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _Nr(e){var t=ENr(e,"string");return typeof t=="symbol"?t:t+""}function ENr(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 CNr(e,t){return v4(v4({},t),e)}function jNr(e,t){return e==="symbols"}function FAe(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return b.createElement(cit,r);case"trapezoid":return b.createElement(xNr,r);case"sector":return b.createElement(fit,r);case"symbols":if(jNr(t))return b.createElement(Zst,r);break;case"curve":return b.createElement(sit,r);default:return null}}function TNr(e){return b.isValidElement(e)?e.props:e}function NNr(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=SNr(e,wNr),i;if(b.isValidElement(t))i=b.cloneElement(t,v4(v4({},a),TNr(t)));else if(typeof t=="function")i=t(a,a.index);else if(mNr(t)&&typeof t!="boolean"){var l=CNr(t,a);i=b.createElement(FAe,{shapeType:r,elementProps:l})}else{var c=a;i=b.createElement(FAe,{shapeType:r,elementProps:c})}return a.isActive?b.createElement(Yv,{className:n},i):b.createElement(Yv,{className:s},i)}function ANr(e){var{tooltipEntrySettings:t}=e,r=Uo(),n=ud(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(FEr(t)):s.current!==t&&r(zEr({prev:s.current,next:t})),s.current=t)},[t,r,n]),b.useLayoutEffect(()=>()=>{s.current&&(r(BEr(s.current)),s.current=null)},[r]),null}function INr(e){var{legendPayload:t}=e,r=Uo(),n=ud(),s=b.useRef(null);return b.useLayoutEffect(()=>{n||(s.current===null?r(eSr(t)):s.current!==t&&r(tSr({prev:s.current,next:t})),s.current=t)},[r,n,t]),b.useLayoutEffect(()=>()=>{s.current&&(r(rSr(s.current)),s.current=null)},[r]),null}var UH,RNr=()=>{var[e]=b.useState(()=>WA("uid-"));return e},PNr=(UH=YS.useId)!==null&&UH!==void 0?UH:RNr;function MNr(e,t){var r=PNr();return t||(e?"".concat(e,"-").concat(r):r)}var DNr=b.createContext(void 0),LNr=e=>{var{id:t,type:r,children:n}=e,s=MNr("recharts-".concat(r),t);return b.createElement(DNr.Provider,{value:s},n(s))},$Nr={cartesianItems:[],polarItems:[]},qlt=Ac({name:"graphicalItems",initialState:$Nr,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:oi()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:oi()},removeCartesianGraphicalItem:{reducer(e,t){var r=ph(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:oi()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:oi()},removePolarGraphicalItem:{reducer(e,t){var r=ph(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:oi()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=ph(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=n)},prepare:oi()}}}),{addCartesianGraphicalItem:FNr,replaceCartesianGraphicalItem:zNr,removeCartesianGraphicalItem:BNr,addPolarGraphicalItem:wRn,removePolarGraphicalItem:SRn,replacePolarGraphicalItem:ORn}=qlt.actions,UNr=qlt.reducer,VNr=e=>{var t=Uo(),r=b.useRef(null);return b.useLayoutEffect(()=>{r.current===null?t(FNr(e)):r.current!==e&&t(zNr({prev:r.current,next:e})),r.current=e},[t,e]),b.useLayoutEffect(()=>()=>{r.current&&(t(BNr(r.current)),r.current=null)},[t]),null},qNr=b.memo(VNr),HNr=["points"];function zAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function VH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zAe(Object(r),!0).forEach(function(n){QNr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QNr(e,t,r){return(t=WNr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WNr(e){var t=GNr(e,"string");return typeof t=="symbol"?t:t+""}function GNr(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 y4(){return y4=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},y4.apply(null,arguments)}function ZNr(e,t){if(e==null)return{};var r,n,s=YNr(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 YNr(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 XNr(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=ya(n,typeof t!="boolean"?t.className:""),a=r??{},{points:i}=a,l=ZNr(a,HNr);return b.createElement(Blt,y4({},l,{className:s}))}function KNr(e,t){return e==null?!1:t?!0:e.length===1}function JNr(e){var{points:t,dot:r,className:n,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=eu.scatter}=e;if(!KNr(t,r))return null;var d=Vlt(r),f=dbr(r),h=t.map((m,g)=>{var v,x,w=VH(VH(VH({r:3},i),f),{},{index:g,cx:(v=m.x)!==null&&v!==void 0?v: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(XNr,{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(Ey,{zIndex:u},b.createElement(Yv,y4({className:n},p),h))}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 UAe(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){eAr(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 eAr(e,t,r){return(t=tAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tAr(e){var t=rAr(e,"string");return typeof t=="symbol"?t:t+""}function rAr(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 nAr={xAxis:{},yAxis:{},zAxis:{}},Hlt=Ac({name:"cartesianAxis",initialState:nAr,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:oi()},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:oi()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:oi()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:oi()},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:oi()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:oi()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:oi()},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:oi()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:oi()},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]=UAe(UAe({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:sAr,replaceXAxis:aAr,removeXAxis:iAr,addYAxis:oAr,replaceYAxis:lAr,removeYAxis:cAr,addZAxis:kRn,replaceZAxis:_Rn,removeZAxis:ERn,updateYAxisWidth:uAr}=Hlt.actions,dAr=Hlt.reducer,fAr=Xe([tc],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),hAr=Xe([fAr,xy,wy],(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)}}),kpe=()=>en(hAr),pAr=()=>en(FCr);function VAe(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 qH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VAe(Object(r),!0).forEach(function(n){mAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mAr(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=vAr(e,"string");return typeof t=="symbol"?t:t+""}function vAr(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=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=qH(qH(qH({},l),Iz(s)),ohe(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Blt,c),b.createElement(Yv,{className:"recharts-active-dot",clipPath:i},u)};function bAr(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:s,clipPath:a,zIndex:i=eu.activeDot}=e,l=en(aI),c=pAr();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return _l(u)?null:b.createElement(Ey,{zIndex:i},b.createElement(yAr,{point:u,childIndex:Number(l),mainColor:r,dataKey:s,activeDot:n,clipPath:a}))}var xAr=e=>{var{chartData:t}=e,r=Uo(),n=ud();return b.useEffect(()=>n?()=>{}:(r(oAe(t)),()=>{r(oAe(void 0))}),[t,r,n]),null},qAe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Qlt=Ac({name:"brush",initialState:qAe,reducers:{setBrushSettings(e,t){return t.payload==null?qAe:t.payload}}}),{setBrushSettings:CRn}=Qlt.actions,wAr=Qlt.reducer;function SAr(e){return(e%180+180)%180}var OAr=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=SAr(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)},kAr={dots:[],areas:[],lines:[]},Wlt=Ac({name:"referenceElements",initialState:kAr,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:jRn,removeDot:TRn,addArea:NRn,removeArea:ARn,addLine:IRn,removeLine:RRn}=Wlt.actions,_Ar=Wlt.reducer,EAr=b.createContext(void 0),CAr=e=>{var{children:t}=e,[r]=b.useState("".concat(WA("recharts"),"-clip")),n=kpe();if(n==null)return null;var{x:s,y:a,width:i,height:l}=n;return b.createElement(EAr.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 Glt(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 jAr(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return OAr(n,r)}function TAr(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 oI(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 NAr(e,t){return Glt(e,t+1)}function AAr(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:Glt(n,u)};var g=c,v,x=()=>(v===void 0&&(v=r(m,g)),v),w=m.coordinate,S=c===0||oI(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 IAr(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||oI(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 v=[],x=d;x<i;x+=u){var w=n[x];w!=null&&v.push(w)}return v}}return[]}function HAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function oc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HAe(Object(r),!0).forEach(function(n){RAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RAr(e,t,r){return(t=PAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PAr(e){var t=MAr(e,"string");return typeof t=="symbol"?t:t+""}function MAr(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 DAr(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,v=()=>(g===void 0&&(g=r(p,h)),g);if(h===i-1){var x=e*(m.coordinate+e*v()/2-c);a[h]=m=oc(oc({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[h]=m=oc(oc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=oI(e,m.tickCoord,v,l,c);w&&(c=m.tickCoord-e*(v()/2+s),a[h]=oc(oc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function LAr(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=oc(oc({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var p=oI(e,d.tickCoord,()=>f,c,u);p&&(u=d.tickCoord-e*(f/2+s),i[l-1]=oc(oc({},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=oc(oc({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else i[w]=k=oc(oc({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var j=oI(e,k.tickCoord,E,c,u);j&&(c=k.tickCoord+e*(E()/2+s),i[w]=oc(oc({},k),{},{isShow:!0}))}},v=0;v<m;v++)g(v);return i}function _pe(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(Vr(c)||yP.isSsr){var h;return(h=NAr(s,Vr(c)?c:0))!==null&&h!==void 0?h:[]}var p=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?CN(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},v=(_,E)=>{var T=typeof u=="function"?u(_.value,E):_.value;return m==="width"?jAr(CN(T,{fontSize:t,letterSpacing:r}),g,f):CN(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=TAr(a,S,m);return c==="equidistantPreserveStart"?AAr(S,k,v,s,i):c==="equidistantPreserveEnd"?IAr(S,k,v,s,i):(c==="preserveStart"||c==="preserveStartEnd"?p=LAr(S,k,v,s,i,c==="preserveStartEnd"):p=DAr(S,k,v,s,i),p.filter(_=>_.isShow))}var $Ar=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},FAr={xAxis:{},yAxis:{}},Zlt=Ac({name:"renderedTicks",initialState:FAr,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:zAr,removeRenderedTicks:BAr}=Zlt.actions,UAr=Zlt.reducer,VAr=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function qAr(e,t){if(e==null)return{};var r,n,s=HAr(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 HAr(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 jS(){return jS=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},jS.apply(null,arguments)}function QAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QAe(Object(r),!0).forEach(function(n){QAr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QAr(e,t,r){return(t=WAr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WAr(e){var t=GAr(e,"string");return typeof t=="symbol"?t:t+""}function GAr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zv={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:eu.axis};function ZAr(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),ag(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",jS({},u,{className:ya("recharts-cartesian-axis-line",Dz(l,"className"))}))}function YAr(e,t,r,n,s,a,i,l,c){var u,d,f,h,p,m,g=l?-1:1,v=e.tickSize||i,x=Vr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,h=r+ +!l*s,f=h-g*v,m=f-g*c,p=x;break;case"left":f=h=e.coordinate,d=t+ +!l*n,u=d-g*v,p=u-g*c,m=x;break;case"right":f=h=e.coordinate,d=t+ +l*n,u=d+g*v,p=u+g*c,m=x;break;default:u=d=e.coordinate,h=r+ +l*s,f=h+g*v,m=f+g*c,p=x;break}return{line:{x1:u,y1:f,x2:d,y2:h},tick:{x:p,y:m}}}function XAr(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function KAr(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function JAr(e){var{option:t,tickProps:r,value:n}=e,s,a=ya(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=ya(i,cNr(t))),s=b.createElement(Spe,jS({},r,{className:i}),n)}return s}function eIr(e){var{ticks:t,axisType:r,axisId:n}=e,s=Uo();return b.useEffect(()=>{if(n==null||r==null)return p1;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(zAr({ticks:a,axisId:n,axisType:r})),()=>{s(BAr({axisId:n,axisType:r}))}},[s,t,n,r]),null}var tIr=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:v,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:k,events:_,axisType:E,axisId:T}=e,j=_pe(Hi(Hi({},k),{},{ticks:r}),w,S),N=ag(k),I=Iz(n),P=Rlt(N.textAnchor)?N.textAnchor:XAr(d,f),R=KAr(d,f),z={};typeof s=="object"&&(z=s);var D=Hi(Hi({},N),{},{fill:"none"},z),U=j.map(H=>Hi({entry:H},YAr(H,h,p,m,g,d,v,f,x))),F=U.map(H=>{var{entry:W,line:L}=H;return b.createElement(Yv,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(W.value,"-").concat(W.coordinate,"-").concat(W.tickCoord)},s&&b.createElement("line",jS({},D,L,{className:ya("recharts-cartesian-axis-tick-line",Dz(s,"className"))})))}),B=U.map((H,W)=>{var L,Y,{entry:q,tick:M}=H,Q=Hi(Hi(Hi(Hi({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},M),{},{index:W,payload:q,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(L=(Y=u?.angle)!==null&&Y!==void 0?Y:N.angle)!==null&&L!==void 0?L:0}),G=Hi(Hi({},Q),I);return b.createElement(Yv,jS({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(q.value,"-").concat(q.coordinate,"-").concat(q.tickCoord)},mxr(_,q,W)),n&&b.createElement(JAr,{option:n,tickProps:G,value:"".concat(typeof i=="function"?i(q.value,W):q.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(eIr,{ticks:j,axisId:T,axisType:E}),B.length>0&&b.createElement(Ey,{zIndex:eu.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},B)),F.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},F))}),rIr=b.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=qAr(e,VAr),[f,h]=b.useState(""),[p,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return $Ar({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var v=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(Ey,{zIndex:e.zIndex},b.createElement(Yv,{className:ya("recharts-cartesian-axis",a)},b.createElement(ZAr,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:ag(e)}),b.createElement(tIr,{ref:v,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(UTr,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(KTr,{label:e.label,labelRef:e.labelRef}),e.children)))}),Epe=b.forwardRef((e,t)=>{var r=cd(e,zv);return b.createElement(rIr,jS({},r,{ref:t}))});Epe.displayName="CartesianAxis";var nIr=["x1","y1","x2","y2","key"],sIr=["offset"],aIr=["xAxisId","yAxisId"],iIr=["xAxisId","yAxisId"];function WAe(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 hc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WAe(Object(r),!0).forEach(function(n){oIr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WAe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oIr(e,t,r){return(t=lIr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lIr(e){var t=cIr(e,"string");return typeof t=="symbol"?t:t+""}function cIr(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 kw(){return kw=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},kw.apply(null,arguments)}function b4(e,t){if(e==null)return{};var r,n,s=uIr(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 uIr(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 dIr=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 Ylt(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=b4(r,nIr),f=(s=ag(d))!==null&&s!==void 0?s:{},{offset:h}=f,p=b4(f,sIr);n=b.createElement("line",kw({},p,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function fIr(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=b4(e,aIr),c=s.map((u,d)=>{var f=hc(hc({},l),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return b.createElement(Ylt,{key:"line-".concat(d),option:n,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function hIr(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=b4(e,iIr),c=s.map((u,d)=>{var f=hc(hc({},l),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return b.createElement(Ylt,{option:n,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function pIr(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 v=h%t.length;return b.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:g,width:a,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function mIr(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 v=h%r.length;return b.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:g,height:l,stroke:"none",fill:r[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var gIr=(e,t)=>{var{xAxis:r,width:n,height:s,offset:a}=e;return Dat(_pe(hc(hc(hc({},zv),r),{},{ticks:Lat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,t)},vIr=(e,t)=>{var{yAxis:r,width:n,height:s,offset:a}=e;return Dat(_pe(hc(hc(hc({},zv),r),{},{ticks:Lat(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,t)},yIr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:eu.grid};function Xlt(e){var t=Hat(),r=Qat(),n=qat(),s=hc(hc({},cd(e,yIr)),{},{x:Vr(e.x)?e.x:n.left,y:Vr(e.y)?e.y:n.top,width:Vr(e.width)?e.width:n.width,height:Vr(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=ud(),g=en(N=>GNe(N,"xAxis",a,m)),v=en(N=>GNe(N,"yAxis",i,m));if(!og(u)||!og(d)||!Vr(l)||!Vr(c))return null;var x=s.verticalCoordinatesGenerator||gIr,w=s.horizontalCoordinatesGenerator||vIr,{horizontalPoints:S,verticalPoints:k}=s;if((!S||!S.length)&&typeof w=="function"){var _=h&&h.length,E=w({yAxis:v?hc(hc({},v),{},{ticks:_?h:v.ticks}):void 0,width:t??u,height:r??d,offset:n},_?!0:f);q5(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?hc(hc({},g),{},{ticks:T?p:g.ticks}):void 0,width:t??u,height:r??d,offset:n},T?!0:f);q5(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(k=j)}return b.createElement(Ey,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(dIr,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(pIr,kw({},s,{horizontalPoints:S})),b.createElement(mIr,kw({},s,{verticalPoints:k})),b.createElement(fIr,kw({},s,{offset:n,horizontalPoints:S,xAxis:g,yAxis:v})),b.createElement(hIr,kw({},s,{offset:n,verticalPoints:k,xAxis:g,yAxis:v}))))}Xlt.displayName="CartesianGrid";var bIr={},Klt=Ac({name:"errorBars",initialState:bIr,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:PRn,replaceErrorBar:MRn,removeErrorBar:DRn}=Klt.actions,xIr=Klt.reducer,wIr=["children"];function SIr(e,t){if(e==null)return{};var r,n,s=OIr(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 OIr(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 kIr={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},_Ir=b.createContext(kIr);function EIr(e){var{children:t}=e,r=SIr(e,wIr);return b.createElement(_Ir.Provider,{value:r},t)}function Jlt(e,t){var r,n,s=en(u=>Oy(u,e)),a=en(u=>ky(u,t)),i=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Zo.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:Yo.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function CIr(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=kpe(),{needClipX:a,needClipY:i,needClip:l}=Jlt(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 ect=(e,t,r,n)=>Jot(e,"xAxis",t,n),tct=(e,t,r,n)=>Kot(e,"xAxis",t,n),rct=(e,t,r,n)=>Jot(e,"yAxis",r,n),nct=(e,t,r,n)=>Kot(e,"yAxis",r,n),jIr=Xe([Fi,ect,rct,tct,nct],(e,t,r,n,s)=>by(e,"xAxis")?V5(t,n,!1):V5(r,s,!1)),TIr=(e,t,r,n,s)=>s;function NIr(e){return e.type==="line"}var AIr=Xe([Sot,TIr],(e,t)=>e.filter(NIr).find(r=>r.id===t)),IIr=Xe([Fi,ect,rct,tct,nct,AIr,jIr,whe],(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 JIr({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:p})}});function RIr(e){var t=Iz(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 PIr=["id"],MIr=["type","layout","connectNulls","needClip","shape"],DIr=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function lI(){return lI=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},lI.apply(null,arguments)}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 Om(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){LIr(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 LIr(e,t,r){return(t=$Ir(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Ir(e){var t=FIr(e,"string");return typeof t=="symbol"?t:t+""}function FIr(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 Cpe(e,t){if(e==null)return{};var r,n,s=zIr(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 zIr(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 BIr=e=>{var{dataKey:t,name:r,stroke:n,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:n,value:$at(r,t),payload:e}]},UIr=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:p1,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:$at(i,t),hide:l,type:u,color:n,unit:c,graphicalItemId:d}};return b.createElement(ANr,{tooltipEntrySettings:f})}),sct=(e,t)=>"".concat(t,"px ").concat(e,"px");function VIr(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],s=0;s<t;++s)n.push(...r);return n}var qIr=(e,t,r)=>{var n=r.reduce((h,p)=>h+p,0);if(!n)return sct(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[...VIr(r,s),...i,...f].map(h=>"".concat(h,"px")).join(", ")};function HIr(e){var{clipPathId:t,points:r,props:n}=e,{dot:s,dataKey:a,needClip:i}=n,{id:l}=n,c=Cpe(n,PIr),u=ag(c);return b.createElement(JNr,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function QIr(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 Om(Om({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return b.createElement(nNr,{value:t?s:void 0},r)}function ZAe(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=Cpe(a,MIr),h=Om(Om({},cu(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(NNr,lI({shapeType:"curve",option:d},h,{pathRef:r})),b.createElement(HIr,{points:n,clipPathId:t,props:a}))}function WIr(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function GIr(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:v}=r,x=s.current,w=xhe(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 v=="function"&&v(),_(!0)},[v]),N=WIr(n.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(QIr,{points:i,showLabels:E},r.children,b.createElement(bhe,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var z=Fu(P,N+P,R),D=Math.min(z,N),U;if(c)if(l){var F="".concat(l).split(/[,\s]+/gim).map(W=>parseFloat(W));U=qIr(D,N,F)}else U=sct(N,D);else U=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,D)),x){var B=x.length/i.length,H=R===1?i:i.map((W,L)=>{var Y=Math.floor(L*B);if(x[Y]){var q=x[Y];return Om(Om({},W),{},{x:Fu(q.x,W.x,R),y:Fu(q.y,W.y,R)})}return h?Om(Om({},W),{},{x:Fu(p*2,W.x,R),y:Fu(m/2,W.y,R)}):Om(Om({},W),{},{x:W.x,y:W.y})});return s.current=H,b.createElement(ZAe,{props:r,points:H,clipPathId:t,pathRef:n,strokeDasharray:U})}return b.createElement(ZAe,{props:r,points:i,clipPathId:t,pathRef:n,strokeDasharray:U})}),b.createElement(iNr,{label:r.label}))}function ZIr(e){var{clipPathId:t,props:r}=e,n=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(GIr,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:s,pathRef:a})}var YIr=(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:Xl(e.payload,t)}};class XIr 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=ya("recharts-line",s),g=f,{r:v,strokeWidth:x}=RIr(r),w=Vlt(r),S=v*2+x,k=h?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(Ey,{zIndex:p},b.createElement(Yv,{className:m},h&&b.createElement("defs",null,b.createElement(CIr,{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(EIr,{xAxisId:a,yAxisId:i,data:n,dataPointFormatter:YIr,errorBarOffset:0},b.createElement(ZIr,{props:this.props,clipPathId:g}))),b.createElement(bAr,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var act={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:eu.line,type:"linear"};function KIr(e){var t=cd(e,act),{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,v=Cpe(t,DIr),{needClip:x}=Jlt(p,m),w=kpe(),S=eC(),k=ud(),_=en(I=>IIr(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(XIr,lI({},v,{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 JIr(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=Xl(u,i);if(t==="horizontal"){var h=Wje({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=Wje({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 eRr(e){var t=cd(e,act),r=ud();return b.createElement(LNr,{id:t.id,type:"line"},n=>b.createElement(b.Fragment,null,b.createElement(INr,{legendPayload:BIr(t)}),b.createElement(UIr,{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(qNr,{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(KIr,lI({},t,{id:n}))))}var ict=b.memo(eRr,t9);ict.displayName="Line";var tRr=["domain","range"],rRr=["domain","range"];function YAe(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}function XAe(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 oct(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=YAe(e,tRr),{domain:a,range:i}=t,l=YAe(t,rRr);return!XAe(r,a)||!XAe(n,i)?!1:t9(s,l)}var sRr=["type"],aRr=["dangerouslySetInnerHTML","ticks","scale"],iRr=["id","scale"];function $ae(){return $ae=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},$ae.apply(null,arguments)}function KAe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function JAe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KAe(Object(r),!0).forEach(function(n){oRr(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 oRr(e,t,r){return(t=lRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lRr(e){var t=cRr(e,"string");return typeof t=="symbol"?t:t+""}function cRr(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 Fae(e,t){if(e==null)return{};var r,n,s=uRr(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 uRr(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 dRr(e){var t=Uo(),r=b.useRef(null),n=Wat(),{type:s}=e,a=Fae(e,sRr),i=s9(n,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return JAe(JAe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(sAr(l)):r.current!==l&&t(aAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(iAr(r.current)),r.current=null)},[t]),null}var fRr=e=>{var{xAxisId:t,className:r}=e,n=en(zat),s=ud(),a="xAxis",i=en(x=>Xot(x,a,t,s)),l=en(x=>xEr(x,t)),c=en(x=>EEr(x,t)),u=en(x=>yot(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,p=Fae(e,aRr),{id:m,scale:g}=u,v=Fae(u,iRr);return b.createElement(Epe,$ae({},p,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:ya("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:i,axisType:a,axisId:t}))},hRr={allowDataOverflow:Zo.allowDataOverflow,allowDecimals:Zo.allowDecimals,allowDuplicatedCategory:Zo.allowDuplicatedCategory,angle:Zo.angle,axisLine:zv.axisLine,height:Zo.height,hide:!1,includeHidden:Zo.includeHidden,interval:Zo.interval,label:!1,minTickGap:Zo.minTickGap,mirror:Zo.mirror,orientation:Zo.orientation,padding:Zo.padding,reversed:Zo.reversed,scale:Zo.scale,tick:Zo.tick,tickCount:Zo.tickCount,tickLine:zv.tickLine,tickSize:zv.tickSize,type:Zo.type,niceTicks:Zo.niceTicks,xAxisId:0},pRr=e=>{var t=cd(e,hRr);return b.createElement(b.Fragment,null,b.createElement(dRr,{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(fRr,t))},lct=b.memo(pRr,oct);lct.displayName="XAxis";var mRr=["type"],gRr=["dangerouslySetInnerHTML","ticks","scale"],vRr=["id","scale"];function zae(){return zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zae.apply(null,arguments)}function eIe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function tIe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eIe(Object(r),!0).forEach(function(n){yRr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eIe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yRr(e,t,r){return(t=bRr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bRr(e){var t=xRr(e,"string");return typeof t=="symbol"?t:t+""}function xRr(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 Bae(e,t){if(e==null)return{};var r,n,s=wRr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wRr(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function SRr(e){var t=Uo(),r=b.useRef(null),n=Wat(),{type:s}=e,a=Bae(e,mRr),i=s9(n,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return tIe(tIe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(r.current===null?t(oAr(l)):r.current!==l&&t(lAr({prev:r.current,next:l})),r.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{r.current&&(t(cAr(r.current)),r.current=null)},[t]),null}function ORr(e){var{yAxisId:t,className:r,width:n,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=en(zat),c=ud(),u=Uo(),d="yAxis",f=en(E=>TEr(E,t)),h=en(E=>jEr(E,t)),p=en(E=>Xot(E,d,t,c)),m=en(E=>bot(E,t));if(b.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Ope(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(uAr({id:t,width:T}))}}},[p,f,u,s,t,n,m]),f==null||h==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:x}=e,w=Bae(e,gRr),{id:S,scale:k}=m,_=Bae(m,vRr);return b.createElement(Epe,zae({},w,_,{ref:a,labelRef:i,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ya("recharts-".concat(d," ").concat(d),r),viewBox:l,ticks:p,axisType:d,axisId:t}))}var kRr={allowDataOverflow:Yo.allowDataOverflow,allowDecimals:Yo.allowDecimals,allowDuplicatedCategory:Yo.allowDuplicatedCategory,angle:Yo.angle,axisLine:zv.axisLine,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:zv.tickLine,tickSize:zv.tickSize,type:Yo.type,niceTicks:Yo.niceTicks,width:Yo.width,yAxisId:0},_Rr=e=>{var t=cd(e,kRr);return b.createElement(b.Fragment,null,b.createElement(SRr,{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(ORr,t))},cct=b.memo(_Rr,oct);cct.displayName="YAxis";var ERr=(e,t)=>t,jpe=Xe([ERr,Fi,Ait,jl,mlt,_y,KCr,tc],ajr);function CRr(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Tpe(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(CRr(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 uct=ff("mouseClick"),dct=pP();dct.startListening({actionCreator:uct,effect:(e,t)=>{var r=e.payload,n=jpe(t.getState(),Tpe(r));n?.activeIndex!=null&&t.dispatch(qEr({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Uae=ff("mouseMove"),fct=pP(),xO=null,D0=null,HH=null;fct.startListening({actionCreator:Uae,effect:(e,t)=>{var r=e.payload,n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a?.includes("mousemove");xO!==null&&(cancelAnimationFrame(xO),xO=null),D0!==null&&(typeof s!="number"||!i)&&(clearTimeout(D0),D0=null),HH=Tpe(r);var l=()=>{var c=t.getState(),u=fpe(c,c.tooltip.settings.shared);if(!HH){xO=null,D0=null;return}if(u==="axis"){var d=jpe(c,HH);d?.activeIndex!=null?t.dispatch(ilt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(alt())}xO=null,D0=null};if(!i){l();return}s==="raf"?xO=requestAnimationFrame(l):typeof s=="number"&&D0===null&&(D0=setTimeout(l,s))}});function jRr(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 rIe={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},hct=Ac({name:"rootProps",initialState:rIe,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:rIe.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}}}),TRr=hct.reducer,{updateOptions:NRr}=hct.actions,ARr=null,IRr={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)},pct=Ac({name:"polarOptions",initialState:ARr,reducers:IRr}),{updatePolarOptions:LRn}=pct.actions,RRr=pct.reducer,mct=ff("keyDown"),gct=ff("focus"),vct=ff("blur"),y9=pP(),wO=null,L0=null,QD=null;y9.startListening({actionCreator:mct,effect:(e,t)=>{QD=e.payload,wO!==null&&(cancelAnimationFrame(wO),wO=null);var r=t.getState(),{throttleDelay:n,throttledEvents:s}=r.eventSettings,a=s==="all"||s.includes("keydown");L0!==null&&(typeof n!="number"||!a)&&(clearTimeout(L0),L0=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=QD;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=hpe(u,lC(l),EP(l),jP(l)),h=f==null?-1:Number(f);if(!Number.isFinite(h)||h<0)return;var p=_y(l);if(d==="Enter"){var m=p4(l,"axis","hover",String(u.index));t.dispatch(h4({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=PEr(l),v=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=h+x*v;if(p==null||w>=p.length||w<0)return;var S=p4(l,"axis","hover",String(w));t.dispatch(h4({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{wO=null,L0=null}};if(!a){i();return}n==="raf"?wO=requestAnimationFrame(i):typeof n=="number"&&L0===null&&(i(),QD=null,L0=setTimeout(()=>{QD?i():(L0=null,wO=null)},n))}});y9.startListening({actionCreator:gct,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=p4(r,"axis","hover",String(a));t.dispatch(h4({active:!0,activeIndex:a,activeCoordinate:i}))}}}});y9.startListening({actionCreator:vct,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(h4({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function yct(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=ff("externalEvent"),bct=pP(),WD=new Map,rT=new Map,QH=new Map;bct.startListening({actionCreator:Xf,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){var s=n.type,a=yct(n);QH.set(s,{handler:r,reactEvent:a});var i=WD.get(s);i!==void 0&&(cancelAnimationFrame(i),WD.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),h=rT.get(s);h!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(h),rT.delete(s));var p=()=>{var v=QH.get(s);try{if(!v)return;var{handler:x,reactEvent:w}=v,S=t.getState(),k={activeCoordinate:DCr(S),activeDataKey:RCr(S),activeIndex:aI(S),activeLabel:ylt(S),activeTooltipIndex:aI(S),isTooltipActive:LCr(S)};x&&x(k,w)}finally{WD.delete(s),rT.delete(s),QH.delete(s)}};if(!f){p();return}if(c==="raf"){var m=requestAnimationFrame(p);WD.set(s,m)}else if(typeof c=="number"){if(!rT.has(s)){p();var g=setTimeout(p,c);rT.set(s,g)}}else p()}}});var PRr=Xe([iC],e=>e.tooltipItemPayloads),MRr=Xe([PRr,(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)}}}),xct=ff("touchMove"),wct=pP(),$0=null,cb=null,nIe=null,nT=null;wct.startListening({actionCreator:xct,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){nT=yct(r);var n=t.getState(),{throttleDelay:s,throttledEvents:a}=n.eventSettings,i=a==="all"||a.includes("touchmove");$0!==null&&(cancelAnimationFrame($0),$0=null),cb!==null&&(typeof s!="number"||!i)&&(clearTimeout(cb),cb=null),nIe=Array.from(r.touches).map(c=>Tpe({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(nT!=null){var c=t.getState(),u=fpe(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=nIe)===null||d===void 0?void 0:d[0];if(f==null){$0=null,cb=null;return}var h=jpe(c,f);h?.activeIndex!=null&&t.dispatch(ilt({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var p,m=nT.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var v=g.getAttribute(uwr),x=(p=g.getAttribute(dwr))!==null&&p!==void 0?p:void 0,w=oC(c).find(_=>_.id===x);if(v==null||w==null||x==null)return;var{dataKey:S}=w,k=MRr(c,v,x);t.dispatch(VEr({activeDataKey:S,activeIndex:v,activeCoordinate:k,activeGraphicalItemId:x}))}$0=null,cb=null}};if(!i){l();return}s==="raf"?$0=requestAnimationFrame(l):typeof s=="number"&&cb===null&&(l(),nT=null,cb=setTimeout(()=>{nT?l():(cb=null,$0=null)},s))}}});var Sct={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Oct=Ac({name:"eventSettings",initialState:Sct,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:DRr}=Oct.actions,LRr=Oct.reducer,$Rr=Jrt({brush:wAr,cartesianAxis:dAr,chartData:Ljr,errorBars:xIr,eventSettings:LRr,graphicalItems:UNr,layout:Z0r,legend:nSr,options:Ijr,polarAxis:lNr,polarOptions:RRr,referenceElements:_Ar,renderedTicks:UAr,rootProps:TRr,tooltip:HEr,zIndex:bjr}),FRr=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return x0r({reducer:$Rr,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([dct.middleware,fct.middleware,y9.middleware,bct.middleware,wct.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(Sat({type:"raf"}))},devTools:{serialize:{replacer:jRr},name:"recharts-".concat(r)}})};function zRr(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=ud(),a=b.useRef(null);if(s)return r;a.current==null&&(a.current=FRr(t,n));var i=che;return b.createElement(lnt,{context:i,store:a.current},r)}function BRr(e){var{layout:t,margin:r}=e,n=Uo(),s=ud();return b.useEffect(()=>{s||(n(Q0r(t)),n(H0r(r)))},[n,s,t,r]),null}var URr=b.memo(BRr,t9);function VRr(e){var t=Uo();return b.useEffect(()=>{t(NRr(e))},[t,e]),null}var qRr=e=>{var t=Uo();return b.useEffect(()=>{t(DRr(e))},[t,e]),null},HRr=b.memo(qRr,t9);function sIe(e){var{zIndex:t,isPanorama:r}=e,n=b.useRef(null),s=Uo();return b.useLayoutEffect(()=>(n.current&&s(vjr({zIndex:t,element:n.current,isPanorama:r})),()=>{s(yjr({zIndex:t,isPanorama:r}))}),[s,t,r]),b.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function aIe(e){var{children:t,isPanorama:r}=e,n=en(ojr);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(sIe,{key:i,zIndex:i,isPanorama:r})),t,a.map(i=>b.createElement(sIe,{key:i,zIndex:i,isPanorama:r})))}var QRr=["children"];function WRr(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}function x4(){return x4=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},x4.apply(null,arguments)}var ZRr={width:"100%",height:"100%",display:"block"},YRr=b.forwardRef((e,t)=>{var r=Hat(),n=Qat(),s=nit();if(!og(r)||!og(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(jst,x4({},i,{title:l,desc:c,role:d,tabIndex:u,width:r,height:n,style:ZRr,ref:t}),a)}),XRr=e=>{var{children:t}=e,r=en(Yz);if(!r)return null;var{width:n,height:s,y:a,x:i}=r;return b.createElement(jst,{width:n,height:s,x:i,y:a},t)},iIe=b.forwardRef((e,t)=>{var{children:r}=e,n=WRr(e,QRr),s=ud();return s?b.createElement(XRr,null,b.createElement(aIe,{isPanorama:!0},r)):b.createElement(YRr,x4({ref:t},n),b.createElement(aIe,{isPanorama:!1},r))});function KRr(){var e=Uo(),[t,r]=b.useState(null),n=en(cwr);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;zs(a)&&a!==n&&e(G0r(a))}},[t,e,n]),r}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 JRr(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){ePr(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 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 Yb(){return Yb=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},Yb.apply(null,arguments)}var nPr=()=>(Qjr(),null);function w4(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var sPr=b.forwardRef((e,t)=>{var r,n,s=b.useRef(null),[a,i]=b.useState({containerWidth:w4((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:w4((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:v,height:x}=g.contentRect;l(v,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(gP,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Yb({ref:c},e)))}),aPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,a]=b.useState({containerWidth:w4(r),containerHeight:w4(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(gP,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Yb({ref:l},e)))}),iPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return b.createElement(b.Fragment,null,b.createElement(gP,{width:r,height:n}),b.createElement("div",Yb({ref:t},e)))}),oPr=b.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?b.createElement(aPr,Yb({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?b.createElement(iPr,Yb({},e,{width:r,height:n,ref:t})):b.createElement(b.Fragment,null,b.createElement(gP,{width:r,height:n}),b.createElement("div",Yb({ref:t},e)))});function lPr(e){return e?sPr:oPr}var cPr=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:v,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,k=b.useRef(null),_=Uo(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=KRr(),P=mhe(),R=P?.width>0?P.width:x,z=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]),U=b.useCallback(ie=>{_(uct(ie)),_(Xf({handler:a,reactEvent:ie}))},[_,a]),F=b.useCallback(ie=>{_(Uae(ie)),_(Xf({handler:u,reactEvent:ie}))},[_,u]),B=b.useCallback(ie=>{_(alt()),_(Xf({handler:d,reactEvent:ie}))},[_,d]),H=b.useCallback(ie=>{_(Uae(ie)),_(Xf({handler:f,reactEvent:ie}))},[_,f]),W=b.useCallback(()=>{_(gct())},[_]),L=b.useCallback(()=>{_(vct())},[_]),Y=b.useCallback(ie=>{_(mct(ie.key))},[_]),q=b.useCallback(ie=>{_(Xf({handler:i,reactEvent:ie}))},[_,i]),M=b.useCallback(ie=>{_(Xf({handler:l,reactEvent:ie}))},[_,l]),Q=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]),ne=b.useCallback(ie=>{S&&_(xct(ie)),_(Xf({handler:m,reactEvent:ie}))},[_,S,m]),ee=b.useCallback(ie=>{_(Xf({handler:p,reactEvent:ie}))},[_,p]),re=lPr(w);return b.createElement(_lt.Provider,{value:E},b.createElement(ybr.Provider,{value:j},b.createElement(re,{width:R??v?.width,height:z??v?.height,className:ya("recharts-wrapper",n),style:JRr({position:"relative",cursor:"default",width:R,height:z},v),onClick:U,onContextMenu:q,onDoubleClick:M,onFocus:W,onBlur:L,onKeyDown:Y,onMouseDown:Q,onMouseEnter:F,onMouseLeave:B,onMouseMove:H,onMouseUp:G,onTouchEnd:ee,onTouchMove:ne,onTouchStart:J,ref:D},b.createElement(nPr,null),r)))}),uPr=["width","height","responsive","children","className","style","compact","title","desc"];function dPr(e,t){if(e==null)return{};var r,n,s=fPr(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 fPr(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 hPr=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=dPr(e,uPr),h=ag(f);return c?b.createElement(b.Fragment,null,b.createElement(gP,{width:r,height:n}),b.createElement(iIe,{otherAttributes:h,title:u,desc:d},a)):b.createElement(cPr,{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(iIe,{otherAttributes:h,title:u,desc:d,ref:t},b.createElement(CAr,null,a)))});function Vae(){return Vae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vae.apply(null,arguments)}function 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 pPr(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){mPr(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 mPr(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=vPr(e,"string");return typeof t=="symbol"?t:t+""}function vPr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yPr={top:5,right:5,bottom:5,left:5},bPr=pPr({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:yPr,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Sct),xPr=b.forwardRef(function(t,r){var n,s=cd(t.categoricalChartProps,bPr),{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(zRr,{preloadedState:{options:d},reduxStoreName:(n=u.id)!==null&&n!==void 0?n:a},b.createElement(xAr,{chartData:u.data}),b.createElement(URr,{layout:s.layout,margin:s.margin}),b.createElement(HRr,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(VRr,{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(hPr,Vae({},s,{ref:r})))}),wPr=["axis"],SPr=b.forwardRef((e,t)=>b.createElement(xPr,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:wPr,tooltipPayloadSearcher:Njr,categoricalChartProps:e,ref:t}));function OPr(e,t){const r=getComputedStyle(e),n=parseFloat(r.fontSize);return t*n}function kPr(e,t){const r=getComputedStyle(e.ownerDocument.body),n=parseFloat(r.fontSize);return t*n}function _Pr(e){return e/100*window.innerHeight}function EPr(e){return e/100*window.innerWidth}function CPr(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 qT({groupSize:e,panelElement:t,styleProp:r}){let n;const[s,a]=CPr(r);switch(a){case"%":{n=s/100*e;break}case"px":{n=s;break}case"rem":{n=kPr(t,s);break}case"em":{n=OPr(t,s);break}case"vh":{n=_Pr(s);break}case"vw":{n=EPr(s);break}}return n}function Hu(e){return parseFloat(e.toFixed(3))}function Z_({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 qae(e){const{panels:t}=e,r=Z_({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=qT({groupSize:r,panelElement:s,styleProp:a.collapsedSize});i=Hu(d/r*100)}let l;if(a.defaultSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.defaultSize});l=Hu(d/r*100)}let c=0;if(a.minSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.minSize});c=Hu(d/r*100)}let u=100;if(a.maxSize!==void 0){const d=qT({groupSize:r,panelElement:s,styleProp:a.maxSize});u=Hu(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 Ea(e,t="Assertion error"){if(!e)throw Error(t)}function Hae(e,t){return Array.from(t).sort(e==="horizontal"?jPr:TPr)}function jPr(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function TPr(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function kct(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function _ct(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 NPr({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}=_ct(n,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return Ea(s,"No rect found"),s}let GD;function APr(){return GD===void 0&&(typeof matchMedia=="function"?GD=!!matchMedia("(pointer:coarse)").matches:GD=!1),GD}function Ect(e){const{element:t,orientation:r,panels:n,separators:s}=e,a=Hae(r,Array.from(t.children).filter(kct).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 v=n.find(x=>x.element===g);if(v){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=NPr({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=APr()?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:Z_({group:e}),panels:[h,v],separator:"width"in k?void 0:k,rect:_}),l=!1}}c=!1,h=v,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const v=s.find(x=>x.element===g);v?p.push(v):(h=void 0,p=[])}else c=!0}return i}let Cct=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)}}},Bm=new Map;const jct=new Cct;function IPr(e){Bm=new Map(Bm),Bm.delete(e)}function cIe(e,t){for(const[r]of Bm)if(r.id===e)return r}function Xb(e,t){for(const[r,n]of Bm)if(r.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function v1(){return Bm}function Npe(e,t){return jct.addListener("groupChange",r=>{r.group.id===e&&t(r)})}function ny(e,t){const r=Bm.get(e);Bm=new Map(Bm),Bm.set(e,t),jct.emit("groupChange",{group:e,prev:r,next:t})}function RPr(e,t,r){let n,s={x:1/0,y:1/0};for(const a of t){const i=_ct(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 PPr(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function MPr(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:fIe(e),b:fIe(t)};let n;for(;r.a.at(-1)===r.b.at(-1);)n=r.a.pop(),r.b.pop();Ea(n,"Stacking order can only be calculated for elements with a common ancestor");const s={a:dIe(uIe(r.a)),b:dIe(uIe(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 DPr=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function LPr(e){const t=getComputedStyle(Tct(e)??e).display;return t==="flex"||t==="inline-flex"}function $Pr(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||LPr(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"||DPr.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function uIe(e){let t=e.length;for(;t--;){const r=e[t];if(Ea(r,"Missing node"),$Pr(r))return r}return null}function dIe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function fIe(e){const t=[];for(;e;)t.push(e),e=Tct(e);return t}function Tct(e){const{parentNode:t}=e;return PPr(t)?t.host:t}function FPr(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 zPr({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!kct(r)||r.contains(e)||e.contains(r))return!0;if(MPr(r,e)>0){let n=r;for(;n;){if(n.contains(e))return!0;if(FPr(n.getBoundingClientRect(),t))return!1;n=n.parentElement}}return!0}function Ape(e,t){const r=[];return t.forEach((n,s)=>{if(s.disabled)return;const a=Ect(s),i=RPr(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&zPr({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&r.push(i.hitRegion)}),r}function BPr(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 Zc(e,t,r=0){return Math.abs(Hu(e)-Hu(t))<=r}function bm(e,t){return Zc(e,t)?0:e>t?1:-1}function pk({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:n}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return r;if(bm(n,c)<0)if(a){const u=(s+c)/2;bm(n,u)<0?n=s:n=c}else n=c;return n=Math.min(l,n),n=Hu(n),n}function cI({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:s,trigger:a}){if(Zc(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=n;Ea(d!=null,"Invalid first pivot index"),Ea(f!=null,"Invalid second pivot index");let h=0;switch(a){case"keyboard":{{const g=e<0?f:d,v=r[g];Ea(v,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=v;if(w){const k=l[g];if(Ea(k!=null,`Previous layout not found for panel index ${g}`),Zc(k,x)){const _=S-k;bm(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}{const g=e<0?d:f,v=r[g];Ea(v,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=v;if(w){const k=l[g];if(Ea(k!=null,`Previous layout not found for panel index ${g}`),Zc(k,S)){const _=k-x;bm(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}break}default:{const g=e<0?f:d,v=r[g];Ea(v,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:k}=v;if(w&&bm(x,k)<0)if(e>0){const _=k-S,E=_/2,T=x+e;bm(T,k)<0&&(e=bm(e,E)<=0?0:_)}else{const _=k-S,E=100-_/2,T=x-e;bm(T,k)<0&&(e=bm(100+e,E)>0?0:-_)}break}}{const g=e<0?1:-1;let v=e<0?f:d,x=0;for(;;){const S=l[v];Ea(S!=null,`Previous layout not found for panel index ${v}`);const k=pk({overrideDisabledPanels:i,panelConstraints:r[v],prevSize:S,size:100})-S;if(x+=k,v+=g,v<0||v>=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 v=Math.abs(e)-Math.abs(h),x=l[g];Ea(x!=null,`Previous layout not found for panel index ${g}`);const w=x-v,S=pk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:x,size:w});if(!Zc(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(BPr(c,u))return s;{const g=e<0?f:d,v=l[g];Ea(v!=null,`Previous layout not found for panel index ${g}`);const x=v+h,w=pk({overrideDisabledPanels:i,panelConstraints:r[g],prevSize:v,size:x});if(u[g]=w,!Zc(w,x)){let S=x-w,k=e<0?f:d;for(;k>=0&&k<r.length;){const _=u[k];Ea(_!=null,`Previous layout not found for panel index ${k}`);const E=_+S,T=pk({overrideDisabledPanels:i,panelConstraints:r[k],prevSize:_,size:E});if(Zc(_,T)||(S-=T-_,u[k]=T),Zc(S,0))break;e>0?k--:k++}}}const p=Object.values(u).reduce((g,v)=>v+g,0);if(!Zc(p,100,.1))return s;const m=Object.keys(s);return u.reduce((g,v,x)=>(g[m[x]]=v,g),{})}function TS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||bm(e[r],t[r])!==0)return!1;return!0}function NS({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(!Zc(s,100)&&n.length>0)for(let l=0;l<t.length;l++){const c=n[l];Ea(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];Ea(c!=null,`No layout data found for index ${l}`);const u=n[l];Ea(u!=null,`No layout data found for index ${l}`);const d=pk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,n[l]=d)}if(!Zc(a,0))for(let l=0;l<t.length;l++){const c=n[l];Ea(c!=null,`No layout data found for index ${l}`);const u=c+a,d=pk({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,n[l]=d,Zc(a,0)))break}const i=Object.keys(e);return n.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function Nct({groupId:e,panelId:t}){const r=()=>{const l=v1();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),v=g===f.panels.length-1,x=cI({delta:v?c-l:l-c,initialLayout:p,panelConstraints:d,pivotIndices:v?[g-1,g]:[g,g+1],prevLayout:p,trigger:"imperative-api"}),w=NS({layout:x,panelConstraints:d});TS(p,w)||ny(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&&Zc(c,u)},resize:l=>{const{group:c}=r(),{element:u}=s(),d=Z_({group:c}),f=qT({groupSize:d,panelElement:u,styleProp:l}),h=Hu(f/d*100);i(h)}}}function hIe(e){if(e.defaultPrevented)return;const t=v1();Ape(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=Nct({groupId:r.group.id,panelId:n.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function S$(e){const t=v1();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 Act({groupId:e}){const t=()=>{const r=v1();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=NS({layout:r,panelConstraints:s});return n?l:(TS(l,u)||ny(a,{defaultLayoutDeferred:n,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function F0(e,t){const r=S$(e),n=Xb(r.id,!0),s=r.separators.find(d=>d.element===e);Ea(s,"Matching separator not found");const a=n.separatorToPanels.get(s);Ea(a,"Matching panels not found");const i=a.map(d=>r.panels.indexOf(d)),l=Act({groupId:r.id}).getLayout(),c=cI({delta:t,initialLayout:l,panelConstraints:n.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=NS({layout:c,panelConstraints:n.derivedPanelConstraints});TS(l,u)||ny(r,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,groupSize:n.groupSize,layout:u,separatorToPanels:n.separatorToPanels})}function pIe(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=S$(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&F0(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&F0(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&F0(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&F0(t,-5);break}case"End":{e.preventDefault(),F0(t,100);break}case"Enter":{e.preventDefault();const n=S$(t),s=Xb(n.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=n.separators.find(h=>h.element===t);Ea(c,"Matching separator not found");const u=l.get(c);Ea(u,"Matching panels not found");const d=u[0],f=a.find(h=>h.panelId===d.id);if(Ea(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;F0(t,p-h)}break}case"F6":{e.preventDefault();const n=S$(t).separators.map(i=>i.element),s=Array.from(n).findIndex(i=>i===e.currentTarget);Ea(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(),F0(t,-100);break}}}let Kk={cursorFlags:0,state:"inactive"};const Ipe=new Cct;function AS(){return Kk}function UPr(e){return Ipe.addListener("change",e)}function VPr(e){const t=Kk,r={...Kk};r.cursorFlags=e,Kk=r,Ipe.emit("change",{prev:t,next:r})}function Jk(e){const t=Kk;Kk=e,Ipe.emit("change",{prev:t,next:e})}function mIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=v1(),r=Ape(e,t),n=new Map;let s=!1;r.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&n.set(a.group,i.layout)}),Jk({cursorFlags:0,hitRegions:r,initialLayoutMap:n,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),r.length&&e.preventDefault()}const qPr=e=>e,WH=()=>{},Ict=1,Rct=2,Pct=4,Mct=8,gIe=3,vIe=12;let ZD;function yIe(){return ZD===void 0&&(ZD=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ZD=!0)),ZD}function HPr({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&&yIe()){const a=(e&Ict)!==0,i=(e&Rct)!==0,l=(e&Pct)!==0,c=(e&Mct)!==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 yIe()?n>0&&s>0?"move":n>0?"ew-resize":"ns-resize":n>0&&s>0?"grab":n>0?"col-resize":"row-resize"}}const bIe=new WeakMap;function Rpe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=bIe.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(r));const n=AS();switch(n.state){case"active":case"hover":{const s=HPr({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}}bIe.set(e,{prevStyle:t,styleSheet:r})}function Dct({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 v=n.get(d),x=s.get(d);if(!v||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:_,separatorToPanels:E}=x;if(S&&_&&E){const T=cI({delta:g,initialLayout:v,panelConstraints:S,pivotIndices:u.panels.map(j=>p.indexOf(j)),prevLayout:_,trigger:"mouse-or-touch"});if(TS(T,_)){if(g!==0&&!m)switch(h){case"horizontal":{l|=g<0?Ict:Rct;break}case"vertical":{l|=g<0?Pct:Mct;break}}}else ny(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:k,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&gIe:c|=l&gIe,t.movementY===0?c|=i&vIe:c|=l&vIe,VPr(c),Rpe(e)}function xIe(e){const t=v1(),r=AS();r.state==="active"&&Dct({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:t,prevCursorFlags:r.cursorFlags})}function wIe(e){if(e.defaultPrevented)return;const t=AS(),r=v1();switch(t.state){case"active":{if(e.buttons===0){Jk({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(n=>{const s=Xb(n.group.id,!0);ny(n.group,s)});return}Dct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const n=Ape(e,r);n.length===0?t.state!=="inactive"&&Jk({cursorFlags:0,state:"inactive"}):Jk({cursorFlags:0,hitRegions:n,state:"hover"}),Rpe(e.currentTarget);break}}}function SIe(e){e.relatedTarget instanceof HTMLIFrameElement&&AS().state==="hover"&&Jk({cursorFlags:0,state:"inactive"})}function OIe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=AS();t.state==="active"&&(Jk({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Rpe(e.currentTarget),t.hitRegions.forEach(r=>{const n=Xb(r.group.id,!0);ny(r.group,n)}),e.preventDefault()))}function kIe(e){let t=0,r=0;const n={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=Hu(a.defaultSize);r+=i,n[a.panelId]=i}else n[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=Hu((100-r)/s);for(const i of e)i.defaultSize===void 0&&(n[i.panelId]=a)}return n}function QPr(e,t,r){if(!r[0])return;const n=e.panels.find(c=>c.element===t);if(!n||!n.onResize)return;const s=Z_({group:e}),a=e.orientation==="horizontal"?n.element.offsetWidth:n.element.offsetHeight,i=n.mutableValues.prevSize,l={asPercentage:Hu(a/s*100),inPixels:a};n.mutableValues.prevSize=l,n.onResize(l,n.id,i)}function WPr(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 GPr({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=Hu(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]=Hu(h/a*u)}else{const f=Hu(u/c.length);for(const h of c)d[h]=f}return d}function ZPr(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 SO=new Map;function YPr(e){let t=!0;Ea(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:v,target:x}=g;if(x===e.element){if(t){const w=Z_({group:e});if(w===0)return;const S=Xb(e.id);if(!S)return;const k=qae(e),_=S.defaultLayoutDeferred?kIe(k):S.layout,E=GPr({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:_}),T=NS({layout:E,panelConstraints:k});if(!S.defaultLayoutDeferred&&TS(S.layout,T)&&WPr(S.derivedPanelConstraints,k)&&S.groupSize===w)return;ny(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:k,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else QPr(e,x,v)}});a.observe(e.element),e.panels.forEach(m=>{Ea(!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=Z_({group:e}),l=qae(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(ZPr(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??kIe(l),f=NS({layout:d,panelConstraints:l}),h=e.element.ownerDocument;SO.set(h,(SO.get(h)??0)+1);const p=new Map;return Ect(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),ny(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:p}),e.separators.forEach(m=>{Ea(!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",pIe)}),SO.get(h)===1&&(h.addEventListener("dblclick",hIe,!0),h.addEventListener("pointerdown",mIe,!0),h.addEventListener("pointerleave",xIe),h.addEventListener("pointermove",wIe),h.addEventListener("pointerout",SIe),h.addEventListener("pointerup",OIe,!0)),function(){t=!1,SO.set(h,Math.max(0,(SO.get(h)??0)-1)),IPr(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",pIe)}),SO.get(h)||(h.removeEventListener("dblclick",hIe,!0),h.removeEventListener("pointerdown",mIe,!0),h.removeEventListener("pointerleave",xIe),h.removeEventListener("pointermove",wIe),h.removeEventListener("pointerout",SIe),h.removeEventListener("pointerup",OIe,!0)),a.disconnect()}}function XPr(){const[e,t]=b.useState({}),r=b.useCallback(()=>t({}),[]);return[e,r]}function Ppe(e){const t=b.useId();return`${e??t}`}const y1=typeof window<"u"?b.useLayoutEffect:b.useEffect;function jN(e){const t=b.useRef(e);return y1(()=>{t.current=e},[e]),b.useCallback((...r)=>t.current?.(...r),[t])}function Mpe(...e){return jN(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Dpe(e){const t=b.useRef({...e});return y1(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Lct=b.createContext(null);function KPr(e,t){const r=b.useRef({getLayout:()=>({}),setLayout:qPr});b.useImperativeHandle(t,()=>r.current,[]),y1(()=>{Object.assign(r.current,Act({groupId:e}))})}function b9({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=jN(P=>{TS(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),v=jN(P=>{TS(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=Ppe(l),w=b.useRef(null),[S,k]=XPr(),_=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=Mpe(w,a);KPr(x,i);const T=jN((P,R)=>{const z=AS(),D=cIe(P),U=Xb(P);if(U){let F=!1;return z.state==="active"&&(F=z.hitRegions.some(B=>B.group===D)),{flexGrow:U.layout[R]??1,pointerEvents:F?"none":void 0}}return{flexGrow:r?.[R]??1}}),j=Dpe({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=Hae(d,[...R.panels,P]),k(),()=>{R.panels=R.panels.filter(z=>z!==P),k()}},registerSeparator:P=>{const R=_.current;return R.separators=Hae(d,[...R.separators,P]),k(),()=>{R.separators=R.separators.filter(z=>z!==P),k()}},togglePanelDisabled:(P,R)=>{const z=_.current.panels.find(F=>F.id===P);z&&(z.panelConstraints.disabled=R);const D=cIe(x),U=Xb(x);D&&U&&ny(D,{...U,derivedPanelConstraints:qae(D)})},toggleSeparatorDisabled:(P,R)=>{const z=_.current.separators.find(D=>D.id===P);z&&(z.disabled=R)}}),[T,x,k,d,j]),I=b.useRef(null);return y1(()=>{const P=w.current;if(P===null)return;const R=_.current;let z;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){z={};for(const L of R.panels){const Y=j.defaultLayout[L.id];Y!==void 0&&(z[L.id]=Y)}}const D={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:z,disableCursor:!!j.disableCursor,expandedPanelSizes:_.current.lastExpandedPanelSizes,layouts:_.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=D;const U=YPr(D),{defaultLayoutDeferred:F,derivedPanelConstraints:B,layout:H}=Xb(D.id,!0);!F&&B.length>0&&(g(H),v(H));const W=Npe(x,L=>{const{defaultLayoutDeferred:Y,derivedPanelConstraints:q,layout:M}=L.next;if(Y||q.length===0)return;const Q=D.panels.map(({id:J})=>J).join(",");D.mutableState.layouts[Q]=M,q.forEach(J=>{if(J.collapsible){const{layout:ne}=L.prev??{};if(ne){const ee=Zc(J.collapsedSize,M[J.panelId]),re=Zc(J.collapsedSize,ne[J.panelId]);ee&&!re&&(D.mutableState.expandedPanelSizes[J.panelId]=ne[J.panelId])}}});const G=AS().state!=="active";g(M),G&&v(M)});return()=>{I.current=null,U(),W()}},[s,x,v,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=r,P.mutableState.disableCursor=!!n)}),o.jsx(Lct.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})})}b9.displayName="Group";function GH(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function Lpe({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...n}){const s=t!==void 0,a="id"in n?n.id:n.groupId,i=GH(a,t??[]),l=b.useSyncExternalStore(JPr,()=>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=GH(a,Object.keys(p)):m=GH(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 JPr(){return function(){}}function $pe(){const e=b.useContext(Lct);return Ea(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function eMr(e,t){const{id:r}=$pe(),n=b.useRef({collapse:WH,expand:WH,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:WH});b.useImperativeHandle(t,()=>n.current,[]),y1(()=>{Object.assign(n.current,Nct({groupId:r,panelId:e}))})}function Y_({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,v=Ppe(c),x=Dpe({disabled:a}),w=b.useRef(null),S=Mpe(w,i),{getPanelStyles:k,id:_,orientation:E,registerPanel:T,togglePanelDisabled:j}=$pe(),N=f!==null,I=jN((R,z,D)=>{f?.(R,c,D)});y1(()=>{const R=w.current;if(R!==null){const z={element:R,id:v,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(z)}},[l,r,n,s,N,v,g,u,d,I,T,x]),b.useEffect(()=>{j(v,!!a)},[a,v,j]),eMr(v,h);const P=b.useSyncExternalStore(R=>Npe(_,R),()=>JSON.stringify(k(_,v)),()=>JSON.stringify(k(_,v)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":v,id:v,ref:S,style:{...tMr,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})})}Y_.displayName="Panel";const tMr={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function rMr(){return b.useRef(null)}function nMr({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=NS({layout:cI({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r],s=NS({layout:cI({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:s,valueMin:a,valueNow:i}}function $ct({children:e,className:t,disabled:r,elementRef:n,id:s,style:a,...i}){const l=Ppe(s),c=Dpe({disabled:r}),[u,d]=b.useState({}),[f,h]=b.useState("inactive"),p=b.useRef(null),m=Mpe(p,n),{disableCursor:g,id:v,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=$pe(),k=x==="horizontal"?"vertical":"horizontal";y1(()=>{const E=p.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=UPr(P=>{h(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=Npe(v,P=>{const{derivedPanelConstraints:R,layout:z,separatorToPanels:D}=P.next,U=D.get(T);if(U){const F=U[0],B=U.indexOf(F);d(nMr({layout:z,panelConstraints:R,panelId:F.id,panelIndex:B}))}});return()=>{N(),I(),j()}}},[v,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})}$ct.displayName="Separator";const Wl={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},NP="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",sMr="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",aMr="rounded-md",Fpe="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",zpe="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",Bpe="disabled:opacity-50 disabled:cursor-not-allowed";function Fct(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=Fct(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function zct(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Fct(e))&&(n&&(n+=" "),n+=t);return n}const iMr=(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},oMr=(e,t)=>({classGroupId:e,validator:t}),Bct=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),S4="-",_Ie=[],lMr="arbitrary..",cMr=e=>{const t=dMr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return uMr(i);const l=i.split(S4),c=l[0]===""&&l.length>1?1:0;return Uct(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],u=r[i];return c?u?iMr(u,c):c:u||_Ie}return r[i]||_Ie}}},Uct=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const u=Uct(e,t+1,a);if(u)return u}const i=r.validators;if(i===null)return;const l=t===0?e.join(S4):e.slice(t).join(S4),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},uMr=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?lMr+n:void 0})(),dMr=e=>{const{theme:t,classGroups:r}=e;return fMr(r,t)},fMr=(e,t)=>{const r=Bct();for(const n in e){const s=e[n];Upe(s,r,n,t)}return r},Upe=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];hMr(i,t,r,n)}},hMr=(e,t,r,n)=>{if(typeof e=="string"){pMr(e,t,r);return}if(typeof e=="function"){mMr(e,t,r,n);return}gMr(e,t,r,n)},pMr=(e,t,r)=>{const n=e===""?t:Vct(t,e);n.classGroupId=r},mMr=(e,t,r,n)=>{if(vMr(e)){Upe(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(oMr(r,e))},gMr=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];Upe(c,Vct(t,l),r,n)}},Vct=(e,t)=>{let r=e;const n=t.split(S4),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=Bct(),r.nextPart.set(i,l)),r=l}return r},vMr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,yMr=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)}}},Qae="!",EIe=":",bMr=[],CIe=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),xMr=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 v=s[g];if(i===0&&l===0){if(v===EIe){a.push(s.slice(c,g)),c=g+1;continue}if(v==="/"){u=g;continue}}v==="["?i++:v==="]"?i--:v==="("?l++:v===")"&&l--}const f=a.length===0?s:s.slice(c);let h=f,p=!1;f.endsWith(Qae)?(h=f.slice(0,-1),p=!0):f.startsWith(Qae)&&(h=f.slice(1),p=!0);const m=u&&u>c?u-c:void 0;return CIe(a,p,h,m)};if(t){const s=t+EIe,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):CIe(bMr,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},wMr=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}},SMr=e=>({cache:yMr(e.cacheSize),parseClassName:xMr(e),sortModifiers:wMr(e),...cMr(e)}),OMr=/\s+/,kMr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(OMr);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 v=!!g,x=n(v?m.substring(0,g):m);if(!x){if(!v){c=d+(c.length>0?" "+c:c);continue}if(x=n(m),!x){c=d+(c.length>0?" "+c:c);continue}v=!1}const w=h.length===0?"":h.length===1?h[0]:a(h).join(":"),S=p?w+Qae:w,k=S+x;if(i.indexOf(k)>-1)continue;i.push(k);const _=s(x,v);for(let E=0;E<_.length;++E){const T=_[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},_Mr=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=qct(r))&&(s&&(s+=" "),s+=n);return s},qct=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=qct(e[n]))&&(r&&(r+=" "),r+=t);return r},jIe=(e,...t)=>{let r,n,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return r=SMr(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=kMr(c,r);return s(c,d),d};return a=i,(...c)=>a(_Mr(...c))},EMr=[],Wo=e=>{const t=r=>r[e]||EMr;return t.isThemeGetter=!0,t},Hct=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qct=/^\((?:(\w[\w-]*):)?(.+)\)$/i,CMr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jMr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TMr=/\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$/,NMr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AMr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,IMr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ub=e=>CMr.test(e),Un=e=>!!e&&!Number.isNaN(Number(e)),db=e=>!!e&&Number.isInteger(Number(e)),ZH=e=>e.endsWith("%")&&Un(e.slice(0,-1)),sv=e=>jMr.test(e),Wct=()=>!0,RMr=e=>TMr.test(e)&&!NMr.test(e),Vpe=()=>!1,PMr=e=>AMr.test(e),MMr=e=>IMr.test(e),DMr=e=>!yr(e)&&!kr(e),LMr=e=>n0(e,Yct,Vpe),yr=e=>Hct.test(e),z0=e=>n0(e,Xct,RMr),TIe=e=>n0(e,HMr,Un),$Mr=e=>n0(e,Jct,Wct),FMr=e=>n0(e,Kct,Vpe),NIe=e=>n0(e,Gct,Vpe),zMr=e=>n0(e,Zct,MMr),YD=e=>n0(e,eut,PMr),kr=e=>Qct.test(e),sT=e=>b1(e,Xct),BMr=e=>b1(e,Kct),AIe=e=>b1(e,Gct),UMr=e=>b1(e,Yct),VMr=e=>b1(e,Zct),XD=e=>b1(e,eut,!0),qMr=e=>b1(e,Jct,!0),n0=(e,t,r)=>{const n=Hct.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},b1=(e,t,r=!1)=>{const n=Qct.exec(e);return n?n[1]?t(n[1]):r:!1},Gct=e=>e==="position"||e==="percentage",Zct=e=>e==="image"||e==="url",Yct=e=>e==="length"||e==="size"||e==="bg-size",Xct=e=>e==="length",HMr=e=>e==="number",Kct=e=>e==="family-name",Jct=e=>e==="number"||e==="weight",eut=e=>e==="shadow",IIe=()=>{const e=Wo("color"),t=Wo("font"),r=Wo("text"),n=Wo("font-weight"),s=Wo("tracking"),a=Wo("leading"),i=Wo("breakpoint"),l=Wo("container"),c=Wo("spacing"),u=Wo("radius"),d=Wo("shadow"),f=Wo("inset-shadow"),h=Wo("text-shadow"),p=Wo("drop-shadow"),m=Wo("blur"),g=Wo("perspective"),v=Wo("aspect"),x=Wo("ease"),w=Wo("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,yr],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[kr,yr,c],N=()=>[ub,"full","auto",...j()],I=()=>[db,"none","subgrid",kr,yr],P=()=>["auto",{span:["full",db,kr,yr]},db,kr,yr],R=()=>[db,"auto",kr,yr],z=()=>["auto","min","max","fr",kr,yr],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...j()],B=()=>[ub,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[ub,"screen","full","dvw","lvw","svw","min","max","fit",...j()],W=()=>[ub,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,kr,yr],Y=()=>[...k(),AIe,NIe,{position:[kr,yr]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",UMr,LMr,{size:[kr,yr]}],Q=()=>[ZH,sT,z0],G=()=>["","none","full",u,kr,yr],J=()=>["",Un,sT,z0],ne=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Un,ZH,AIe,NIe],ie=()=>["","none",m,kr,yr],ce=()=>["none",Un,kr,yr],K=()=>["none",Un,kr,yr],ae=()=>[Un,kr,yr],le=()=>[ub,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sv],breakpoint:[sv],color:[Wct],container:[sv],"drop-shadow":[sv],ease:["in","out","in-out"],font:[DMr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sv],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sv],shadow:[sv],spacing:["px",Un],text:[sv],"text-shadow":[sv],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ub,yr,kr,v]}],container:["container"],columns:[{columns:[Un,yr,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:[db,"auto",kr,yr]}],basis:[{basis:[ub,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Un,ub,"auto","initial","none",yr]}],grow:[{grow:["",Un,kr,yr]}],shrink:[{shrink:["",Un,kr,yr]}],order:[{order:[db,"first","last","none",kr,yr]}],"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":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],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:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[l,"screen",...B()]}],"min-w":[{"min-w":[l,"screen","none",...B()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",r,sT,z0]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,qMr,$Mr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ZH,yr]}],"font-family":[{font:[BMr,FMr,t]}],"font-features":[{"font-features":[yr]}],"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,yr]}],"line-clamp":[{"line-clamp":[Un,"none",kr,TIe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",kr,yr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kr,yr]}],"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:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Un,"from-font","auto",kr,z0]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Un,"auto",kr,yr]}],"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,yr]}],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,yr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},db,kr,yr],radial:["",kr,yr],conic:[db,kr,yr]},VMr,zMr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"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:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"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:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Un,kr,yr]}],"outline-w":[{outline:["",Un,sT,z0]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,XD,YD]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,XD,YD]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Un,z0]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,XD,YD]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Un,kr,yr]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":[Un]}],"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,yr]}],"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":[Un]}],"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:Y()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kr,yr]}],filter:[{filter:["","none",kr,yr]}],blur:[{blur:ie()}],brightness:[{brightness:[Un,kr,yr]}],contrast:[{contrast:[Un,kr,yr]}],"drop-shadow":[{"drop-shadow":["","none",p,XD,YD]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Un,kr,yr]}],"hue-rotate":[{"hue-rotate":[Un,kr,yr]}],invert:[{invert:["",Un,kr,yr]}],saturate:[{saturate:[Un,kr,yr]}],sepia:[{sepia:["",Un,kr,yr]}],"backdrop-filter":[{"backdrop-filter":["","none",kr,yr]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Un,kr,yr]}],"backdrop-contrast":[{"backdrop-contrast":[Un,kr,yr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Un,kr,yr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Un,kr,yr]}],"backdrop-invert":[{"backdrop-invert":["",Un,kr,yr]}],"backdrop-opacity":[{"backdrop-opacity":[Un,kr,yr]}],"backdrop-saturate":[{"backdrop-saturate":[Un,kr,yr]}],"backdrop-sepia":[{"backdrop-sepia":["",Un,kr,yr]}],"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,yr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Un,"initial",kr,yr]}],ease:[{ease:["linear","initial",x,kr,yr]}],delay:[{delay:[Un,kr,yr]}],animate:[{animate:["none",w,kr,yr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,kr,yr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[kr,yr,"","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,yr]}],"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,yr]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Un,sT,z0,TIe]}],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"]}},QMr=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:s={},override:a={}})=>(HT(e,"cacheSize",t),HT(e,"prefix",r),HT(e,"experimentalParseClassName",n),KD(e.theme,a.theme),KD(e.classGroups,a.classGroups),KD(e.conflictingClassGroups,a.conflictingClassGroups),KD(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),HT(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),JD(e.theme,s.theme),JD(e.classGroups,s.classGroups),JD(e.conflictingClassGroups,s.conflictingClassGroups),JD(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),tut(e,s,"orderSensitiveModifiers"),e),HT=(e,t,r)=>{r!==void 0&&(e[t]=r)},KD=(e,t)=>{if(t)for(const r in t)HT(e,r,t[r])},JD=(e,t)=>{if(t)for(const r in t)tut(e,t,r)},tut=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},WMr=(e,...t)=>typeof e=="function"?jIe(IIe,e,...t):jIe(()=>QMr(IIe(),e),...t),GMr=Object.keys({...Mb,...Hzt}),ZMr=Object.keys(Xzt),YMr=Object.keys(Qzt),XMr=Object.keys(Wzt),KMr=Object.keys(qzt),B0=Object.keys(Yzt),JMr=Object.keys(Gzt).concat(Object.keys(Zzt)),e2r=WMr({extend:{theme:{color:GMr,spacing:ZMr,radius:KMr,leading:XMr,shadow:JMr},classGroups:{"font-size":[{text:YMr}],h:[{h:B0}],w:[{w:B0}],size:[{size:B0}],"min-h":[{"min-h":B0}],"min-w":[{"min-w":B0}],"max-h":[{"max-h":B0}],"max-w":[{"max-w":B0}]}}});function Z(...e){return e2r(zct(e))}const t2r={sm:`${Wl.sm} text-ui-sm px-[.75em]`,md:`${Wl.md} text-ui-md px-[.75em]`,default:`${Wl.default} text-ui-md px-[.85em] `,lg:`${Wl.lg} text-ui-lg px-[1em] `},r2r={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:Fpe,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"},n2r=Z("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",Bpe,zpe),s2r={light:"default",outline:"default"};function a2r(e){return s2r[e]??e}function cC(e){const t=a2r(e?.variant||"default"),r=e?.size||"default";return Z(n2r,t2r[r],r2r[t],e?.iconOnly&&"[&>svg]:opacity-75")}function rut(e){const t=[];return Te.Children.forEach(e,r=>{Te.isValidElement(r)&&r.type===Te.Fragment?t.push(...rut(r.props.children)):t.push(r)}),t}function i2r(e){const t=rut(e);return t.length>0&&t.every(r=>Te.isValidElement(r))}const ge=Te.forwardRef(({className:e,as:t,size:r="default",variant:n="default",disabled:s,children:a,...i},l)=>{const c=t||"button",u=i2r(a);return o.jsx(c,{ref:l,disabled:s,className:Z(cC({variant:n,size:r,iconOnly:u}),e),...i,children:a})});ge.displayName="Button";const dd=A3t,Yr=I3t,Xr=R3t,Wr=b.forwardRef(({className:e,sideOffset:t=4,children:r,...n},s)=>o.jsx(P3t,{children:o.jsxs(kqe,{ref:s,sideOffset:t,className:Z("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(M3t,{className:"fill-surface3"})]})}));Wr.displayName=kqe.displayName;const Cn=Te.forwardRef(({tooltipContent:e,...t},r)=>o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ge,{ref:r,...t})}),e&&o.jsx(Wr,{children:e})]}));Cn.displayName="ButtonWithTooltip";const o2r={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"},je=({children:e,className:t,size:r="default",...n})=>o.jsx("span",{className:Z("block",o2r[r],t),...n,children:e}),sn={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"},s0={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},nut=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),O4=({children:e,as:t="a",href:r,className:n,prefetch:s,to:a})=>o.jsx(t,{href:r,prefetch:s,to:a,className:Z("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",sn.colors,n),children:e}),sut=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),k4=({children:e,isActive:t,className:r})=>o.jsx("li",{className:Z("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",sn.colors,"hover:bg-surface3",t&&"bg-accent1Dark",r),children:e}),aut=({onClick:e})=>o.jsx(ge,{variant:"ghost",className:Z("shrink-0 opacity-0",sn.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(je,{children:o.jsx(Kl,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),l2r={"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"},c2r={mono:"font-mono"},ve=({as:e="p",className:t,variant:r="ui-md",font:n,...s})=>o.jsx(e,{className:Z(l2r[r],n&&c2r[n],t),...s}),pa=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"})]}),u2r=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"})]}),qpe=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"})]}),Hpe=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"})]}),a0=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"})}),iut=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)"})})})]}),out=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)"})})})]}),d2r=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"})]}),x9=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"})}),Qpe=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"})}),f2r=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"})}),Pi=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"})}),uC=e=>o.jsx(Uzt,{...e}),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:"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"})}),vl=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"})]}),w9=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 pp(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 lut=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)"})})})]}),h2r=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"})}),p2r=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"})})}),cut=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}})}),m2r=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"})]})]}),g2r=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"})})]}),v2r=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"})}),y2r=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"})]}),b2r=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"})})})]}),RIe=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"})}),x2r=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"})]})}),w2r={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},S2r={warning:$E,destructive:wF,info:DR},Ul=({children:e,variant:t="destructive",className:r})=>{const n=S2r[t];return o.jsx("div",{className:Z(w2r[t],"p-3 rounded-md border shadow-sm",sn.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(je,{className:"mt-0.5 shrink-0",children:o.jsx(n,{})}),o.jsx("div",{className:"text-neutral4",children:e})]})})},Vl=({children:e,as:t="h5"})=>o.jsx(ve,{as:t,variant:"ui-md",className:"font-semibold",children:e}),zu=({children:e,as:t="p"})=>o.jsx(ve,{as:t,variant:"ui-sm",children:e}),O2r={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},uut=({src:e,name:t,size:r="sm",interactive:n=!1})=>o.jsx("div",{className:Z(O2r[r],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",sn.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(ve,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),k2r={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"},_2r={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},gt=({icon:e,variant:t="default",className:r,children:n,...s})=>o.jsxs("div",{className:Z("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",sn.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":k2r[t],r),...s,children:[e&&o.jsx("span",{className:_2r[t],children:o.jsx(je,{children:e})}),n]}),Za=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),Cr=({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:Z("text-ui-md leading-ui-md flex items-center gap-2",sn.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(je,{className:Z("text-neutral2",sn.colors),children:o.jsx(f2r,{})})})]})};function E2r(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 C2r(e){const t=E2r(e);return VWe({override:[j2r(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function j2r(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 T2r=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,N2r=er.mark({class:"cm-variable-highlight"}),PIe=new nWe({regexp:T2r,decoration:()=>N2r}),A2r=Si.fromClass(class{decorations;constructor(e){this.decorations=PIe.createDeco(e)}update(e){this.decorations=PIe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),I2r=A2r,R2r={duration:5e3,cancel:{label:o.jsx(je,{children:o.jsx(Kl,{})}),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 sf(e){const{classNames:t,...r}=R2r,{classNames:n,...s}=e||{};return{...r,classNames:{...t,title:Z(t?.title,n?.title),toast:Z(t?.toast,n?.toast),cancelButton:Z(t?.cancelButton,n?.cancelButton),actionButton:Z(t?.actionButton,n?.actionButton),description:Z(t?.description,n?.description)},...s}}const ze=(e,t={})=>{if(Array.isArray(e))return e.forEach(r=>xc(r,sf(t)));if(Te.isValidElement(e))return xc(e,sf(t));if(typeof e=="string")return xc(e,sf(t));throw new Error("Invalid message type")};ze.success=(e,t={})=>{const r={...t,icon:o.jsx(je,{className:"text-accent1 shrink-0",children:o.jsx($Ft,{})}),classNames:{...t.classNames,toast:Z("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Z("text-xs text-neutral5",t.classNames?.title),description:Z("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return xc.success(e,sf(r));case"object":return e.forEach(n=>xc.success(n,sf(r)))}};ze.error=(e,t={})=>{const r={...t,icon:o.jsx(je,{className:"text-accent2 shrink-0",children:o.jsx(kHe,{})}),classNames:{...t.classNames,toast:Z("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Z("text-xs text-neutral5",t.classNames?.title),description:Z("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return xc.error(e,sf(r));case"object":return e.forEach(n=>xc.error(n,sf(r)))}};ze.warning=(e,t={})=>{const r={...t,icon:o.jsx(je,{className:"text-accent6 shrink-0",children:o.jsx(wF,{})}),classNames:{...t.classNames,toast:Z("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Z("text-xs text-neutral5",t.classNames?.title),description:Z("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return xc.warning(e,sf(r));case"object":return e.forEach(n=>xc.warning(n,sf(r)))}};ze.info=(e,t={})=>{const r={...t,icon:o.jsx(je,{className:"text-accent3 shrink-0",children:o.jsx(DR,{})}),classNames:{...t.classNames,toast:Z("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Z("text-xs text-neutral5",t.classNames?.title),description:Z("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return xc.info(e,sf(r));case"object":return e.forEach(n=>xc.info(n,sf(r)))}};ze.custom=(e,t={})=>xc(e,sf(t));ze.dismiss=e=>{e&&xc.dismiss(e)};ze.promise=({myPromise:e,loadingMessage:t,successMessage:r,errorMessage:n,onSuccess:s,onError:a,options:i={}})=>xc.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),r),error:l=>(a?.(l),n||l?.message||"Error..."),...sf(i)});function pf({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 Xa({content:e,copyMessage:t,tooltip:r="Copy to clipboard",size:n="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=pf({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(ge,{onClick:c,type:"button",size:n,className:s,"aria-label":a?"Copied!":r,children:a?o.jsx(py,{}):o.jsx(EHe,{})})}),o.jsx(Wr,{children:a?"Copied!":r})]})}const Qn=Gue()(kZt(e=>({requestContext:{},theme:"dark",setRequestContext:t=>e({requestContext:t}),setTheme:t=>e({theme:t})}),{name:"mastra-playground-store"})),Wae=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;function P2r(e){return Wae?.addEventListener("change",e),()=>Wae?.removeEventListener("change",e)}function M2r(){return Wae?.matches??!0}function AP(){const e=Qn(r=>r.theme),t=b.useSyncExternalStore(P2r,M2r,()=>!0);return e==="system"?t:e==="dark"}function D2r(){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:[se.className,se.propertyName],color:"var(--neutral6)"},{tag:se.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[se.heading1,se.heading2,se.heading3,se.heading4,se.heading5,se.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:se.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:se.link,color:"var(--accent3)",textDecoration:"underline"},{tag:se.url,color:"var(--accent3)"},{tag:se.monospace,color:"var(--neutral6)"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:se.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 L2r(){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=Vp.define([{tag:[se.comment,se.bracket],color:"var(--neutral2)"},{tag:[se.string,se.meta,se.regexp],color:"var(--accent1)"},{tag:[se.atom,se.bool,se.special(se.variableName)],color:"var(--accent6)"},{tag:[se.keyword,se.operator,se.tagName],color:"var(--accent2)"},{tag:[se.function(se.propertyName),se.propertyName],color:"var(--accent5)"},{tag:[se.definition(se.variableName),se.function(se.variableName),se.className,se.attributeName],color:"var(--accent3)"},{tag:[se.variableName,se.number],color:"var(--accent5)"},{tag:[se.name,se.quote],color:"var(--accent1)"},{tag:se.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[se.heading1,se.heading2,se.heading3,se.heading4,se.heading5,se.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[se.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[se.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:se.link,color:"var(--accent3)",textDecoration:"underline"},{tag:se.url,color:"var(--accent3)"},{tag:se.monospace,color:"var(--neutral6)"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:[se.deleted],color:"var(--accent2)"},{tag:se.invalid,color:"var(--error)"},{tag:[se.standard(se.tagName)],color:"var(--accent1)"}]);return[e,Qx(t)]}const Cy=()=>{const e=AP();return b.useMemo(()=>e?D2r():L2r(),[e])},hs=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=Cy(),g=e?JSON.stringify(e,null,2):t??"",v=b.useMemo(()=>{const x=[];return a==="json"?x.push(Jd):a==="markdown"&&(x.push($ue({base:uS,codeLanguages:dZe})),x.push(ft.lineWrapping)),i&&a==="markdown"&&x.push(I2r),c&&a==="markdown"&&x.push(C2r(c)),f===!1&&x.push(Fn.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Z("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...h,children:[n&&o.jsx(Xa,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(Oc,{ref:p,value:g,theme:m,extensions:v,onChange:r,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function $2r(e,t){const{codeToTokens:r,bundledLanguages:n}=await Ke(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-cqQUVS11.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 Ka({iconSlot:e,titleSlot:t,descriptionSlot:r,actionSlot:n,className:s,as:a="h3"}){return o.jsxs("div",{className:Z("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:Z("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}),dut=({children:e,className:t,style:r})=>o.jsx(je,{size:"lg",className:Z("text-neutral3 mt-1 shrink-0",t),style:r,children:e}),Ef=({children:e,className:t})=>o.jsx(ve,{as:"p",variant:"ui-lg",className:Z("text-neutral6 font-medium",t),children:e}),Cf=({children:e,className:t})=>o.jsx(ve,{as:"div",variant:"ui-sm",className:Z("text-neutral3",t),children:e}),jf=({children:e,className:t})=>o.jsx("div",{className:Z("flex-1 w-full",t),children:e});function Us({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(Ka,{className:s,iconSlot:o.jsx(je,{size:"lg",className:"text-neutral3",children:o.jsx(jzt,{})}),titleSlot:t??a,descriptionSlot:r??i,actionSlot:n})}function Ys({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(Ka,{className:r,iconSlot:o.jsx(je,{size:"lg",className:"text-neutral3",children:o.jsx(xzt,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(ge,{variant:"default",onClick:i,disabled:n,children:n?"Redirecting...":"Log in"})})}const En=({children:e,border:t=!0,className:r})=>o.jsx("header",{className:Z("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},r),children:e}),Xu=({children:e})=>o.jsx(ve,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),vu=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),F2r=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),Kb=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"})}),z2r={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},B2r=({className:e,children:t,size:r="default",style:n})=>o.jsx("table",{className:Z("w-full",z2r[r],e),style:n,children:t}),U2r=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Z("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),V2r=({className:e,children:t,...r})=>o.jsx("th",{className:Z("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}),q2r=({className:e,children:t,...r})=>o.jsx("tbody",{className:Z("",e),...r,children:t}),H2r=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:Z("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})}),Q2r=({className:e,children:t,...r})=>o.jsx("td",{className:Z("text-neutral5 first:pl-3 last:pr-3",e),...r,children:o.jsx("div",{className:Z("flex h-full w-full shrink-0 items-center"),children:t})}),MIe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,DIe=zct,dC=(e,t)=>r=>{var n;if(t?.variants==null)return DIe(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=MIe(d)||MIe(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,v]=m;return Array.isArray(v)?v.includes({...a,...l}[g]):{...a,...l}[g]===v})?[...u,f,h]:u},[]);return DIe(e,i,c,r?.class,r?.className)},W2r=dC(Z("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:Z(Fpe,zpe,Bpe),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"}}),wc=b.forwardRef(({className:e,size:t,testId:r,variant:n,error:s,...a},i)=>o.jsx("textarea",{className:Z(W2r({variant:n,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:i,"aria-invalid":s,...a}));wc.displayName="Textarea";const G2r=DYt,Z2r=LYt,fut=$Yt;function Bt({open:e,onOpenChange:t,children:r}){return o.jsx(G2r,{open:e,onOpenChange:t,children:r})}const Wpe=b.forwardRef(({className:e,...t},r)=>o.jsx(HYe,{className:Z("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}));Wpe.displayName=HYe.displayName;const hut=b.forwardRef(({className:e,...t},r)=>o.jsxs(fut,{children:[o.jsx(Wpe,{}),o.jsx(QYe,{ref:r,className:Z("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})]}));hut.displayName=QYe.displayName;const put=({className:e,...t})=>o.jsx("div",{className:Z("flex flex-col space-y-2 text-center sm:text-left",e),...t});put.displayName="AlertDialogHeader";const mut=({className:e,...t})=>o.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mut.displayName="AlertDialogFooter";const gut=b.forwardRef(({className:e,...t},r)=>o.jsx(ZYe,{ref:r,className:Z("text-lg font-semibold",e),...t}));gut.displayName=ZYe.displayName;const vut=b.forwardRef(({className:e,...t},r)=>o.jsx(YYe,{ref:r,className:Z("text-sm text-neutral3",e),...t}));vut.displayName=YYe.displayName;const yut=b.forwardRef(({className:e,...t},r)=>o.jsx(WYe,{ref:r,className:Z(cC({variant:"primary",size:"default"}),e),...t}));yut.displayName=WYe.displayName;const but=b.forwardRef(({className:e,...t},r)=>o.jsx(GYe,{ref:r,className:Z(cC({variant:"default",size:"default"}),"mt-2 sm:mt-0",e),...t}));but.displayName=GYe.displayName;Bt.Trigger=Z2r;Bt.Portal=fut;Bt.Overlay=Wpe;Bt.Content=hut;Bt.Header=put;Bt.Footer=mut;Bt.Title=gut;Bt.Description=vut;Bt.Action=yut;Bt.Cancel=but;const di=b.forwardRef(({className:e,...t},r)=>o.jsx(Jue,{ref:r,className:Z("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",sn.all,"hover:border-neutral5 hover:shadow-md",NP,"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(eXe,{className:Z("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(py,{className:"h-3.5 w-3.5 stroke-3"})})}));di.displayName=Jue.displayName;const Dp=QYt,Nh=Te.forwardRef(({className:e,children:t,...r},n)=>o.jsx(tde,{ref:n,className:Z("-outline-offset-2",sn.colors,s0.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=tde.displayName;const Ah=Te.forwardRef(({className:e,children:t,...r},n)=>o.jsx(nde,{ref:n,className:Z("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=nde.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:Z("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:Z("flex items-center border-b border-border1 px-3 py-2",sn.colors),searchIcon:Z("mr-2 h-4 w-4 shrink-0 text-neutral3",sn.colors),searchInput:Z("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",sn.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:Z("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",sn.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:Z("h-4 w-4 text-accent1",sn.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 Jl({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(v=>v.value===t)??null,g=v=>{v&&r?.(v.value)};return o.jsxs("div",{className:gn.root,children:[o.jsxs(nKe,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(dKe,{className:Z(cC({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(OJt,{placeholder:n})]}),o.jsx(OHe,{className:gn.chevron})]}),o.jsx(mKe,{container:h,children:o.jsx(yKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(bKe,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(x_,{className:gn.searchIcon}),o.jsx(uKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(kKe,{className:gn.empty,children:a}),o.jsx(hKe,{className:gn.list,children:v=>o.jsxs(OKe,{value:v,className:Z(gn.item,gn.itemSelected),children:[o.jsx("span",{className:gn.checkContainer,children:o.jsx(uer,{children:o.jsx(py,{className:gn.checkIcon})})}),o.jsxs("span",{className:gn.optionContent,children:[v.start,o.jsxs("span",{className:gn.optionText,children:[o.jsx("span",{className:gn.optionLabel,children:v.label}),v.description&&o.jsx("span",{className:gn.optionDescription,children:v.description})]}),v.end?o.jsx("div",{className:gn.optionEnd,children:v.end}):null]})]},v.value)})]})})})]}),p&&o.jsx("span",{className:gn.error,children:p})]})}function xut({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))},v=m.length===0?n:`${m.length} selected`;return o.jsxs("div",{className:gn.root,children:[o.jsxs(nKe,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(dKe,{className:Z(cC({variant:c,size:u}),gn.trigger,p&&gn.triggerError,i),children:[o.jsx("span",{className:Z("truncate",m.length===0&&gn.placeholder),children:v}),o.jsx(OHe,{className:gn.chevron})]}),o.jsx(mKe,{container:h,children:o.jsx(yKe,{align:"start",sideOffset:4,className:gn.positioner,children:o.jsxs(bKe,{className:gn.popup,children:[o.jsxs("div",{className:gn.searchContainer,children:[o.jsx(x_,{className:gn.searchIcon}),o.jsx(uKe,{className:gn.searchInput,placeholder:s})]}),o.jsx(kKe,{className:gn.empty,children:a}),o.jsx(hKe,{className:gn.list,children:x=>{const w=t.includes(x.value);return o.jsxs(OKe,{value:x,className:gn.item,children:[o.jsx("span",{className:Z(gn.checkbox,w?gn.checkboxSelected:gn.checkboxUnselected),children:w&&o.jsx(py,{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 kn=UF,wut=AYe,Y2r=VF,X2r=GR,Sut=b.forwardRef(({className:e,...t},r)=>o.jsx(QR,{ref:r,className:Z("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}));Sut.displayName=QR.displayName;const xn=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Y2r,{children:[o.jsx(Sut,{}),o.jsxs(WR,{ref:n,className:Z("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(GR,{className:Z("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(Kl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xn.displayName=WR.displayName;const _n=({className:e,...t})=>o.jsx("div",{className:Z("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});_n.displayName="DialogHeader";const mf=({className:e,...t})=>o.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mf.displayName="DialogFooter";const qn=({className:e,...t})=>o.jsx("div",{className:Z("overflow-y-auto px-6 max-h-[50vh]",e),...t});qn.displayName="DialogBody";const wn=b.forwardRef(({className:e,...t},r)=>o.jsx(qF,{ref:r,className:Z("text-ui-md font-medium",e),...t}));wn.displayName=qF.displayName;const ea=b.forwardRef(({className:e,...t},r)=>o.jsx(HF,{ref:r,className:Z("sr-only",e),...t}));ea.displayName=HF.displayName;const Out=b.forwardRef(({className:e,...t},r)=>o.jsx(ld,{ref:r,className:Z("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));Out.displayName=ld.displayName;const K2r=({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(kn,{...n,children:o.jsxs(xn,{className:"overflow-hidden p-0",children:[o.jsx(wn,{className:"sr-only",children:t}),o.jsx(ea,{className:"sr-only",children:r}),o.jsx(Out,{filter:s,onKeyDown:a,className:Z("**:[[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})]})})},kut=b.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:Z("flex items-center border-b border-border1 px-3",sn.colors),"cmdk-input-wrapper":"",children:[o.jsx(x_,{className:Z("mr-2 h-4 w-4 shrink-0 text-neutral3",sn.colors)}),o.jsx(ld.Input,{ref:r,className:Z("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",sn.colors,e),...t})]}));kut.displayName=ld.Input.displayName;const _ut=b.forwardRef(({className:e,...t},r)=>o.jsx(ld.List,{ref:r,className:Z("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));_ut.displayName=ld.List.displayName;const Eut=b.forwardRef((e,t)=>o.jsx(ld.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));Eut.displayName=ld.Empty.displayName;const bb=b.forwardRef(({className:e,...t},r)=>o.jsx(ld.Group,{ref:r,className:Z("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}));bb.displayName=ld.Group.displayName;const aw=b.forwardRef(({className:e,...t},r)=>o.jsx(ld.Separator,{ref:r,className:Z("-mx-1 h-px bg-border1",e),...t}));aw.displayName=ld.Separator.displayName;const Go=b.forwardRef(({className:e,...t},r)=>o.jsx(ld.Item,{ref:r,className:Z("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",sn.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}));Go.displayName=ld.Item.displayName;const Cut=({className:e,...t})=>o.jsx("span",{className:Z("ml-auto text-xs tracking-widest text-neutral3",e),...t});Cut.displayName="CommandShortcut";function jut({children:e,className:t}){return o.jsx("div",{className:Z("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const J2r=orr,eDr=lrr,tDr=nP,rDr=drr,nDr=crr,Gpe=Z("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"),Tut=b.forwardRef(({className:e,children:t,...r},n)=>o.jsx(CJe,{ref:n,className:Z("cursor-pointer",e),...r,children:t}));Tut.displayName=CJe.displayName;const Nut=b.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(PJe,{ref:s,className:Z(Gpe,"data-[state=open]:bg-surface4",t&&"pl-8",e),...n,children:[r,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(wHe,{className:"-rotate-90 opacity-50"})})]}));Nut.displayName=PJe.displayName;const Aut=b.forwardRef(({className:e,...t},r)=>o.jsx(nP,{children:o.jsx(sz,{ref:r,className:Z("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})}));Aut.displayName=sz.displayName;const Iut=b.forwardRef(({className:e,container:t,sideOffset:r=8,...n},s)=>o.jsx(nP,{container:t,children:o.jsx(jJe,{ref:s,sideOffset:r,className:Z("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})}));Iut.displayName=jJe.displayName;const Rut=b.forwardRef(({className:e,...t},r)=>o.jsx(NJe,{ref:r,className:Z(Gpe,e),...t}));Rut.displayName=NJe.displayName;const Put=b.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(AJe,{ref:s,className:Z(Gpe,"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(py,{})}),t]}));Put.displayName=AJe.displayName;const Mut=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(IJe,{ref:n,className:Z("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(urr,{children:o.jsx(_He,{className:"h-2 w-2 fill-current"})})}),t]}));Mut.displayName=IJe.displayName;const Dut=b.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(TJe,{ref:n,className:Z("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Dut.displayName=TJe.displayName;const Lut=b.forwardRef(({className:e,...t},r)=>o.jsx(RJe,{ref:r,className:Z("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));Lut.displayName=RJe.displayName;const $ut=({className:e,...t})=>o.jsx("span",{className:Z("ml-auto text-xs tracking-widest opacity-60",e),...t});$ut.displayName="DropdownMenuShortcut";function yt({open:e,onOpenChange:t,children:r,modal:n}){return o.jsx(J2r,{modal:n,open:e,onOpenChange:t,children:r})}yt.Trigger=Tut;yt.Content=Iut;yt.Group=eDr;yt.Portal=tDr;yt.Item=Rut;yt.CheckboxItem=Put;yt.RadioItem=Mut;yt.Label=Dut;yt.Separator=Lut;yt.Shortcut=$ut;yt.Sub=rDr;yt.SubContent=Aut;yt.SubTrigger=Nut;yt.RadioGroup=nDr;const eL=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(ve,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Mn({className:e,...t}){return o.jsx("div",{className:Z("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 Fut=({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(je,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),r?o.jsx(Mn,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(ve,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),n&&o.jsx("div",{className:"pt-2",children:n})]});function sDr({children:e,className:t}){return o.jsx("div",{className:Z("grid gap-2 text-neutral4",t),children:e})}function aDr({children:e}){return o.jsxs("p",{className:Z("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx($E,{})," ",e]})}function iDr({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function oDr({children:e,name:t,required:r,size:n="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Z("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 lDr({children:e,className:t,layout:r="vertical",labelColumnWidth:n}){return o.jsx("div",{className:Z("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 go=Object.assign({},{Layout:lDr,Column:sDr,Label:oDr,HelpText:iDr,ErrorMsg:aDr});function cDr({children:e,className:t}){return o.jsx("div",{className:Z("grid gap-6 content-start",t),children:e})}function uDr({children:e,className:t,columns:r=1,gap:n}){return o.jsx("div",{className:Z("grid",{"grid-cols-1":r===1,"grid-cols-2":r===2},n??"gap-6",t),children:e})}Object.assign(uDr,{Column:cDr});const dDr=dC(Z("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:Z(Fpe,zpe,Bpe),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Wl.sm} text-ui-sm px-[.75em]`,md:`${Wl.md} text-ui-md px-[.75em]`,default:`${Wl.default} text-ui-md px-[.85em]`,lg:`${Wl.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),sr=b.forwardRef(({className:e,size:t,testId:r,variant:n,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Z(dDr({variant:n,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":r,ref:l,"aria-invalid":a,...i}));sr.displayName="Input";function _x({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(go.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(go.Column,{children:o.jsx(go.Label,{name:e,required:l,size:u||"bigger",children:n?o.jsx(ed,{children:r}):r})}):null,o.jsxs(go.Column,{children:[!n&&d==="vertical"?o.jsx(go.Label,{name:e,required:l,size:u||"default",children:r}):null,o.jsx(sr,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":p,size:h,...g}),a&&o.jsx(go.HelpText,{children:a}),i&&o.jsx(go.ErrorMsg,{children:i})]})]})}function Ex({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 v=b.useRef(null);return b.useEffect(()=>{m===!1&&v.current?.focus()},[m]),m?o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(ge,{size:p||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(x_,{})})}),o.jsx(Wr,{children:i||"Search"})]}):o.jsxs(go.Layout,{layout:c,className:h,children:[c==="horizontal"?o.jsx(go.Column,{children:o.jsx(go.Label,{name:e,required:n,children:l?o.jsx(ed,{children:i}):i})}):null,o.jsxs(go.Column,{children:[c==="vertical"&&i&&!l?o.jsx(go.Label,{name:e,required:n,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(sr,{ref:v,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:p,className:Z(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(x_,{"aria-hidden":"true",className:Z("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(ge,{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(Kl,{})})]}),t&&o.jsx(go.HelpText,{children:t}),r&&o.jsx(go.ErrorMsg,{children:r})]})]})}const fi=zrr,hi=Brr,Ja=b.forwardRef(({className:e,children:t,variant:r="inputLike",size:n="default",...s},a)=>o.jsxs(aet,{ref:a,className:Z(cC({variant:r,size:n}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(Urr,{asChild:!0,children:o.jsx(wHe,{className:Z("h-4 w-4 text-neutral3",sn.colors)})})]}));Ja.displayName=aet.displayName;const ei=b.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(Vrr,{children:o.jsx(iet,{ref:s,className:Z("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(qrr,{className:Z("p-1",r==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));ei.displayName=iet.displayName;const ss=b.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(oet,{ref:n,className:Z("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",sn.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(Qrr,{children:o.jsx(py,{className:"h-4 w-4 text-accent1"})})}),o.jsx(Hrr,{children:t})]}));ss.displayName=oet.displayName;function Lo({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(go.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(go.Column,{children:o.jsx(go.Label,{name:e,required:n,children:c?o.jsx(ed,{children:l}):l})}):null,o.jsxs(go.Column,{children:[u==="vertical"&&l&&!c?o.jsx(go.Label,{name:e,required:n,children:l}):null,o.jsxs(fi,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:p,disabled:s,children:[o.jsx(Ja,{size:a,children:o.jsx(hi,{placeholder:h})}),o.jsx(ei,{children:f.map(g=>o.jsx(ss,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(go.HelpText,{children:t}),r&&o.jsx(go.ErrorMsg,{children:r})]})]})}const fDr={sm:`${Wl.sm} w-form-sm`,md:`${Wl.md} w-form-md`,lg:`${Wl.lg} w-form-lg`,default:`${Wl.default}`},hDr={sm:"sm",md:"default",lg:"lg",default:"default"},pDr={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"},mDr="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",Dn=Te.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:Z(mDr,NP,pDr[s],fDr[n],a&&"active:scale-100",e),...i,children:o.jsx(je,{size:hDr[n],children:t})})}),o.jsx(Wr,{children:r})]}));Dn.displayName="IconButton";const gDr=dC("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=b.forwardRef(({className:e,...t},r)=>o.jsx(uet,{ref:r,className:Z(gDr(),e),...t}));xt.displayName=uet.displayName;function X_({children:e}){const t=e.replace(/\\n/g,`
291
291
  `);return o.jsx(Let,{remarkPlugins:[ott],components:yDr,className:"space-y-3",children:t})}const zut=Te.memo(({children:e,language:t,...r})=>{const[n,s]=b.useState([]);return b.useEffect(()=>{$2r(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&&`
292
292
  `]}))})}):o.jsx("pre",{...r,children:e})});zut.displayName="HighlightedCode";const vDr=({children:e,className:t,language:r,...n})=>{const s=typeof e=="string"?e:Gae(e),a=Z("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(zut,{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(Xa,{content:s,copyMessage:"Copied code to clipboard"})})]})};function Gae(e){if(typeof e=="string")return e;if(e?.props?.children){let t=e.props.children;return Array.isArray(t)?t.map(r=>Gae(r)).join(""):Gae(t)}return""}const yDr={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(vDr,{className:t,language:n[1],...r,children:e}):o.jsx("code",{className:Z("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 bDr({children:e,className:t}){return o.jsx("div",{className:Z("overflow-x-auto ",t),children:e})}function But({children:e,className:t}){return o.jsx("p",{className:Z("text-ui-md text-neutral2 leading-tight mt-0.5",t),children:e})}function xDr({message:e="Failed to load data",className:t}){return o.jsx("div",{className:Z("flex flex-col gap-3 items-center justify-center",t),children:o.jsx("p",{className:"text-ui-sm text-accent2",children:e})})}const wDr={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Mt({color:e,className:t,size:r="md"}){return o.jsx("svg",{className:Z("animate-spin",wDr[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 SDr({className:e}){return o.jsx("div",{className:Z("flex items-center justify-center",e),children:o.jsx(Mt,{size:"md",color:Mb.neutral1})})}function ODr({message:e="No data yet",className:t}){return o.jsx("div",{className:Z("flex items-center justify-center h-full",t),children:o.jsx("p",{className:"text-neutral1 text-sm",children:e})})}function LIe({children:e,className:t}){return o.jsx(jut,{className:Z("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 kDr({value:e,label:t,className:r}){return o.jsxs("div",{className:Z("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 Uut({children:e,className:t,as:r="h2"}){return o.jsx(r,{className:Z("text-ui-md font-normal text-neutral4",t),children:e})}function _Dr(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(Uut,{as:n,children:t}),r&&o.jsx(But,{children:r})]})}function EDr({children:e,className:t}){return o.jsx("div",{className:Z("grid grid-cols-[1fr_auto] gap-4",t),children:e})}function CDr({changePct:e,prevValue:t,lowerIsBetter:r,className:n}){const s=r?e<0:e>=0;return o.jsxs("div",{className:Z("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:Z("[&>svg]:w-4 [&>svg]:h-4",s?"text-green-600":"text-red-600"),children:e>=0?o.jsx($zt,{}):o.jsx(Dzt,{})}),o.jsx("span",{className:Z(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 jDr({message:e="Failed to load data",className:t}){return o.jsx("span",{className:Z("text-ui-sm text-accent2",t),children:e})}function TDr({children:e,className:t}){return o.jsx("span",{className:Z("text-ui-md text-neutral3 leading-relaxed",t),children:e})}function NDr({className:e}){return o.jsx("span",{className:Z("text-sm",e),children:o.jsx(Mt,{size:"md",color:Mb.neutral1})})}function ADr({message:e="No previous value to compare",className:t}){return o.jsx("span",{className:Z("text-sm text-neutral1",t),children:e})}function IDr({message:e="No data yet",className:t}){return o.jsx("span",{className:Z("text-sm text-neutral1",t),children:e})}function RDr({children:e,className:t}){return o.jsx(jut,{className:Z("flex-1 min-w-60",t),children:o.jsx("div",{className:"grid gap-1",children:e})})}function PDr({children:e,className:t}){return o.jsx("strong",{className:Z("text-header-lg text-neutral4 font-semibold",t),children:e})}const fr=Object.assign(RDr,{Label:TDr,Value:PDr,Change:CDr,NoChange:ADr,NoData:IDr,Error:jDr,Loading:NDr}),Ht=Object.assign(LIe,{Root:LIe,Kpi:fr,TopBar:EDr,TitleAndDescription:_Dr,Title:Uut,Description:But,Summary:kDr,Loading:SDr,Error:xDr,Content:bDr,NoData:ODr});function Zae({children:e,className:t}){return o.jsx("div",{className:Z("flex flex-wrap gap-8",t),children:e})}const Tf=Dlr,fd=Llr,yu=b.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx($lr,{children:o.jsx(ytt,{ref:s,align:t,sideOffset:r,className:Z("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=ytt.displayName;function Vut({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 qut({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(ge,{disabled:e,size:"md",onClick:()=>t(),children:[o.jsx(Kl,{}),"Clear"]}),a&&o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ge,{disabled:e,size:"md","aria-label":"More filter actions",children:o.jsx(WFt,{})})}),o.jsxs(yt.Content,{align:"end",children:[r&&o.jsxs(yt.Item,{onSelect:()=>r(),children:[o.jsx(Kl,{}),"Remove all filters"]}),r&&(n||s)&&o.jsx(yt.Separator,{}),n&&o.jsxs(yt.Item,{onSelect:()=>n(),children:[o.jsx(_zt,{}),"Save filters for next time"]}),s&&o.jsxs(yt.Item,{onSelect:()=>s(),children:[o.jsx(CHe,{}),"Remove saved filters"]})]})]})]})}const fC=b.forwardRef(({className:e,...t},r)=>o.jsx(Att,{className:Z("grid gap-2",e),...t,ref:r}));fC.displayName=Att.displayName;const ru=b.forwardRef(({className:e,...t},r)=>o.jsx(Itt,{ref:r,className:Z("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",sn.all,"hover:border-neutral5 hover:shadow-md",NP,"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(Glr,{className:Z("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(_He,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));ru.displayName=Itt.displayName;function Hut({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(sr,{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(Mt,{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(di,{"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(fC,{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(ru,{"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(ru,{"data-pick-multi-item":"",value:"Any",className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:"Any"})]})]})]})}function Qut(e){return Array.isArray(e)?e.length===0?"Any":e.join(", "):e}const Zpe="inline-flex",Wut=`${Wl.md} border-y-2 border-border1 px-[.75em] text-neutral3 whitespace-nowrap flex items-center`,Ype=`${Wut} text-ui-md rounded-l-lg border-l-2 border-r-1`,Xpe=`${Wut} text-ui-md `,Kpe="rounded-tl-none rounded-bl-none border-l-transparent",MDr="rounded-none",DDr="rounded-none";function LDr({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:Zpe,children:[o.jsx("span",{className:Ype,children:e.label}),o.jsx("span",{className:Xpe,children:"is"}),o.jsx(sr,{ref:c,size:"md",disabled:s,value:i,placeholder:e.placeholder??`Enter ${e.label}`,className:MDr,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(ge,{type:"button",disabled:s,"aria-label":`Remove ${e.label} filter`,className:Kpe,size:"md",onMouseDown:u=>u.preventDefault(),onClick:n,children:o.jsx(Kl,{})})]})}function $Dr({field:e,token:t,tokens:r,onChange:n,onRemove:s,disabled:a}){const[i,l]=b.useState(!1);return o.jsxs("div",{className:Zpe,children:[o.jsx("span",{className:Ype,children:e.label}),o.jsx("span",{className:Xpe,children:"is"}),o.jsxs(Tf,{open:i,onOpenChange:l,children:[o.jsx(fd,{asChild:!0,children:o.jsx(ge,{type:"button",disabled:a,size:"md",className:DDr,children:Qut(t.value)})}),o.jsx(yu,{align:"start",sideOffset:8,className:"w-64 p-2","data-pick-multi-panel":!0,children:o.jsx(Hut,{field:e,tokens:r,onChange:n})})]}),o.jsx(ge,{type:"button",disabled:a,"aria-label":`Remove ${e.label} filter`,className:Kpe,size:"md",onClick:s,children:o.jsx(Kl,{})})]})}function Gut({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(LDr,{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($Dr,{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:Zpe,children:[o.jsx("span",{className:Ype,children:u.label}),o.jsx("span",{className:Xpe,children:"is"}),o.jsx("span",{className:"px-2.5 py-1.5 max-w-[20rem] truncate",children:Qut(l.value)}),o.jsx(ge,{type:"button",disabled:n,size:"md","aria-label":`Remove ${u.label} filter`,className:Kpe,onClick:()=>i(c),children:o.jsx(Kl,{})})]},`${l.fieldId}-${c}`):null})})}function Zut({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,v]=b.useState(),[x,w]=b.useState(),S=b.useRef(null),k=b.useRef(!1),_=b.useCallback(R=>{w(z=>z===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 z of t){const D=e.find(U=>U.id===z.fieldId);D&&D.kind!=="pick-multi"&&R.add(z.fieldId)}return R},[t,e]),N=b.useCallback(()=>{d(void 0),h(""),m([]),v(void 0)},[]);b.useEffect(()=>{l||N()},[l,N]),b.useEffect(()=>{l&&T?.kind==="text"&&S.current?.focus()},[l,T]);const I=b.useCallback((R,z)=>{const D=t.findIndex(B=>B.fieldId===R);if(z===void 0||Array.isArray(z)&&z.length===0){if(D===-1)return;r(t.filter((B,H)=>H!==D));return}if(D===-1){r([...t,{fieldId:R,value:z}]);return}const F=[...t];F[D]={fieldId:R,value:z},r(F)},[r,t]),P=b.useCallback(()=>{if(!T){v("Choose a property first.");return}if(j.has(T.id)){v(`Remove the existing ${T.label} filter before adding another.`);return}if(T.kind==="text"&&!f.trim()){v(`Enter a value for ${T.label}.`);return}if(T.kind==="multi-select"&&p.length===0){v(`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(fd,{asChild:!0,children:o.jsxs(ge,{variant:"outline",size:a,disabled:s,children:[o.jsx(mzt,{}),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([]),v(void 0)},children:o.jsx(LE,{className:"h-4 w-4"})}),o.jsx(azt,{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 z=Array.from(R.currentTarget.querySelectorAll("[data-filter-item]:not([disabled])"));if(z.length===0)return;R.preventDefault();const D=document.activeElement,U=z.findIndex(B=>B===D);let F;R.key==="Home"?F=0:R.key==="End"?F=z.length-1:R.key==="ArrowDown"?F=U<0?0:(U+1)%z.length:F=U<=0?z.length-1:U-1,z[F]?.focus()},children:e.length>0?e.map(R=>{const z=j.has(R.id);return R.kind==="pick-multi"?o.jsx(FDr,{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:Z("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",z?"cursor-not-allowed text-neutral2 opacity-70":"text-neutral4 hover:bg-surface4 hover:text-neutral6"),disabled:z,onClick:()=>{if(v(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}),z?o.jsx("span",{className:"ml-auto text-neutral3",children:"In use"}):o.jsx(Lce,{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(sr,{ref:S,size:"md",value:f,onChange:R=>{h(R.target.value),v(void 0)},placeholder:T.placeholder??`Enter ${T.label}`,onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),P())}}),T&&T.kind==="multi-select"&&o.jsx(xut,{options:T.options??[],value:p,onValueChange:R=>{m(R),v(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(ge,{variant:"ghost",size:"md",onClick:()=>c(!1),children:"Cancel"}),o.jsx(ge,{variant:"outline",size:"md",onClick:P,children:"Add filter"})]})]})})]})}function FDr({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(fd,{asChild:!0,children:o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Z("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(Pce,{className:"h-4 w-4 text-neutral3 shrink-0"}),o.jsx("span",{className:"truncate",children:e.label}),!n&&o.jsx(b_,{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(Hut,{field:e,tokens:t,onChange:r})})]})}const Yut=(e,{enabled:t=!0})=>{const r=b.useRef(t);Te.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 Yut(c,{enabled:s}),o.jsxs(Htt,{ref:l,className:Z("relative overflow-hidden",e),...i,children:[o.jsx(icr,{ref:c,className:Z("h-full w-full rounded-[inherit] [&>div]:block!",r),style:n?{maxHeight:n}:void 0,children:t}),(a==="vertical"||a==="both")&&o.jsx(Yae,{orientation:"vertical"}),(a==="horizontal"||a==="both")&&o.jsx(Yae,{orientation:"horizontal"}),a==="both"&&o.jsx(ocr,{})]})});Ms.displayName=Htt.displayName;const Yae=b.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(Wde,{ref:n,orientation:t,className:Z("flex touch-none select-none transition-all duration-normal ease-out-custom","opacity-0 hover:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...r,children:o.jsx(ztt,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));Yae.displayName=Wde.displayName;const $Ie={sm:Wl.sm,md:Wl.md,lg:Wl.lg,default:Wl.default},Rm=({onSearch:e,label:t,placeholder:r,debounceMs:n=300,size:s="md"})=>{const a=b.useId(),i=b.useRef(null),l=d1(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:Z("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",aMr,sMr,sn.all,"hover:border-neutral2",$Ie[s]),children:[o.jsx(x_,{className:Z("text-neutral3 h-4 w-4",sn.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:Z("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-hidden",$Ie[s]),name:a,ref:i,onChange:c})]})]})},zDr=({children:e})=>o.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e}),_4=b.forwardRef(({className:e,...t},r)=>o.jsxs(ort,{ref:r,className:Z("relative flex w-full touch-none select-none items-center group",e),...t,children:[o.jsx(_cr,{className:Z("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",sn.colors),children:o.jsx(Ecr,{className:Z("absolute h-full bg-accent1",sn.all)})}),o.jsx(Ccr,{className:Z("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",NP,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));_4.displayName=ort.displayName;const kc=b.forwardRef(({className:e,...t},r)=>o.jsx(hrt,{className:Z("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent",sn.all,NP,"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(Icr,{className:Z("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")})}));kc.displayName=hrt.displayName;function BDr({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(ve,{as:i,className:a,...l,children:c});const f=o.jsxs(ve,{as:"span",className:"cursor-default",variant:l.variant,font:l.font,children:[u,"..."]});return o.jsxs(ve,{as:i,className:Z("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(Xa,{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:Z("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 Fr({children:e,className:t,style:r}){const n=Xut("MainContentLayout");return o.jsx("main",{className:Z("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...r,...n?{border:"3px dotted red"}:{}},children:e})}function gf({children:e,className:t,isCentered:r=!1,isDivided:n=!1,hasLeftServiceColumn:s=!1,style:a}){const i=Xut("MainContentContent"),l=Jpe({isCentered:r,isDivided:n,hasLeftServiceColumn:s,className:t});return o.jsx("div",{className:l,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const Jpe=({isCentered:e,isDivided:t,hasLeftServiceColumn:r,className:n})=>Z("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 Xut(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 UDr({children:e,className:t}){return o.jsx("div",{className:Z("grid content-start",t),children:e})}function VDr({children:e,isLoading:t}){return o.jsx("p",{className:Z("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 qDr({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:Z("grid grid-cols-[1fr_auto] gap-16 w-full ",{"mt-[6vh] mb-[4vh]":a},s),children:e}):o.jsxs("header",{className:Z("grid gap-2 pt-8 pb-8 ",s),children:[o.jsx("h1",{className:Z("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:Z("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 HDr({children:e,isLoading:t,size:r="default"}){return o.jsx("h1",{className:Z("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 Ar=Object.assign(qDr,{Title:HDr,Description:VDr,Column:UDr});function IS({children:e,className:t}){return o.jsx("div",{className:Z("grid gap-12",t),children:e})}const Kut=({className:e,children:t})=>o.jsx("div",{className:Z("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 E4({className:e,classNames:t,showOutsideDays:r=!0,...n}){return o.jsx(mhr,{showOutsideDays:r,className:Z("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:Z("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:Z("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:Z("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:Z("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 YH=["12","1","2","3","4","5","6","7","8","9","10","11"],tL=["00","15","30","45","59"],rL=["AM","PM"];function Xae({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),v=p[3]?.toUpperCase();m>=1&&m<=12&&g>=0&&g<=59&&(s(m.toString()),i(g===0?"00":g.toString()),c(v||"AM"))}}},[e]);const u=h=>{s(h),t(`${YH[+h]}:${a} ${l}`.trim())},d=h=>{i(tL[+h]),t(`${n}:${tL[+h]} ${l}`.trim())},f=h=>{c(rL[+h]),t(`${n}:${a} ${rL[+h]}`.trim())};return o.jsxs("div",{className:Z("flex gap-2 items-center",r),children:[o.jsxs(fi,{name:"hour",value:YH.indexOf(n).toString(),onValueChange:u,children:[o.jsx(Ja,{size:"sm",children:o.jsx(hi,{placeholder:"Select..."})}),o.jsx(ei,{children:YH.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),":",o.jsxs(fi,{name:"minute",value:tL.indexOf(a).toString(),onValueChange:d,children:[o.jsx(Ja,{size:"sm",children:o.jsx(hi,{placeholder:"Select..."})}),o.jsx(ei,{children:tL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]}),o.jsxs(fi,{name:"period",value:rL.indexOf(l).toString(),onValueChange:f,children:[o.jsx(Ja,{size:"sm",children:o.jsx(hi,{placeholder:"Select..."})}),o.jsx(ei,{children:rL.map((h,p)=>o.jsx(ss,{value:`${p}`,children:h},h))})]})]})}const FIe=({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(fd,{asChild:!0,children:a||o.jsx(WDr,{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(QDr,{value:e,minValue:t,maxValue:r,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:n,...c})})]})};function nL({date:e,timeStr:t=""}){if(!Tv(e))return null;if(t){const r=ur(e,"yyyy-MM-dd"),n=new Date(`${r} ${t}`);if(Tv(n))return n}return e}const QDr=({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?ur(nL({date:e,timeStr:l})||"","PP p"):""),[p,m]=b.useState(l||""),[g,v]=b.useState(e?new Date(e):void 0),x=d1(z=>{Tv(z)&&(v(z),n?.(z),s?.(!1))},500),w=z=>{h(z.currentTarget.value);const D=new Date(z.currentTarget.value);x(D)},S=z=>{Tv(z)?r&&z>r?(d(`The selected date should be before ${ur(r,"PP p")}`),h("")):t&&z<t?(d(`The selected date should be after ${ur(t,"PP p")}`),h("")):(h(ur(z,"PP p")),d("")):(h(""),d(""))},k=new Date(f),_=Tv(k),E=_&&k.getTime()!==e?.getTime(),T=z=>{if(v(z),z){const D=nL({date:z,timeStr:p});S(D||"")}else S("")},j=z=>{if(v(z),z){const D=nL({date:z,timeStr:p});S(D||"")}else S("")},N=z=>{if(m(z),_){const D=nL({date:k,timeStr:z});S(D||"")}},I=()=>{s?.(!1)},P=()=>{Tv(k)&&n(k),s?.(!1)},R=()=>{n(void 0),v(void 0),h(""),m(""),s?.(!1)};return o.jsxs("div",{"aria-label":"Choose date",className:Z("relative flex flex-col",i),onKeyDown:z=>{z.stopPropagation(),z.key==="Escape"&&s?.(!1)},children:[o.jsx(_x,{name:"date-range",type:"text",value:f,onChange:w,placeholder:a,className:"m-4 mb-0 w-auto!"}),u&&o.jsxs("div",{className:Z("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(wF,{})," ",u]}),o.jsx(E4,{mode:"single",month:g,selected:g,onMonthChange:j,onSelect:T,...c}),o.jsx(Xae,{onValueChange:N,className:"m-4 mt-0 w-auto",defaultValue:e?ur(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(ge,{tabIndex:0,size:"md",onClick:R,type:"button",children:"Clear"}),o.jsx(ge,{tabIndex:0,type:"button",size:"md",variant:E?"primary":"default",onClick:()=>{_?P():I()},children:E?"Apply":"Cancel"})]})]})},WDr=b.forwardRef(({value:e,placeholder:t,className:r,...n},s)=>o.jsxs(ge,{ref:s,className:Z("justify-start",r),variant:"inputLike",...n,children:[o.jsx(Zre,{className:"h-4 w-4"}),e?o.jsx("span",{className:"text-white",children:ur(e,"PP p")}):o.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));function Jut({children:e}){return o.jsx("ul",{className:"grid bg-surface3 overflow-y-auto",children:e})}function edt(e){return!e||e.length===0?"":e?.map(t=>t.size).join(" ")}function tdt({entry:e,isSelected:t,onClick:r,children:n,columns:s}){const a=()=>{r?.(e?.id)};return o.jsx("li",{className:Z("border-t text-neutral5 border-border1 last:border-b-0 text-ui-md","[&:last-child>button]:rounded-b-lg",sn.colors,{"bg-accent1Dark":t}),children:o.jsx("button",{onClick:a,className:Z("grid w-full px-6 gap-6 text-left items-center min-h-12",sn.colors,s0.visible,{"hover:bg-surface4":e&&!t}),style:{gridTemplateColumns:edt(s)},disabled:!e,children:n})})}function GDr({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 ZDr({status:e}){return o.jsxs("div",{className:Z("flex justify-center items-center w-full relative"),children:[e?o.jsx("div",{className:Z("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(ed,{children:["Status: ",e||"not provided"]})]})}function rdt({columns:e}){return o.jsx("div",{className:Z("sticky top-0 bg-surface4 z-10 rounded-t-lg px-6"),children:o.jsx("div",{className:Z("grid gap-6 text-left uppercase py-3 text-neutral3 text-ui-sm"),style:{gridTemplateColumns:edt(e)},children:e?.map(t=>o.jsx("span",{children:t.label||t.name},t.name))})})}function YDr({children:e,message:t,className:r,type:n}){return!e&&!t?null:o.jsx("div",{className:Z("grid border-t border-border1",r),children:t?o.jsxs("p",{className:Z("text-neutral3 text-ui-md text-center grid p-8 justify-center justify-items-center gap-2","[&>svg]:w-[1.5em] [&>svg]:h-[1.5em] [&>svg]:opacity-75",{"[&>svg]:text-red-500":n==="error"}),children:[n==="error"?o.jsx($E,{}):o.jsx(DR,{})," ",t]}):e})}function XDr({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 KDr({currentPage:e,hasMore:t,onNextPage:r,onPrevPage:n}){const s=typeof e=="number"&&e>0||t;return o.jsxs("div",{className:Z("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:Z("flex gap-4","[&>button]:flex [&>button]:items-center [&>button]:gap-2 [&>button]:text-neutral4 [&>button:hover]:text-neutral5 [&>button]:transition-colors [&>button]:border [&>button]:border-border1 [&>button]:p-1 [&>button]:px-2 [&>button]:rounded-md","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[typeof e=="number"&&e>0&&o.jsxs("button",{onClick:n,children:[o.jsx(LE,{}),"Previous"]}),t&&o.jsxs("button",{onClick:r,children:["Next",o.jsx(MR,{})]})]})]})}function JDr({children:e}){return o.jsx("div",{className:"grid",children:e})}function ndt({children:e}){return o.jsx("div",{className:Z("rounded-lg border border-border1 overflow-clip"),children:e})}const mo=Object.assign(JDr,{Header:rdt,Trim:ndt,Entries:Jut,Entry:tdt,Message:YDr,NextPageLoading:XDr,Pagination:KDr,EntryText:GDr,EntryStatus:ZDr}),zIe=["75%","50%","65%","90%","60%","80%"];function eLr({columns:e,numberOfRows:t=3}){const r=(n,s)=>{const a=(n+s+(e?.length||0)+(t||0))%zIe.length;return zIe[a]};return o.jsx(Jut,{children:Array.from({length:t}).map((n,s)=>o.jsx(tdt,{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 tLr({columns:e,numberOfRows:t}){return o.jsx(mo,{children:o.jsxs(ndt,{children:[o.jsx(rdt,{columns:e}),o.jsx(eLr,{columns:e,numberOfRows:t})]})})}function sdt({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 adt({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 idt({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(ed,{children:p}):p;return o.jsxs("div",{className:Z("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:Z("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(fi,{name:e,value:t,onValueChange:u,disabled:i,children:[o.jsx(Ja,{id:`select-${e}`,size:f,className:"grid grid-cols-[1fr_auto] [&>span]:truncate w-full",children:o.jsx(hi,{placeholder:d})}),o.jsx(ei,{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 odt=b.createContext(null);function rLr({children:e,value:t}){return o.jsx(odt.Provider,{value:t,children:e})}function S9(){const e=b.useContext(odt);if(!e)throw new Error("useJSONSchemaForm must be used within a JSONSchemaForm.Root");return e}let nLr=0;function O9(e={}){return{id:`field-${Date.now()}-${nLr++}`,name:"",type:"string",nullable:!1,optional:!1,...e}}function sLr(e){return e==="text"?"string":e}function ldt(e){const t=sLr(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}=cdt(e.properties);n.properties=s,a.length>0&&(n.required=a)}return e.type==="array"&&e.items&&(n.items=ldt(e.items)),n}function cdt(e){const t={},r=[];for(const n of e)n.name.trim()&&(t[n.name]=ldt(n),n.optional||r.push(n.name));return{properties:t,required:r}}function aLr(e){const{properties:t,required:r}=cdt(e),n={type:"object",properties:t};return r.length>0&&(n.required=r),n}function udt(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 ddt(e){return["string","number","boolean","object","array"].includes(e)?e:"string"}function fdt(e){const{type:t,nullable:r}=udt(e.type);return O9({name:"",type:ddt(t),description:e.description,nullable:r,optional:!1,properties:e.properties?k9({properties:e.properties,required:e.required}):void 0,items:e.items?fdt(e.items):void 0})}function k9(e){if(!e?.properties)return[];const t=new Set(e.required||[]);return Object.entries(e.properties).map(([r,n])=>{const{type:s,nullable:a}=udt(n.type);return O9({name:r,type:ddt(s),description:n.description,nullable:a,optional:!t.has(r),properties:n.properties?k9({properties:n.properties,required:n.required}):void 0,items:n.items?fdt(n.items):void 0})})}function Kae(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:Kae(i.properties||[],a,r,n)}:i.type==="array"&&i.items?{...i,items:{...i.items,properties:Kae(i.items.properties||[],a,r,n)}}:i)}function Jae(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:Jae(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:Jae(a.items.properties||[],s,r)}}:a)}function eie(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:eie(a.properties||[],s,r)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:eie(a.items.properties||[],s,r)}}:a)}function iLr({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=aLr(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=O9();l(g=>Jae(g,p,m))},[]),d=b.useCallback((p,m)=>{l(g=>eie(g,p,m))},[]),f=b.useCallback((p,m,g)=>{l(v=>Kae(v,p,m,g))},[]),h=b.useMemo(()=>({fields:i,addField:u,removeField:d,updateField:f,maxDepth:n}),[i,u,d,f,n]);return o.jsx(rLr,{value:h,children:o.jsx("div",{className:Z(s),children:a})})}const hdt=b.createContext(null);function oLr({children:e,value:t}){return o.jsx(hdt.Provider,{value:t,children:e})}function hC(){const e=b.useContext(hdt);if(!e)throw new Error("useJSONSchemaFormField must be used within a JSONSchemaForm.Field");return e}function lLr({field:e,parentPath:t=[],depth:r=0,className:n,children:s}){const{updateField:a,removeField:i}=S9(),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(oLr,{value:u,children:o.jsx("div",{className:Z(n),children:s})})}const pdt=b.createContext(null);function cLr({children:e,value:t}){return o.jsx(pdt.Provider,{value:t,children:e})}function mdt(){return b.useContext(pdt)}function uLr({className:e,children:t}){const{fields:r}=S9(),n=mdt(),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 dLr(e){const{field:t,update:r}=hC(),n=b.useCallback(s=>{r({name:s.target.value})},[r]);return o.jsx(_x,{...e,size:"md",labelIsHidden:!0,name:`field-name-${t.id}`,value:t.name,onChange:n})}const fLr=[{value:"string",label:"String",icon:o.jsx(je,{size:"sm",children:o.jsx(Fce,{})})},{value:"number",label:"Number",icon:o.jsx(je,{size:"sm",children:o.jsx(Mce,{})})},{value:"boolean",label:"Boolean",icon:o.jsx(je,{size:"sm",children:o.jsx($ce,{})})},{value:"text",label:"Text",icon:o.jsx(je,{size:"sm",children:o.jsx(cA,{})})},{value:"object",label:"Object",icon:o.jsx(je,{size:"sm",children:o.jsx(xHe,{})})},{value:"array",label:"Array",icon:o.jsx(je,{size:"sm",children:o.jsx(Dce,{})})}];function hLr({className:e,...t}){const{field:r,update:n}=hC(),s=b.useCallback(a=>{n({type:a})},[n]);return o.jsx(Lo,{className:Z("w-28 shrink-0",e),name:`field-type-${r.id}`,label:"Select type",labelIsHidden:!0,value:r.type,onValueChange:s,options:fLr,size:"md",...t})}function pLr({label:e="Optional",labelClassName:t,className:r,...n}){const{field:s,update:a}=hC(),i=b.useCallback(l=>{a({optional:l===!0})},[a]);return o.jsxs("label",{className:Z("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(di,{...n,className:r,checked:s.optional,onCheckedChange:i}),e]})}function mLr({label:e="Nullable",labelClassName:t,className:r,...n}){const{field:s,update:a}=hC(),i=b.useCallback(l=>{a({nullable:l===!0})},[a]);return o.jsxs("label",{className:Z("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(di,{...n,className:r,checked:s.nullable,onCheckedChange:i}),e]})}function gLr({children:e,tooltip:t="Remove field",...r}){const{remove:n}=hC();return o.jsx(Cn,{tooltipContent:t,onClick:n,size:"md",...r,children:e||o.jsx(CHe,{})})}function vLr({className:e,children:t}){const{maxDepth:r,updateField:n}=S9(),{field:s,parentPath:a,depth:i}=hC(),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:O9({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(cLr,{value:{parentPath:u,depth:d,fields:f},children:o.jsx("div",{className:Z("pl-4 border-l border-border1 mt-2",e),children:t})})}function yLr({children:e,...t}){const{addField:r}=S9(),n=mdt(),s=n?n.parentPath:[],a=b.useCallback(()=>{r(s)},[r,s]);return o.jsx(ge,{type:"button",...t,onClick:a,children:e||"Add field"})}const vi={Root:iLr,Field:lLr,FieldList:uLr,FieldName:dLr,FieldType:hLr,FieldOptional:pLr,FieldNullable:mLr,FieldRemove:gLr,NestedFields:vLr,AddField:yLr};function pC({data:e,className:t,labelsAreHidden:r,isLoading:n,LinkComponent:s}){const a=({children:i})=>r?o.jsx(ed,{children:i}):i;return!e||e.length===0?null:o.jsx("dl",{className:Z("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(Te.Fragment,{children:[o.jsxs("dt",{className:Z("text-neutral3 text-ui-md flex items-center gap-8 justify-between min-h-9"),children:[o.jsxs("span",{className:Z("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:Z("text-neutral3","[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:text-neutral3"),children:u})]}),o.jsx("dd",{className:Z("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:Z("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(BIe,{description:h.description,children:o.jsxs(s,{href:h.path,children:[h?.name," ",o.jsx(b_,{})]})},h.id):h.path?o.jsx(BIe,{description:h.description,children:o.jsxs("a",{href:h.path,children:[h?.name," ",o.jsx(b_,{})]})},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 BIe({description:e,children:t}){return e?o.jsxs(yfe,{openDelay:250,children:[o.jsx(bfe,{asChild:!0,children:t}),o.jsx(xfe,{children:o.jsxs(wfe,{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(Sfe,{className:"fill-surface5"})]})})]}):t}function bLr({children:e,className:t}){return o.jsx("div",{className:Z("mt-auto",t),children:e})}function xLr({children:e,className:t}){return o.jsx("nav",{className:Z("",t),children:e})}function gdt({className:e}){return o.jsx("div",{className:Z("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 wLr({children:e,className:t,state:r="default",href:n,isActive:s,LinkComponent:a}){const i=r==="default",l=i?e:o.jsx(ed,{children:e});return o.jsxs("div",{className:Z("grid grid-cols-[auto_1fr] items-center min-h-11",t),children:[o.jsx("header",{className:Z("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:Z("transition-colors duration-normal",{"hover:text-neutral5":!s,"text-black dark:text-white":s}),children:l}):l}),o.jsx(gdt,{})]})}function SLr({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:Z("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(ed,{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(ed,{children:e.name}):e.name," ",r,e.isExperimental&&o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(wF,{className:"ml-auto stroke-accent5"})}),o.jsx(Wr,{side:"right",align:"center",className:"ml-4",children:"Experimental Feature"})]})]})}):r})}function OLr({children:e,className:t}){return o.jsx("ul",{className:Z("grid gap-1 items-start content-center",t),children:e})}function kLr({children:e,className:t}){return o.jsx("section",{className:Z("grid items-start content-center relative",t),children:e})}const vdt="sidebar:state",eme=Te.createContext(null);function tme(){const e=Te.useContext(eme);if(!e)throw new Error("useMainSidebar must be used within a MainSidebarProvider.");return e}function _Lr(){return Te.useContext(eme)}const ELr=e=>{window.localStorage.setItem(vdt,e.toString())};function CLr({children:e}){const[t,r]=Te.useState(()=>"default");Te.useLayoutEffect(()=>{const a=window.localStorage.getItem(vdt);(a==="collapsed"||a==="default")&&r(a)},[]);const n=Te.useCallback(()=>{ELr(t==="default"?"collapsed":"default"),r(t==="default"?"collapsed":"default")},[t]),s=Te.useMemo(()=>({state:t,toggleSidebar:n}),[t,n]);return o.jsx(eme.Provider,{value:s,children:e})}function jLr({children:e,className:t}){const{state:r,toggleSidebar:n}=tme(),s=r==="collapsed";return o.jsxs("div",{className:Z("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:Z("w-[.75rem] h-full right-0 top-0 absolute opacity-10",{"cursor-w-resize":!s,"cursor-e-resize":s}),"aria-label":"Toggle sidebar"})]})}function TLr({className:e}){const{state:t,toggleSidebar:r}=tme(),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:Z("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(Szt,{className:Z({"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(dzt,{})," Ctrl+B"]})]})]})}const Yh=Object.assign(jLr,{Bottom:bLr,Nav:xLr,NavSection:kLr,NavLink:SLr,NavHeader:wLr,NavList:OLr,NavSeparator:gdt,Trigger:TLr});function XH({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:Z("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",sn.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:Z("shrink-0 mt-0.5",p[i]),children:i==="error"||i==="warning"?o.jsx($E,{className:"h-4 w-4"}):o.jsx(DR,{className:"h-4 w-4"})}),o.jsx("div",{className:"flex gap-2 items-start min-w-0",children:e}),a&&o.jsxs(ge,{variant:"ghost",className:Z("h-6 w-6 p-0 shrink-0",sn.colors,"hover:bg-surface5"),onClick:f,children:[o.jsx(Kl,{className:"h-4 w-4"}),o.jsx(ed,{children:"Dismiss"})]})]})}function ydt({children:e,isLoading:t}){return o.jsx("p",{className:Z("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 bdt({children:e,isLoading:t,size:r="default"}){return o.jsx("h1",{className:Z("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 NLr({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:Z("w-full grid",t),children:i?o.jsxs(o.Fragment,{children:[o.jsxs(bdt,{isLoading:a,children:[s," ",r]}),n!==void 0&&o.jsx(ydt,{isLoading:a,children:n})]}):e})}const vn=Object.assign(NLr,{Title:bdt,Description:ydt});function ALr({children:e,className:t}){return o.jsx("header",{className:Z("grid items-center grid-cols-[1fr_auto]",t),children:e})}function ILr({headingLevel:e="h2",children:t,className:r}){const n=e;return o.jsx(n,{className:Z("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 xdt({children:e,className:t}){return o.jsx("section",{className:Z("grid gap-4",t),children:e})}function x1({children:e,className:t}){return o.jsx("section",{className:Z("grid gap-2",t),children:e})}const pl=Object.assign(xdt,{Header:ALr,Heading:ILr});function RLr(){return qE({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8125rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[se.className,se.propertyName]}]})}function PLr(){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=Vp.define([{tag:[se.comment,se.bracket],color:"var(--neutral2)"},{tag:[se.string,se.meta,se.regexp],color:"var(--accent1)"},{tag:[se.atom,se.bool,se.special(se.variableName)],color:"var(--accent6)"},{tag:[se.keyword,se.operator,se.tagName],color:"var(--accent2)"},{tag:[se.function(se.propertyName),se.propertyName],color:"var(--accent5)"},{tag:[se.definition(se.variableName),se.function(se.variableName),se.className,se.attributeName],color:"var(--accent3)"},{tag:[se.variableName,se.number],color:"var(--accent5)"},{tag:[se.name,se.quote],color:"var(--accent1)"}]);return[e,Qx(t)]}const MLr=()=>{const e=AP();return b.useMemo(()=>e?RLr():PLr(),[e])};function DLr({codeStr:e="",title:t,icon:r,simplified:n=!1}){const s=MLr(),[a,i]=b.useState(!1),l=b.useMemo(()=>{try{const u=JSON.parse(e);return tie(u||"")}catch{return!1}},[e]),c=a?e?.replace(/\\n/g,`
293
293
  `):e;return o.jsxs(pl,{children:[o.jsxs(pl.Header,{children:[o.jsxs(pl.Heading,{children:[r,t]}),o.jsxs(ps,{children:[o.jsx(Xa,{content:e||"No content"}),l&&o.jsx(ge,{onClick:()=>i(!a),children:a?o.jsx(cA,{}):o.jsx(b3,{})})]})]}),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(Oc,{extensions:[C_(),ft.lineWrapping],theme:s,value:c})})]})}function tie(e){if(typeof e=="string"){const t=e.indexOf(`
@@ -552,7 +552,7 @@ Token usage: ${r} input + ${n} output = ${s} total`:`The model stopped generatin
552
552
  "groundTruth": "Expected result (optional)",
553
553
  "metadata": { "key": "value" } // optional
554
554
  }
555
- ]`})]})]})}function aCn({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(je,{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 iCn({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:v}=dEn(),{batchInsertItems:x}=ri(),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(sCn,{onFileSelect:w,isParsing:g,error:v?.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(aCn,{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(nCn,{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(Mt,{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(ge,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ge,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(ge,{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(ge,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(kn,{open:t,onOpenChange:_,children:o.jsxs(xn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(_n,{children:[o.jsx(wn,{children:N[s]}),o.jsx(ea,{children:"Import dataset items from a JSON file."})]}),o.jsx(qn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(mf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function oCn({dataset:e,isLoading:t=!1,onEditClick:r,onDuplicateClick:n,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(Ar,{className:c,children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{isLoading:t,children:[o.jsx(ja,{})," ",e?.name]}),o.jsx(Ar.Description,{isLoading:t,children:e?.description}),o.jsxs(Ar.Description,{isLoading:t,children:[o.jsxs(fs,{children:[o.jsx(m_,{})," Created at ",e?.createdAt?ur(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(fs,{children:[o.jsx(Ux,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ar.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(ge,{disabled:!0,tabIndex:-1,children:[o.jsx(hx,{}),"Run Experiment"]})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(ge,{onClick:l,children:[o.jsx(hx,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ge,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(uVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(dy,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(iu,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(id,{})," Delete Dataset"]})]})]})]})})]})}const u1t=e=>{const t=Ge(),{data:r}=yR(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})},lCn=e=>{const t=Ge(),{data:r}=yR(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 cCn(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 uCn=Z("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 yBe({className:e,children:t,...r}){return o.jsx(nP,{children:o.jsx(sz,{className:Z(uCn,e),...r,children:t})})}function dCn({datasetId:e}){const t=Ge(),{data:r}=Rg(e),{data:n,isLoading:s}=u1t(e),{data:a,isLoading:i}=lCn(e),{updateExperimentResult:l}=ri(),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState(new Set),[m,g]=b.useState(!1),[v,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,z]=b.useState(!1),[D,U]=b.useState(null),F=D??n??[];b.useEffect(()=>{n&&D===null&&U(n)},[n]);const B=b.useMemo(()=>{const ye=new Set;if(r?.tags)for(const Ce of r.tags)ye.add(Ce);for(const Ce of F)for(const Fe of Ce.tags)ye.add(Fe);return[...ye].sort()},[r,F]),H=b.useCallback(ye=>{!r||!e||(r.tags??[]).includes(ye)},[r,e]),W=b.useMemo(()=>d?d==="__untagged__"?F.filter(ye=>ye.tags.length===0):F.filter(ye=>ye.tags.includes(d)):F,[F,d]),L=b.useMemo(()=>{const ye=new Map;for(const Ce of F)for(const Fe of Ce.tags)ye.set(Fe,(ye.get(Fe)??0)+1);return[...ye.entries()].sort((Ce,Fe)=>Fe[1]-Ce[1])},[F]),Y=b.useMemo(()=>F.filter(ye=>ye.tags.length===0).length,[F]),q=b.useMemo(()=>{let ye=0;return d&&ye++,m&&ye++,ye},[d,m]),M=b.useCallback((ye,Ce)=>{U(ct=>(ct??[]).map(wt=>wt.id===ye?{...wt,tags:Ce}:wt));const Fe=F.find(ct=>ct.id===ye);Fe?.experimentId&&Fe?.datasetId&&l.mutate({datasetId:Fe.datasetId,experimentId:Fe.experimentId,resultId:Fe.id,tags:Ce})},[F,l]),Q=b.useCallback((ye,Ce)=>{const Fe=F.find(ct=>ct.id===ye);Fe?.traceId&&Ce!==void 0&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ce==="positive"?1:-1,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),U(ct=>(ct??[]).map(wt=>wt.id===ye?{...wt,rating:Ce}:wt))},[F,t]),G=b.useCallback((ye,Ce)=>{const Fe=F.find(ct=>ct.id===ye);Fe?.traceId&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ce,comment:Ce,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),U(ct=>(ct??[]).map(wt=>wt.id===ye?{...wt,comment:Ce}:wt))},[F,t]),J=b.useCallback(ye=>{const Ce=F.find(Fe=>Fe.id===ye);U(Fe=>(Fe??[]).filter(ct=>ct.id!==ye)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ye),ct}),c===ye&&u(null),Ce?.experimentId&&Ce?.datasetId&&l.mutate({datasetId:Ce.datasetId,experimentId:Ce.experimentId,resultId:Ce.id,status:null})},[F,l,c]),ne=b.useCallback(ye=>{const Ce=F.find(Fe=>Fe.id===ye);U(Fe=>(Fe??[]).filter(ct=>ct.id!==ye)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ye),ct}),c===ye&&u(null),Ce?.experimentId&&Ce?.datasetId&&l.mutate({datasetId:Ce.datasetId,experimentId:Ce.experimentId,resultId:Ce.id,status:"complete"})},[F,l,c]),ee=b.useMemo(()=>{const ye=m?a??[]:W;return!m||!d?ye:d==="__untagged__"?ye.filter(Ce=>Ce.tags.length===0):ye.filter(Ce=>Ce.tags.includes(d))},[m,a,W,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(ee.map(ye=>ye.id)),[ee]),ce=b.useMemo(()=>[...h].filter(ye=>ie.has(ye)).length,[h,ie]),K=ee.length>0&&ce===ee.length,ae=ce>0&&!K,le=b.useCallback(ye=>{p(Ce=>{const Fe=new Set(Ce);return Fe.has(ye)?Fe.delete(ye):Fe.add(ye),Fe})},[]),xe=b.useCallback(()=>{p(K?new Set:new Set(ee.map(ye=>ye.id)))},[K,ee]),fe=b.useCallback(ye=>{for(const Ce of h){const Fe=F.find(ct=>ct.id===Ce);Fe&&!Fe.tags.includes(ye)&&M(Ce,[...Fe.tags,ye])}},[F,h,M]),he=b.useCallback(ye=>{for(const Ce of h){const Fe=F.find(ct=>ct.id===Ce);Fe&&Fe.tags.includes(ye)&&M(Ce,Fe.tags.filter(ct=>ct!==ye))}},[F,h,M]),me=b.useCallback(()=>{for(const ye of h)ne(ye);p(new Set)},[h,ne]),ue=b.useCallback(()=>{for(const ye of h)J(ye);p(new Set)},[h,J]),Se=b.useCallback(()=>{_(""),S(!0)},[]),X=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ye=F.filter(Fe=>h.has(Fe.id));if(ye.length===0){x(!1);return}const Ce=await t.clusterFailures({modelId:`${E}/${j}`,items:ye.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:B.length>0?B:void 0,prompt:k||void 0});Ce.proposedTags&&Ce.proposedTags.length>0&&(P(Ce.proposedTags.map(Fe=>({...Fe,accepted:!0}))),z(!0))}catch(ye){console.error("Analysis failed:",ye)}finally{x(!1)}}},[E,j,F,h,t,B,k]),oe=b.useCallback(()=>{for(const ye of I){if(!ye.accepted)continue;const Ce=F.find(Fe=>Fe.id===ye.itemId);if(Ce){const Fe=[...new Set([...Ce.tags,...ye.tags])];M(Ce.id,Fe)}}z(!1)},[I,F,M]),we=b.useCallback(ye=>{u(Ce=>Ce===ye?null:ye)},[]),Ae=b.useMemo(()=>c?ee.find(ye=>ye.id===c)??null:null,[c,ee]),$e=b.useCallback(()=>{if(!c||ee.length===0)return;const ye=ee.findIndex(Ce=>Ce.id===c);ye<ee.length-1&&u(ee[ye+1].id)},[c,ee]),be=b.useCallback(()=>{if(!c||ee.length===0)return;const ye=ee.findIndex(Ce=>Ce.id===c);ye>0&&u(ee[ye-1].id)},[c,ee]),_e=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(Mt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx(kn,{open:w,onOpenChange:S,children:o.jsxs(xn,{children:[o.jsxs(_n,{children:[o.jsx(wn,{children:"Analyze Items"}),o.jsx(ea,{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(Pg,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Mg,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(ve,{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(wc,{value:k,onChange:ye=>_(ye.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(mf,{children:[o.jsx(ge,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(ge,{onClick:X,disabled:!E||!j||v,children:[v?o.jsx(Mt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(kn,{open:R,onOpenChange:z,children:o.jsxs(xn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(_n,{children:[o.jsx(wn,{children:"Review Proposed Tags"}),o.jsxs(ea,{children:[I.filter(ye=>ye.accepted).length," of ",I.length," proposals selected"]})]}),o.jsx("div",{className:"space-y-3 py-2",children:I.map((ye,Ce)=>{const Fe=F.find(ct=>ct.id===ye.itemId);return o.jsx("div",{className:Z("p-3 border rounded-lg",!ye.accepted&&"opacity-50"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(di,{checked:ye.accepted,onCheckedChange:ct=>P(wt=>wt.map((or,Ve)=>Ve===Ce?{...or,accepted:!!ct}:or))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(ve,{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):ye.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ye.tags.map((ct,wt)=>o.jsx(r1t,{tag:ct,onRename:or=>P(Ve=>Ve.map((qe,Ie)=>Ie===Ce?{...qe,tags:qe.tags.map((Le,Re)=>Re===wt?or:Le)}:qe)),onRemove:()=>P(or=>or.map((Ve,qe)=>qe===Ce?{...Ve,tags:Ve.tags.filter((Ie,Le)=>Le!==wt)}:Ve))},`${ct}-${wt}`))}),ye.reason&&o.jsx(ve,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ye.reason})]})]})},ye.itemId)})}),o.jsxs(mf,{children:[o.jsx(ge,{variant:"outline",onClick:()=>z(!1),children:"Cancel"}),o.jsxs(ge,{onClick:oe,disabled:I.filter(ye=>ye.accepted).length===0,children:["Accept ",I.filter(ye=>ye.accepted).length," proposals"]})]})]})}),o.jsxs(of,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ge,{variant:"outline",size:"md",children:[o.jsx(dVe,{}),"Filter",q>0&&o.jsx("span",{className:Z("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:q})]})}),o.jsxs(yt.Content,{align:"start",className:Z("min-w-48"),children:[o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Z("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(yBe,{children:[o.jsx(yt.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ye=>ye.preventDefault(),children:"Review Queue"}),o.jsx(yt.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ye=>ye.preventDefault(),children:"Completed"})]})]}),o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Z("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(yBe,{children:[o.jsx(yt.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ye=>ye.preventDefault(),children:"All"}),Y>0&&o.jsx(yt.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ye=>ye.preventDefault(),children:"Untagged"}),L.length>0&&o.jsx(yt.Separator,{}),L.map(([ye])=>o.jsx(yt.CheckboxItem,{checked:d===ye,onCheckedChange:()=>f(d===ye?null:ye),onSelect:Ce=>Ce.preventDefault(),children:ye},ye))]})]}),q>0&&o.jsxs(o.Fragment,{children:[o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(Nn,{}),"Clear all filters"]})]})]})]}),q>0&&o.jsxs(ge,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(Nn,{}),"Reset"]})]}),!m&&h.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(t1t,{selectedCount:h.size,vocabulary:B,onApplyTag:fe,onRemoveTag:he,onNewTag:ye=>fe(ye)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ge,{disabled:v,children:[v?o.jsx(Mt,{className:"w-4 h-4"}):o.jsx(je,{size:"sm",children:o.jsx(Gn,{})}),"Actions"]})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:me,children:[o.jsx(je,{size:"sm",children:o.jsx(dx,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:ue,children:[o.jsx(je,{size:"sm",children:o.jsx(id,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Se,children:[o.jsx(je,{size:"sm",children:o.jsx(g_,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Mt,{className:"w-6 h-6"})}):ee.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(ve,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(ve,{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(Oe,{columns:_e,children:[o.jsxs(Oe.Top,{children:[!m&&o.jsx(Oe.TopCell,{children:o.jsx(di,{checked:K?!0:ae?"indeterminate":!1,onCheckedChange:()=>xe(),"aria-label":"Select all"})}),m&&o.jsx(Oe.TopCell,{children:" "}),o.jsx(Oe.TopCell,{children:"Input"}),o.jsx(Oe.TopCell,{children:"Comment"}),o.jsx(Oe.TopCell,{children:"Tags"}),!Ae&&o.jsx(Oe.TopCell,{children:"Rating"}),!Ae&&o.jsx(Oe.TopCell,{children:"Scores"})]}),o.jsx(Oe.Rows,{children:ee.map(ye=>{const Ce=ye.scores?Object.entries(ye.scores):[];return o.jsxs(Oe.Row,{onClick:()=>we(ye.id),selected:c===ye.id,children:[o.jsx(Oe.Cell,{children:m?ye.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(di,{checked:h.has(ye.id),onCheckedChange:()=>le(ye.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ye.id}`})}),o.jsx(Oe.NameCell,{children:cCn(ye.input,80)}),o.jsx(Oe.Cell,{children:ye.comment?o.jsx(ve,{variant:"ui-xs",className:"text-neutral3 truncate",children:ye.comment}):o.jsx(ve,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Oe.Cell,{children:ye.tags.length>0?o.jsx(ve,{variant:"ui-xs",className:"text-neutral4 truncate",children:ye.tags.join(", ")}):o.jsx(ve,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Ae&&o.jsxs(Oe.Cell,{children:[ye.rating==="positive"&&o.jsx(je,{size:"sm",className:"text-positive1",children:o.jsx(rce,{})}),ye.rating==="negative"&&o.jsx(je,{size:"sm",className:"text-negative1",children:o.jsx(tce,{})}),!ye.rating&&o.jsx(ve,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Ae&&o.jsx(Oe.Cell,{children:Ce.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(je,{size:"sm",className:"text-neutral3",children:o.jsx(Ma,{})}),o.jsx(ve,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ce[0][1].toFixed(2)}),Ce.length>1&&o.jsxs(gt,{variant:"default",children:["+",Ce.length-1]})]}):o.jsx(ve,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ye.id)})})]})]}),Ae&&o.jsx(e1t,{item:Ae,isCompleted:m,tagVocabulary:B,onRate:ye=>Q(Ae.id,ye),onSetTags:ye=>{M(Ae.id,ye);for(const Ce of ye)B.includes(Ce)||H(Ce)},onComment:ye=>G(Ae.id,ye),onRemove:()=>J(Ae.id),onComplete:m?void 0:()=>ne(Ae.id),onPrevious:be,onNext:$e,onClose:()=>u(null)})]})]})}function fCn({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}=ir(),[h,p]=b.useState(u??"items"),m=Ut=>{p(Ut),d?.(Ut)},[g,v]=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),[z,D]=b.useState([]),[U,F]=b.useState(!1),[B,H]=b.useState(0),[W,L]=b.useState(null),[Y,q]=b.useState(""),[M]=ccr(Y,300),[Q,G]=b.useState(null),ne=l!==void 0?l:Q,{data:ee,isLoading:re}=Rg(e),{data:ie=[],total:ce,isLoading:K,setEndOfListElement:ae,isFetchingNextPage:le,hasNextPage:xe}=kE(e,M||void 0,ne),{data:fe=[],total:he,isLoading:me}=kE(e,void 0,ne),[ue,Se]=b.useState({}),{data:X,isLoading:oe}=yR(e,void 0,ue),{data:we}=yR(e),{deleteItems:Ae}=ri(),$e=X?.experiments??[],be=we?.experiments??[],_e=TEn({hasSearchQuery:!!M,filteredItemsLength:ie.length,unfilteredItemsTotal:he,itemsTotal:ce}),{data:ye}=u1t(e),Ce=ye?.length??0,Fe=Ut=>{L(Ut)},ct=()=>{L(null)},wt=Ut=>{const Lr=Ut.isCurrent?null:Ut;c?c(Lr):G(Ut.isCurrent?null:Ut.version)},or=Ut=>{E(Ut),k(!0)},Ve=Ut=>{I(Ut),j(!0)},qe=Ut=>{j(Ut),Ut||(I([]),H(Lr=>Lr+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:z}),ze.success(`Deleted ${z.length} items`),R(!1),D([]),H(Ut=>Ut+1)},rt=Ut=>{k(!1),E([]),H(Lr=>Lr+1),i?.(Ut)},ht=Ut=>{k(Ut),Ut||(E([]),H(Lr=>Lr+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Z("h-full w-full",sn.allSlow),children:o.jsxs("div",{className:Z("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",W?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(oCn,{dataset:ee,isLoading:re,onEditClick:r,onDuplicateClick:()=>F(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!me&&fe.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(Ss,{value:"items",children:["Items ",o.jsx($a,{color:"gray",children:_e})]}),o.jsxs(Ss,{value:"experiments",children:["Experiments",o.jsx($a,{color:"gray",children:$e.length})]}),o.jsxs(Ss,{value:"review",children:["Review",Ce>0&&o.jsx($a,{color:"orange",children:Ce})]})]}),o.jsx(Ps,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(rCn,{datasetId:e,items:ie,isLoading:K,featuredItemId:W,onItemSelect:Fe,onItemClose:ct,onAddClick:s??(()=>{}),onImportClick:()=>v(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Re,onCreateDatasetClick:or,onAddToDatasetClick:Ve,onCompareItemsClick:Ie,datasetName:ee?.name,clearSelectionTrigger:B,setEndOfListElement:ae,isFetchingNextPage:le,hasNextPage:xe,searchQuery:Y,onSearchChange:q,activeDatasetVersion:ne,currentDatasetVersion:ee?.version,onVersionSelect:wt,onCompareVersionsClick:Le})}),o.jsx(Ps,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(HEn,{experiments:$e,allExperiments:be,isLoading:oe,datasetId:e,filters:ue,onFiltersChange:Se})}),o.jsx(Ps,{value:"review",className:"overflow-auto mt-0",children:o.jsx(dCn,{datasetId:e})})]})})]})})}),o.jsx(LEn,{datasetId:e,open:g,onOpenChange:v}),o.jsx(iCn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(OEn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(kEn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(_En,{open:U,onOpenChange:F,sourceDatasetId:e,sourceDatasetName:ee?.name||"",sourceDatasetDescription:ee?.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 ",z.length," item",z.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 hCn(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 bBe({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 pCn({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}=ri(),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=hCn(_);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)},v=()=>{a("{}"),l(""),u(""),f(null),r(!1)};return o.jsx(kn,{open:t,onOpenChange:r,children:o.jsxs(xn,{className:"max-w-lg",children:[o.jsx(_n,{children:o.jsx(wn,{children:"Add Item"})}),o.jsx(qn,{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(hs,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(bBe,{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(hs,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(bBe,{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(hs,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(ge,{type:"button",onClick:v,children:"Cancel"}),o.jsx(ge,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function mCn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=md(),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(xut,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const gCn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function vCn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Ng(),{data:l,isLoading:c}=o0(),{data:u,isLoading:d}=md(),f=e==="agent"?Object.entries(a??{}).map(([g,v])=>({value:g,label:v.name??g})):e==="workflow"?Object.entries(l??{}).map(([g,v])=>({value:g,label:v.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,v])=>({value:g,label:v.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(Jl,{options:gCn,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(Jl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function yCn({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}=ri(),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});xc.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";xc.error(w)}},v=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(kn,{open:r,onOpenChange:v,children:o.jsxs(xn,{ref:a,children:[o.jsxs(_n,{children:[o.jsx(wn,{children:"Run Experiment"}),o.jsx(ea,{children:t?`Execute items from ${ur(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(qn,{className:"grid gap-6",children:[o.jsx(vCn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(mCn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(mf,{className:"px-6 pt-4",children:[o.jsx(ge,{onClick:v,disabled:m,children:"Cancel"}),o.jsx(ge,{variant:"primary",onClick:g,disabled:!p||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Mt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const d1t=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})},xBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function bCn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=qte(e?.input),d=qte(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(gC,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(ge,{onClick:a,disabled:!e.traceId,children:[o.jsx(ece,{}),"Show Trace"]}),o.jsx(ge,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(Nn,{})})]})]}),o.jsxs(gr.Content,{children:[o.jsx(Ar,{withMargins:!1,children:o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(hx,{})," ",e.id]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{children:[o.jsx(fx,{})," ",e.itemId]})})]})}),c&&o.jsxs(ml,{variant:"destructive",children:[o.jsx(W2t,{}),o.jsxs(ml.Message,{children:[o.jsx("strong",{children:"Error: "}),qte(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:xBe,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:xBe,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(IE,{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(Xt.CodeSection,{title:"Input",icon:o.jsx(fx,{}),codeStr:u}),o.jsx(Xt.CodeSection,{title:"Output",icon:o.jsx(yc,{}),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(m_,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:ur(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function qte(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function xCn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Xt.CodeSection,{title:"Input",icon:o.jsx(Np,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Xt.CodeSection,{title:"Output",icon:o.jsx(yc,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Xt.CodeSection,{title:"Metadata",icon:o.jsx(yl,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Xt.CodeSection,{title:"Attributes",icon:o.jsx(yl,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function wCn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=OE(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(gC,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(ge,{onClick:s,"aria-label":"Close span details",children:o.jsx(Nn,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(yl,{})," Span ",af(t)]})})}),o.jsx(xCn,{span:i})]})]})}const SCn=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 f1t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...f1t(r))}),t}const wBe=["agent","workflow","model","mcp","tool","workspace","other"];function h1t(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(pa,{}),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(Mi,{}),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(gp,{}),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(vl,{}),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(Pi,{}),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(w9,{}),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 OCn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Z("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(SBe,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(Gle,{}):o.jsx(uy,{}):o.jsx(Gn,{})]}),a>(l??0)&&!i&&o.jsxs(SBe,{onClick:()=>s?.(),children:[a," ",o.jsx(Wle,{})]})]}):null})}function SBe({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Z("h-full",r),children:o.jsx("div",{className:Z("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 kCn({isLastChild:e,hasChildren:t=!1,expanded:r=!1}){return o.jsx("div",{className:Z("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:Z("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(rVe,{}):o.jsx(tVe,{})})})}function _Cn({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:Z({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(kCn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function p1t({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=f1t(e),v=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(_Cn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(OCn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:N,numOfChildren:m}),p&&S&&e.spans?.map((I,P,R)=>{const z=P===R.length-1;return o.jsx(p1t,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:z,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:h,featuredSpanIds:d},I.id)})]})}function ECn({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:Z("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(Mt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(p1t,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function CCn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=wBe.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!wBe.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=Qtt(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(Ex,{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(Kut,{children:[c.map(h=>{const p=h1t(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(ge,{onClick:()=>d(h),className:m?"opacity-40":"",style:{color:m?void 0:p?.color,backgroundColor:p?.bgColor},children:[p?.icon&&o.jsx(je,{children:p.icon}),p?.label]})},h)}),u&&o.jsxs(ge,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(je,{children:o.jsx(tF,{})}),"Other"]}),o.jsx(ge,{onClick:n,disabled:t?.length===0,children:o.jsx(je,{children:o.jsx(Nn,{})})})]})]})}function jCn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=d1t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>SCn(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 v=S=>{r?.(t===S?void 0:S)},x=S=>{d(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(gr.Toolbar,{children:o.jsx(ge,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(Nn,{})})}),o.jsxs(gr.Content,{children:[o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(Di,{})," Trace ",af(e)]})})}),o.jsx(CCn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(ECn,{hierarchicalSpans:g,onSpanClick:v,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function TCn({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(Oe,{columns:d,children:[o.jsx(Oe.Top,{children:s.map(f=>o.jsx(Oe.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Mt,{})})]}):e.length===0?o.jsxs(Oe,{columns:d,children:[o.jsx(Oe.Top,{children:s.map(f=>o.jsx(Oe.TopCell,{children:f.label},f.name))}),o.jsx(Oe.NoMatch,{message:"No results yet"})]}):o.jsxs(Oe,{columns:d,children:[o.jsx(Oe.Top,{children:s.map(f=>o.jsx(Oe.TopCell,{children:f.label},f.name))}),o.jsxs(Oe.Rows,{children:[e.map(f=>{const h=!!f.error,p=f.id===r;return o.jsxs(Oe.Row,{onClick:()=>n(f.id),selected:p,children:[o.jsx(Oe.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(Oe.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:Z("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(Oe.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:ACn(NCn(f.input),200)})}),i?.map(m=>{const v=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(Oe.TextCell,{children:o.jsx("span",{className:"font-mono",children:v!=null?v.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(Mt,{})}),!u&&e.length>0&&o.jsx(ve,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function NCn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function ACn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function ICn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function RCn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=ICn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(gC,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(ge,{onClick:n,"aria-label":"Close score details",children:o.jsx(Nn,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(Ma,{})," ",e.scorerId]})})}),o.jsxs(IS,{children:[o.jsx(Xt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(Ma,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Xt.CodeSection,{title:"Input",icon:o.jsx(fx,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Xt.CodeSection,{title:"Output",icon:o.jsx(yc,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Xt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(cc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Xt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(cc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Xt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(cc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Xt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(cc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const OBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function PCn({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(Ka,{iconSlot:o.jsx(Ma,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:OBe,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:OBe,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 m1t({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(B=>B.id===l)??null,{data:v}=iSt(e,t),x=b.useMemo(()=>{if(!v)return[];const B=new Set;for(const H of Object.values(v))for(const W of H)B.add(W.scorerId);return[...B].sort()},[v]),{data:w}=d1t(u),S=w?.spans??[],k=()=>{if(!f)return;const B=S.findIndex(H=>H.spanId===f);if(B>=0&&B<S.length-1)return()=>h(S[B+1].spanId)},_=()=>{if(!f)return;const B=S.findIndex(H=>H.spanId===f);if(B>0)return()=>h(S[B-1].spanId)},E=B=>{c(B),d(null),h(void 0),m(null)},T=B=>{E(B===l?null:B)},j=()=>{E(null)},N=()=>{if(!g)return;const B=r.findIndex(H=>H.id===g.id);if(B>=0&&B<r.length-1)return()=>E(r[B+1].id)},I=()=>{if(!g)return;const B=r.findIndex(H=>H.id===g.id);if(B>0)return()=>E(r[B-1].id)},P=g?v?.[g.itemId]:void 0,R=P?.find(B=>B.id===p)??null,z=B=>{m(B===p?null:B),d(null),h(void 0)},D=()=>{if(!p||!P)return;const B=P.findIndex(H=>H.id===p);if(B>=0&&B<P.length-1)return()=>m(P[B+1].id)},U=()=>{if(!p||!P)return;const B=P.findIndex(H=>H.id===p);if(B>0)return()=>m(P[B-1].id)},F=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(B=>({name:B,label:B,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(Ss,{value:"summary",children:"Summary"}),o.jsx(Ss,{value:"results",children:"Results"})]}),o.jsx(Ps,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(PCn,{scoresByItemId:v,experimentStatus:t})}),o.jsx(Ps,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(of,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(gr,{children:o.jsx(TCn,{results:r,isLoading:n,featuredResultId:l,onResultClick:T,columns:F,scoresByItemId:v,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(KLr,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(bCn,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:z,featuredScoreId:p,onShowTrace:()=>{d(g.traceId??null),h(void 0),m(null)}})}),g&&!u&&R&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(RCn,{score:R,onNext:D(),onPrevious:U(),onClose:()=>m(null)})}),g&&u&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(jCn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(wCn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const MCn={pending:o.jsx(jE,{}),running:o.jsx(u3,{}),completed:o.jsx(ra,{}),failed:o.jsx(Nn,{})};function DCn({experiment:e,className:t}){const r=e.status,n=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Z("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:Z("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:MCn[r]}),e.status]}),o.jsxs("div",{className:Z("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}=ir(),{data:s}=Ng(),{data:a}=o0(),{data:i}=md(),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(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(sVe,{}),e," ",e&&o.jsx(Xa,{content:e})]}),o.jsxs(Ar.Description,{children:[o.jsxs(fs,{children:[o.jsx(m_,{})," Created at ",ur(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(fs,{children:[o.jsx(m_,{})," Completed at ",ur(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(Ar.Description,{children:[o.jsxs(fs,{children:[o.jsx(SMt,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(fs,{children:[o.jsx(nF,{})," 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(Xa,{content:t.agentVersion})]})]})]}),o.jsx(Ar.Column,{children:o.jsx(DCn,{experiment:t})})]})}function pye({delta:e}){const t=e>0?o.jsx($a,{size:"small",color:"green",intensity:"muted",children:o.jsx(eF,{})}):e<0?o.jsx($a,{size:"small",color:"red",intensity:"muted",children:o.jsx(Qle,{})}):null;return o.jsxs("span",{className:Z("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 PL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function LCn({item:e,baselineId:t,contenderId:r,baselineVersion:n,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[r],d=!!(c&&u),f=new Set;if(c)for(const p of Object.keys(c.scores))f.add(p);if(u)for(const p of Object.keys(u.scores))f.add(p);const h=[...f].sort();return o.jsxs(gr,{withLeftSeparator:!0,children:[o.jsxs(gr.Toolbar,{children:[o.jsx(gC,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(ge,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(Nn,{})})})]}),o.jsxs(gr.Content,{className:"pb-6",children:[o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(fx,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(IS,{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,v=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):"-"]}),v!=null&&o.jsx(pye,{delta:v})]})]},p)})})]}),o.jsx(Xt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx($a,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(yc,{}),codeStr:PL(c?.output)}),o.jsx(Xt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx($a,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(yc,{}),codeStr:PL(u?.output)}),o.jsx(Xt.CodeSection,{title:"Item Input",icon:o.jsx(Np,{}),codeStr:PL(e.input)}),o.jsx(Xt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(SVe,{}),codeStr:PL(e.groundTruth)})]})}):o.jsxs(ml,{variant:"warning",children:[o.jsx(Eh,{}),o.jsx(ml.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 $Cn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(gr,{children:o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:a,children:[o.jsx(Pt.HeaderCol,{children:"Item ID"}),!s&&n.map(l=>o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[r],d=!!(c&&u);return o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Pt.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:n.map(f=>{const h=c?.scores[f]??null,p=u?.scores[f]??null,m=h!=null&&p!=null?p-h:null;return o.jsx(Pt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[h?.toFixed(2)," → ",p?.toFixed(2)]}),o.jsx(pye,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const FCn={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 kBe({datasetId:e,experiment:t,type:r}){const{Link:n}=ir(),{label:s,color:a,customStyle:i}=FCn[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($a,{size:"small",color:a,children:[s,o.jsx(yh,{})]}),o.jsx(ge,{as:n,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),r==="baseline"&&o.jsxs($a,{size:"small",color:a,children:[o.jsx(Tp,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(fs,{children:[o.jsx(SVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(fs,{children:[o.jsx(fVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(fs,{children:[o.jsx(YUe,{})," ",ur(l,"MMM d, yyyy HH:mm")]})]})]})}function zCn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=tEn(e,t,r),{data:u}=F6(e,t),{data:d}=F6(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,z=0;for(const B of i.items){const H=B.results[T]?.scores[N],W=B.results[j]?.scores[N];H!=null&&(I+=H,R++),W!=null&&(P+=W,z++)}const D=R>0?I/R:null,U=z>0?P/z:null,F=D!=null&&U!=null?U-D:null;return{scorerId:N,avgA:D,avgB:U,delta:F}})},[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]),v=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(Mt,{})});if(c)return o.jsxs(ml,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(ml.Column,{children:[o.jsx(ml.Title,{children:"Error loading comparison"}),o.jsx(ml.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:Z("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(kBe,{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(ge,{onClick:n,children:"VS"})}),o.jsx(Wr,{children:"Switch the order"})]})})}),o.jsx(kBe,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsxs(ml,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(ml.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(qIe,{children:[o.jsx($a,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx($a,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(qIe,{children:[o.jsx($a,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx($a,{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(pye,{delta:I}):"-"})]},T))})})]}),o.jsxs(of,{className:Z({"grid-cols-[1fr_2fr]":!!v}),children:[o.jsx($Cn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!v&&o.jsx(LCn,{item:v,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function BCn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=hye(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)},v=()=>{u.size===2&&n?.([...u])};return o.jsxs(gr,{className:"min-w-56",children:[l?o.jsx(gr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ge,{onClick:m,children:"Cancel"}),o.jsx(Cn,{variant:"primary",disabled:u.size!==2,onClick:v,tooltipContent:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):o.jsx(o.Fragment,{children:(a||[]).length>1&&o.jsx(gr.Toolbar,{children:o.jsxs(ge,{onClick:g,className:"w-full",children:[o.jsx(Wm,{})," Compare Ver."]})})}),i?o.jsx(UCn,{}):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(di,{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 UCn(){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 VCn(e,t){if(t){const r=typeof t=="string"?new Date(t):t;return`v${e} ${ur(r,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function qCn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=dye(e),a=(s??[]).map(i=>({value:String(i.version),label:`${VCn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(gr.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx(Lo,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>n?.(i,r??"")}),o.jsx(Lo,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:r??"",onValueChange:i=>n?.(t??"",i)}),o.jsx("div",{})]})}const HCn=[{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"}],QCn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(cs,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(wVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(RMt,{}),tooltip:"Same in both versions"}};function Hte({red:e=!1,tooltip:t}){return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(dPt,{className:Z("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Wr,{children:t})]})}function K0({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}=QCn[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($a,{color:r,size:"small",children:n})]})}),o.jsx(Wr,{children:s})]})}function WCn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function GCn({datasetId:e,versionA:t,versionB:r,allItems:n,itemsAMap:s,itemsBMap:a}){const{Link:i}=ir(),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=WCn(u,d);return o.jsxs(Pt.Row,{columns:HCn,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(K0,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(K0,{variant:"changed",version:u.datasetVersion}):o.jsx(K0,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(Hte,{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(K0,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(K0,{variant:"changed",version:d.datasetVersion}):o.jsx(K0,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(Hte,{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(K0,{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(Hte,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const _Be={needsReview:"#facc15",complete:"#22c55e"},ZCn=[{label:"Needs Review",color:_Be.needsReview},{label:"Reviewed",color:_Be.complete}];function YCn({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 v=u.get(m.experimentId),x=v?.datasetId?d.get(v.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(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Ht.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Ht.Loading,{}):s?o.jsx(Ht.Error,{message:"Failed to load review data"}):o.jsx(Ht.Content,{children:c?o.jsx(K_,{data:a,segments:ZCn,maxVal:i,fmt:u=>String(u)}):o.jsx(Ht.NoData,{message:"No items have been sent to review yet"})})]})}function mye(){const e=Ge();return kt({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function v1t(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 XCn(e,t){const r=new Map,n=v1t(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 KCn(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 JCn=10;function ejn(){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:JCn}),{data:g,isLoading:v,error:x}=W8(),{data:w}=mye(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>bEn(S),[S]),T=b.useMemo(()=>XCn(w,_),[w,_]),j=p||v,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(W=>W+1),[]),R=b.useCallback(()=>f(W=>Math.max(0,W-1)),[]),z=b.useCallback(W=>{n(W),f(0)},[]),D=b.useCallback(W=>{a(W),f(0)},[]),U=b.useCallback(W=>{l(W),f(0)},[]),F=b.useCallback(W=>{u(W),f(0)},[]);if(N&&Ts(N))return o.jsx(qr,{title:"Datasets",icon:o.jsx(ja,{}),children:o.jsx(Ys,{})});if(N&&ys(N))return o.jsx(qr,{title:"Datasets",icon:o.jsx(ja,{}),children:o.jsx(Us,{resource:"datasets"})});if(N)return o.jsx(qr,{title:"Datasets",icon:o.jsx(ja,{}),children:o.jsx(Ic,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(qr,{title:"Datasets",icon:o.jsx(ja,{}),children:o.jsx(xEn,{onCreateClick:I})}),o.jsx(ble,{open:e,onOpenChange:t})]});const B=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(vn,{children:o.jsxs(vn.Title,{isLoading:j,children:[o.jsx(ja,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(cs,{})}),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(SEn,{search:r,onSearchChange:z,targetFilter:s,onTargetFilterChange:D,experimentFilter:i,onExperimentFilterChange:U,tagFilter:c,onTagFilterChange:F,tagOptions:E,onReset:H,hasActiveFilters:B})]}),o.jsx(gEn,{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(ble,{open:e,onOpenChange:t})]})}const tjn=new Set(["items","experiments","review"]);function rjn(){const{datasetId:e}=na(),t=mu(),[r,n]=ao(),s=r.get("tab"),a=s&&tjn.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,v]=b.useState(null),{data:x,error:w}=Rg(e??"");if(!e)return o.jsx(Fr,{children:o.jsx(gf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Ts(w))return o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})});if(w&&ys(w))return o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},k=()=>{t("/datasets")},_=E=>{v(E?.version??null)};return o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:"span",to:"",isCurrent:!0,children:o.jsx(jEn,{value:e,variant:"ghost"})})]})}),o.jsxs(gf,{className:"content-stretch",children:[o.jsx(fCn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(ge,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(hx,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(yCn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(pCn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(EEn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(CEn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function njn(){const{datasetId:e,experimentId:t}=na(),{data:r}=Rg(e??""),{data:n,isLoading:s,error:a}=F6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=D8({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:s?o.jsx(Fr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Mt,{})})}):a&&Ts(a)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):a&&ys(a)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):a||!n?o.jsx(Fr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:r?.name}),o.jsx(Cr,{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(m1t,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function sjn(){const{datasetId:e}=na(),[t,r]=ao(),{data:n,error:s}=Rg(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Ts(s)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):s&&ys(s)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsxs(Cr,{isCurrent:!0,as:"span",children:[o.jsx(je,{children:o.jsx(Wm,{})}),"Compare Experiments"]})]})}),o.jsx(gf,{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(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(Cr,{isCurrent:!0,as:"span",children:[o.jsx(je,{children:o.jsx(Wm,{})}),"Experiments Comparison"]})]})}),o.jsx(gf,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(Wm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ar.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(Ar.Column,{children:o.jsxs(ge,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Tp,{}),"Back to Dataset"]})})]}),o.jsx(zCn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function ajn(){const{datasetId:e,itemId:t}=na(),{Link:r}=ir(),n=mu(),{data:s,isLoading:a,error:i}=hye(e??"",t??""),{updateItem:l,deleteItem:c}=ri(),{data:u}=Rg(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,[v,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=q=>{p(f?q:q.isLatest?null:q)},z=()=>{p(null)},D=!f&&h!=null,U=()=>{D||x(!0)},F=()=>{D||P(!0)},B=async()=>{if(!e||!t)return;let q;try{q=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 Q;if(E.trim())try{Q=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:q,groundTruth:M,metadata:Q}),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)},W=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),n(`/datasets/${e}`)}catch(q){ze.error(`Failed to delete item: ${q instanceof Error?q.message:"Unknown error"}`)}},L=h??d,Y=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&&Ts(i)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):i&&ys(i)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(Fr,{children:o.jsx(gf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:u?.name}),o.jsx(Cr,{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(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(fx,{}),t," ",o.jsx(Xa,{content:t})]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{children:["Item of ",o.jsx(ja,{})," ",u?.name]})}),o.jsxs(Ar.Description,{children:[o.jsxs(fs,{children:[o.jsx(m_,{})," Created at"," ",d?.createdAt?ur(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(fs,{children:[o.jsx(Ux,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ar.Column,{children:!v&&!f&&o.jsxs(ps,{children:[o.jsxs(ge,{onClick:U,disabled:D,title:D?"Return to latest version to edit":void 0,children:[o.jsx(wVe,{})," Edit"]}),o.jsxs(ge,{onClick:F,disabled:D,title:D?"Return to latest version to delete":void 0,children:[o.jsx(id,{})," Delete"]})]})})]}),o.jsxs(of,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(gr,{withRightSeparator:!v,children:[f&&d&&o.jsxs(ml,{variant:"destructive",children:[o.jsx(Eh,{}),o.jsxs(ml.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&D&&h&&o.jsx(o.Fragment,{children:o.jsxs(ml,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(ml.Message,{children:["Viewing version v",h.datasetVersion]}),o.jsxs(ml.Button,{onClick:z,children:[o.jsx(sh,{})," Return to the latest version"]})]})}),v?o.jsx(l1t,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:B,onCancel:H,isSaving:l.isPending}):Y?o.jsx(G8,{item:Y,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&o.jsx(gr,{children:o.jsx(BCn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:q=>{n(`/datasets/${e}/items/${t}/versions?ids=${q.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:W,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function EBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function ijn(){const{datasetId:e}=na(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Rg(e??""),{Link:i}=ir(),[l,c]=b.useState(!1),{data:u}=gle(e??"",n[0]??""),{data:d}=gle(e??"",n[1]??"");return a&&Ts(a)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):a&&ys(a)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):!e||n.length<2?o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(gf,{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(Fr,{children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(je,{children:o.jsx(Tp,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Z("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(Wm,{}),"Compare Dataset Items"]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{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(Ar.Column,{children:o.jsxs(ps,{children:[o.jsxs(ge,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Tp,{}),"Back to Dataset"]}),o.jsx(ge,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(cVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(_Mt,{})," Diff View"]})})]})})]}),o.jsx(of,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(ojn,{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:Z("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(Sdt,{codeA:EBe(u),codeB:EBe(d)})]})})]})}function ojn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=gle(e,t),{data:u}=kE(e),d=new Set(s.filter((h,p)=>p!==n)),f=(u??[]).map(h=>({value:h.id,label:h.id,disabled:d.has(h.id)}));return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"flex gap-4",children:[o.jsx(Rme,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(ge,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Ux,{}),"Versions"]})]}),i&&o.jsx(gr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(c1t,{item:l}),o.jsx(G8,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function CBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function ljn(){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}=Rg(e??""),{Link:u}=ir(),{data:d}=hye(e??"",t??""),{data:f}=wle(e??"",t??"",i[0]??0,l?.version),{data:h}=wle(e??"",t??"",i[1]??0,l?.version);return c&&Ts(c)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):c&&ys(c)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(gf,{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(Fr,{children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:l?.name}),o.jsx(Cr,{as:dr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(je,{children:o.jsx(Tp,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Z("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(Wm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{children:["Comparing ",i.length," versions of"," ",o.jsx(dr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ar.Column,{children:o.jsxs(ps,{children:[o.jsxs(ge,{as:dr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Tp,{}),"Back to Item"]}),o.jsx(ge,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(cVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(l2t,{})," Diff View"]})})]})})]}),o.jsx(of,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(cjn,{datasetId:e,itemId:t,datasetVersion:p,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const v=[...i];v[m]=g,n({ids:v.join(",")})}}),m===0&&o.jsx("div",{className:Z("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},p))}),s&&f&&h&&o.jsx(Sdt,{codeA:CBe(f),codeB:CBe(h)})]})})]})}function cjn({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}=wle(e,t,r,n),h=new Set(a.filter((g,v)=>v!==l)),p=s.map(g=>{const v=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]})," - ",ur(v,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx($a,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:h.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Ux,{className:"w-6 h-6 opacity-50"}),o.jsx(Rme,{label:"Version",name:`compare-version-${l}`,value:String(r),onValueChange:g=>u(Number(g)),options:p,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(gr.Content,{children:f?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?o.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):o.jsx(G8,{item:m,Link:i})})]})}function ujn(){const{datasetId:e}=na(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=mu(),{data:s,error:a}=Rg(e??""),i=kE(e??"",void 0,r[0]??null),l=kE(e??"",void 0,r[1]??null),c=b.useMemo(()=>i.data??[],[i.data]),u=b.useMemo(()=>l.data??[],[l.data]),d=b.useMemo(()=>{const g=new Map;for(const v of[...c,...u])g.has(v.id)||g.set(v.id,{id:v.id,createdAt:new Date(v.createdAt)});return[...g.values()].sort((v,x)=>x.createdAt.getTime()-v.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&&Ts(a))return o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})});if(a&&ys(a))return o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})});if(!e||r.length<2)return o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(gf,{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,v,x)=>{n(`/datasets/${e}/items/${g}/versions?ids=${v?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,v)=>{n(`/datasets/${e}/versions?ids=${g},${v}`,{replace:!0})};return o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(Cr,{isCurrent:!0,as:"span",children:[o.jsx(je,{children:o.jsx(nSe,{})}),"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(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(nSe,{})," Compare Dataset Versions"]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{children:[o.jsx(Ux,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ar.Column,{children:o.jsxs(ge,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Tp,{}),"Back to Dataset"]})})]}),o.jsx(of,{children:o.jsxs(gr,{children:[o.jsx(qCn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(GCn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function djn(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 fjn({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=djn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Scorers"}),i?o.jsx(fr.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(f)}),o.jsx(fr.NoChange,{message:"Static count"})]}):o.jsx(fr.NoData,{})]}),o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Datasets"}),l?o.jsx(fr.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(h)}),o.jsx(fr.NoChange,{message:"Static count"})]}):o.jsx(fr.NoData,{})]}),o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Avg Score"}),u?o.jsx(fr.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(n)}),m?o.jsx(fr.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(fr.NoChange,{})]}):o.jsx(fr.NoData,{})]}),o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Experiments"}),c?o.jsx(fr.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(p)}),g?o.jsx(fr.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(fr.NoChange,{})]}):o.jsx(fr.NoData,{})]}),o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Needs Review"}),d?o.jsx(fr.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(a)}),a>0?o.jsx(fr.NoChange,{message:"items pending review"}):o.jsx(fr.NoChange,{message:"All caught up"})]}):o.jsx(fr.NoData,{})]})]})}const hjn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],jBe="auto 1fr auto auto auto auto auto auto auto";function pjn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const mjn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function gjn({experiments:e,datasets:t,reviewByExperiment:r,isLoading:n,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=ir(),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),v=a==="all"||p.status===a,x=i==="all"||p.datasetId===i;return g&&v&&x})},[d,s,u,a,i]);return n?o.jsx(Sh,{columns:jBe}):o.jsxs(Oe,{columns:jBe,children:[o.jsxs(Oe.Top,{children:[o.jsx(Oe.TopCell,{children:"Experiment"}),o.jsx(Oe.TopCell,{children:"Dataset"}),o.jsx(Oe.TopCell,{children:"Target"}),o.jsx(Oe.TopCell,{children:"Status"}),o.jsx(Oe.TopCell,{className:"text-center",children:"Items"}),o.jsx(Oe.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(Oe.TopCell,{className:"text-center",children:"Failed"}),o.jsx(Oe.TopCell,{className:"text-center",children:"Review"}),o.jsx(Oe.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,v=h.failedCount??0,x=h.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(Oe.RowLink,{to:l.experimentLink(h.id),LinkComponent:c,children:[o.jsx(Oe.NameCell,{className:"font-mono",children:h.id.slice(0,8)}),o.jsx(Oe.TextCell,{children:p}),o.jsx(Oe.Cell,{children:o.jsxs("span",{className:"truncate",children:[h.targetType," ",h.targetId]})}),o.jsx(Oe.Cell,{children:o.jsx(PP,{variant:mjn[m]??"neutral",withDot:!0,children:m})}),o.jsx(Oe.TextCell,{className:"text-center",children:x}),o.jsx(Oe.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(Oe.TextCell,{className:"text-center",children:o.jsx("span",{className:v>0?"text-accent2":"",children:v})}),o.jsx(Oe.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(gt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(gt,{variant:"success",children:[S.complete,"/",k," reviewed"]})})()}),o.jsx(Oe.TextCell,{children:pjn(h.createdAt)})]},h.id)})]})}function vjn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const ML={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},yjn=[{label:"Completed",color:ML.completed},{label:"Running",color:ML.running},{label:"Pending",color:ML.pending},{label:"Failed",color:ML.failed}];function bjn({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(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Ht.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Ht.Loading,{}):n?o.jsx(Ht.Error,{message:"Failed to load experiments data"}):o.jsx(Ht.Content,{children:i?o.jsx(K_,{data:s,segments:yjn,maxVal:a,fmt:l=>String(l)}):o.jsx(Ht.NoData,{message:"No experiments have been run yet"})})]})}const xjn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(va,{})]})})})});function wjn({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(Eg,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx(Lo,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...hjn],value:r,onValueChange:n,className:"whitespace-nowrap"}),o.jsx(Lo,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(ge,{onClick:l,size:"sm",variant:"light",children:[o.jsx(Nn,{className:"size-3"})," Reset"]})]})]})}function Sjn(){const{data:e,isLoading:t,error:r}=md(),{data:n,isLoading:s,error:a}=Uh(),{data:i,isLoading:l,error:c}=W8(),{data:u,isLoading:d,isError:f,error:h}=nwn(),{data:p,isLoading:m,isError:g,error:v}=mye(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>KCn(p),[p]),k=r||a||c||h||v;return k&&Ts(k)?o.jsx(qr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(Ys,{})}):k&&ys(k)?o.jsx(qr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(Us,{resource:"evaluation"})}):k?o.jsx(qr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(Ic,{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(vn,{children:o.jsxs(vn.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(Zae,{children:o.jsx(fjn,{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(Q0n,{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(wEn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(bjn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(YCn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function Ojn(){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}=W8(),{data:h}=mye(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>vjn(p),[p]),v=b.useMemo(()=>v1t(h),[h]),x=l||d,w=f||c;if(w&&Ts(w))return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Ys,{})});if(f&&ys(f))return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Us,{resource:"experiments"})});if(c&&ys(c))return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Us,{resource:"datasets"})});if(w)return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Ic,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(xjn,{})});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(vn,{children:o.jsxs(vn.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(wjn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(gjn,{experiments:m,datasets:p,reviewByExperiment:v,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function kjn(){const{experimentId:e}=na(),{data:t,isLoading:r}=W8(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=F6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=D8({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?r||i||!s?o.jsx(Fr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Mt,{})})}):l&&Ts(l)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):l&&ys(l)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):l||!a?o.jsx(Fr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/experiments",children:[o.jsx(je,{children:o.jsx(Ru,{})}),"Experiments"]}),o.jsx(Cr,{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(m1t,{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}=vC(),{mutate:i,isPending:l,error:c}=N_n(),{mutate:u,isPending:d,error:f}=A_n(),{mutate:h,isPending:p}=a1t(),[m,g]=b.useState(r),[v,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,z=P?c:f,D=()=>{t?t():e?window.location.href=e:window.location.href="/"},U=H=>{H.preventDefault(),P?i({email:w,password:k},{onSuccess:D}):u({email:w,password:k,name:v||void 0},{onSuccess:D})},F=()=>{h({redirectUri:e},{onSuccess:H=>{window.location.href=H.url}})},B=()=>{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(Kb,{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"})]}),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:U,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(sr,{id:"name",type:"text",value:v,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(sr,{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(sr,{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"})]}),z&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:z.message}),o.jsx(ge,{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:B,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(ge,{onClick:F,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 _jn(){const[e]=ao(),t=mu(),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})}const Nd=Ga.KeyValueList;function Ejn(e){return e instanceof Date?e:new Date(e)}function Cjn({log:e,onClose:t,onTraceClick:r,onSpanClick:n,onPrevious:s,onNext:a,collapsed:i,onCollapsedChange:l}){const[c,u]=b.useState(!1),d=i??c,f=l??u,h=Ejn(e.timestamp);return o.jsxs(Ga,{collapsed:d,children:[o.jsxs(Ga.Header,{children:[o.jsxs(Ga.Heading,{children:["Log ",o.jsx("b",{children:ur(h,"MMM dd, HH:mm:ss.SSS")})]}),o.jsxs(ps,{className:"ml-auto shrink-0",children:[l&&o.jsx(Cn,{size:"md",tooltipContent:d?"Expand panel":"Collapse panel",onClick:()=>f(!d),children:d?o.jsx(JUe,{}):o.jsx(KUe,{})}),o.jsxs(ps,{spacing:"close",children:[o.jsx(Cn,{size:"md",tooltipContent:"Previous log",onClick:s,disabled:!s,children:o.jsx(eF,{})}),o.jsx(Cn,{size:"md",tooltipContent:"Next log",onClick:a,disabled:!a,children:o.jsx(Qle,{})})]}),o.jsx(Ga.CloseButton,{onClick:t})]})]}),!d&&o.jsxs(Ga.Content,{children:[o.jsx("p",{className:"text-ui-md text-neutral4 font-mono wrap-break-word whitespace-pre-wrap",children:e.message}),(e.traceId||e.spanId)&&o.jsxs("div",{className:Z("grid gap-2 my-8","[&>button]:justify-between [&>button]:overflow-hidden"),children:[e.traceId&&o.jsxs(ps,{spacing:"close",className:"min-w-0 w-full",children:[o.jsxs(ge,{size:"md",className:"min-w-0 flex-1 overflow-hidden",onClick:()=>r?.(e.traceId),children:[o.jsx(yh,{}),o.jsx("span",{children:"Trace"}),o.jsxs("span",{className:" ml-auto text-ui-sm text-neutral2 min-w-0 truncate",children:["# ",e.traceId]})]}),o.jsx(Xa,{content:e.traceId,size:"md",tooltip:"Copy Trace ID to clipboard"})]}),e.spanId&&o.jsxs(ps,{spacing:"close",className:"min-w-0 w-full",children:[o.jsxs(ge,{size:"md",className:"min-w-0 flex-1 overflow-hidden",disabled:!e.traceId||!n,onClick:()=>e.traceId&&n?.(e.traceId,e.spanId),children:[o.jsx(yh,{}),o.jsx("span",{children:"Span"}),o.jsxs("span",{className:" ml-auto text-ui-sm text-neutral2 min-w-0 truncate",children:["# ",e.spanId]})]}),o.jsx(Xa,{content:e.spanId,size:"md",tooltip:"Copy Span ID to clipboard"})]})]}),o.jsxs(Nd,{className:"mb-6",children:[e.entityType&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Entity Type"}),o.jsx(Nd.Value,{children:e.entityType})]}),e.entityName&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Entity Name"}),o.jsx(Nd.Value,{children:e.entityName})]}),e.serviceName&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Service"}),o.jsx(Nd.Value,{children:e.serviceName})]}),e.environment&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Environment"}),o.jsx(Nd.Value,{children:e.environment})]}),e.source&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Source"}),o.jsx(Nd.Value,{children:e.source})]}),e.metadata&&Object.keys(e.metadata).length>0&&o.jsx(o.Fragment,{children:Object.entries(e.metadata).map(([p,m])=>o.jsxs(b.Fragment,{children:[o.jsx(Nd.Key,{children:p}),o.jsx(Nd.Value,{children:String(m)})]},p))})]}),e.data&&Object.keys(e.data).length>0&&o.jsx(Ga.CodeSection,{title:"Data",codeStr:JSON.stringify(e.data,null,2),className:"mt-6"})]})]})}const jjn=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 gye(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...gye(r))}),t}function Z8(e){const t=[];for(const r of e)t.push(r.id),t.push(...gye(r));return t}const TBe=["agent","workflow","model","mcp","tool","memory","workspace","other"],Tjn={agent:{icon:o.jsx(pa,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:o.jsx(Mi,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:o.jsx(gp,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(vl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(Pi,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},memory:{icon:o.jsx(x9,{}),color:"oklch(0.75 0.15 60)",label:"Memory",bgColor:"oklch(0.75 0.15 60 / 0.1)",typePrefix:"memory"},workspace:{icon:o.jsx(w9,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}},Njn={color:"oklch(0.65 0 0)",label:"Other",typePrefix:"other"};function b1t(e){const t=e?.toLowerCase().split("_")[0];return Tjn[t]??Njn}function Ajn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Z("flex items-center justify-end h-full px-1.5",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(NBe,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(Gle,{}):o.jsx(uy,{}):o.jsx(Gn,{})]}),a>l&&!i&&o.jsxs(NBe,{onClick:()=>s?.(),children:[a," ",o.jsx(Wle,{})]})]}):null})}function NBe({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Z("h-full",r),children:o.jsx("div",{className:Z("flex items-center gap-[0.1rem] text-ui-xs text-neutral5 border border-border1 pl-1.5 pr-0.5 rounded-md transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-[0.85rem] [&>svg]:h-[0.85rem] [&>svg]:transition-all"),children:t})})}function Ijn({isLastChild:e}){return o.jsx("div",{className:Z("w-[0.5rem] h-[1.8rem] relative opacity-100 shrink-0",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-[0px] after:border-l-[1px] after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-[0px] before:border-b-[1px] before:border-neutral3 before:border-dashed',{"after:bottom-[50%]":e})})}function Rjn({span:e,spanUI:t,isFaded:r,depth:n=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:l,isRootSpan:c,isExpanded:u}){return o.jsxs("div",{"data-span-id":e.id,"aria-label":`View details for span ${e.name}`,className:Z("rounded-md flex opacity-80 min-h-8 items-center rounded-l-lg",{"opacity-30 [&:hover]:opacity-60":r,"bg-surface4":a===e.id}),style:{paddingLeft:`${n*1}rem`},children:[!c&&o.jsx(Ijn,{isLastChild:i}),o.jsx("button",{onClick:()=>s?.(e.id),className:Z("text-ui-sm flex items-center text-left gap-1.5 text-neutral6 w-full min-w-0 rounded-md h-full px-2 py-1 transition-colors","[&>svg]:transition-all [&>svg]:shrink-0 [&>svg]:opacity-0 [&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:ml-auto","hover:bg-surface4 [&:hover>svg]:opacity-60","focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent1"),children:o.jsx("span",{className:"min-w-0 truncate",children:e.name})})]})}function Pjn({span:e,selectedSpanId:t,isFaded:r,overallLatency:n,overallStartTime:s,color:a,chartWidth:i="default"}){const l=n?Math.ceil(e.latency/n*100):0,c=s?new Date(s):null,u=e.startTime?new Date(e.startTime):null,d=u&&c?u.getTime()-c.getTime():0,f=n&&Math.floor(d/n*100);return o.jsxs(yfe,{openDelay:250,children:[o.jsxs(bfe,{className:Z("h-8 p-1 grid grid-cols-[1fr_auto] gap-2 items-center cursor-help pr-2 rounded-r-md",i==="wide"?"min-w-72":"min-w-32","[&:hover>div]:bg-surface5",{"opacity-30 [&:hover]:opacity-60":r,"bg-surface4":t===e.id}),children:[o.jsx("div",{className:Z("w-full p-1.5 rounded-md bg-surface4 transition-colors duration-1000"),children:o.jsx("div",{className:"relative w-full h-1.5 rounded-sm overflow-hidden",children:o.jsx("div",{className:Z("bg-neutral1 absolute rounded-sm h-1.5 top-0"),style:{width:l?`${l}%`:"2px",left:`${f||0}%`,backgroundColor:a}})})}),o.jsxs("div",{className:Z("flex justify-end text-neutral3 text-ui-xs"),children:[(e.latency/1e3).toFixed(3)," s"]})]}),o.jsx(xfe,{children:o.jsxs(wfe,{className:"z-50 w-auto max-w-100 rounded-md bg-surface4 p-2 px-4 pr-6 text-ui-sm text-neutral5 border border-border1",sideOffset:5,side:"top",children:[o.jsx("div",{className:Z("text-ui-sm flex items-center gap-2 mb-2 mt-1"),children:"Span Timing"}),o.jsxs(On,{children:[o.jsx(On.Key,{children:"Latency"}),o.jsxs(On.Value,{children:[e.latency," ms"]}),o.jsx(On.Key,{children:"Started at"}),o.jsx(On.Value,{children:e.startTime?ur(new Date(e.startTime),"hh:mm:ss:SSS a"):"-"}),o.jsx(On.Key,{children:"Ended at"}),o.jsx(On.Value,{children:e.endTime?ur(new Date(e.endTime),"hh:mm:ss:SSS a"):"-"}),o.jsx(On.Key,{children:"Start Shift"}),o.jsxs(On.Value,{children:[d,"ms"]})]}),o.jsx(Sfe,{className:"fill-surface5"})]})})]})}function vye({span:e,depth:t=0,onSpanClick:r,selectedSpanId:n,isLastChild:s,overallLatency:a,overallStartTime:i,fadedTypes:l,searchPhrase:c,featuredSpanIds:u,expandedSpanIds:d,setExpandedSpanIds:f,chartWidth:h}){const p=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=gye(e),v=g.length,x=t===0,w=b1t(e?.type),S=d?d.includes(e.id):!1,k=u&&u.length>0?!u.includes(e.id):!1,E=(l&&l.length>0?l.includes(w?.typePrefix||""):!1)||k;b.useEffect(()=>{if(!u||g.length===0||S)return;g.some(P=>u.includes(P))&&f&&f(P=>!P||P.includes(e.id)?P??[e.id]:[...P,e.id])},[u,g]);const T=()=>{f&&f(I=>{if(!I)return I;const P=new Set([e.id,...g]);return S?I.filter(R=>!P.has(R)):[...I,e.id]})},j=()=>{f&&f(I=>I&&Array.from(new Set([...I,e.id,...g])))},N=g.every(I=>d?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(Rjn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S}),o.jsx(Ajn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:N,numOfChildren:m}),o.jsx(Pjn,{span:e,selectedSpanId:n,isFaded:E,overallLatency:a,overallStartTime:i,color:w?.color,chartWidth:h}),p&&S&&e.spans?.map((I,P,R)=>{const z=P===R.length-1;return o.jsx(vye,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:z,overallLatency:a,overallStartTime:i,fadedTypes:l,searchPhrase:c,expandedSpanIds:d,setExpandedSpanIds:f,featuredSpanIds:u,chartWidth:h},I.id)})]})}function Mjn({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||"";return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Z("flex items-center text-ui-sm gap-3 bg-surface3/50 rounded-md p-3 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Mt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_auto] items-start content-start gap-y-px overflow-hidden py-1",children:e?.map(d=>o.jsx(vye,{span:d,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},d.id))})})}const Djn=1e3*60*60*24*30;function Y8(e){const t=Ge();return kt({queryKey:["trace-light-spans",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return await t.getTraceLight(e)},enabled:!!e,staleTime:r=>r.state.data?.spans.every(a=>!!a.endedAt)?Djn:0})}function Ljn({traceId:e,onClose:t,onSpanSelect:r,initialSpanId:n}){const{data:s,isLoading:a}=Y8(e),i=s?.spans,[l,c]=b.useState(n??void 0);b.useEffect(()=>{if(n&&i&&i.find(m=>m.spanId===n)){c(n),r?.(n);return}c(void 0),r?.(void 0)},[n,i]);const u=b.useMemo(()=>jjn(i??[]),[i]),[d,f]=b.useState([]);b.useEffect(()=>{u.length>0&&f(Z8(u))},[u]);const h=p=>{const m=l===p?void 0:p;c(m),r?.(m)};return o.jsxs(Ga,{children:[o.jsxs(Ga.Header,{children:[o.jsxs(Ga.Heading,{children:["Trace ",o.jsxs("b",{children:["# ",e]})]}),o.jsx(Ga.CloseButton,{onClick:t})]}),a?o.jsx(Ga.LoadingData,{children:"Loading trace..."}):u.length===0?o.jsx(Ga.NoData,{children:"No spans found for this trace."}):o.jsx(Ga.Content,{children:o.jsx(Mjn,{hierarchicalSpans:u,onSpanClick:h,selectedSpanId:l,expandedSpanIds:d,setExpandedSpanIds:f})})]})}const fv=Ga.KeyValueList;function $jn({traceId:e,spanId:t,onClose:r}){const{data:n,isLoading:s}=OE(e,t),a=n?.span,i=a?.startedAt&&a?.endedAt?new Date(a.endedAt).getTime()-new Date(a.startedAt).getTime():null;return o.jsxs(Ga,{children:[o.jsxs(Ga.Header,{children:[o.jsxs(Ga.Heading,{children:["Span ",o.jsxs("b",{children:["# ",t]})]}),o.jsx(Ga.CloseButton,{onClick:r})]}),s?o.jsx(Ga.LoadingData,{children:"Loading span..."}):a?o.jsxs(Ga.Content,{children:[o.jsxs(fv,{children:[a.spanType&&o.jsxs(o.Fragment,{children:[o.jsx(fv.Key,{children:"Type"}),o.jsx(fv.Value,{children:a.spanType})]}),a.startedAt&&o.jsxs(o.Fragment,{children:[o.jsx(fv.Key,{children:"Started"}),o.jsx(fv.Value,{children:ur(new Date(a.startedAt),"MMM dd, HH:mm:ss.SSS")})]}),a.endedAt&&o.jsxs(o.Fragment,{children:[o.jsx(fv.Key,{children:"Ended"}),o.jsx(fv.Value,{children:ur(new Date(a.endedAt),"MMM dd, HH:mm:ss.SSS")})]}),i!=null&&o.jsxs(o.Fragment,{children:[o.jsx(fv.Key,{children:"Duration"}),o.jsx(fv.Value,{children:i<1e3?`${i}ms`:`${(i/1e3).toFixed(2)}s`})]})]}),o.jsx("br",{}),o.jsx(Ga.CodeSection,{title:"Input",icon:o.jsx(Np,{}),codeStr:JSON.stringify(a.input??null,null,2)}),o.jsx(Ga.CodeSection,{title:"Output",icon:o.jsx(yc,{}),codeStr:JSON.stringify(a.output??null,null,2)}),o.jsx(Ga.CodeSection,{title:"Metadata",icon:o.jsx(yl,{}),codeStr:JSON.stringify(a.metadata??null,null,2)}),o.jsx(Ga.CodeSection,{title:"Attributes",icon:o.jsx(yl,{}),codeStr:JSON.stringify(a.attributes??null,null,2)})]}):o.jsx(Ga.NoData,{children:"Span not found."})]})}function Fjn(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return(t>>>0).toString(36)}function zjn(e){const t=new Map,r=new Map;for(const n of e){const s=n.timestamp instanceof Date?n.timestamp.toISOString():n.timestamp,a=Fjn(`${s}${n.message??""}${n.data?JSON.stringify(n.data):""}`),i=r.get(a)??0;r.set(a,i+1),t.set(n,i>0?`${a}-${i}`:a)}return t}const ABe="auto auto auto auto minmax(5rem,1fr) minmax(5rem,1fr)";function Bjn({logs:e,isLoading:t,isFetchingNextPage:r,hasNextPage:n,setEndOfListElement:s,featuredLogId:a,featuredTraceId:i,featuredSpanId:l,onFeaturedChange:c}){const[u,d]=b.useState({}),f=a??u.logId??null,h=i??u.traceId??null,p=l??u.spanId??null,m=b.useCallback(F=>{const B={logId:F.logId!==void 0?F.logId:f,traceId:F.traceId!==void 0?F.traceId:h,spanId:F.spanId!==void 0?F.spanId:p};c?c(B):d(B)},[c,f,h,p]),[g,v]=b.useState(!1),x=b.useMemo(()=>zjn(e),[e]),w=b.useMemo(()=>{const F=new Map;for(let B=0;B<e.length;B++){const H=x.get(e[B]);H&&F.set(H,{log:e[B],idx:B})}return F},[e,x]),k=(f?w.get(f):void 0)?.idx??-1,_=k>=0?e[k]:null,E=k>0?()=>{const F=e[k-1],B=x.get(F);m(h?{logId:B,traceId:F.traceId??null,spanId:null}:{logId:B})}:void 0,T=k>=0&&k<e.length-1?()=>{const F=e[k+1],B=x.get(F);m(h?{logId:B,traceId:F.traceId??null,spanId:null}:{logId:B})}:void 0,j=b.useCallback(F=>{const B=x.get(F);if(f===B){m({logId:null});return}m(h?{logId:B,traceId:F.traceId??null,spanId:null}:{logId:B})},[f,h,m,x]),N=b.useCallback(F=>{m({traceId:F,spanId:null})},[m]),I=b.useCallback((F,B)=>{m({traceId:F,spanId:B})},[m]),P=b.useCallback(()=>{m({traceId:null,spanId:null}),v(!1)},[m]),R=b.useCallback(F=>{m({spanId:F??null})},[m]),z=b.useCallback(()=>{m({spanId:null})},[m]),D=b.useCallback(()=>{m({logId:null})},[m]);if(t)return o.jsx(N9,{columns:ABe});const U=!!_;return o.jsxs("div",{className:Z("grid h-full min-h-0 gap-4 items-start",U?"grid-cols-[1fr_1fr]":"grid-cols-[1fr]"),children:[o.jsxs(Ml,{columns:ABe,className:"min-w-0",children:[o.jsxs(Ml.Top,{children:[o.jsx(Ml.TopCell,{children:"Date"}),o.jsx(Ml.TopCell,{children:"Time"}),o.jsx(Ml.TopCell,{children:"Level"}),o.jsx(Ml.TopCell,{children:"Entity"}),o.jsx(Ml.TopCell,{children:"Message"}),o.jsx(Ml.TopCell,{children:"Data"})]}),e.length===0?o.jsx(Ml.NoMatch,{message:"No logs match your search"}):e.map(F=>{const B=x.get(F),H=B===f;return o.jsxs(Ml.RowButton,{onClick:()=>j(F),className:Z(H&&"bg-surface4"),children:[o.jsx(Ml.DateCell,{timestamp:F.timestamp}),o.jsx(Ml.TimeCell,{timestamp:F.timestamp}),o.jsx(Ml.LevelCell,{level:F.level}),o.jsx(Ml.EntityCell,{entityType:F.entityType,entityName:F.entityName}),o.jsx(Ml.MessageCell,{message:F.message}),o.jsx(Ml.DataCell,{data:F.data})]},B)}),o.jsx(Ml.NextPageLoading,{isLoading:r,hasMore:n,setEndOfListElement:s})]}),_&&o.jsxs("div",{className:Z("grid gap-4 h-full overflow-auto ",g&&h&&p?"grid-rows-[auto_1fr_1fr]":g&&h?"grid-rows-[auto_1fr]":h&&p?"grid-rows-[1fr_1fr_1fr]":h?"grid-rows-[1fr_1fr]":g?"grid-rows-[auto]":"grid-rows-[1fr]"),children:[o.jsx(Cjn,{log:_,onClose:D,onTraceClick:N,onSpanClick:I,onPrevious:E,onNext:T,collapsed:g,onCollapsedChange:v}),h&&o.jsx(Ljn,{traceId:h,onClose:P,onSpanSelect:R,initialSpanId:p}),h&&p&&o.jsx($jn,{traceId:h,spanId:p,onClose:z})]})]})}const Ujn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),titleSlot:"No logs yet",descriptionSlot:"Logs will appear here once agents, workflows, or tools are executed."})});function Vjn({onClear:e,onRemoveAll:t,onSave:r,onRemoveSaved:n,isLoading:s,filterFields:a,filterTokens:i,onFilterTokensChange:l,autoFocusFilterFieldId:c}){const u=i.length>0,d=i.some(f=>qjn(f,a));return o.jsxs("div",{className:Z("grid grid-cols-[1fr_auto] gap-3 items-start"),children:[o.jsx(Gut,{fields:a,tokens:i,onTokensChange:l,disabled:s,autoFocusFieldId:c}),u&&o.jsx(qut,{disabled:s,onClear:d?e:void 0,onRemoveAll:t,onSave:r,onRemoveSaved:n})]})}function qjn(e,t){const r=t.find(n=>n.id===e.fieldId);return r?r.kind==="text"?typeof e.value=="string"&&e.value.trim()!=="":r.kind==="pick-multi"?r.multi?Array.isArray(e.value)&&e.value.length>0:typeof e.value=="string"&&e.value!==""&&e.value!=="Any":r.kind==="multi-select"?Array.isArray(e.value)&&e.value.length>0:!1:!1}const Hjn=20;function Qjn(e,t,r){if(e?.pagination?.hasMore)return r+1}function Wjn(e){return e.pages.flatMap(t=>t.logs??[])}const Gjn=({filters:e}={})=>{const t=Ge(),{inView:r,setRef:n}=w1(),s=i0({queryKey:["logs",e],queryFn:({pageParam:c})=>t.listLogsVNext({pagination:{page:c,perPage:Hjn},filters:e,orderBy:{field:"timestamp",direction:"DESC"}}),initialPageParam:0,getNextPageParam:Qjn,select:Wjn,retry:!1,refetchInterval:3e3}),{hasNextPage:a,isFetchingNextPage:i,fetchNextPage:l}=s;return b.useEffect(()=>{r&&a&&!i&&l()},[r,a,i,l]),{...s,data:s.data,setEndOfListElement:n}},DL={AGENT:wl.AGENT,WORKFLOW:wl.WORKFLOW_RUN,SCORER:wl.SCORER,INGEST:wl.RAG_INGESTION},x1t=[{label:"Agent",entityType:DL.AGENT},{label:"Workflow",entityType:DL.WORKFLOW},{label:"Scorer",entityType:DL.SCORER},{label:"Ingest",entityType:DL.INGEST}],Zjn=[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warn",value:"warn"},{label:"Error",value:"error"},{label:"Fatal",value:"fatal"}],Lx="rootEntityType",Aw="datePreset",Iw="dateFrom",Rw="dateTo",Yjn=new Set(["all","last-24h","last-3d","last-7d","last-14d","last-30d","custom"]),GS={level:"filterLevel",tags:"filterTags",entityName:"filterEntityName",traceId:"filterTraceId",spanId:"filterSpanId",runId:"filterRunId",threadId:"filterThreadId",sessionId:"filterSessionId",requestId:"filterRequestId",resourceId:"filterResourceId",userId:"filterUserId",organizationId:"filterOrganizationId",serviceName:"filterServiceName",environment:"filterEnvironment",experimentId:"filterExperimentId"},cM=Object.keys(GS),yye=new Set(["tags"]),bye="mastra:logs:saved-filters";function Xjn(e){const t=rTn(e),r=e.get(Aw);r&&t.set(Aw,r);const n=e.get(Iw);n&&t.set(Iw,n);const s=e.get(Rw);s&&t.set(Rw,s);try{localStorage.setItem(bye,t.toString())}catch{}}function Kjn(){try{localStorage.removeItem(bye)}catch{}}function IBe(){try{const e=localStorage.getItem(bye);if(!e)return null;const t=new URLSearchParams(e);return t.toString()?t:null}catch{return null}}function Jjn(e){if(e.has(Aw)||e.has(Iw)||e.has(Rw)||e.has(Lx))return!0;for(const t of cM)if(e.has(GS[t]))return!0;return!1}function eTn({availableTags:e,availableRootEntityNames:t,availableServiceNames:r,availableEnvironments:n,loading:s}){const a=[{id:"rootEntityType",label:"Primitive Type",kind:"pick-multi",searchable:!1,options:x1t.map(u=>({label:u.label,value:u.entityType})),placeholder:"Choose entity type",emptyText:"No entity types."},{id:"entityName",label:"Primitive Name",kind:"pick-multi",options:t.map(u=>({label:u,value:u})),placeholder:"Choose entity names",emptyText:"No entity names found.",isLoading:s?.entityNames},{id:"level",label:"Level",kind:"pick-multi",searchable:!1,options:Zjn.map(u=>({label:u.label,value:u.value})),placeholder:"Choose level",emptyText:"No levels."},{id:"tags",label:"Tags",kind:"pick-multi",multi:!0,options:e.map(u=>({label:u,value:u})),placeholder:"Choose tags",emptyText:"No tags found.",isLoading:s?.tags},{id:"serviceName",label:"Service Name",kind:"pick-multi",options:r.map(u=>({label:u,value:u})),placeholder:"Choose service names",emptyText:"No service names found.",isLoading:s?.serviceNames},{id:"environment",label:"Environment",kind:"pick-multi",options:n.map(u=>({label:u,value:u})),placeholder:"Choose environments",emptyText:"No environments found.",isLoading:s?.environments},{id:"traceId",label:"Trace ID",kind:"text"},{id:"spanId",label:"Span ID",kind:"text"},{id:"runId",label:"Run ID",kind:"text"},{id:"threadId",label:"Thread ID",kind:"text"},{id:"sessionId",label:"Session ID",kind:"text"},{id:"requestId",label:"Request ID",kind:"text"},{id:"resourceId",label:"Resource ID",kind:"text"},{id:"userId",label:"User ID",kind:"text"},{id:"organizationId",label:"Organization ID",kind:"text"},{id:"experimentId",label:"Experiment ID",kind:"text"}],i=(u,d)=>u.label.localeCompare(d.label),l=a.filter(u=>u.kind==="pick-multi").sort(i),c=a.filter(u=>u.kind==="text").sort(i);return[...l,...c]}function tTn(e){const t=[],r=new Map([[Lx,"rootEntityType"]]);for(const s of cM)r.set(GS[s],s);const n=new Set;for(const[s]of e.entries()){const a=r.get(s);if(!a||n.has(a))continue;if(n.add(a),yye.has(a)){const l=e.getAll(s);if(l.length===0)continue;t.push({fieldId:a,value:l.filter(Boolean)});continue}const i=e.get(s);i!==null&&t.push({fieldId:a,value:i})}return t}function rTn(e){const t=new URLSearchParams,r=e.get(Lx);r&&t.set(Lx,r);for(const n of cM){const s=GS[n];if(yye.has(n)){for(const i of e.getAll(s))t.append(s,i);continue}const a=e.get(s);a&&t.set(s,a)}return t}function RBe(e,t){e.delete(Lx);for(const r of cM)e.delete(GS[r]);for(const r of t){if(r.fieldId==="rootEntityType"&&typeof r.value=="string"){e.set(Lx,r.value);continue}const n=GS[r.fieldId];if(n){if(yye.has(r.fieldId)&&Array.isArray(r.value)){if(r.value.length===0)e.append(n,"");else for(const s of r.value)e.append(n,s);continue}typeof r.value=="string"&&e.set(n,r.value.trim())}}}function nTn({rootEntityType:e,dateFrom:t,dateTo:r,tokens:n}){const s={};e&&(s.rootEntityType=e),(t||r)&&(s.timestamp={...t?{start:t}:{},...r?{end:r}:{}});for(const a of n){if(a.fieldId==="tags"){Array.isArray(a.value)&&a.value.length>0?s.tags=a.value:typeof a.value=="string"&&a.value.trim()&&(s.tags=[a.value.trim()]);continue}if(a.fieldId==="level"){typeof a.value=="string"&&a.value.trim()&&a.value!=="Any"&&(s.level=a.value);continue}if(typeof a.value=="string"&&a.value.trim()&&a.value!=="Any")switch(a.fieldId){case"entityName":s.rootEntityName=a.value;break;case"traceId":s.traceId=a.value;break;case"spanId":s.spanId=a.value;break;case"runId":s.runId=a.value;break;case"threadId":s.threadId=a.value;break;case"sessionId":s.sessionId=a.value;break;case"requestId":s.requestId=a.value;break;case"resourceId":s.resourceId=a.value;break;case"userId":s.userId=a.value;break;case"organizationId":s.organizationId=a.value;break;case"serviceName":s.serviceName=a.value;break;case"environment":s.environment=a.value;break;case"experimentId":s.experimentId=a.value;break}}return s}const LL={AGENT:wl.AGENT,WORKFLOW:wl.WORKFLOW_RUN,SCORER:wl.SCORER,INGEST:wl.RAG_INGESTION},xye=[{label:"Agent",entityType:LL.AGENT},{label:"Workflow",entityType:LL.WORKFLOW},{label:"Scorer",entityType:LL.SCORER},{label:"Ingest",entityType:LL.INGEST}],sTn=[{label:"Running",value:"running"},{label:"Success",value:"success"},{label:"Error",value:"error"}],$x="rootEntityType",Fx="status",Pw="datePreset",Mw="dateFrom",Dw="dateTo",aTn=new Set(["all","last-24h","last-3d","last-7d","last-14d","last-30d","custom"]),ZS={tags:"filterTags",entityId:"filterEntityId",entityName:"filterEntityName",traceId:"filterTraceId",runId:"filterRunId",threadId:"filterThreadId",sessionId:"filterSessionId",requestId:"filterRequestId",resourceId:"filterResourceId",userId:"filterUserId",organizationId:"filterOrganizationId",serviceName:"filterServiceName",environment:"filterEnvironment",experimentId:"filterExperimentId"},uM=Object.keys(ZS),iTn=new Set(["running","success","error"]),wye="mastra:traces:saved-filters";function oTn(e){const t=fTn(e),r=e.get(Pw);r&&t.set(Pw,r);const n=e.get(Mw);n&&t.set(Mw,n);const s=e.get(Dw);s&&t.set(Dw,s);try{localStorage.setItem(wye,t.toString())}catch{}}function lTn(){try{localStorage.removeItem(wye)}catch{}}function PBe(){try{const e=localStorage.getItem(wye);if(!e)return null;const t=new URLSearchParams(e);return t.toString()?t:null}catch{return null}}function cTn(e){if(e.has(Pw)||e.has(Mw)||e.has(Dw)||e.has($x)||e.has(Fx))return!0;for(const t of uM)if(e.has(ZS[t]))return!0;return!1}function uTn({availableTags:e,availableRootEntityNames:t,availableServiceNames:r,availableEnvironments:n,loading:s}){const a=[{id:"rootEntityType",label:"Primitive Type",kind:"pick-multi",searchable:!1,options:xye.map(u=>({label:u.label,value:u.entityType})),placeholder:"Choose entity type",emptyText:"No entity types."},{id:"entityName",label:"Primitive Name",kind:"pick-multi",options:t.map(u=>({label:u,value:u})),placeholder:"Choose entity names",emptyText:"No entity names found.",isLoading:s?.entityNames},{id:"entityId",label:"Primitive ID",kind:"text"},{id:"status",label:"Status",kind:"pick-multi",searchable:!1,options:sTn.map(u=>({label:u.label,value:u.value})),placeholder:"Choose status",emptyText:"No statuses."},{id:"tags",label:"Tags",kind:"pick-multi",multi:!0,options:e.map(u=>({label:u,value:u})),placeholder:"Choose tags",emptyText:"No tags found.",isLoading:s?.tags},{id:"serviceName",label:"Service Name",kind:"pick-multi",options:r.map(u=>({label:u,value:u})),placeholder:"Choose service names",emptyText:"No service names found.",isLoading:s?.serviceNames},{id:"environment",label:"Environment",kind:"pick-multi",options:n.map(u=>({label:u,value:u})),placeholder:"Choose environments",emptyText:"No environments found.",isLoading:s?.environments},{id:"traceId",label:"Trace ID",kind:"text"},{id:"runId",label:"Run ID",kind:"text"},{id:"threadId",label:"Thread ID",kind:"text"},{id:"sessionId",label:"Session ID",kind:"text"},{id:"requestId",label:"Request ID",kind:"text"},{id:"resourceId",label:"Resource ID",kind:"text"},{id:"userId",label:"User ID",kind:"text"},{id:"organizationId",label:"Organization ID",kind:"text"},{id:"experimentId",label:"Experiment ID",kind:"text"}],i=(u,d)=>u.label.localeCompare(d.label),l=a.filter(u=>u.kind==="pick-multi").sort(i),c=a.filter(u=>u.kind==="text").sort(i);return[...l,...c]}function dTn(e){const t=[],r=new Map([[$x,"rootEntityType"],[Fx,"status"]]);for(const s of uM)r.set(ZS[s],s);const n=new Set;for(const[s]of e.entries()){const a=r.get(s);if(!a||n.has(a))continue;if(n.add(a),a==="tags"){const l=e.getAll(s);if(l.length===0)continue;t.push({fieldId:a,value:l.filter(Boolean)});continue}const i=e.get(s);i!==null&&t.push({fieldId:a,value:i})}return t}function fTn(e){const t=new URLSearchParams,r=e.get($x);r&&t.set($x,r);const n=e.get(Fx);n&&t.set(Fx,n);for(const s of uM){const a=ZS[s];if(s==="tags"){for(const l of e.getAll(a))t.append(a,l);continue}const i=e.get(a);i&&t.set(a,i)}return t}function MBe(e,t){e.delete($x),e.delete(Fx);for(const r of uM)e.delete(ZS[r]);for(const r of t){if(r.fieldId==="rootEntityType"&&typeof r.value=="string"){e.set($x,r.value);continue}if(r.fieldId==="status"&&typeof r.value=="string"){e.set(Fx,r.value);continue}const n=ZS[r.fieldId];if(n){if(r.fieldId==="tags"&&Array.isArray(r.value)){if(r.value.length===0)e.append(n,"");else for(const s of r.value)e.append(n,s);continue}typeof r.value=="string"&&e.set(n,r.value.trim())}}}function hTn({rootEntityType:e,status:t,dateFrom:r,dateTo:n,tokens:s}){const a={};e&&(a.entityType=e),t&&(a.status=t),r&&(a.startedAt={start:r}),n&&(a.endedAt={end:n});for(const i of s){if(i.fieldId==="tags"){Array.isArray(i.value)&&i.value.length>0?a.tags=i.value:typeof i.value=="string"&&i.value.trim()&&(a.tags=[i.value.trim()]);continue}if(typeof i.value=="string"&&i.value.trim()&&i.value!=="Any")switch(i.fieldId){case"entityId":a.entityId=i.value;break;case"entityName":a.entityName=i.value;break;case"traceId":a.traceId=i.value;break;case"runId":a.runId=i.value;break;case"threadId":a.threadId=i.value;break;case"sessionId":a.sessionId=i.value;break;case"requestId":a.requestId=i.value;break;case"resourceId":a.resourceId=i.value;break;case"userId":a.userId=i.value;break;case"organizationId":a.organizationId=i.value;break;case"serviceName":a.serviceName=i.value;break;case"environment":a.environment=i.value;break;case"experimentId":a.experimentId=i.value;break}}return a}const w1t=({entityType:e,rootOnly:t=!1}={})=>{const r=Ge();return kt({queryKey:e?["observability-entity-names","by-type",e]:["observability-entity-names","all",t?"root-only":"all-types"],queryFn:async()=>{try{if(e)return await r.getEntityNames({entityType:e});if(!t)return await r.getEntityNames();const s=await Promise.all(xye.map(a=>r.getEntityNames({entityType:a.entityType})));return{names:Array.from(new Set(s.flatMap(a=>a?.names??[]))).sort()}}catch{return{names:[]}}},select:s=>s?.names??[],retry:!1})},S1t=()=>{const e=Ge();return kt({queryKey:["observability-environments"],queryFn:async()=>{try{return await e.getEnvironments()}catch{return{environments:[]}}},select:t=>t?.environments??[],retry:!1})},O1t=()=>{const e=Ge();return kt({queryKey:["observability-service-names"],queryFn:async()=>{try{return await e.getServiceNames()}catch{return{serviceNames:[]}}},select:t=>t?.serviceNames??[],retry:!1})},k1t=()=>{const e=Ge();return kt({queryKey:["observability-tags"],queryFn:async()=>{try{return await e.getTags()}catch{return{tags:[]}}},select:t=>t?.tags??[],retry:!1})},Sle="logId",Ole="traceId",kle="spanId",ST=1440*60*1e3,pTn={"last-24h":ST,"last-3d":3*ST,"last-7d":7*ST,"last-14d":14*ST,"last-30d":30*ST};function OT(e){e.delete(Sle),e.delete(Ole),e.delete(kle)}function mTn(){const[e,t]=ao(),[r,n]=b.useState(),s=b.useMemo(()=>{const ne=e.get(Aw);return ne&&Yjn.has(ne)?ne:"last-24h"},[e]),a=e.get(Iw),i=e.get(Rw),l=b.useMemo(()=>{if(s==="custom"){if(!a)return;const ee=new Date(a);return Number.isNaN(ee.getTime())?void 0:ee}if(s==="all")return;const ne=pTn[s];return ne?new Date(Date.now()-ne):void 0},[s,a]),c=b.useMemo(()=>{if(s!=="custom"||!i)return;const ne=new Date(i);return Number.isNaN(ne.getTime())?void 0:ne},[s,i]),u=b.useRef(s);u.current=s;const d=e.get(Sle),f=e.get(Ole),h=e.get(kle),p=b.useMemo(()=>x1t.find(ne=>ne.entityType===e.get(Lx)),[e]),m=b.useMemo(()=>tTn(e),[e]),{data:g=[],isPending:v}=k1t(),{data:x=[],isPending:w}=w1t({entityType:p?.entityType,rootOnly:!0}),{data:S=[],isPending:k}=S1t(),{data:_=[],isPending:E}=O1t(),T=b.useMemo(()=>eTn({availableTags:g,availableRootEntityNames:x,availableServiceNames:_,availableEnvironments:S,loading:{tags:v,entityNames:w,serviceNames:E,environments:k}}),[g,x,_,S,v,w,E,k]),j=b.useMemo(()=>nTn({rootEntityType:p?.entityType,dateFrom:l,dateTo:c,tokens:m}),[m,l,c,p]),{data:N=[],isLoading:I,error:P,isFetchingNextPage:R,hasNextPage:z,setEndOfListElement:D}=Gjn({filters:j}),U=b.useCallback(ne=>{t(ee=>{const re=new URLSearchParams(ee);for(const[ie,ce]of Object.entries(ne)){const K=ie==="logId"?Sle:ie==="traceId"?Ole:kle;ce?re.set(K,ce):re.delete(K)}return re},{replace:!0})},[t]),F=b.useCallback(ne=>{t(ee=>{const re=new URLSearchParams(ee);return RBe(re,ne),OT(re),re},{replace:!0})},[t]),B=b.useCallback((ne,ee)=>{if(u.current!=="custom")return;const re=ee==="from"?Iw:Rw;t(ie=>{const ce=new URLSearchParams(ie);return ne?ce.set(re,ne.toISOString()):ce.delete(re),OT(ce),ce},{replace:!0})},[t]),H=b.useCallback(ne=>{u.current=ne,t(ee=>{const re=new URLSearchParams(ee);return ne==="last-24h"?(re.delete(Aw),re.delete(Iw),re.delete(Rw)):ne==="custom"?re.set(Aw,"custom"):(re.set(Aw,ne),re.delete(Iw),re.delete(Rw)),OT(re),re},{replace:!0})},[t]),[W,L]=b.useState(()=>IBe()!==null),Y=b.useCallback(()=>{Xjn(e),L(!0),ze.success("Filters setting for Logs saved")},[e]),q=b.useCallback(()=>{Kjn(),L(!1),ze.success("Filters setting for Logs cleared up")},[]),M=b.useRef(!1);b.useEffect(()=>{if(M.current||(M.current=!0,Jjn(e)))return;const ne=IBe();ne&&t(ee=>{const re=new URLSearchParams(ee);for(const[ie,ce]of ne)re.append(ie,ce);return re},{replace:!0})},[]);const Q=b.useCallback(()=>{t(ne=>{const ee=new URLSearchParams(ne);ee.delete(Lx);for(const re of cM)ee.delete(GS[re]);return OT(ee),ee},{replace:!0})},[t]),G=b.useCallback(()=>{const ne=m.map(ee=>{const re=T.find(ie=>ie.id===ee.fieldId);return re?re.kind==="text"?{fieldId:ee.fieldId,value:""}:re.kind==="pick-multi"?re.multi?{fieldId:ee.fieldId,value:[]}:{fieldId:ee.fieldId,value:"Any"}:ee:ee});t(ee=>{const re=new URLSearchParams(ee);return RBe(re,ne),OT(re),re},{replace:!0})},[T,m,t]);if(P&&Ts(P))return o.jsx(qr,{title:"Logs",icon:o.jsx(DO,{}),children:o.jsx(Ys,{})});if(P&&ys(P))return o.jsx(qr,{title:"Logs",icon:o.jsx(DO,{}),children:o.jsx(Us,{resource:"logs"})});if(P)return o.jsx(qr,{title:"Logs",icon:o.jsx(DO,{}),children:o.jsx(Ic,{title:"Failed to load logs",message:P?.message??"Unknown error"})});const J=m.length>0||s!=="last-24h"||!!c;return N.length===0&&!I&&!J?o.jsx(qr,{title:"Logs",icon:o.jsx(DO,{}),children:o.jsx(Ujn,{})}):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(vn,{children:o.jsxs(vn.Title,{isLoading:I,children:[o.jsx(DO,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(Hdt,{preset:s,onPresetChange:H,dateFrom:l,dateTo:c,onDateChange:B,disabled:I,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(Zut,{fields:T,tokens:m,onTokensChange:F,disabled:I,onStartTextFilter:n}),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(Vjn,{isLoading:I,filterFields:T,filterTokens:m,onFilterTokensChange:F,onClear:G,onRemoveAll:Q,onSave:Y,onRemoveSaved:W?q:void 0,autoFocusFilterFieldId:r})]}),o.jsx(Bjn,{logs:N,isLoading:I,isFetchingNextPage:R,hasNextPage:z,setEndOfListElement:D,featuredLogId:d,featuredTraceId:f,featuredSpanId:h,onFeaturedChange:U})]})}const _1t=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 gTn({server:e}){const{paths:t,Link:r}=ir(),s=Ge().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=_1t(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(Oe.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:r,children:[o.jsx(Oe.NameCell,{children:f}),o.jsx(Oe.DescriptionCell,{children:a}),o.jsx(Oe.TextCell,{className:"text-center",children:u||""}),o.jsx(Oe.TextCell,{className:"text-center",children:c||""}),o.jsx(Oe.TextCell,{className:"text-center",children:d||""})]})}function vTn({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(Sh,{columns:"auto 1fr auto auto auto"}):o.jsxs(Oe,{columns:"auto 1fr auto auto auto",children:[o.jsxs(Oe.Top,{children:[o.jsx(Oe.TopCell,{children:"Name"}),o.jsx(Oe.TopCell,{children:"URL"}),o.jsx(Oe.TopCellSmart,{long:"Agents",short:o.jsx(pa,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(Oe.TopCellSmart,{long:"Tools",short:o.jsx(Pi,{}),tooltip:"Tools",className:"text-center"}),o.jsx(Oe.TopCellSmart,{long:"Workflows",short:o.jsx(Mi,{}),tooltip:"Workflow Tools",className:"text-center"})]}),n.length===0&&r?o.jsx(Oe.NoMatch,{message:"No MCP Servers match your search"}):null,n.map(s=>o.jsx(gTn,{server:s},s.id))]})}const yTn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(va,{})]})})}),bTn=()=>{const{data:e=[],isLoading:t,error:r}=iM(),[n,s]=b.useState("");return r&&Ts(r)?o.jsx(qr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(Ys,{})}):r&&ys(r)?o.jsx(qr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(Us,{resource:"MCP servers"})}):r?o.jsx(qr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(Ic,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(qr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(yTn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{isLoading:t,children:[o.jsx(vl,{})," 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(Eg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(vTn,{mcpServers:e,isLoading:t,search:n})]})},xTn=(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 wTn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=ir(),i=b.useMemo(()=>xTn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(Sh,{columns:"auto 1fr auto"}):o.jsxs(Oe,{columns:"auto 1fr auto",children:[o.jsxs(Oe.Top,{children:[o.jsx(Oe.TopCell,{children:"Name"}),o.jsx(Oe.TopCell,{children:"Description"}),o.jsx(Oe.TopCellSmart,{long:"Agents",short:o.jsx(pa,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&n?o.jsx(Oe.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(Oe.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(Oe.NameCell,{children:u}),o.jsx(Oe.DescriptionCell,{children:d}),o.jsx(Oe.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const STn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(va,{})]})})}),OTn=()=>{const e=Ge();return Jr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new p_;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}}})},kTn=({toolId:e})=>{const{canExecute:t}=jy(),r=t("tools"),{data:n={}}=Ng(),s=b.useMemo(()=>{for(const g of Object.values(n))if(g.tools){const v=Object.values(g.tools).find(x=>x.id===e);if(v)return v}return null},[n,e]),{data:a,isLoading:i,error:l}=jSn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=OTn(),{requestContext:h}=Qn();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,v)=>{if(!c)return;const x={...h??{},...v??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?fg(cg(sy(c?.inputSchema))):Yn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Mn,{className:"h-8 w-48 mb-4"}),o.jsx(Mn,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(Gve,{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(ve,{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(ve,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function _Tn({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}=P8(),{data:h={},isLoading:p,isError:m,error:g}=Ng(),{navigate:v,paths:x}=ir();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&&v(x.toolLink(_))};return o.jsx(Jl,{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 ETn=({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(gf,{children:o.jsx(ve,{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(gf,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(ve,{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(gt,{icon:o.jsx(w9,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(gt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(ve,{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(gt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(ve,{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(ve,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(Xa,{tooltip:"Copy HTTP Stream URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(gt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(ve,{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(ve,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(Xa,{tooltip:"Copy SSE URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(gt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(ve,{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(ve,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(Xa,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(CTn,{server:t})})]})},CTn=({server:e})=>{const{data:t={},isLoading:r}=_1t(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(je,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(vl,{})}),o.jsx(ve,{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(jTn,{tool:a,serverId:e.id},s)})})]})},jTn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=ir(),a=Swt[e.toolType||"tool"];return o.jsxs(_f,{onClick:()=>r.current?.click(),children:[o.jsx(dut,{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})]})]})},TTn=()=>{const{serverId:e}=na(),{data:t=[],isLoading:r}=iM(),n=t.find(s=>s.id===e);return o.jsxs(Fr,{children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/mcps",children:[o.jsx(je,{children:o.jsx(vl,{})}),"MCP Servers"]}),o.jsx(Cr,{as:"span",to:"",isCurrent:!0,children:o.jsx(Fwt,{value:e,variant:"ghost"})})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(a0,{}),"MCP documentation"]})})]}),o.jsx(ETn,{isLoading:r,server:n})]})},E1t=(e,t)=>{const{requestContext:r}=Qn(),n=Ge();return kt({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},NTn=(e,t)=>{const{requestContext:r}=Qn(),n=Ge();return Jr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},ATn=({toolId:e,serverId:t})=>{const{canExecute:r}=jy(),n=r("tools"),{data:s,isLoading:a,error:i}=E1t(t,e),{mutateAsync:l,isPending:c,data:u}=NTn(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(Mn,{className:"h-8 w-48 mb-4"}),o.jsx(Mn,{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(ve,{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(ve,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=fg(cg(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Yn({})}return o.jsx(Gve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},ITn=()=>{const{data:e}=iM(),{serverId:t,toolId:r}=na(),{data:n,isLoading:s}=E1t(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(Za,{children:[o.jsxs(Cr,{as:dr,to:"/mcps",children:[o.jsx(je,{children:o.jsx(vl,{})}),"MCP Servers"]}),o.jsx(Cr,{as:dr,to:`/mcps/${t}`,children:l}),o.jsx(Cr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(a0,{}),"MCP documentation"]})})]}),o.jsx(ATn,{toolId:r,serverId:t})]})},C1t=[{label:"Last 24 hours",value:"24h"},{label:"Last 3 days",value:"3d"},{label:"Last 7 days",value:"7d"},{label:"Last 14 days",value:"14d"},{label:"Last 30 days",value:"30d"}],RTn=new Set(C1t.map(e=>e.value));function PTn(e){return typeof e=="string"&&(RTn.has(e)||e==="custom")}const MTn={"24h":1,"3d":3,"7d":7,"14d":14,"30d":30},DTn={"Studio Cloud":42,Production:31,Staging:18,Dev:7,"CI / Preview":2};function LTn(e,t,r){let n=1;e!=="custom"?n=MTn[e]??1:t?.from&&t?.to&&(n=Math.max(1,Vcr(t.to,t.from)+1));const s=r.filter(i=>i.field==="Environment"&&i.comparator==="is"),a=s.length===0?100:s.flatMap(i=>i.values).reduce((i,l)=>i+(DTn[l]??0),0);return n*(a/100)}const j1t=b.createContext({datePreset:"24h",setDatePreset:()=>{},customRange:void 0,setCustomRange:()=>{},dateRangeLabel:"Last 24 hours",filterGroups:[],setFilterGroups:()=>{},multiplier:1});function T1t(){return b.useContext(j1t)}function $Tn(e,t){return e!=="custom"?C1t.find(r=>r.value===e).label:t?.from?t.to?`${ur(t.from,"MMM d, yyyy")} – ${ur(t.to,"MMM d, yyyy")}`:ur(t.from,"MMM d, yyyy"):"Custom range"}function FTn({children:e,initialPreset:t,onPresetChange:r}){const[n,s]=b.useState(t??"24h"),[a,i]=b.useState(void 0),[l,c]=b.useState([]),u=$Tn(n,a),d=LTn(n,a,l);b.useEffect(()=>{t&&t!==n&&s(t)},[t]);const f=b.useCallback(h=>{s(h),r?.(h)},[r]);return o.jsx(j1t.Provider,{value:{datePreset:n,setDatePreset:f,customRange:a,setCustomRange:i,dateRangeLabel:u,filterGroups:l,setFilterGroups:c,multiplier:d},children:e})}const Qte={"24h":1440*60*1e3,"3d":4320*60*1e3,"7d":10080*60*1e3,"14d":336*60*60*1e3,"30d":720*60*60*1e3};function zTn(e,t){const r=new Date;if(e!=="custom"){const n=Qte[e]??Qte["24h"];return{start:new Date(r.getTime()-n),end:r}}return{start:t?.from??new Date(r.getTime()-Qte["24h"]),end:t?.to??r}}function Iy(){const{datePreset:e,customRange:t}=T1t(),r=zTn(e,t);return{datePreset:e,customRange:t,timestamp:r}}async function Wte(e,t,r){const n=await e.getMetricPercentiles({name:t,percentiles:[.5,.95],interval:"1h",filters:{timestamp:r}}),s=n.series.find(l=>l.percentile===.5),a=n.series.find(l=>l.percentile===.95);if(!s||!a)return[];const i=new Map(a.points.map(l=>[new Date(l.timestamp).getTime(),l.value]));return s.points.map(l=>{const c=new Date(l.timestamp);return{time:c.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),p50:Math.round(l.value),p95:Math.round(i.get(c.getTime())??0)}})}function BTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","latency",t,r],queryFn:async()=>{const[s,a,i]=await Promise.all([Wte(e,"mastra_agent_duration_ms",n),Wte(e,"mastra_workflow_duration_ms",n),Wte(e,"mastra_tool_duration_ms",n)]);return{agentData:s,workflowData:a,toolData:i}}})}const UTn=[{dataKey:"p50",label:"p50",color:mc.blue,aggregate:e=>({value:e.length>0?`${Math.round(e.reduce((t,r)=>t+r.p50,0)/e.length)}`:"0",suffix:"avg ms"})},{dataKey:"p95",label:"p95",color:mc.yellow,aggregate:e=>({value:e.length>0?`${Math.round(e.reduce((t,r)=>t+r.p95,0)/e.length)}`:"0",suffix:"avg ms"})}];function Gte({data:e}){return e.length===0?o.jsx(Ht.NoData,{message:"No latency data yet"}):o.jsx(ome,{data:e,series:UTn})}function VTn(){const{data:e,isLoading:t,isError:r}=BTn(),n=!!e&&(e.agentData.length>0||e.workflowData.length>0||e.toolData.length>0),s=e&&e.agentData.length>0?`${Math.round(e.agentData.reduce((a,i)=>a+i.p50,0)/e.agentData.length)}ms`:"—";return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Latency",description:"Hourly p50 and p95 latency."}),n&&o.jsx(Ht.Summary,{value:s,label:"Avg p50"})]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load latency data"}):o.jsx(Ht.Content,{children:n?o.jsxs(Nf,{defaultTab:"agents",className:"overflow-visible",children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"agents",children:"Agents"}),o.jsx(Ss,{value:"workflows",children:"Workflows"}),o.jsx(Ss,{value:"tools",children:"Tools"})]}),o.jsx(Ps,{value:"agents",children:o.jsx(Gte,{data:e.agentData})}),o.jsx(Ps,{value:"workflows",children:o.jsx(Gte,{data:e.workflowData})}),o.jsx(Ps,{value:"tools",children:o.jsx(Gte,{data:e.toolData})})]}):o.jsx(Ht.NoData,{message:"No latency data yet"})})]})}function N1t(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","agent-runs-kpi",t,r],queryFn:()=>e.getMetricAggregate({name:["mastra_agent_duration_ms"],aggregation:"count",filters:{timestamp:n},comparePeriod:"previous_period"})})}function qTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","avg-score-kpi",t,r],queryFn:async()=>{const s=await e.listScorers(),a=Object.keys(s??{});if(a.length===0)return{value:null,previousValue:null,changePercent:null};const i={timestamp:{start:n.start,end:n.end}},c=(await Promise.all(a.map(async h=>{const[p,m]=await Promise.all([e.getScoreAggregate({scorerId:h,aggregation:"avg",filters:i}),e.getScoreAggregate({scorerId:h,aggregation:"count",filters:i})]);return{avg:p.value??0,count:m.value??0}}))).filter(h=>h.count>0);if(c.length===0)return{value:null,previousValue:null,changePercent:null};const u=c.reduce((h,p)=>h+p.count,0),f=c.reduce((h,p)=>h+p.avg*p.count,0)/u;return{value:Math.round(f*100)/100,previousValue:null,changePercent:null}}})}function HTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","model-cost-kpi",t,r],queryFn:async()=>{const s=await e.getMetricAggregate({name:["mastra_model_total_input_tokens","mastra_model_total_output_tokens"],aggregation:"sum",filters:{timestamp:n},comparePeriod:"previous_period"});return{cost:s.estimatedCost??null,costUnit:s.costUnit??null,previousCost:s.previousEstimatedCost??null,costChangePercent:s.costChangePercent??null}}})}function QTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","total-tokens-kpi",t,r],queryFn:async()=>{const[s,a]=await Promise.all([e.getMetricAggregate({name:["mastra_model_total_input_tokens"],aggregation:"sum",filters:{timestamp:n},comparePeriod:"previous_period"}),e.getMetricAggregate({name:["mastra_model_total_output_tokens"],aggregation:"sum",filters:{timestamp:n},comparePeriod:"previous_period"})]),i=s.value!=null||a.value!=null,l=s.previousValue!=null||a.previousValue!=null,c=(s.value??0)+(a.value??0),u=(s.previousValue??0)+(a.previousValue??0),d=l&&u>0?(c-u)/u*100:null;return{value:i?c:null,previousValue:l?u:null,changePercent:d}}})}function WTn(){const{data:e,isLoading:t,isError:r}=N1t(),n=e?.value!=null;return o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Agent Runs"}),o.jsx(fr.Value,{className:n?void 0:"invisible",children:n?e.value.toLocaleString():"—"}),r?o.jsx(fr.Error,{}):t?o.jsx(fr.Loading,{}):n?e.changePercent!=null?o.jsx(fr.Change,{changePct:e.changePercent,prevValue:e.previousValue?.toLocaleString()}):o.jsx(fr.NoChange,{}):o.jsx(fr.NoData,{})]})}function GTn(){const{data:e,isLoading:t,isError:r}=HTn(),n=e?.cost!=null;return o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Model Cost"}),o.jsx(fr.Value,{className:n?void 0:"invisible",children:n?_E(e.cost,e.costUnit):"—"}),r?o.jsx(fr.Error,{}):t?o.jsx(fr.Loading,{}):n?e.costChangePercent!=null?o.jsx(fr.Change,{changePct:e.costChangePercent,prevValue:e.previousCost!=null?_E(e.previousCost,e.costUnit):void 0}):o.jsx(fr.NoChange,{}):o.jsx(fr.NoData,{})]})}function ZTn(){const{data:e,isLoading:t,isError:r}=QTn(),n=e?.value!=null;return o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Tokens"}),o.jsx(fr.Value,{className:n?void 0:"invisible",children:n?Qm(e.value):"—"}),r?o.jsx(fr.Error,{}):t?o.jsx(fr.Loading,{}):n?e.changePercent!=null?o.jsx(fr.Change,{changePct:e.changePercent,prevValue:e.previousValue!=null?Qm(e.previousValue):void 0}):o.jsx(fr.NoChange,{}):o.jsx(fr.NoData,{})]})}function YTn(){const{data:e,isLoading:t,isError:r}=qTn(),n=e?.value!=null;return o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Avg Score"}),o.jsx(fr.Value,{className:n?void 0:"invisible",children:n?String(e.value):"—"}),r?o.jsx(fr.Error,{}):t?o.jsx(fr.Loading,{}):n?e.changePercent!=null?o.jsx(fr.Change,{changePct:e.changePercent,prevValue:e.previousValue!=null?String(e.previousValue):void 0}):o.jsx(fr.NoChange,{}):o.jsx(fr.NoData,{})]})}function XTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","model-usage-cost",t,r],queryFn:async()=>{const s=["mastra_model_total_input_tokens","mastra_model_total_output_tokens","mastra_model_input_cache_read_tokens","mastra_model_input_cache_write_tokens"],[a,i,l,c]=await Promise.all(s.map(h=>e.getMetricBreakdown({name:[h],groupBy:["model"],aggregation:"sum",filters:{timestamp:n}}))),u=new Map,d=h=>(u.has(h)||u.set(h,{input:0,output:0,cacheRead:0,cacheWrite:0,cost:null,costUnit:null}),u.get(h)),f=(h,p)=>{p.estimatedCost!=null&&(h.cost=(h.cost??0)+p.estimatedCost,p.costUnit&&(h.costUnit=p.costUnit))};for(const h of a.groups){const p=h.dimensions.model??"unknown",m=d(p);m.input=h.value,f(m,h)}for(const h of i.groups){const p=h.dimensions.model??"unknown",m=d(p);m.output=h.value,f(m,h)}for(const h of l.groups){const p=h.dimensions.model??"unknown",m=d(p);m.cacheRead=h.value,f(m,h)}for(const h of c.groups){const p=h.dimensions.model??"unknown",m=d(p);m.cacheWrite=h.value,f(m,h)}return Array.from(u.entries()).map(([h,p])=>({model:h,input:Qm(p.input),output:Qm(p.output),cacheRead:Qm(p.cacheRead),cacheWrite:Qm(p.cacheWrite),cost:p.cost,costUnit:p.costUnit})).sort((h,p)=>h.model.localeCompare(p.model))}})}function KTn(){const{data:e,isLoading:t,isError:r}=XTn(),n=!!e&&e.length>0;return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Model Usage & Cost",description:"Token consumption by model."}),n&&(()=>{const s=e.reduce((i,l)=>i+(l.cost??0),0),a=e.find(i=>i.costUnit)?.costUnit;return o.jsx(Ht.Summary,{value:s>0?_E(s,a):"—",label:"Total cost"})})()]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load model usage data"}):o.jsx(Ht.Content,{children:n?o.jsx(ime,{columns:[{label:"Model",value:s=>s.model},{label:"Input",value:s=>s.input},{label:"Output",value:s=>s.output},{label:"Cache Read",value:s=>s.cacheRead},{label:"Cache Write",value:s=>s.cacheWrite},{label:"Cost",value:s=>s.cost!=null?_E(s.cost,s.costUnit):"—",highlight:!0}],data:e.map(s=>({...s,key:s.model}))}):o.jsx(Ht.NoData,{message:"No model usage data yet"})})]})}function JTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","scores-card",t,r],queryFn:async()=>{const s={timestamp:{start:n.start,end:n.end}},a=await e.listScorers(),i=Object.keys(a??{});if(i.length===0)return{summaryData:[],overTimeData:[],scorerNames:[],avgScore:null};const c=(await Promise.all(i.map(async x=>{const[w,S,k,_]=await Promise.all([e.getScoreAggregate({scorerId:x,aggregation:"avg",filters:s}),e.getScoreAggregate({scorerId:x,aggregation:"min",filters:s}),e.getScoreAggregate({scorerId:x,aggregation:"max",filters:s}),e.getScoreAggregate({scorerId:x,aggregation:"count",filters:s})]);return{scorer:x,avg:w.value??0,min:S.value??0,max:k.value??0,count:_.value??0}}))).filter(x=>x.count>0),u=c.map(x=>x.scorer);if(c.length===0)return{summaryData:[],overTimeData:[],scorerNames:[],avgScore:null};const d=c.reduce((x,w)=>x+w.avg*w.count,0),f=c.reduce((x,w)=>x+w.count,0),h=f?Math.round(d/f*100)/100:0,p="1h",m=await Promise.all(u.map(x=>e.getScoreTimeSeries({scorerId:x,interval:p,aggregation:"avg",filters:s}))),g=new Map;for(let x=0;x<u.length;x++){const w=u[x],S=m[x]?.series??[];for(const k of S)for(const _ of k.points){const T=new Date(_.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1});g.has(T)||g.set(T,new Map);const j=g.get(T);j.has(w)||j.set(w,{sum:0,count:0});const N=j.get(w);N.sum+=_.value,N.count+=1}}const v=Array.from(g.entries()).sort(([x],[w])=>x.localeCompare(w)).map(([x,w])=>{const S={time:x};for(const[k,_]of w)S[k]=+(_.sum/_.count).toFixed(2);return S});return{summaryData:c,overTimeData:v,scorerNames:u,avgScore:h}}})}const DBe=[mc.green,mc.blue,mc.purple,mc.orange,mc.pink,mc.yellow];function eNn(){const{data:e,isLoading:t,isError:r}=JTn(),n=!!e&&e.summaryData.length>0,s=b.useMemo(()=>e?.scorerNames?e.scorerNames.map((a,i)=>({dataKey:a,label:a,color:DBe[i%DBe.length],aggregate:l=>({value:l.length>0?(l.reduce((c,u)=>c+(u[a]??0),0)/l.length).toFixed(2):"0",suffix:"avg"})})):[],[e?.scorerNames]);return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Scores",description:"Evaluation scorer performance."}),n&&o.jsx(Ht.Summary,{value:e?.avgScore!=null?`avg ${e.avgScore}`:"—",label:"Across all scorers"})]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load scores data"}):o.jsx(Ht.Content,{children:n?o.jsxs(Nf,{defaultTab:"over-time",className:"overflow-visible",children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"over-time",children:"Over Time"}),o.jsx(Ss,{value:"summary",children:"Summary"})]}),o.jsx(Ps,{value:"over-time",className:"pb-0",children:e.overTimeData.length>0?o.jsx(ome,{data:e.overTimeData,series:s,yDomain:[0,1]}):o.jsx(Ht.NoData,{message:"No time series data yet"})}),o.jsx(Ps,{value:"summary",children:o.jsx(ime,{columns:[{label:"Scorer",value:a=>a.scorer},{label:"Avg",value:a=>a.avg.toFixed(2),highlight:!0},{label:"Min",value:a=>a.min.toFixed(2)},{label:"Max",value:a=>a.max.toFixed(2)},{label:"Count",value:a=>a.count.toLocaleString()}],data:e.summaryData.map(a=>({...a,key:a.scorer}))})})]}):o.jsx(Ht.NoData,{message:"No scores data yet"})})]})}function tNn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","token-usage-by-agent",t,r],queryFn:async()=>{const[s,a,i,l]=await Promise.all([e.getMetricBreakdown({name:["mastra_model_total_input_tokens"],groupBy:["entityName"],aggregation:"sum",filters:{timestamp:n}}),e.getMetricBreakdown({name:["mastra_model_total_output_tokens"],groupBy:["entityName"],aggregation:"sum",filters:{timestamp:n}}),e.getMetricBreakdown({name:["mastra_model_input_cache_read_tokens"],groupBy:["entityName"],aggregation:"sum",filters:{timestamp:n}}),e.getMetricBreakdown({name:["mastra_model_input_cache_write_tokens"],groupBy:["entityName"],aggregation:"sum",filters:{timestamp:n}})]),c=new Map,u=f=>(c.has(f)||c.set(f,{input:0,output:0,cost:null,costUnit:null}),c.get(f)),d=(f,h)=>{h.estimatedCost!=null&&(f.cost=(f.cost??0)+h.estimatedCost,h.costUnit&&(f.costUnit=h.costUnit))};for(const f of s.groups){const h=f.dimensions.entityName??"unknown",p=u(h);p.input=f.value,d(p,f)}for(const f of a.groups){const h=f.dimensions.entityName??"unknown",p=u(h);p.output=f.value,d(p,f)}for(const f of i.groups){const h=f.dimensions.entityName??"unknown",p=u(h);d(p,f)}for(const f of l.groups){const h=f.dimensions.entityName??"unknown",p=u(h);d(p,f)}return Array.from(c.entries()).map(([f,h])=>({name:f,input:h.input,output:h.output,total:h.input+h.output,cost:h.cost,costUnit:h.costUnit})).sort((f,h)=>h.total-f.total)}})}function rNn(){const{data:e,isLoading:t,isError:r}=tNn(),[n,s]=b.useState("tokens"),a=!!e&&e.length>0,i=e?.reduce((p,m)=>p+m.total,0)??0,l=e?.filter(p=>p.cost!=null&&p.cost>0)??[],u=new Set(l.map(p=>p.costUnit??"usd")).size<=1,d=u?l[0]?.costUnit??null:null,f=u?l.reduce((p,m)=>p+(m.cost??0),0):0,h=u&&f>0;return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Token Usage by Agent",description:"Token consumption grouped by agent."}),a&&(n==="cost"&&h?o.jsx(Ht.Summary,{value:_E(f,d),label:"Total cost"}):o.jsx(Ht.Summary,{value:Qm(i),label:"Total tokens"}))]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load token usage data"}):o.jsx(Ht.Content,{children:a?o.jsxs(Nf,{defaultTab:"tokens",value:n,onValueChange:p=>s(p),className:"grid grid-rows-[auto_1fr] overflow-y-auto h-full",children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"tokens",children:"Tokens"}),o.jsx(Ss,{value:"cost",children:"Cost"})]}),o.jsx(Ps,{value:"tokens",children:o.jsx(K_,{data:e.map(p=>({name:p.name,values:[p.input,p.output]})),segments:[{label:"Input",color:mc.blueDark},{label:"Output",color:mc.blue}],maxVal:Math.max(...e.map(p=>p.input+p.output)),fmt:Qm})}),o.jsx(Ps,{value:"cost",children:h?o.jsx(K_,{data:e.filter(p=>p.cost!=null&&p.cost>0).sort((p,m)=>(m.cost??0)-(p.cost??0)).map(p=>({name:p.name,values:[p.cost]})),segments:[{label:"Cost",color:mc.purple}],maxVal:Math.max(...e.map(p=>p.cost??0)),fmt:p=>_E(p,d)}):o.jsx(Ht.NoData,{message:"No cost data yet"})})]}):o.jsx(Ht.NoData,{message:"No token usage data yet"})})]})}async function Zte(e,t,r){const n=await e.getMetricBreakdown({name:[t],groupBy:["entityName","status"],aggregation:"count",filters:{timestamp:r}}),s=new Map;for(const a of n.groups){const i=a.dimensions.entityName??"unknown",l=a.dimensions.status??"ok";s.has(i)||s.set(i,{completed:0,errors:0});const c=s.get(i);l==="error"?c.errors+=a.value:c.completed+=a.value}return Array.from(s.entries()).map(([a,i])=>({name:a,...i})).sort((a,i)=>i.completed+i.errors-(a.completed+a.errors))}function nNn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","trace-volume",t,r],queryFn:async()=>{const[s,a,i]=await Promise.all([Zte(e,"mastra_agent_duration_ms",n),Zte(e,"mastra_workflow_duration_ms",n),Zte(e,"mastra_tool_duration_ms",n)]);return{agentData:s,workflowData:a,toolData:i}}})}function Yte({data:e}){return o.jsx(K_,{data:e.map(t=>({name:t.name,values:[t.completed,t.errors]})),segments:[{label:"Completed",color:mc.blueDark},{label:"Errors",color:mc.pink}],maxVal:Math.max(...e.map(t=>t.completed+t.errors)),fmt:Qm})}function sNn(){const{data:e,isLoading:t,isError:r}=nNn(),n=!!e&&(e.agentData.length>0||e.workflowData.length>0||e.toolData.length>0),s=e?[...e.agentData,...e.workflowData,...e.toolData].reduce((a,i)=>a+i.completed+i.errors,0):0;return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Trace Volume",description:"Runs and call counts."}),n&&o.jsx(Ht.Summary,{value:Qm(s),label:"Total runs"})]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load trace volume data"}):o.jsx(Ht.Content,{children:n?o.jsxs(Nf,{defaultTab:"agents",className:"grid grid-rows-[auto_1fr] overflow-y-auto h-full",children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"agents",children:"Agents"}),o.jsx(Ss,{value:"workflows",children:"Workflows"}),o.jsx(Ss,{value:"tools",children:"Tools"})]}),o.jsx(Ps,{value:"agents",children:e.agentData.length>0?o.jsx(Yte,{data:e.agentData}):o.jsx(Ht.NoData,{message:"No agent data yet"})}),o.jsx(Ps,{value:"workflows",children:e.workflowData.length>0?o.jsx(Yte,{data:e.workflowData}):o.jsx(Ht.NoData,{message:"No workflow data yet"})}),o.jsx(Ps,{value:"tools",children:e.toolData.length>0?o.jsx(Yte,{data:e.toolData}):o.jsx(Ht.NoData,{message:"No tool data yet"})})]}):o.jsx(Ht.NoData,{message:"No trace volume data yet"})})]})}const aNn=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]);function iNn(){const{data:e,isLoading:t}=C8(),r=e?.observabilityStorageType,n=r?aNn.has(r):!1,s=r==="ObservabilityInMemory";return t?null:n?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[s&&o.jsxs(Ul,{variant:"info",children:[o.jsx(Vl,{children:"Metrics are not persisted"}),o.jsx(zu,{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(Zae,{children:[o.jsx(WTn,{}),o.jsx(GTn,{}),o.jsx(ZTn,{}),o.jsx(YTn,{})]}),o.jsxs(Zae,{children:[o.jsx(KTn,{}),o.jsx(rNn,{}),o.jsx(eNn,{}),o.jsx(sNn,{}),o.jsx(VTn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(va,{})]})})})}const oNn=[{label:"Last 24 hours",value:"24h"},{label:"Last 3 days",value:"3d"},{label:"Last 7 days",value:"7d"},{label:"Last 14 days",value:"14d"},{label:"Last 30 days",value:"30d"}];function lNn(){const{datePreset:e,setDatePreset:t}=T1t();return o.jsx(Lo,{name:"date-range",labelIsHidden:!0,value:e,options:oNn,onValueChange:r=>t(r)})}const Xte="period";function cNn(){const[e,t]=ao(),r=e.get(Xte),n=PTn(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(Xte):l.set(Xte,a),l},{replace:!0})},[t]);return o.jsx(FTn,{initialPreset:n,onPresetChange:s,children:o.jsx(uNn,{})})}function uNn(){const{error:e}=N1t();return e&&Ts(e)?o.jsx(qr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(Ys,{})}):e&&ys(e)?o.jsx(qr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(Us,{resource:"metrics"})}):e?o.jsx(qr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(Ic,{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(vn,{children:o.jsxs(vn.Title,{children:[o.jsx(sk,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(lNn,{}),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,{})})]})]})}),o.jsx(iNn,{})]})}const dNn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:sk,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:Di,href:"/observability"}];function fNn(){return o.jsxs(mk,{children:[o.jsx(mk.Top,{children:o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{children:[o.jsx(Di,{})," 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:dNn.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 hNn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:pa,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:Mi,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:Jw,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:vl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Pi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:lc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:NE,href:"/request-context"}];function pNn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{children:[o.jsx(m2t,{})," 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:hNn.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 mNn(){const{paths:e}=ir(),{data:t,isLoading:r,error:n}=jwt(),{isCmsAvailable:s}=aM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ts(n)?o.jsx(qr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Ys,{})}):n&&ys(n)?o.jsx(qr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Us,{resource:"prompt blocks"})}):n?o.jsx(qr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Ic,{title:"Failed to load prompt blocks",message:n.message})}):l.length===0&&!r?o.jsx(qr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(ySn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(vn,{children:o.jsxs(vn.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(ge,{as:dr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(cs,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(vSn,{promptBlocks:l,isLoading:r,search:a})]})}function gNn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{children:[o.jsx(NE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(Mxn,{children:o.jsx(iwt,{})})})]})}const vNn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:NMt,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:va,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:Kle,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:oVe,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:OPt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function yNn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(vn,{children:o.jsxs(vn.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:vNn.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(va,{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 bNn(){const{data:e={},isLoading:t,error:r}=md(),[n,s]=b.useState(""),[a,i]=b.useState("all");if(r&&Ts(r))return o.jsx(qr,{title:"Scorers",icon:o.jsx(Ma,{}),children:o.jsx(Ys,{})});if(r&&ys(r))return o.jsx(qr,{title:"Scorers",icon:o.jsx(Ma,{}),children:o.jsx(Us,{resource:"scorers"})});if(r)return o.jsx(qr,{title:"Scorers",icon:o.jsx(Ma,{}),children:o.jsx(Ic,{title:"Failed to load scorers",message:r.message})});if(Object.keys(e).length===0&&!t)return o.jsx(qr,{title:"Scorers",icon:o.jsx(Ma,{}),children:o.jsx(G0n,{})});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(vn,{children:o.jsxs(vn.Title,{isLoading:t,children:[o.jsx(Ma,{})," 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(Y0n,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(W0n,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function xNn(){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}=q0n(e),{data:f={},isLoading:h,error:p}=Ng(),{isLoading:m,error:g}=o0(),{data:v=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=V0n({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(Y=>{const q=new URLSearchParams(Y);return q.set("entity",L.value),q})};b.useEffect(()=>{const L=t.get("scoreId")??void 0;if(L===s)return;if(!L){a(void 0);return}v.find(q=>q.id===L)&&a(L)},[t,v]);const R=b.useCallback(L=>{a(L||void 0),r(Y=>{const q=new URLSearchParams(Y);return L?q.set("scoreId",L):q.delete("scoreId"),q})},[r]);if(!c)return null;const z=Ts(d)||Ts(p)||Ts(g),D=d&&ys(d),U=!z&&!D&&(d||p||g),F=!x&&v.length===0,B=i?.value!=="all",H=o.jsxs(o.Fragment,{children:[o.jsxs(Za,{children:[o.jsx(Cr,{as:dr,to:"/scorers",children:"Scorers"}),o.jsx(H0n,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(vn,{children:[o.jsxs(vn.Title,{isLoading:u,children:[o.jsx(Ma,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(vn.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(ge,{variant:"light",as:dr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(dy,{})," Edit"]})]})]})]});if(z||D||U||F&&!B){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:z?o.jsx(Ys,{}):D?o.jsx(Us,{resource:"scorers"}):U?o.jsx(Ic,{title:"Failed to load scorer",message:L}):o.jsx(D0n,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(F0n,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{r(L=>{const Y=new URLSearchParams(L);return Y.set("entity","all"),Y})},isLoading:x||h||m})]}),o.jsx(M0n,{scores:v,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const wNn=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],SNn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=Lve(),{theme:n,setTheme:s}=Qn(),[a,i]=b.useState(n),l=b.useRef(n);return b.useEffect(()=>{i(n),l.current=n},[n]),o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{children:[o.jsx(Qpe,{})," 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(idt,{name:"theme",label:"Theme mode",value:a,onValueChange:c=>{const u=c;l.current=u,i(u)},options:wNn.map(c=>({...c}))})]})}),o.jsx(cwt,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r},onSave:()=>{s(l.current)}})]})]})};function ONn(){const[e]=ao(),t=mu(),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 kNn(e){return e.replace(/\/$/,"").split("/").pop()}function X8({children:e,className:t}){return o.jsx("div",{className:Z("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function _Nn({templates:e,linkComponent:t,className:r,isLoading:n}){const s=t||"a";return n?o.jsx("div",{className:Z("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:Z("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:Z("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:Z("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Z("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:Z("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:Z("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(pa,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(Pi,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(vVe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(oF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(vl,{})," ",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:Z("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(iut,{})," ",kNn(a.githubUrl)]})})]},a.slug)})})}function ENn({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:Z("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:Z("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(Ex,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx(Lo,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx(Lo,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:n,onValueChange:a,options:r}),c&&o.jsxs(ge,{onClick:c,children:["Reset ",o.jsx(Nn,{})]})]})}function CNn(){const{data:e,isLoading:t}=D4r(),{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("")},v=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(Fr,{children:[o.jsx(En,{children:o.jsxs(Xu,{children:[o.jsx(je,{children:o.jsx(Ub,{})}),"Templates"]})}),o.jsxs("div",{className:Z("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(ENn,{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(_Nn,{templates:v,linkComponent:dr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const jNn="1.28.0-alpha.1";function TNn({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(n2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(X8,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Z("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 NNn({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(X8,{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:Z("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(yVe,{})]}),o.jsx(Lo,{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:Z("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(Mt,{})," Loading variables..."]}):Object.entries(n).map(([h,p])=>o.jsxs(b.Fragment,{children:[o.jsx(_x,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(_x,{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(owt,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(ge,{className:Z("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(Mt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(yh,{})]})})]})})}function ANn({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:Z("grid mt-8 items-center"),children:o.jsxs("div",{className:Z("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(Ub,{}),o.jsx("h2",{className:Z({"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:Z("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:Z("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(qv,{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(nF,{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(iut,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(pC,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function INn({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(X8,{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(QLr,{steps:p})}),i&&n==="error"&&o.jsxs("div",{className:Z("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(Z2t,{}),i||"Something went wrong"]}),c&&o.jsx(HLr,{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(Mt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function RNn({name:e,installedEntities:t}){return o.jsxs(X8,{className:Z("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(yVe,{}),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(pC,{data:t})]})}function PNn(){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,v]=b.useState(!1),[x,w]=b.useState(""),[S,k]=b.useState(!1),[_,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=L4r({repoOrSlug:e,owner:"mastra-ai"}),R=jNn?.includes("beta")??!1?"beta":"main",{data:z,isLoading:D}=$4r({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:U,isLoading:F}=F4r(),{mutateAsync:B,isPending:H}=z4r(),{mutateAsync:W}=B4r(),{streamInstall:L,streamResult:Y,isStreaming:q}=V4r(U),{observeInstall:M,streamResult:Q,isStreaming:G}=q4r(U);b.useEffect(()=>{const ae=t.get("runId");ae&&!g&&!p&&!q&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:ae}),w(ae),W({runId:ae}).then(le=>{const xe=le.snapshot;if(xe?.status==="success"&&xe?.result?.success)v(!0);else if(xe?.result?.success===!1)if(xe?.result?.validationResults&&!xe?.result?.validationResults?.valid&&xe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:he,errors:me}=xe.result.validationResults,ue=`Template installation completed but ${he} validation issue${he>1?"s":""} remain unresolved.`;m(ue),j(me||[])}else{const he=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof he=="string"?he:String(he))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,p,q,G,W]),b.useEffect(()=>{const ae=t.get("runId"),le=t.get("resume"),xe=t.get("provider");if(ae&&le==="true"&&xe&&!q&&!G&&!S&&!_&&U){w(ae),k(!0);try{W({runId:ae}).then(fe=>{if(fe.snapshot?.status==="running")return M.mutateAsync({runId:ae})}).then(()=>{r(fe=>{const he=new URLSearchParams(fe);return he.delete("resume"),he})}).catch(fe=>{console.error("❌ Failed to resume template installation:",fe),fe.message?.includes("404")||fe.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(fe){console.error("❌ Auto-resume failed with error:",fe),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,q,G,S,_,U,W,M,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ne=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(ae=>ae).join(", "):"n/a",icon:o.jsx(Pi,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(ae=>ae).join(", "):"n/a",icon:o.jsx(pa,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(ae=>ae).join(", "):"n/a",icon:o.jsx(oF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(gp,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(IE,{})}],ee=[{...ne[0]},{...ne[1]},{...ne[2]}].filter(ae=>ae.value!=="n/a");b.useEffect(()=>{z&&d(z)},[z]),b.useEffect(()=>{const ae=Y||Q;ae?.phase==="error"&&ae?.error&&m(typeof ae.error=="string"?ae.error:String(ae.error))},[Y?.phase,Y?.error,Q?.phase,Q?.error]);const re=ae=>{s(ae)},ie=async ae=>(i(ae.provider),c(ae.modelId),{message:"Model updated successfully"}),ce=async()=>{const ae=Object.entries(u).reduce((le,[xe,fe])=>(fe===""&&le.push(xe),le),[]);if(ae.length>0){h(ae);return}if(N){m(null),v(!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:fe}=await B({});w(fe),r(he=>{const me=new URLSearchParams(he);return me.set("runId",fe),me.set("resume","true"),me.set("provider",n||"openai"),me}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:fe})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},K=ae=>{const{name:le,value:xe}=ae.target;xe.trim()===""?h(fe=>[...fe,le]):h(fe=>fe.filter(he=>he!==le)),d(fe=>({...fe,[le]:xe}))};return o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/templates",children:[o.jsx(je,{children:o.jsx(Ub,{})}),"Templates"]}),o.jsx(Cr,{as:dr,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Z("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(ANn,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ne,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(q||G)&&o.jsx(INn,{name:N.title,streamResult:G?Q:Y,runId:x,workflowInfo:U}),g&&o.jsx(RNn,{name:N.title,installedEntities:ee,linkComponent:dr}),p&&o.jsx(TNn,{errorMsg:p,validationErrors:T.length>0?T:Y?.validationResults?.errors||Q?.validationResults?.errors}),!q&&!G&&!g&&!p&&o.jsx(NNn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:ce,handleVariableChange:K,isLoadingEnvVars:D||F,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const MNn=()=>{const{toolId:e,agentId:t}=na();return o.jsxs(Fr,{children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/agents",children:[o.jsx(je,{children:o.jsx(pa,{})}),"Agents"]}),o.jsx(Cr,{as:dr,to:`/agents/${t}/chat`,children:t}),o.jsx(Cr,{as:dr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(je,{children:o.jsx(a0,{})}),"Tools documentation"]})})]}),o.jsx(Own,{toolId:e,agentId:t})]})},DNn=()=>{const{toolId:e}=na();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/tools",children:[o.jsx(je,{children:o.jsx(Pi,{})}),"Tools"]}),o.jsx(Cr,{as:"span",to:"",isCurrent:!0,children:o.jsx(_Tn,{value:e,variant:"ghost"})})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(a0,{}),"Tools documentation"]})})]}),o.jsx(kTn,{toolId:e})]})},LNn=async({client:e,page:t,perPage:r,filters:n})=>e.listTraces({pagination:{page:t,perPage:r},filters:n}),$Nn=25;function FNn(e,t,r){if(e?.pagination?.hasMore)return r+1}function zNn(e){const t=new Set,r=e.pages.flatMap(s=>s.spans??[]).filter(s=>t.has(s.traceId)?!1:(t.add(s.traceId),!0)),n={};for(const s of e.pages)s.threadTitles&&Object.assign(n,s.threadTitles);return{spans:r,threadTitles:n}}const BNn=({filters:e})=>{const t=Ge(),{inView:r,setRef:n}=w1(),s=i0({queryKey:["traces",e],queryFn:({pageParam:c})=>LNn({client:t,page:c,perPage:$Nn,filters:e}),initialPageParam:0,getNextPageParam:FNn,select:zNn,placeholderData:r4r,retry:!1,refetchInterval:c=>ys(c.state.error)?!1:3e3}),{hasNextPage:a,isFetchingNextPage:i,fetchNextPage:l}=s;return b.useEffect(()=>{r&&a&&!i&&l()},[r,a,i,l]),{...s,setEndOfListElement:n}};function UNn(e){const t=new Map,r=[];for(const s of e)if(s.threadId){const a=t.get(s.threadId);a?a.push(s):t.set(s.threadId,[s])}else r.push(s);const n=Array.from(t.entries()).map(([s,a])=>({threadId:s,traces:a}));return n.sort((s,a)=>{const i=Math.max(...s.traces.map(c=>new Date(c.createdAt).getTime()));return Math.max(...a.traces.map(c=>new Date(c.createdAt).getTime()))-i}),{groups:n,ungrouped:r}}function VNn(e,t=100){if(e==null)return"";const r=Array.isArray(e)?e:e&&typeof e=="object"&&!Array.isArray(e)&&Array.isArray(e.messages)?e.messages:null;if(r){const i=r.filter(l=>l?.role==="user").map(l=>typeof l.content=="string"?l.content:Array.isArray(l.content)?l.content.map(c=>typeof c=="string"?c:c?.type==="text"&&typeof c.text=="string"?c.text:"").filter(Boolean).join(" "):"").filter(Boolean).join(" | ");return i.length>t?i.slice(0,t)+"…":i}if(typeof e=="string")return e.length>t?e.slice(0,t)+"…":e;const n=JSON.stringify(e);return n.length>t?n.slice(0,t)+"…":n}function qNn(e){return e?.attributes?.finishReason==="length"}function HNn(e){const t=e?.attributes?.usage;if(!t)return"The model stopped generating because it reached the maximum token limit. The response was truncated and may be incomplete.";const r=t.inputTokens??0,n=t.outputTokens??0,s=t.totalTokens??r+n;return r>0||n>0?`The model stopped generating because it reached the maximum token limit. The response was truncated and may be incomplete.
555
+ ]`})]})]})}function aCn({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(je,{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 iCn({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:v}=dEn(),{batchInsertItems:x}=ri(),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(sCn,{onFileSelect:w,isParsing:g,error:v?.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(aCn,{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(nCn,{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(Mt,{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(ge,{onClick:_,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ge,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(ge,{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(ge,{variant:"primary",onClick:k,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx(kn,{open:t,onOpenChange:_,children:o.jsxs(xn,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(_n,{children:[o.jsx(wn,{children:N[s]}),o.jsx(ea,{children:"Import dataset items from a JSON file."})]}),o.jsx(qn,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(mf,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function oCn({dataset:e,isLoading:t=!1,onEditClick:r,onDuplicateClick:n,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(Ar,{className:c,children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{isLoading:t,children:[o.jsx(ja,{})," ",e?.name]}),o.jsx(Ar.Description,{isLoading:t,children:e?.description}),o.jsxs(Ar.Description,{isLoading:t,children:[o.jsxs(fs,{children:[o.jsx(m_,{})," Created at ",e?.createdAt?ur(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(fs,{children:[o.jsx(Ux,{})," Latest version v",e?.version??""]})]})]}),o.jsx(Ar.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(ge,{disabled:!0,tabIndex:-1,children:[o.jsx(hx,{}),"Run Experiment"]})})}),o.jsx(Wr,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(ge,{onClick:l,children:[o.jsx(hx,{}),"Run Experiment"]}):null,o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsx(ge,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(uVe,{})})}),o.jsxs(yt.Content,{align:"end",className:"w-48",children:[o.jsxs(yt.Item,{onSelect:r,children:[o.jsx(dy,{})," Edit Dataset"]}),o.jsxs(yt.Item,{onSelect:n,children:[o.jsx(iu,{})," Duplicate Dataset"]}),o.jsxs(yt.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(id,{})," Delete Dataset"]})]})]})]})})]})}const u1t=e=>{const t=Ge(),{data:r}=yR(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})},lCn=e=>{const t=Ge(),{data:r}=yR(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 cCn(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 uCn=Z("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 yBe({className:e,children:t,...r}){return o.jsx(nP,{children:o.jsx(sz,{className:Z(uCn,e),...r,children:t})})}function dCn({datasetId:e}){const t=Ge(),{data:r}=Rg(e),{data:n,isLoading:s}=u1t(e),{data:a,isLoading:i}=lCn(e),{updateExperimentResult:l}=ri(),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState(new Set),[m,g]=b.useState(!1),[v,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,z]=b.useState(!1),[D,U]=b.useState(null),F=D??n??[];b.useEffect(()=>{n&&D===null&&U(n)},[n]);const B=b.useMemo(()=>{const ye=new Set;if(r?.tags)for(const Ce of r.tags)ye.add(Ce);for(const Ce of F)for(const Fe of Ce.tags)ye.add(Fe);return[...ye].sort()},[r,F]),H=b.useCallback(ye=>{!r||!e||(r.tags??[]).includes(ye)},[r,e]),W=b.useMemo(()=>d?d==="__untagged__"?F.filter(ye=>ye.tags.length===0):F.filter(ye=>ye.tags.includes(d)):F,[F,d]),L=b.useMemo(()=>{const ye=new Map;for(const Ce of F)for(const Fe of Ce.tags)ye.set(Fe,(ye.get(Fe)??0)+1);return[...ye.entries()].sort((Ce,Fe)=>Fe[1]-Ce[1])},[F]),Y=b.useMemo(()=>F.filter(ye=>ye.tags.length===0).length,[F]),q=b.useMemo(()=>{let ye=0;return d&&ye++,m&&ye++,ye},[d,m]),M=b.useCallback((ye,Ce)=>{U(ct=>(ct??[]).map(wt=>wt.id===ye?{...wt,tags:Ce}:wt));const Fe=F.find(ct=>ct.id===ye);Fe?.experimentId&&Fe?.datasetId&&l.mutate({datasetId:Fe.datasetId,experimentId:Fe.experimentId,resultId:Fe.id,tags:Ce})},[F,l]),Q=b.useCallback((ye,Ce)=>{const Fe=F.find(ct=>ct.id===ye);Fe?.traceId&&Ce!==void 0&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ce==="positive"?1:-1,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),U(ct=>(ct??[]).map(wt=>wt.id===ye?{...wt,rating:Ce}:wt))},[F,t]),G=b.useCallback((ye,Ce)=>{const Fe=F.find(ct=>ct.id===ye);Fe?.traceId&&t.createFeedback({feedback:{traceId:Fe.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ce,comment:Ce,experimentId:Fe.experimentId??void 0,sourceId:Fe.id}}).catch(()=>{}),U(ct=>(ct??[]).map(wt=>wt.id===ye?{...wt,comment:Ce}:wt))},[F,t]),J=b.useCallback(ye=>{const Ce=F.find(Fe=>Fe.id===ye);U(Fe=>(Fe??[]).filter(ct=>ct.id!==ye)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ye),ct}),c===ye&&u(null),Ce?.experimentId&&Ce?.datasetId&&l.mutate({datasetId:Ce.datasetId,experimentId:Ce.experimentId,resultId:Ce.id,status:null})},[F,l,c]),ne=b.useCallback(ye=>{const Ce=F.find(Fe=>Fe.id===ye);U(Fe=>(Fe??[]).filter(ct=>ct.id!==ye)),p(Fe=>{const ct=new Set(Fe);return ct.delete(ye),ct}),c===ye&&u(null),Ce?.experimentId&&Ce?.datasetId&&l.mutate({datasetId:Ce.datasetId,experimentId:Ce.experimentId,resultId:Ce.id,status:"complete"})},[F,l,c]),ee=b.useMemo(()=>{const ye=m?a??[]:W;return!m||!d?ye:d==="__untagged__"?ye.filter(Ce=>Ce.tags.length===0):ye.filter(Ce=>Ce.tags.includes(d))},[m,a,W,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(ee.map(ye=>ye.id)),[ee]),ce=b.useMemo(()=>[...h].filter(ye=>ie.has(ye)).length,[h,ie]),K=ee.length>0&&ce===ee.length,ae=ce>0&&!K,le=b.useCallback(ye=>{p(Ce=>{const Fe=new Set(Ce);return Fe.has(ye)?Fe.delete(ye):Fe.add(ye),Fe})},[]),xe=b.useCallback(()=>{p(K?new Set:new Set(ee.map(ye=>ye.id)))},[K,ee]),fe=b.useCallback(ye=>{for(const Ce of h){const Fe=F.find(ct=>ct.id===Ce);Fe&&!Fe.tags.includes(ye)&&M(Ce,[...Fe.tags,ye])}},[F,h,M]),he=b.useCallback(ye=>{for(const Ce of h){const Fe=F.find(ct=>ct.id===Ce);Fe&&Fe.tags.includes(ye)&&M(Ce,Fe.tags.filter(ct=>ct!==ye))}},[F,h,M]),me=b.useCallback(()=>{for(const ye of h)ne(ye);p(new Set)},[h,ne]),ue=b.useCallback(()=>{for(const ye of h)J(ye);p(new Set)},[h,J]),Se=b.useCallback(()=>{_(""),S(!0)},[]),X=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ye=F.filter(Fe=>h.has(Fe.id));if(ye.length===0){x(!1);return}const Ce=await t.clusterFailures({modelId:`${E}/${j}`,items:ye.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:B.length>0?B:void 0,prompt:k||void 0});Ce.proposedTags&&Ce.proposedTags.length>0&&(P(Ce.proposedTags.map(Fe=>({...Fe,accepted:!0}))),z(!0))}catch(ye){console.error("Analysis failed:",ye)}finally{x(!1)}}},[E,j,F,h,t,B,k]),oe=b.useCallback(()=>{for(const ye of I){if(!ye.accepted)continue;const Ce=F.find(Fe=>Fe.id===ye.itemId);if(Ce){const Fe=[...new Set([...Ce.tags,...ye.tags])];M(Ce.id,Fe)}}z(!1)},[I,F,M]),we=b.useCallback(ye=>{u(Ce=>Ce===ye?null:ye)},[]),Ae=b.useMemo(()=>c?ee.find(ye=>ye.id===c)??null:null,[c,ee]),$e=b.useCallback(()=>{if(!c||ee.length===0)return;const ye=ee.findIndex(Ce=>Ce.id===c);ye<ee.length-1&&u(ee[ye+1].id)},[c,ee]),be=b.useCallback(()=>{if(!c||ee.length===0)return;const ye=ee.findIndex(Ce=>Ce.id===c);ye>0&&u(ee[ye-1].id)},[c,ee]),_e=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(Mt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx(kn,{open:w,onOpenChange:S,children:o.jsxs(xn,{children:[o.jsxs(_n,{children:[o.jsx(wn,{children:"Analyze Items"}),o.jsx(ea,{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(Pg,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(xt,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Mg,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(ve,{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(wc,{value:k,onChange:ye=>_(ye.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(mf,{children:[o.jsx(ge,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(ge,{onClick:X,disabled:!E||!j||v,children:[v?o.jsx(Mt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx(kn,{open:R,onOpenChange:z,children:o.jsxs(xn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(_n,{children:[o.jsx(wn,{children:"Review Proposed Tags"}),o.jsxs(ea,{children:[I.filter(ye=>ye.accepted).length," of ",I.length," proposals selected"]})]}),o.jsx("div",{className:"space-y-3 py-2",children:I.map((ye,Ce)=>{const Fe=F.find(ct=>ct.id===ye.itemId);return o.jsx("div",{className:Z("p-3 border rounded-lg",!ye.accepted&&"opacity-50"),children:o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(di,{checked:ye.accepted,onCheckedChange:ct=>P(wt=>wt.map((or,Ve)=>Ve===Ce?{...or,accepted:!!ct}:or))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(ve,{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):ye.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ye.tags.map((ct,wt)=>o.jsx(r1t,{tag:ct,onRename:or=>P(Ve=>Ve.map((qe,Ie)=>Ie===Ce?{...qe,tags:qe.tags.map((Le,Re)=>Re===wt?or:Le)}:qe)),onRemove:()=>P(or=>or.map((Ve,qe)=>qe===Ce?{...Ve,tags:Ve.tags.filter((Ie,Le)=>Le!==wt)}:Ve))},`${ct}-${wt}`))}),ye.reason&&o.jsx(ve,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ye.reason})]})]})},ye.itemId)})}),o.jsxs(mf,{children:[o.jsx(ge,{variant:"outline",onClick:()=>z(!1),children:"Cancel"}),o.jsxs(ge,{onClick:oe,disabled:I.filter(ye=>ye.accepted).length===0,children:["Accept ",I.filter(ye=>ye.accepted).length," proposals"]})]})]})}),o.jsxs(of,{className:Ae?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ge,{variant:"outline",size:"md",children:[o.jsx(dVe,{}),"Filter",q>0&&o.jsx("span",{className:Z("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:q})]})}),o.jsxs(yt.Content,{align:"start",className:Z("min-w-48"),children:[o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Z("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(yBe,{children:[o.jsx(yt.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ye=>ye.preventDefault(),children:"Review Queue"}),o.jsx(yt.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ye=>ye.preventDefault(),children:"Completed"})]})]}),o.jsxs(yt.Sub,{children:[o.jsxs(yt.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Z("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(yBe,{children:[o.jsx(yt.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ye=>ye.preventDefault(),children:"All"}),Y>0&&o.jsx(yt.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ye=>ye.preventDefault(),children:"Untagged"}),L.length>0&&o.jsx(yt.Separator,{}),L.map(([ye])=>o.jsx(yt.CheckboxItem,{checked:d===ye,onCheckedChange:()=>f(d===ye?null:ye),onSelect:Ce=>Ce.preventDefault(),children:ye},ye))]})]}),q>0&&o.jsxs(o.Fragment,{children:[o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(Nn,{}),"Clear all filters"]})]})]})]}),q>0&&o.jsxs(ge,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(Nn,{}),"Reset"]})]}),!m&&h.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(t1t,{selectedCount:h.size,vocabulary:B,onApplyTag:fe,onRemoveTag:he,onNewTag:ye=>fe(ye)}),o.jsxs(yt,{children:[o.jsx(yt.Trigger,{asChild:!0,children:o.jsxs(ge,{disabled:v,children:[v?o.jsx(Mt,{className:"w-4 h-4"}):o.jsx(je,{size:"sm",children:o.jsx(Gn,{})}),"Actions"]})}),o.jsxs(yt.Content,{align:"end",children:[o.jsxs(yt.Item,{onSelect:me,children:[o.jsx(je,{size:"sm",children:o.jsx(dx,{})}),"Complete"]}),o.jsxs(yt.Item,{onSelect:ue,children:[o.jsx(je,{size:"sm",children:o.jsx(id,{})}),"Remove"]}),o.jsx(yt.Separator,{}),o.jsxs(yt.Item,{onSelect:Se,children:[o.jsx(je,{size:"sm",children:o.jsx(g_,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Mt,{className:"w-6 h-6"})}):ee.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(ve,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(ve,{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(Oe,{columns:_e,children:[o.jsxs(Oe.Top,{children:[!m&&o.jsx(Oe.TopCell,{children:o.jsx(di,{checked:K?!0:ae?"indeterminate":!1,onCheckedChange:()=>xe(),"aria-label":"Select all"})}),m&&o.jsx(Oe.TopCell,{children:" "}),o.jsx(Oe.TopCell,{children:"Input"}),o.jsx(Oe.TopCell,{children:"Comment"}),o.jsx(Oe.TopCell,{children:"Tags"}),!Ae&&o.jsx(Oe.TopCell,{children:"Rating"}),!Ae&&o.jsx(Oe.TopCell,{children:"Scores"})]}),o.jsx(Oe.Rows,{children:ee.map(ye=>{const Ce=ye.scores?Object.entries(ye.scores):[];return o.jsxs(Oe.Row,{onClick:()=>we(ye.id),selected:c===ye.id,children:[o.jsx(Oe.Cell,{children:m?ye.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(di,{checked:h.has(ye.id),onCheckedChange:()=>le(ye.id),onClick:Fe=>Fe.stopPropagation(),"aria-label":`Select item ${ye.id}`})}),o.jsx(Oe.NameCell,{children:cCn(ye.input,80)}),o.jsx(Oe.Cell,{children:ye.comment?o.jsx(ve,{variant:"ui-xs",className:"text-neutral3 truncate",children:ye.comment}):o.jsx(ve,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(Oe.Cell,{children:ye.tags.length>0?o.jsx(ve,{variant:"ui-xs",className:"text-neutral4 truncate",children:ye.tags.join(", ")}):o.jsx(ve,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Ae&&o.jsxs(Oe.Cell,{children:[ye.rating==="positive"&&o.jsx(je,{size:"sm",className:"text-positive1",children:o.jsx(rce,{})}),ye.rating==="negative"&&o.jsx(je,{size:"sm",className:"text-negative1",children:o.jsx(tce,{})}),!ye.rating&&o.jsx(ve,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Ae&&o.jsx(Oe.Cell,{children:Ce.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(je,{size:"sm",className:"text-neutral3",children:o.jsx(Ma,{})}),o.jsx(ve,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ce[0][1].toFixed(2)}),Ce.length>1&&o.jsxs(gt,{variant:"default",children:["+",Ce.length-1]})]}):o.jsx(ve,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ye.id)})})]})]}),Ae&&o.jsx(e1t,{item:Ae,isCompleted:m,tagVocabulary:B,onRate:ye=>Q(Ae.id,ye),onSetTags:ye=>{M(Ae.id,ye);for(const Ce of ye)B.includes(Ce)||H(Ce)},onComment:ye=>G(Ae.id,ye),onRemove:()=>J(Ae.id),onComplete:m?void 0:()=>ne(Ae.id),onPrevious:be,onNext:$e,onClose:()=>u(null)})]})]})}function fCn({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}=ir(),[h,p]=b.useState(u??"items"),m=Ut=>{p(Ut),d?.(Ut)},[g,v]=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),[z,D]=b.useState([]),[U,F]=b.useState(!1),[B,H]=b.useState(0),[W,L]=b.useState(null),[Y,q]=b.useState(""),[M]=ccr(Y,300),[Q,G]=b.useState(null),ne=l!==void 0?l:Q,{data:ee,isLoading:re}=Rg(e),{data:ie=[],total:ce,isLoading:K,setEndOfListElement:ae,isFetchingNextPage:le,hasNextPage:xe}=kE(e,M||void 0,ne),{data:fe=[],total:he,isLoading:me}=kE(e,void 0,ne),[ue,Se]=b.useState({}),{data:X,isLoading:oe}=yR(e,void 0,ue),{data:we}=yR(e),{deleteItems:Ae}=ri(),$e=X?.experiments??[],be=we?.experiments??[],_e=TEn({hasSearchQuery:!!M,filteredItemsLength:ie.length,unfilteredItemsTotal:he,itemsTotal:ce}),{data:ye}=u1t(e),Ce=ye?.length??0,Fe=Ut=>{L(Ut)},ct=()=>{L(null)},wt=Ut=>{const Lr=Ut.isCurrent?null:Ut;c?c(Lr):G(Ut.isCurrent?null:Ut.version)},or=Ut=>{E(Ut),k(!0)},Ve=Ut=>{I(Ut),j(!0)},qe=Ut=>{j(Ut),Ut||(I([]),H(Lr=>Lr+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:z}),ze.success(`Deleted ${z.length} items`),R(!1),D([]),H(Ut=>Ut+1)},rt=Ut=>{k(!1),E([]),H(Lr=>Lr+1),i?.(Ut)},ht=Ut=>{k(Ut),Ut||(E([]),H(Lr=>Lr+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Z("h-full w-full",sn.allSlow),children:o.jsxs("div",{className:Z("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",W?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(oCn,{dataset:ee,isLoading:re,onEditClick:r,onDuplicateClick:()=>F(!0),onDeleteClick:n,experimentTriggerSlot:a,disableExperimentTrigger:!me&&fe.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(Ss,{value:"items",children:["Items ",o.jsx($a,{color:"gray",children:_e})]}),o.jsxs(Ss,{value:"experiments",children:["Experiments",o.jsx($a,{color:"gray",children:$e.length})]}),o.jsxs(Ss,{value:"review",children:["Review",Ce>0&&o.jsx($a,{color:"orange",children:Ce})]})]}),o.jsx(Ps,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(rCn,{datasetId:e,items:ie,isLoading:K,featuredItemId:W,onItemSelect:Fe,onItemClose:ct,onAddClick:s??(()=>{}),onImportClick:()=>v(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Re,onCreateDatasetClick:or,onAddToDatasetClick:Ve,onCompareItemsClick:Ie,datasetName:ee?.name,clearSelectionTrigger:B,setEndOfListElement:ae,isFetchingNextPage:le,hasNextPage:xe,searchQuery:Y,onSearchChange:q,activeDatasetVersion:ne,currentDatasetVersion:ee?.version,onVersionSelect:wt,onCompareVersionsClick:Le})}),o.jsx(Ps,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(HEn,{experiments:$e,allExperiments:be,isLoading:oe,datasetId:e,filters:ue,onFiltersChange:Se})}),o.jsx(Ps,{value:"review",className:"overflow-auto mt-0",children:o.jsx(dCn,{datasetId:e})})]})})]})})}),o.jsx(LEn,{datasetId:e,open:g,onOpenChange:v}),o.jsx(iCn,{datasetId:e,open:x,onOpenChange:w}),o.jsx(OEn,{open:S,onOpenChange:ht,items:_,onSuccess:rt}),o.jsx(kEn,{open:T,onOpenChange:qe,items:N,currentDatasetId:e}),o.jsx(_En,{open:U,onOpenChange:F,sourceDatasetId:e,sourceDatasetName:ee?.name||"",sourceDatasetDescription:ee?.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 ",z.length," item",z.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 hCn(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 bBe({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 pCn({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}=ri(),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=hCn(_);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)},v=()=>{a("{}"),l(""),u(""),f(null),r(!1)};return o.jsx(kn,{open:t,onOpenChange:r,children:o.jsxs(xn,{className:"max-w-lg",children:[o.jsx(_n,{children:o.jsx(wn,{children:"Add Item"})}),o.jsx(qn,{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(hs,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(bBe,{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(hs,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(bBe,{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(hs,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(ge,{type:"button",onClick:v,children:"Cancel"}),o.jsx(ge,{type:"submit",variant:"primary",disabled:h.isPending,children:h.isPending?"Adding...":"Add Item"})]})]})})]})})}function mCn({selectedScorers:e,setSelectedScorers:t,disabled:r=!1,container:n}){const{data:s,isLoading:a}=md(),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(xut,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:r||a,container:n})]})}const gCn=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function vCn({targetType:e,setTargetType:t,targetId:r,setTargetId:n,container:s}){const{data:a,isLoading:i}=Ng(),{data:l,isLoading:c}=o0(),{data:u,isLoading:d}=md(),f=e==="agent"?Object.entries(a??{}).map(([g,v])=>({value:g,label:v.name??g})):e==="workflow"?Object.entries(l??{}).map(([g,v])=>({value:g,label:v.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,v])=>({value:g,label:v.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(Jl,{options:gCn,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(Jl,{options:f,value:r,onValueChange:n,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:h,container:s})]})]})}function yCn({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}=ri(),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});xc.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";xc.error(w)}},v=()=>{m||(n(!1),l(""),u(""),f([]))};return o.jsx(kn,{open:r,onOpenChange:v,children:o.jsxs(xn,{ref:a,children:[o.jsxs(_n,{children:[o.jsx(wn,{children:"Run Experiment"}),o.jsx(ea,{children:t?`Execute items from ${ur(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(qn,{className:"grid gap-6",children:[o.jsx(vCn,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(mCn,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(mf,{className:"px-6 pt-4",children:[o.jsx(ge,{onClick:v,disabled:m,children:"Cancel"}),o.jsx(ge,{variant:"primary",onClick:g,disabled:!p||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Mt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const d1t=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})},xBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function bCn({result:e,scores:t,onPrevious:r,onNext:n,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=qte(e?.input),d=qte(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(gC,{onPrevious:r,onNext:n,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(ge,{onClick:a,disabled:!e.traceId,children:[o.jsx(ece,{}),"Show Trace"]}),o.jsx(ge,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(Nn,{})})]})]}),o.jsxs(gr.Content,{children:[o.jsx(Ar,{withMargins:!1,children:o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(hx,{})," ",e.id]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{children:[o.jsx(fx,{})," ",e.itemId]})})]})}),c&&o.jsxs(ml,{variant:"destructive",children:[o.jsx(W2t,{}),o.jsxs(ml.Message,{children:[o.jsx("strong",{children:"Error: "}),qte(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:xBe,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:xBe,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(IE,{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(Xt.CodeSection,{title:"Input",icon:o.jsx(fx,{}),codeStr:u}),o.jsx(Xt.CodeSection,{title:"Output",icon:o.jsx(yc,{}),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(m_,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:ur(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function qte(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function xCn({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Xt.CodeSection,{title:"Input",icon:o.jsx(Np,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Xt.CodeSection,{title:"Output",icon:o.jsx(yc,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Xt.CodeSection,{title:"Metadata",icon:o.jsx(yl,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Xt.CodeSection,{title:"Attributes",icon:o.jsx(yl,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function wCn({traceId:e,spanId:t,onNext:r,onPrevious:n,onClose:s}){const{data:a}=OE(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(gC,{onPrevious:n,onNext:r,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(ge,{onClick:s,"aria-label":"Close span details",children:o.jsx(Nn,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(yl,{})," Span ",af(t)]})})}),o.jsx(xCn,{span:i})]})]})}const SCn=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 f1t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...f1t(r))}),t}const wBe=["agent","workflow","model","mcp","tool","workspace","other"];function h1t(e){const t=e?.toLowerCase().split("_")[0],r={agent:{icon:o.jsx(pa,{}),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(Mi,{}),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(gp,{}),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(vl,{}),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(Pi,{}),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(w9,{}),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 OCn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Z("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(SBe,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(Gle,{}):o.jsx(uy,{}):o.jsx(Gn,{})]}),a>(l??0)&&!i&&o.jsxs(SBe,{onClick:()=>s?.(),children:[a," ",o.jsx(Wle,{})]})]}):null})}function SBe({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Z("h-full",r),children:o.jsx("div",{className:Z("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 kCn({isLastChild:e,hasChildren:t=!1,expanded:r=!1}){return o.jsx("div",{className:Z("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:Z("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(rVe,{}):o.jsx(tVe,{})})})}function _Cn({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:Z({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(kCn,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function p1t({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=f1t(e),v=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(_Cn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(OCn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:N,numOfChildren:m}),p&&S&&e.spans?.map((I,P,R)=>{const z=P===R.length-1;return o.jsx(p1t,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:z,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:h,featuredSpanIds:d},I.id)})]})}function ECn({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:Z("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(Mt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(p1t,{span:f,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function CCn({spans:e=[],fadedTypes:t,onLegendClick:r,onLegendReset:n,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=wBe.filter(h=>e.some(p=>p?.spanType?.startsWith(h)))||[],u=e.some(h=>!wBe.some(m=>h?.spanType?.startsWith(m))),d=h=>{r?.(h)};b.useEffect(()=>{f(i)},[i,s]);const f=Qtt(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(Ex,{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(Kut,{children:[c.map(h=>{const p=h1t(h),m=t?.includes(h);return o.jsx(b.Fragment,{children:o.jsxs(ge,{onClick:()=>d(h),className:m?"opacity-40":"",style:{color:m?void 0:p?.color,backgroundColor:p?.bgColor},children:[p?.icon&&o.jsx(je,{children:p.icon}),p?.label]})},h)}),u&&o.jsxs(ge,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(je,{children:o.jsx(tF,{})}),"Other"]}),o.jsx(ge,{onClick:n,disabled:t?.length===0,children:o.jsx(je,{children:o.jsx(Nn,{})})})]})]})}function jCn({traceId:e,selectedSpanId:t,onSpanSelect:r,onClose:n}){const{data:s,isLoading:a}=d1t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,m]=b.useState([]),g=b.useMemo(()=>SCn(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 v=S=>{r?.(t===S?void 0:S)},x=S=>{d(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(gr.Toolbar,{children:o.jsx(ge,{onClick:n,"aria-label":"Close trace panel",children:o.jsx(Nn,{})})}),o.jsxs(gr.Content,{children:[o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(Di,{})," Trace ",af(e)]})})}),o.jsx(CCn,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(ECn,{hierarchicalSpans:g,onSpanClick:v,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:p,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function TCn({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(Oe,{columns:d,children:[o.jsx(Oe.Top,{children:s.map(f=>o.jsx(Oe.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Mt,{})})]}):e.length===0?o.jsxs(Oe,{columns:d,children:[o.jsx(Oe.Top,{children:s.map(f=>o.jsx(Oe.TopCell,{children:f.label},f.name))}),o.jsx(Oe.NoMatch,{message:"No results yet"})]}):o.jsxs(Oe,{columns:d,children:[o.jsx(Oe.Top,{children:s.map(f=>o.jsx(Oe.TopCell,{children:f.label},f.name))}),o.jsxs(Oe.Rows,{children:[e.map(f=>{const h=!!f.error,p=f.id===r;return o.jsxs(Oe.Row,{onClick:()=>n(f.id),selected:p,children:[o.jsx(Oe.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(Oe.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:Z("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(Oe.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:ACn(NCn(f.input),200)})}),i?.map(m=>{const v=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(Oe.TextCell,{children:o.jsx("span",{className:"font-mono",children:v!=null?v.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(Mt,{})}),!u&&e.length>0&&o.jsx(ve,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function NCn(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function ACn(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function ICn(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function RCn({score:e,onNext:t,onPrevious:r,onClose:n}){const s=ICn(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(gr.Toolbar,{children:[o.jsx(gC,{onPrevious:r,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(ge,{onClick:n,"aria-label":"Close score details",children:o.jsx(Nn,{})})]}),o.jsxs(gr.Content,{children:[o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(Ma,{})," ",e.scorerId]})})}),o.jsxs(IS,{children:[o.jsx(Xt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(Ma,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Xt.CodeSection,{title:"Input",icon:o.jsx(fx,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Xt.CodeSection,{title:"Output",icon:o.jsx(yc,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Xt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(cc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Xt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(cc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Xt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(cc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Xt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(cc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const OBe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function PCn({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(Ka,{iconSlot:o.jsx(Ma,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:OBe,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:OBe,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 m1t({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(B=>B.id===l)??null,{data:v}=iSt(e,t),x=b.useMemo(()=>{if(!v)return[];const B=new Set;for(const H of Object.values(v))for(const W of H)B.add(W.scorerId);return[...B].sort()},[v]),{data:w}=d1t(u),S=w?.spans??[],k=()=>{if(!f)return;const B=S.findIndex(H=>H.spanId===f);if(B>=0&&B<S.length-1)return()=>h(S[B+1].spanId)},_=()=>{if(!f)return;const B=S.findIndex(H=>H.spanId===f);if(B>0)return()=>h(S[B-1].spanId)},E=B=>{c(B),d(null),h(void 0),m(null)},T=B=>{E(B===l?null:B)},j=()=>{E(null)},N=()=>{if(!g)return;const B=r.findIndex(H=>H.id===g.id);if(B>=0&&B<r.length-1)return()=>E(r[B+1].id)},I=()=>{if(!g)return;const B=r.findIndex(H=>H.id===g.id);if(B>0)return()=>E(r[B-1].id)},P=g?v?.[g.itemId]:void 0,R=P?.find(B=>B.id===p)??null,z=B=>{m(B===p?null:B),d(null),h(void 0)},D=()=>{if(!p||!P)return;const B=P.findIndex(H=>H.id===p);if(B>=0&&B<P.length-1)return()=>m(P[B+1].id)},U=()=>{if(!p||!P)return;const B=P.findIndex(H=>H.id===p);if(B>0)return()=>m(P[B-1].id)},F=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(B=>({name:B,label:B,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(Ss,{value:"summary",children:"Summary"}),o.jsx(Ss,{value:"results",children:"Results"})]}),o.jsx(Ps,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(PCn,{scoresByItemId:v,experimentStatus:t})}),o.jsx(Ps,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(of,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(gr,{children:o.jsx(TCn,{results:r,isLoading:n,featuredResultId:l,onResultClick:T,columns:F,scoresByItemId:v,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(KLr,{numOfColumns:1+(!u&&p?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(bCn,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:z,featuredScoreId:p,onShowTrace:()=>{d(g.traceId??null),h(void 0),m(null)}})}),g&&!u&&R&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(RCn,{score:R,onNext:D(),onPrevious:U(),onClose:()=>m(null)})}),g&&u&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(jCn,{traceId:u,selectedSpanId:f,onSpanSelect:h,onClose:()=>{d(null),h(void 0)}})}),g&&u&&f&&o.jsx(gr,{withLeftSeparator:!0,children:o.jsx(wCn,{traceId:u,spanId:f,onNext:k(),onPrevious:_(),onClose:()=>h(void 0)})})]})]})})]})}const MCn={pending:o.jsx(jE,{}),running:o.jsx(u3,{}),completed:o.jsx(ra,{}),failed:o.jsx(Nn,{})};function DCn({experiment:e,className:t}){const r=e.status,n=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Z("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:Z("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:MCn[r]}),e.status]}),o.jsxs("div",{className:Z("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}=ir(),{data:s}=Ng(),{data:a}=o0(),{data:i}=md(),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(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(sVe,{}),e," ",e&&o.jsx(Xa,{content:e})]}),o.jsxs(Ar.Description,{children:[o.jsxs(fs,{children:[o.jsx(m_,{})," Created at ",ur(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(fs,{children:[o.jsx(m_,{})," Completed at ",ur(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(Ar.Description,{children:[o.jsxs(fs,{children:[o.jsx(SMt,{})," Target",o.jsx(r,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(fs,{children:[o.jsx(nF,{})," 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(Xa,{content:t.agentVersion})]})]})]}),o.jsx(Ar.Column,{children:o.jsx(DCn,{experiment:t})})]})}function pye({delta:e}){const t=e>0?o.jsx($a,{size:"small",color:"green",intensity:"muted",children:o.jsx(eF,{})}):e<0?o.jsx($a,{size:"small",color:"red",intensity:"muted",children:o.jsx(Qle,{})}):null;return o.jsxs("span",{className:Z("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 PL(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function LCn({item:e,baselineId:t,contenderId:r,baselineVersion:n,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[r],d=!!(c&&u),f=new Set;if(c)for(const p of Object.keys(c.scores))f.add(p);if(u)for(const p of Object.keys(u.scores))f.add(p);const h=[...f].sort();return o.jsxs(gr,{withLeftSeparator:!0,children:[o.jsxs(gr.Toolbar,{children:[o.jsx(gC,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(ge,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(Nn,{})})})]}),o.jsxs(gr.Content,{className:"pb-6",children:[o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{size:"smaller",children:[o.jsx(fx,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(IS,{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,v=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):"-"]}),v!=null&&o.jsx(pye,{delta:v})]})]},p)})})]}),o.jsx(Xt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx($a,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(yc,{}),codeStr:PL(c?.output)}),o.jsx(Xt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx($a,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(yc,{}),codeStr:PL(u?.output)}),o.jsx(Xt.CodeSection,{title:"Item Input",icon:o.jsx(Np,{}),codeStr:PL(e.input)}),o.jsx(Xt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(SVe,{}),codeStr:PL(e.groundTruth)})]})}):o.jsxs(ml,{variant:"warning",children:[o.jsx(Eh,{}),o.jsx(ml.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 $Cn({items:e,baselineId:t,contenderId:r,scorerIds:n,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(gr,{children:o.jsxs(Pt,{children:[o.jsxs(Pt.Header,{columns:a,children:[o.jsx(Pt.HeaderCol,{children:"Item ID"}),!s&&n.map(l=>o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Pt.Scroller,{children:o.jsx(Pt.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[r],d=!!(c&&u);return o.jsx(Pt.Row,{children:o.jsxs(Pt.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Pt.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:n.map(f=>{const h=c?.scores[f]??null,p=u?.scores[f]??null,m=h!=null&&p!=null?p-h:null;return o.jsx(Pt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[h?.toFixed(2)," → ",p?.toFixed(2)]}),o.jsx(pye,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const FCn={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 kBe({datasetId:e,experiment:t,type:r}){const{Link:n}=ir(),{label:s,color:a,customStyle:i}=FCn[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($a,{size:"small",color:a,children:[s,o.jsx(yh,{})]}),o.jsx(ge,{as:n,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),r==="baseline"&&o.jsxs($a,{size:"small",color:a,children:[o.jsx(Tp,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(fs,{children:[o.jsx(SVe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(fs,{children:[o.jsx(fVe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(fs,{children:[o.jsx(YUe,{})," ",ur(l,"MMM d, yyyy HH:mm")]})]})]})}function zCn({datasetId:e,experimentIdA:t,experimentIdB:r,onSwap:n}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=tEn(e,t,r),{data:u}=F6(e,t),{data:d}=F6(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,z=0;for(const B of i.items){const H=B.results[T]?.scores[N],W=B.results[j]?.scores[N];H!=null&&(I+=H,R++),W!=null&&(P+=W,z++)}const D=R>0?I/R:null,U=z>0?P/z:null,F=D!=null&&U!=null?U-D:null;return{scorerId:N,avgA:D,avgB:U,delta:F}})},[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]),v=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(Mt,{})});if(c)return o.jsxs(ml,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(ml.Column,{children:[o.jsx(ml.Title,{children:"Error loading comparison"}),o.jsx(ml.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:Z("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(kBe,{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(ge,{onClick:n,children:"VS"})}),o.jsx(Wr,{children:"Switch the order"})]})})}),o.jsx(kBe,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsxs(ml,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(ml.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(qIe,{children:[o.jsx($a,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx($a,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Pt.HeaderCol,{className:"flex justify-center",children:o.jsxs(qIe,{children:[o.jsx($a,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx($a,{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(pye,{delta:I}):"-"})]},T))})})]}),o.jsxs(of,{className:Z({"grid-cols-[1fr_2fr]":!!v}),children:[o.jsx($Cn,{items:i.items,baselineId:_,contenderId:E,scorerIds:h,featuredItemId:s,columns:g,onItemClick:x}),!!v&&o.jsx(LCn,{item:v,baselineId:_,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:k(),onNext:S(),onClose:w})]})]})}function BCn({datasetId:e,itemId:t,onVersionSelect:r,onCompareVersionsClick:n,activeVersion:s}){const{data:a,isLoading:i}=hye(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)},v=()=>{u.size===2&&n?.([...u])};return o.jsxs(gr,{className:"min-w-56",children:[l?o.jsx(gr.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ge,{onClick:m,children:"Cancel"}),o.jsx(Cn,{variant:"primary",disabled:u.size!==2,onClick:v,tooltipContent:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):o.jsx(o.Fragment,{children:(a||[]).length>1&&o.jsx(gr.Toolbar,{children:o.jsxs(ge,{onClick:g,className:"w-full",children:[o.jsx(Wm,{})," Compare Ver."]})})}),i?o.jsx(UCn,{}):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(di,{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 UCn(){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 VCn(e,t){if(t){const r=typeof t=="string"?new Date(t):t;return`v${e} ${ur(r,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function qCn({datasetId:e,versionA:t,versionB:r,onVersionChange:n}){const{data:s}=dye(e),a=(s??[]).map(i=>({value:String(i.version),label:`${VCn(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(gr.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx(Lo,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>n?.(i,r??"")}),o.jsx(Lo,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:r??"",onValueChange:i=>n?.(t??"",i)}),o.jsx("div",{})]})}const HCn=[{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"}],QCn={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(cs,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(wVe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(RMt,{}),tooltip:"Same in both versions"}};function Hte({red:e=!1,tooltip:t}){return o.jsxs(Yr,{children:[o.jsx(Xr,{asChild:!0,children:o.jsx(dPt,{className:Z("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Wr,{children:t})]})}function K0({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}=QCn[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($a,{color:r,size:"small",children:n})]})}),o.jsx(Wr,{children:s})]})}function WCn(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function GCn({datasetId:e,versionA:t,versionB:r,allItems:n,itemsAMap:s,itemsBMap:a}){const{Link:i}=ir(),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=WCn(u,d);return o.jsxs(Pt.Row,{columns:HCn,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(K0,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(K0,{variant:"changed",version:u.datasetVersion}):o.jsx(K0,{version:u.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(Hte,{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(K0,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(K0,{variant:"changed",version:d.datasetVersion}):o.jsx(K0,{version:d.datasetVersion})}):o.jsx(Pt.Cell,{className:"justify-center flex items-center",children:o.jsx(Hte,{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(K0,{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(Hte,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const _Be={needsReview:"#facc15",complete:"#22c55e"},ZCn=[{label:"Needs Review",color:_Be.needsReview},{label:"Reviewed",color:_Be.complete}];function YCn({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 v=u.get(m.experimentId),x=v?.datasetId?d.get(v.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(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Ht.Summary,{value:String(l),label:"Items in pipeline"})]}),n?o.jsx(Ht.Loading,{}):s?o.jsx(Ht.Error,{message:"Failed to load review data"}):o.jsx(Ht.Content,{children:c?o.jsx(K_,{data:a,segments:ZCn,maxVal:i,fmt:u=>String(u)}):o.jsx(Ht.NoData,{message:"No items have been sent to review yet"})})]})}function mye(){const e=Ge();return kt({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function v1t(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 XCn(e,t){const r=new Map,n=v1t(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 KCn(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 JCn=10;function ejn(){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:JCn}),{data:g,isLoading:v,error:x}=W8(),{data:w}=mye(),S=b.useMemo(()=>h?.datasets??[],[h?.datasets]),k=h?.pagination?.hasMore??!1,_=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>bEn(S),[S]),T=b.useMemo(()=>XCn(w,_),[w,_]),j=p||v,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(W=>W+1),[]),R=b.useCallback(()=>f(W=>Math.max(0,W-1)),[]),z=b.useCallback(W=>{n(W),f(0)},[]),D=b.useCallback(W=>{a(W),f(0)},[]),U=b.useCallback(W=>{l(W),f(0)},[]),F=b.useCallback(W=>{u(W),f(0)},[]);if(N&&Ts(N))return o.jsx(qr,{title:"Datasets",icon:o.jsx(ja,{}),children:o.jsx(Ys,{})});if(N&&ys(N))return o.jsx(qr,{title:"Datasets",icon:o.jsx(ja,{}),children:o.jsx(Us,{resource:"datasets"})});if(N)return o.jsx(qr,{title:"Datasets",icon:o.jsx(ja,{}),children:o.jsx(Ic,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(qr,{title:"Datasets",icon:o.jsx(ja,{}),children:o.jsx(xEn,{onCreateClick:I})}),o.jsx(ble,{open:e,onOpenChange:t})]});const B=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(vn,{children:o.jsxs(vn.Title,{isLoading:j,children:[o.jsx(ja,{})," Datasets"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Cn,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(cs,{})}),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(SEn,{search:r,onSearchChange:z,targetFilter:s,onTargetFilterChange:D,experimentFilter:i,onExperimentFilterChange:U,tagFilter:c,onTagFilterChange:F,tagOptions:E,onReset:H,hasActiveFilters:B})]}),o.jsx(gEn,{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(ble,{open:e,onOpenChange:t})]})}const tjn=new Set(["items","experiments","review"]);function rjn(){const{datasetId:e}=na(),t=mu(),[r,n]=ao(),s=r.get("tab"),a=s&&tjn.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,v]=b.useState(null),{data:x,error:w}=Rg(e??"");if(!e)return o.jsx(Fr,{children:o.jsx(gf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Ts(w))return o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})});if(w&&ys(w))return o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},k=()=>{t("/datasets")},_=E=>{v(E?.version??null)};return o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:"span",to:"",isCurrent:!0,children:o.jsx(jEn,{value:e,variant:"ghost"})})]})}),o.jsxs(gf,{className:"content-stretch",children:[o.jsx(fCn,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>h(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:_,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(ge,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(hx,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(yCn,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(pCn,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(EEn,{open:f,onOpenChange:h,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(CEn,{open:p,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:k})]})]})}function njn(){const{datasetId:e,experimentId:t}=na(),{data:r}=Rg(e??""),{data:n,isLoading:s,error:a}=F6(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=D8({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:s?o.jsx(Fr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Mt,{})})}):a&&Ts(a)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):a&&ys(a)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):a||!n?o.jsx(Fr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:r?.name}),o.jsx(Cr,{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(m1t,{experimentId:t,experimentStatus:n?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function sjn(){const{datasetId:e}=na(),[t,r]=ao(),{data:n,error:s}=Rg(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Ts(s)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):s&&ys(s)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsxs(Cr,{isCurrent:!0,as:"span",children:[o.jsx(je,{children:o.jsx(Wm,{})}),"Compare Experiments"]})]})}),o.jsx(gf,{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(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:n?.name??e?.slice(0,8)}),o.jsxs(Cr,{isCurrent:!0,as:"span",children:[o.jsx(je,{children:o.jsx(Wm,{})}),"Experiments Comparison"]})]})}),o.jsx(gf,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(Wm,{})," Dataset Experiments Comparison"]}),o.jsxs(Ar.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(Ar.Column,{children:o.jsxs(ge,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Tp,{}),"Back to Dataset"]})})]}),o.jsx(zCn,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{r({baseline:i,contender:a})}})]})})]})}function ajn(){const{datasetId:e,itemId:t}=na(),{Link:r}=ir(),n=mu(),{data:s,isLoading:a,error:i}=hye(e??"",t??""),{updateItem:l,deleteItem:c}=ri(),{data:u}=Rg(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,[v,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=q=>{p(f?q:q.isLatest?null:q)},z=()=>{p(null)},D=!f&&h!=null,U=()=>{D||x(!0)},F=()=>{D||P(!0)},B=async()=>{if(!e||!t)return;let q;try{q=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 Q;if(E.trim())try{Q=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:q,groundTruth:M,metadata:Q}),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)},W=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),n(`/datasets/${e}`)}catch(q){ze.error(`Failed to delete item: ${q instanceof Error?q.message:"Unknown error"}`)}},L=h??d,Y=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&&Ts(i)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):i&&ys(i)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(Fr,{children:o.jsx(gf,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:u?.name}),o.jsx(Cr,{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(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(fx,{}),t," ",o.jsx(Xa,{content:t})]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{children:["Item of ",o.jsx(ja,{})," ",u?.name]})}),o.jsxs(Ar.Description,{children:[o.jsxs(fs,{children:[o.jsx(m_,{})," Created at"," ",d?.createdAt?ur(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(fs,{children:[o.jsx(Ux,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(Ar.Column,{children:!v&&!f&&o.jsxs(ps,{children:[o.jsxs(ge,{onClick:U,disabled:D,title:D?"Return to latest version to edit":void 0,children:[o.jsx(wVe,{})," Edit"]}),o.jsxs(ge,{onClick:F,disabled:D,title:D?"Return to latest version to delete":void 0,children:[o.jsx(id,{})," Delete"]})]})})]}),o.jsxs(of,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(gr,{withRightSeparator:!v,children:[f&&d&&o.jsxs(ml,{variant:"destructive",children:[o.jsx(Eh,{}),o.jsxs(ml.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&D&&h&&o.jsx(o.Fragment,{children:o.jsxs(ml,{variant:"warning",children:[o.jsx(Eh,{}),o.jsxs(ml.Message,{children:["Viewing version v",h.datasetVersion]}),o.jsxs(ml.Button,{onClick:z,children:[o.jsx(sh,{})," Return to the latest version"]})]})}),v?o.jsx(l1t,{inputValue:w,setInputValue:S,groundTruthValue:k,setGroundTruthValue:_,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:B,onCancel:H,isSaving:l.isPending}):Y?o.jsx(G8,{item:Y,Link:r}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&o.jsx(gr,{children:o.jsx(BCn,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:q=>{n(`/datasets/${e}/items/${t}/versions?ids=${q.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:W,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function EBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function ijn(){const{datasetId:e}=na(),[t,r]=ao(),n=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Rg(e??""),{Link:i}=ir(),[l,c]=b.useState(!1),{data:u}=gle(e??"",n[0]??""),{data:d}=gle(e??"",n[1]??"");return a&&Ts(a)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):a&&ys(a)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):!e||n.length<2?o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(gf,{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(Fr,{children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(je,{children:o.jsx(Tp,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Z("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(Wm,{}),"Compare Dataset Items"]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{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(Ar.Column,{children:o.jsxs(ps,{children:[o.jsxs(ge,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Tp,{}),"Back to Dataset"]}),o.jsx(ge,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(cVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(_Mt,{})," Diff View"]})})]})})]}),o.jsx(of,{className:"grid-cols-[1fr_3vw_1fr]",children:n.map((f,h)=>o.jsxs(b.Fragment,{children:[o.jsx(ojn,{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:Z("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(Sdt,{codeA:EBe(u),codeB:EBe(d)})]})})]})}function ojn({datasetId:e,itemId:t,Link:r,idx:n,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=gle(e,t),{data:u}=kE(e),d=new Set(s.filter((h,p)=>p!==n)),f=(u??[]).map(h=>({value:h.id,label:h.id,disabled:d.has(h.id)}));return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"flex gap-4",children:[o.jsx(Rme,{label:"Item",name:`compare-item-${n}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(ge,{as:r,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Ux,{}),"Versions"]})]}),i&&o.jsx(gr.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(c1t,{item:l}),o.jsx(G8,{item:l,Link:r})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function CBe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function ljn(){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}=Rg(e??""),{Link:u}=ir(),{data:d}=hye(e??"",t??""),{data:f}=wle(e??"",t??"",i[0]??0,l?.version),{data:h}=wle(e??"",t??"",i[1]??0,l?.version);return c&&Ts(c)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):c&&ys(c)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(gf,{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(Fr,{children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:l?.name}),o.jsx(Cr,{as:dr,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(je,{children:o.jsx(Tp,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Z("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(Wm,{}),"Compare Dataset Item Versions"]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{children:["Comparing ",i.length," versions of"," ",o.jsx(dr,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(Ar.Column,{children:o.jsxs(ps,{children:[o.jsxs(ge,{as:dr,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Tp,{}),"Back to Item"]}),o.jsx(ge,{variant:"primary",onClick:()=>a(p=>!p),children:s?o.jsxs(o.Fragment,{children:[o.jsx(cVe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(l2t,{})," Diff View"]})})]})})]}),o.jsx(of,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((p,m)=>o.jsxs(b.Fragment,{children:[o.jsx(cjn,{datasetId:e,itemId:t,datasetVersion:p,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const v=[...i];v[m]=g,n({ids:v.join(",")})}}),m===0&&o.jsx("div",{className:Z("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},p))}),s&&f&&h&&o.jsx(Sdt,{codeA:CBe(f),codeB:CBe(h)})]})})]})}function cjn({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}=wle(e,t,r,n),h=new Set(a.filter((g,v)=>v!==l)),p=s.map(g=>{const v=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]})," - ",ur(v,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx($a,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:h.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return o.jsxs(gr,{children:[o.jsxs(gr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Ux,{className:"w-6 h-6 opacity-50"}),o.jsx(Rme,{label:"Version",name:`compare-version-${l}`,value:String(r),onValueChange:g=>u(Number(g)),options:p,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(gr.Content,{children:f?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?o.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",r," not found"]}):o.jsx(G8,{item:m,Link:i})})]})}function ujn(){const{datasetId:e}=na(),[t]=ao(),r=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],n=mu(),{data:s,error:a}=Rg(e??""),i=kE(e??"",void 0,r[0]??null),l=kE(e??"",void 0,r[1]??null),c=b.useMemo(()=>i.data??[],[i.data]),u=b.useMemo(()=>l.data??[],[l.data]),d=b.useMemo(()=>{const g=new Map;for(const v of[...c,...u])g.has(v.id)||g.set(v.id,{id:v.id,createdAt:new Date(v.createdAt)});return[...g.values()].sort((v,x)=>x.createdAt.getTime()-v.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&&Ts(a))return o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})});if(a&&ys(a))return o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})});if(!e||r.length<2)return o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(gf,{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,v,x)=>{n(`/datasets/${e}/items/${g}/versions?ids=${v?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,v)=>{n(`/datasets/${e}/versions?ids=${g},${v}`,{replace:!0})};return o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/datasets",children:[o.jsx(je,{children:o.jsx(ja,{})}),"Datasets"]}),o.jsx(Cr,{as:dr,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(Cr,{isCurrent:!0,as:"span",children:[o.jsx(je,{children:o.jsx(nSe,{})}),"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(Ar,{children:[o.jsxs(Ar.Column,{children:[o.jsxs(Ar.Title,{children:[o.jsx(nSe,{})," Compare Dataset Versions"]}),o.jsx(Ar.Description,{children:o.jsxs(fs,{children:[o.jsx(Ux,{})," Comparing ",r.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(Ar.Column,{children:o.jsxs(ge,{as:dr,to:`/datasets/${e}`,children:[o.jsx(Tp,{}),"Back to Dataset"]})})]}),o.jsx(of,{children:o.jsxs(gr,{children:[o.jsx(qCn,{datasetId:e,versionA:String(r[0]),versionB:String(r[1]),onVersionChange:m}),o.jsx(GCn,{datasetId:e,versionA:r[0],versionB:r[1],allItems:d,itemsAMap:f,itemsBMap:h,onItemClick:p})]})})]})})]})}function djn(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 fjn({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=djn(r);return o.jsxs(o.Fragment,{children:[o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Scorers"}),i?o.jsx(fr.Loading,{}):f!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(f)}),o.jsx(fr.NoChange,{message:"Static count"})]}):o.jsx(fr.NoData,{})]}),o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Datasets"}),l?o.jsx(fr.Loading,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(h)}),o.jsx(fr.NoChange,{message:"Static count"})]}):o.jsx(fr.NoData,{})]}),o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Avg Score"}),u?o.jsx(fr.Loading,{}):n!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(n)}),m?o.jsx(fr.Change,{changePct:m.changePct,prevValue:m.prevValue}):o.jsx(fr.NoChange,{})]}):o.jsx(fr.NoData,{})]}),o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Experiments"}),c?o.jsx(fr.Loading,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(p)}),g?o.jsx(fr.Change,{changePct:g.changePct,prevValue:g.prevValue}):o.jsx(fr.NoChange,{})]}):o.jsx(fr.NoData,{})]}),o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Needs Review"}),d?o.jsx(fr.Loading,{}):a!=null?o.jsxs(o.Fragment,{children:[o.jsx(fr.Value,{children:String(a)}),a>0?o.jsx(fr.NoChange,{message:"items pending review"}):o.jsx(fr.NoChange,{message:"All caught up"})]}):o.jsx(fr.NoData,{})]})]})}const hjn=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],jBe="auto 1fr auto auto auto auto auto auto auto";function pjn(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const mjn={completed:"success",running:"warning",failed:"error",pending:"neutral"};function gjn({experiments:e,datasets:t,reviewByExperiment:r,isLoading:n,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=ir(),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),v=a==="all"||p.status===a,x=i==="all"||p.datasetId===i;return g&&v&&x})},[d,s,u,a,i]);return n?o.jsx(Sh,{columns:jBe}):o.jsxs(Oe,{columns:jBe,children:[o.jsxs(Oe.Top,{children:[o.jsx(Oe.TopCell,{children:"Experiment"}),o.jsx(Oe.TopCell,{children:"Dataset"}),o.jsx(Oe.TopCell,{children:"Target"}),o.jsx(Oe.TopCell,{children:"Status"}),o.jsx(Oe.TopCell,{className:"text-center",children:"Items"}),o.jsx(Oe.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(Oe.TopCell,{className:"text-center",children:"Failed"}),o.jsx(Oe.TopCell,{className:"text-center",children:"Review"}),o.jsx(Oe.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,v=h.failedCount??0,x=h.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(Oe.RowLink,{to:l.experimentLink(h.id),LinkComponent:c,children:[o.jsx(Oe.NameCell,{className:"font-mono",children:h.id.slice(0,8)}),o.jsx(Oe.TextCell,{children:p}),o.jsx(Oe.Cell,{children:o.jsxs("span",{className:"truncate",children:[h.targetType," ",h.targetId]})}),o.jsx(Oe.Cell,{children:o.jsx(PP,{variant:mjn[m]??"neutral",withDot:!0,children:m})}),o.jsx(Oe.TextCell,{className:"text-center",children:x}),o.jsx(Oe.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(Oe.TextCell,{className:"text-center",children:o.jsx("span",{className:v>0?"text-accent2":"",children:v})}),o.jsx(Oe.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(gt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(gt,{variant:"success",children:[S.complete,"/",k," reviewed"]})})()}),o.jsx(Oe.TextCell,{children:pjn(h.createdAt)})]},h.id)})]})}function vjn(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const ML={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},yjn=[{label:"Completed",color:ML.completed},{label:"Running",color:ML.running},{label:"Pending",color:ML.pending},{label:"Failed",color:ML.failed}];function bjn({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(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Ht.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),r?o.jsx(Ht.Loading,{}):n?o.jsx(Ht.Error,{message:"Failed to load experiments data"}):o.jsx(Ht.Content,{children:i?o.jsx(K_,{data:s,segments:yjn,maxVal:a,fmt:l=>String(l)}):o.jsx(Ht.NoData,{message:"No experiments have been run yet"})})]})}const xjn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(va,{})]})})})});function wjn({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(Eg,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx(Lo,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...hjn],value:r,onValueChange:n,className:"whitespace-nowrap"}),o.jsx(Lo,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(ge,{onClick:l,size:"sm",variant:"light",children:[o.jsx(Nn,{className:"size-3"})," Reset"]})]})]})}function Sjn(){const{data:e,isLoading:t,error:r}=md(),{data:n,isLoading:s,error:a}=Uh(),{data:i,isLoading:l,error:c}=W8(),{data:u,isLoading:d,isError:f,error:h}=nwn(),{data:p,isLoading:m,isError:g,error:v}=mye(),x=n?.datasets,w=i?.experiments,S=b.useMemo(()=>KCn(p),[p]),k=r||a||c||h||v;return k&&Ts(k)?o.jsx(qr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(Ys,{})}):k&&ys(k)?o.jsx(qr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(Us,{resource:"evaluation"})}):k?o.jsx(qr,{title:"Evaluation",icon:o.jsx(Ru,{}),children:o.jsx(Ic,{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(vn,{children:o.jsxs(vn.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(Zae,{children:o.jsx(fjn,{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(Q0n,{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(wEn,{experiments:w,isLoading:l,isError:!!c}),o.jsx(bjn,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(YCn,{reviewSummary:p,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function Ojn(){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}=W8(),{data:h}=mye(),p=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>vjn(p),[p]),v=b.useMemo(()=>v1t(h),[h]),x=l||d,w=f||c;if(w&&Ts(w))return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Ys,{})});if(f&&ys(f))return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Us,{resource:"experiments"})});if(c&&ys(c))return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Us,{resource:"datasets"})});if(w)return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(Ic,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(qr,{title:"Experiments",icon:o.jsx(Ru,{}),children:o.jsx(xjn,{})});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(vn,{children:o.jsxs(vn.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(wjn,{search:e,onSearchChange:t,statusFilter:r,onStatusFilterChange:n,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:k,hasActiveFilters:S})]}),o.jsx(gjn,{experiments:m,datasets:p,reviewByExperiment:v,isLoading:x,search:e,statusFilter:r,datasetFilter:s})]})}function kjn(){const{experimentId:e}=na(),{data:t,isLoading:r}=W8(),s=t?.experiments?.find(p=>p.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=F6(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:h}=D8({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?r||i||!s?o.jsx(Fr,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Mt,{})})}):l&&Ts(l)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})})}):l&&ys(l)?o.jsx(Fr,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"datasets"})})}):l||!a?o.jsx(Fr,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/experiments",children:[o.jsx(je,{children:o.jsx(Ru,{})}),"Experiments"]}),o.jsx(Cr,{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(m1t,{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}=vC(),{mutate:i,isPending:l,error:c}=N_n(),{mutate:u,isPending:d,error:f}=A_n(),{mutate:h,isPending:p}=a1t(),[m,g]=b.useState(r),[v,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,z=P?c:f,D=()=>{t?t():e?window.location.href=e:window.location.href="/"},U=H=>{H.preventDefault(),P?i({email:w,password:k},{onSuccess:D}):u({email:w,password:k,name:v||void 0},{onSuccess:D})},F=()=>{h({redirectUri:e},{onSuccess:H=>{window.location.href=H.url}})},B=()=>{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(Kb,{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"})]}),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:U,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(sr,{id:"name",type:"text",value:v,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(sr,{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(sr,{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"})]}),z&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:z.message}),o.jsx(ge,{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:B,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(ge,{onClick:F,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 _jn(){const[e]=ao(),t=mu(),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})}const Nd=Ga.KeyValueList;function Ejn(e){return e instanceof Date?e:new Date(e)}function Cjn({log:e,onClose:t,onTraceClick:r,onSpanClick:n,onPrevious:s,onNext:a,collapsed:i,onCollapsedChange:l}){const[c,u]=b.useState(!1),d=i??c,f=l??u,h=Ejn(e.timestamp);return o.jsxs(Ga,{collapsed:d,children:[o.jsxs(Ga.Header,{children:[o.jsxs(Ga.Heading,{children:["Log ",o.jsx("b",{children:ur(h,"MMM dd, HH:mm:ss.SSS")})]}),o.jsxs(ps,{className:"ml-auto shrink-0",children:[l&&o.jsx(Cn,{size:"md",tooltipContent:d?"Expand panel":"Collapse panel",onClick:()=>f(!d),children:d?o.jsx(JUe,{}):o.jsx(KUe,{})}),o.jsxs(ps,{spacing:"close",children:[o.jsx(Cn,{size:"md",tooltipContent:"Previous log",onClick:s,disabled:!s,children:o.jsx(eF,{})}),o.jsx(Cn,{size:"md",tooltipContent:"Next log",onClick:a,disabled:!a,children:o.jsx(Qle,{})})]}),o.jsx(Ga.CloseButton,{onClick:t})]})]}),!d&&o.jsxs(Ga.Content,{children:[o.jsx("p",{className:"text-ui-md text-neutral4 font-mono wrap-break-word whitespace-pre-wrap",children:e.message}),(e.traceId||e.spanId)&&o.jsxs("div",{className:Z("grid gap-2 my-8","[&>button]:justify-between [&>button]:overflow-hidden"),children:[e.traceId&&o.jsxs(ps,{spacing:"close",className:"min-w-0 w-full",children:[o.jsxs(ge,{size:"md",className:"min-w-0 flex-1 overflow-hidden",onClick:()=>r?.(e.traceId),children:[o.jsx(yh,{}),o.jsx("span",{children:"Trace"}),o.jsxs("span",{className:" ml-auto text-ui-sm text-neutral2 min-w-0 truncate",children:["# ",e.traceId]})]}),o.jsx(Xa,{content:e.traceId,size:"md",tooltip:"Copy Trace ID to clipboard"})]}),e.spanId&&o.jsxs(ps,{spacing:"close",className:"min-w-0 w-full",children:[o.jsxs(ge,{size:"md",className:"min-w-0 flex-1 overflow-hidden",disabled:!e.traceId||!n,onClick:()=>e.traceId&&n?.(e.traceId,e.spanId),children:[o.jsx(yh,{}),o.jsx("span",{children:"Span"}),o.jsxs("span",{className:" ml-auto text-ui-sm text-neutral2 min-w-0 truncate",children:["# ",e.spanId]})]}),o.jsx(Xa,{content:e.spanId,size:"md",tooltip:"Copy Span ID to clipboard"})]})]}),o.jsxs(Nd,{className:"mb-6",children:[e.entityType&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Entity Type"}),o.jsx(Nd.Value,{children:e.entityType})]}),e.entityName&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Entity Name"}),o.jsx(Nd.Value,{children:e.entityName})]}),e.serviceName&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Service"}),o.jsx(Nd.Value,{children:e.serviceName})]}),e.environment&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Environment"}),o.jsx(Nd.Value,{children:e.environment})]}),e.source&&o.jsxs(o.Fragment,{children:[o.jsx(Nd.Key,{children:"Source"}),o.jsx(Nd.Value,{children:e.source})]}),e.metadata&&Object.keys(e.metadata).length>0&&o.jsx(o.Fragment,{children:Object.entries(e.metadata).map(([p,m])=>o.jsxs(b.Fragment,{children:[o.jsx(Nd.Key,{children:p}),o.jsx(Nd.Value,{children:String(m)})]},p))})]}),e.data&&Object.keys(e.data).length>0&&o.jsx(Ga.CodeSection,{title:"Data",codeStr:JSON.stringify(e.data,null,2),className:"mt-6"})]})]})}const jjn=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 gye(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(r=>{t.push(r.id),t.push(...gye(r))}),t}function Z8(e){const t=[];for(const r of e)t.push(r.id),t.push(...gye(r));return t}const TBe=["agent","workflow","model","mcp","tool","memory","workspace","other"],Tjn={agent:{icon:o.jsx(pa,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:o.jsx(Mi,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:o.jsx(gp,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(vl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(Pi,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},memory:{icon:o.jsx(x9,{}),color:"oklch(0.75 0.15 60)",label:"Memory",bgColor:"oklch(0.75 0.15 60 / 0.1)",typePrefix:"memory"},workspace:{icon:o.jsx(w9,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}},Njn={color:"oklch(0.65 0 0)",label:"Other",typePrefix:"other"};function b1t(e){const t=e?.toLowerCase().split("_")[0];return Tjn[t]??Njn}function Ajn({isSelected:e,isFaded:t,isExpanded:r,toggleChildren:n,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Z("flex items-center justify-end h-full px-1.5",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(NBe,{onClick:()=>n?.(),children:[i?a:l," ",r?i?o.jsx(Gle,{}):o.jsx(uy,{}):o.jsx(Gn,{})]}),a>l&&!i&&o.jsxs(NBe,{onClick:()=>s?.(),children:[a," ",o.jsx(Wle,{})]})]}):null})}function NBe({onClick:e,children:t,className:r}){return o.jsx("button",{onClick:e,className:Z("h-full",r),children:o.jsx("div",{className:Z("flex items-center gap-[0.1rem] text-ui-xs text-neutral5 border border-border1 pl-1.5 pr-0.5 rounded-md transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-[0.85rem] [&>svg]:h-[0.85rem] [&>svg]:transition-all"),children:t})})}function Ijn({isLastChild:e}){return o.jsx("div",{className:Z("w-[0.5rem] h-[1.8rem] relative opacity-100 shrink-0",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-[0px] after:border-l-[1px] after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-[0px] before:border-b-[1px] before:border-neutral3 before:border-dashed',{"after:bottom-[50%]":e})})}function Rjn({span:e,spanUI:t,isFaded:r,depth:n=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:l,isRootSpan:c,isExpanded:u}){return o.jsxs("div",{"data-span-id":e.id,"aria-label":`View details for span ${e.name}`,className:Z("rounded-md flex opacity-80 min-h-8 items-center rounded-l-lg",{"opacity-30 [&:hover]:opacity-60":r,"bg-surface4":a===e.id}),style:{paddingLeft:`${n*1}rem`},children:[!c&&o.jsx(Ijn,{isLastChild:i}),o.jsx("button",{onClick:()=>s?.(e.id),className:Z("text-ui-sm flex items-center text-left gap-1.5 text-neutral6 w-full min-w-0 rounded-md h-full px-2 py-1 transition-colors","[&>svg]:transition-all [&>svg]:shrink-0 [&>svg]:opacity-0 [&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:ml-auto","hover:bg-surface4 [&:hover>svg]:opacity-60","focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent1"),children:o.jsx("span",{className:"min-w-0 truncate",children:e.name})})]})}function Pjn({span:e,selectedSpanId:t,isFaded:r,overallLatency:n,overallStartTime:s,color:a,chartWidth:i="default"}){const l=n?Math.ceil(e.latency/n*100):0,c=s?new Date(s):null,u=e.startTime?new Date(e.startTime):null,d=u&&c?u.getTime()-c.getTime():0,f=n&&Math.floor(d/n*100);return o.jsxs(yfe,{openDelay:250,children:[o.jsxs(bfe,{className:Z("h-8 p-1 grid grid-cols-[1fr_auto] gap-2 items-center cursor-help pr-2 rounded-r-md",i==="wide"?"min-w-72":"min-w-32","[&:hover>div]:bg-surface5",{"opacity-30 [&:hover]:opacity-60":r,"bg-surface4":t===e.id}),children:[o.jsx("div",{className:Z("w-full p-1.5 rounded-md bg-surface4 transition-colors duration-1000"),children:o.jsx("div",{className:"relative w-full h-1.5 rounded-sm overflow-hidden",children:o.jsx("div",{className:Z("bg-neutral1 absolute rounded-sm h-1.5 top-0"),style:{width:l?`${l}%`:"2px",left:`${f||0}%`,backgroundColor:a}})})}),o.jsxs("div",{className:Z("flex justify-end text-neutral3 text-ui-xs"),children:[(e.latency/1e3).toFixed(3)," s"]})]}),o.jsx(xfe,{children:o.jsxs(wfe,{className:"z-50 w-auto max-w-100 rounded-md bg-surface4 p-2 px-4 pr-6 text-ui-sm text-neutral5 border border-border1",sideOffset:5,side:"top",children:[o.jsx("div",{className:Z("text-ui-sm flex items-center gap-2 mb-2 mt-1"),children:"Span Timing"}),o.jsxs(On,{children:[o.jsx(On.Key,{children:"Latency"}),o.jsxs(On.Value,{children:[e.latency," ms"]}),o.jsx(On.Key,{children:"Started at"}),o.jsx(On.Value,{children:e.startTime?ur(new Date(e.startTime),"hh:mm:ss:SSS a"):"-"}),o.jsx(On.Key,{children:"Ended at"}),o.jsx(On.Value,{children:e.endTime?ur(new Date(e.endTime),"hh:mm:ss:SSS a"):"-"}),o.jsx(On.Key,{children:"Start Shift"}),o.jsxs(On.Value,{children:[d,"ms"]})]}),o.jsx(Sfe,{className:"fill-surface5"})]})})]})}function vye({span:e,depth:t=0,onSpanClick:r,selectedSpanId:n,isLastChild:s,overallLatency:a,overallStartTime:i,fadedTypes:l,searchPhrase:c,featuredSpanIds:u,expandedSpanIds:d,setExpandedSpanIds:f,chartWidth:h}){const p=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=gye(e),v=g.length,x=t===0,w=b1t(e?.type),S=d?d.includes(e.id):!1,k=u&&u.length>0?!u.includes(e.id):!1,E=(l&&l.length>0?l.includes(w?.typePrefix||""):!1)||k;b.useEffect(()=>{if(!u||g.length===0||S)return;g.some(P=>u.includes(P))&&f&&f(P=>!P||P.includes(e.id)?P??[e.id]:[...P,e.id])},[u,g]);const T=()=>{f&&f(I=>{if(!I)return I;const P=new Set([e.id,...g]);return S?I.filter(R=>!P.has(R)):[...I,e.id]})},j=()=>{f&&f(I=>I&&Array.from(new Set([...I,e.id,...g])))},N=g.every(I=>d?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(Rjn,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:r,selectedSpanId:n,isLastChild:s,hasChildren:p,isRootSpan:x,isExpanded:S}),o.jsx(Ajn,{isSelected:n===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:N,numOfChildren:m}),o.jsx(Pjn,{span:e,selectedSpanId:n,isFaded:E,overallLatency:a,overallStartTime:i,color:w?.color,chartWidth:h}),p&&S&&e.spans?.map((I,P,R)=>{const z=P===R.length-1;return o.jsx(vye,{span:I,depth:t+1,onSpanClick:r,selectedSpanId:n,isLastChild:z,overallLatency:a,overallStartTime:i,fadedTypes:l,searchPhrase:c,expandedSpanIds:d,setExpandedSpanIds:f,featuredSpanIds:u,chartWidth:h},I.id)})]})}function Mjn({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||"";return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Z("flex items-center text-ui-sm gap-3 bg-surface3/50 rounded-md p-3 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Mt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_auto] items-start content-start gap-y-px overflow-hidden py-1",children:e?.map(d=>o.jsx(vye,{span:d,onSpanClick:t,selectedSpanId:r,overallLatency:c,overallStartTime:u,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},d.id))})})}const Djn=1e3*60*60*24*30;function Y8(e){const t=Ge();return kt({queryKey:["trace-light-spans",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return await t.getTraceLight(e)},enabled:!!e,staleTime:r=>r.state.data?.spans.every(a=>!!a.endedAt)?Djn:0})}function Ljn({traceId:e,onClose:t,onSpanSelect:r,initialSpanId:n}){const{data:s,isLoading:a}=Y8(e),i=s?.spans,[l,c]=b.useState(n??void 0);b.useEffect(()=>{if(n&&i&&i.find(m=>m.spanId===n)){c(n),r?.(n);return}c(void 0),r?.(void 0)},[n,i]);const u=b.useMemo(()=>jjn(i??[]),[i]),[d,f]=b.useState([]);b.useEffect(()=>{u.length>0&&f(Z8(u))},[u]);const h=p=>{const m=l===p?void 0:p;c(m),r?.(m)};return o.jsxs(Ga,{children:[o.jsxs(Ga.Header,{children:[o.jsxs(Ga.Heading,{children:["Trace ",o.jsxs("b",{children:["# ",e]})]}),o.jsx(Ga.CloseButton,{onClick:t})]}),a?o.jsx(Ga.LoadingData,{children:"Loading trace..."}):u.length===0?o.jsx(Ga.NoData,{children:"No spans found for this trace."}):o.jsx(Ga.Content,{children:o.jsx(Mjn,{hierarchicalSpans:u,onSpanClick:h,selectedSpanId:l,expandedSpanIds:d,setExpandedSpanIds:f})})]})}const fv=Ga.KeyValueList;function $jn({traceId:e,spanId:t,onClose:r}){const{data:n,isLoading:s}=OE(e,t),a=n?.span,i=a?.startedAt&&a?.endedAt?new Date(a.endedAt).getTime()-new Date(a.startedAt).getTime():null;return o.jsxs(Ga,{children:[o.jsxs(Ga.Header,{children:[o.jsxs(Ga.Heading,{children:["Span ",o.jsxs("b",{children:["# ",t]})]}),o.jsx(Ga.CloseButton,{onClick:r})]}),s?o.jsx(Ga.LoadingData,{children:"Loading span..."}):a?o.jsxs(Ga.Content,{children:[o.jsxs(fv,{children:[a.spanType&&o.jsxs(o.Fragment,{children:[o.jsx(fv.Key,{children:"Type"}),o.jsx(fv.Value,{children:a.spanType})]}),a.startedAt&&o.jsxs(o.Fragment,{children:[o.jsx(fv.Key,{children:"Started"}),o.jsx(fv.Value,{children:ur(new Date(a.startedAt),"MMM dd, HH:mm:ss.SSS")})]}),a.endedAt&&o.jsxs(o.Fragment,{children:[o.jsx(fv.Key,{children:"Ended"}),o.jsx(fv.Value,{children:ur(new Date(a.endedAt),"MMM dd, HH:mm:ss.SSS")})]}),i!=null&&o.jsxs(o.Fragment,{children:[o.jsx(fv.Key,{children:"Duration"}),o.jsx(fv.Value,{children:i<1e3?`${i}ms`:`${(i/1e3).toFixed(2)}s`})]})]}),o.jsx("br",{}),o.jsx(Ga.CodeSection,{title:"Input",icon:o.jsx(Np,{}),codeStr:JSON.stringify(a.input??null,null,2)}),o.jsx(Ga.CodeSection,{title:"Output",icon:o.jsx(yc,{}),codeStr:JSON.stringify(a.output??null,null,2)}),o.jsx(Ga.CodeSection,{title:"Metadata",icon:o.jsx(yl,{}),codeStr:JSON.stringify(a.metadata??null,null,2)}),o.jsx(Ga.CodeSection,{title:"Attributes",icon:o.jsx(yl,{}),codeStr:JSON.stringify(a.attributes??null,null,2)})]}):o.jsx(Ga.NoData,{children:"Span not found."})]})}function Fjn(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return(t>>>0).toString(36)}function zjn(e){const t=new Map,r=new Map;for(const n of e){const s=n.timestamp instanceof Date?n.timestamp.toISOString():n.timestamp,a=Fjn(`${s}${n.message??""}${n.data?JSON.stringify(n.data):""}`),i=r.get(a)??0;r.set(a,i+1),t.set(n,i>0?`${a}-${i}`:a)}return t}const ABe="auto auto auto auto minmax(5rem,1fr) minmax(5rem,1fr)";function Bjn({logs:e,isLoading:t,isFetchingNextPage:r,hasNextPage:n,setEndOfListElement:s,featuredLogId:a,featuredTraceId:i,featuredSpanId:l,onFeaturedChange:c}){const[u,d]=b.useState({}),f=a??u.logId??null,h=i??u.traceId??null,p=l??u.spanId??null,m=b.useCallback(F=>{const B={logId:F.logId!==void 0?F.logId:f,traceId:F.traceId!==void 0?F.traceId:h,spanId:F.spanId!==void 0?F.spanId:p};c?c(B):d(B)},[c,f,h,p]),[g,v]=b.useState(!1),x=b.useMemo(()=>zjn(e),[e]),w=b.useMemo(()=>{const F=new Map;for(let B=0;B<e.length;B++){const H=x.get(e[B]);H&&F.set(H,{log:e[B],idx:B})}return F},[e,x]),k=(f?w.get(f):void 0)?.idx??-1,_=k>=0?e[k]:null,E=k>0?()=>{const F=e[k-1],B=x.get(F);m(h?{logId:B,traceId:F.traceId??null,spanId:null}:{logId:B})}:void 0,T=k>=0&&k<e.length-1?()=>{const F=e[k+1],B=x.get(F);m(h?{logId:B,traceId:F.traceId??null,spanId:null}:{logId:B})}:void 0,j=b.useCallback(F=>{const B=x.get(F);if(f===B){m({logId:null});return}m(h?{logId:B,traceId:F.traceId??null,spanId:null}:{logId:B})},[f,h,m,x]),N=b.useCallback(F=>{m({traceId:F,spanId:null})},[m]),I=b.useCallback((F,B)=>{m({traceId:F,spanId:B})},[m]),P=b.useCallback(()=>{m({traceId:null,spanId:null}),v(!1)},[m]),R=b.useCallback(F=>{m({spanId:F??null})},[m]),z=b.useCallback(()=>{m({spanId:null})},[m]),D=b.useCallback(()=>{m({logId:null})},[m]);if(t)return o.jsx(N9,{columns:ABe});const U=!!_;return o.jsxs("div",{className:Z("grid h-full min-h-0 gap-4 items-start",U?"grid-cols-[1fr_1fr]":"grid-cols-[1fr]"),children:[o.jsxs(Ml,{columns:ABe,className:"min-w-0",children:[o.jsxs(Ml.Top,{children:[o.jsx(Ml.TopCell,{children:"Date"}),o.jsx(Ml.TopCell,{children:"Time"}),o.jsx(Ml.TopCell,{children:"Level"}),o.jsx(Ml.TopCell,{children:"Entity"}),o.jsx(Ml.TopCell,{children:"Message"}),o.jsx(Ml.TopCell,{children:"Data"})]}),e.length===0?o.jsx(Ml.NoMatch,{message:"No logs match your search"}):e.map(F=>{const B=x.get(F),H=B===f;return o.jsxs(Ml.RowButton,{onClick:()=>j(F),className:Z(H&&"bg-surface4"),children:[o.jsx(Ml.DateCell,{timestamp:F.timestamp}),o.jsx(Ml.TimeCell,{timestamp:F.timestamp}),o.jsx(Ml.LevelCell,{level:F.level}),o.jsx(Ml.EntityCell,{entityType:F.entityType,entityName:F.entityName}),o.jsx(Ml.MessageCell,{message:F.message}),o.jsx(Ml.DataCell,{data:F.data})]},B)}),o.jsx(Ml.NextPageLoading,{isLoading:r,hasMore:n,setEndOfListElement:s})]}),_&&o.jsxs("div",{className:Z("grid gap-4 h-full overflow-auto ",g&&h&&p?"grid-rows-[auto_1fr_1fr]":g&&h?"grid-rows-[auto_1fr]":h&&p?"grid-rows-[1fr_1fr_1fr]":h?"grid-rows-[1fr_1fr]":g?"grid-rows-[auto]":"grid-rows-[1fr]"),children:[o.jsx(Cjn,{log:_,onClose:D,onTraceClick:N,onSpanClick:I,onPrevious:E,onNext:T,collapsed:g,onCollapsedChange:v}),h&&o.jsx(Ljn,{traceId:h,onClose:P,onSpanSelect:R,initialSpanId:p}),h&&p&&o.jsx($jn,{traceId:h,spanId:p,onClose:z})]})]})}const Ujn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),titleSlot:"No logs yet",descriptionSlot:"Logs will appear here once agents, workflows, or tools are executed."})});function Vjn({onClear:e,onRemoveAll:t,onSave:r,onRemoveSaved:n,isLoading:s,filterFields:a,filterTokens:i,onFilterTokensChange:l,autoFocusFilterFieldId:c}){const u=i.length>0,d=i.some(f=>qjn(f,a));return o.jsxs("div",{className:Z("grid grid-cols-[1fr_auto] gap-3 items-start"),children:[o.jsx(Gut,{fields:a,tokens:i,onTokensChange:l,disabled:s,autoFocusFieldId:c}),u&&o.jsx(qut,{disabled:s,onClear:d?e:void 0,onRemoveAll:t,onSave:r,onRemoveSaved:n})]})}function qjn(e,t){const r=t.find(n=>n.id===e.fieldId);return r?r.kind==="text"?typeof e.value=="string"&&e.value.trim()!=="":r.kind==="pick-multi"?r.multi?Array.isArray(e.value)&&e.value.length>0:typeof e.value=="string"&&e.value!==""&&e.value!=="Any":r.kind==="multi-select"?Array.isArray(e.value)&&e.value.length>0:!1:!1}const Hjn=20;function Qjn(e,t,r){if(e?.pagination?.hasMore)return r+1}function Wjn(e){return e.pages.flatMap(t=>t.logs??[])}const Gjn=({filters:e}={})=>{const t=Ge(),{inView:r,setRef:n}=w1(),s=i0({queryKey:["logs",e],queryFn:({pageParam:c})=>t.listLogsVNext({pagination:{page:c,perPage:Hjn},filters:e,orderBy:{field:"timestamp",direction:"DESC"}}),initialPageParam:0,getNextPageParam:Qjn,select:Wjn,retry:!1,refetchInterval:3e3}),{hasNextPage:a,isFetchingNextPage:i,fetchNextPage:l}=s;return b.useEffect(()=>{r&&a&&!i&&l()},[r,a,i,l]),{...s,data:s.data,setEndOfListElement:n}},DL={AGENT:wl.AGENT,WORKFLOW:wl.WORKFLOW_RUN,SCORER:wl.SCORER,INGEST:wl.RAG_INGESTION},x1t=[{label:"Agent",entityType:DL.AGENT},{label:"Workflow",entityType:DL.WORKFLOW},{label:"Scorer",entityType:DL.SCORER},{label:"Ingest",entityType:DL.INGEST}],Zjn=[{label:"Debug",value:"debug"},{label:"Info",value:"info"},{label:"Warn",value:"warn"},{label:"Error",value:"error"},{label:"Fatal",value:"fatal"}],Lx="rootEntityType",Aw="datePreset",Iw="dateFrom",Rw="dateTo",Yjn=new Set(["all","last-24h","last-3d","last-7d","last-14d","last-30d","custom"]),GS={level:"filterLevel",tags:"filterTags",entityName:"filterEntityName",traceId:"filterTraceId",spanId:"filterSpanId",runId:"filterRunId",threadId:"filterThreadId",sessionId:"filterSessionId",requestId:"filterRequestId",resourceId:"filterResourceId",userId:"filterUserId",organizationId:"filterOrganizationId",serviceName:"filterServiceName",environment:"filterEnvironment",experimentId:"filterExperimentId"},cM=Object.keys(GS),yye=new Set(["tags"]),bye="mastra:logs:saved-filters";function Xjn(e){const t=rTn(e),r=e.get(Aw);r&&t.set(Aw,r);const n=e.get(Iw);n&&t.set(Iw,n);const s=e.get(Rw);s&&t.set(Rw,s);try{localStorage.setItem(bye,t.toString())}catch{}}function Kjn(){try{localStorage.removeItem(bye)}catch{}}function IBe(){try{const e=localStorage.getItem(bye);if(!e)return null;const t=new URLSearchParams(e);return t.toString()?t:null}catch{return null}}function Jjn(e){if(e.has(Aw)||e.has(Iw)||e.has(Rw)||e.has(Lx))return!0;for(const t of cM)if(e.has(GS[t]))return!0;return!1}function eTn({availableTags:e,availableRootEntityNames:t,availableServiceNames:r,availableEnvironments:n,loading:s}){const a=[{id:"rootEntityType",label:"Primitive Type",kind:"pick-multi",searchable:!1,options:x1t.map(u=>({label:u.label,value:u.entityType})),placeholder:"Choose entity type",emptyText:"No entity types."},{id:"entityName",label:"Primitive Name",kind:"pick-multi",options:t.map(u=>({label:u,value:u})),placeholder:"Choose entity names",emptyText:"No entity names found.",isLoading:s?.entityNames},{id:"level",label:"Level",kind:"pick-multi",searchable:!1,options:Zjn.map(u=>({label:u.label,value:u.value})),placeholder:"Choose level",emptyText:"No levels."},{id:"tags",label:"Tags",kind:"pick-multi",multi:!0,options:e.map(u=>({label:u,value:u})),placeholder:"Choose tags",emptyText:"No tags found.",isLoading:s?.tags},{id:"serviceName",label:"Service Name",kind:"pick-multi",options:r.map(u=>({label:u,value:u})),placeholder:"Choose service names",emptyText:"No service names found.",isLoading:s?.serviceNames},{id:"environment",label:"Environment",kind:"pick-multi",options:n.map(u=>({label:u,value:u})),placeholder:"Choose environments",emptyText:"No environments found.",isLoading:s?.environments},{id:"traceId",label:"Trace ID",kind:"text"},{id:"spanId",label:"Span ID",kind:"text"},{id:"runId",label:"Run ID",kind:"text"},{id:"threadId",label:"Thread ID",kind:"text"},{id:"sessionId",label:"Session ID",kind:"text"},{id:"requestId",label:"Request ID",kind:"text"},{id:"resourceId",label:"Resource ID",kind:"text"},{id:"userId",label:"User ID",kind:"text"},{id:"organizationId",label:"Organization ID",kind:"text"},{id:"experimentId",label:"Experiment ID",kind:"text"}],i=(u,d)=>u.label.localeCompare(d.label),l=a.filter(u=>u.kind==="pick-multi").sort(i),c=a.filter(u=>u.kind==="text").sort(i);return[...l,...c]}function tTn(e){const t=[],r=new Map([[Lx,"rootEntityType"]]);for(const s of cM)r.set(GS[s],s);const n=new Set;for(const[s]of e.entries()){const a=r.get(s);if(!a||n.has(a))continue;if(n.add(a),yye.has(a)){const l=e.getAll(s);if(l.length===0)continue;t.push({fieldId:a,value:l.filter(Boolean)});continue}const i=e.get(s);i!==null&&t.push({fieldId:a,value:i})}return t}function rTn(e){const t=new URLSearchParams,r=e.get(Lx);r&&t.set(Lx,r);for(const n of cM){const s=GS[n];if(yye.has(n)){for(const i of e.getAll(s))t.append(s,i);continue}const a=e.get(s);a&&t.set(s,a)}return t}function RBe(e,t){e.delete(Lx);for(const r of cM)e.delete(GS[r]);for(const r of t){if(r.fieldId==="rootEntityType"&&typeof r.value=="string"){e.set(Lx,r.value);continue}const n=GS[r.fieldId];if(n){if(yye.has(r.fieldId)&&Array.isArray(r.value)){if(r.value.length===0)e.append(n,"");else for(const s of r.value)e.append(n,s);continue}typeof r.value=="string"&&e.set(n,r.value.trim())}}}function nTn({rootEntityType:e,dateFrom:t,dateTo:r,tokens:n}){const s={};e&&(s.rootEntityType=e),(t||r)&&(s.timestamp={...t?{start:t}:{},...r?{end:r}:{}});for(const a of n){if(a.fieldId==="tags"){Array.isArray(a.value)&&a.value.length>0?s.tags=a.value:typeof a.value=="string"&&a.value.trim()&&(s.tags=[a.value.trim()]);continue}if(a.fieldId==="level"){typeof a.value=="string"&&a.value.trim()&&a.value!=="Any"&&(s.level=a.value);continue}if(typeof a.value=="string"&&a.value.trim()&&a.value!=="Any")switch(a.fieldId){case"entityName":s.rootEntityName=a.value;break;case"traceId":s.traceId=a.value;break;case"spanId":s.spanId=a.value;break;case"runId":s.runId=a.value;break;case"threadId":s.threadId=a.value;break;case"sessionId":s.sessionId=a.value;break;case"requestId":s.requestId=a.value;break;case"resourceId":s.resourceId=a.value;break;case"userId":s.userId=a.value;break;case"organizationId":s.organizationId=a.value;break;case"serviceName":s.serviceName=a.value;break;case"environment":s.environment=a.value;break;case"experimentId":s.experimentId=a.value;break}}return s}const LL={AGENT:wl.AGENT,WORKFLOW:wl.WORKFLOW_RUN,SCORER:wl.SCORER,INGEST:wl.RAG_INGESTION},xye=[{label:"Agent",entityType:LL.AGENT},{label:"Workflow",entityType:LL.WORKFLOW},{label:"Scorer",entityType:LL.SCORER},{label:"Ingest",entityType:LL.INGEST}],sTn=[{label:"Running",value:"running"},{label:"Success",value:"success"},{label:"Error",value:"error"}],$x="rootEntityType",Fx="status",Pw="datePreset",Mw="dateFrom",Dw="dateTo",aTn=new Set(["all","last-24h","last-3d","last-7d","last-14d","last-30d","custom"]),ZS={tags:"filterTags",entityId:"filterEntityId",entityName:"filterEntityName",traceId:"filterTraceId",runId:"filterRunId",threadId:"filterThreadId",sessionId:"filterSessionId",requestId:"filterRequestId",resourceId:"filterResourceId",userId:"filterUserId",organizationId:"filterOrganizationId",serviceName:"filterServiceName",environment:"filterEnvironment",experimentId:"filterExperimentId"},uM=Object.keys(ZS),iTn=new Set(["running","success","error"]),wye="mastra:traces:saved-filters";function oTn(e){const t=fTn(e),r=e.get(Pw);r&&t.set(Pw,r);const n=e.get(Mw);n&&t.set(Mw,n);const s=e.get(Dw);s&&t.set(Dw,s);try{localStorage.setItem(wye,t.toString())}catch{}}function lTn(){try{localStorage.removeItem(wye)}catch{}}function PBe(){try{const e=localStorage.getItem(wye);if(!e)return null;const t=new URLSearchParams(e);return t.toString()?t:null}catch{return null}}function cTn(e){if(e.has(Pw)||e.has(Mw)||e.has(Dw)||e.has($x)||e.has(Fx))return!0;for(const t of uM)if(e.has(ZS[t]))return!0;return!1}function uTn({availableTags:e,availableRootEntityNames:t,availableServiceNames:r,availableEnvironments:n,loading:s}){const a=[{id:"rootEntityType",label:"Primitive Type",kind:"pick-multi",searchable:!1,options:xye.map(u=>({label:u.label,value:u.entityType})),placeholder:"Choose entity type",emptyText:"No entity types."},{id:"entityName",label:"Primitive Name",kind:"pick-multi",options:t.map(u=>({label:u,value:u})),placeholder:"Choose entity names",emptyText:"No entity names found.",isLoading:s?.entityNames},{id:"entityId",label:"Primitive ID",kind:"text"},{id:"status",label:"Status",kind:"pick-multi",searchable:!1,options:sTn.map(u=>({label:u.label,value:u.value})),placeholder:"Choose status",emptyText:"No statuses."},{id:"tags",label:"Tags",kind:"pick-multi",multi:!0,options:e.map(u=>({label:u,value:u})),placeholder:"Choose tags",emptyText:"No tags found.",isLoading:s?.tags},{id:"serviceName",label:"Service Name",kind:"pick-multi",options:r.map(u=>({label:u,value:u})),placeholder:"Choose service names",emptyText:"No service names found.",isLoading:s?.serviceNames},{id:"environment",label:"Environment",kind:"pick-multi",options:n.map(u=>({label:u,value:u})),placeholder:"Choose environments",emptyText:"No environments found.",isLoading:s?.environments},{id:"traceId",label:"Trace ID",kind:"text"},{id:"runId",label:"Run ID",kind:"text"},{id:"threadId",label:"Thread ID",kind:"text"},{id:"sessionId",label:"Session ID",kind:"text"},{id:"requestId",label:"Request ID",kind:"text"},{id:"resourceId",label:"Resource ID",kind:"text"},{id:"userId",label:"User ID",kind:"text"},{id:"organizationId",label:"Organization ID",kind:"text"},{id:"experimentId",label:"Experiment ID",kind:"text"}],i=(u,d)=>u.label.localeCompare(d.label),l=a.filter(u=>u.kind==="pick-multi").sort(i),c=a.filter(u=>u.kind==="text").sort(i);return[...l,...c]}function dTn(e){const t=[],r=new Map([[$x,"rootEntityType"],[Fx,"status"]]);for(const s of uM)r.set(ZS[s],s);const n=new Set;for(const[s]of e.entries()){const a=r.get(s);if(!a||n.has(a))continue;if(n.add(a),a==="tags"){const l=e.getAll(s);if(l.length===0)continue;t.push({fieldId:a,value:l.filter(Boolean)});continue}const i=e.get(s);i!==null&&t.push({fieldId:a,value:i})}return t}function fTn(e){const t=new URLSearchParams,r=e.get($x);r&&t.set($x,r);const n=e.get(Fx);n&&t.set(Fx,n);for(const s of uM){const a=ZS[s];if(s==="tags"){for(const l of e.getAll(a))t.append(a,l);continue}const i=e.get(a);i&&t.set(a,i)}return t}function MBe(e,t){e.delete($x),e.delete(Fx);for(const r of uM)e.delete(ZS[r]);for(const r of t){if(r.fieldId==="rootEntityType"&&typeof r.value=="string"){e.set($x,r.value);continue}if(r.fieldId==="status"&&typeof r.value=="string"){e.set(Fx,r.value);continue}const n=ZS[r.fieldId];if(n){if(r.fieldId==="tags"&&Array.isArray(r.value)){if(r.value.length===0)e.append(n,"");else for(const s of r.value)e.append(n,s);continue}typeof r.value=="string"&&e.set(n,r.value.trim())}}}function hTn({rootEntityType:e,status:t,dateFrom:r,dateTo:n,tokens:s}){const a={};e&&(a.entityType=e),t&&(a.status=t),r&&(a.startedAt={start:r}),n&&(a.endedAt={end:n});for(const i of s){if(i.fieldId==="tags"){Array.isArray(i.value)&&i.value.length>0?a.tags=i.value:typeof i.value=="string"&&i.value.trim()&&(a.tags=[i.value.trim()]);continue}if(typeof i.value=="string"&&i.value.trim()&&i.value!=="Any")switch(i.fieldId){case"entityId":a.entityId=i.value;break;case"entityName":a.entityName=i.value;break;case"traceId":a.traceId=i.value;break;case"runId":a.runId=i.value;break;case"threadId":a.threadId=i.value;break;case"sessionId":a.sessionId=i.value;break;case"requestId":a.requestId=i.value;break;case"resourceId":a.resourceId=i.value;break;case"userId":a.userId=i.value;break;case"organizationId":a.organizationId=i.value;break;case"serviceName":a.serviceName=i.value;break;case"environment":a.environment=i.value;break;case"experimentId":a.experimentId=i.value;break}}return a}const w1t=({entityType:e,rootOnly:t=!1}={})=>{const r=Ge();return kt({queryKey:e?["observability-entity-names","by-type",e]:["observability-entity-names","all",t?"root-only":"all-types"],queryFn:async()=>{try{if(e)return await r.getEntityNames({entityType:e});if(!t)return await r.getEntityNames();const s=await Promise.all(xye.map(a=>r.getEntityNames({entityType:a.entityType})));return{names:Array.from(new Set(s.flatMap(a=>a?.names??[]))).sort()}}catch{return{names:[]}}},select:s=>s?.names??[],retry:!1})},S1t=()=>{const e=Ge();return kt({queryKey:["observability-environments"],queryFn:async()=>{try{return await e.getEnvironments()}catch{return{environments:[]}}},select:t=>t?.environments??[],retry:!1})},O1t=()=>{const e=Ge();return kt({queryKey:["observability-service-names"],queryFn:async()=>{try{return await e.getServiceNames()}catch{return{serviceNames:[]}}},select:t=>t?.serviceNames??[],retry:!1})},k1t=()=>{const e=Ge();return kt({queryKey:["observability-tags"],queryFn:async()=>{try{return await e.getTags()}catch{return{tags:[]}}},select:t=>t?.tags??[],retry:!1})},Sle="logId",Ole="traceId",kle="spanId",ST=1440*60*1e3,pTn={"last-24h":ST,"last-3d":3*ST,"last-7d":7*ST,"last-14d":14*ST,"last-30d":30*ST};function OT(e){e.delete(Sle),e.delete(Ole),e.delete(kle)}function mTn(){const[e,t]=ao(),[r,n]=b.useState(),s=b.useMemo(()=>{const ne=e.get(Aw);return ne&&Yjn.has(ne)?ne:"last-24h"},[e]),a=e.get(Iw),i=e.get(Rw),l=b.useMemo(()=>{if(s==="custom"){if(!a)return;const ee=new Date(a);return Number.isNaN(ee.getTime())?void 0:ee}if(s==="all")return;const ne=pTn[s];return ne?new Date(Date.now()-ne):void 0},[s,a]),c=b.useMemo(()=>{if(s!=="custom"||!i)return;const ne=new Date(i);return Number.isNaN(ne.getTime())?void 0:ne},[s,i]),u=b.useRef(s);u.current=s;const d=e.get(Sle),f=e.get(Ole),h=e.get(kle),p=b.useMemo(()=>x1t.find(ne=>ne.entityType===e.get(Lx)),[e]),m=b.useMemo(()=>tTn(e),[e]),{data:g=[],isPending:v}=k1t(),{data:x=[],isPending:w}=w1t({entityType:p?.entityType,rootOnly:!0}),{data:S=[],isPending:k}=S1t(),{data:_=[],isPending:E}=O1t(),T=b.useMemo(()=>eTn({availableTags:g,availableRootEntityNames:x,availableServiceNames:_,availableEnvironments:S,loading:{tags:v,entityNames:w,serviceNames:E,environments:k}}),[g,x,_,S,v,w,E,k]),j=b.useMemo(()=>nTn({rootEntityType:p?.entityType,dateFrom:l,dateTo:c,tokens:m}),[m,l,c,p]),{data:N=[],isLoading:I,error:P,isFetchingNextPage:R,hasNextPage:z,setEndOfListElement:D}=Gjn({filters:j}),U=b.useCallback(ne=>{t(ee=>{const re=new URLSearchParams(ee);for(const[ie,ce]of Object.entries(ne)){const K=ie==="logId"?Sle:ie==="traceId"?Ole:kle;ce?re.set(K,ce):re.delete(K)}return re},{replace:!0})},[t]),F=b.useCallback(ne=>{t(ee=>{const re=new URLSearchParams(ee);return RBe(re,ne),OT(re),re},{replace:!0})},[t]),B=b.useCallback((ne,ee)=>{if(u.current!=="custom")return;const re=ee==="from"?Iw:Rw;t(ie=>{const ce=new URLSearchParams(ie);return ne?ce.set(re,ne.toISOString()):ce.delete(re),OT(ce),ce},{replace:!0})},[t]),H=b.useCallback(ne=>{u.current=ne,t(ee=>{const re=new URLSearchParams(ee);return ne==="last-24h"?(re.delete(Aw),re.delete(Iw),re.delete(Rw)):ne==="custom"?re.set(Aw,"custom"):(re.set(Aw,ne),re.delete(Iw),re.delete(Rw)),OT(re),re},{replace:!0})},[t]),[W,L]=b.useState(()=>IBe()!==null),Y=b.useCallback(()=>{Xjn(e),L(!0),ze.success("Filters setting for Logs saved")},[e]),q=b.useCallback(()=>{Kjn(),L(!1),ze.success("Filters setting for Logs cleared up")},[]),M=b.useRef(!1);b.useEffect(()=>{if(M.current||(M.current=!0,Jjn(e)))return;const ne=IBe();ne&&t(ee=>{const re=new URLSearchParams(ee);for(const[ie,ce]of ne)re.append(ie,ce);return re},{replace:!0})},[]);const Q=b.useCallback(()=>{t(ne=>{const ee=new URLSearchParams(ne);ee.delete(Lx);for(const re of cM)ee.delete(GS[re]);return OT(ee),ee},{replace:!0})},[t]),G=b.useCallback(()=>{const ne=m.map(ee=>{const re=T.find(ie=>ie.id===ee.fieldId);return re?re.kind==="text"?{fieldId:ee.fieldId,value:""}:re.kind==="pick-multi"?re.multi?{fieldId:ee.fieldId,value:[]}:{fieldId:ee.fieldId,value:"Any"}:ee:ee});t(ee=>{const re=new URLSearchParams(ee);return RBe(re,ne),OT(re),re},{replace:!0})},[T,m,t]);if(P&&Ts(P))return o.jsx(qr,{title:"Logs",icon:o.jsx(DO,{}),children:o.jsx(Ys,{})});if(P&&ys(P))return o.jsx(qr,{title:"Logs",icon:o.jsx(DO,{}),children:o.jsx(Us,{resource:"logs"})});if(P)return o.jsx(qr,{title:"Logs",icon:o.jsx(DO,{}),children:o.jsx(Ic,{title:"Failed to load logs",message:P?.message??"Unknown error"})});const J=m.length>0||s!=="last-24h"||!!c;return N.length===0&&!I&&!J?o.jsx(qr,{title:"Logs",icon:o.jsx(DO,{}),children:o.jsx(Ujn,{})}):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(vn,{children:o.jsxs(vn.Title,{isLoading:I,children:[o.jsx(DO,{})," Logs"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(Hdt,{preset:s,onPresetChange:H,dateFrom:l,dateTo:c,onDateChange:B,disabled:I,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(Zut,{fields:T,tokens:m,onTokensChange:F,disabled:I,onStartTextFilter:n}),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(Vjn,{isLoading:I,filterFields:T,filterTokens:m,onFilterTokensChange:F,onClear:G,onRemoveAll:Q,onSave:Y,onRemoveSaved:W?q:void 0,autoFocusFilterFieldId:r})]}),o.jsx(Bjn,{logs:N,isLoading:I,isFetchingNextPage:R,hasNextPage:z,setEndOfListElement:D,featuredLogId:d,featuredTraceId:f,featuredSpanId:h,onFeaturedChange:U})]})}const _1t=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 gTn({server:e}){const{paths:t,Link:r}=ir(),s=Ge().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=_1t(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(Oe.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:r,children:[o.jsx(Oe.NameCell,{children:f}),o.jsx(Oe.DescriptionCell,{children:a}),o.jsx(Oe.TextCell,{className:"text-center",children:u||""}),o.jsx(Oe.TextCell,{className:"text-center",children:c||""}),o.jsx(Oe.TextCell,{className:"text-center",children:d||""})]})}function vTn({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(Sh,{columns:"auto 1fr auto auto auto"}):o.jsxs(Oe,{columns:"auto 1fr auto auto auto",children:[o.jsxs(Oe.Top,{children:[o.jsx(Oe.TopCell,{children:"Name"}),o.jsx(Oe.TopCell,{children:"URL"}),o.jsx(Oe.TopCellSmart,{long:"Agents",short:o.jsx(pa,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(Oe.TopCellSmart,{long:"Tools",short:o.jsx(Pi,{}),tooltip:"Tools",className:"text-center"}),o.jsx(Oe.TopCellSmart,{long:"Workflows",short:o.jsx(Mi,{}),tooltip:"Workflow Tools",className:"text-center"})]}),n.length===0&&r?o.jsx(Oe.NoMatch,{message:"No MCP Servers match your search"}):null,n.map(s=>o.jsx(gTn,{server:s},s.id))]})}const yTn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(va,{})]})})}),bTn=()=>{const{data:e=[],isLoading:t,error:r}=iM(),[n,s]=b.useState("");return r&&Ts(r)?o.jsx(qr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(Ys,{})}):r&&ys(r)?o.jsx(qr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(Us,{resource:"MCP servers"})}):r?o.jsx(qr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(Ic,{title:"Failed to load MCP servers",message:r.message})}):e.length===0&&!t?o.jsx(qr,{title:"MCP Servers",icon:o.jsx(vl,{}),children:o.jsx(yTn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{isLoading:t,children:[o.jsx(vl,{})," 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(Eg,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(vTn,{mcpServers:e,isLoading:t,search:n})]})},xTn=(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 wTn({tools:e,agents:t,isLoading:r,search:n=""}){const{paths:s,Link:a}=ir(),i=b.useMemo(()=>xTn(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(n.toLowerCase())),[i,n]);return r?o.jsx(Sh,{columns:"auto 1fr auto"}):o.jsxs(Oe,{columns:"auto 1fr auto",children:[o.jsxs(Oe.Top,{children:[o.jsx(Oe.TopCell,{children:"Name"}),o.jsx(Oe.TopCell,{children:"Description"}),o.jsx(Oe.TopCellSmart,{long:"Agents",short:o.jsx(pa,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&n?o.jsx(Oe.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(Oe.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(Oe.NameCell,{children:u}),o.jsx(Oe.DescriptionCell,{children:d}),o.jsx(Oe.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const STn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(va,{})]})})}),OTn=()=>{const e=Ge();return Jr({mutationFn:async({toolId:t,input:r,requestContext:n})=>{const s=new p_;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}}})},kTn=({toolId:e})=>{const{canExecute:t}=jy(),r=t("tools"),{data:n={}}=Ng(),s=b.useMemo(()=>{for(const g of Object.values(n))if(g.tools){const v=Object.values(g.tools).find(x=>x.id===e);if(v)return v}return null},[n,e]),{data:a,isLoading:i,error:l}=jSn(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=OTn(),{requestContext:h}=Qn();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,v)=>{if(!c)return;const x={...h??{},...v??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?fg(cg(sy(c?.inputSchema))):Yn({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Mn,{className:"h-8 w-48 mb-4"}),o.jsx(Mn,{className:"h-32 w-full"})]}):l?null:c?r?o.jsx(Gve,{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(ve,{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(ve,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function _Tn({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}=P8(),{data:h={},isLoading:p,isError:m,error:g}=Ng(),{navigate:v,paths:x}=ir();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&&v(x.toolLink(_))};return o.jsx(Jl,{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 ETn=({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(gf,{children:o.jsx(ve,{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(gf,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(ve,{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(gt,{icon:o.jsx(w9,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(gt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(ve,{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(gt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(ve,{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(ve,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(Xa,{tooltip:"Copy HTTP Stream URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(gt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(ve,{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(ve,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(Xa,{tooltip:"Copy SSE URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(gt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(ve,{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(ve,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(Xa,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(CTn,{server:t})})]})},CTn=({server:e})=>{const{data:t={},isLoading:r}=_1t(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(je,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(vl,{})}),o.jsx(ve,{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(jTn,{tool:a,serverId:e.id},s)})})]})},jTn=({tool:e,serverId:t})=>{const r=b.useRef(null),{Link:n,paths:s}=ir(),a=Swt[e.toolType||"tool"];return o.jsxs(_f,{onClick:()=>r.current?.click(),children:[o.jsx(dut,{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})]})]})},TTn=()=>{const{serverId:e}=na(),{data:t=[],isLoading:r}=iM(),n=t.find(s=>s.id===e);return o.jsxs(Fr,{children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/mcps",children:[o.jsx(je,{children:o.jsx(vl,{})}),"MCP Servers"]}),o.jsx(Cr,{as:"span",to:"",isCurrent:!0,children:o.jsx(Fwt,{value:e,variant:"ghost"})})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(a0,{}),"MCP documentation"]})})]}),o.jsx(ETn,{isLoading:r,server:n})]})},E1t=(e,t)=>{const{requestContext:r}=Qn(),n=Ge();return kt({queryKey:["mcp-server-tool",e,t],queryFn:()=>n.getMcpServerTool(e,t).details(r)})},NTn=(e,t)=>{const{requestContext:r}=Qn(),n=Ge();return Jr({mutationFn:s=>n.getMcpServerTool(e,t).execute({data:s,requestContext:r})})},ATn=({toolId:e,serverId:t})=>{const{canExecute:r}=jy(),n=r("tools"),{data:s,isLoading:a,error:i}=E1t(t,e),{mutateAsync:l,isPending:c,data:u}=NTn(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(Mn,{className:"h-8 w-48 mb-4"}),o.jsx(Mn,{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(ve,{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(ve,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let f;try{f=fg(cg(s.inputSchema))}catch(h){console.error("Error processing input schema:",h),ze.error("Failed to process tool input schema."),f=Yn({})}return o.jsx(Gve,{executionResult:u,isExecutingTool:c,zodInputSchema:f,handleExecuteTool:d,toolDescription:s.description||"",toolId:s.id})},ITn=()=>{const{data:e}=iM(),{serverId:t,toolId:r}=na(),{data:n,isLoading:s}=E1t(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(Za,{children:[o.jsxs(Cr,{as:dr,to:"/mcps",children:[o.jsx(je,{children:o.jsx(vl,{})}),"MCP Servers"]}),o.jsx(Cr,{as:dr,to:`/mcps/${t}`,children:l}),o.jsx(Cr,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(a0,{}),"MCP documentation"]})})]}),o.jsx(ATn,{toolId:r,serverId:t})]})},C1t=[{label:"Last 24 hours",value:"24h"},{label:"Last 3 days",value:"3d"},{label:"Last 7 days",value:"7d"},{label:"Last 14 days",value:"14d"},{label:"Last 30 days",value:"30d"}],RTn=new Set(C1t.map(e=>e.value));function PTn(e){return typeof e=="string"&&(RTn.has(e)||e==="custom")}const MTn={"24h":1,"3d":3,"7d":7,"14d":14,"30d":30},DTn={"Studio Cloud":42,Production:31,Staging:18,Dev:7,"CI / Preview":2};function LTn(e,t,r){let n=1;e!=="custom"?n=MTn[e]??1:t?.from&&t?.to&&(n=Math.max(1,Vcr(t.to,t.from)+1));const s=r.filter(i=>i.field==="Environment"&&i.comparator==="is"),a=s.length===0?100:s.flatMap(i=>i.values).reduce((i,l)=>i+(DTn[l]??0),0);return n*(a/100)}const j1t=b.createContext({datePreset:"24h",setDatePreset:()=>{},customRange:void 0,setCustomRange:()=>{},dateRangeLabel:"Last 24 hours",filterGroups:[],setFilterGroups:()=>{},multiplier:1});function T1t(){return b.useContext(j1t)}function $Tn(e,t){return e!=="custom"?C1t.find(r=>r.value===e).label:t?.from?t.to?`${ur(t.from,"MMM d, yyyy")} – ${ur(t.to,"MMM d, yyyy")}`:ur(t.from,"MMM d, yyyy"):"Custom range"}function FTn({children:e,initialPreset:t,onPresetChange:r}){const[n,s]=b.useState(t??"24h"),[a,i]=b.useState(void 0),[l,c]=b.useState([]),u=$Tn(n,a),d=LTn(n,a,l);b.useEffect(()=>{t&&t!==n&&s(t)},[t]);const f=b.useCallback(h=>{s(h),r?.(h)},[r]);return o.jsx(j1t.Provider,{value:{datePreset:n,setDatePreset:f,customRange:a,setCustomRange:i,dateRangeLabel:u,filterGroups:l,setFilterGroups:c,multiplier:d},children:e})}const Qte={"24h":1440*60*1e3,"3d":4320*60*1e3,"7d":10080*60*1e3,"14d":336*60*60*1e3,"30d":720*60*60*1e3};function zTn(e,t){const r=new Date;if(e!=="custom"){const n=Qte[e]??Qte["24h"];return{start:new Date(r.getTime()-n),end:r}}return{start:t?.from??new Date(r.getTime()-Qte["24h"]),end:t?.to??r}}function Iy(){const{datePreset:e,customRange:t}=T1t(),r=zTn(e,t);return{datePreset:e,customRange:t,timestamp:r}}async function Wte(e,t,r){const n=await e.getMetricPercentiles({name:t,percentiles:[.5,.95],interval:"1h",filters:{timestamp:r}}),s=n.series.find(l=>l.percentile===.5),a=n.series.find(l=>l.percentile===.95);if(!s||!a)return[];const i=new Map(a.points.map(l=>[new Date(l.timestamp).getTime(),l.value]));return s.points.map(l=>{const c=new Date(l.timestamp);return{time:c.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),p50:Math.round(l.value),p95:Math.round(i.get(c.getTime())??0)}})}function BTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","latency",t,r],queryFn:async()=>{const[s,a,i]=await Promise.all([Wte(e,"mastra_agent_duration_ms",n),Wte(e,"mastra_workflow_duration_ms",n),Wte(e,"mastra_tool_duration_ms",n)]);return{agentData:s,workflowData:a,toolData:i}}})}const UTn=[{dataKey:"p50",label:"p50",color:mc.blue,aggregate:e=>({value:e.length>0?`${Math.round(e.reduce((t,r)=>t+r.p50,0)/e.length)}`:"0",suffix:"avg ms"})},{dataKey:"p95",label:"p95",color:mc.yellow,aggregate:e=>({value:e.length>0?`${Math.round(e.reduce((t,r)=>t+r.p95,0)/e.length)}`:"0",suffix:"avg ms"})}];function Gte({data:e}){return e.length===0?o.jsx(Ht.NoData,{message:"No latency data yet"}):o.jsx(ome,{data:e,series:UTn})}function VTn(){const{data:e,isLoading:t,isError:r}=BTn(),n=!!e&&(e.agentData.length>0||e.workflowData.length>0||e.toolData.length>0),s=e&&e.agentData.length>0?`${Math.round(e.agentData.reduce((a,i)=>a+i.p50,0)/e.agentData.length)}ms`:"—";return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Latency",description:"Hourly p50 and p95 latency."}),n&&o.jsx(Ht.Summary,{value:s,label:"Avg p50"})]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load latency data"}):o.jsx(Ht.Content,{children:n?o.jsxs(Nf,{defaultTab:"agents",className:"overflow-visible",children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"agents",children:"Agents"}),o.jsx(Ss,{value:"workflows",children:"Workflows"}),o.jsx(Ss,{value:"tools",children:"Tools"})]}),o.jsx(Ps,{value:"agents",children:o.jsx(Gte,{data:e.agentData})}),o.jsx(Ps,{value:"workflows",children:o.jsx(Gte,{data:e.workflowData})}),o.jsx(Ps,{value:"tools",children:o.jsx(Gte,{data:e.toolData})})]}):o.jsx(Ht.NoData,{message:"No latency data yet"})})]})}function N1t(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","agent-runs-kpi",t,r],queryFn:()=>e.getMetricAggregate({name:["mastra_agent_duration_ms"],aggregation:"count",filters:{timestamp:n},comparePeriod:"previous_period"})})}function qTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","avg-score-kpi",t,r],queryFn:async()=>{const s=await e.listScorers(),a=Object.keys(s??{});if(a.length===0)return{value:null,previousValue:null,changePercent:null};const i={timestamp:{start:n.start,end:n.end}},c=(await Promise.all(a.map(async h=>{const[p,m]=await Promise.all([e.getScoreAggregate({scorerId:h,aggregation:"avg",filters:i}),e.getScoreAggregate({scorerId:h,aggregation:"count",filters:i})]);return{avg:p.value??0,count:m.value??0}}))).filter(h=>h.count>0);if(c.length===0)return{value:null,previousValue:null,changePercent:null};const u=c.reduce((h,p)=>h+p.count,0),f=c.reduce((h,p)=>h+p.avg*p.count,0)/u;return{value:Math.round(f*100)/100,previousValue:null,changePercent:null}}})}function HTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","model-cost-kpi",t,r],queryFn:async()=>{const s=await e.getMetricAggregate({name:["mastra_model_total_input_tokens","mastra_model_total_output_tokens"],aggregation:"sum",filters:{timestamp:n},comparePeriod:"previous_period"});return{cost:s.estimatedCost??null,costUnit:s.costUnit??null,previousCost:s.previousEstimatedCost??null,costChangePercent:s.costChangePercent??null}}})}function QTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","total-tokens-kpi",t,r],queryFn:async()=>{const[s,a]=await Promise.all([e.getMetricAggregate({name:["mastra_model_total_input_tokens"],aggregation:"sum",filters:{timestamp:n},comparePeriod:"previous_period"}),e.getMetricAggregate({name:["mastra_model_total_output_tokens"],aggregation:"sum",filters:{timestamp:n},comparePeriod:"previous_period"})]),i=s.value!=null||a.value!=null,l=s.previousValue!=null||a.previousValue!=null,c=(s.value??0)+(a.value??0),u=(s.previousValue??0)+(a.previousValue??0),d=l&&u>0?(c-u)/u*100:null;return{value:i?c:null,previousValue:l?u:null,changePercent:d}}})}function WTn(){const{data:e,isLoading:t,isError:r}=N1t(),n=e?.value!=null;return o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Agent Runs"}),o.jsx(fr.Value,{className:n?void 0:"invisible",children:n?e.value.toLocaleString():"—"}),r?o.jsx(fr.Error,{}):t?o.jsx(fr.Loading,{}):n?e.changePercent!=null?o.jsx(fr.Change,{changePct:e.changePercent,prevValue:e.previousValue?.toLocaleString()}):o.jsx(fr.NoChange,{}):o.jsx(fr.NoData,{})]})}function GTn(){const{data:e,isLoading:t,isError:r}=HTn(),n=e?.cost!=null;return o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Model Cost"}),o.jsx(fr.Value,{className:n?void 0:"invisible",children:n?_E(e.cost,e.costUnit):"—"}),r?o.jsx(fr.Error,{}):t?o.jsx(fr.Loading,{}):n?e.costChangePercent!=null?o.jsx(fr.Change,{changePct:e.costChangePercent,prevValue:e.previousCost!=null?_E(e.previousCost,e.costUnit):void 0}):o.jsx(fr.NoChange,{}):o.jsx(fr.NoData,{})]})}function ZTn(){const{data:e,isLoading:t,isError:r}=QTn(),n=e?.value!=null;return o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Total Tokens"}),o.jsx(fr.Value,{className:n?void 0:"invisible",children:n?Qm(e.value):"—"}),r?o.jsx(fr.Error,{}):t?o.jsx(fr.Loading,{}):n?e.changePercent!=null?o.jsx(fr.Change,{changePct:e.changePercent,prevValue:e.previousValue!=null?Qm(e.previousValue):void 0}):o.jsx(fr.NoChange,{}):o.jsx(fr.NoData,{})]})}function YTn(){const{data:e,isLoading:t,isError:r}=qTn(),n=e?.value!=null;return o.jsxs(fr,{children:[o.jsx(fr.Label,{children:"Avg Score"}),o.jsx(fr.Value,{className:n?void 0:"invisible",children:n?String(e.value):"—"}),r?o.jsx(fr.Error,{}):t?o.jsx(fr.Loading,{}):n?e.changePercent!=null?o.jsx(fr.Change,{changePct:e.changePercent,prevValue:e.previousValue!=null?String(e.previousValue):void 0}):o.jsx(fr.NoChange,{}):o.jsx(fr.NoData,{})]})}function XTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","model-usage-cost",t,r],queryFn:async()=>{const s=["mastra_model_total_input_tokens","mastra_model_total_output_tokens","mastra_model_input_cache_read_tokens","mastra_model_input_cache_write_tokens"],[a,i,l,c]=await Promise.all(s.map(h=>e.getMetricBreakdown({name:[h],groupBy:["model"],aggregation:"sum",filters:{timestamp:n}}))),u=new Map,d=h=>(u.has(h)||u.set(h,{input:0,output:0,cacheRead:0,cacheWrite:0,cost:null,costUnit:null}),u.get(h)),f=(h,p)=>{p.estimatedCost!=null&&(h.cost=(h.cost??0)+p.estimatedCost,p.costUnit&&(h.costUnit=p.costUnit))};for(const h of a.groups){const p=h.dimensions.model??"unknown",m=d(p);m.input=h.value,f(m,h)}for(const h of i.groups){const p=h.dimensions.model??"unknown",m=d(p);m.output=h.value,f(m,h)}for(const h of l.groups){const p=h.dimensions.model??"unknown",m=d(p);m.cacheRead=h.value,f(m,h)}for(const h of c.groups){const p=h.dimensions.model??"unknown",m=d(p);m.cacheWrite=h.value,f(m,h)}return Array.from(u.entries()).map(([h,p])=>({model:h,input:Qm(p.input),output:Qm(p.output),cacheRead:Qm(p.cacheRead),cacheWrite:Qm(p.cacheWrite),cost:p.cost,costUnit:p.costUnit})).sort((h,p)=>h.model.localeCompare(p.model))}})}function KTn(){const{data:e,isLoading:t,isError:r}=XTn(),n=!!e&&e.length>0;return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Model Usage & Cost",description:"Token consumption by model."}),n&&(()=>{const s=e.reduce((i,l)=>i+(l.cost??0),0),a=e.find(i=>i.costUnit)?.costUnit;return o.jsx(Ht.Summary,{value:s>0?_E(s,a):"—",label:"Total cost"})})()]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load model usage data"}):o.jsx(Ht.Content,{children:n?o.jsx(ime,{columns:[{label:"Model",value:s=>s.model},{label:"Input",value:s=>s.input},{label:"Output",value:s=>s.output},{label:"Cache Read",value:s=>s.cacheRead},{label:"Cache Write",value:s=>s.cacheWrite},{label:"Cost",value:s=>s.cost!=null?_E(s.cost,s.costUnit):"—",highlight:!0}],data:e.map(s=>({...s,key:s.model}))}):o.jsx(Ht.NoData,{message:"No model usage data yet"})})]})}function JTn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","scores-card",t,r],queryFn:async()=>{const s={timestamp:{start:n.start,end:n.end}},a=await e.listScorers(),i=Object.keys(a??{});if(i.length===0)return{summaryData:[],overTimeData:[],scorerNames:[],avgScore:null};const c=(await Promise.all(i.map(async x=>{const[w,S,k,_]=await Promise.all([e.getScoreAggregate({scorerId:x,aggregation:"avg",filters:s}),e.getScoreAggregate({scorerId:x,aggregation:"min",filters:s}),e.getScoreAggregate({scorerId:x,aggregation:"max",filters:s}),e.getScoreAggregate({scorerId:x,aggregation:"count",filters:s})]);return{scorer:x,avg:w.value??0,min:S.value??0,max:k.value??0,count:_.value??0}}))).filter(x=>x.count>0),u=c.map(x=>x.scorer);if(c.length===0)return{summaryData:[],overTimeData:[],scorerNames:[],avgScore:null};const d=c.reduce((x,w)=>x+w.avg*w.count,0),f=c.reduce((x,w)=>x+w.count,0),h=f?Math.round(d/f*100)/100:0,p="1h",m=await Promise.all(u.map(x=>e.getScoreTimeSeries({scorerId:x,interval:p,aggregation:"avg",filters:s}))),g=new Map;for(let x=0;x<u.length;x++){const w=u[x],S=m[x]?.series??[];for(const k of S)for(const _ of k.points){const T=new Date(_.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1});g.has(T)||g.set(T,new Map);const j=g.get(T);j.has(w)||j.set(w,{sum:0,count:0});const N=j.get(w);N.sum+=_.value,N.count+=1}}const v=Array.from(g.entries()).sort(([x],[w])=>x.localeCompare(w)).map(([x,w])=>{const S={time:x};for(const[k,_]of w)S[k]=+(_.sum/_.count).toFixed(2);return S});return{summaryData:c,overTimeData:v,scorerNames:u,avgScore:h}}})}const DBe=[mc.green,mc.blue,mc.purple,mc.orange,mc.pink,mc.yellow];function eNn(){const{data:e,isLoading:t,isError:r}=JTn(),n=!!e&&e.summaryData.length>0,s=b.useMemo(()=>e?.scorerNames?e.scorerNames.map((a,i)=>({dataKey:a,label:a,color:DBe[i%DBe.length],aggregate:l=>({value:l.length>0?(l.reduce((c,u)=>c+(u[a]??0),0)/l.length).toFixed(2):"0",suffix:"avg"})})):[],[e?.scorerNames]);return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Scores",description:"Evaluation scorer performance."}),n&&o.jsx(Ht.Summary,{value:e?.avgScore!=null?`avg ${e.avgScore}`:"—",label:"Across all scorers"})]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load scores data"}):o.jsx(Ht.Content,{children:n?o.jsxs(Nf,{defaultTab:"over-time",className:"overflow-visible",children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"over-time",children:"Over Time"}),o.jsx(Ss,{value:"summary",children:"Summary"})]}),o.jsx(Ps,{value:"over-time",className:"pb-0",children:e.overTimeData.length>0?o.jsx(ome,{data:e.overTimeData,series:s,yDomain:[0,1]}):o.jsx(Ht.NoData,{message:"No time series data yet"})}),o.jsx(Ps,{value:"summary",children:o.jsx(ime,{columns:[{label:"Scorer",value:a=>a.scorer},{label:"Avg",value:a=>a.avg.toFixed(2),highlight:!0},{label:"Min",value:a=>a.min.toFixed(2)},{label:"Max",value:a=>a.max.toFixed(2)},{label:"Count",value:a=>a.count.toLocaleString()}],data:e.summaryData.map(a=>({...a,key:a.scorer}))})})]}):o.jsx(Ht.NoData,{message:"No scores data yet"})})]})}function tNn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","token-usage-by-agent",t,r],queryFn:async()=>{const[s,a,i,l]=await Promise.all([e.getMetricBreakdown({name:["mastra_model_total_input_tokens"],groupBy:["entityName"],aggregation:"sum",filters:{timestamp:n}}),e.getMetricBreakdown({name:["mastra_model_total_output_tokens"],groupBy:["entityName"],aggregation:"sum",filters:{timestamp:n}}),e.getMetricBreakdown({name:["mastra_model_input_cache_read_tokens"],groupBy:["entityName"],aggregation:"sum",filters:{timestamp:n}}),e.getMetricBreakdown({name:["mastra_model_input_cache_write_tokens"],groupBy:["entityName"],aggregation:"sum",filters:{timestamp:n}})]),c=new Map,u=f=>(c.has(f)||c.set(f,{input:0,output:0,cost:null,costUnit:null}),c.get(f)),d=(f,h)=>{h.estimatedCost!=null&&(f.cost=(f.cost??0)+h.estimatedCost,h.costUnit&&(f.costUnit=h.costUnit))};for(const f of s.groups){const h=f.dimensions.entityName??"unknown",p=u(h);p.input=f.value,d(p,f)}for(const f of a.groups){const h=f.dimensions.entityName??"unknown",p=u(h);p.output=f.value,d(p,f)}for(const f of i.groups){const h=f.dimensions.entityName??"unknown",p=u(h);d(p,f)}for(const f of l.groups){const h=f.dimensions.entityName??"unknown",p=u(h);d(p,f)}return Array.from(c.entries()).map(([f,h])=>({name:f,input:h.input,output:h.output,total:h.input+h.output,cost:h.cost,costUnit:h.costUnit})).sort((f,h)=>h.total-f.total)}})}function rNn(){const{data:e,isLoading:t,isError:r}=tNn(),[n,s]=b.useState("tokens"),a=!!e&&e.length>0,i=e?.reduce((p,m)=>p+m.total,0)??0,l=e?.filter(p=>p.cost!=null&&p.cost>0)??[],u=new Set(l.map(p=>p.costUnit??"usd")).size<=1,d=u?l[0]?.costUnit??null:null,f=u?l.reduce((p,m)=>p+(m.cost??0),0):0,h=u&&f>0;return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Token Usage by Agent",description:"Token consumption grouped by agent."}),a&&(n==="cost"&&h?o.jsx(Ht.Summary,{value:_E(f,d),label:"Total cost"}):o.jsx(Ht.Summary,{value:Qm(i),label:"Total tokens"}))]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load token usage data"}):o.jsx(Ht.Content,{children:a?o.jsxs(Nf,{defaultTab:"tokens",value:n,onValueChange:p=>s(p),className:"grid grid-rows-[auto_1fr] overflow-y-auto h-full",children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"tokens",children:"Tokens"}),o.jsx(Ss,{value:"cost",children:"Cost"})]}),o.jsx(Ps,{value:"tokens",children:o.jsx(K_,{data:e.map(p=>({name:p.name,values:[p.input,p.output]})),segments:[{label:"Input",color:mc.blueDark},{label:"Output",color:mc.blue}],maxVal:Math.max(...e.map(p=>p.input+p.output)),fmt:Qm})}),o.jsx(Ps,{value:"cost",children:h?o.jsx(K_,{data:e.filter(p=>p.cost!=null&&p.cost>0).sort((p,m)=>(m.cost??0)-(p.cost??0)).map(p=>({name:p.name,values:[p.cost]})),segments:[{label:"Cost",color:mc.purple}],maxVal:Math.max(...e.map(p=>p.cost??0)),fmt:p=>_E(p,d)}):o.jsx(Ht.NoData,{message:"No cost data yet"})})]}):o.jsx(Ht.NoData,{message:"No token usage data yet"})})]})}async function Zte(e,t,r){const n=await e.getMetricBreakdown({name:[t],groupBy:["entityName","status"],aggregation:"count",filters:{timestamp:r}}),s=new Map;for(const a of n.groups){const i=a.dimensions.entityName??"unknown",l=a.dimensions.status??"ok";s.has(i)||s.set(i,{completed:0,errors:0});const c=s.get(i);l==="error"?c.errors+=a.value:c.completed+=a.value}return Array.from(s.entries()).map(([a,i])=>({name:a,...i})).sort((a,i)=>i.completed+i.errors-(a.completed+a.errors))}function nNn(){const e=Ge(),{datePreset:t,customRange:r,timestamp:n}=Iy();return kt({queryKey:["metrics","trace-volume",t,r],queryFn:async()=>{const[s,a,i]=await Promise.all([Zte(e,"mastra_agent_duration_ms",n),Zte(e,"mastra_workflow_duration_ms",n),Zte(e,"mastra_tool_duration_ms",n)]);return{agentData:s,workflowData:a,toolData:i}}})}function Yte({data:e}){return o.jsx(K_,{data:e.map(t=>({name:t.name,values:[t.completed,t.errors]})),segments:[{label:"Completed",color:mc.blueDark},{label:"Errors",color:mc.pink}],maxVal:Math.max(...e.map(t=>t.completed+t.errors)),fmt:Qm})}function sNn(){const{data:e,isLoading:t,isError:r}=nNn(),n=!!e&&(e.agentData.length>0||e.workflowData.length>0||e.toolData.length>0),s=e?[...e.agentData,...e.workflowData,...e.toolData].reduce((a,i)=>a+i.completed+i.errors,0):0;return o.jsxs(Ht,{children:[o.jsxs(Ht.TopBar,{children:[o.jsx(Ht.TitleAndDescription,{title:"Trace Volume",description:"Runs and call counts."}),n&&o.jsx(Ht.Summary,{value:Qm(s),label:"Total runs"})]}),t?o.jsx(Ht.Loading,{}):r?o.jsx(Ht.Error,{message:"Failed to load trace volume data"}):o.jsx(Ht.Content,{children:n?o.jsxs(Nf,{defaultTab:"agents",className:"grid grid-rows-[auto_1fr] overflow-y-auto h-full",children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"agents",children:"Agents"}),o.jsx(Ss,{value:"workflows",children:"Workflows"}),o.jsx(Ss,{value:"tools",children:"Tools"})]}),o.jsx(Ps,{value:"agents",children:e.agentData.length>0?o.jsx(Yte,{data:e.agentData}):o.jsx(Ht.NoData,{message:"No agent data yet"})}),o.jsx(Ps,{value:"workflows",children:e.workflowData.length>0?o.jsx(Yte,{data:e.workflowData}):o.jsx(Ht.NoData,{message:"No workflow data yet"})}),o.jsx(Ps,{value:"tools",children:e.toolData.length>0?o.jsx(Yte,{data:e.toolData}):o.jsx(Ht.NoData,{message:"No tool data yet"})})]}):o.jsx(Ht.NoData,{message:"No trace volume data yet"})})]})}const aNn=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]);function iNn(){const{data:e,isLoading:t}=C8(),r=e?.observabilityStorageType,n=r?aNn.has(r):!1,s=r==="ObservabilityInMemory";return t?null:n?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[s&&o.jsxs(Ul,{variant:"info",children:[o.jsx(Vl,{children:"Metrics are not persisted"}),o.jsx(zu,{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(Zae,{children:[o.jsx(WTn,{}),o.jsx(GTn,{}),o.jsx(ZTn,{}),o.jsx(YTn,{})]}),o.jsxs(Zae,{children:[o.jsx(KTn,{}),o.jsx(rNn,{}),o.jsx(eNn,{}),o.jsx(sNn,{}),o.jsx(VTn,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(va,{})]})})})}const oNn=[{label:"Last 24 hours",value:"24h"},{label:"Last 3 days",value:"3d"},{label:"Last 7 days",value:"7d"},{label:"Last 14 days",value:"14d"},{label:"Last 30 days",value:"30d"}];function lNn(){const{datePreset:e,setDatePreset:t}=T1t();return o.jsx(Lo,{name:"date-range",labelIsHidden:!0,value:e,options:oNn,onValueChange:r=>t(r)})}const Xte="period";function cNn(){const[e,t]=ao(),r=e.get(Xte),n=PTn(r)?r:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(Xte):l.set(Xte,a),l},{replace:!0})},[t]);return o.jsx(FTn,{initialPreset:n,onPresetChange:s,children:o.jsx(uNn,{})})}function uNn(){const{error:e}=N1t();return e&&Ts(e)?o.jsx(qr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(Ys,{})}):e&&ys(e)?o.jsx(qr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(Us,{resource:"metrics"})}):e?o.jsx(qr,{title:"Metrics",icon:o.jsx(sk,{}),children:o.jsx(Ic,{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(vn,{children:o.jsxs(vn.Title,{children:[o.jsx(sk,{})," Metrics"]})})}),o.jsxs(bt.Column,{className:"flex justify-end gap-2",children:[o.jsx(lNn,{}),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,{})})]})]})}),o.jsx(iNn,{})]})}const dNn=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:sk,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:Di,href:"/observability"}];function fNn(){return o.jsxs(mk,{children:[o.jsx(mk.Top,{children:o.jsx(Ar,{withMargins:!1,children:o.jsx(Ar.Column,{children:o.jsxs(Ar.Title,{children:[o.jsx(Di,{})," 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:dNn.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 hNn=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:pa,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:Mi,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:Jw,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:vl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Pi,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:lc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:NE,href:"/request-context"}];function pNn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{children:[o.jsx(m2t,{})," 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:hNn.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 mNn(){const{paths:e}=ir(),{data:t,isLoading:r,error:n}=jwt(),{isCmsAvailable:s}=aM(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return n&&Ts(n)?o.jsx(qr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Ys,{})}):n&&ys(n)?o.jsx(qr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Us,{resource:"prompt blocks"})}):n?o.jsx(qr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(Ic,{title:"Failed to load prompt blocks",message:n.message})}):l.length===0&&!r?o.jsx(qr,{title:"Prompts",icon:o.jsx(Yi,{}),children:o.jsx(ySn,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(vn,{children:o.jsxs(vn.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(ge,{as:dr,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(cs,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Eg,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(vSn,{promptBlocks:l,isLoading:r,search:a})]})}function gNn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{children:[o.jsx(NE,{})," Request Context"]})})}),o.jsx(bt.MainArea,{children:o.jsx(Mxn,{children:o.jsx(iwt,{})})})]})}const vNn=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:NMt,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:va,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:Kle,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:oVe,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:OPt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function yNn(){return o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(vn,{children:o.jsxs(vn.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:vNn.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(va,{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 bNn(){const{data:e={},isLoading:t,error:r}=md(),[n,s]=b.useState(""),[a,i]=b.useState("all");if(r&&Ts(r))return o.jsx(qr,{title:"Scorers",icon:o.jsx(Ma,{}),children:o.jsx(Ys,{})});if(r&&ys(r))return o.jsx(qr,{title:"Scorers",icon:o.jsx(Ma,{}),children:o.jsx(Us,{resource:"scorers"})});if(r)return o.jsx(qr,{title:"Scorers",icon:o.jsx(Ma,{}),children:o.jsx(Ic,{title:"Failed to load scorers",message:r.message})});if(Object.keys(e).length===0&&!t)return o.jsx(qr,{title:"Scorers",icon:o.jsx(Ma,{}),children:o.jsx(G0n,{})});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(vn,{children:o.jsxs(vn.Title,{isLoading:t,children:[o.jsx(Ma,{})," 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(Y0n,{search:n,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(W0n,{scorers:e,isLoading:t,search:n,sourceFilter:a})]})}function xNn(){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}=q0n(e),{data:f={},isLoading:h,error:p}=Ng(),{isLoading:m,error:g}=o0(),{data:v=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_}=V0n({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(Y=>{const q=new URLSearchParams(Y);return q.set("entity",L.value),q})};b.useEffect(()=>{const L=t.get("scoreId")??void 0;if(L===s)return;if(!L){a(void 0);return}v.find(q=>q.id===L)&&a(L)},[t,v]);const R=b.useCallback(L=>{a(L||void 0),r(Y=>{const q=new URLSearchParams(Y);return L?q.set("scoreId",L):q.delete("scoreId"),q})},[r]);if(!c)return null;const z=Ts(d)||Ts(p)||Ts(g),D=d&&ys(d),U=!z&&!D&&(d||p||g),F=!x&&v.length===0,B=i?.value!=="all",H=o.jsxs(o.Fragment,{children:[o.jsxs(Za,{children:[o.jsx(Cr,{as:dr,to:"/scorers",children:"Scorers"}),o.jsx(H0n,{value:e,variant:"link"})]}),o.jsxs(bt.Row,{children:[o.jsxs(vn,{children:[o.jsxs(vn.Title,{isLoading:u,children:[o.jsx(Ma,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(vn.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(ge,{variant:"light",as:dr,to:`/cms/scorers/${e}/edit`,children:[o.jsx(dy,{})," Edit"]})]})]})]});if(z||D||U||F&&!B){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:z?o.jsx(Ys,{}):D?o.jsx(Us,{resource:"scorers"}):U?o.jsx(Ic,{title:"Failed to load scorer",message:L}):o.jsx(D0n,{})})]})}return o.jsxs(bt,{width:"wide",children:[o.jsxs(bt.TopArea,{children:[H,o.jsx(F0n,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{r(L=>{const Y=new URLSearchParams(L);return Y.set("entity","all"),Y})},isLoading:x||h||m})]}),o.jsx(M0n,{scores:v,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:k,setEndOfListElement:_,onScoreClick:R,errorMsg:w?.message})]})}const wNn=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],SNn=()=>{const{baseUrl:e,headers:t,apiPrefix:r}=Lve(),{theme:n,setTheme:s}=Qn(),[a,i]=b.useState(n),l=b.useRef(n);return b.useEffect(()=>{i(n),l.current=n},[n]),o.jsxs(bt,{width:"narrow",children:[o.jsx(bt.TopArea,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{children:[o.jsx(Qpe,{})," 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(idt,{name:"theme",label:"Theme mode",value:a,onValueChange:c=>{const u=c;l.current=u,i(u)},options:wNn.map(c=>({...c}))})]})}),o.jsx(cwt,{initialConfig:{baseUrl:e,headers:t,apiPrefix:r},onSave:()=>{s(l.current)}})]})]})};function ONn(){const[e]=ao(),t=mu(),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 kNn(e){return e.replace(/\/$/,"").split("/").pop()}function X8({children:e,className:t}){return o.jsx("div",{className:Z("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function _Nn({templates:e,linkComponent:t,className:r,isLoading:n}){const s=t||"a";return n?o.jsx("div",{className:Z("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:Z("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:Z("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:Z("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Z("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:Z("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:Z("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(pa,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(Pi,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(vVe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(oF,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(vl,{})," ",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:Z("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(iut,{})," ",kNn(a.githubUrl)]})})]},a.slug)})})}function ENn({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:Z("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:Z("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(Ex,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx(Lo,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx(Lo,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:n,onValueChange:a,options:r}),c&&o.jsxs(ge,{onClick:c,children:["Reset ",o.jsx(Nn,{})]})]})}function CNn(){const{data:e,isLoading:t}=D4r(),{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("")},v=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(Fr,{children:[o.jsx(En,{children:o.jsxs(Xu,{children:[o.jsx(je,{children:o.jsx(Ub,{})}),"Templates"]})}),o.jsxs("div",{className:Z("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(ENn,{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(_Nn,{templates:v,linkComponent:dr,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const jNn="1.28.0";function TNn({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(n2t,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(X8,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Z("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 NNn({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(X8,{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:Z("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(yVe,{})]}),o.jsx(Lo,{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:Z("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(Mt,{})," Loading variables..."]}):Object.entries(n).map(([h,p])=>o.jsxs(b.Fragment,{children:[o.jsx(_x,{name:`env-${h}`,labelIsHidden:!0,label:"Key",value:h,disabled:!0,className:"w-full"}),o.jsx(_x,{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(owt,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(ge,{className:Z("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(Mt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(yh,{})]})})]})})}function ANn({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:Z("grid mt-8 items-center"),children:o.jsxs("div",{className:Z("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(Ub,{}),o.jsx("h2",{className:Z({"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:Z("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:Z("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(qv,{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(nF,{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(iut,{}),r?.split("/")?.pop()]})]}),s&&o.jsx(pC,{data:s,labelsAreHidden:!0,isLoading:n})]})]})}function INn({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(X8,{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(QLr,{steps:p})}),i&&n==="error"&&o.jsxs("div",{className:Z("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(Z2t,{}),i||"Something went wrong"]}),c&&o.jsx(HLr,{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(Mt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function RNn({name:e,installedEntities:t}){return o.jsxs(X8,{className:Z("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(yVe,{}),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(pC,{data:t})]})}function PNn(){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,v]=b.useState(!1),[x,w]=b.useState(""),[S,k]=b.useState(!1),[_,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=L4r({repoOrSlug:e,owner:"mastra-ai"}),R=jNn?.includes("beta")??!1?"beta":"main",{data:z,isLoading:D}=$4r({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:U,isLoading:F}=F4r(),{mutateAsync:B,isPending:H}=z4r(),{mutateAsync:W}=B4r(),{streamInstall:L,streamResult:Y,isStreaming:q}=V4r(U),{observeInstall:M,streamResult:Q,isStreaming:G}=q4r(U);b.useEffect(()=>{const ae=t.get("runId");ae&&!g&&!p&&!q&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:ae}),w(ae),W({runId:ae}).then(le=>{const xe=le.snapshot;if(xe?.status==="success"&&xe?.result?.success)v(!0);else if(xe?.result?.success===!1)if(xe?.result?.validationResults&&!xe?.result?.validationResults?.valid&&xe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:he,errors:me}=xe.result.validationResults,ue=`Template installation completed but ${he} validation issue${he>1?"s":""} remain unresolved.`;m(ue),j(me||[])}else{const he=xe?.result?.message||xe?.result?.error||"Template installation failed";m(typeof he=="string"?he:String(he))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,p,q,G,W]),b.useEffect(()=>{const ae=t.get("runId"),le=t.get("resume"),xe=t.get("provider");if(ae&&le==="true"&&xe&&!q&&!G&&!S&&!_&&U){w(ae),k(!0);try{W({runId:ae}).then(fe=>{if(fe.snapshot?.status==="running")return M.mutateAsync({runId:ae})}).then(()=>{r(fe=>{const he=new URLSearchParams(fe);return he.delete("resume"),he})}).catch(fe=>{console.error("❌ Failed to resume template installation:",fe),fe.message?.includes("404")||fe.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(fe){console.error("❌ Auto-resume failed with error:",fe),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,q,G,S,_,U,W,M,r]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ne=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(ae=>ae).join(", "):"n/a",icon:o.jsx(Pi,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(ae=>ae).join(", "):"n/a",icon:o.jsx(pa,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(ae=>ae).join(", "):"n/a",icon:o.jsx(oF,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(gp,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(IE,{})}],ee=[{...ne[0]},{...ne[1]},{...ne[2]}].filter(ae=>ae.value!=="n/a");b.useEffect(()=>{z&&d(z)},[z]),b.useEffect(()=>{const ae=Y||Q;ae?.phase==="error"&&ae?.error&&m(typeof ae.error=="string"?ae.error:String(ae.error))},[Y?.phase,Y?.error,Q?.phase,Q?.error]);const re=ae=>{s(ae)},ie=async ae=>(i(ae.provider),c(ae.modelId),{message:"Model updated successfully"}),ce=async()=>{const ae=Object.entries(u).reduce((le,[xe,fe])=>(fe===""&&le.push(xe),le),[]);if(ae.length>0){h(ae);return}if(N){m(null),v(!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:fe}=await B({});w(fe),r(he=>{const me=new URLSearchParams(he);return me.set("runId",fe),me.set("resume","true"),me.set("provider",n||"openai"),me}),await L.mutateAsync({inputData:xe,selectedModel:{provider:a,modelId:l},runId:fe})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},K=ae=>{const{name:le,value:xe}=ae.target;xe.trim()===""?h(fe=>[...fe,le]):h(fe=>fe.filter(he=>he!==le)),d(fe=>({...fe,[le]:xe}))};return o.jsxs(Fr,{children:[o.jsx(En,{children:o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/templates",children:[o.jsx(je,{children:o.jsx(Ub,{})}),"Templates"]}),o.jsx(Cr,{as:dr,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Z("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(ANn,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ne,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(q||G)&&o.jsx(INn,{name:N.title,streamResult:G?Q:Y,runId:x,workflowInfo:U}),g&&o.jsx(RNn,{name:N.title,installedEntities:ee,linkComponent:dr}),p&&o.jsx(TNn,{errorMsg:p,validationErrors:T.length>0?T:Y?.validationResults?.errors||Q?.validationResults?.errors}),!q&&!G&&!g&&!p&&o.jsx(NNn,{providerOptions:J,selectedProvider:n,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:h,handleInstallTemplate:ce,handleVariableChange:K,isLoadingEnvVars:D||F,isInstalling:H,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const MNn=()=>{const{toolId:e,agentId:t}=na();return o.jsxs(Fr,{children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/agents",children:[o.jsx(je,{children:o.jsx(pa,{})}),"Agents"]}),o.jsx(Cr,{as:dr,to:`/agents/${t}/chat`,children:t}),o.jsx(Cr,{as:dr,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(je,{children:o.jsx(a0,{})}),"Tools documentation"]})})]}),o.jsx(Own,{toolId:e,agentId:t})]})},DNn=()=>{const{toolId:e}=na();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(En,{children:[o.jsxs(Za,{children:[o.jsxs(Cr,{as:dr,to:"/tools",children:[o.jsx(je,{children:o.jsx(Pi,{})}),"Tools"]}),o.jsx(Cr,{as:"span",to:"",isCurrent:!0,children:o.jsx(_Tn,{value:e,variant:"ghost"})})]}),o.jsx(vu,{children:o.jsxs(ge,{as:dr,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(a0,{}),"Tools documentation"]})})]}),o.jsx(kTn,{toolId:e})]})},LNn=async({client:e,page:t,perPage:r,filters:n})=>e.listTraces({pagination:{page:t,perPage:r},filters:n}),$Nn=25;function FNn(e,t,r){if(e?.pagination?.hasMore)return r+1}function zNn(e){const t=new Set,r=e.pages.flatMap(s=>s.spans??[]).filter(s=>t.has(s.traceId)?!1:(t.add(s.traceId),!0)),n={};for(const s of e.pages)s.threadTitles&&Object.assign(n,s.threadTitles);return{spans:r,threadTitles:n}}const BNn=({filters:e})=>{const t=Ge(),{inView:r,setRef:n}=w1(),s=i0({queryKey:["traces",e],queryFn:({pageParam:c})=>LNn({client:t,page:c,perPage:$Nn,filters:e}),initialPageParam:0,getNextPageParam:FNn,select:zNn,placeholderData:r4r,retry:!1,refetchInterval:c=>ys(c.state.error)?!1:3e3}),{hasNextPage:a,isFetchingNextPage:i,fetchNextPage:l}=s;return b.useEffect(()=>{r&&a&&!i&&l()},[r,a,i,l]),{...s,setEndOfListElement:n}};function UNn(e){const t=new Map,r=[];for(const s of e)if(s.threadId){const a=t.get(s.threadId);a?a.push(s):t.set(s.threadId,[s])}else r.push(s);const n=Array.from(t.entries()).map(([s,a])=>({threadId:s,traces:a}));return n.sort((s,a)=>{const i=Math.max(...s.traces.map(c=>new Date(c.createdAt).getTime()));return Math.max(...a.traces.map(c=>new Date(c.createdAt).getTime()))-i}),{groups:n,ungrouped:r}}function VNn(e,t=100){if(e==null)return"";const r=Array.isArray(e)?e:e&&typeof e=="object"&&!Array.isArray(e)&&Array.isArray(e.messages)?e.messages:null;if(r){const i=r.filter(l=>l?.role==="user").map(l=>typeof l.content=="string"?l.content:Array.isArray(l.content)?l.content.map(c=>typeof c=="string"?c:c?.type==="text"&&typeof c.text=="string"?c.text:"").filter(Boolean).join(" "):"").filter(Boolean).join(" | ");return i.length>t?i.slice(0,t)+"…":i}if(typeof e=="string")return e.length>t?e.slice(0,t)+"…":e;const n=JSON.stringify(e);return n.length>t?n.slice(0,t)+"…":n}function qNn(e){return e?.attributes?.finishReason==="length"}function HNn(e){const t=e?.attributes?.usage;if(!t)return"The model stopped generating because it reached the maximum token limit. The response was truncated and may be incomplete.";const r=t.inputTokens??0,n=t.outputTokens??0,s=t.totalTokens??r+n;return r>0||n>0?`The model stopped generating because it reached the maximum token limit. The response was truncated and may be incomplete.
556
556
 
557
557
  Token usage: ${r} input + ${n} output = ${s} total`:`The model stopped generating because it reached the maximum token limit (${s} tokens). The response was truncated and may be incomplete.`}const Sye=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},LBe="auto auto auto auto 1fr";function QNn({scoresData:e,isLoadingScoresData:t,onPageChange:r,onScoreSelect:n}){return t?o.jsx(N9,{columns:LBe}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(Lc,{columns:LBe,className:"min-w-0",children:[o.jsxs(Lc.Top,{children:[o.jsx(Lc.TopCell,{children:"ID"}),o.jsx(Lc.TopCell,{children:"Date"}),o.jsx(Lc.TopCell,{children:"Time"}),o.jsx(Lc.TopCell,{children:"Score"}),o.jsx(Lc.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=yy(a);return o.jsxs(Lc.RowButton,{onClick:()=>n?.(s),children:[o.jsx(Lc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:af(s?.id)||"n/a"}),o.jsx(Lc.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":ur(a,"MMM dd")}),o.jsx(Lc.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:ur(a,"h:mm:ss aaa")}),o.jsx(Lc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(Lc.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(Lc.NoMatch,{message:"No scores found"})]}),o.jsx(Lc.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 $Be(e){return typeof e=="object"&&e!==null}const WNn={text:"Text",cacheRead:"Cache Read",cacheWrite:"Cache Write",audio:"Audio",image:"Image",reasoning:"Reasoning"};function GNn({usage:e,className:t}){if(!e)return null;const r="inputTokens"in e,n={promptTokens:{label:"Prompt Tokens",icon:o.jsx(yh,{})},completionTokens:{label:"Completion Tokens",icon:o.jsx(sh,{})}},s={inputTokens:{label:"Input Tokens",icon:o.jsx(yh,{})},outputTokens:{label:"Output Tokens",icon:o.jsx(sh,{})},reasoningTokens:{label:"Reasoning Tokens",icon:o.jsx(sh,{})},cachedInputTokens:{label:"Cached Input Tokens",icon:o.jsx(sh,{})},inputDetails:{label:"Input Details",icon:o.jsx(yh,{})},outputDetails:{label:"Output Details",icon:o.jsx(sh,{})}},i={...{totalTokens:{label:"Total LLM Tokens",icon:o.jsx(lVe,{})}},...s,...n},l=r?["totalTokens","inputTokens","outputTokens","reasoningTokens","cachedInputTokens","inputDetails","outputDetails"]:["totalTokens","promptTokens","completionTokens"],c=Object.entries(e).filter(u=>{const d=u[1];return typeof d=="number"||$Be(d)}).map(([u,d])=>({key:u,value:d})).sort((u,d)=>l.indexOf(u.key)-l.indexOf(d.key));return o.jsx("div",{className:Z("flex gap-6 flex-wrap",t),children:c.map(({key:u,value:d})=>{const f=$Be(d);return o.jsxs("div",{className:"bg-surface3 p-3 px-4 rounded-lg text-ui-md grow",children:[o.jsxs("div",{className:Z("grid grid-cols-[1.5rem_1fr_auto] gap-2 items-center","[&>svg]:w-[1.5em] [&>svg]:h-[1.5em] [&>svg]:opacity-70"),children:[i?.[u]?.icon,o.jsx("span",{className:"text-ui-md",children:i?.[u]?.label}),!f&&o.jsx("b",{className:"text-ui-lg",children:d})]}),f&&o.jsx("div",{className:"text-ui-md mt-2 pl-8",children:Object.entries(d).map(([h,p])=>typeof p!="number"?null:o.jsxs("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 justify-between text-neutral3",children:[o.jsx("dt",{children:WNn[h]||h}),o.jsx("dd",{children:p})]},h))})]},u)})})}function $L(e,t,r){return o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center gap-1.5 text-neutral2 uppercase tracking-widest [&>svg]:size-3.5",children:[t,e]}),o.jsxs("span",{children:["› Span ",o.jsxs("b",{className:"text-neutral3",children:["#",r.spanId]})]}),o.jsxs("span",{children:["› Trace ",o.jsxs("b",{className:"text-neutral3",children:["#",r.traceId]})]})]})}function A1t({traceId:e,spanId:t,onClose:r,onPrevious:n,onNext:s,spanScoresData:a,onSpanScoresPageChange:i,isLoadingSpanScoresData:l,onScoreSelect:c,scorers:u,isLoadingScorers:d,activeTab:f,onTabChange:h}){const{data:p,isLoading:m}=OE(e,t),g=p?.span;return o.jsxs(As,{children:[o.jsxs(As.Header,{children:[o.jsxs(As.Heading,{children:["Span ",o.jsxs("b",{children:["# ",t]})]}),o.jsxs(ps,{className:"ml-auto shrink-0",children:[o.jsx(As.NextPrevNav,{onPrevious:n,onNext:s,previousLabel:"Previous span",nextLabel:"Next span"}),o.jsx(As.CloseButton,{onClick:r})]})]}),m?o.jsx(As.LoadingData,{children:"Loading span details..."}):g?o.jsx(ZNn,{span:g,traceId:e,spanId:t,spanScoresData:a,onSpanScoresPageChange:i,isLoadingSpanScoresData:l,onScoreSelect:c,scorers:u,isLoadingScorers:d,activeTab:f,onTabChange:h}):o.jsx(As.NoData,{children:"Span not found."})]})}function ZNn({span:e,traceId:t,spanId:r,spanScoresData:n,onSpanScoresPageChange:s,isLoadingSpanScoresData:a,onScoreSelect:i,scorers:l,isLoadingScorers:c,activeTab:u,onTabChange:d}){const f=e.startedAt&&e.endedAt?new Date(e.endedAt).getTime()-new Date(e.startedAt).getTime():null,h=e.attributes?.usage;return o.jsx(As.Content,{children:o.jsxs(Nf,{defaultTab:"details",value:u,onValueChange:d,children:[o.jsxs(Af,{children:[o.jsx(Ss,{value:"details",children:"Details"}),o.jsxs(Ss,{value:"scoring",children:["Scoring ",n?.pagination&&`(${n.pagination.total||0})`]})]}),o.jsxs(Ps,{value:"details",children:[qNn(e)&&o.jsxs(Ul,{variant:"warning",className:"mb-3",children:[o.jsx(Vl,{children:"Token Limit Exceeded"}),o.jsx(zu,{as:"p",children:HNn(e)})]}),h&&o.jsx(GNn,{usage:h,className:"mb-3"}),o.jsxs(On,{numOfCol:2,children:[e.name&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Name"}),o.jsx(On.Value,{className:"col-span-3",children:e.name})]}),e.spanType&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Type"}),o.jsx(On.Value,{children:e.spanType})]}),e.startedAt&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Started"}),o.jsx(On.Value,{children:ur(new Date(e.startedAt),"MMM dd, HH:mm:ss.SSS")})]}),e.endedAt&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Ended"}),o.jsx(On.Value,{children:ur(new Date(e.endedAt),"MMM dd, HH:mm:ss.SSS")})]}),f!=null&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Duration"}),o.jsx(On.Value,{children:f<1e3?`${f}ms`:`${(f/1e3).toFixed(2)}s`})]})]}),o.jsxs("div",{className:"grid gap-3 mt-3",children:[o.jsx(As.CodeSection,{title:"Input",dialogTitle:$L("Input",o.jsx(Np,{}),{spanId:r,traceId:t}),icon:o.jsx(Np,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(As.CodeSection,{title:"Output",dialogTitle:$L("Output",o.jsx(yc,{}),{spanId:r,traceId:t}),icon:o.jsx(yc,{}),codeStr:JSON.stringify(e.output??null,null,2)}),o.jsx(As.CodeSection,{title:"Metadata",dialogTitle:$L("Metadata",o.jsx(yl,{}),{spanId:r,traceId:t}),icon:o.jsx(yl,{}),codeStr:JSON.stringify(e.metadata??null,null,2)}),o.jsx(As.CodeSection,{title:"Attributes",dialogTitle:$L("Attributes",o.jsx(yl,{}),{spanId:r,traceId:t}),icon:o.jsx(yl,{}),codeStr:JSON.stringify(e.attributes??null,null,2)})]})]}),o.jsx(Ps,{value:"scoring",children:o.jsxs("div",{className:"grid gap-6",children:[o.jsx(HSt,{traceId:t,isTopLevelSpan:!e.parentSpanId,spanId:r,entityType:e.attributes?.agentId||e.entityType===wl.AGENT?"Agent":e.attributes?.workflowId||e.entityType===wl.WORKFLOW_RUN?"Workflow":void 0,scorers:l,isLoadingScorers:c}),o.jsx(QNn,{scoresData:n,onPageChange:s,isLoadingScoresData:a,onScoreSelect:i})]})})]})})}function I1t({rootSpan:e,numOfCol:t=2,className:r}){const n=e.startedAt?new Date(e.startedAt):null,s=e.endedAt?new Date(e.endedAt):null,a=Hkn(e),i=a===c_.ERROR?"ERROR":a===c_.RUNNING?"RUNNING":"SUCCESS";return o.jsxs(On,{numOfCol:t,className:r,children:[e.entityId&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Entity Id"}),o.jsx(On.Value,{children:e.entityName||e.entityId})]}),e.entityType&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Entity Type"}),o.jsx(On.Value,{children:e.entityType})]}),o.jsx(On.Key,{children:"Status"}),o.jsx(On.Value,{children:i}),n&&s&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Duration"}),o.jsx(On.Value,{children:`${(s.getTime()-n.getTime()).toLocaleString()}ms`})]}),n&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Started at"}),o.jsx(On.Value,{children:ur(n,"MMM dd, h:mm:ss.SSS aaa")})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx(On.Key,{children:"Ended at"}),o.jsx(On.Value,{children:ur(s,"MMM dd, h:mm:ss.SSS aaa")})]})]})}function YNn({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:r,isLoading:n,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:l,chartWidth:c="default"}){const u=e?.[0]?.latency||0,d=e?.[0]?.startTime||"",f=b.useMemo(()=>{const h=v=>{const x=new Set;for(const w of v){const S=w.type?.toLowerCase().split("_")[0];if(S&&x.add(S),w.spans)for(const k of h(w.spans))x.add(k)}return x},p=h(e),m=[...p].some(v=>!TBe.includes(v)),g=TBe.filter(v=>v!=="other"&&p.has(v));return m&&g.push("other"),g},[e]);return o.jsx(o.Fragment,{children:n?o.jsxs("div",{className:Z("flex items-center text-ui-sm gap-3 bg-surface3/50 rounded-md p-3 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Mt,{})," Loading Trace Timeline ..."]}):o.jsxs(o.Fragment,{children:[f.length>0&&o.jsx("div",{className:"flex flex-wrap gap-3 px-2 py-1.5 justify-end",children:f.map(h=>{const p=b1t(h);return o.jsxs("div",{className:"flex items-center gap-1 text-ui-sm text-neutral3",children:[o.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:p?.color}}),p?.label||h]},h)})}),o.jsx("div",{className:"grid grid-cols-[minmax(0,1fr)_auto_auto] items-start content-start gap-y-px overflow-hidden py-1",children:e?.map(h=>o.jsx(vye,{span:h,onSpanClick:t,selectedSpanId:r,overallLatency:u,overallStartTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i,chartWidth:c},h.id))})]})})}function R1t({traceId:e,onClose:t,onSpanSelect:r,onEvaluateTrace:n,initialSpanId:s,onPrevious:a,onNext:i,collapsed:l,onCollapsedChange:c,placement:u,timelineChartWidth:d="default"}){const f=u==="trace-page",[h,p]=b.useState(!1),m=l??h,g=c??p,v=b.useRef(null),{data:x,isLoading:w}=Y8(e),S=x?.spans,[k,_]=b.useState(s??void 0);b.useEffect(()=>{if(!s){_(void 0),r?.(void 0);return}if(!S)return;S.find(D=>D.spanId===s)?(_(s),r?.(s)):(_(void 0),r?.(void 0))},[s,S]),b.useEffect(()=>{if(!k||!v.current)return;v.current.querySelector(`[data-span-id="${k}"]`)?.scrollIntoView({block:"nearest"})},[k]);const E=b.useMemo(()=>Sye(S??[]),[S]),[T,j]=b.useState([]);b.useEffect(()=>{E.length>0&&j(Z8(E))},[E]);const N=b.useMemo(()=>S?.find(z=>z.parentSpanId==null),[S]),[I,P]=b.useState(!1),R=z=>{const D=k===z?void 0:z;_(D),r?.(D)};return o.jsxs(o.Fragment,{children:[o.jsxs(As,{collapsed:m,children:[o.jsx(As.Header,{children:f?o.jsx(As.Heading,{children:"Trace Timeline"}):o.jsxs(o.Fragment,{children:[o.jsxs(As.Heading,{children:["Trace ",o.jsxs("b",{children:["# ",Ih(e,12)]})]}),o.jsxs(ps,{className:"ml-auto shrink-0",children:[c&&o.jsx(Cn,{size:"md",tooltipContent:m?"Expand panel":"Collapse panel",onClick:()=>g(!m),children:m?o.jsx(JUe,{}):o.jsx(KUe,{})}),o.jsx(As.NextPrevNav,{onPrevious:a,onNext:i,previousLabel:"Previous trace",nextLabel:"Next trace"}),!f&&o.jsx(Cn,{as:o8,href:`/traces/${e}`,size:"md",tooltipContent:"Open trace page","aria-label":"Open trace page",children:o.jsx(hVe,{})}),o.jsx(As.CloseButton,{onClick:t})]})]})}),!m&&(w?o.jsx(As.LoadingData,{children:"Loading trace..."}):E.length===0?o.jsx(As.NoData,{children:"No spans found for this trace."}):o.jsxs(As.Content,{ref:v,children:[!f&&N&&o.jsx(I1t,{rootSpan:N,className:"mb-6"}),!f&&o.jsxs("div",{className:"mb-6 flex justify-between items-center gap-4",children:[n&&o.jsxs(ge,{size:"sm",onClick:n,children:[o.jsx(je,{children:o.jsx(tA,{})}),"Evaluate Trace"]}),o.jsxs(ge,{size:"sm",onClick:()=>P(!0),children:[o.jsx(je,{children:o.jsx(Sc,{})}),"Save as Dataset Item"]})]}),o.jsx(YNn,{hierarchicalSpans:E,onSpanClick:R,selectedSpanId:k,expandedSpanIds:T,setExpandedSpanIds:j,chartWidth:d})]}))]}),o.jsx(cye,{rootSpanId:N?.spanId,traceId:e,isOpen:I,onClose:()=>P(!1)})]})}const FBe="auto auto auto auto minmax(5rem,1fr) auto auto";function XNn({traces:e,isLoading:t,isFetchingNextPage:r,hasNextPage:n,setEndOfListElement:s,filtersApplied:a,selectedTraceId:i,initialSpanId:l,initialSpanTab:c,initialScoreId:u,onTraceClick:d,onSpanChange:f,onSpanTabChange:h,onScoreChange:p,groupByThread:m,threadTitles:g}){const[v,x]=b.useState(i??null),[w,S]=b.useState(l??null),[k,_]=b.useState(0),[E,T]=b.useState(),[j,N]=b.useState(c??"details"),[I,P]=b.useState(!1),{data:R,isLoading:z}=md(),{data:D,isLoading:U}=Qve({traceId:v??void 0,spanId:w??void 0,page:k});b.useEffect(()=>{x(i??null),i||(S(null),T(void 0),N("details"))},[i]),b.useEffect(()=>{S(l??null)},[l]),b.useEffect(()=>{c!==void 0&&N(c)},[c]),b.useEffect(()=>{if(u&&D?.scores&&!E){const me=D.scores.find(ue=>ue.id===u);me&&T(me)}},[u,D?.scores,E]);const F=b.useCallback(()=>{S(null),T(void 0),N("details")},[]),B=b.useCallback(me=>{const ue=me.traceId;if(v===ue){x(null),F(),d?.("");return}x(ue),F(),d?.(ue)},[v,d,F]),H=b.useCallback(()=>{x(null),F(),d?.("")},[d,F]),W=b.useCallback(me=>{const ue=me??null,Se=ue===w;S(ue),Se||(T(void 0),N("details"),ue&&f?.(ue))},[w,f]),L=b.useCallback(()=>{S(null),T(void 0),N("details"),f?.(null)},[f]),Y=b.useCallback(me=>{N(me),h?.(me)},[h]),q=b.useCallback(me=>{T(me),p?.(me.id)},[p]),M=b.useCallback(()=>{T(void 0),p?.(null)},[p]),Q=b.useMemo(()=>{const me=new Map;for(let ue=0;ue<e.length;ue++)me.set(e[ue].traceId,{trace:e[ue],idx:ue});return me},[e]),J=(v?Q.get(v):void 0)?.idx??-1,{data:ne}=Y8(v),ee=b.useMemo(()=>ne?.spans??[],[ne?.spans]),re=b.useCallback(()=>{const me=ee.find(ue=>ue.parentSpanId==null);me&&(S(me.spanId),N("scoring"),f?.(me.spanId),h?.("scoring"))},[ee,f,h]),ie=b.useMemo(()=>Z8(Sye(ee)),[ee]),ce=w?ie.indexOf(w):-1,K=ce>0?()=>{const me=ie[ce-1];S(me),f?.(me)}:void 0,ae=ce>=0&&ce<ie.length-1?()=>{const me=ie[ce+1];S(me),f?.(me)}:void 0,le=J>0?()=>{const me=e[J-1];x(me.traceId),F(),d?.(me.traceId)}:void 0,xe=J>=0&&J<e.length-1?()=>{const me=e[J+1];x(me.traceId),F(),d?.(me.traceId)}:void 0;if(t)return o.jsx(N9,{columns:FBe});const fe=!!v,he=me=>me.map(ue=>{const Se=ue.traceId===v,X=ue.startedAt??ue.createdAt,oe=ue.entityName||ue.entityId||ue.attributes?.agentId||ue.attributes?.workflowId;return o.jsxs(Ci.RowButton,{onClick:()=>B(ue),className:Z(Se&&"bg-surface4"),children:[o.jsx(Ci.IdCell,{traceId:ue.traceId}),o.jsx(Ci.DateCell,{timestamp:X}),o.jsx(Ci.TimeCell,{timestamp:X}),o.jsx(Ci.NameCell,{name:ue.name}),o.jsx(Ci.InputCell,{input:VNn(ue.input)}),o.jsx(Ci.EntityCell,{entityType:ue.entityType,entityName:oe}),o.jsx(Ci.StatusCell,{status:ue.attributes?.status})]},ue.traceId)});return o.jsxs("div",{className:Z("grid max-h-full min-h-0 gap-4 items-start ",fe?"grid-cols-[1fr_1fr]":"grid-cols-[1fr]"),children:[o.jsxs(Ci,{columns:FBe,className:"min-w-0",children:[o.jsxs(Ci.Top,{children:[o.jsx(Ci.TopCell,{children:"ID"}),o.jsx(Ci.TopCell,{children:"Date"}),o.jsx(Ci.TopCell,{children:"Time"}),o.jsx(Ci.TopCell,{children:"Name"}),o.jsx(Ci.TopCell,{children:"Input"}),o.jsx(Ci.TopCell,{children:"Entity"}),o.jsx(Ci.TopCell,{children:"Status"})]}),e.length===0?o.jsx(Ci.NoMatch,{message:a?"No traces found for applied filters":"No traces found yet"}):m?(()=>{const{groups:me,ungrouped:ue}=UNn(e);return o.jsxs(o.Fragment,{children:[me.map(Se=>o.jsxs(Te.Fragment,{children:[o.jsx(Ci.Subheader,{children:o.jsxs(Ci.SubHeading,{className:"flex gap-2",children:[o.jsx("span",{className:"uppercase",children:"Thread"}),g?.[Se.threadId]&&o.jsxs("b",{children:["'",g[Se.threadId],"'"]}),o.jsxs("b",{children:["# ",Se.threadId]}),o.jsxs("span",{className:"text-neutral2",children:["(",Se.traces.length,")"]})]})}),he(Se.traces)]},Se.threadId)),ue.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(Ci.Subheader,{children:o.jsxs(Ci.SubHeading,{className:"flex gap-2 uppercase",children:[o.jsx("span",{children:"No thread"}),o.jsxs("span",{className:"text-neutral2",children:["(",ue.length,")"]})]})}),he(ue)]})]})})():he(e),e.length>0&&o.jsx(Ci.NextPageLoading,{isLoading:r,hasMore:n,setEndOfListElement:s})]}),v&&o.jsxs("div",{className:Z("grid gap-4 max-h-full overflow-auto",E?I?"grid-rows-[auto_3fr_3fr]":"grid-rows-[2fr_3fr_3fr]":w?I?"grid-rows-[auto_3fr]":"grid-rows-[2fr_3fr]":I?"grid-rows-[auto]":"grid-rows-[1fr]"),children:[o.jsx(R1t,{traceId:v,onClose:H,onSpanSelect:W,onEvaluateTrace:re,initialSpanId:w,onPrevious:le,onNext:xe,collapsed:I,onCollapsedChange:P,placement:"traces-list"}),w&&o.jsx(A1t,{traceId:v,spanId:w,onClose:L,onPrevious:K,onNext:ae,scorers:R,isLoadingScorers:z,spanScoresData:D,isLoadingSpanScoresData:U,onSpanScoresPageChange:_,onScoreSelect:q,activeTab:j,onTabChange:Y}),E&&o.jsx(qve,{score:E,onClose:M})]})]})}function KNn({onClear:e,onRemoveAll:t,onSave:r,onRemoveSaved:n,isLoading:s,filterFields:a,filterTokens:i,onFilterTokensChange:l,autoFocusFilterFieldId:c}){const u=i.length>0,d=i.some(f=>JNn(f,a));return o.jsxs("div",{className:Z("grid grid-cols-[1fr_auto] gap-3 items-start "),children:[o.jsx(Gut,{fields:a,tokens:i,onTokensChange:l,disabled:s,autoFocusFieldId:c}),u&&o.jsx(qut,{disabled:s,onClear:d?e:void 0,onRemoveAll:t,onSave:r,onRemoveSaved:n})]})}function JNn(e,t){const r=t.find(n=>n.id===e.fieldId);return r?r.kind==="text"?typeof e.value=="string"&&e.value.trim()!=="":r.kind==="pick-multi"?r.multi?Array.isArray(e.value)&&e.value.length>0:typeof e.value=="string"&&e.value!==""&&e.value!=="Any":r.kind==="multi-select"?Array.isArray(e.value)&&e.value.length>0:!1:!1}const V$="traceId",JO="spanId",ek="tab",uw="scoreId",kT=1440*60*1e3,eAn={"last-24h":kT,"last-3d":3*kT,"last-7d":7*kT,"last-14d":14*kT,"last-30d":30*kT};function _T(e){e.delete(V$),e.delete(JO),e.delete(ek),e.delete(uw)}function tAn(){const[e,t]=ao(),[r,n]=b.useState(!1),[s,a]=b.useState(),i=b.useMemo(()=>{const ue=e.get(Pw);return ue&&aTn.has(ue)?ue:"last-24h"},[e]),l=e.get(Mw),c=e.get(Dw),u=b.useMemo(()=>{if(i==="custom"){if(!l)return;const Se=new Date(l);return Number.isNaN(Se.getTime())?void 0:Se}if(i==="all")return;const ue=eAn[i];return ue?new Date(Date.now()-ue):void 0},[i,l]),d=b.useMemo(()=>{if(i!=="custom"||!c)return;const ue=new Date(c);return Number.isNaN(ue.getTime())?void 0:ue},[i,c]),f=b.useRef(i);f.current=i;const h=e.get(V$)||void 0,p=e.get(JO)||void 0,m=e.get(ek),g=m==="scoring"?"scoring":m==="details"?"details":void 0,v=e.get(uw)||void 0,x=b.useMemo(()=>xye.find(ue=>ue.entityType===e.get($x)),[e]),w=b.useMemo(()=>{const ue=e.get(Fx);return ue&&iTn.has(ue)?ue:void 0},[e]),S=b.useMemo(()=>dTn(e),[e]),{data:k=[],isPending:_}=k1t(),{data:E=[],isPending:T}=w1t({entityType:x?.entityType,rootOnly:!0}),{data:j=[],isPending:N}=S1t(),{data:I=[],isPending:P}=O1t(),R=b.useMemo(()=>uTn({availableTags:k,availableRootEntityNames:E,availableServiceNames:I,availableEnvironments:j,loading:{tags:_,entityNames:T,serviceNames:P,environments:N}}),[k,E,I,j,_,T,P,N]),z=b.useMemo(()=>hTn({rootEntityType:x?.entityType,status:w,dateFrom:u,dateTo:d,tokens:S}),[S,u,d,x,w]),{data:D,isLoading:U,isFetchingNextPage:F,hasNextPage:B,setEndOfListElement:H,error:W,isError:L}=BNn({filters:z}),Y=b.useMemo(()=>D?.spans??[],[D?.spans]),q=D?.threadTitles??{},M=b.useCallback(ue=>{t(Se=>{const X=new URLSearchParams(Se);return ue?X.set(V$,ue):X.delete(V$),X.delete(JO),X.delete(ek),X.delete(uw),X},{replace:!0})},[t]),Q=b.useCallback(ue=>{const Se=e.get(JO)||null;ue!==Se&&t(X=>{const oe=new URLSearchParams(X);return ue?oe.set(JO,ue):oe.delete(JO),oe},{replace:!0})},[e,t]),G=b.useCallback(ue=>{const Se=e.get(ek)||null;ue!==Se&&t(X=>{const oe=new URLSearchParams(X);return ue&&ue!=="details"?oe.set(ek,ue):oe.delete(ek),oe.delete(uw),oe},{replace:!0})},[e,t]),J=b.useCallback(ue=>{const Se=e.get(uw)||null;ue!==Se&&t(X=>{const oe=new URLSearchParams(X);return ue?oe.set(uw,ue):oe.delete(uw),oe},{replace:!0})},[e,t]),ne=b.useCallback(ue=>{t(Se=>{const X=new URLSearchParams(Se);return MBe(X,ue),_T(X),X},{replace:!0})},[t]),ee=b.useCallback((ue,Se)=>{if(f.current!=="custom")return;const X=Se==="from"?Mw:Dw;t(oe=>{const we=new URLSearchParams(oe);return ue?we.set(X,ue.toISOString()):we.delete(X),_T(we),we},{replace:!0})},[t]),re=b.useCallback(ue=>{f.current=ue,t(Se=>{const X=new URLSearchParams(Se);return ue==="last-24h"?(X.delete(Pw),X.delete(Mw),X.delete(Dw)):ue==="custom"?X.set(Pw,"custom"):(X.set(Pw,ue),X.delete(Mw),X.delete(Dw)),_T(X),X},{replace:!0})},[t]),[ie,ce]=b.useState(()=>PBe()!==null),K=b.useCallback(()=>{oTn(e),ce(!0),ze.success("Filters setting for Traces saved")},[e]),ae=b.useCallback(()=>{lTn(),ce(!1),ze.success("Filters setting for Traces cleared up")},[]),le=b.useRef(!1);b.useEffect(()=>{if(le.current||(le.current=!0,cTn(e)))return;const ue=PBe();ue&&t(Se=>{const X=new URLSearchParams(Se);for(const[oe,we]of ue)X.append(oe,we);return X},{replace:!0})},[]);const xe=b.useCallback(()=>{t(ue=>{const Se=new URLSearchParams(ue);Se.delete($x),Se.delete(Fx);for(const X of uM)Se.delete(ZS[X]);return _T(Se),Se},{replace:!0}),n(!1)},[t]),fe=b.useCallback(()=>{const ue=S.map(Se=>{const X=R.find(oe=>oe.id===Se.fieldId);return X?X.kind==="text"?{fieldId:Se.fieldId,value:""}:X.kind==="pick-multi"?X.multi?{fieldId:Se.fieldId,value:[]}:{fieldId:Se.fieldId,value:"Any"}:Se:Se});t(Se=>{const X=new URLSearchParams(Se);return MBe(X,ue),_T(X),X},{replace:!0})},[R,S,t]),he=L?Qdt(W):void 0;if(W&&Ts(W))return o.jsx(qr,{title:"Traces",icon:o.jsx(Di,{}),children:o.jsx(Ys,{})});if(W&&ys(W))return o.jsx(qr,{title:"Traces",icon:o.jsx(Di,{}),children:o.jsx(Us,{resource:"traces"})});if(W)return o.jsx(qr,{title:"Traces",icon:o.jsx(Di,{}),children:o.jsx(Ic,{title:"Failed to load traces",message:he?.error??"Unknown error"})});const me=!!x||!!w||S.length>0||i!=="last-24h"||!!d;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(vn,{children:o.jsxs(vn.Title,{isLoading:U,children:[o.jsx(Di,{})," Traces"]})})}),o.jsxs(bt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(Hdt,{preset:i,onPresetChange:re,dateFrom:u,dateTo:d,onDateChange:ee,disabled:U,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(Zut,{fields:R,tokens:S,onTokensChange:ne,disabled:U,onStartTextFilter:a}),o.jsx(Cn,{disabled:U,"aria-pressed":r,"aria-label":r?"Ungroup traces":"Group traces by thread",tooltipContent:r?"Ungroup traces":"Group traces by thread",onClick:()=>n(ue=>!ue),children:r?o.jsx(c3,{}):o.jsx(pVe,{})}),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(KNn,{isLoading:U,filterFields:R,filterTokens:S,onFilterTokensChange:ne,onClear:fe,onRemoveAll:xe,onSave:K,onRemoveSaved:ie?ae:void 0,autoFocusFilterFieldId:s})]}),o.jsx(XNn,{traces:Y,isLoading:U,isFetchingNextPage:F,hasNextPage:B,setEndOfListElement:H,filtersApplied:me,selectedTraceId:h,initialSpanId:p,initialSpanTab:g,initialScoreId:v,onTraceClick:M,onSpanChange:Q,onSpanTabChange:G,onScoreChange:J,groupByThread:r,threadTitles:q})]})}function rAn(){const{traceId:e}=na(),[t,r]=ao(),n=mu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":"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),[v,x]=b.useState(!1),{data:w,isLoading:S,error:k,isError:_}=Y8(e),E=b.useMemo(()=>w?.spans??[],[w?.spans]),T=b.useMemo(()=>E.find(ie=>ie.parentSpanId==null),[E]),j=b.useMemo(()=>Z8(Sye(E)),[E]),{data:N,isLoading:I}=md(),{data:P,isLoading:R}=Qve({traceId:e,spanId:c??void 0,page:m});b.useEffect(()=>{if(l&&P?.scores&&!d){const ie=P.scores.find(ce=>ce.id===l);ie&&f(ie)}},[l,P?.scores,d]);const z=b.useCallback(ie=>{const ce=new URLSearchParams(t);for(const[K,ae]of Object.entries(ie))ae===null||ae===""?ce.delete(K):ce.set(K,ae);r(ce,{replace:!0})},[t,r]),D=b.useCallback(ie=>{const ce=ie??null,K=ce===c;u(ce),K||(f(void 0),p("details"),z({spanId:ce,tab:null,scoreId:null}))},[c,z]),U=b.useCallback(()=>{u(null),f(void 0),p("details"),z({spanId:null,tab:null,scoreId:null})},[z]),F=c?j.indexOf(c):-1,B=b.useCallback(ie=>{u(ie),f(void 0),p("details"),z({spanId:ie,tab:null,scoreId:null})},[z]),H=F>0?()=>B(j[F-1]):void 0,W=F>=0&&F<j.length-1?()=>B(j[F+1]):void 0,L=b.useCallback(ie=>{const ce=ie;p(ce),f(void 0),z({tab:ce==="details"?null:ce,scoreId:null})},[z]),Y=b.useCallback(ie=>{f(ie),z({scoreId:ie.id})},[z]),q=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),M=b.useCallback(()=>{n("/observability")},[n]),Q=b.useCallback(()=>{p("scoring"),T&&c!==T.spanId?(u(T.spanId),f(void 0),z({spanId:T.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[T,c,z]),G=b.useMemo(()=>_?Qdt(k):void 0,[_,k]),J=!!k&&Ts(k),ne=!!k&&ys(k),ee=!!k&&!J&&!ne,re=o.jsxs(o.Fragment,{children:[o.jsxs(ge,{as:o8,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(Tp,{}),"Back to Traces"]}),o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{isLoading:S,children:[o.jsx(Di,{})," 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,{})}),T&&o.jsxs(o.Fragment,{children:[o.jsxs(Cn,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:Q,children:[o.jsx(tA,{}),"Evaluate"]}),o.jsxs(Cn,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(Sc,{}),"Save"]})]})]})})]}),T&&o.jsx(bt.Row,{children:o.jsx(bt.Column,{children:o.jsx(I1t,{rootSpan:T,numOfCol:3})})})]});return J||ne||ee?o.jsxs(bt,{height:"full",children:[o.jsx(bt.TopArea,{children:re}),o.jsx(bt.MainArea,{isCentered:!0,children:J?o.jsx(Ys,{}):ne?o.jsx(Us,{resource:"traces"}):o.jsx(Ic,{title:"Failed to load trace",message:G?.error??"Unknown error"})})]}):o.jsxs(bt,{children:[o.jsx(bt.TopArea,{children:re}),o.jsx(cye,{rootSpanId:T?.spanId,traceId:e,isOpen:v,onClose:()=>x(!1)}),o.jsxs("div",{className:Z("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(R1t,{traceId:e,onClose:M,onSpanSelect:D,onEvaluateTrace:Q,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Z("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(A1t,{traceId:e,spanId:c,onClose:U,onPrevious:H,onNext:W,scorers:N,isLoadingScorers:I,spanScoresData:P,isLoadingSpanScoresData:R,onSpanScoresPageChange:g,onScoreSelect:Y,activeTab:h,onTabChange:L}),d&&o.jsx(qve,{score:d,onClose:q})]})]})]})}function nAn(){const{data:e,isLoading:t,error:r}=o0(),[n,s]=b.useState("");return r&&Ts(r)?o.jsx(qr,{title:"Workflows",icon:o.jsx(Mi,{}),children:o.jsx(Ys,{})}):r&&ys(r)?o.jsx(qr,{title:"Workflows",icon:o.jsx(Mi,{}),children:o.jsx(Us,{resource:"workflows"})}):r?o.jsx(qr,{title:"Workflows",icon:o.jsx(Mi,{}),children:o.jsx(Ic,{title:"Failed to load workflows",message:r.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(qr,{title:"Workflows",icon:o.jsx(Mi,{}),children:o.jsx(Zun,{})}):o.jsxs(bt,{children:[o.jsxs(bt.TopArea,{children:[o.jsxs(bt.Row,{children:[o.jsx(bt.Column,{children:o.jsx(vn,{children:o.jsxs(vn.Title,{isLoading:t,children:[o.jsx(Mi,{})," 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(Eg,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(Gun,{workflows:e||{},isLoading:t,search:n})]})}const zBe=()=>{const{workflowId:e}=na(),{data:t,isLoading:r,error:n}=DP(e);return n&&Ts(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ys,{})}):n&&ys(n)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Us,{resource:"workflows"})}):o.jsx(g0t,{workflowId:e,workflow:t??void 0,isLoading:r})};function sAn(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(lut,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(out,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(cut,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(uU,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Are,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(ja,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(lc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Are,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(uU,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(uU,{className:"h-4 w-4 text-neutral4"})}}function P1t(e,t=!1){const{name:r,type:n,mount:s}=e;if(n==="directory")return s?sAn(s):t?o.jsx(TE,{className:"h-4 w-4 text-amber-400"}):o.jsx(lc,{className:"h-4 w-4 text-amber-400"});switch(r.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(fx,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(SR,{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(Xle,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(Zle,{className:"h-4 w-4 text-neutral4"})}}function M1t(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+M1t(-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 aAn(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 D1t(e){return e==="."||e===""}function iAn({path:e,onNavigate:t}){const n=D1t(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(TE,{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(qs,{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 oAn({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=D1t(t),v=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(iAn,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(ge,{variant:"ghost",size:"md",onClick:i,disabled:r,"aria-label":"Refresh files",children:o.jsx(OR,{className:`h-4 w-4 ${r?"animate-spin":""}`})}),c&&o.jsx(ge,{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(Ta,{className:"h-4 w-4 animate-spin"}):o.jsx(rF,{className:"h-4 w-4"})}),l&&o.jsx(ge,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(iF,{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(Ta,{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(eA,{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:aAn(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(dd,{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(TE,{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:()=>v(w),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[P1t(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(eA,{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:M1t(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(id,{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(Ta,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function lAn(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 cAn({content:e,language:t}){return o.jsx(Ive,{language:t,style:Rve.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function uAn({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=lAn(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:[P1t({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(Xa,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(ge,{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(Ta,{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(cAn,{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 dAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(ad,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),fAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(pMt,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),hAn=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Ka,{iconSlot:o.jsx(eA,{}),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(ge,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(va,{})]})})}),Kte={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(g_,{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(KDt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function L1t(e){return e.id.replace(/#chunk-\d+$/,"")}function pAn({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(AE,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(sr,{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(sr,{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(ge,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Ta,{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 v=Kte[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>h(g),className:`
558
558
  inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-xs font-medium border transition-colors