@mastra/deployer-cloud 1.32.1-alpha.0 → 1.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/studio/assets/{index-iBM5gI8m.js → index-0ZhaJMzn.js} +1 -1
- package/dist/studio/assets/{index-Dju3G_Nj.js → index-B818jJF8.js} +1 -1
- package/dist/studio/assets/{index-DesNrfeV.js → index-BRnbZ_zY.js} +1 -1
- package/dist/studio/assets/{index-BotJ7ssY.js → index-BUA1uxDU.js} +1 -1
- package/dist/studio/assets/{index-CXSn9hCL.js → index-B_OqxYGM.js} +1 -1
- package/dist/studio/assets/{index-D8yiz0d7.js → index-BcbyRcdO.js} +1 -1
- package/dist/studio/assets/{index-C7nciVvt.js → index-Bd3KOA-e.js} +1 -1
- package/dist/studio/assets/{index-CaWqs6po.js → index-Btqfk5yp.js} +1 -1
- package/dist/studio/assets/{index-DFqSsR_9.js → index-C2OqAplM.js} +1 -1
- package/dist/studio/assets/{index-ChQXWFo6.js → index-C4t9LjwW.js} +1 -1
- package/dist/studio/assets/{index-B1XO30jB.js → index-DE1Uf-DZ.js} +1 -1
- package/dist/studio/assets/{index-CKJz4ksW.js → index-DHBy70un.js} +1 -1
- package/dist/studio/assets/{index-08vwibD7.js → index-DT-bmX_c.js} +1 -1
- package/dist/studio/assets/{index-C2aPX93u.js → index-DU3FtUyc.js} +1 -1
- package/dist/studio/assets/{index-BZ5mhtuX.js → index-J2K1uPqD.js} +1 -1
- package/dist/studio/assets/{index-CKunvpxP.js → index-aMP3lwxt.js} +1 -1
- package/dist/studio/assets/{index-DihrLdtI.js → index-bWOYDAHF.js} +1 -1
- package/dist/studio/assets/{index-BlK8TA7O.js → index-hTIM_Qvg.js} +1 -1
- package/dist/studio/assets/{main-C0pNFRxv.js → main-CP6EB5Ig.js} +5 -5
- package/dist/studio/index.html +1 -1
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{_ as tt}from"./index-BlK8TA7O.js";function MQe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var z5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oZ={exports:{}},tN={};var nCe;function QLt(){if(nCe)return tN;nCe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,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:r,key:i,ref:s!==void 0?s:null,props:a}}return tN.Fragment=t,tN.jsx=n,tN.jsxs=n,tN}var rCe;function GLt(){return rCe||(rCe=1,oZ.exports=QLt()),oZ.exports}var o=GLt(),lZ={exports:{}},Tr={},sCe;function YLt(){if(sCe)return Tr;sCe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=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"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=h&&V[h]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,x={};function w(V,$,W){this.props=V,this.context=$,this.refs=x,this.updater=W||g}w.prototype.isReactComponent={},w.prototype.setState=function(V,$){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,$,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=w.prototype;function _(V,$,W){this.props=V,this.context=$,this.refs=x,this.updater=W||g}var O=_.prototype=new S;O.constructor=_,v(O,w.prototype),O.isPureReactComponent=!0;var E=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(V,$,W){var Q=W.ref;return{$$typeof:t,type:V,key:$,ref:Q!==void 0?Q:null,props:W}}function P(V,$){return I(V.type,$,V.props)}function R(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var $={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return $[W]})}var M=/\/+/g;function L(V,$){return typeof V=="object"&&V!==null&&V.key!=null?B(""+V.key):$.toString(36)}function U(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(T,T):(V.status="pending",V.then(function($){V.status==="pending"&&(V.status="fulfilled",V.value=$)},function($){V.status==="pending"&&(V.status="rejected",V.reason=$)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,$,W,Q,J){var ae=typeof V;(ae==="undefined"||ae==="boolean")&&(V=null);var te=!1;if(V===null)te=!0;else switch(ae){case"bigint":case"string":case"number":te=!0;break;case"object":switch(V.$$typeof){case t:case n:te=!0;break;case f:return te=V._init,z(te(V._payload),$,W,Q,J)}}if(te)return J=J(V),te=Q===""?"."+L(V,0):Q,E(J)?(W="",te!=null&&(W=te.replace(M,"$&/")+"/"),z(J,$,W,"",function(pe){return pe})):J!=null&&(R(J)&&(J=P(J,W+(J.key==null||V&&V.key===J.key?"":(""+J.key).replace(M,"$&/")+"/")+te)),$.push(J)),1;te=0;var re=Q===""?".":Q+":";if(E(V))for(var ie=0;ie<V.length;ie++)Q=V[ie],ae=re+L(Q,ie),te+=z(Q,$,W,ae,J);else if(ie=m(V),typeof ie=="function")for(V=ie.call(V),ie=0;!(Q=V.next()).done;)Q=Q.value,ae=re+L(Q,ie++),te+=z(Q,$,W,ae,J);else if(ae==="object"){if(typeof V.then=="function")return z(U(V),$,W,Q,J);throw $=String(V),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return te}function q(V,$,W){if(V==null)return V;var Q=[],J=0;return z(V,Q,"","",function(ae){return $.call(W,ae,J++)}),Q}function Z(V){if(V._status===-1){var $=V._result;$=$(),$.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=$)}if(V._status===1)return V._result.default;throw V._result}var D=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent($))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},G={map:q,forEach:function(V,$,W){q(V,function(){$.apply(this,arguments)},W)},count:function(V){var $=0;return q(V,function(){$++}),$},toArray:function(V){return q(V,function($){return $})||[]},only:function(V){if(!R(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return Tr.Activity=p,Tr.Children=G,Tr.Component=w,Tr.Fragment=r,Tr.Profiler=a,Tr.PureComponent=_,Tr.StrictMode=s,Tr.Suspense=u,Tr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Tr.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},Tr.cache=function(V){return function(){return V.apply(null,arguments)}},Tr.cacheSignal=function(){return null},Tr.cloneElement=function(V,$,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var Q=v({},V.props),J=V.key;if($!=null)for(ae in $.key!==void 0&&(J=""+$.key),$)!N.call($,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&$.ref===void 0||(Q[ae]=$[ae]);var ae=arguments.length-2;if(ae===1)Q.children=W;else if(1<ae){for(var te=Array(ae),re=0;re<ae;re++)te[re]=arguments[re+2];Q.children=te}return I(V.type,J,Q)},Tr.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},Tr.createElement=function(V,$,W){var Q,J={},ae=null;if($!=null)for(Q in $.key!==void 0&&(ae=""+$.key),$)N.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(J[Q]=$[Q]);var te=arguments.length-2;if(te===1)J.children=W;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];J.children=re}if(V&&V.defaultProps)for(Q in te=V.defaultProps,te)J[Q]===void 0&&(J[Q]=te[Q]);return I(V,ae,J)},Tr.createRef=function(){return{current:null}},Tr.forwardRef=function(V){return{$$typeof:c,render:V}},Tr.isValidElement=R,Tr.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Z}},Tr.memo=function(V,$){return{$$typeof:d,type:V,compare:$===void 0?null:$}},Tr.startTransition=function(V){var $=j.T,W={};j.T=W;try{var Q=V(),J=j.S;J!==null&&J(W,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(T,D)}catch(ae){D(ae)}finally{$!==null&&W.types!==null&&($.types=W.types),j.T=$}},Tr.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Tr.use=function(V){return j.H.use(V)},Tr.useActionState=function(V,$,W){return j.H.useActionState(V,$,W)},Tr.useCallback=function(V,$){return j.H.useCallback(V,$)},Tr.useContext=function(V){return j.H.useContext(V)},Tr.useDebugValue=function(){},Tr.useDeferredValue=function(V,$){return j.H.useDeferredValue(V,$)},Tr.useEffect=function(V,$){return j.H.useEffect(V,$)},Tr.useEffectEvent=function(V){return j.H.useEffectEvent(V)},Tr.useId=function(){return j.H.useId()},Tr.useImperativeHandle=function(V,$,W){return j.H.useImperativeHandle(V,$,W)},Tr.useInsertionEffect=function(V,$){return j.H.useInsertionEffect(V,$)},Tr.useLayoutEffect=function(V,$){return j.H.useLayoutEffect(V,$)},Tr.useMemo=function(V,$){return j.H.useMemo(V,$)},Tr.useOptimistic=function(V,$){return j.H.useOptimistic(V,$)},Tr.useReducer=function(V,$,W){return j.H.useReducer(V,$,W)},Tr.useRef=function(V){return j.H.useRef(V)},Tr.useState=function(V){return j.H.useState(V)},Tr.useSyncExternalStore=function(V,$,W){return j.H.useSyncExternalStore(V,$,W)},Tr.useTransition=function(){return j.H.useTransition()},Tr.version="19.2.5",Tr}var aCe;function oj(){return aCe||(aCe=1,lZ.exports=YLt()),lZ.exports}var b=oj();const Te=xl(b),gk=MQe({__proto__:null,default:Te},[b]);var cZ={exports:{}},nN={},uZ={exports:{}},dZ={};var iCe;function XLt(){return iCe||(iCe=1,(function(e){function t(U,z){var q=U.length;U.push(z);e:for(;0<q;){var Z=q-1>>>1,D=U[Z];if(0<s(D,z))U[Z]=z,U[q]=D,q=Z;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var z=U[0],q=U.pop();if(q!==z){U[0]=q;e:for(var Z=0,D=U.length,G=D>>>1;Z<G;){var V=2*(Z+1)-1,$=U[V],W=V+1,Q=U[W];if(0>s($,q))W<D&&0>s(Q,$)?(U[Z]=Q,U[W]=q,Z=W):(U[Z]=$,U[V]=q,Z=V);else if(W<D&&0>s(Q,q))U[Z]=Q,U[W]=q,Z=W;else break e}}return z}function s(U,z){var q=U.sortIndex-z.sortIndex;return q!==0?q:U.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,p=3,h=!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 _(U){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=U)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function O(U){if(g=!1,_(U),!m)if(n(c)!==null)m=!0,E||(E=!0,R());else{var z=n(u);z!==null&&L(O,z.startTime-U)}}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 U=e.unstable_now();N=U;var z=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),h=!0;var q=p;try{t:{for(_(U),f=n(c);f!==null&&!(f.expirationTime>U&&I());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,p=f.priorityLevel;var D=Z(f.expirationTime<=U);if(U=e.unstable_now(),typeof D=="function"){f.callback=D,_(U),z=!0;break t}f===n(c)&&r(c),_(U)}else r(c);f=n(c)}if(f!==null)z=!0;else{var G=n(u);G!==null&&L(O,G.startTime-U),z=!1}}break e}finally{f=null,p=q,h=!1}z=void 0}}finally{z?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=P,R=function(){M.postMessage(null)}}else R=function(){x(P,0)};function L(U,z){T=x(function(){U(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(U){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var q=p;p=z;try{return U()}finally{p=q}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var q=p;p=U;try{return z()}finally{p=q}},e.unstable_scheduleCallback=function(U,z,q){var Z=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?Z+q:Z):q=Z,U){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=q+D,U={id:d++,callback:z,priorityLevel:U,startTime:q,expirationTime:D,sortIndex:-1},q>Z?(U.sortIndex=q,t(u,U),n(c)===null&&U===n(u)&&(g?(w(T),T=-1):g=!0,L(O,q-Z))):(U.sortIndex=D,t(c,U),m||h||(m=!0,E||(E=!0,R()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var z=p;return function(){var q=p;p=z;try{return U.apply(this,arguments)}finally{p=q}}}})(dZ)),dZ}var oCe;function KLt(){return oCe||(oCe=1,uZ.exports=XLt()),uZ.exports}var fZ={exports:{}},Pc={};var lCe;function JLt(){if(lCe)return Pc;lCe=1;var e=oj();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 n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},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 Pc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Pc.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)},Pc.flushSync=function(c){var u=i.T,d=r.p;try{if(i.T=null,r.p=2,c)return c()}finally{i.T=u,r.p=d,r.d.f()}},Pc.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},Pc.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Pc.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:h}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:p,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Pc.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);r.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&&r.d.M(c)},Pc.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);r.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})}},Pc.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);r.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 r.d.m(c)},Pc.requestFormReset=function(c){r.d.r(c)},Pc.unstable_batchedUpdates=function(c,u){return c(u)},Pc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Pc.useFormStatus=function(){return i.H.useHostTransitionStatus()},Pc.version="19.2.5",Pc}var cCe;function DQe(){if(cCe)return fZ.exports;cCe=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(),fZ.exports=JLt(),fZ.exports}var uCe;function e4t(){if(uCe)return nN;uCe=1;var e={env:{}};var t=KLt(),n=oj(),r=DQe();function s(y){var k="https://react.dev/errors/"+y;if(1<arguments.length){k+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)k+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+y+"; visit "+k+" 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 k=y,C=y;if(y.alternate)for(;k.return;)k=k.return;else{y=k;do k=y,(k.flags&4098)!==0&&(C=k.return),y=k.return;while(y)}return k.tag===3?C:null}function l(y){if(y.tag===13){var k=y.memoizedState;if(k===null&&(y=y.alternate,y!==null&&(k=y.memoizedState)),k!==null)return k.dehydrated}return null}function c(y){if(y.tag===31){var k=y.memoizedState;if(k===null&&(y=y.alternate,y!==null&&(k=y.memoizedState)),k!==null)return k.dehydrated}return null}function u(y){if(i(y)!==y)throw Error(s(188))}function d(y){var k=y.alternate;if(!k){if(k=i(y),k===null)throw Error(s(188));return k!==y?null:y}for(var C=y,A=k;;){var F=C.return;if(F===null)break;var H=F.alternate;if(H===null){if(A=F.return,A!==null){C=A;continue}break}if(F.child===H.child){for(H=F.child;H;){if(H===C)return u(F),y;if(H===A)return u(F),k;H=H.sibling}throw Error(s(188))}if(C.return!==A.return)C=F,A=H;else{for(var ee=!1,fe=F.child;fe;){if(fe===C){ee=!0,C=F,A=H;break}if(fe===A){ee=!0,A=F,C=H;break}fe=fe.sibling}if(!ee){for(fe=H.child;fe;){if(fe===C){ee=!0,C=H,A=F;break}if(fe===A){ee=!0,A=H,C=F;break}fe=fe.sibling}if(!ee)throw Error(s(189))}}if(C.alternate!==A)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?y:k}function f(y){var k=y.tag;if(k===5||k===26||k===27||k===6)return y;for(y=y.child;y!==null;){if(k=f(y),k!==null)return k;y=y.sibling}return null}var p=Object.assign,h=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"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(y){return y===null||typeof y!="object"?null:(y=R&&y[R]||y["@@iterator"],typeof y=="function"?y:null)}var M=Symbol.for("react.client.reference");function L(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===M?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 _:return y.displayName||"Context";case S:return(y._context.displayName||"Context")+".Consumer";case O:var k=y.render;return y=y.displayName,y||(y=k.displayName||k.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case j:return k=y.displayName||null,k!==null?k:L(y.type)||"Memo";case N:k=y._payload,y=y._init;try{return L(y(k))}catch{}}return null}var U=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},D=[],G=-1;function V(y){return{current:y}}function $(y){0>G||(y.current=D[G],D[G]=null,G--)}function W(y,k){G++,D[G]=y.current,y.current=k}var Q=V(null),J=V(null),ae=V(null),te=V(null);function re(y,k){switch(W(ae,k),W(J,y),W(Q,null),k.nodeType){case 9:case 11:y=(y=k.documentElement)&&(y=y.namespaceURI)?OEe(y):0;break;default:if(y=k.tagName,k=k.namespaceURI)k=OEe(k),y=EEe(k,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}$(Q),W(Q,y)}function ie(){$(Q),$(J),$(ae)}function pe(y){y.memoizedState!==null&&W(te,y);var k=Q.current,C=EEe(k,y.type);k!==C&&(W(J,y),W(Q,C))}function X(y){J.current===y&&($(Q),$(J)),te.current===y&&($(te),XT._currentValue=Z)}var ne,le;function ge(y){if(ne===void 0)try{throw Error()}catch(C){var k=C.stack.trim().match(/\n( *(at )?)/);ne=k&&k[1]||"",le=-1<C.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-bWOYDAHF.js","./index-hTIM_Qvg.js","./index-aMP3lwxt.js","./index-C2OqAplM.js","./index-B818jJF8.js","./index-DHBy70un.js","./index-DT-bmX_c.js","./index-BRnbZ_zY.js","./index-BcbyRcdO.js","./index-DE1Uf-DZ.js","./index-C4t9LjwW.js","./index-0ZhaJMzn.js","./index-Bd3KOA-e.js","./index-DU3FtUyc.js","./index-BUA1uxDU.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-B_OqxYGM.js","./index-Btqfk5yp.js","./index-J2K1uPqD.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as tt}from"./index-hTIM_Qvg.js";function MQe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var z5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oZ={exports:{}},tN={};var nCe;function QLt(){if(nCe)return tN;nCe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,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:r,key:i,ref:s!==void 0?s:null,props:a}}return tN.Fragment=t,tN.jsx=n,tN.jsxs=n,tN}var rCe;function GLt(){return rCe||(rCe=1,oZ.exports=QLt()),oZ.exports}var o=GLt(),lZ={exports:{}},Tr={},sCe;function YLt(){if(sCe)return Tr;sCe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=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"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=h&&V[h]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,x={};function w(V,$,W){this.props=V,this.context=$,this.refs=x,this.updater=W||g}w.prototype.isReactComponent={},w.prototype.setState=function(V,$){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,$,"setState")},w.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function S(){}S.prototype=w.prototype;function _(V,$,W){this.props=V,this.context=$,this.refs=x,this.updater=W||g}var O=_.prototype=new S;O.constructor=_,v(O,w.prototype),O.isPureReactComponent=!0;var E=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(V,$,W){var Q=W.ref;return{$$typeof:t,type:V,key:$,ref:Q!==void 0?Q:null,props:W}}function P(V,$){return I(V.type,$,V.props)}function R(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var $={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return $[W]})}var M=/\/+/g;function L(V,$){return typeof V=="object"&&V!==null&&V.key!=null?B(""+V.key):$.toString(36)}function U(V){switch(V.status){case"fulfilled":return V.value;case"rejected":throw V.reason;default:switch(typeof V.status=="string"?V.then(T,T):(V.status="pending",V.then(function($){V.status==="pending"&&(V.status="fulfilled",V.value=$)},function($){V.status==="pending"&&(V.status="rejected",V.reason=$)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,$,W,Q,J){var ae=typeof V;(ae==="undefined"||ae==="boolean")&&(V=null);var te=!1;if(V===null)te=!0;else switch(ae){case"bigint":case"string":case"number":te=!0;break;case"object":switch(V.$$typeof){case t:case n:te=!0;break;case f:return te=V._init,z(te(V._payload),$,W,Q,J)}}if(te)return J=J(V),te=Q===""?"."+L(V,0):Q,E(J)?(W="",te!=null&&(W=te.replace(M,"$&/")+"/"),z(J,$,W,"",function(pe){return pe})):J!=null&&(R(J)&&(J=P(J,W+(J.key==null||V&&V.key===J.key?"":(""+J.key).replace(M,"$&/")+"/")+te)),$.push(J)),1;te=0;var re=Q===""?".":Q+":";if(E(V))for(var ie=0;ie<V.length;ie++)Q=V[ie],ae=re+L(Q,ie),te+=z(Q,$,W,ae,J);else if(ie=m(V),typeof ie=="function")for(V=ie.call(V),ie=0;!(Q=V.next()).done;)Q=Q.value,ae=re+L(Q,ie++),te+=z(Q,$,W,ae,J);else if(ae==="object"){if(typeof V.then=="function")return z(U(V),$,W,Q,J);throw $=String(V),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return te}function q(V,$,W){if(V==null)return V;var Q=[],J=0;return z(V,Q,"","",function(ae){return $.call(W,ae,J++)}),Q}function Z(V){if(V._status===-1){var $=V._result;$=$(),$.then(function(W){(V._status===0||V._status===-1)&&(V._status=1,V._result=W)},function(W){(V._status===0||V._status===-1)&&(V._status=2,V._result=W)}),V._status===-1&&(V._status=0,V._result=$)}if(V._status===1)return V._result.default;throw V._result}var D=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof V=="object"&&V!==null&&typeof V.message=="string"?String(V.message):String(V),error:V});if(!window.dispatchEvent($))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},G={map:q,forEach:function(V,$,W){q(V,function(){$.apply(this,arguments)},W)},count:function(V){var $=0;return q(V,function(){$++}),$},toArray:function(V){return q(V,function($){return $})||[]},only:function(V){if(!R(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return Tr.Activity=p,Tr.Children=G,Tr.Component=w,Tr.Fragment=r,Tr.Profiler=a,Tr.PureComponent=_,Tr.StrictMode=s,Tr.Suspense=u,Tr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Tr.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},Tr.cache=function(V){return function(){return V.apply(null,arguments)}},Tr.cacheSignal=function(){return null},Tr.cloneElement=function(V,$,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var Q=v({},V.props),J=V.key;if($!=null)for(ae in $.key!==void 0&&(J=""+$.key),$)!N.call($,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&$.ref===void 0||(Q[ae]=$[ae]);var ae=arguments.length-2;if(ae===1)Q.children=W;else if(1<ae){for(var te=Array(ae),re=0;re<ae;re++)te[re]=arguments[re+2];Q.children=te}return I(V.type,J,Q)},Tr.createContext=function(V){return V={$$typeof:l,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},Tr.createElement=function(V,$,W){var Q,J={},ae=null;if($!=null)for(Q in $.key!==void 0&&(ae=""+$.key),$)N.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(J[Q]=$[Q]);var te=arguments.length-2;if(te===1)J.children=W;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];J.children=re}if(V&&V.defaultProps)for(Q in te=V.defaultProps,te)J[Q]===void 0&&(J[Q]=te[Q]);return I(V,ae,J)},Tr.createRef=function(){return{current:null}},Tr.forwardRef=function(V){return{$$typeof:c,render:V}},Tr.isValidElement=R,Tr.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:Z}},Tr.memo=function(V,$){return{$$typeof:d,type:V,compare:$===void 0?null:$}},Tr.startTransition=function(V){var $=j.T,W={};j.T=W;try{var Q=V(),J=j.S;J!==null&&J(W,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(T,D)}catch(ae){D(ae)}finally{$!==null&&W.types!==null&&($.types=W.types),j.T=$}},Tr.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Tr.use=function(V){return j.H.use(V)},Tr.useActionState=function(V,$,W){return j.H.useActionState(V,$,W)},Tr.useCallback=function(V,$){return j.H.useCallback(V,$)},Tr.useContext=function(V){return j.H.useContext(V)},Tr.useDebugValue=function(){},Tr.useDeferredValue=function(V,$){return j.H.useDeferredValue(V,$)},Tr.useEffect=function(V,$){return j.H.useEffect(V,$)},Tr.useEffectEvent=function(V){return j.H.useEffectEvent(V)},Tr.useId=function(){return j.H.useId()},Tr.useImperativeHandle=function(V,$,W){return j.H.useImperativeHandle(V,$,W)},Tr.useInsertionEffect=function(V,$){return j.H.useInsertionEffect(V,$)},Tr.useLayoutEffect=function(V,$){return j.H.useLayoutEffect(V,$)},Tr.useMemo=function(V,$){return j.H.useMemo(V,$)},Tr.useOptimistic=function(V,$){return j.H.useOptimistic(V,$)},Tr.useReducer=function(V,$,W){return j.H.useReducer(V,$,W)},Tr.useRef=function(V){return j.H.useRef(V)},Tr.useState=function(V){return j.H.useState(V)},Tr.useSyncExternalStore=function(V,$,W){return j.H.useSyncExternalStore(V,$,W)},Tr.useTransition=function(){return j.H.useTransition()},Tr.version="19.2.5",Tr}var aCe;function oj(){return aCe||(aCe=1,lZ.exports=YLt()),lZ.exports}var b=oj();const Te=xl(b),gk=MQe({__proto__:null,default:Te},[b]);var cZ={exports:{}},nN={},uZ={exports:{}},dZ={};var iCe;function XLt(){return iCe||(iCe=1,(function(e){function t(U,z){var q=U.length;U.push(z);e:for(;0<q;){var Z=q-1>>>1,D=U[Z];if(0<s(D,z))U[Z]=z,U[q]=D,q=Z;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var z=U[0],q=U.pop();if(q!==z){U[0]=q;e:for(var Z=0,D=U.length,G=D>>>1;Z<G;){var V=2*(Z+1)-1,$=U[V],W=V+1,Q=U[W];if(0>s($,q))W<D&&0>s(Q,$)?(U[Z]=Q,U[W]=q,Z=W):(U[Z]=$,U[V]=q,Z=V);else if(W<D&&0>s(Q,q))U[Z]=Q,U[W]=q,Z=W;else break e}}return z}function s(U,z){var q=U.sortIndex-z.sortIndex;return q!==0?q:U.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,f=null,p=3,h=!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 _(U){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=U)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function O(U){if(g=!1,_(U),!m)if(n(c)!==null)m=!0,E||(E=!0,R());else{var z=n(u);z!==null&&L(O,z.startTime-U)}}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 U=e.unstable_now();N=U;var z=!0;try{e:{m=!1,g&&(g=!1,w(T),T=-1),h=!0;var q=p;try{t:{for(_(U),f=n(c);f!==null&&!(f.expirationTime>U&&I());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,p=f.priorityLevel;var D=Z(f.expirationTime<=U);if(U=e.unstable_now(),typeof D=="function"){f.callback=D,_(U),z=!0;break t}f===n(c)&&r(c),_(U)}else r(c);f=n(c)}if(f!==null)z=!0;else{var G=n(u);G!==null&&L(O,G.startTime-U),z=!1}}break e}finally{f=null,p=q,h=!1}z=void 0}}finally{z?R():E=!1}}}var R;if(typeof S=="function")R=function(){S(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=P,R=function(){M.postMessage(null)}}else R=function(){x(P,0)};function L(U,z){T=x(function(){U(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(U){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var q=p;p=z;try{return U()}finally{p=q}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(U,z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var q=p;p=U;try{return z()}finally{p=q}},e.unstable_scheduleCallback=function(U,z,q){var Z=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?Z+q:Z):q=Z,U){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=q+D,U={id:d++,callback:z,priorityLevel:U,startTime:q,expirationTime:D,sortIndex:-1},q>Z?(U.sortIndex=q,t(u,U),n(c)===null&&U===n(u)&&(g?(w(T),T=-1):g=!0,L(O,q-Z))):(U.sortIndex=D,t(c,U),m||h||(m=!0,E||(E=!0,R()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var z=p;return function(){var q=p;p=z;try{return U.apply(this,arguments)}finally{p=q}}}})(dZ)),dZ}var oCe;function KLt(){return oCe||(oCe=1,uZ.exports=XLt()),uZ.exports}var fZ={exports:{}},Pc={};var lCe;function JLt(){if(lCe)return Pc;lCe=1;var e=oj();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 n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},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 Pc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Pc.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)},Pc.flushSync=function(c){var u=i.T,d=r.p;try{if(i.T=null,r.p=2,c)return c()}finally{i.T=u,r.p=d,r.d.f()}},Pc.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},Pc.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Pc.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=l(d,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:h}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:p,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Pc.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);r.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&&r.d.M(c)},Pc.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);r.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})}},Pc.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);r.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 r.d.m(c)},Pc.requestFormReset=function(c){r.d.r(c)},Pc.unstable_batchedUpdates=function(c,u){return c(u)},Pc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Pc.useFormStatus=function(){return i.H.useHostTransitionStatus()},Pc.version="19.2.5",Pc}var cCe;function DQe(){if(cCe)return fZ.exports;cCe=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(),fZ.exports=JLt(),fZ.exports}var uCe;function e4t(){if(uCe)return nN;uCe=1;var e={env:{}};var t=KLt(),n=oj(),r=DQe();function s(y){var k="https://react.dev/errors/"+y;if(1<arguments.length){k+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)k+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+y+"; visit "+k+" 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 k=y,C=y;if(y.alternate)for(;k.return;)k=k.return;else{y=k;do k=y,(k.flags&4098)!==0&&(C=k.return),y=k.return;while(y)}return k.tag===3?C:null}function l(y){if(y.tag===13){var k=y.memoizedState;if(k===null&&(y=y.alternate,y!==null&&(k=y.memoizedState)),k!==null)return k.dehydrated}return null}function c(y){if(y.tag===31){var k=y.memoizedState;if(k===null&&(y=y.alternate,y!==null&&(k=y.memoizedState)),k!==null)return k.dehydrated}return null}function u(y){if(i(y)!==y)throw Error(s(188))}function d(y){var k=y.alternate;if(!k){if(k=i(y),k===null)throw Error(s(188));return k!==y?null:y}for(var C=y,A=k;;){var F=C.return;if(F===null)break;var H=F.alternate;if(H===null){if(A=F.return,A!==null){C=A;continue}break}if(F.child===H.child){for(H=F.child;H;){if(H===C)return u(F),y;if(H===A)return u(F),k;H=H.sibling}throw Error(s(188))}if(C.return!==A.return)C=F,A=H;else{for(var ee=!1,fe=F.child;fe;){if(fe===C){ee=!0,C=F,A=H;break}if(fe===A){ee=!0,A=F,C=H;break}fe=fe.sibling}if(!ee){for(fe=H.child;fe;){if(fe===C){ee=!0,C=H,A=F;break}if(fe===A){ee=!0,A=H,C=F;break}fe=fe.sibling}if(!ee)throw Error(s(189))}}if(C.alternate!==A)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?y:k}function f(y){var k=y.tag;if(k===5||k===26||k===27||k===6)return y;for(y=y.child;y!==null;){if(k=f(y),k!==null)return k;y=y.sibling}return null}var p=Object.assign,h=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"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(y){return y===null||typeof y!="object"?null:(y=R&&y[R]||y["@@iterator"],typeof y=="function"?y:null)}var M=Symbol.for("react.client.reference");function L(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===M?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 _:return y.displayName||"Context";case S:return(y._context.displayName||"Context")+".Consumer";case O:var k=y.render;return y=y.displayName,y||(y=k.displayName||k.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case j:return k=y.displayName||null,k!==null?k:L(y.type)||"Memo";case N:k=y._payload,y=y._init;try{return L(y(k))}catch{}}return null}var U=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},D=[],G=-1;function V(y){return{current:y}}function $(y){0>G||(y.current=D[G],D[G]=null,G--)}function W(y,k){G++,D[G]=y.current,y.current=k}var Q=V(null),J=V(null),ae=V(null),te=V(null);function re(y,k){switch(W(ae,k),W(J,y),W(Q,null),k.nodeType){case 9:case 11:y=(y=k.documentElement)&&(y=y.namespaceURI)?OEe(y):0;break;default:if(y=k.tagName,k=k.namespaceURI)k=OEe(k),y=EEe(k,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}$(Q),W(Q,y)}function ie(){$(Q),$(J),$(ae)}function pe(y){y.memoizedState!==null&&W(te,y);var k=Q.current,C=EEe(k,y.type);k!==C&&(W(J,y),W(Q,C))}function X(y){J.current===y&&($(Q),$(J)),te.current===y&&($(te),XT._currentValue=Z)}var ne,le;function ge(y){if(ne===void 0)try{throw Error()}catch(C){var k=C.stack.trim().match(/\n( *(at )?)/);ne=k&&k[1]||"",le=-1<C.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+ne+y+le}var de=!1;function ue(y,k){if(!y||de)return"";de=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var A={DetermineComponentFrameRoot:function(){try{if(k){var mt=function(){throw Error()};if(Object.defineProperty(mt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(mt,[])}catch(st){var Xe=st}Reflect.construct(y,[],mt)}else{try{mt.call()}catch(st){Xe=st}y.call(mt.prototype)}}else{try{throw Error()}catch(st){Xe=st}(mt=y())&&typeof mt.catch=="function"&&mt.catch(function(){})}}catch(st){if(st&&Xe&&typeof st.stack=="string")return[st.stack,Xe.stack]}return[null,null]}};A.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var F=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");F&&F.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var H=A.DetermineComponentFrameRoot(),ee=H[0],fe=H[1];if(ee&&fe){var Ae=ee.split(`
|
|
5
5
|
`),Ye=fe.split(`
|
|
@@ -112,7 +112,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
|
|
|
112
112
|
constructor(\${params}) {
|
|
113
113
|
\${}
|
|
114
114
|
}
|
|
115
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),dd('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),dd('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],knt=sme.concat([dd("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),dd("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),dd("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),xAe=new wJe,_nt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function mN(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const Ron=["FunctionDeclaration"],Pon={FunctionDeclaration:mN("function"),ClassDeclaration:mN("class"),ClassExpression:()=>!0,EnumDeclaration:mN("constant"),TypeAliasDeclaration:mN("type"),NamespaceDeclaration:mN("namespace"),VariableDefinition(e,t){e.matchContext(Ron)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function Ont(e,t){let n=xAe.get(t);if(n)return n;let r=[],s=!0;function a(i,l){let c=e.sliceString(i.from,i.to);r.push({label:c,type:l})}return t.cursor(Sa.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=Pon[i.name];if(l&&l(i,a)||_nt.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of Ont(e,i.node))r.push(l);return!1}}),xAe.set(t,r),r}const D6=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,ame=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Ent(e){let t=ei(e.state).resolveInner(e.pos,-1);if(ame.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&D6.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)_nt.has(s.name)&&(r=r.concat(Ont(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:D6}}function hW(e,t,n){var r;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:n};if(a?.name=="MemberExpression"&&((r=i=a.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function Cnt(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=ei(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?hW(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?hW(t,n.parent,""):ame.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&D6.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?hW(t,n,""):e.explicit?{path:[],name:""}:null}function $on(e,t){let n=e,r=[],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=n[l]}catch{continue}r.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 r;e=i}}function Mon(e){let t=new Map;return n=>{let r=Cnt(n);if(!r)return null;let s=e;for(let i of r.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=$on(s,!r.path.length)),{from:n.pos-r.name.length,options:a,validFor:D6}}}const oh=S1.define({name:"javascript",parser:Ion.configure({props:[Ck.add({IfStatement:dE({except:/^\s*({|else\b)/}),TryStatement:dE({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Irn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Arn({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":dE({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}}),jk.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Lhe,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 n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,r=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?e.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),jnt={test:e=>/^JSX/.test(e.name),facet:F8({commentTokens:{block:{open:"{/*",close:"*/}"}}})},ime=oh.configure({dialect:"ts"},"typescript"),ome=oh.configure({dialect:"jsx",props:[$he.add(e=>e.isTop?[jnt]:void 0)]}),lme=oh.configure({dialect:"jsx ts",props:[$he.add(e=>e.isTop?[jnt]:void 0)]},"typescript");let Tnt=e=>({label:e,type:"keyword"});const Nnt="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(Tnt),Don=Nnt.concat(["declare","implements","private","protected","public"].map(Tnt));function L6(e={}){let t=e.jsx?e.typescript?lme:ome:e.typescript?ime:oh,n=e.typescript?knt.concat(Don):sme.concat(Nnt);return new _1(t,[oh.data.of({autocomplete:vsn(ame,Ott(n))}),oh.data.of({autocomplete:Ent}),e.jsx?Ant:[]])}function Lon(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 wAe(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const zon=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Ant=vt.inputHandler.of((e,t,n,r,s)=>{if((zon?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!oh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=ei(i).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==d-2&&((p=wAe(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:it.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=Lon(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=wAe(i.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function Fon(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((n,r)=>{var s;!((s=n.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,s=[];for(let{from:a,to:i}of oh.findRegions(r)){let l=r.doc.lineAt(a),c={line:l.number-1,col:a-l.from,pos:a};for(let u of e.verify(r.sliceDoc(a,i),t))s.push(Bon(u,r.doc,c))}return s}}function SAe(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function Bon(e,t,n){let r=SAe(e.line,e.column,t,n),s={from:r,to:e.endLine!=null&&e.endColumn!=1?SAe(e.endLine,e.endColumn,t,n):r,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]+n.pos-r,c=a[1]+n.pos-r;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const PL=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Ant,completionPath:Cnt,esLint:Fon,javascript:L6,javascriptLanguage:oh,jsxLanguage:ome,localCompletionSource:Ent,scopeCompletionSource:Mon,snippets:sme,tsxLanguage:lme,typescriptLanguage:ime,typescriptSnippets:knt},Symbol.toStringTag,{value:"Module"})),gN=["_blank","_self","_top","_parent"],mW=["ascii","utf-8","utf-16","latin1","latin1"],gW=["get","post","put","delete"],vW=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],df=["true","false"],Wn={},Uon={a:{attrs:{href:null,ping:null,type:null,media:null,target:gN,hreflang:null}},abbr:Wn,address:Wn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Wn,aside:Wn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Wn,base:{attrs:{href:null,target:gN}},bdi:Wn,bdo:Wn,blockquote:{attrs:{cite:null}},body:Wn,br:Wn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:vW,formmethod:gW,formnovalidate:["novalidate"],formtarget:gN,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Wn,center:Wn,cite:Wn,code:Wn,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:Wn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Wn,div:Wn,dl:Wn,dt:Wn,em:Wn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Wn,figure:Wn,footer:Wn,form:{attrs:{action:null,name:null,"accept-charset":mW,autocomplete:["on","off"],enctype:vW,method:gW,novalidate:["novalidate"],target:gN}},h1:Wn,h2:Wn,h3:Wn,h4:Wn,h5:Wn,h6:Wn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Wn,hgroup:Wn,hr:Wn,html:{attrs:{manifest:null}},i:Wn,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:vW,formmethod:gW,formnovalidate:["novalidate"],formtarget:gN,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:Wn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Wn,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:Wn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mW,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:Wn,noscript:Wn,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:Wn,param:{attrs:{name:null,value:null}},pre:Wn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Wn,rt:Wn,ruby:Wn,samp:Wn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mW}},section:Wn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Wn,source:{attrs:{src:null,type:null,media:null}},span:Wn,strong:Wn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Wn,summary:Wn,sup:Wn,table:Wn,tbody:Wn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Wn,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:Wn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Wn,time:{attrs:{datetime:null}},title:Wn,tr:Wn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Wn,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:Wn},Int={accesskey:null,class:null,contenteditable:df,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:df,autocorrect:df,autocapitalize:df,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":df,"aria-autocomplete":["inline","list","both","none"],"aria-busy":df,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":df,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":df,"aria-hidden":df,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":df,"aria-multiselectable":df,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":df,"aria-relevant":null,"aria-required":df,"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},Rnt="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 Rnt)Int[e]=null;let yR=class{constructor(t,n){this.tags={...Uon,...t},this.globalAttrs={...Int,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};yR.default=new yR;function nC(e,t,n=e.length){if(!t)return"";let r=t.firstChild,s=r&&r.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,n)):""}function rC(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function Pnt(e,t,n){let r=n.tags[nC(e,rC(t))];return r?.children||n.allTags}function cme(e,t){let n=[];for(let r=rC(t);r&&!r.type.isTop;r=rC(r.parent)){let s=nC(e,r);if(s&&r.lastChild.name=="CloseTag")break;s&&n.indexOf(s)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(s)}return n}const $nt=/^[:\-\.\w\u00b7-\uffff]*$/;function kAe(e,t,n,r,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=rC(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:s,options:Pnt(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(cme(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function _Ae(e,t,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:cme(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:$nt}}function qon(e,t,n,r){let s=[],a=0;for(let i of Pnt(e.doc,n,t))s.push({label:"<"+i,type:"type"});for(let i of cme(e.doc,n))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Von(e,t,n,r,s){let a=rC(n),i=a?t.tags[nC(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:r,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:$nt}}function Hon(e,t,n,r,s){var a;let i=(a=n.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=rC(n),p=f?t.tags[nC(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,s).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let m of d)l.push({label:m,apply:p+m+h,type:"constant"})}}return{from:r,to:s,options:l,validFor:c}}function Mnt(e,t){let{state:n,pos:r}=t,s=ei(n).resolveInner(r,-1),a=s.resolve(r);for(let i=r,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)?_Ae(n,s,s.from,r):kAe(n,e,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?kAe(n,e,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?_Ae(n,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Von(n,e,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?Hon(n,e,s,s.name=="Is"?r:s.from,r):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?qon(n,e,s,r):null}function Dnt(e){return Mnt(yR.default,e)}function Lnt(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new yR(t,n):yR.default;return s=>Mnt(r,s)}const Zon=oh.parser.configure({top:"SingleExpression"}),znt=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:ime.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:ome.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:lme.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Zon},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:oh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:vR.parser}],Fnt=[{name:"style",parser:vR.parser.configure({top:"Styles"})}].concat(Rnt.map(e=>({name:e,parser:oh.parser}))),Bnt=S1.define({name:"html",parser:win.configure({props:[Ck.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,n;for(let r=e.node;;){let s=r.lastChild;if(!s||s.name!="Element"||s.to!=r.to)break;t=r=s}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),jk.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),ytt.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),aI=Bnt.configure({wrap:pnt(znt,Fnt)});function Unt(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=pnt((e.nestedLanguages||[]).concat(znt),(e.nestedAttributes||[]).concat(Fnt)));let r=n?Bnt.configure({wrap:n,dialect:t}):t?aI.configure({dialect:t}):aI;return new _1(r,[aI.data.of({autocomplete:Lnt(e)}),e.autoCloseTags!==!1?qnt:[],L6().support,wnt().support])}const OAe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),qnt=vt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!aI.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u,d,f;let p=i.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,m=ei(i).resolveInner(h,-1),g;if(p&&r==">"&&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=nC(i.doc,v.parent,h))&&!OAe.has(g)){let x=h+(i.doc.sliceString(h,h+1)===">"?1:0),w=`</${g}>`;return{range:c,changes:{from:h,to:x,insert:w}}}}else if(p&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=nC(i.doc,v,h))&&!OAe.has(g)){let x=h+(i.doc.sliceString(h,h+1)===">"?1:0),w=`${g}>`;return{range:it.cursor(h+w.length,-1),changes:{from:h,to:x,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Won=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:qnt,html:Unt,htmlCompletionSource:Dnt,htmlCompletionSourceWith:Lnt,htmlLanguage:aI},Symbol.toStringTag,{value:"Module"})),Vnt=F8({commentTokens:{block:{open:"<!--",close:"-->"}}}),Hnt=new Cr,Znt=kan.configure({props:[jk.add(e=>!e.is("Block")||e.is("Document")||lle(e)!=null||Qon(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),Hnt.add(lle),Ck.add({Document:()=>null}),zx.add({Document:Vnt})]});function lle(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Qon(e){return e.name=="OrderedList"||e.name=="BulletList"}function Gon(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=lle(r.type))!=null&&s<=t)break;n=r}return n.to}const Yon=itt.of((e,t,n)=>{for(let r=ei(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(Hnt);if(s==null)continue;let a=Gon(r,s);if(a>n)return{from:n,to:a}}return null});function ume(e){return new Pf(Vnt,e,[],"markdown")}const Wnt=ume(Znt),Xon=Znt.configure([Pan,Man,$an,Dan,{props:[jk.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),C1=ume(Xon);function Kon(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=Je.matchLanguageName(e,n,!0),r instanceof Je)return r.support?r.support.language.parser:k1.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class yW{constructor(t,n,r,s,a,i,l){this.node=t,this.from=n,this.to=r,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=l}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+Gnt(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function Qnt(e,t){let n=[],r=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&n.push(s)}for(let s=n.length-1;s>=0;s--){let a=n[s],i,l=t.lineAt(a.from),c=a.from-l.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(c))))r.push(new yW(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),r.push(new yW(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]/," ")),r.push(new yW(a.parent,c,c+d,i[1],u,f,a))}}return r}function Gnt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bW(e,t,n,r=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=Gnt(a,t),c=+l[2];if(s>=0){if(c!=s+1)return;n.push({from:a.from+l[1].length,to:a.from+l[0].length,insert:String(s+2+r)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function dme(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(wj)!=" ")return e;let r=bm(e,4,n),s="";for(let a=r;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(n)}const Ynt=(e={})=>({state:t,dispatch:n})=>{let r=ei(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!C1.isActiveAt(t,l.from,-1)&&!C1.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=Qnt(r.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 p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){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,_,O="";S&&S.item?(_=u.from+S.from,O=S.marker(s,1)):_=u.from+(S?S.to:0);let E=[{from:_,to:c,insert:O}];return f.node.name=="OrderedList"&&bW(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&bW(S.item,s,E),{range:it.cursor(_+O.length),changes:E}}else{let S=CAe(d,t,u);return{range:it.cursor(c+S.length+1),changes:{from:u.from,insert:S+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&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 h=[];f.node.name=="OrderedList"&&bW(f.item,s,h);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?bm(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=dme(g,t),Jon(f.node,t.doc)&&(g=CAe(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:it.cursor(v+g.length+1),changes:h}});return a?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},Xnt=Ynt();function EAe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function Jon(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),a=t.lineAt(r.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function CAe(e,t,n){let r="";for(let s=0,a=e.length-2;s<=a;s++)r+=e[s].blank(s<a?bm(n.text,4,e[s+1].from)-r.length:null,s<a);return dme(r,t)}function eln(e,t){let n=e.resolveInner(t,-1),r=t;EAe(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(EAe(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const Knt=({state:e,dispatch:t})=>{let n=ei(e),r=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&C1.isActiveAt(e,a.from)){let c=l.lineAt(i),u=Qnt(eln(n,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:it.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 p=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(bm(c.text,4,d.to)-bm(c.text,4,d.from));return p==c.from&&(h=dme(h,e)),{range:it.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:it.cursor(p),changes:{from:p,to:i}}}}}return r={range:a}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},Jnt=[{key:"Enter",run:Xnt},{key:"Backspace",run:Knt}],ert=Unt({matchClosingTags:!1});function fme(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=Wnt,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=ert}=e;if(!(s instanceof V8))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,Yon],d;i&&u.push(trt),n instanceof _1?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?Kon(t,d):void 0;c.push(Oan({codeParser:f,htmlParser:l.language.parser})),r&&u.push(Am.high(xj.of(Jnt)));let p=ume(s.configure(c));return a&&u.push(p.data.of({autocomplete:tln})),new _1(p,u)}function tln(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=ei(t).resolveInner(n,-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:n-r[0].length,to:n,options:nln(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xW=null;function nln(){if(xW)return xW;let e=Dnt(new Uhe(es.create({extensions:ert}),0,!0));return xW=e?e.options:[]}const rln=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,trt=vt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!C1.isActiveAt(t.state,r.from,1)))return!1;let a=ei(t.state),i=!1;return a.iterate({from:r.from,to:r.to,enter:l=>{(l.from>r.from||rln.test(l.name))&&(i=!0)},leave:l=>{l.to<r.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),sln=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Wnt,deleteMarkupBackward:Knt,insertNewlineContinueMarkup:Xnt,insertNewlineContinueMarkupCommand:Ynt,markdown:fme,markdownKeymap:Jnt,markdownLanguage:C1,pasteURLAsLink:trt},Symbol.toStringTag,{value:"Module"}));function yt(e){return new _1(zhe.define(e))}function sx(e){return tt(()=>import("./index-DihrLdtI.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const nrt=[Je.of({name:"C",extensions:["c","h","ino"],load(){return tt(()=>import("./index-CKunvpxP.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Je.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return tt(()=>import("./index-CKunvpxP.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Je.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return sx("Cassandra")}}),Je.of({name:"CSS",extensions:["css"],load(){return tt(()=>Promise.resolve().then(()=>ton),void 0,import.meta.url).then(e=>e.css())}}),Je.of({name:"Go",extensions:["go"],load(){return tt(()=>import("./index-DFqSsR_9.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Je.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return tt(()=>Promise.resolve().then(()=>Won),void 0,import.meta.url).then(e=>e.html())}}),Je.of({name:"Java",extensions:["java"],load(){return tt(()=>import("./index-Dju3G_Nj.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Je.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return tt(()=>Promise.resolve().then(()=>PL),void 0,import.meta.url).then(e=>e.javascript())}}),Je.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return tt(()=>import("./index-CKJz4ksW.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Je.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return tt(()=>Promise.resolve().then(()=>msn),void 0,import.meta.url).then(e=>e.json())}}),Je.of({name:"JSX",extensions:["jsx"],load(){return tt(()=>Promise.resolve().then(()=>PL),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Je.of({name:"LESS",extensions:["less"],load(){return tt(()=>import("./index-08vwibD7.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Je.of({name:"Liquid",extensions:["liquid"],load(){return tt(()=>import("./index-DesNrfeV.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Je.of({name:"MariaDB SQL",load(){return sx("MariaSQL")}}),Je.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return tt(()=>Promise.resolve().then(()=>sln),void 0,import.meta.url).then(e=>e.markdown())}}),Je.of({name:"MS SQL",load(){return sx("MSSQL")}}),Je.of({name:"MySQL",load(){return sx("MySQL")}}),Je.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return tt(()=>import("./index-D8yiz0d7.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Je.of({name:"PLSQL",extensions:["pls"],load(){return sx("PLSQL")}}),Je.of({name:"PostgreSQL",load(){return sx("PostgreSQL")}}),Je.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return tt(()=>import("./index-B1XO30jB.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Je.of({name:"Rust",extensions:["rs"],load(){return tt(()=>import("./index-ChQXWFo6.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Je.of({name:"Sass",extensions:["sass"],load(){return tt(()=>import("./index-iBM5gI8m.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Je.of({name:"SCSS",extensions:["scss"],load(){return tt(()=>import("./index-iBM5gI8m.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Je.of({name:"SQL",extensions:["sql"],load(){return sx("StandardSQL")}}),Je.of({name:"SQLite",load(){return sx("SQLite")}}),Je.of({name:"TSX",extensions:["tsx"],load(){return tt(()=>Promise.resolve().then(()=>PL),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Je.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return tt(()=>Promise.resolve().then(()=>PL),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Je.of({name:"WebAssembly",extensions:["wat","wast"],load(){return tt(()=>import("./index-C7nciVvt.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Je.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return tt(()=>import("./index-C2aPX93u.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Je.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return tt(()=>import("./index-BotJ7ssY.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Je.of({name:"APL",extensions:["dyalog","apl"],load(){return tt(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>yt(e.apl))}}),Je.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return tt(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>yt(e.asciiArmor))}}),Je.of({name:"ASN.1",extensions:["asn","asn1"],load(){return tt(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>yt(e.asn1({})))}}),Je.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return tt(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>yt(e.asterisk))}}),Je.of({name:"Brainfuck",extensions:["b","bf"],load(){return tt(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>yt(e.brainfuck))}}),Je.of({name:"Cobol",extensions:["cob","cpy"],load(){return tt(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>yt(e.cobol))}}),Je.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.csharp))}}),Je.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return tt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>yt(e.clojure))}}),Je.of({name:"ClojureScript",extensions:["cljs"],load(){return tt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>yt(e.clojure))}}),Je.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return tt(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>yt(e.gss))}}),Je.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return tt(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>yt(e.cmake))}}),Je.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return tt(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>yt(e.coffeeScript))}}),Je.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return tt(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>yt(e.commonLisp))}}),Je.of({name:"Cypher",extensions:["cyp","cypher"],load(){return tt(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>yt(e.cypher))}}),Je.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return tt(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>yt(e.cython))}}),Je.of({name:"Crystal",extensions:["cr"],load(){return tt(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>yt(e.crystal))}}),Je.of({name:"D",extensions:["d"],load(){return tt(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>yt(e.d))}}),Je.of({name:"Dart",extensions:["dart"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.dart))}}),Je.of({name:"diff",extensions:["diff","patch"],load(){return tt(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>yt(e.diff))}}),Je.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return tt(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>yt(e.dockerFile))}}),Je.of({name:"DTD",extensions:["dtd"],load(){return tt(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>yt(e.dtd))}}),Je.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return tt(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>yt(e.dylan))}}),Je.of({name:"EBNF",load(){return tt(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>yt(e.ebnf))}}),Je.of({name:"ECL",extensions:["ecl"],load(){return tt(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>yt(e.ecl))}}),Je.of({name:"edn",extensions:["edn"],load(){return tt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>yt(e.clojure))}}),Je.of({name:"Eiffel",extensions:["e"],load(){return tt(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>yt(e.eiffel))}}),Je.of({name:"Elm",extensions:["elm"],load(){return tt(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>yt(e.elm))}}),Je.of({name:"Erlang",extensions:["erl"],load(){return tt(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>yt(e.erlang))}}),Je.of({name:"Esper",load(){return tt(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>yt(e.esper))}}),Je.of({name:"Factor",extensions:["factor"],load(){return tt(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>yt(e.factor))}}),Je.of({name:"FCL",load(){return tt(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>yt(e.fcl))}}),Je.of({name:"Forth",extensions:["forth","fth","4th"],load(){return tt(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>yt(e.forth))}}),Je.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return tt(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>yt(e.fortran))}}),Je.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return tt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>yt(e.fSharp))}}),Je.of({name:"Gas",extensions:["s"],load(){return tt(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>yt(e.gas))}}),Je.of({name:"Gherkin",extensions:["feature"],load(){return tt(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>yt(e.gherkin))}}),Je.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return tt(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>yt(e.groovy))}}),Je.of({name:"Haskell",extensions:["hs"],load(){return tt(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>yt(e.haskell))}}),Je.of({name:"Haxe",extensions:["hx"],load(){return tt(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>yt(e.haxe))}}),Je.of({name:"HXML",extensions:["hxml"],load(){return tt(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>yt(e.hxml))}}),Je.of({name:"HTTP",load(){return tt(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>yt(e.http))}}),Je.of({name:"IDL",extensions:["pro"],load(){return tt(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>yt(e.idl))}}),Je.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return tt(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>yt(e.jsonld))}}),Je.of({name:"Julia",extensions:["jl"],load(){return tt(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>yt(e.julia))}}),Je.of({name:"Kotlin",extensions:["kt","kts"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.kotlin))}}),Je.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return tt(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>yt(e.liveScript))}}),Je.of({name:"Lua",extensions:["lua"],load(){return tt(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>yt(e.lua))}}),Je.of({name:"mIRC",extensions:["mrc"],load(){return tt(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>yt(e.mirc))}}),Je.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return tt(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>yt(e.mathematica))}}),Je.of({name:"Modelica",extensions:["mo"],load(){return tt(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>yt(e.modelica))}}),Je.of({name:"MUMPS",extensions:["mps"],load(){return tt(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>yt(e.mumps))}}),Je.of({name:"Mbox",extensions:["mbox"],load(){return tt(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>yt(e.mbox))}}),Je.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return tt(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>yt(e.nginx))}}),Je.of({name:"NSIS",extensions:["nsh","nsi"],load(){return tt(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>yt(e.nsis))}}),Je.of({name:"NTriples",extensions:["nt","nq"],load(){return tt(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>yt(e.ntriples))}}),Je.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.objectiveC))}}),Je.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.objectiveCpp))}}),Je.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return tt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>yt(e.oCaml))}}),Je.of({name:"Octave",extensions:["m"],load(){return tt(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>yt(e.octave))}}),Je.of({name:"Oz",extensions:["oz"],load(){return tt(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>yt(e.oz))}}),Je.of({name:"Pascal",extensions:["p","pas"],load(){return tt(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>yt(e.pascal))}}),Je.of({name:"Perl",extensions:["pl","pm"],load(){return tt(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>yt(e.perl))}}),Je.of({name:"Pig",extensions:["pig"],load(){return tt(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>yt(e.pig))}}),Je.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return tt(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>yt(e.powerShell))}}),Je.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return tt(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>yt(e.properties))}}),Je.of({name:"ProtoBuf",extensions:["proto"],load(){return tt(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>yt(e.protobuf))}}),Je.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return tt(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>yt(e.pug))}}),Je.of({name:"Puppet",extensions:["pp"],load(){return tt(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>yt(e.puppet))}}),Je.of({name:"Q",extensions:["q"],load(){return tt(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>yt(e.q))}}),Je.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return tt(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>yt(e.r))}}),Je.of({name:"RPM Changes",load(){return tt(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>yt(e.rpmChanges))}}),Je.of({name:"RPM Spec",extensions:["spec"],load(){return tt(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>yt(e.rpmSpec))}}),Je.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return tt(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>yt(e.ruby))}}),Je.of({name:"SAS",extensions:["sas"],load(){return tt(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>yt(e.sas))}}),Je.of({name:"Scala",extensions:["scala"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.scala))}}),Je.of({name:"Scheme",extensions:["scm","ss"],load(){return tt(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>yt(e.scheme))}}),Je.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return tt(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>yt(e.shell))}}),Je.of({name:"Sieve",extensions:["siv","sieve"],load(){return tt(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>yt(e.sieve))}}),Je.of({name:"Smalltalk",extensions:["st"],load(){return tt(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>yt(e.smalltalk))}}),Je.of({name:"Solr",load(){return tt(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>yt(e.solr))}}),Je.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return tt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>yt(e.sml))}}),Je.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return tt(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>yt(e.sparql))}}),Je.of({name:"Spreadsheet",alias:["excel","formula"],load(){return tt(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>yt(e.spreadsheet))}}),Je.of({name:"Squirrel",extensions:["nut"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.squirrel))}}),Je.of({name:"Stylus",extensions:["styl"],load(){return tt(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>yt(e.stylus))}}),Je.of({name:"Swift",extensions:["swift"],load(){return tt(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>yt(e.swift))}}),Je.of({name:"sTeX",load(){return tt(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>yt(e.stex))}}),Je.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return tt(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>yt(e.stex))}}),Je.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return tt(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>yt(e.verilog))}}),Je.of({name:"Tcl",extensions:["tcl"],load(){return tt(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>yt(e.tcl))}}),Je.of({name:"Textile",extensions:["textile"],load(){return tt(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>yt(e.textile))}}),Je.of({name:"TiddlyWiki",load(){return tt(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>yt(e.tiddlyWiki))}}),Je.of({name:"Tiki wiki",load(){return tt(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>yt(e.tiki))}}),Je.of({name:"TOML",extensions:["toml"],load(){return tt(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>yt(e.toml))}}),Je.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return tt(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>yt(e.troff))}}),Je.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return tt(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>yt(e.ttcn))}}),Je.of({name:"TTCN_CFG",extensions:["cfg"],load(){return tt(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>yt(e.ttcnCfg))}}),Je.of({name:"Turtle",extensions:["ttl"],load(){return tt(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>yt(e.turtle))}}),Je.of({name:"Web IDL",extensions:["webidl"],load(){return tt(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>yt(e.webIDL))}}),Je.of({name:"VB.NET",extensions:["vb"],load(){return tt(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>yt(e.vb))}}),Je.of({name:"VBScript",extensions:["vbs"],load(){return tt(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>yt(e.vbScript))}}),Je.of({name:"Velocity",extensions:["vtl"],load(){return tt(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>yt(e.velocity))}}),Je.of({name:"Verilog",extensions:["v"],load(){return tt(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>yt(e.verilog))}}),Je.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return tt(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>yt(e.vhdl))}}),Je.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return tt(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>yt(e.xQuery))}}),Je.of({name:"Yacas",extensions:["ys"],load(){return tt(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>yt(e.yacas))}}),Je.of({name:"Z80",extensions:["z80"],load(){return tt(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>yt(e.z80))}}),Je.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return tt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>yt(e.mscgen))}}),Je.of({name:"Xù",extensions:["xu"],load(){return tt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>yt(e.xu))}}),Je.of({name:"MsGenny",extensions:["msgenny"],load(){return tt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>yt(e.msgenny))}}),Je.of({name:"Vue",extensions:["vue"],load(){return tt(()=>import("./index-CXSn9hCL.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Je.of({name:"Angular Template",load(){return tt(()=>import("./index-CaWqs6po.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function S0(){return S0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S0.apply(null,arguments)}var aln=e=>{var{theme:t,settings:n={},styles:r=[]}=e,s={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(s["&"]=a),n.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(s[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(s[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(s[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(s[".cm-content"]={caretColor:n.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var i={};n.gutterActiveForeground&&(i.color=n.gutterActiveForeground),n.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:n.lineHighlight},i.backgroundColor=n.lineHighlight),s[".cm-activeLineGutter"]=i,n.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var l=vt.theme(s,{dark:t==="dark"}),c=Im.define(r),u=[l,tw(c)];return u},iln={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)"},oln=[{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"}],kj=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return aln({theme:t,settings:S0({},iln,n),styles:[...oln,...r]})};kj();function pme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}const lln=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=mme(e.state,n.from);return r.line?cln(e):r.block?dln(e):!1};function hme(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=e(t,n);return s?(r(n.update(s)),!0):!1}}const cln=hme(hln,0),uln=hme(rrt,0),dln=hme((e,t)=>rrt(e,t,pln(t)),0);function mme(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const vN=50;function fln(e,{open:t,close:n},r,s){let a=e.sliceDoc(r-vN,r),i=e.sliceDoc(s,s+vN),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+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-r<=2*vN?d=f=e.sliceDoc(r,s):(d=e.sliceDoc(r,r+vN),f=e.sliceDoc(s-vN,s));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(m,m+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:s-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function pln(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),s=n.to<=r.to?r:e.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=s.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return t}function rrt(e,t,n=t.selection.ranges){let r=n.map(a=>mme(t,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,i)=>fln(t,r[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(n.map((a,i)=>s[i]?[]:[{from:a.from,insert:r[i].open+" "},{from:a.to,insert:" "+r[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=r[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 hln(e,t,n=t.selection.ranges){let r=[],s=-1;e:for(let{from:a,to:i}of n){let l=r.length,c=1e9,u;for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(u==null&&(u=mme(t,f.from).line,!u))continue e;if(f.from>s&&(a==i||i>f.from)){s=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,m=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:m,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=l;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==l+1&&(r[l].single=!0)}if(e!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of r)(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&&r.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:l,token:c}of r)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 cle=hv.define(),mln=hv.define(),gln=on.define(),srt=on.define({combine(e){return mv(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,s)=>t(r,s)||n(r,s)})}}),art=tl.define({create(){return Ng.empty},update(e,t){let n=t.state.facet(srt),r=t.annotation(cle);if(r){let c=Od.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=z6(d,d.length,n.minDepth,c):d=lrt(d,t.startState.selection),new Ng(u==0?r.rest:d,u==0?d:r.rest)}let s=t.annotation(mln);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(pl.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Od.fromTransaction(t),i=t.annotation(pl.time),l=t.annotation(pl.userEvent);return a?e=e.addChanges(a,i,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,i,l,n.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 Ng(e.done.map(Od.fromJSON),e.undone.map(Od.fromJSON))}});function vln(e={}){return[art,srt.of(e),vt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?irt:t.inputType=="historyRedo"?ule:null;return r?(t.preventDefault(),r(n)):!1}})]}function H8(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let s=n.field(art,!1);if(!s)return!1;let a=s.pop(e,n,t);return a?(r(a),!0):!1}}const irt=H8(0,!1),ule=H8(1,!1),yln=H8(0,!0),bln=H8(1,!0);class Od{constructor(t,n,r,s,a){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new Od(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new Od(t.changes&&ul.fromJSON(t.changes),[],t.mapped&&qg.fromJSON(t.mapped),t.startSelection&&it.fromJSON(t.startSelection),t.selectionsAfter.map(it.fromJSON))}static fromTransaction(t,n){let r=Jp;for(let s of t.startState.facet(gln)){let a=s(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new Od(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Jp)}static selection(t){return new Od(void 0,Jp,void 0,void 0,t)}}function z6(e,t,n,r){let s=t+1>n+20?t-n-1:0,a=e.slice(s,t);return a.push(r),a}function xln(e,t){let n=[],r=!1;return e.iterChangedRanges((s,a)=>n.push(s,a)),t.iterChangedRanges((s,a,i,l)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];l>=u&&i<=d&&(r=!0)}}),r}function wln(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function ort(e,t){return e.length?t.length?e.concat(t):e:t}const Jp=[],Sln=200;function lrt(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Sln));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),z6(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Od.selection([t])]}function kln(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function wW(e,t){if(!e.length)return e;let n=e.length,r=Jp;for(;n;){let s=_ln(e[n-1],t,r);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,n);return a[n-1]=s,a}else t=s.mapped,n--,r=s.selectionsAfter}return r.length?[Od.selection(r)]:Jp}function _ln(e,t,n){let r=ort(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):Jp,n);if(!e.changes)return Od.selection(r);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Od(s,hr.mapEffects(e.effects,t),i,e.startSelection.map(a),r)}const Oln=/^(input\.type|delete)($|\.)/;class Ng{constructor(t,n,r=0,s=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Ng(this.done,this.undone):this}addChanges(t,n,r,s,a){let i=this.done,l=i[i.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!r||Oln.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,xln(l.changes,t.changes))||r=="input.type.compose")?i=z6(i,i.length-1,s.minDepth,new Od(t.changes.compose(l.changes),ort(hr.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,Jp)):i=z6(i,i.length,s.minDepth,t),new Ng(i,Jp,n,r)}addSelection(t,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Jp;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&wln(a[a.length-1],t)?this:new Ng(lrt(this.done,t),this.undone,n,r)}addMapping(t){return new Ng(wW(this.done,t),wW(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){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):n.selection);if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:cle.of({side:t,rest:kln(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?Jp:s.slice(0,s.length-1);return a.mapped&&(l=wW(l,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:cle.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ng.empty=new Ng(Jp,Jp);const Eln=[{key:"Mod-z",run:irt,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ule,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ule,preventDefault:!0},{key:"Mod-u",run:yln,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:bln,preventDefault:!0}];function _j(e,t){return it.create(e.ranges.map(t),e.mainIndex)}function Rm(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Pm({state:e,dispatch:t},n){let r=_j(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Rm(e,r)),!0)}function Z8(e,t){return it.cursor(t?e.to:e.from)}function crt(e,t){return Pm(e,n=>n.empty?e.moveByChar(n,t):Z8(n,t))}function ou(e){return e.textDirectionAt(e.state.selection.main.head)==ai.LTR}const urt=e=>crt(e,!ou(e)),drt=e=>crt(e,ou(e));function frt(e,t){return Pm(e,n=>n.empty?e.moveByGroup(n,t):Z8(n,t))}const Cln=e=>frt(e,!ou(e)),jln=e=>frt(e,ou(e));function Tln(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function W8(e,t,n){let r=ei(e).resolveInner(t.head),s=n?Cr.closedBy:Cr.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;Tln(e,u,s)?r=u:c=n?u.to:u.from}let a=r.type.prop(s),i,l;return a&&(i=n?Tg(e,r.from,1):Tg(e,r.to,-1))&&i.matched?l=n?i.end.to:i.end.from:l=n?r.to:r.from,it.cursor(l,n?-1:1)}const Nln=e=>Pm(e,t=>W8(e.state,t,!ou(e))),Aln=e=>Pm(e,t=>W8(e.state,t,ou(e)));function prt(e,t){return Pm(e,n=>{if(!n.empty)return Z8(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const hrt=e=>prt(e,!1),mrt=e=>prt(e,!0);function grt(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,s;if(t){for(let a of e.state.facet(vt.scrollMargins)){let i=a(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}s=e.scrollDOM.clientHeight-n-r}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function vrt(e,t){let n=grt(e),{state:r}=e,s=_j(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):Z8(i,t));if(s.eq(r.selection))return!1;let a;if(n.selfScroll){let i=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;i&&i.top>c&&i.bottom<u&&(a=vt.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Rm(r,s),{effects:a}),!0}const jAe=e=>vrt(e,!1),dle=e=>vrt(e,!0);function nw(e,t,n){let r=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,n);if(s.head==t.head&&s.head!=(n?r.to:r.from)&&(s=e.moveToLineBoundary(t,n,!1)),!n&&s.head==r.from&&r.length){let a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(s=it.cursor(r.from+a))}return s}const Iln=e=>Pm(e,t=>nw(e,t,!0)),Rln=e=>Pm(e,t=>nw(e,t,!1)),Pln=e=>Pm(e,t=>nw(e,t,!ou(e))),$ln=e=>Pm(e,t=>nw(e,t,ou(e))),Mln=e=>Pm(e,t=>it.cursor(e.lineBlockAt(t.head).from,1)),Dln=e=>Pm(e,t=>it.cursor(e.lineBlockAt(t.head).to,-1));function Lln(e,t,n){let r=!1,s=_j(e.selection,a=>{let i=Tg(e,a.head,-1)||Tg(e,a.head,1)||a.head>0&&Tg(e,a.head-1,1)||a.head<e.doc.length&&Tg(e,a.head+1,-1);if(!i||!i.end)return a;r=!0;let l=i.start.from==a.head?i.end.to:i.end.from;return it.cursor(l)});return r?(t(Rm(e,s)),!0):!1}const zln=({state:e,dispatch:t})=>Lln(e,t);function Th(e,t){let n=_j(e.state.selection,r=>{let s=t(r);return it.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(Rm(e.state,n)),!0)}function yrt(e,t){return Th(e,n=>e.moveByChar(n,t))}const brt=e=>yrt(e,!ou(e)),xrt=e=>yrt(e,ou(e));function wrt(e,t){return Th(e,n=>e.moveByGroup(n,t))}const Fln=e=>wrt(e,!ou(e)),Bln=e=>wrt(e,ou(e)),Uln=e=>Th(e,t=>W8(e.state,t,!ou(e))),qln=e=>Th(e,t=>W8(e.state,t,ou(e)));function Srt(e,t){return Th(e,n=>e.moveVertically(n,t))}const krt=e=>Srt(e,!1),_rt=e=>Srt(e,!0);function Ort(e,t){return Th(e,n=>e.moveVertically(n,t,grt(e).height))}const TAe=e=>Ort(e,!1),NAe=e=>Ort(e,!0),Vln=e=>Th(e,t=>nw(e,t,!0)),Hln=e=>Th(e,t=>nw(e,t,!1)),Zln=e=>Th(e,t=>nw(e,t,!ou(e))),Wln=e=>Th(e,t=>nw(e,t,ou(e))),Qln=e=>Th(e,t=>it.cursor(e.lineBlockAt(t.head).from)),Gln=e=>Th(e,t=>it.cursor(e.lineBlockAt(t.head).to)),AAe=({state:e,dispatch:t})=>(t(Rm(e,{anchor:0})),!0),IAe=({state:e,dispatch:t})=>(t(Rm(e,{anchor:e.doc.length})),!0),RAe=({state:e,dispatch:t})=>(t(Rm(e,{anchor:e.selection.main.anchor,head:0})),!0),PAe=({state:e,dispatch:t})=>(t(Rm(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Yln=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Xln=({state:e,dispatch:t})=>{let n=Q8(e).map(({from:r,to:s})=>it.range(r,Math.min(s+1,e.doc.length)));return t(e.update({selection:it.create(n),userEvent:"select"})),!0},Kln=({state:e,dispatch:t})=>{let n=_j(e.selection,r=>{let s=ei(e),a=s.resolveStack(r.from,1);if(r.empty){let i=s.resolveStack(r.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<r.from&&l.to>=r.to||l.to>r.to&&l.from<=r.from)&&i.next)return it.range(l.to,l.from)}return r});return n.eq(e.selection)?!1:(t(Rm(e,n)),!0)};function Ert(e,t){let{state:n}=e,r=n.selection,s=n.selection.ranges.slice();for(let a of n.selection.ranges){let i=n.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==r.ranges.length?!1:(e.dispatch(Rm(n,it.create(s,s.length-1))),!0)}const Jln=e=>Ert(e,!1),ecn=e=>Ert(e,!0),tcn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=it.create([n.main]):n.main.empty||(r=it.create([it.cursor(n.main.head)])),r?(t(Rm(e,r)),!0):!1};function U$(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,s=r.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(n="delete.backward",c=$L(e,c,!1)):c>i&&(n="delete.forward",c=$L(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=$L(e,i,!1),l=$L(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:it.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?vt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function $L(e,t,n){if(e instanceof vt)for(let r of e.state.facet(vt.atomicRanges).map(s=>s(e)))r.between(t,t,(s,a)=>{s<t&&a>t&&(t=n?a:s)});return t}const Crt=(e,t,n)=>U$(e,r=>{let s=r.from,{state:a}=e,i=a.doc.lineAt(s),l,c;if(n&&!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=bm(l,a.tabSize),d=u%O1(a)||O1(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=Yl(i.text,s-i.from,t,t)+i.from,c==s&&i.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,s-i.from))&&(c=Yl(i.text,c-i.from,!1,!1)+i.from);return c}),fle=e=>Crt(e,!1,!0),jrt=e=>Crt(e,!0,!1),Trt=(e,t)=>U$(e,n=>{let r=n.head,{state:s}=e,a=s.doc.lineAt(r),i=s.charCategorizer(r);for(let l=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?s.doc.lines:1)&&(r+=t?1:-1);break}let c=Yl(a.text,r-a.from,t)+a.from,u=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),d=i(u);if(l!=null&&d!=l)break;(u!=" "||r!=n.head)&&(l=d),r=c}return r}),Nrt=e=>Trt(e,!1),ncn=e=>Trt(e,!0),rcn=e=>U$(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),scn=e=>U$(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),acn=e=>U$(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),icn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:aa.of(["",""])},range:it.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},ocn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let s=r.from,a=e.doc.lineAt(s),i=s==a.from?s-1:Yl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:Yl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:l,insert:e.doc.slice(s,l).append(e.doc.slice(i,s))},range:it.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Q8(e){let t=[],n=-1;for(let r of e.selection.ranges){let s=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(r)}else t.push({from:s.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Art(e,t,n){if(e.readOnly)return!1;let r=[],s=[];for(let a of Q8(e)){if(n?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(n?a.to+1:a.from-1),l=i.length+1;if(n){r.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(it.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{r.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(it.range(c.anchor-l,c.head-l))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:it.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const lcn=({state:e,dispatch:t})=>Art(e,t,!1),ccn=({state:e,dispatch:t})=>Art(e,t,!0);function Irt(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of Q8(e))n?r.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):r.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(r);return t(e.update({changes:s,selection:e.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ucn=({state:e,dispatch:t})=>Irt(e,t,!1),dcn=({state:e,dispatch:t})=>Irt(e,t,!0),fcn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Q8(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),r=_j(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(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function pcn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ei(e).resolveInner(t),r=n.childBefore(t),s=n.childAfter(t),a;return r&&s&&r.to<=t&&s.from>=t&&(a=r.type.prop(Cr.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const $Ae=Rrt(!1),hcn=Rrt(!0);function Rrt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(s=>{let{from:a,to:i}=s,l=t.doc.lineAt(a),c=!e&&a==i&&pcn(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new B8(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=Mhe(u,a);for(d==null&&(d=bm(/^\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=["",cR(t,d)];return c&&f.push(cR(t,u.lineIndent(l.from,-1))),{changes:{from:a,to:i,insert:aa.of(f)},range:it.cursor(a+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function gme(e,t){let n=-1;return e.changeByRange(r=>{let s=[];for(let i=r.from;i<=r.to;){let l=e.doc.lineAt(i);l.number>n&&(r.empty||r.to>l.from)&&(t(l,s,r),n=l.number),i=l.to+1}let a=e.changes(s);return{changes:s,range:it.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const mcn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new B8(e,{overrideIndentation:a=>{let i=n[a];return i??-1}}),s=gme(e,(a,i,l)=>{let c=Mhe(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=cR(e,c);(u!=d||l.from<a.from+u.length)&&(n[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},Prt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gme(e,(n,r)=>{r.push({from:n.from,insert:e.facet(wj)})}),{userEvent:"input.indent"})),!0),$rt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gme(e,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=bm(s,e.tabSize),i=0,l=cR(e,Math.max(0,a-O1(e)));for(;i<s.length&&i<l.length&&s.charCodeAt(i)==l.charCodeAt(i);)i++;r.push({from:n.from+i,to:n.from+s.length,insert:l.slice(i)})}),{userEvent:"delete.dedent"})),!0),gcn=e=>(e.setTabFocusMode(),!0),vcn=[{key:"Ctrl-b",run:urt,shift:brt,preventDefault:!0},{key:"Ctrl-f",run:drt,shift:xrt},{key:"Ctrl-p",run:hrt,shift:krt},{key:"Ctrl-n",run:mrt,shift:_rt},{key:"Ctrl-a",run:Mln,shift:Qln},{key:"Ctrl-e",run:Dln,shift:Gln},{key:"Ctrl-d",run:jrt},{key:"Ctrl-h",run:fle},{key:"Ctrl-k",run:rcn},{key:"Ctrl-Alt-h",run:Nrt},{key:"Ctrl-o",run:icn},{key:"Ctrl-t",run:ocn},{key:"Ctrl-v",run:dle}],ycn=[{key:"ArrowLeft",run:urt,shift:brt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Cln,shift:Fln,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Pln,shift:Zln,preventDefault:!0},{key:"ArrowRight",run:drt,shift:xrt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:jln,shift:Bln,preventDefault:!0},{mac:"Cmd-ArrowRight",run:$ln,shift:Wln,preventDefault:!0},{key:"ArrowUp",run:hrt,shift:krt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:AAe,shift:RAe},{mac:"Ctrl-ArrowUp",run:jAe,shift:TAe},{key:"ArrowDown",run:mrt,shift:_rt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:IAe,shift:PAe},{mac:"Ctrl-ArrowDown",run:dle,shift:NAe},{key:"PageUp",run:jAe,shift:TAe},{key:"PageDown",run:dle,shift:NAe},{key:"Home",run:Rln,shift:Hln,preventDefault:!0},{key:"Mod-Home",run:AAe,shift:RAe},{key:"End",run:Iln,shift:Vln,preventDefault:!0},{key:"Mod-End",run:IAe,shift:PAe},{key:"Enter",run:$Ae,shift:$Ae},{key:"Mod-a",run:Yln},{key:"Backspace",run:fle,shift:fle,preventDefault:!0},{key:"Delete",run:jrt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Nrt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ncn,preventDefault:!0},{mac:"Mod-Backspace",run:scn,preventDefault:!0},{mac:"Mod-Delete",run:acn,preventDefault:!0}].concat(vcn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),bcn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Nln,shift:Uln},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Aln,shift:qln},{key:"Alt-ArrowUp",run:lcn},{key:"Shift-Alt-ArrowUp",run:ucn},{key:"Alt-ArrowDown",run:ccn},{key:"Shift-Alt-ArrowDown",run:dcn},{key:"Mod-Alt-ArrowUp",run:Jln},{key:"Mod-Alt-ArrowDown",run:ecn},{key:"Escape",run:tcn},{key:"Mod-Enter",run:hcn},{key:"Alt-l",mac:"Ctrl-l",run:Xln},{key:"Mod-i",run:Kln,preventDefault:!0},{key:"Mod-[",run:$rt},{key:"Mod-]",run:Prt},{key:"Mod-Alt-\\",run:mcn},{key:"Shift-Mod-k",run:fcn},{key:"Shift-Mod-\\",run:zln},{key:"Mod-/",run:lln},{key:"Alt-A",run:uln},{key:"Ctrl-m",mac:"Shift-Alt-m",run:gcn}].concat(ycn),xcn={key:"Tab",run:Prt,shift:$rt},MAe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Vy{constructor(t,n,r=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(r,s),this.bufferStart=r,this.normalize=a?l=>a(MAe(l)):MAe,this.query=this.normalize(n)}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 vd(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 n=vhe(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=vg(t);let s=this.normalize(n);if(s.length)for(let a=0,i=r;;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==r&&a<n.length&&n.charCodeAt(a)==l&&i++}}}match(t,n,r){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:r}:(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:n,to:r}:this.matches.push(1,n)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(Vy.prototype[Symbol.iterator]=function(){return this});const Mrt={from:-1,to:-1,match:/.*/.exec("")},vme="gm"+(/x/.unicode==null?"":"u");class Drt{constructor(t,n,r,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=Mrt,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Lrt(t,n,r,s,a);this.re=new RegExp(n,vme+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=F6(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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=F6(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},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 SW=new WeakMap;class pE{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let s=SW.get(t);if(!s||s.from>=r||s.to<=n){let l=new pE(n,t.sliceString(n,r));return SW.set(t,l),l}if(s.from==n&&s.to==r)return s;let{text:a,from:i}=s;return i>n&&(a=t.sliceString(n,i)+a,i=n),s.to<r&&(a+=t.sliceString(s.to,r)),SW.set(t,new pE(i,a)),new pE(n,a.slice(n-i,r-i))}}class Lrt{constructor(t,n,r,s,a){this.text=t,this.to=a,this.done=!1,this.value=Mrt,this.matchPos=F6(t,s),this.re=new RegExp(n,vme+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=pE.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,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=F6(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pE.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Drt.prototype[Symbol.iterator]=Lrt.prototype[Symbol.iterator]=function(){return this});function wcn(e){try{return new RegExp(e,vme),!0}catch{return!1}}function F6(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const Scn=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:s}=lrn(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},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:r});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,p=d?+d.slice(1):0,h=u?+u:l.number;if(u&&f){let v=h/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),h=Math.round(t.doc.lines*v)}else u&&c&&(h=h*(c=="-"?-1:1)+l.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,h))),g=it.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[r,vt.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},kcn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},_cn=on.define({combine(e){return mv(e,kcn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Ocn(e){return[Ncn,Tcn]}const Ecn=dn.mark({class:"cm-selectionMatch"}),Ccn=dn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function DAe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Zi.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Zi.Word)}function jcn(e,t,n,r){return e(t.sliceDoc(n,n+1))==Zi.Word&&e(t.sliceDoc(r-1,r))==Zi.Word}const Tcn=Gi.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(_cn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return dn.none;let s=r.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return dn.none;let c=n.wordAt(s.head);if(!c)return dn.none;i=n.charCategorizer(s.head),a=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return dn.none;if(t.wholeWords){if(a=n.sliceDoc(s.from,s.to),i=n.charCategorizer(s.head),!(DAe(i,n,s.from,s.to)&&jcn(i,n,s.from,s.to)))return dn.none}else if(a=n.sliceDoc(s.from,s.to),!a)return dn.none}let l=[];for(let c of e.visibleRanges){let u=new Vy(n.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||DAe(i,n,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(Ccn.range(d,f)):(d>=s.to||f<=s.from)&&l.push(Ecn.range(d,f)),l.length>t.maxMatches))return dn.none}}return dn.set(l)}},{decorations:e=>e.decorations}),Ncn=vt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Acn=({state:e,dispatch:t})=>{let{selection:n}=e,r=it.create(n.ranges.map(s=>e.wordAt(s.head)||it.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Icn(e,t){let{main:n,ranges:r}=e.selection,s=e.wordAt(n.head),a=s&&s.from==n.from&&s.to==n.to;for(let i=!1,l=new Vy(e.doc,t,r[r.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new Vy(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),i=!0}else{if(i&&r.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 Rcn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return Acn({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=r))return!1;let s=Icn(e,r);return s?(t(e.update({selection:e.selection.addRange(it.range(s.from,s.to),!1),effects:vt.scrollIntoView(s.to)})),!0):!1},Oj=on.define({combine(e){return mv(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Wcn(t),scrollToMatch:t=>vt.scrollIntoView(t)})}});class zrt{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||wcn(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,(n,r)=>r=="n"?`
|
|
115
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),dd('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),dd('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],knt=sme.concat([dd("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),dd("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),dd("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),xAe=new wJe,_nt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function mN(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const Ron=["FunctionDeclaration"],Pon={FunctionDeclaration:mN("function"),ClassDeclaration:mN("class"),ClassExpression:()=>!0,EnumDeclaration:mN("constant"),TypeAliasDeclaration:mN("type"),NamespaceDeclaration:mN("namespace"),VariableDefinition(e,t){e.matchContext(Ron)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function Ont(e,t){let n=xAe.get(t);if(n)return n;let r=[],s=!0;function a(i,l){let c=e.sliceString(i.from,i.to);r.push({label:c,type:l})}return t.cursor(Sa.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let l=Pon[i.name];if(l&&l(i,a)||_nt.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of Ont(e,i.node))r.push(l);return!1}}),xAe.set(t,r),r}const D6=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,ame=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Ent(e){let t=ei(e.state).resolveInner(e.pos,-1);if(ame.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&D6.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)_nt.has(s.name)&&(r=r.concat(Ont(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:D6}}function hW(e,t,n){var r;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:n};if(a?.name=="MemberExpression"&&((r=i=a.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function Cnt(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=ei(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?hW(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?hW(t,n.parent,""):ame.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&D6.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?hW(t,n,""):e.explicit?{path:[],name:""}:null}function $on(e,t){let n=e,r=[],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=n[l]}catch{continue}r.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 r;e=i}}function Mon(e){let t=new Map;return n=>{let r=Cnt(n);if(!r)return null;let s=e;for(let i of r.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=$on(s,!r.path.length)),{from:n.pos-r.name.length,options:a,validFor:D6}}}const oh=S1.define({name:"javascript",parser:Ion.configure({props:[Ck.add({IfStatement:dE({except:/^\s*({|else\b)/}),TryStatement:dE({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Irn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Arn({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":dE({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}}),jk.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Lhe,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 n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,r=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?e.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),jnt={test:e=>/^JSX/.test(e.name),facet:F8({commentTokens:{block:{open:"{/*",close:"*/}"}}})},ime=oh.configure({dialect:"ts"},"typescript"),ome=oh.configure({dialect:"jsx",props:[$he.add(e=>e.isTop?[jnt]:void 0)]}),lme=oh.configure({dialect:"jsx ts",props:[$he.add(e=>e.isTop?[jnt]:void 0)]},"typescript");let Tnt=e=>({label:e,type:"keyword"});const Nnt="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(Tnt),Don=Nnt.concat(["declare","implements","private","protected","public"].map(Tnt));function L6(e={}){let t=e.jsx?e.typescript?lme:ome:e.typescript?ime:oh,n=e.typescript?knt.concat(Don):sme.concat(Nnt);return new _1(t,[oh.data.of({autocomplete:vsn(ame,Ott(n))}),oh.data.of({autocomplete:Ent}),e.jsx?Ant:[]])}function Lon(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 wAe(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const zon=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Ant=vt.inputHandler.of((e,t,n,r,s)=>{if((zon?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!oh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u;let{head:d}=c,f=ei(i).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==d-2&&((p=wAe(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:it.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=Lon(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=wAe(i.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function Fon(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((n,r)=>{var s;!((s=n.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,s=[];for(let{from:a,to:i}of oh.findRegions(r)){let l=r.doc.lineAt(a),c={line:l.number-1,col:a-l.from,pos:a};for(let u of e.verify(r.sliceDoc(a,i),t))s.push(Bon(u,r.doc,c))}return s}}function SAe(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function Bon(e,t,n){let r=SAe(e.line,e.column,t,n),s={from:r,to:e.endLine!=null&&e.endColumn!=1?SAe(e.endLine,e.endColumn,t,n):r,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]+n.pos-r,c=a[1]+n.pos-r;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+l,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const PL=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Ant,completionPath:Cnt,esLint:Fon,javascript:L6,javascriptLanguage:oh,jsxLanguage:ome,localCompletionSource:Ent,scopeCompletionSource:Mon,snippets:sme,tsxLanguage:lme,typescriptLanguage:ime,typescriptSnippets:knt},Symbol.toStringTag,{value:"Module"})),gN=["_blank","_self","_top","_parent"],mW=["ascii","utf-8","utf-16","latin1","latin1"],gW=["get","post","put","delete"],vW=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],df=["true","false"],Wn={},Uon={a:{attrs:{href:null,ping:null,type:null,media:null,target:gN,hreflang:null}},abbr:Wn,address:Wn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Wn,aside:Wn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Wn,base:{attrs:{href:null,target:gN}},bdi:Wn,bdo:Wn,blockquote:{attrs:{cite:null}},body:Wn,br:Wn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:vW,formmethod:gW,formnovalidate:["novalidate"],formtarget:gN,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Wn,center:Wn,cite:Wn,code:Wn,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:Wn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Wn,div:Wn,dl:Wn,dt:Wn,em:Wn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Wn,figure:Wn,footer:Wn,form:{attrs:{action:null,name:null,"accept-charset":mW,autocomplete:["on","off"],enctype:vW,method:gW,novalidate:["novalidate"],target:gN}},h1:Wn,h2:Wn,h3:Wn,h4:Wn,h5:Wn,h6:Wn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Wn,hgroup:Wn,hr:Wn,html:{attrs:{manifest:null}},i:Wn,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:vW,formmethod:gW,formnovalidate:["novalidate"],formtarget:gN,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:Wn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Wn,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:Wn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mW,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:Wn,noscript:Wn,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:Wn,param:{attrs:{name:null,value:null}},pre:Wn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Wn,rt:Wn,ruby:Wn,samp:Wn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mW}},section:Wn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Wn,source:{attrs:{src:null,type:null,media:null}},span:Wn,strong:Wn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Wn,summary:Wn,sup:Wn,table:Wn,tbody:Wn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Wn,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:Wn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Wn,time:{attrs:{datetime:null}},title:Wn,tr:Wn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Wn,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:Wn},Int={accesskey:null,class:null,contenteditable:df,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:df,autocorrect:df,autocapitalize:df,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":df,"aria-autocomplete":["inline","list","both","none"],"aria-busy":df,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":df,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":df,"aria-hidden":df,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":df,"aria-multiselectable":df,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":df,"aria-relevant":null,"aria-required":df,"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},Rnt="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 Rnt)Int[e]=null;let yR=class{constructor(t,n){this.tags={...Uon,...t},this.globalAttrs={...Int,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};yR.default=new yR;function nC(e,t,n=e.length){if(!t)return"";let r=t.firstChild,s=r&&r.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,n)):""}function rC(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function Pnt(e,t,n){let r=n.tags[nC(e,rC(t))];return r?.children||n.allTags}function cme(e,t){let n=[];for(let r=rC(t);r&&!r.type.isTop;r=rC(r.parent)){let s=nC(e,r);if(s&&r.lastChild.name=="CloseTag")break;s&&n.indexOf(s)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(s)}return n}const $nt=/^[:\-\.\w\u00b7-\uffff]*$/;function kAe(e,t,n,r,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=rC(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:s,options:Pnt(e.doc,i,t).map(l=>({label:l,type:"type"})).concat(cme(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function _Ae(e,t,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:cme(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:$nt}}function qon(e,t,n,r){let s=[],a=0;for(let i of Pnt(e.doc,n,t))s.push({label:"<"+i,type:"type"});for(let i of cme(e.doc,n))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Von(e,t,n,r,s){let a=rC(n),i=a?t.tags[nC(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:r,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:$nt}}function Hon(e,t,n,r,s){var a;let i=(a=n.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=rC(n),p=f?t.tags[nC(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,s).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let m of d)l.push({label:m,apply:p+m+h,type:"constant"})}}return{from:r,to:s,options:l,validFor:c}}function Mnt(e,t){let{state:n,pos:r}=t,s=ei(n).resolveInner(r,-1),a=s.resolve(r);for(let i=r,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)?_Ae(n,s,s.from,r):kAe(n,e,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?kAe(n,e,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?_Ae(n,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Von(n,e,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?Hon(n,e,s,s.name=="Is"?r:s.from,r):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?qon(n,e,s,r):null}function Dnt(e){return Mnt(yR.default,e)}function Lnt(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new yR(t,n):yR.default;return s=>Mnt(r,s)}const Zon=oh.parser.configure({top:"SingleExpression"}),znt=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:ime.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:ome.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:lme.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Zon},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:oh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:vR.parser}],Fnt=[{name:"style",parser:vR.parser.configure({top:"Styles"})}].concat(Rnt.map(e=>({name:e,parser:oh.parser}))),Bnt=S1.define({name:"html",parser:win.configure({props:[Ck.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,n;for(let r=e.node;;){let s=r.lastChild;if(!s||s.name!="Element"||s.to!=r.to)break;t=r=s}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),jk.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),ytt.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),aI=Bnt.configure({wrap:pnt(znt,Fnt)});function Unt(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=pnt((e.nestedLanguages||[]).concat(znt),(e.nestedAttributes||[]).concat(Fnt)));let r=n?Bnt.configure({wrap:n,dialect:t}):t?aI.configure({dialect:t}):aI;return new _1(r,[aI.data.of({autocomplete:Lnt(e)}),e.autoCloseTags!==!1?qnt:[],L6().support,wnt().support])}const OAe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),qnt=vt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!aI.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,l=i.changeByRange(c=>{var u,d,f;let p=i.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,m=ei(i).resolveInner(h,-1),g;if(p&&r==">"&&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=nC(i.doc,v.parent,h))&&!OAe.has(g)){let x=h+(i.doc.sliceString(h,h+1)===">"?1:0),w=`</${g}>`;return{range:c,changes:{from:h,to:x,insert:w}}}}else if(p&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=nC(i.doc,v,h))&&!OAe.has(g)){let x=h+(i.doc.sliceString(h,h+1)===">"?1:0),w=`${g}>`;return{range:it.cursor(h+w.length,-1),changes:{from:h,to:x,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([a,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Won=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:qnt,html:Unt,htmlCompletionSource:Dnt,htmlCompletionSourceWith:Lnt,htmlLanguage:aI},Symbol.toStringTag,{value:"Module"})),Vnt=F8({commentTokens:{block:{open:"<!--",close:"-->"}}}),Hnt=new Cr,Znt=kan.configure({props:[jk.add(e=>!e.is("Block")||e.is("Document")||lle(e)!=null||Qon(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),Hnt.add(lle),Ck.add({Document:()=>null}),zx.add({Document:Vnt})]});function lle(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Qon(e){return e.name=="OrderedList"||e.name=="BulletList"}function Gon(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=lle(r.type))!=null&&s<=t)break;n=r}return n.to}const Yon=itt.of((e,t,n)=>{for(let r=ei(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(Hnt);if(s==null)continue;let a=Gon(r,s);if(a>n)return{from:n,to:a}}return null});function ume(e){return new Pf(Vnt,e,[],"markdown")}const Wnt=ume(Znt),Xon=Znt.configure([Pan,Man,$an,Dan,{props:[jk.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),C1=ume(Xon);function Kon(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=Je.matchLanguageName(e,n,!0),r instanceof Je)return r.support?r.support.language.parser:k1.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class yW{constructor(t,n,r,s,a,i,l){this.node=t,this.from=n,this.to=r,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=l}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+Gnt(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function Qnt(e,t){let n=[],r=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&n.push(s)}for(let s=n.length-1;s>=0;s--){let a=n[s],i,l=t.lineAt(a.from),c=a.from-l.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(c))))r.push(new yW(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),r.push(new yW(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]/," ")),r.push(new yW(a.parent,c,c+d,i[1],u,f,a))}}return r}function Gnt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function bW(e,t,n,r=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let l=Gnt(a,t),c=+l[2];if(s>=0){if(c!=s+1)return;n.push({from:a.from+l[1].length,to:a.from+l[0].length,insert:String(s+2+r)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function dme(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(wj)!=" ")return e;let r=bm(e,4,n),s="";for(let a=r;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(n)}const Ynt=(e={})=>({state:t,dispatch:n})=>{let r=ei(t),{doc:s}=t,a=null,i=t.changeByRange(l=>{if(!l.empty||!C1.isActiveAt(t,l.from,-1)&&!C1.isActiveAt(t,l.from,1))return a={range:l};let c=l.from,u=s.lineAt(c),d=Qnt(r.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 p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){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,_,O="";S&&S.item?(_=u.from+S.from,O=S.marker(s,1)):_=u.from+(S?S.to:0);let E=[{from:_,to:c,insert:O}];return f.node.name=="OrderedList"&&bW(f.item,s,E,-2),S&&S.node.name=="OrderedList"&&bW(S.item,s,E),{range:it.cursor(_+O.length),changes:E}}else{let S=CAe(d,t,u);return{range:it.cursor(c+S.length+1),changes:{from:u.from,insert:S+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&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 h=[];f.node.name=="OrderedList"&&bW(f.item,s,h);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?bm(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=dme(g,t),Jon(f.node,t.doc)&&(g=CAe(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:it.cursor(v+g.length+1),changes:h}});return a?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},Xnt=Ynt();function EAe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function Jon(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),a=t.lineAt(r.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function CAe(e,t,n){let r="";for(let s=0,a=e.length-2;s<=a;s++)r+=e[s].blank(s<a?bm(n.text,4,e[s+1].from)-r.length:null,s<a);return dme(r,t)}function eln(e,t){let n=e.resolveInner(t,-1),r=t;EAe(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(EAe(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const Knt=({state:e,dispatch:t})=>{let n=ei(e),r=null,s=e.changeByRange(a=>{let i=a.from,{doc:l}=e;if(a.empty&&C1.isActiveAt(e,a.from)){let c=l.lineAt(i),u=Qnt(eln(n,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:it.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 p=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(bm(c.text,4,d.to)-bm(c.text,4,d.from));return p==c.from&&(h=dme(h,e)),{range:it.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:it.cursor(p),changes:{from:p,to:i}}}}}return r={range:a}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},Jnt=[{key:"Enter",run:Xnt},{key:"Backspace",run:Knt}],ert=Unt({matchClosingTags:!1});function fme(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=Wnt,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:l=ert}=e;if(!(s instanceof V8))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[l.support,Yon],d;i&&u.push(trt),n instanceof _1?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?Kon(t,d):void 0;c.push(Oan({codeParser:f,htmlParser:l.language.parser})),r&&u.push(Am.high(xj.of(Jnt)));let p=ume(s.configure(c));return a&&u.push(p.data.of({autocomplete:tln})),new _1(p,u)}function tln(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=ei(t).resolveInner(n,-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:n-r[0].length,to:n,options:nln(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xW=null;function nln(){if(xW)return xW;let e=Dnt(new Uhe(es.create({extensions:ert}),0,!0));return xW=e?e.options:[]}const rln=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,trt=vt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!C1.isActiveAt(t.state,r.from,1)))return!1;let a=ei(t.state),i=!1;return a.iterate({from:r.from,to:r.to,enter:l=>{(l.from>r.from||rln.test(l.name))&&(i=!0)},leave:l=>{l.to<r.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),sln=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Wnt,deleteMarkupBackward:Knt,insertNewlineContinueMarkup:Xnt,insertNewlineContinueMarkupCommand:Ynt,markdown:fme,markdownKeymap:Jnt,markdownLanguage:C1,pasteURLAsLink:trt},Symbol.toStringTag,{value:"Module"}));function yt(e){return new _1(zhe.define(e))}function sx(e){return tt(()=>import("./index-bWOYDAHF.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const nrt=[Je.of({name:"C",extensions:["c","h","ino"],load(){return tt(()=>import("./index-aMP3lwxt.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Je.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return tt(()=>import("./index-aMP3lwxt.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Je.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return sx("Cassandra")}}),Je.of({name:"CSS",extensions:["css"],load(){return tt(()=>Promise.resolve().then(()=>ton),void 0,import.meta.url).then(e=>e.css())}}),Je.of({name:"Go",extensions:["go"],load(){return tt(()=>import("./index-C2OqAplM.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Je.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return tt(()=>Promise.resolve().then(()=>Won),void 0,import.meta.url).then(e=>e.html())}}),Je.of({name:"Java",extensions:["java"],load(){return tt(()=>import("./index-B818jJF8.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Je.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return tt(()=>Promise.resolve().then(()=>PL),void 0,import.meta.url).then(e=>e.javascript())}}),Je.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return tt(()=>import("./index-DHBy70un.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Je.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return tt(()=>Promise.resolve().then(()=>msn),void 0,import.meta.url).then(e=>e.json())}}),Je.of({name:"JSX",extensions:["jsx"],load(){return tt(()=>Promise.resolve().then(()=>PL),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Je.of({name:"LESS",extensions:["less"],load(){return tt(()=>import("./index-DT-bmX_c.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Je.of({name:"Liquid",extensions:["liquid"],load(){return tt(()=>import("./index-BRnbZ_zY.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Je.of({name:"MariaDB SQL",load(){return sx("MariaSQL")}}),Je.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return tt(()=>Promise.resolve().then(()=>sln),void 0,import.meta.url).then(e=>e.markdown())}}),Je.of({name:"MS SQL",load(){return sx("MSSQL")}}),Je.of({name:"MySQL",load(){return sx("MySQL")}}),Je.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return tt(()=>import("./index-BcbyRcdO.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Je.of({name:"PLSQL",extensions:["pls"],load(){return sx("PLSQL")}}),Je.of({name:"PostgreSQL",load(){return sx("PostgreSQL")}}),Je.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return tt(()=>import("./index-DE1Uf-DZ.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Je.of({name:"Rust",extensions:["rs"],load(){return tt(()=>import("./index-C4t9LjwW.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Je.of({name:"Sass",extensions:["sass"],load(){return tt(()=>import("./index-0ZhaJMzn.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Je.of({name:"SCSS",extensions:["scss"],load(){return tt(()=>import("./index-0ZhaJMzn.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Je.of({name:"SQL",extensions:["sql"],load(){return sx("StandardSQL")}}),Je.of({name:"SQLite",load(){return sx("SQLite")}}),Je.of({name:"TSX",extensions:["tsx"],load(){return tt(()=>Promise.resolve().then(()=>PL),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Je.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return tt(()=>Promise.resolve().then(()=>PL),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Je.of({name:"WebAssembly",extensions:["wat","wast"],load(){return tt(()=>import("./index-Bd3KOA-e.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Je.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return tt(()=>import("./index-DU3FtUyc.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Je.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return tt(()=>import("./index-BUA1uxDU.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Je.of({name:"APL",extensions:["dyalog","apl"],load(){return tt(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>yt(e.apl))}}),Je.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return tt(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>yt(e.asciiArmor))}}),Je.of({name:"ASN.1",extensions:["asn","asn1"],load(){return tt(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>yt(e.asn1({})))}}),Je.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return tt(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>yt(e.asterisk))}}),Je.of({name:"Brainfuck",extensions:["b","bf"],load(){return tt(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>yt(e.brainfuck))}}),Je.of({name:"Cobol",extensions:["cob","cpy"],load(){return tt(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>yt(e.cobol))}}),Je.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.csharp))}}),Je.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return tt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>yt(e.clojure))}}),Je.of({name:"ClojureScript",extensions:["cljs"],load(){return tt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>yt(e.clojure))}}),Je.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return tt(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>yt(e.gss))}}),Je.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return tt(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>yt(e.cmake))}}),Je.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return tt(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>yt(e.coffeeScript))}}),Je.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return tt(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>yt(e.commonLisp))}}),Je.of({name:"Cypher",extensions:["cyp","cypher"],load(){return tt(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>yt(e.cypher))}}),Je.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return tt(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>yt(e.cython))}}),Je.of({name:"Crystal",extensions:["cr"],load(){return tt(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>yt(e.crystal))}}),Je.of({name:"D",extensions:["d"],load(){return tt(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>yt(e.d))}}),Je.of({name:"Dart",extensions:["dart"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.dart))}}),Je.of({name:"diff",extensions:["diff","patch"],load(){return tt(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>yt(e.diff))}}),Je.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return tt(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>yt(e.dockerFile))}}),Je.of({name:"DTD",extensions:["dtd"],load(){return tt(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>yt(e.dtd))}}),Je.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return tt(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>yt(e.dylan))}}),Je.of({name:"EBNF",load(){return tt(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>yt(e.ebnf))}}),Je.of({name:"ECL",extensions:["ecl"],load(){return tt(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>yt(e.ecl))}}),Je.of({name:"edn",extensions:["edn"],load(){return tt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>yt(e.clojure))}}),Je.of({name:"Eiffel",extensions:["e"],load(){return tt(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>yt(e.eiffel))}}),Je.of({name:"Elm",extensions:["elm"],load(){return tt(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>yt(e.elm))}}),Je.of({name:"Erlang",extensions:["erl"],load(){return tt(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>yt(e.erlang))}}),Je.of({name:"Esper",load(){return tt(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>yt(e.esper))}}),Je.of({name:"Factor",extensions:["factor"],load(){return tt(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>yt(e.factor))}}),Je.of({name:"FCL",load(){return tt(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>yt(e.fcl))}}),Je.of({name:"Forth",extensions:["forth","fth","4th"],load(){return tt(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>yt(e.forth))}}),Je.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return tt(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>yt(e.fortran))}}),Je.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return tt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>yt(e.fSharp))}}),Je.of({name:"Gas",extensions:["s"],load(){return tt(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>yt(e.gas))}}),Je.of({name:"Gherkin",extensions:["feature"],load(){return tt(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>yt(e.gherkin))}}),Je.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return tt(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>yt(e.groovy))}}),Je.of({name:"Haskell",extensions:["hs"],load(){return tt(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>yt(e.haskell))}}),Je.of({name:"Haxe",extensions:["hx"],load(){return tt(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>yt(e.haxe))}}),Je.of({name:"HXML",extensions:["hxml"],load(){return tt(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>yt(e.hxml))}}),Je.of({name:"HTTP",load(){return tt(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>yt(e.http))}}),Je.of({name:"IDL",extensions:["pro"],load(){return tt(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>yt(e.idl))}}),Je.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return tt(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>yt(e.jsonld))}}),Je.of({name:"Julia",extensions:["jl"],load(){return tt(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>yt(e.julia))}}),Je.of({name:"Kotlin",extensions:["kt","kts"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.kotlin))}}),Je.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return tt(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>yt(e.liveScript))}}),Je.of({name:"Lua",extensions:["lua"],load(){return tt(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>yt(e.lua))}}),Je.of({name:"mIRC",extensions:["mrc"],load(){return tt(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>yt(e.mirc))}}),Je.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return tt(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>yt(e.mathematica))}}),Je.of({name:"Modelica",extensions:["mo"],load(){return tt(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>yt(e.modelica))}}),Je.of({name:"MUMPS",extensions:["mps"],load(){return tt(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>yt(e.mumps))}}),Je.of({name:"Mbox",extensions:["mbox"],load(){return tt(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>yt(e.mbox))}}),Je.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return tt(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>yt(e.nginx))}}),Je.of({name:"NSIS",extensions:["nsh","nsi"],load(){return tt(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>yt(e.nsis))}}),Je.of({name:"NTriples",extensions:["nt","nq"],load(){return tt(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>yt(e.ntriples))}}),Je.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.objectiveC))}}),Je.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.objectiveCpp))}}),Je.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return tt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>yt(e.oCaml))}}),Je.of({name:"Octave",extensions:["m"],load(){return tt(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>yt(e.octave))}}),Je.of({name:"Oz",extensions:["oz"],load(){return tt(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>yt(e.oz))}}),Je.of({name:"Pascal",extensions:["p","pas"],load(){return tt(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>yt(e.pascal))}}),Je.of({name:"Perl",extensions:["pl","pm"],load(){return tt(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>yt(e.perl))}}),Je.of({name:"Pig",extensions:["pig"],load(){return tt(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>yt(e.pig))}}),Je.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return tt(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>yt(e.powerShell))}}),Je.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return tt(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>yt(e.properties))}}),Je.of({name:"ProtoBuf",extensions:["proto"],load(){return tt(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>yt(e.protobuf))}}),Je.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return tt(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>yt(e.pug))}}),Je.of({name:"Puppet",extensions:["pp"],load(){return tt(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>yt(e.puppet))}}),Je.of({name:"Q",extensions:["q"],load(){return tt(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>yt(e.q))}}),Je.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return tt(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>yt(e.r))}}),Je.of({name:"RPM Changes",load(){return tt(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>yt(e.rpmChanges))}}),Je.of({name:"RPM Spec",extensions:["spec"],load(){return tt(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>yt(e.rpmSpec))}}),Je.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return tt(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>yt(e.ruby))}}),Je.of({name:"SAS",extensions:["sas"],load(){return tt(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>yt(e.sas))}}),Je.of({name:"Scala",extensions:["scala"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.scala))}}),Je.of({name:"Scheme",extensions:["scm","ss"],load(){return tt(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>yt(e.scheme))}}),Je.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return tt(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>yt(e.shell))}}),Je.of({name:"Sieve",extensions:["siv","sieve"],load(){return tt(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>yt(e.sieve))}}),Je.of({name:"Smalltalk",extensions:["st"],load(){return tt(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>yt(e.smalltalk))}}),Je.of({name:"Solr",load(){return tt(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>yt(e.solr))}}),Je.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return tt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>yt(e.sml))}}),Je.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return tt(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>yt(e.sparql))}}),Je.of({name:"Spreadsheet",alias:["excel","formula"],load(){return tt(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>yt(e.spreadsheet))}}),Je.of({name:"Squirrel",extensions:["nut"],load(){return tt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>yt(e.squirrel))}}),Je.of({name:"Stylus",extensions:["styl"],load(){return tt(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>yt(e.stylus))}}),Je.of({name:"Swift",extensions:["swift"],load(){return tt(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>yt(e.swift))}}),Je.of({name:"sTeX",load(){return tt(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>yt(e.stex))}}),Je.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return tt(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>yt(e.stex))}}),Je.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return tt(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>yt(e.verilog))}}),Je.of({name:"Tcl",extensions:["tcl"],load(){return tt(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>yt(e.tcl))}}),Je.of({name:"Textile",extensions:["textile"],load(){return tt(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>yt(e.textile))}}),Je.of({name:"TiddlyWiki",load(){return tt(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>yt(e.tiddlyWiki))}}),Je.of({name:"Tiki wiki",load(){return tt(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>yt(e.tiki))}}),Je.of({name:"TOML",extensions:["toml"],load(){return tt(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>yt(e.toml))}}),Je.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return tt(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>yt(e.troff))}}),Je.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return tt(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>yt(e.ttcn))}}),Je.of({name:"TTCN_CFG",extensions:["cfg"],load(){return tt(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>yt(e.ttcnCfg))}}),Je.of({name:"Turtle",extensions:["ttl"],load(){return tt(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>yt(e.turtle))}}),Je.of({name:"Web IDL",extensions:["webidl"],load(){return tt(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>yt(e.webIDL))}}),Je.of({name:"VB.NET",extensions:["vb"],load(){return tt(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>yt(e.vb))}}),Je.of({name:"VBScript",extensions:["vbs"],load(){return tt(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>yt(e.vbScript))}}),Je.of({name:"Velocity",extensions:["vtl"],load(){return tt(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>yt(e.velocity))}}),Je.of({name:"Verilog",extensions:["v"],load(){return tt(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>yt(e.verilog))}}),Je.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return tt(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>yt(e.vhdl))}}),Je.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return tt(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>yt(e.xQuery))}}),Je.of({name:"Yacas",extensions:["ys"],load(){return tt(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>yt(e.yacas))}}),Je.of({name:"Z80",extensions:["z80"],load(){return tt(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>yt(e.z80))}}),Je.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return tt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>yt(e.mscgen))}}),Je.of({name:"Xù",extensions:["xu"],load(){return tt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>yt(e.xu))}}),Je.of({name:"MsGenny",extensions:["msgenny"],load(){return tt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>yt(e.msgenny))}}),Je.of({name:"Vue",extensions:["vue"],load(){return tt(()=>import("./index-B_OqxYGM.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Je.of({name:"Angular Template",load(){return tt(()=>import("./index-Btqfk5yp.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function S0(){return S0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S0.apply(null,arguments)}var aln=e=>{var{theme:t,settings:n={},styles:r=[]}=e,s={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(s["&"]=a),n.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(s[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(s[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(s[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(s[".cm-content"]={caretColor:n.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var i={};n.gutterActiveForeground&&(i.color=n.gutterActiveForeground),n.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:n.lineHighlight},i.backgroundColor=n.lineHighlight),s[".cm-activeLineGutter"]=i,n.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var l=vt.theme(s,{dark:t==="dark"}),c=Im.define(r),u=[l,tw(c)];return u},iln={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)"},oln=[{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"}],kj=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return aln({theme:t,settings:S0({},iln,n),styles:[...oln,...r]})};kj();function pme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}const lln=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=mme(e.state,n.from);return r.line?cln(e):r.block?dln(e):!1};function hme(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=e(t,n);return s?(r(n.update(s)),!0):!1}}const cln=hme(hln,0),uln=hme(rrt,0),dln=hme((e,t)=>rrt(e,t,pln(t)),0);function mme(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const vN=50;function fln(e,{open:t,close:n},r,s){let a=e.sliceDoc(r-vN,r),i=e.sliceDoc(s,s+vN),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+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-r<=2*vN?d=f=e.sliceDoc(r,s):(d=e.sliceDoc(r,r+vN),f=e.sliceDoc(s-vN,s));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(m,m+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:s-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function pln(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),s=n.to<=r.to?r:e.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=s.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return t}function rrt(e,t,n=t.selection.ranges){let r=n.map(a=>mme(t,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,i)=>fln(t,r[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(n.map((a,i)=>s[i]?[]:[{from:a.from,insert:r[i].open+" "},{from:a.to,insert:" "+r[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=r[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 hln(e,t,n=t.selection.ranges){let r=[],s=-1;e:for(let{from:a,to:i}of n){let l=r.length,c=1e9,u;for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(u==null&&(u=mme(t,f.from).line,!u))continue e;if(f.from>s&&(a==i||i>f.from)){s=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,m=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:m,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=l;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==l+1&&(r[l].single=!0)}if(e!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of r)(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&&r.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:l,token:c}of r)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 cle=hv.define(),mln=hv.define(),gln=on.define(),srt=on.define({combine(e){return mv(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,s)=>t(r,s)||n(r,s)})}}),art=tl.define({create(){return Ng.empty},update(e,t){let n=t.state.facet(srt),r=t.annotation(cle);if(r){let c=Od.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=z6(d,d.length,n.minDepth,c):d=lrt(d,t.startState.selection),new Ng(u==0?r.rest:d,u==0?d:r.rest)}let s=t.annotation(mln);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(pl.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Od.fromTransaction(t),i=t.annotation(pl.time),l=t.annotation(pl.userEvent);return a?e=e.addChanges(a,i,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,i,l,n.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 Ng(e.done.map(Od.fromJSON),e.undone.map(Od.fromJSON))}});function vln(e={}){return[art,srt.of(e),vt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?irt:t.inputType=="historyRedo"?ule:null;return r?(t.preventDefault(),r(n)):!1}})]}function H8(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let s=n.field(art,!1);if(!s)return!1;let a=s.pop(e,n,t);return a?(r(a),!0):!1}}const irt=H8(0,!1),ule=H8(1,!1),yln=H8(0,!0),bln=H8(1,!0);class Od{constructor(t,n,r,s,a){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new Od(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new Od(t.changes&&ul.fromJSON(t.changes),[],t.mapped&&qg.fromJSON(t.mapped),t.startSelection&&it.fromJSON(t.startSelection),t.selectionsAfter.map(it.fromJSON))}static fromTransaction(t,n){let r=Jp;for(let s of t.startState.facet(gln)){let a=s(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new Od(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Jp)}static selection(t){return new Od(void 0,Jp,void 0,void 0,t)}}function z6(e,t,n,r){let s=t+1>n+20?t-n-1:0,a=e.slice(s,t);return a.push(r),a}function xln(e,t){let n=[],r=!1;return e.iterChangedRanges((s,a)=>n.push(s,a)),t.iterChangedRanges((s,a,i,l)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];l>=u&&i<=d&&(r=!0)}}),r}function wln(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function ort(e,t){return e.length?t.length?e.concat(t):e:t}const Jp=[],Sln=200;function lrt(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Sln));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),z6(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Od.selection([t])]}function kln(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function wW(e,t){if(!e.length)return e;let n=e.length,r=Jp;for(;n;){let s=_ln(e[n-1],t,r);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,n);return a[n-1]=s,a}else t=s.mapped,n--,r=s.selectionsAfter}return r.length?[Od.selection(r)]:Jp}function _ln(e,t,n){let r=ort(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):Jp,n);if(!e.changes)return Od.selection(r);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Od(s,hr.mapEffects(e.effects,t),i,e.startSelection.map(a),r)}const Oln=/^(input\.type|delete)($|\.)/;class Ng{constructor(t,n,r=0,s=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Ng(this.done,this.undone):this}addChanges(t,n,r,s,a){let i=this.done,l=i[i.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!r||Oln.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,xln(l.changes,t.changes))||r=="input.type.compose")?i=z6(i,i.length-1,s.minDepth,new Od(t.changes.compose(l.changes),ort(hr.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,Jp)):i=z6(i,i.length,s.minDepth,t),new Ng(i,Jp,n,r)}addSelection(t,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Jp;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&wln(a[a.length-1],t)?this:new Ng(lrt(this.done,t),this.undone,n,r)}addMapping(t){return new Ng(wW(this.done,t),wW(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){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):n.selection);if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:cle.of({side:t,rest:kln(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let l=s.length==1?Jp:s.slice(0,s.length-1);return a.mapped&&(l=wW(l,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:cle.of({side:t,rest:l,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ng.empty=new Ng(Jp,Jp);const Eln=[{key:"Mod-z",run:irt,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ule,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ule,preventDefault:!0},{key:"Mod-u",run:yln,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:bln,preventDefault:!0}];function _j(e,t){return it.create(e.ranges.map(t),e.mainIndex)}function Rm(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Pm({state:e,dispatch:t},n){let r=_j(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Rm(e,r)),!0)}function Z8(e,t){return it.cursor(t?e.to:e.from)}function crt(e,t){return Pm(e,n=>n.empty?e.moveByChar(n,t):Z8(n,t))}function ou(e){return e.textDirectionAt(e.state.selection.main.head)==ai.LTR}const urt=e=>crt(e,!ou(e)),drt=e=>crt(e,ou(e));function frt(e,t){return Pm(e,n=>n.empty?e.moveByGroup(n,t):Z8(n,t))}const Cln=e=>frt(e,!ou(e)),jln=e=>frt(e,ou(e));function Tln(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function W8(e,t,n){let r=ei(e).resolveInner(t.head),s=n?Cr.closedBy:Cr.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;Tln(e,u,s)?r=u:c=n?u.to:u.from}let a=r.type.prop(s),i,l;return a&&(i=n?Tg(e,r.from,1):Tg(e,r.to,-1))&&i.matched?l=n?i.end.to:i.end.from:l=n?r.to:r.from,it.cursor(l,n?-1:1)}const Nln=e=>Pm(e,t=>W8(e.state,t,!ou(e))),Aln=e=>Pm(e,t=>W8(e.state,t,ou(e)));function prt(e,t){return Pm(e,n=>{if(!n.empty)return Z8(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const hrt=e=>prt(e,!1),mrt=e=>prt(e,!0);function grt(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,s;if(t){for(let a of e.state.facet(vt.scrollMargins)){let i=a(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}s=e.scrollDOM.clientHeight-n-r}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function vrt(e,t){let n=grt(e),{state:r}=e,s=_j(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):Z8(i,t));if(s.eq(r.selection))return!1;let a;if(n.selfScroll){let i=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;i&&i.top>c&&i.bottom<u&&(a=vt.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Rm(r,s),{effects:a}),!0}const jAe=e=>vrt(e,!1),dle=e=>vrt(e,!0);function nw(e,t,n){let r=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,n);if(s.head==t.head&&s.head!=(n?r.to:r.from)&&(s=e.moveToLineBoundary(t,n,!1)),!n&&s.head==r.from&&r.length){let a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(s=it.cursor(r.from+a))}return s}const Iln=e=>Pm(e,t=>nw(e,t,!0)),Rln=e=>Pm(e,t=>nw(e,t,!1)),Pln=e=>Pm(e,t=>nw(e,t,!ou(e))),$ln=e=>Pm(e,t=>nw(e,t,ou(e))),Mln=e=>Pm(e,t=>it.cursor(e.lineBlockAt(t.head).from,1)),Dln=e=>Pm(e,t=>it.cursor(e.lineBlockAt(t.head).to,-1));function Lln(e,t,n){let r=!1,s=_j(e.selection,a=>{let i=Tg(e,a.head,-1)||Tg(e,a.head,1)||a.head>0&&Tg(e,a.head-1,1)||a.head<e.doc.length&&Tg(e,a.head+1,-1);if(!i||!i.end)return a;r=!0;let l=i.start.from==a.head?i.end.to:i.end.from;return it.cursor(l)});return r?(t(Rm(e,s)),!0):!1}const zln=({state:e,dispatch:t})=>Lln(e,t);function Th(e,t){let n=_j(e.state.selection,r=>{let s=t(r);return it.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(Rm(e.state,n)),!0)}function yrt(e,t){return Th(e,n=>e.moveByChar(n,t))}const brt=e=>yrt(e,!ou(e)),xrt=e=>yrt(e,ou(e));function wrt(e,t){return Th(e,n=>e.moveByGroup(n,t))}const Fln=e=>wrt(e,!ou(e)),Bln=e=>wrt(e,ou(e)),Uln=e=>Th(e,t=>W8(e.state,t,!ou(e))),qln=e=>Th(e,t=>W8(e.state,t,ou(e)));function Srt(e,t){return Th(e,n=>e.moveVertically(n,t))}const krt=e=>Srt(e,!1),_rt=e=>Srt(e,!0);function Ort(e,t){return Th(e,n=>e.moveVertically(n,t,grt(e).height))}const TAe=e=>Ort(e,!1),NAe=e=>Ort(e,!0),Vln=e=>Th(e,t=>nw(e,t,!0)),Hln=e=>Th(e,t=>nw(e,t,!1)),Zln=e=>Th(e,t=>nw(e,t,!ou(e))),Wln=e=>Th(e,t=>nw(e,t,ou(e))),Qln=e=>Th(e,t=>it.cursor(e.lineBlockAt(t.head).from)),Gln=e=>Th(e,t=>it.cursor(e.lineBlockAt(t.head).to)),AAe=({state:e,dispatch:t})=>(t(Rm(e,{anchor:0})),!0),IAe=({state:e,dispatch:t})=>(t(Rm(e,{anchor:e.doc.length})),!0),RAe=({state:e,dispatch:t})=>(t(Rm(e,{anchor:e.selection.main.anchor,head:0})),!0),PAe=({state:e,dispatch:t})=>(t(Rm(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Yln=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Xln=({state:e,dispatch:t})=>{let n=Q8(e).map(({from:r,to:s})=>it.range(r,Math.min(s+1,e.doc.length)));return t(e.update({selection:it.create(n),userEvent:"select"})),!0},Kln=({state:e,dispatch:t})=>{let n=_j(e.selection,r=>{let s=ei(e),a=s.resolveStack(r.from,1);if(r.empty){let i=s.resolveStack(r.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<r.from&&l.to>=r.to||l.to>r.to&&l.from<=r.from)&&i.next)return it.range(l.to,l.from)}return r});return n.eq(e.selection)?!1:(t(Rm(e,n)),!0)};function Ert(e,t){let{state:n}=e,r=n.selection,s=n.selection.ranges.slice();for(let a of n.selection.ranges){let i=n.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==r.ranges.length?!1:(e.dispatch(Rm(n,it.create(s,s.length-1))),!0)}const Jln=e=>Ert(e,!1),ecn=e=>Ert(e,!0),tcn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=it.create([n.main]):n.main.empty||(r=it.create([it.cursor(n.main.head)])),r?(t(Rm(e,r)),!0):!1};function U$(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,s=r.changeByRange(a=>{let{from:i,to:l}=a;if(i==l){let c=t(a);c<i?(n="delete.backward",c=$L(e,c,!1)):c>i&&(n="delete.forward",c=$L(e,c,!0)),i=Math.min(i,c),l=Math.max(l,c)}else i=$L(e,i,!1),l=$L(e,l,!0);return i==l?{range:a}:{changes:{from:i,to:l},range:it.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?vt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function $L(e,t,n){if(e instanceof vt)for(let r of e.state.facet(vt.atomicRanges).map(s=>s(e)))r.between(t,t,(s,a)=>{s<t&&a>t&&(t=n?a:s)});return t}const Crt=(e,t,n)=>U$(e,r=>{let s=r.from,{state:a}=e,i=a.doc.lineAt(s),l,c;if(n&&!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=bm(l,a.tabSize),d=u%O1(a)||O1(a);for(let f=0;f<d&&l[l.length-1-f]==" ";f++)s--;c=s}else c=Yl(i.text,s-i.from,t,t)+i.from,c==s&&i.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,s-i.from))&&(c=Yl(i.text,c-i.from,!1,!1)+i.from);return c}),fle=e=>Crt(e,!1,!0),jrt=e=>Crt(e,!0,!1),Trt=(e,t)=>U$(e,n=>{let r=n.head,{state:s}=e,a=s.doc.lineAt(r),i=s.charCategorizer(r);for(let l=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?s.doc.lines:1)&&(r+=t?1:-1);break}let c=Yl(a.text,r-a.from,t)+a.from,u=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),d=i(u);if(l!=null&&d!=l)break;(u!=" "||r!=n.head)&&(l=d),r=c}return r}),Nrt=e=>Trt(e,!1),ncn=e=>Trt(e,!0),rcn=e=>U$(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),scn=e=>U$(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),acn=e=>U$(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),icn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:aa.of(["",""])},range:it.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},ocn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let s=r.from,a=e.doc.lineAt(s),i=s==a.from?s-1:Yl(a.text,s-a.from,!1)+a.from,l=s==a.to?s+1:Yl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:l,insert:e.doc.slice(s,l).append(e.doc.slice(i,s))},range:it.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Q8(e){let t=[],n=-1;for(let r of e.selection.ranges){let s=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(r)}else t.push({from:s.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Art(e,t,n){if(e.readOnly)return!1;let r=[],s=[];for(let a of Q8(e)){if(n?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(n?a.to+1:a.from-1),l=i.length+1;if(n){r.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(it.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{r.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(it.range(c.anchor-l,c.head-l))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:it.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const lcn=({state:e,dispatch:t})=>Art(e,t,!1),ccn=({state:e,dispatch:t})=>Art(e,t,!0);function Irt(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of Q8(e))n?r.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):r.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(r);return t(e.update({changes:s,selection:e.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ucn=({state:e,dispatch:t})=>Irt(e,t,!1),dcn=({state:e,dispatch:t})=>Irt(e,t,!0),fcn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Q8(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),r=_j(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(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function pcn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ei(e).resolveInner(t),r=n.childBefore(t),s=n.childAfter(t),a;return r&&s&&r.to<=t&&s.from>=t&&(a=r.type.prop(Cr.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const $Ae=Rrt(!1),hcn=Rrt(!0);function Rrt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(s=>{let{from:a,to:i}=s,l=t.doc.lineAt(a),c=!e&&a==i&&pcn(t,a);e&&(a=i=(i<=l.to?l:t.doc.lineAt(i)).to);let u=new B8(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=Mhe(u,a);for(d==null&&(d=bm(/^\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=["",cR(t,d)];return c&&f.push(cR(t,u.lineIndent(l.from,-1))),{changes:{from:a,to:i,insert:aa.of(f)},range:it.cursor(a+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function gme(e,t){let n=-1;return e.changeByRange(r=>{let s=[];for(let i=r.from;i<=r.to;){let l=e.doc.lineAt(i);l.number>n&&(r.empty||r.to>l.from)&&(t(l,s,r),n=l.number),i=l.to+1}let a=e.changes(s);return{changes:s,range:it.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const mcn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new B8(e,{overrideIndentation:a=>{let i=n[a];return i??-1}}),s=gme(e,(a,i,l)=>{let c=Mhe(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=cR(e,c);(u!=d||l.from<a.from+u.length)&&(n[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},Prt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gme(e,(n,r)=>{r.push({from:n.from,insert:e.facet(wj)})}),{userEvent:"input.indent"})),!0),$rt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gme(e,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=bm(s,e.tabSize),i=0,l=cR(e,Math.max(0,a-O1(e)));for(;i<s.length&&i<l.length&&s.charCodeAt(i)==l.charCodeAt(i);)i++;r.push({from:n.from+i,to:n.from+s.length,insert:l.slice(i)})}),{userEvent:"delete.dedent"})),!0),gcn=e=>(e.setTabFocusMode(),!0),vcn=[{key:"Ctrl-b",run:urt,shift:brt,preventDefault:!0},{key:"Ctrl-f",run:drt,shift:xrt},{key:"Ctrl-p",run:hrt,shift:krt},{key:"Ctrl-n",run:mrt,shift:_rt},{key:"Ctrl-a",run:Mln,shift:Qln},{key:"Ctrl-e",run:Dln,shift:Gln},{key:"Ctrl-d",run:jrt},{key:"Ctrl-h",run:fle},{key:"Ctrl-k",run:rcn},{key:"Ctrl-Alt-h",run:Nrt},{key:"Ctrl-o",run:icn},{key:"Ctrl-t",run:ocn},{key:"Ctrl-v",run:dle}],ycn=[{key:"ArrowLeft",run:urt,shift:brt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Cln,shift:Fln,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Pln,shift:Zln,preventDefault:!0},{key:"ArrowRight",run:drt,shift:xrt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:jln,shift:Bln,preventDefault:!0},{mac:"Cmd-ArrowRight",run:$ln,shift:Wln,preventDefault:!0},{key:"ArrowUp",run:hrt,shift:krt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:AAe,shift:RAe},{mac:"Ctrl-ArrowUp",run:jAe,shift:TAe},{key:"ArrowDown",run:mrt,shift:_rt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:IAe,shift:PAe},{mac:"Ctrl-ArrowDown",run:dle,shift:NAe},{key:"PageUp",run:jAe,shift:TAe},{key:"PageDown",run:dle,shift:NAe},{key:"Home",run:Rln,shift:Hln,preventDefault:!0},{key:"Mod-Home",run:AAe,shift:RAe},{key:"End",run:Iln,shift:Vln,preventDefault:!0},{key:"Mod-End",run:IAe,shift:PAe},{key:"Enter",run:$Ae,shift:$Ae},{key:"Mod-a",run:Yln},{key:"Backspace",run:fle,shift:fle,preventDefault:!0},{key:"Delete",run:jrt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Nrt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ncn,preventDefault:!0},{mac:"Mod-Backspace",run:scn,preventDefault:!0},{mac:"Mod-Delete",run:acn,preventDefault:!0}].concat(vcn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),bcn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Nln,shift:Uln},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Aln,shift:qln},{key:"Alt-ArrowUp",run:lcn},{key:"Shift-Alt-ArrowUp",run:ucn},{key:"Alt-ArrowDown",run:ccn},{key:"Shift-Alt-ArrowDown",run:dcn},{key:"Mod-Alt-ArrowUp",run:Jln},{key:"Mod-Alt-ArrowDown",run:ecn},{key:"Escape",run:tcn},{key:"Mod-Enter",run:hcn},{key:"Alt-l",mac:"Ctrl-l",run:Xln},{key:"Mod-i",run:Kln,preventDefault:!0},{key:"Mod-[",run:$rt},{key:"Mod-]",run:Prt},{key:"Mod-Alt-\\",run:mcn},{key:"Shift-Mod-k",run:fcn},{key:"Shift-Mod-\\",run:zln},{key:"Mod-/",run:lln},{key:"Alt-A",run:uln},{key:"Ctrl-m",mac:"Shift-Alt-m",run:gcn}].concat(ycn),xcn={key:"Tab",run:Prt,shift:$rt},MAe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Vy{constructor(t,n,r=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(r,s),this.bufferStart=r,this.normalize=a?l=>a(MAe(l)):MAe,this.query=this.normalize(n)}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 vd(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 n=vhe(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=vg(t);let s=this.normalize(n);if(s.length)for(let a=0,i=r;;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==r&&a<n.length&&n.charCodeAt(a)==l&&i++}}}match(t,n,r){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:r}:(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:n,to:r}:this.matches.push(1,n)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(Vy.prototype[Symbol.iterator]=function(){return this});const Mrt={from:-1,to:-1,match:/.*/.exec("")},vme="gm"+(/x/.unicode==null?"":"u");class Drt{constructor(t,n,r,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=Mrt,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Lrt(t,n,r,s,a);this.re=new RegExp(n,vme+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=F6(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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=F6(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},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 SW=new WeakMap;class pE{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let s=SW.get(t);if(!s||s.from>=r||s.to<=n){let l=new pE(n,t.sliceString(n,r));return SW.set(t,l),l}if(s.from==n&&s.to==r)return s;let{text:a,from:i}=s;return i>n&&(a=t.sliceString(n,i)+a,i=n),s.to<r&&(a+=t.sliceString(s.to,r)),SW.set(t,new pE(i,a)),new pE(n,a.slice(n-i,r-i))}}class Lrt{constructor(t,n,r,s,a){this.text=t,this.to=a,this.done=!1,this.value=Mrt,this.matchPos=F6(t,s),this.re=new RegExp(n,vme+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=pE.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,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=F6(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pE.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Drt.prototype[Symbol.iterator]=Lrt.prototype[Symbol.iterator]=function(){return this});function wcn(e){try{return new RegExp(e,vme),!0}catch{return!1}}function F6(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const Scn=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:s}=lrn(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},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:r});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,p=d?+d.slice(1):0,h=u?+u:l.number;if(u&&f){let v=h/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),h=Math.round(t.doc.lines*v)}else u&&c&&(h=h*(c=="-"?-1:1)+l.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,h))),g=it.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[r,vt.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},kcn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},_cn=on.define({combine(e){return mv(e,kcn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Ocn(e){return[Ncn,Tcn]}const Ecn=dn.mark({class:"cm-selectionMatch"}),Ccn=dn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function DAe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Zi.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Zi.Word)}function jcn(e,t,n,r){return e(t.sliceDoc(n,n+1))==Zi.Word&&e(t.sliceDoc(r-1,r))==Zi.Word}const Tcn=Gi.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(_cn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return dn.none;let s=r.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return dn.none;let c=n.wordAt(s.head);if(!c)return dn.none;i=n.charCategorizer(s.head),a=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return dn.none;if(t.wholeWords){if(a=n.sliceDoc(s.from,s.to),i=n.charCategorizer(s.head),!(DAe(i,n,s.from,s.to)&&jcn(i,n,s.from,s.to)))return dn.none}else if(a=n.sliceDoc(s.from,s.to),!a)return dn.none}let l=[];for(let c of e.visibleRanges){let u=new Vy(n.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||DAe(i,n,d,f))&&(s.empty&&d<=s.from&&f>=s.to?l.push(Ccn.range(d,f)):(d>=s.to||f<=s.from)&&l.push(Ecn.range(d,f)),l.length>t.maxMatches))return dn.none}}return dn.set(l)}},{decorations:e=>e.decorations}),Ncn=vt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Acn=({state:e,dispatch:t})=>{let{selection:n}=e,r=it.create(n.ranges.map(s=>e.wordAt(s.head)||it.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Icn(e,t){let{main:n,ranges:r}=e.selection,s=e.wordAt(n.head),a=s&&s.from==n.from&&s.to==n.to;for(let i=!1,l=new Vy(e.doc,t,r[r.length-1].to);;)if(l.next(),l.done){if(i)return null;l=new Vy(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),i=!0}else{if(i&&r.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 Rcn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return Acn({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=r))return!1;let s=Icn(e,r);return s?(t(e.update({selection:e.selection.addRange(it.range(s.from,s.to),!1),effects:vt.scrollIntoView(s.to)})),!0):!1},Oj=on.define({combine(e){return mv(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Wcn(t),scrollToMatch:t=>vt.scrollIntoView(t)})}});class zrt{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||wcn(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,(n,r)=>r=="n"?`
|
|
116
116
|
`:r=="r"?"\r":r=="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 zcn(this):new Mcn(this)}getCursor(t,n=0,r){let s=t.doc?t:es.create({doc:t});return r==null&&(r=s.doc.length),this.regexp?pO(this,s,n,r):fO(this,s,n,r)}}class Frt{constructor(t){this.spec=t}}function Pcn(e,t,n){return(r,s,a,i)=>{if(n&&!n(r,s,a,i))return!1;let l=r>=i&&s<=i+a.length?a.slice(r-i,s-i):t.doc.sliceString(r,s);return e(l,t,r,s)}}function fO(e,t,n,r){let s;return e.wholeWord&&(s=$cn(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(s=Pcn(e.test,t,s)),new Vy(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),s)}function $cn(e,t){return(n,r,s,a)=>((a>n||a+s.length<r)&&(a=Math.max(0,n-2),s=e.sliceString(a,Math.min(e.length,r+2))),(t(B6(s,n-a))!=Zi.Word||t(U6(s,n-a))!=Zi.Word)&&(t(U6(s,r-a))!=Zi.Word||t(B6(s,r-a))!=Zi.Word))}class Mcn extends Frt{constructor(t){super(t)}nextMatch(t,n,r){let s=fO(this.spec,t,r,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,n+this.spec.unquoted.length);s=fO(this.spec,t,0,a).nextOverlapping()}return s.done||s.value.from==n&&s.value.to==r?null:s.value}prevMatchInRange(t,n,r){for(let s=r;;){let a=Math.max(n,s-1e4-this.spec.unquoted.length),i=fO(this.spec,t,a,s),l=null;for(;!i.nextOverlapping().done;)l=i.value;if(l)return l;if(a==n)return null;s-=1e4}}prevMatch(t,n,r){let s=this.prevMatchInRange(t,0,n);return s||(s=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=n||s.to!=r)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=fO(this.spec,t,0,t.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(t,n,r,s){let a=fO(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}function Dcn(e,t,n){return(r,s,a)=>(!n||n(r,s,a))&&e(a[0],t,r,s)}function pO(e,t,n,r){let s;return e.wholeWord&&(s=Lcn(t.charCategorizer(t.selection.main.head))),e.test&&(s=Dcn(e.test,t,s)),new Drt(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},n,r)}function B6(e,t){return e.slice(Yl(e,t,!1),t)}function U6(e,t){return e.slice(t,Yl(e,t))}function Lcn(e){return(t,n,r)=>!r[0].length||(e(B6(r.input,r.index))!=Zi.Word||e(U6(r.input,r.index))!=Zi.Word)&&(e(U6(r.input,r.index+r[0].length))!=Zi.Word||e(B6(r.input,r.index+r[0].length))!=Zi.Word)}class zcn extends Frt{nextMatch(t,n,r){let s=pO(this.spec,t,r,t.doc.length).next();return s.done&&(s=pO(this.spec,t,0,n).next()),s.done?null:s.value}prevMatchInRange(t,n,r){for(let s=1;;s++){let a=Math.max(n,r-s*1e4),i=pO(this.spec,t,a,r),l=null;for(;!i.next().done;)l=i.value;if(l&&(a==n||l.from>a+10))return l;if(a==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let s=r.length;s>0;s--){let a=+r.slice(0,s);if(a>0&&a<t.match.length)return t.match[a]+r.slice(s)}return n})}matchAll(t,n){let r=pO(this.spec,t,0,t.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(t,n,r,s){let a=pO(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}const bR=hr.define(),yme=hr.define(),Hx=tl.define({create(e){return new kW(ple(e).create(),null)},update(e,t){for(let n of t.effects)n.is(bR)?e=new kW(n.value.create(),e.panel):n.is(yme)&&(e=new kW(e.query,n.value?bme:null));return e},provide:e=>lR.from(e,t=>t.panel)});class kW{constructor(t,n){this.query=t,this.panel=n}}const Fcn=dn.mark({class:"cm-searchMatch"}),Bcn=dn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Ucn=Gi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Hx))}update(e){let t=e.state.field(Hx);(t!=e.startState.field(Hx)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return dn.none;let{view:n}=this,r=new qu;for(let s=0,a=n.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(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(p=>p.from==u&&p.to==d);r.add(u,d,f?Bcn:Fcn)})}return r.finish()}},{decorations:e=>e.decorations});function q$(e){return t=>{let n=t.state.field(Hx,!1);return n&&n.query.spec.valid?e(t,n):qrt(t)}}const q6=q$((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let s=it.single(r.from,r.to),a=e.state.facet(Oj);return e.dispatch({selection:s,effects:[xme(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),Urt(e),!0}),V6=q$((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,s=t.prevMatch(n,r,r);if(!s)return!1;let a=it.single(s.from,s.to),i=e.state.facet(Oj);return e.dispatch({selection:a,effects:[xme(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),Urt(e),!0}),qcn=q$((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:it.create(n.map(r=>it.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),Vcn=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,a=[],i=0;for(let l=new Vy(e.doc,e.sliceDoc(r,s));!l.next().done;){if(a.length>1e3)return!1;l.value.from==r&&(i=a.length),a.push(it.range(l.value.from,l.value.to))}return t(e.update({selection:it.create(a,i),userEvent:"select.search.matches"})),!0},LAe=q$((e,{query:t})=>{let{state:n}=e,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let i=a,l=[],c,u,d=[];i.from==r&&i.to==s&&(u=n.toText(t.getReplacement(i)),l.push({from:i.from,to:i.to,insert:u}),i=t.nextMatch(n,i.from,i.to),d.push(vt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=e.state.changes(l);return i&&(c=it.single(i.from,i.to).map(f),d.push(xme(e,i)),d.push(n.facet(Oj).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),Hcn=q$((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(s=>{let{from:a,to:i}=s;return{from:a,to:i,insert:t.getReplacement(s)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:vt.announce.of(r),userEvent:"input.replace.all"}),!0});function bme(e){return e.state.facet(Oj).createPanel(e)}function ple(e,t){var n,r,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(Oj);return new zrt({search:((n=t?.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r: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 Brt(e){let t=Phe(e,bme);return t&&t.dom.querySelector("[main-field]")}function Urt(e){let t=Brt(e);t&&t==e.root.activeElement&&t.select()}const qrt=e=>{let t=e.state.field(Hx,!1);if(t&&t.panel){let n=Brt(e);if(n&&n!=e.root.activeElement){let r=ple(e.state,t.query.spec);r.valid&&e.dispatch({effects:bR.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[yme.of(!0),t?bR.of(ple(e.state,t.query.spec)):hr.appendConfig.of(Gcn)]});return!0},Vrt=e=>{let t=e.state.field(Hx,!1);if(!t||!t.panel)return!1;let n=Phe(e,bme);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:yme.of(!1)}),!0},Zcn=[{key:"Mod-f",run:qrt,scope:"editor search-panel"},{key:"F3",run:q6,shift:V6,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:q6,shift:V6,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Vrt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Vcn},{key:"Mod-Alt-g",run:Scn},{key:"Mod-d",run:Rcn,preventDefault:!0}];class Wcn{constructor(t){this.view=t;let n=this.query=t.state.field(Hx).query.spec;this.commit=this.commit.bind(this),this.searchField=Wa("input",{value:n.search,placeholder:ff(t,"Find"),"aria-label":ff(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Wa("input",{value:n.replace,placeholder:ff(t,"Replace"),"aria-label":ff(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Wa("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Wa("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Wa("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,a,i){return Wa("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=Wa("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>q6(t),[ff(t,"next")]),r("prev",()=>V6(t),[ff(t,"previous")]),r("select",()=>qcn(t),[ff(t,"all")]),Wa("label",null,[this.caseField,ff(t,"match case")]),Wa("label",null,[this.reField,ff(t,"regexp")]),Wa("label",null,[this.wordField,ff(t,"by word")]),...t.state.readOnly?[]:[Wa("br"),this.replaceField,r("replace",()=>LAe(t),[ff(t,"replace")]),r("replaceAll",()=>Hcn(t),[ff(t,"replace all")])],Wa("button",{name:"close",onclick:()=>Vrt(t),"aria-label":ff(t,"close"),type:"button"},["×"])])}commit(){let t=new zrt({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:bR.of(t)}))}keydown(t){bnn(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?V6:q6)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),LAe(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(bR)&&!r.value.eq(this.query)&&this.setQuery(r.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(Oj).top}}function ff(e,t){return e.state.phrase(t)}const ML=30,DL=/[\s\.,:;?!]/;function xme(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),s=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-ML),i=Math.min(s,n+ML),l=e.state.sliceDoc(a,i);if(a!=r.from){for(let c=0;c<ML;c++)if(!DL.test(l[c+1])&&DL.test(l[c])){l=l.slice(c);break}}if(i!=s){for(let c=l.length-1;c>l.length-ML;c--)if(!DL.test(l[c-1])&&DL.test(l[c])){l=l.slice(0,c);break}}return vt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${r.number}.`)}const Qcn=vt.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"}}),Gcn=[Hx,Am.low(Ucn),Qcn];class zAe{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class ES{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let s=r.facet(xR).markerFilter;s&&(t=s(t,r));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new qu,l=[],c=0;for(let d=0;;){let f=d==a.length?null:a[d];if(!f&&!l.length)break;let p,h;for(l.length?(p=c,h=l.reduce((g,v)=>Math.min(g,v.to),f&&f.from>p?f.from:1e8)):(p=f.from,h=f.to,l.push(f),d++);d<a.length;){let g=a[d];if(g.from==p&&(g.to>g.from||g.to==p))l.push(g),d++,h=Math.min(g.to,h);else{h=Math.min(g.from,h);break}}let m=lun(l);if(l.some(g=>g.from==g.to||g.from==g.to-1&&r.doc.lineAt(g.from).to==g.from))i.add(p,p,dn.widget({widget:new sun(m),diagnostics:l.slice()}));else{let g=l.reduce((v,x)=>x.markClass?v+" "+x.markClass:v,"");i.add(p,h,dn.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:l.slice(),inclusiveEnd:l.some(v=>v.to>h)}))}c=h;for(let g=0;g<l.length;g++)l[g].to<=c&&l.splice(g--,1)}let u=i.finish();return new ES(u,n,sC(u))}}function sC(e,t=null,n=0){let r=null;return e.between(n,1e9,(s,a,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new zAe(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new zAe(r.from,a,r.diagnostic)}}),r}function Ycn(e,t){let n=t.pos,r=t.end||n,s=e.state.facet(xR).hideOn(e,n,r);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(Hrt))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function Xcn(e,t){return e.field($f,!1)?t:t.concat(hr.appendConfig.of(cun))}const Hrt=hr.define(),wme=hr.define(),Zrt=hr.define(),$f=tl.define({create(){return new ES(dn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,s=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);r=sC(n,e.selected.diagnostic,a)||sC(n,null,a)}!n.size&&s&&t.state.facet(xR).autoPanel&&(s=null),e=new ES(n,s,r)}for(let n of t.effects)if(n.is(Hrt)){let r=t.state.facet(xR).autoPanel?n.value.length?wR.open:null:e.panel;e=ES.init(n.value,r,t.state)}else n.is(wme)?e=new ES(e.diagnostics,n.value?wR.open:null,e.selected):n.is(Zrt)&&(e=new ES(e.diagnostics,e.panel,n.value));return e},provide:e=>[lR.from(e,t=>t.panel),vt.decorations.from(e,t=>t.diagnostics)]}),Kcn=dn.mark({class:"cm-lintRange cm-lintRange-active"});function Jcn(e,t,n){let{diagnostics:r}=e.state.field($f),s,a=-1,i=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(t<u||n<0)))return s=d.diagnostics,a=c,i=u,!1});let l=e.state.facet(xR).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:eun(e,s)}}}:null}function eun(e,t){return Wa("ul",{class:"cm-tooltip-lint"},t.map(n=>Qrt(e,n,!1)))}const tun=e=>{let t=e.state.field($f,!1);(!t||!t.panel)&&e.dispatch({effects:Xcn(e.state,[wme.of(!0)])});let n=Phe(e,wR.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},FAe=e=>{let t=e.state.field($f,!1);return!t||!t.panel?!1:(e.dispatch({effects:wme.of(!1)}),!0)},nun=e=>{let t=e.state.field($f,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},run=[{key:"Mod-Shift-m",run:tun,preventDefault:!0},{key:"F8",run:nun}],xR=on.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...mv(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:BAe,tooltipFilter:BAe,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,s,a)=>t(r,s,a)||n(r,s,a):t:n,autoPanel:(t,n)=>t||n})}}});function BAe(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function Wrt(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let s=n[r];if(/[a-zA-Z]/.test(s)&&!t.some(a=>a.toLowerCase()==s.toLowerCase())){t.push(s);continue e}}t.push("")}return t}function Qrt(e,t,n){var r;let s=n?Wrt(t.actions):[];return Wa("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Wa("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((a,i)=>{let l=!1,c=h=>{if(h.preventDefault(),l)return;l=!0;let m=sC(e.state.field($f).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),Wa("u",u.slice(d,d+1)),u.slice(d+1)],p=a.markClass?" "+a.markClass:"";return Wa("button",{type:"button",class:"cm-diagnosticAction"+p,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[i]})"`}.`},f)}),t.source&&Wa("div",{class:"cm-diagnosticSource"},t.source))}class sun extends fp{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Wa("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class UAe{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Qrt(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class wR{constructor(t){this.view=t,this.items=[];let n=s=>{if(s.keyCode==27)FAe(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=Wrt(a.actions);for(let l=0;l<i.length;l++)if(i[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=sC(this.view.state.field($f).diagnostics,a);c&&a.actions[l].apply(t,c.from,c.to)}}else return;s.preventDefault()},r=s=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(s.target)&&this.moveSelection(a)};this.list=Wa("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Wa("div",{class:"cm-panel-lint"},this.list,Wa("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>FAe(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field($f).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field($f),r=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,p;for(let h=r;h<this.items.length;h++)if(this.items[h].diagnostic==d){f=h;break}f<0?(p=new UAe(this.view,d),this.items.splice(r,0,p),s=!0):(p=this.items[f],f>r&&(this.items.splice(r,f-r),s=!0)),n&&p.diagnostic==n.diagnostic?p.dom.hasAttribute("aria-selected")||(p.dom.setAttribute("aria-selected","true"),a=p):p.dom.hasAttribute("aria-selected")&&p.dom.removeAttribute("aria-selected"),r++}});r<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 UAe(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 n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field($f),r=sC(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Zrt.of(r)})}static open(t){return new wR(t)}}function aun(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 LL(e){return aun(`<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 iun=vt.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:LL("#d11")},".cm-lintRange-warning":{backgroundImage:LL("orange")},".cm-lintRange-info":{backgroundImage:LL("#999")},".cm-lintRange-hint":{backgroundImage:LL("#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 oun(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function lun(e){let t="hint",n=1;for(let r of e){let s=oun(r.severity);s>n&&(n=s,t=r.severity)}return t}const cun=[$f,vt.decorations.compute([$f],e=>{let{selected:t,panel:n}=e.field($f);return!t||!n||t.from==t.to?dn.none:dn.set([Kcn.range(t.from,t.to)])}),irn(Jcn,{hideOn:Ycn}),iun];var qAe=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(ran)),t.defaultKeymap!==!1&&(r=r.concat(bcn)),t.searchKeymap!==!1&&(r=r.concat(Zcn)),t.historyKeymap!==!1&&(r=r.concat(Eln)),t.foldKeymap!==!1&&(r=r.concat(Urn)),t.completionKeymap!==!1&&(r=r.concat($tt)),t.lintKeymap!==!1&&(r=r.concat(run));var s=[];return t.lineNumbers!==!1&&s.push(yrn()),t.highlightActiveLineGutter!==!1&&s.push(wrn()),t.highlightSpecialChars!==!1&&s.push($nn()),t.history!==!1&&s.push(vln()),t.foldGutter!==!1&&s.push(Zrn()),t.drawSelection!==!1&&s.push(Onn()),t.dropCursor!==!1&&s.push(Nnn()),t.allowMultipleSelections!==!1&&s.push(es.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(Prn()),t.syntaxHighlighting!==!1&&s.push(tw(Yrn,{fallback:!0})),t.bracketMatching!==!1&&s.push(rsn()),t.closeBrackets!==!1&&s.push(Jsn()),t.autocompletion!==!1&&s.push(Ptt()),t.rectangularSelection!==!1&&s.push(Gnn()),n!==!1&&s.push(Knn()),t.highlightActiveLine!==!1&&s.push(Bnn()),t.highlightSelectionMatches!==!1&&s.push(Ocn()),t.tabSize&&typeof t.tabSize=="number"&&s.push(wj.of(" ".repeat(t.tabSize))),s.concat([xj.of(r.flat())]).filter(Boolean)};const uun="#e5c07b",VAe="#e06c75",dun="#56b6c2",fun="#ffffff",J3="#abb2bf",hle="#7d8799",pun="#61afef",hun="#98c379",HAe="#d19a66",mun="#c678dd",gun="#21252b",ZAe="#2c313a",WAe="#282c34",_W="#353a42",vun="#3E4451",QAe="#528bff",yun=vt.theme({"&":{color:J3,backgroundColor:WAe},".cm-content":{caretColor:QAe},".cm-cursor, .cm-dropCursor":{borderLeftColor:QAe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:vun},".cm-panels":{backgroundColor:gun,color:J3},".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:WAe,color:hle,border:"none"},".cm-activeLineGutter":{backgroundColor:ZAe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:_W},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:_W,borderBottomColor:_W},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ZAe,color:J3}}},{dark:!0}),bun=Im.define([{tag:se.keyword,color:mun},{tag:[se.name,se.deleted,se.character,se.propertyName,se.macroName],color:VAe},{tag:[se.function(se.variableName),se.labelName],color:pun},{tag:[se.color,se.constant(se.name),se.standard(se.name)],color:HAe},{tag:[se.definition(se.name),se.separator],color:J3},{tag:[se.typeName,se.className,se.number,se.changed,se.annotation,se.modifier,se.self,se.namespace],color:uun},{tag:[se.operator,se.operatorKeyword,se.url,se.escape,se.regexp,se.link,se.special(se.string)],color:dun},{tag:[se.meta,se.comment],color:hle},{tag:se.strong,fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:se.link,color:hle,textDecoration:"underline"},{tag:se.heading,fontWeight:"bold",color:VAe},{tag:[se.atom,se.bool,se.special(se.variableName)],color:HAe},{tag:[se.processingInstruction,se.string,se.inserted],color:hun},{tag:se.invalid,color:fun}]),xun=[yun,tw(bun)];var wun=vt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Sun=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:a="light",placeholder:i="",basicSetup:l=!0}=t,c=[];switch(n&&c.unshift(xj.of([xcn])),l&&(typeof l=="boolean"?c.unshift(qAe()):c.unshift(qAe(l))),i&&c.unshift(Hnn(i)),a){case"light":c.push(wun);break;case"dark":c.push(xun);break;case"none":break;default:c.push(a);break}return r===!1&&c.push(vt.editable.of(!1)),s&&c.push(es.readOnly.of(!0)),[...c]},kun=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 _un{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,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(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}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 GAe=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 OW=null,Oun=()=>typeof window>"u"?new GAe:(OW||(OW=new GAe),OW),YAe=hv.define(),Eun=200,Cun=[];function jun(e){var{value:t,selection:n,onChange:r,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:l=Cun,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:p=null,width:h=null,minWidth:m=null,maxWidth:g=null,placeholder:v="",editable:x=!0,readOnly:w=!1,indentWithTab:S=!0,basicSetup:_=!0,root:O,initialState:E}=e,[T,j]=b.useState(),[N,I]=b.useState(),[P,R]=b.useState(),B=b.useState(()=>({current:null}))[0],M=b.useState(()=>({current:null}))[0],L=vt.theme({"&":{height:d,minHeight:f,maxHeight:p,width:h,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),U=vt.updateListener.of(Z=>{if(Z.docChanged&&typeof r=="function"&&!Z.transactions.some(V=>V.annotation(YAe))){B.current?B.current.reset():(B.current=new _un(()=>{if(M.current){var V=M.current;M.current=null,V()}B.current=null},Eun),Oun().add(B.current));var D=Z.state.doc,G=D.toString();r(G,Z)}s&&s(kun(Z))}),z=Sun({theme:u,editable:x,readOnly:w,placeholder:v,indentWithTab:S,basicSetup:_}),q=[U,L,...z];return i&&typeof i=="function"&&q.push(vt.updateListener.of(i)),q=q.concat(l),b.useLayoutEffect(()=>{if(T&&!P){var Z={doc:t,selection:n,extensions:q},D=E?es.fromJSON(E.json,Z,E.fields):es.create(Z);if(R(D),!N){var G=new vt({state:D,parent:T,root:O});I(G),a&&a(G,D)}}return()=>{N&&(R(void 0),I(void 0))}},[T,P]),b.useEffect(()=>{e.container&&j(e.container)},[e.container]),b.useEffect(()=>()=>{N&&(N.destroy(),I(void 0)),B.current&&(B.current.cancel(),B.current=null)},[N]),b.useEffect(()=>{c&&N&&N.focus()},[c,N]),b.useEffect(()=>{N&&N.dispatch({effects:hr.reconfigure.of(q)})},[u,l,d,f,p,h,m,g,v,x,w,S,_,r,i]),b.useEffect(()=>{if(t!==void 0){var Z=N?N.state.doc.toString():"";if(N&&t!==Z){var D=B.current&&!B.current.isDone,G=()=>{N&&t!==N.state.doc.toString()&&N.dispatch({changes:{from:0,to:N.state.doc.toString().length,insert:t||""},annotations:[YAe.of(!0)]})};D?M.current=G:G()}}},[t,N]),{state:P,setState:R,view:N,setView:I,container:T,setContainer:j}}var Tun=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],eu=b.forwardRef((e,t)=>{var{className:n,value:r="",selection:s,extensions:a=[],onChange:i,onStatistics:l,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:f="light",height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:_,editable:O,readOnly:E,root:T,initialState:j}=e,N=pme(e,Tun),I=b.useRef(null),{state:P,view:R,container:B,setContainer:M}=jun({root:T,value:r,autoFocus:d,theme:f,height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:x,basicSetup:w,placeholder:S,indentWithTab:_,editable:O,readOnly:E,selection:s,onChange:i,onStatistics:l,onCreateEditor:c,onUpdate:u,extensions:a,initialState:j});b.useImperativeHandle(t,()=>({editor:I.current,state:P,view:R}),[I,B,P,R]);var L=b.useCallback(z=>{I.current=z,M(z)},[M]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var U=typeof f=="string"?"cm-theme-"+f:"cm-theme";return o.jsx("div",S0({ref:L,className:""+U+(n?" "+n:"")},N))});eu.displayName="CodeMirror";function Nun(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Aun=e=>{switch(e){case"success":return Pun;case"info":return Mun;case"warning":return $un;case"error":return Dun;default:return null}},Iun=Array(12).fill(0),Run=({visible:e,className:t})=>Te.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Te.createElement("div",{className:"sonner-spinner"},Iun.map((n,r)=>Te.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Pun=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"})),$un=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"})),Mun=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"})),Dun=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"})),Lun=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"})),zun=()=>{const[e,t]=Te.useState(document.hidden);return Te.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let mle=1;class Fun{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,a=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:mle++,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:r}),{...c,...t,id:a,dismissible:l,title:r}):c):this.addToast({title:r,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,i;const l=s.then(async u=>{if(i=["resolve",u],Te.isValidElement(u))a=!1,this.create({id:r,type:"default",message:u});else if(Uun(u)&&!u.ok){a=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,m=typeof f=="object"&&!Te.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...m})}else if(u instanceof Error){a=!1;const f=typeof n.error=="function"?await n.error(u):n.error,p=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!Te.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...m})}else if(n.success!==void 0){a=!1;const f=typeof n.success=="function"?await n.success(u):n.success,p=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!Te.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:p,...m})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){a=!1;const d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,h=typeof d=="object"&&!Te.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...h})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>l.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||mle++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const pd=new Fun,Bun=(e,t)=>{const n=t?.id||mle++;return pd.addToast({title:e,...t,id:n}),n},Uun=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",qun=Bun,Vun=()=>pd.toasts,Hun=()=>pd.getActiveToasts(),wm=Object.assign(qun,{success:pd.success,info:pd.info,warning:pd.warning,error:pd.error,custom:pd.custom,message:pd.message,promise:pd.promise,dismiss:pd.dismiss,loading:pd.loading},{getHistory:Vun,getToasts:Hun});Nun("[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 zL(e){return e.label!==void 0}const Zun=3,Wun="24px",Qun="16px",XAe=4e3,Gun=356,Yun=14,Xun=45,Kun=200;function Jm(...e){return e.filter(Boolean).join(" ")}function Jun(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const edn=e=>{var t,n,r,s,a,i,l,c,u;const{invert:d,toast:f,unstyled:p,interacting:h,setHeights:m,visibleToasts:g,heights:v,index:x,toasts:w,expanded:S,removeToast:_,defaultRichColors:O,closeButton:E,style:T,cancelButtonStyle:j,actionButtonStyle:N,className:I="",descriptionClassName:P="",duration:R,position:B,gap:M,expandByDefault:L,classNames:U,icons:z,closeButtonAriaLabel:q="Close toast"}=e,[Z,D]=Te.useState(null),[G,V]=Te.useState(null),[$,W]=Te.useState(!1),[Q,J]=Te.useState(!1),[ae,te]=Te.useState(!1),[re,ie]=Te.useState(!1),[pe,X]=Te.useState(!1),[ne,le]=Te.useState(0),[ge,de]=Te.useState(0),ue=Te.useRef(f.duration||R||XAe),be=Te.useRef(null),ke=Te.useRef(null),Ie=x===0,K=x+1<=g,oe=f.type,we=f.dismissible!==!1,Pe=f.className||"",Le=f.descriptionClassName||"",ve=Te.useMemo(()=>v.findIndex(qt=>qt.toastId===f.id)||0,[v,f.id]),Ee=Te.useMemo(()=>{var qt;return(qt=f.closeButton)!=null?qt:E},[f.closeButton,E]),ye=Te.useMemo(()=>f.duration||R||XAe,[f.duration,R]),Ce=Te.useRef(0),De=Te.useRef(0),ut=Te.useRef(0),jt=Te.useRef(null),[bn,Ve]=B.split("-"),He=Te.useMemo(()=>v.reduce((qt,jn,xt)=>xt>=ve?qt:qt+jn.height,0),[v,ve]),Re=zun(),Qe=f.invert||d,Fe=oe==="loading";De.current=Te.useMemo(()=>ve*M+He,[ve,He]),Te.useEffect(()=>{ue.current=ye},[ye]),Te.useEffect(()=>{W(!0)},[]),Te.useEffect(()=>{const qt=ke.current;if(qt){const jn=qt.getBoundingClientRect().height;return de(jn),m(xt=>[{toastId:f.id,height:jn,position:f.position},...xt]),()=>m(xt=>xt.filter(gn=>gn.toastId!==f.id))}},[m,f.id]),Te.useLayoutEffect(()=>{if(!$)return;const qt=ke.current,jn=qt.style.height;qt.style.height="auto";const xt=qt.getBoundingClientRect().height;qt.style.height=jn,de(xt),m(gn=>gn.find(Tn=>Tn.toastId===f.id)?gn.map(Tn=>Tn.toastId===f.id?{...Tn,height:xt}:Tn):[{toastId:f.id,height:xt,position:f.position},...gn])},[$,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const Ke=Te.useCallback(()=>{J(!0),le(De.current),m(qt=>qt.filter(jn=>jn.toastId!==f.id)),setTimeout(()=>{_(f)},Kun)},[f,_,m,De]);Te.useEffect(()=>{if(f.promise&&oe==="loading"||f.duration===1/0||f.type==="loading")return;let qt;return S||h||Re?(()=>{if(ut.current<Ce.current){const gn=new Date().getTime()-Ce.current;ue.current=ue.current-gn}ut.current=new Date().getTime()})():ue.current!==1/0&&(Ce.current=new Date().getTime(),qt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ke()},ue.current)),()=>clearTimeout(qt)},[S,h,f,oe,Re,Ke]),Te.useEffect(()=>{f.delete&&(Ke(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ke,f.delete]);function rt(){var qt;if(z?.loading){var jn;return Te.createElement("div",{className:Jm(U?.loader,f==null||(jn=f.classNames)==null?void 0:jn.loader,"sonner-loader"),"data-visible":oe==="loading"},z.loading)}return Te.createElement(Run,{className:Jm(U?.loader,f==null||(qt=f.classNames)==null?void 0:qt.loader),visible:oe==="loading"})}const _t=f.icon||z?.[oe]||Aun(oe);var Tt,un;return Te.createElement("li",{tabIndex:0,ref:ke,className:Jm(I,Pe,U?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,U?.default,U?.[oe],f==null||(n=f.classNames)==null?void 0:n[oe]),"data-sonner-toast":"","data-rich-colors":(Tt=f.richColors)!=null?Tt:O,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":$,"data-promise":!!f.promise,"data-swiped":pe,"data-removed":Q,"data-visible":K,"data-y-position":bn,"data-x-position":Ve,"data-index":x,"data-front":Ie,"data-swiping":ae,"data-dismissible":we,"data-type":oe,"data-invert":Qe,"data-swipe-out":re,"data-swipe-direction":G,"data-expanded":!!(S||L&&$),"data-testid":f.testId,style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${Q?ne:De.current}px`,"--initial-height":L?"auto":`${ge}px`,...T,...f.style},onDragEnd:()=>{te(!1),D(null),jt.current=null},onPointerDown:qt=>{qt.button!==2&&(Fe||!we||(be.current=new Date,le(De.current),qt.target.setPointerCapture(qt.pointerId),qt.target.tagName!=="BUTTON"&&(te(!0),jt.current={x:qt.clientX,y:qt.clientY})))},onPointerUp:()=>{var qt,jn,xt;if(re||!we)return;jt.current=null;const gn=Number(((qt=ke.current)==null?void 0:qt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Hr=Number(((jn=ke.current)==null?void 0:jn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Tn=new Date().getTime()-((xt=be.current)==null?void 0:xt.getTime()),zn=Z==="x"?gn:Hr,qs=Math.abs(zn)/Tn;if(Math.abs(zn)>=Xun||qs>.11){le(De.current),f.onDismiss==null||f.onDismiss.call(f,f),V(Z==="x"?gn>0?"right":"left":Hr>0?"down":"up"),Ke(),ie(!0);return}else{var xn,Se;(xn=ke.current)==null||xn.style.setProperty("--swipe-amount-x","0px"),(Se=ke.current)==null||Se.style.setProperty("--swipe-amount-y","0px")}X(!1),te(!1),D(null)},onPointerMove:qt=>{var jn,xt,gn;if(!jt.current||!we||((jn=window.getSelection())==null?void 0:jn.toString().length)>0)return;const Tn=qt.clientY-jt.current.y,zn=qt.clientX-jt.current.x;var qs;const xn=(qs=e.swipeDirections)!=null?qs:Jun(B);!Z&&(Math.abs(zn)>1||Math.abs(Tn)>1)&&D(Math.abs(zn)>Math.abs(Tn)?"x":"y");let Se={x:0,y:0};const je=Ue=>1/(1.5+Math.abs(Ue)/20);if(Z==="y"){if(xn.includes("top")||xn.includes("bottom"))if(xn.includes("top")&&Tn<0||xn.includes("bottom")&&Tn>0)Se.y=Tn;else{const Ue=Tn*je(Tn);Se.y=Math.abs(Ue)<Math.abs(Tn)?Ue:Tn}}else if(Z==="x"&&(xn.includes("left")||xn.includes("right")))if(xn.includes("left")&&zn<0||xn.includes("right")&&zn>0)Se.x=zn;else{const Ue=zn*je(zn);Se.x=Math.abs(Ue)<Math.abs(zn)?Ue:zn}(Math.abs(Se.x)>0||Math.abs(Se.y)>0)&&X(!0),(xt=ke.current)==null||xt.style.setProperty("--swipe-amount-x",`${Se.x}px`),(gn=ke.current)==null||gn.style.setProperty("--swipe-amount-y",`${Se.y}px`)}},Ee&&!f.jsx&&oe!=="loading"?Te.createElement("button",{"aria-label":q,"data-disabled":Fe,"data-close-button":!0,onClick:Fe||!we?()=>{}:()=>{Ke(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Jm(U?.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(un=z?.close)!=null?un:Lun):null,(oe||f.icon||f.promise)&&f.icon!==null&&(z?.[oe]!==null||f.icon)?Te.createElement("div",{"data-icon":"",className:Jm(U?.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||rt():null,f.type!=="loading"?_t:null):null,Te.createElement("div",{"data-content":"",className:Jm(U?.content,f==null||(a=f.classNames)==null?void 0:a.content)},Te.createElement("div",{"data-title":"",className:Jm(U?.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?Te.createElement("div",{"data-description":"",className:Jm(P,Le,U?.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&&zL(f.cancel)?Te.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:qt=>{zL(f.cancel)&&we&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,qt),Ke())},className:Jm(U?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Te.isValidElement(f.action)?f.action:f.action&&zL(f.action)?Te.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||N,onClick:qt=>{zL(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,qt),!qt.defaultPrevented&&Ke())},className:Jm(U?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function KAe(){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 tdn(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?Qun:Wun;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=l:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}const ndn=Te.forwardRef(function(t,n){const{id:r,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:d,mobileOffset:f,theme:p="light",richColors:h,duration:m,style:g,visibleToasts:v=Zun,toastOptions:x,dir:w=KAe(),gap:S=Yun,icons:_,containerAriaLabel:O="Notifications"}=t,[E,T]=Te.useState([]),j=Te.useMemo(()=>r?E.filter($=>$.toasterId===r):E.filter($=>!$.toasterId),[E,r]),N=Te.useMemo(()=>Array.from(new Set([a].concat(j.filter($=>$.position).map($=>$.position)))),[j,a]),[I,P]=Te.useState([]),[R,B]=Te.useState(!1),[M,L]=Te.useState(!1),[U,z]=Te.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=Te.useRef(null),Z=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Te.useRef(null),G=Te.useRef(!1),V=Te.useCallback($=>{T(W=>{var Q;return(Q=W.find(J=>J.id===$.id))!=null&&Q.delete||pd.dismiss($.id),W.filter(({id:J})=>J!==$.id)})},[]);return Te.useEffect(()=>pd.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{T(W=>W.map(Q=>Q.id===$.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{Ipe.flushSync(()=>{T(W=>{const Q=W.findIndex(J=>J.id===$.id);return Q!==-1?[...W.slice(0,Q),{...W[Q],...$},...W.slice(Q+1)]:[$,...W]})})})}),[E]),Te.useEffect(()=>{if(p!=="system"){z(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:W})=>{z(W?"dark":"light")})}catch{$.addListener(({matches:Q})=>{try{z(Q?"dark":"light")}catch(J){console.error(J)}})}},[p]),Te.useEffect(()=>{E.length<=1&&B(!1)},[E]),Te.useEffect(()=>{const $=W=>{var Q;if(i.every(te=>W[te]||W.code===te)){var ae;B(!0),(ae=q.current)==null||ae.focus()}W.code==="Escape"&&(document.activeElement===q.current||(Q=q.current)!=null&&Q.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[i]),Te.useEffect(()=>{if(q.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,G.current=!1)}},[q.current]),Te.createElement("section",{ref:n,"aria-label":`${O} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map(($,W)=>{var Q;const[J,ae]=$.split("-");return j.length?Te.createElement("ol",{key:$,dir:w==="auto"?KAe():w,tabIndex:-1,ref:q,className:u,"data-sonner-toaster":!0,"data-sonner-theme":U,"data-y-position":J,"data-x-position":ae,style:{"--front-toast-height":`${((Q=I[0])==null?void 0:Q.height)||0}px`,"--width":`${Gun}px`,"--gap":`${S}px`,...g,...tdn(d,f)},onBlur:te=>{G.current&&!te.currentTarget.contains(te.relatedTarget)&&(G.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||G.current||(G.current=!0,D.current=te.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{M||B(!1)},onDragEnd:()=>B(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},j.filter(te=>!te.position&&W===0||te.position===$).map((te,re)=>{var ie,pe;return Te.createElement(edn,{key:te.id,icons:_,index:re,toast:te,defaultRichColors:h,duration:(ie=x?.duration)!=null?ie:m,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=x?.closeButton)!=null?pe:c,interacting:M,position:$,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:V,toasts:j.filter(X=>X.position==te.position),heights:I.filter(X=>X.position==te.position),setHeights:P,expandByDefault:l,gap:S,expanded:R,swipeDirections:t.swipeDirections})})):null}))});var EW="focusScope.autoFocusOnMount",CW="focusScope.autoFocusOnUnmount",JAe={bubbles:!1,cancelable:!0},rdn="FocusScope",V$=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=e,[l,c]=b.useState(null),u=Hi(s),d=Hi(a),f=b.useRef(null),p=Jn(t,g=>c(g)),h=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let g=function(S){if(h.paused||!l)return;const _=S.target;l.contains(_)?f.current=_:gx(f.current,{select:!0})},v=function(S){if(h.paused||!l)return;const _=S.relatedTarget;_!==null&&(l.contains(_)||gx(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const O of S)O.removedNodes.length>0&&gx(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()}}},[r,l,h.paused]),b.useEffect(()=>{if(l){tIe.add(h);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(EW,JAe);l.addEventListener(EW,u),l.dispatchEvent(x),x.defaultPrevented||(sdn(cdn(Grt(l)),{select:!0}),document.activeElement===g&&gx(l))}return()=>{l.removeEventListener(EW,u),setTimeout(()=>{const x=new CustomEvent(CW,JAe);l.addEventListener(CW,d),l.dispatchEvent(x),x.defaultPrevented||gx(g??document.body,{select:!0}),l.removeEventListener(CW,d),tIe.remove(h)},0)}}},[l,u,d,h]);const m=b.useCallback(g=>{if(!n&&!r||h.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(v&&x){const w=g.currentTarget,[S,_]=adn(w);S&&_?!g.shiftKey&&x===_?(g.preventDefault(),n&&gx(S,{select:!0})):g.shiftKey&&x===S&&(g.preventDefault(),n&&gx(_,{select:!0})):x===w&&g.preventDefault()}},[n,r,h.paused]);return o.jsx(Pn.div,{tabIndex:-1,...i,ref:p,onKeyDown:m})});V$.displayName=rdn;function sdn(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(gx(r,{select:t}),document.activeElement!==n)return}function adn(e){const t=Grt(e),n=eIe(t,e),r=eIe(t.reverse(),e);return[n,r]}function Grt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function eIe(e,t){for(const n of e)if(!idn(n,{upTo:t}))return n}function idn(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 odn(e){return e instanceof HTMLInputElement&&"select"in e}function gx(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&odn(e)&&t&&e.select()}}var tIe=ldn();function ldn(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=nIe(e,t),e.unshift(t)},remove(t){e=nIe(e,t),e[0]?.resume()}}}function nIe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function cdn(e){return e.filter(t=>t.tagName!=="A")}var jW=0;function G8(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??rIe()),document.body.insertAdjacentElement("beforeend",e[1]??rIe()),jW++,()=>{jW===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jW--}},[])}function rIe(){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 bg=function(){return bg=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},bg.apply(this,arguments)};function Yrt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function udn(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var e5="right-scroll-bar-position",t5="width-before-scroll-bar",ddn="with-scroll-bars-hidden",fdn="--removed-body-scroll-bar-size";function TW(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pdn(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var hdn=typeof window<"u"?b.useLayoutEffect:b.useEffect,sIe=new WeakMap;function mdn(e,t){var n=pdn(null,function(r){return e.forEach(function(s){return TW(s,r)})});return hdn(function(){var r=sIe.get(n);if(r){var s=new Set(r),a=new Set(e),i=n.current;s.forEach(function(l){a.has(l)||TW(l,null)}),a.forEach(function(l){s.has(l)||TW(l,i)})}sIe.set(n,e)},[e]),n}function gdn(e){return e}function vdn(e,t){t===void 0&&(t=gdn);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(a),i=n}var c=function(){var d=i;i=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return s}function ydn(e){e===void 0&&(e={});var t=vdn(null);return t.options=bg({async:!0,ssr:!1},e),t}var Xrt=function(e){var t=e.sideCar,n=Yrt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,bg({},n))};Xrt.isSideCarExport=!0;function bdn(e,t){return e.useMedium(t),Xrt}var Krt=ydn(),NW=function(){},Y8=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:NW,onWheelCapture:NW,onTouchMoveCapture:NW}),s=r[0],a=r[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=e.gapMode,_=Yrt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=p,E=mdn([n,t]),T=bg(bg({},_),s);return b.createElement(b.Fragment,null,d&&b.createElement(O,{sideCar:Krt,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:S}),i?b.cloneElement(b.Children.only(l),bg(bg({},T),{ref:E})):b.createElement(w,bg({},T,{className:c,ref:E}),l))});Y8.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Y8.classNames={fullWidth:t5,zeroRight:e5};var xdn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wdn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xdn();return t&&e.setAttribute("nonce",t),e}function Sdn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kdn(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var _dn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wdn())&&(Sdn(t,n),kdn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Odn=function(){var e=_dn();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Jrt=function(){var e=Odn(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Edn={left:0,top:0,right:0,gap:0},AW=function(e){return parseInt(e||"",10)||0},Cdn=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[AW(n),AW(r),AW(s)]},jdn=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Edn;var t=Cdn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Tdn=Jrt(),hE="data-scroll-locked",Ndn=function(e,t,n,r){var s=e.left,a=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
117
117
|
.`.concat(ddn,` {
|
|
118
118
|
overflow: hidden `).concat(r,`;
|
|
@@ -290,7 +290,7 @@ ${J.current.stack}
|
|
|
290
290
|
A`,",",",0,",",",",",",",`
|
|
291
291
|
A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(d<0),E.x,E.y,r,r,+(N>180),+(d>0),S.x,S.y,a,a,+(d<0),_.x,_.y)}else w+=Eo(QMe||(QMe=$S(["L",",","Z"])),t,n);return w},eDn={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},eht=e=>{var t=Wd(e,eDn),{cx:n,cy:r,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 p=Ba("recharts-sector",f),h=a-s,m=O0(i,h,0,!0),g;return m>0&&Math.abs(u-d)<360?g=J2n({cx:n,cy:r,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=Jpt({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d}),b.createElement("path",Dce({},Vu(t),{className:p,d:g}))};function tDn(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(Lft(t)){if(e==="centric"){var{cx:r,cy:s,innerRadius:a,outerRadius:i,angle:l}=t,c=Sc(r,s,a,l),u=Sc(r,s,i,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return Kpt(t)}}var RG={},PG={},$G={},GMe;function nDn(){return GMe||(GMe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qft();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})($G)),$G}var YMe;function rDn(){return YMe||(YMe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nDn();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(PG)),PG}var XMe;function sDn(){return XMe||(XMe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Gft(),n=rDn();function r(s,a,i){i&&typeof i!="number"&&t.isIterateeCall(s,a,i)&&(a=i=void 0),s=n.toFinite(s),a===void 0?(a=s,s=0):a=n.toFinite(a),i=i===void 0?s<a?1:-1:n.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=r})(RG)),RG}var MG,KMe;function aDn(){return KMe||(KMe=1,MG=sDn().range),MG}var iDn=aDn();const tht=xl(iDn);var cw=e=>e.chartData,oDn=et([cw],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Qve=(e,t,n,r)=>r?oDn(e):cw(e);function Vg(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ia(t)&&ia(n))return!0}return!1}function JMe(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function nht(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,s,a;if(ia(n))s=n;else if(typeof n=="function")return;if(ia(r))a=r;else if(typeof r=="function")return;var i=[s,a];if(Vg(i))return i}}function lDn(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Vg(r))return JMe(r,t,n)}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(tr(s))i=s;else if(typeof s=="function")try{t!=null&&(i=s(t?.[0]))}catch{}else if(typeof s=="string"&&Q$e.test(s)){var c=Q$e.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(tr(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t?.[1]))}catch{}else if(typeof a=="string"&&G$e.test(a)){var d=G$e.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 p=[i,l];if(Vg(p))return t==null?p:JMe(p,t,n)}}}var $j=1e9,cDn={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Yve,Wi=!0,vh="[DecimalError] ",t1=vh+"Invalid argument: ",Gve=vh+"Exponent out of range: ",Mj=Math.floor,mS=Math.pow,uDn=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Af,Hl=1e7,Ri=7,rht=9007199254740991,Qz=Mj(rht/Ri),kn={};kn.absoluteValue=kn.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};kn.comparedTo=kn.cmp=function(e){var t,n,r,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(r=a.d.length,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};kn.decimalPlaces=kn.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ri;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};kn.dividedBy=kn.div=function(e){return Py(this,new this.constructor(e))};kn.dividedToIntegerBy=kn.idiv=function(e){var t=this,n=t.constructor;return ii(Py(t,new n(e),0,1),n.precision)};kn.equals=kn.eq=function(e){return!this.cmp(e)};kn.exponent=function(){return ml(this)};kn.greaterThan=kn.gt=function(e){return this.cmp(e)>0};kn.greaterThanOrEqualTo=kn.gte=function(e){return this.cmp(e)>=0};kn.isInteger=kn.isint=function(){return this.e>this.d.length-2};kn.isNegative=kn.isneg=function(){return this.s<0};kn.isPositive=kn.ispos=function(){return this.s>0};kn.isZero=function(){return this.s===0};kn.lessThan=kn.lt=function(e){return this.cmp(e)<0};kn.lessThanOrEqualTo=kn.lte=function(e){return this.cmp(e)<1};kn.logarithm=kn.log=function(e){var t,n=this,r=n.constructor,s=r.precision,a=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Af))throw Error(vh+"NaN");if(n.s<1)throw Error(vh+(n.s?"NaN":"-Infinity"));return n.eq(Af)?new r(0):(Wi=!1,t=Py(VR(n,a),VR(e,a),a),Wi=!0,ii(t,s))};kn.minus=kn.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?iht(t,e):sht(t,(e.s=-e.s,e))};kn.modulo=kn.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(vh+"NaN");return n.s?(Wi=!1,t=Py(n,e,0,1).times(e),Wi=!0,n.minus(t)):ii(new r(n),s)};kn.naturalExponential=kn.exp=function(){return aht(this)};kn.naturalLogarithm=kn.ln=function(){return VR(this)};kn.negated=kn.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};kn.plus=kn.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?sht(t,e):iht(t,(e.s=-e.s,e))};kn.precision=kn.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(t1+e);if(t=ml(s)+1,r=s.d.length-1,n=r*Ri+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};kn.squareRoot=kn.sqrt=function(){var e,t,n,r,s,a,i,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(vh+"NaN")}for(e=ml(l),Wi=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Rg(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=Mj((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),r=new c(t)):r=new c(s.toString()),n=c.precision,s=i=n+3;;)if(a=r,r=a.plus(Py(l,a,i+2)).times(.5),Rg(a.d).slice(0,i)===(t=Rg(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),s==i&&t=="4999"){if(ii(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;i+=4}return Wi=!0,ii(r,n)};kn.times=kn.mul=function(e){var t,n,r,s,a,i,l,c,u,d=this,f=d.constructor,p=d.d,h=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=p.length,u=h.length,c<u&&(a=p,p=h,h=a,i=c,c=u,u=i),a=[],i=c+u,r=i;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,s=c+r;s>r;)l=a[s]+h[r]*p[s-r-1]+t,a[s--]=l%Hl|0,t=l/Hl|0;a[s]=(a[s]+t)%Hl|0}for(;!a[--i];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Wi?ii(e,f.precision):e};kn.toDecimalPlaces=kn.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(nv(e,0,$j),t===void 0?t=r.rounding:nv(t,0,8),ii(n,e+ml(n)+1,t))};kn.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=q1(r,!0):(nv(e,0,$j),t===void 0?t=s.rounding:nv(t,0,8),r=ii(new s(r),e+1,t),n=q1(r,!0,e+1)),n};kn.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?q1(s):(nv(e,0,$j),t===void 0?t=a.rounding:nv(t,0,8),r=ii(new a(s),e+ml(s)+1,t),n=q1(r.abs(),!1,e+ml(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};kn.toInteger=kn.toint=function(){var e=this,t=e.constructor;return ii(new t(e),ml(e)+1,t.rounding)};kn.toNumber=function(){return+this};kn.toPower=kn.pow=function(e){var t,n,r,s,a,i,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Af);if(l=new c(l),!l.s){if(e.s<1)throw Error(vh+"Infinity");return l}if(l.eq(Af))return l;if(r=c.precision,e.eq(Af))return ii(l,r);if(t=e.e,n=e.d.length-1,i=t>=n,a=l.s,i){if((n=d<0?-d:d)<=rht){for(s=new c(Af),t=Math.ceil(r/Ri+4),Wi=!1;n%2&&(s=s.times(l),t2e(s.d,t)),n=Mj(n/2),n!==0;)l=l.times(l),t2e(l.d,t);return Wi=!0,e.s<0?new c(Af).div(s):ii(s,r)}}else if(a<0)throw Error(vh+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Wi=!1,s=e.times(VR(l,r+u)),Wi=!0,s=aht(s),s.s=a,s};kn.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=ml(s),r=q1(s,n<=a.toExpNeg||n>=a.toExpPos)):(nv(e,1,$j),t===void 0?t=a.rounding:nv(t,0,8),s=ii(new a(s),e,t),n=ml(s),r=q1(s,e<=n||n<=a.toExpNeg,e)),r};kn.toSignificantDigits=kn.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(nv(e,1,$j),t===void 0?t=r.rounding:nv(t,0,8)),ii(new r(n),e,t)};kn.toString=kn.valueOf=kn.val=kn.toJSON=kn[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ml(e),n=e.constructor;return q1(e,t<=n.toExpNeg||t>=n.toExpPos)};function sht(e,t){var n,r,s,a,i,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Wi?ii(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?(r=c,a=-a,l=u.length):(r=u,s=i,l=c.length),i=Math.ceil(f/Ri),l=i>l?i+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Hl|0,c[a]%=Hl;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,Wi?ii(t,f):t}function nv(e,t,n){if(e!==~~e||e<t||e>n)throw Error(t1+e)}function Rg(e){var t,n,r,s=e.length-1,a="",i=e[0];if(s>0){for(a+=i,t=1;t<s;t++)r=e[t]+"",n=Ri-r.length,n&&(a+=kx(n)),a+=r;i=e[t],r=i+"",n=Ri-r.length,n&&(a+=kx(n))}else if(i===0)return"0";for(;i%10===0;)i/=10;return a+i}var Py=(function(){function e(r,s){var a,i=0,l=r.length;for(r=r.slice();l--;)a=r[l]*s+i,r[l]=a%Hl|0,i=a/Hl|0;return i&&r.unshift(i),r}function t(r,s,a,i){var l,c;if(a!=i)c=a>i?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=s[l]){c=r[l]>s[l]?1:-1;break}return c}function n(r,s,a){for(var i=0;a--;)r[a]-=i,i=r[a]<s[a]?1:0,r[a]=i*Hl+r[a]-s[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,a,i){var l,c,u,d,f,p,h,m,g,v,x,w,S,_,O,E,T,j,N=r.constructor,I=r.s==s.s?1:-1,P=r.d,R=s.d;if(!r.s)return new N(r);if(!s.s)throw Error(vh+"Division by zero");for(c=r.e-s.e,T=R.length,O=P.length,h=new N(I),m=h.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+(ml(r)-ml(s))+1:w=a,w<0)return new N(0);if(w=w/Ri+2|0,u=0,T==1)for(d=0,R=R[0],w++;(u<O||d)&&w--;u++)S=d*Hl+(P[u]||0),m[u]=S/R|0,d=S%R|0;else{for(d=Hl/(R[0]+1)|0,d>1&&(R=e(R,d),P=e(P,d),T=R.length,O=P.length),_=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]>=Hl/2&&++E;do d=0,l=t(R,g,T,v),l<0?(x=g[0],T!=v&&(x=x*Hl+(g[1]||0)),d=x/E|0,d>1?(d>=Hl&&(d=Hl-1),f=e(R,d),p=f.length,v=g.length,l=t(f,g,p,v),l==1&&(d--,n(f,T<p?j:R,p))):(d==0&&(l=d=1),f=R.slice()),p=f.length,p<v&&f.unshift(0),n(g,f,v),l==-1&&(v=g.length,l=t(R,g,T,v),l<1&&(d++,n(g,T<v?j:R,v))),v=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[v++]=P[_]||0:(g=[P[_]],v=1);while((_++<O||g[0]!==void 0)&&w--)}return m[0]||m.shift(),h.e=c,ii(h,i?a+ml(h)+1:a)}})();function aht(e,t){var n,r,s,a,i,l,c=0,u=0,d=e.constructor,f=d.precision;if(ml(e)>16)throw Error(Gve+ml(e));if(!e.s)return new d(Af);for(Wi=!1,l=f,i=new d(.03125);e.abs().gte(.1);)e=e.times(i),u+=5;for(r=Math.log(mS(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new d(Af),d.precision=l;;){if(s=ii(s.times(e),l),n=n.times(++c),i=a.plus(Py(s,n,l)),Rg(i.d).slice(0,l)===Rg(a.d).slice(0,l)){for(;u--;)a=ii(a.times(a),l);return d.precision=f,t==null?(Wi=!0,ii(a,f)):a}a=i}}function ml(e){for(var t=e.e*Ri,n=e.d[0];n>=10;n/=10)t++;return t}function DG(e,t,n){if(t>e.LN10.sd())throw Wi=!0,n&&(e.precision=n),Error(vh+"LN10 precision limit exceeded");return ii(new e(e.LN10),t)}function kx(e){for(var t="";e--;)t+="0";return t}function VR(e,t){var n,r,s,a,i,l,c,u,d,f=1,p=10,h=e,m=h.d,g=h.constructor,v=g.precision;if(h.s<1)throw Error(vh+(h.s?"NaN":"-Infinity"));if(h.eq(Af))return new g(0);if(t==null?(Wi=!1,u=v):u=t,h.eq(10))return t==null&&(Wi=!0),DG(g,u);if(u+=p,g.precision=u,n=Rg(m),r=n.charAt(0),a=ml(h),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=Rg(h.d),r=n.charAt(0),f++;a=ml(h),r>1?(h=new g("0."+n),a++):h=new g(r+"."+n.slice(1))}else return c=DG(g,u+2,v).times(a+""),h=VR(new g(r+"."+n.slice(1)),u-p).plus(c),g.precision=v,t==null?(Wi=!0,ii(h,v)):h;for(l=i=h=Py(h.minus(Af),h.plus(Af),u),d=ii(h.times(h),u),s=3;;){if(i=ii(i.times(d),u),c=l.plus(Py(i,new g(s),u)),Rg(c.d).slice(0,u)===Rg(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(DG(g,u+2,v).times(a+""))),l=Py(l,new g(f),u),g.precision=v,t==null?(Wi=!0,ii(l,v)):l;l=c,s+=2}}function e2e(e,t){var n,r,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=Mj(n/Ri),e.d=[],r=(n+1)%Ri,n<0&&(r+=Ri),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=Ri;r<s;)e.d.push(+t.slice(r,r+=Ri));t=t.slice(r),r=Ri-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),Wi&&(e.e>Qz||e.e<-Qz))throw Error(Gve+n)}else e.s=0,e.e=0,e.d=[0];return e}function ii(e,t,n){var r,s,a,i,l,c,u,d,f=e.d;for(i=1,a=f[0];a>=10;a/=10)i++;if(r=t-i,r<0)r+=Ri,s=t,u=f[d=0];else{if(d=Math.ceil((r+1)/Ri),a=f.length,d>=a)return e;for(u=a=f[d],i=1;a>=10;a/=10)i++;r%=Ri,s=r-Ri+i}if(n!==void 0&&(a=mS(10,i-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?u/mS(10,i-s):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=ml(e),f.length=1,t=t-a-1,f[0]=mS(10,(Ri-t%Ri)%Ri),e.e=Mj(-t/Ri)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=mS(10,Ri-r),f[d]=s>0?(u/mS(10,i-s)%mS(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Hl&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Hl)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Wi&&(e.e>Qz||e.e<-Qz))throw Error(Gve+ml(e));return e}function iht(e,t){var n,r,s,a,i,l,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),Wi?ii(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),i=u-r,i){for(d=i<0,d?(n=c,i=-i,l=f.length):(n=f,r=u,l=c.length),s=Math.max(Math.ceil(h/Ri),l)+2,i>s&&(i=s,n.length=1),n.reverse(),s=i;s--;)n.push(0);n.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&&(n=c,c=f,f=n,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]=Hl-1;--c[a],c[s]+=Hl}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Wi?ii(t,h):t):new p(0)}function q1(e,t,n){var r,s=ml(e),a=Rg(e.d),i=a.length;return t?(n&&(r=n-i)>0?a=a.charAt(0)+"."+a.slice(1)+kx(r):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+kx(-s-1)+a,n&&(r=n-i)>0&&(a+=kx(r))):s>=i?(a+=kx(s+1-i),n&&(r=n-s-1)>0&&(a=a+"."+kx(r))):((r=s+1)<i&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-i)>0&&(s+1===i&&(a+="."),a+=kx(r))),e.s<0?"-"+a:a}function t2e(e,t){if(e.length>t)return e.length=t,!0}function oht(e){var t,n,r;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(t1+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 e2e(i,a.toString())}else if(typeof a!="string")throw Error(t1+a);if(a.charCodeAt(0)===45?(a=a.slice(1),i.s=-1):i.s=1,uDn.test(a))e2e(i,a);else throw Error(t1+a)}if(s.prototype=kn,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=oht,s.config=s.set=dDn,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return s.config(e),s}function dDn(e){if(!e||typeof e!="object")throw Error(vh+"Object expected");var t,n,r,s=["precision",1,$j,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((r=e[n=s[t]])!==void 0)if(Mj(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(t1+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(t1+n+": "+r);return this}var Yve=oht(cDn);Af=new Yve(1);const Ds=Yve;function lht(e){var t;return e===0?t=1:t=Math.floor(new Ds(e).abs().log(10).toNumber())+1,t}function cht(e,t,n){for(var r=new Ds(e),s=0,a=[];r.lt(t)&&s<1e5;)a.push(r.toNumber()),r=r.add(n),s++;return a}var uht=e=>{var[t,n]=e,[r,s]=[t,n];return t>n&&([r,s]=[n,t]),[r,s]},Xve=(e,t,n)=>{if(e.lte(0))return new Ds(0);var r=lht(e.toNumber()),s=new Ds(10).pow(r),a=e.div(s),i=r!==1?.05:.1,l=new Ds(Math.ceil(a.div(i).toNumber())).add(n).mul(i),c=l.mul(s);return t?new Ds(c.toNumber()):new Ds(Math.ceil(c.toNumber()))},dht=(e,t,n)=>{var r;if(e.lte(0))return new Ds(0);var s=[1,2,2.5,5],a=e.toNumber(),i=Math.floor(new Ds(a).abs().log(10).toNumber()),l=new Ds(10).pow(i),c=e.div(l).toNumber(),u=s.findIndex(h=>h>=c-1e-10);if(u===-1&&(l=l.mul(10),u=0),u+=n,u>=s.length){var d=Math.floor(u/s.length);u%=s.length,l=l.mul(new Ds(10).pow(d))}var f=(r=s[u])!==null&&r!==void 0?r:1,p=new Ds(f).mul(l);return t?p:new Ds(Math.ceil(p.toNumber()))},fDn=(e,t,n)=>{var r=new Ds(1),s=new Ds(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new Ds(10).pow(lht(e)-1),s=new Ds(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new Ds(Math.floor(e)))}else e===0?s=new Ds(Math.floor((t-1)/2)):n||(s=new Ds(Math.floor(e)));for(var i=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new Ds(c-i).mul(r)).toNumber());return l},fht=function(t,n,r,s){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Xve;if(!Number.isFinite((n-t)/(r-1)))return{step:new Ds(0),tickMin:new Ds(0),tickMax:new Ds(0)};var l=i(new Ds(n).sub(t).div(r-1),s,a),c;t<=0&&n>=0?c=new Ds(0):(c=new Ds(t).add(n).div(2),c=c.sub(new Ds(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),d=Math.ceil(new Ds(n).sub(c).div(l).toNumber()),f=u+d+1;return f>r?fht(t,n,r,s,a+1,i):(f<r&&(d=n>0?d+(r-f):d,u=n>0?u:u+(r-f)),{step:l,tickMin:c.sub(new Ds(u).mul(l)),tickMax:c.add(new Ds(d).mul(l))})},n2e=function(t){var[n,r]=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]=uht([n,r]);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 n>r?d.reverse():d}if(c===u)return fDn(c,s,a);var f=i==="snap125"?dht:Xve,{step:p,tickMin:h,tickMax:m}=fht(c,u,l,a,0,f),g=cht(h,m.add(new Ds(.1).mul(p)),p);return n>r?g.reverse():g},r2e=function(t,n){var[r,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]=uht([r,s]);if(l===-1/0||c===1/0)return[r,s];if(l===c)return[l];var u=i==="snap125"?dht:Xve,d=Math.max(n,2),f=u(new Ds(c).sub(l).div(d-1),a,0),p=[...cht(new Ds(l),new Ds(c),f),c];return a===!1&&(p=p.map(h=>Math.round(h))),r>s?p.reverse():p},pDn=e=>e.rootProps.barCategoryGap,pU=e=>e.rootProps.stackOffset,pht=e=>e.rootProps.reverseStackOrder,Kve=e=>e.options.chartName,Jve=e=>e.rootProps.syncId,hht=e=>e.rootProps.syncMethod,eye=e=>e.options.eventEmitter,Pu={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ww={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},tg={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},hU=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function mU(e,t,n){if(n!=="auto")return n;if(e!=null)return hb(e,t)?"category":"number"}function s2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Gz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s2e(Object(n),!0).forEach(function(r){hDn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hDn(e,t,n){return(t=mDn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mDn(e){var t=gDn(e,"string");return typeof t=="symbol"?t:t+""}function gDn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var a2e={allowDataOverflow:Ww.allowDataOverflow,allowDecimals:Ww.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ww.angleAxisId,includeHidden:!1,name:void 0,reversed:Ww.reversed,scale:Ww.scale,tick:Ww.tick,tickCount:void 0,ticks:void 0,type:Ww.type,unit:void 0,niceTicks:"auto"},i2e={allowDataOverflow:tg.allowDataOverflow,allowDecimals:tg.allowDecimals,allowDuplicatedCategory:tg.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:tg.radiusAxisId,includeHidden:tg.includeHidden,name:void 0,reversed:tg.reversed,scale:tg.scale,tick:tg.tick,tickCount:tg.tickCount,ticks:void 0,type:tg.type,unit:void 0,niceTicks:"auto"},vDn=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},tye=et([vDn,Mpt],(e,t)=>{var n;if(e!=null)return e;var r=(n=mU(t,"angleAxis",a2e.type))!==null&&n!==void 0?n:"category";return Gz(Gz({},a2e),{},{type:r})}),yDn=(e,t)=>e.polarAxis.radiusAxis[t],nye=et([yDn,Mpt],(e,t)=>{var n;if(e!=null)return e;var r=(n=mU(t,"radiusAxis",i2e.type))!==null&&n!==void 0?n:"category";return Gz(Gz({},i2e),{},{type:r})}),gU=e=>e.polarOptions,rye=et([mb,gb,Nc],Z2n),mht=et([gU,rye],(e,t)=>{if(e!=null)return O0(e.innerRadius,t,0)}),ght=et([gU,rye],(e,t)=>{if(e!=null)return O0(e.outerRadius,t,t*.8)}),bDn=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},vht=et([gU],bDn);et([tye,vht],hU);var yht=et([rye,mht,ght],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});et([nye,yht],hU);var bht=et([vo,gU,mht,ght,mb,gb],(e,t,n,r,s,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:i,cy:l,startAngle:c,endAngle:u}=t;return{cx:O0(i,s,s/2),cy:O0(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),sc=(e,t)=>t,vU=(e,t,n)=>n;function xht(e){return e?.id}function wht(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:s,dataKey:a}=n,i=new Map;return e.forEach(l=>{var c,u=(c=l.data)!==null&&c!==void 0?c:r;if(!(u==null||u.length===0)){var d=xht(l);u.forEach((f,p)=>{var h=a==null||s?p:String(Cc(f,a,null)),m=Cc(f,l.dataKey,0),g;i.has(h)?g=i.get(h):g={},Object.assign(g,{[d]:m}),i.set(h,g)})}}),Array.from(i.values())}function sye(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var yU=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function bU(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function xDn(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var ac=e=>{var t=vo(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Dj=e=>e.tooltip.settings.axisId;function aye(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),s=[Math.min(...r),Math.max(...r)];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:n?()=>n.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 wDn=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Vg(t)){for(var n,r,s=0;s<t.length;s++){var a=t[s];ia(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Xx(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function SDn(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function iye(e){let t,n,r;e.length!==2?(t=Xx,n=(l,c)=>Xx(e(l),c),r=(l,c)=>e(l)-c):(t=e===Xx||e===SDn?e:kDn,n=e,r=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;n(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;n(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&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:s,center:i,right:a}}function kDn(){return 0}function Sht(e){return e===null?NaN:+e}function*_Dn(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ODn=iye(Xx),bM=ODn.right;iye(Sht).center;class o2e extends Map{constructor(t,n=jDn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(l2e(this,t))}has(t){return super.has(l2e(this,t))}set(t,n){return super.set(EDn(this,t),n)}delete(t){return super.delete(CDn(this,t))}}function l2e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function EDn({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function CDn({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function jDn(e){return e!==null&&typeof e=="object"?e.valueOf():e}function TDn(e=Xx){if(e===Xx)return kht;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function kht(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const NDn=Math.sqrt(50),ADn=Math.sqrt(10),IDn=Math.sqrt(2);function Yz(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),i=a>=NDn?10:a>=ADn?5:a>=IDn?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<=n&&n<2?Yz(e,t,n*2):[l,c,u]}function Lce(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,a,i]=r?Yz(t,e,n):Yz(e,t,n);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(r)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 zce(e,t,n){return t=+t,e=+e,n=+n,Yz(e,t,n)[2]}function Fce(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?zce(t,e,n):zce(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function c2e(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function u2e(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function _ht(e,t,n=0,r=1/0,s){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(s=s===void 0?kht:TDn(s);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),p=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/c+p)),m=Math.min(r,Math.floor(t+(c-u)*f/c+p));_ht(e,t,h,m,s)}const a=e[t];let i=n,l=r;for(PN(e,n,t),s(e[r],a)>0&&PN(e,n,r);i<l;){for(PN(e,i,l),++i,--l;s(e[i],a)<0;)++i;for(;s(e[l],a)>0;)--l}s(e[n],a)===0?PN(e,n,l):(++l,PN(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function PN(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function RDn(e,t,n){if(e=Float64Array.from(_Dn(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return u2e(e);if(t>=1)return c2e(e);var r,s=(r-1)*t,a=Math.floor(s),i=c2e(_ht(e,a).subarray(0,a+1)),l=u2e(e.subarray(a+1));return i+(l-i)*(s-a)}}function PDn(e,t,n=Sht){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,a=Math.floor(s),i=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return i+(l-i)*(s-a)}}function $Dn(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(s);++r<s;)a[r]=e+r*n;return a}function Ah(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function vb(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 Bce=Symbol("implicit");function oye(){var e=new o2e,t=[],n=[],r=Bce;function s(a){let i=e.get(a);if(i===void 0){if(r!==Bce)return r;e.set(a,i=t.push(a)-1)}return n[i%n.length]}return s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new o2e;for(const i of a)e.has(i)||e.set(i,t.push(i)-1);return s},s.range=function(a){return arguments.length?(n=Array.from(a),s):n.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return oye(t,n).unknown(r)},Ah.apply(s,arguments),s}function lye(){var e=oye().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,a,i,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var p=t().length,h=s<r,m=h?s:r,g=h?r:s;a=(g-m)/Math.max(1,p-c+u*2),l&&(a=Math.floor(a)),m+=(g-m-a*(p-c))*d,i=a*(1-c),l&&(m=Math.round(m),i=Math.round(i));var v=$Dn(p).map(function(x){return m+a*x});return n(h?v.reverse():v)}return e.domain=function(p){return arguments.length?(t(p),f()):t()},e.range=function(p){return arguments.length?([r,s]=p,r=+r,s=+s,f()):[r,s]},e.rangeRound=function(p){return[r,s]=p,r=+r,s=+s,l=!0,f()},e.bandwidth=function(){return i},e.step=function(){return a},e.round=function(p){return arguments.length?(l=!!p,f()):l},e.padding=function(p){return arguments.length?(c=Math.min(1,u=+p),f()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),f()):c},e.paddingOuter=function(p){return arguments.length?(u=+p,f()):u},e.align=function(p){return arguments.length?(d=Math.max(0,Math.min(1,p)),f()):d},e.copy=function(){return lye(t(),[r,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},Ah.apply(f(),arguments)}function Oht(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Oht(t())},e}function MDn(){return Oht(lye.apply(null,arguments).paddingInner(1))}function cye(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Eht(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xM(){}var HR=.7,Xz=1/HR,wE="\\s*([+-]?\\d+)\\s*",ZR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",DDn=/^#([0-9a-f]{3,8})$/,LDn=new RegExp(`^rgb\\(${wE},${wE},${wE}\\)$`),zDn=new RegExp(`^rgb\\(${Hg},${Hg},${Hg}\\)$`),FDn=new RegExp(`^rgba\\(${wE},${wE},${wE},${ZR}\\)$`),BDn=new RegExp(`^rgba\\(${Hg},${Hg},${Hg},${ZR}\\)$`),UDn=new RegExp(`^hsl\\(${ZR},${Hg},${Hg}\\)$`),qDn=new RegExp(`^hsla\\(${ZR},${Hg},${Hg},${ZR}\\)$`),d2e={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};cye(xM,V1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:f2e,formatHex:f2e,formatHex8:VDn,formatHsl:HDn,formatRgb:p2e,toString:p2e});function f2e(){return this.rgb().formatHex()}function VDn(){return this.rgb().formatHex8()}function HDn(){return Cht(this).formatHsl()}function p2e(){return this.rgb().formatRgb()}function V1(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=DDn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?h2e(t):n===3?new Cd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?y4(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?y4(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=LDn.exec(e))?new Cd(t[1],t[2],t[3],1):(t=zDn.exec(e))?new Cd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=FDn.exec(e))?y4(t[1],t[2],t[3],t[4]):(t=BDn.exec(e))?y4(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=UDn.exec(e))?v2e(t[1],t[2]/100,t[3]/100,1):(t=qDn.exec(e))?v2e(t[1],t[2]/100,t[3]/100,t[4]):d2e.hasOwnProperty(e)?h2e(d2e[e]):e==="transparent"?new Cd(NaN,NaN,NaN,0):null}function h2e(e){return new Cd(e>>16&255,e>>8&255,e&255,1)}function y4(e,t,n,r){return r<=0&&(e=t=n=NaN),new Cd(e,t,n,r)}function ZDn(e){return e instanceof xM||(e=V1(e)),e?(e=e.rgb(),new Cd(e.r,e.g,e.b,e.opacity)):new Cd}function Uce(e,t,n,r){return arguments.length===1?ZDn(e):new Cd(e,t,n,r??1)}function Cd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}cye(Cd,Uce,Eht(xM,{brighter(e){return e=e==null?Xz:Math.pow(Xz,e),new Cd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?HR:Math.pow(HR,e),new Cd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Cd(n1(this.r),n1(this.g),n1(this.b),Kz(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:m2e,formatHex:m2e,formatHex8:WDn,formatRgb:g2e,toString:g2e}));function m2e(){return`#${MS(this.r)}${MS(this.g)}${MS(this.b)}`}function WDn(){return`#${MS(this.r)}${MS(this.g)}${MS(this.b)}${MS((isNaN(this.opacity)?1:this.opacity)*255)}`}function g2e(){const e=Kz(this.opacity);return`${e===1?"rgb(":"rgba("}${n1(this.r)}, ${n1(this.g)}, ${n1(this.b)}${e===1?")":`, ${e})`}`}function Kz(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function n1(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function MS(e){return e=n1(e),(e<16?"0":"")+e.toString(16)}function v2e(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new im(e,t,n,r)}function Cht(e){if(e instanceof im)return new im(e.h,e.s,e.l,e.opacity);if(e instanceof xM||(e=V1(e)),!e)return new im;if(e instanceof im)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,l=a-s,c=(a+s)/2;return l?(t===a?i=(n-r)/l+(n<r)*6:n===a?i=(r-t)/l+2:i=(t-n)/l+4,l/=c<.5?a+s:2-a-s,i*=60):l=c>0&&c<1?0:i,new im(i,l,c,e.opacity)}function QDn(e,t,n,r){return arguments.length===1?Cht(e):new im(e,t,n,r??1)}function im(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}cye(im,QDn,Eht(xM,{brighter(e){return e=e==null?Xz:Math.pow(Xz,e),new im(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?HR:Math.pow(HR,e),new im(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Cd(LG(e>=240?e-240:e+120,s,r),LG(e,s,r),LG(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new im(y2e(this.h),b4(this.s),b4(this.l),Kz(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=Kz(this.opacity);return`${e===1?"hsl(":"hsla("}${y2e(this.h)}, ${b4(this.s)*100}%, ${b4(this.l)*100}%${e===1?")":`, ${e})`}`}}));function y2e(e){return e=(e||0)%360,e<0?e+360:e}function b4(e){return Math.max(0,Math.min(1,e||0))}function LG(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const uye=e=>()=>e;function GDn(e,t){return function(n){return e+n*t}}function YDn(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function XDn(e){return(e=+e)==1?jht:function(t,n){return n-t?YDn(t,n,e):uye(isNaN(t)?n:t)}}function jht(e,t){var n=t-e;return n?GDn(e,n):uye(isNaN(e)?t:e)}const Jz=(function e(t){var n=XDn(t);function r(s,a){var i=n((s=Uce(s)).r,(a=Uce(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=jht(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 r.gamma=e,r})(1);function KDn(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(a){for(s=0;s<n;++s)r[s]=e[s]*(1-a)+t[s]*a;return r}}function JDn(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function eLn(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),a=new Array(n),i;for(i=0;i<r;++i)s[i]=$y(e[i],t[i]);for(;i<n;++i)a[i]=t[i];return function(l){for(i=0;i<r;++i)a[i]=s[i](l);return a}}function tLn(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nm(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function nLn(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=$y(e[s],t[s]):r[s]=t[s];return function(a){for(s in n)r[s]=n[s](a);return r}}var qce=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zG=new RegExp(qce.source,"g");function rLn(e){return function(){return e}}function sLn(e){return function(t){return e(t)+""}}function Tht(e,t){var n=qce.lastIndex=zG.lastIndex=0,r,s,a,i=-1,l=[],c=[];for(e=e+"",t=t+"";(r=qce.exec(e))&&(s=zG.exec(t));)(a=s.index)>n&&(a=t.slice(n,a),l[i]?l[i]+=a:l[++i]=a),(r=r[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,c.push({i,x:nm(r,s)})),n=zG.lastIndex;return n<t.length&&(a=t.slice(n),l[i]?l[i]+=a:l[++i]=a),l.length<2?c[0]?sLn(c[0].x):rLn(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 $y(e,t){var n=typeof t,r;return t==null||n==="boolean"?uye(t):(n==="number"?nm:n==="string"?(r=V1(t))?(t=r,Jz):Tht:t instanceof V1?Jz:t instanceof Date?tLn:JDn(t)?KDn:Array.isArray(t)?eLn:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?nLn:nm)(e,t)}function dye(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var b2e=180/Math.PI,Vce={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Nht(e,t,n,r,s,a){var i,l,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,i=-i),{translateX:s,translateY:a,rotate:Math.atan2(t,e)*b2e,skewX:Math.atan(c)*b2e,scaleX:i,scaleY:l}}var x4;function aLn(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Vce:Nht(t.a,t.b,t.c,t.d,t.e,t.f)}function iLn(e){return e==null||(x4||(x4=document.createElementNS("http://www.w3.org/2000/svg","g")),x4.setAttribute("transform",e),!(e=x4.transform.baseVal.consolidate()))?Vce:(e=e.matrix,Nht(e.a,e.b,e.c,e.d,e.e,e.f))}function Aht(e,t,n,r){function s(u){return u.length?u.pop()+" ":""}function a(u,d,f,p,h,m){if(u!==f||d!==p){var g=h.push("translate(",null,t,null,n);m.push({i:g-4,x:nm(u,f)},{i:g-2,x:nm(d,p)})}else(f||p)&&h.push("translate("+f+t+p+n)}function i(u,d,f,p){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),p.push({i:f.push(s(f)+"rotate(",null,r)-2,x:nm(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function l(u,d,f,p){u!==d?p.push({i:f.push(s(f)+"skewX(",null,r)-2,x:nm(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(u,d,f,p,h,m){if(u!==f||d!==p){var g=h.push(s(h)+"scale(",null,",",null,")");m.push({i:g-4,x:nm(u,f)},{i:g-2,x:nm(d,p)})}else(f!==1||p!==1)&&h.push(s(h)+"scale("+f+","+p+")")}return function(u,d){var f=[],p=[];return u=e(u),d=e(d),a(u.translateX,u.translateY,d.translateX,d.translateY,f,p),i(u.rotate,d.rotate,f,p),l(u.skewX,d.skewX,f,p),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,p),u=d=null,function(h){for(var m=-1,g=p.length,v;++m<g;)f[(v=p[m]).i]=v.x(h);return f.join("")}}}var oLn=Aht(aLn,"px, ","px)","deg)"),lLn=Aht(iLn,", ",")",")"),cLn=1e-12;function x2e(e){return((e=Math.exp(e))+1/e)/2}function uLn(e){return((e=Math.exp(e))-1/e)/2}function dLn(e){return((e=Math.exp(2*e))-1)/(e+1)}const f5=(function e(t,n,r){function s(a,i){var l=a[0],c=a[1],u=a[2],d=i[0],f=i[1],p=i[2],h=d-l,m=f-c,g=h*h+m*m,v,x;if(g<cLn)x=Math.log(p/u)/t,v=function(T){return[l+T*h,c+T*m,u*Math.exp(t*T*x)]};else{var w=Math.sqrt(g),S=(p*p-u*u+r*g)/(2*u*n*w),_=(p*p-u*u-r*g)/(2*p*n*w),O=Math.log(Math.sqrt(S*S+1)-S),E=Math.log(Math.sqrt(_*_+1)-_);x=(E-O)/t,v=function(T){var j=T*x,N=x2e(O),I=u/(n*w)*(N*dLn(t*j+O)-uLn(O));return[l+I*h,c+I*m,u*N/x2e(t*j+O)]}}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 fLn(e,t){t===void 0&&(t=e,e=$y);for(var n=0,r=t.length-1,s=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(s,s=t[++n]);return function(i){var l=Math.max(0,Math.min(r-1,Math.floor(i*=r)));return a[l](i-l)}}function pLn(e){return function(){return e}}function eF(e){return+e}var w2e=[0,1];function $u(e){return e}function Hce(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:pLn(isNaN(t)?NaN:.5)}function hLn(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function mLn(e,t,n){var r=e[0],s=e[1],a=t[0],i=t[1];return s<r?(r=Hce(s,r),a=n(i,a)):(r=Hce(r,s),a=n(a,i)),function(l){return a(r(l))}}function gLn(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),a=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)s[i]=Hce(e[i],e[i+1]),a[i]=n(t[i],t[i+1]);return function(l){var c=bM(e,l,1,r)-1;return a[c](s[c](l))}}function wM(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function xU(){var e=w2e,t=w2e,n=$y,r,s,a,i=$u,l,c,u;function d(){var p=Math.min(e.length,t.length);return i!==$u&&(i=hLn(e[0],e[p-1])),l=p>2?gLn:mLn,c=u=null,f}function f(p){return p==null||isNaN(p=+p)?a:(c||(c=l(e.map(r),t,n)))(r(i(p)))}return f.invert=function(p){return i(s((u||(u=l(t,e.map(r),nm)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,eF),d()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),n=dye,d()},f.clamp=function(p){return arguments.length?(i=p?!0:$u,d()):i!==$u},f.interpolate=function(p){return arguments.length?(n=p,d()):n},f.unknown=function(p){return arguments.length?(a=p,f):a},function(p,h){return r=p,s=h,d()}}function fye(){return xU()($u,$u)}function vLn(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tF(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function bC(e){return e=tF(Math.abs(e)),e?e[1]:NaN}function yLn(e,t){return function(n,r){for(var s=n.length,a=[],i=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[i=(i+1)%e.length];return a.reverse().join(t)}}function bLn(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var xLn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function WR(e){if(!(t=xLn.exec(e)))throw new Error("invalid format: "+e);var t;return new pye({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]})}WR.prototype=pye.prototype;function pye(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+""}pye.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 wLn(e){e:for(var t=e.length,n=1,r=-1,s;n<t;++n)switch(e[n]){case".":r=s=n;break;case"0":r===0&&(r=n),s=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var nF;function SLn(e,t){var n=tF(e,t);if(!n)return nF=void 0,e.toPrecision(t);var r=n[0],s=n[1],a=s-(nF=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,i=r.length;return a===i?r:a>i?r+new Array(a-i+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+tF(e,Math.max(0,t+a-1))[0]}function S2e(e,t){var n=tF(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const k2e={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:vLn,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)=>S2e(e*100,t),r:S2e,s:SLn,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function _2e(e){return e}var O2e=Array.prototype.map,E2e=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kLn(e){var t=e.grouping===void 0||e.thousands===void 0?_2e:yLn(O2e.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?_2e:bLn(O2e.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,p){f=WR(f);var h=f.fill,m=f.align,g=f.sign,v=f.symbol,x=f.zero,w=f.width,S=f.comma,_=f.precision,O=f.trim,E=f.type;E==="n"?(S=!0,E="g"):k2e[E]||(_===void 0&&(_=12),O=!0,E="g"),(x||h==="0"&&m==="=")&&(x=!0,h="0",m="=");var T=(p&&p.prefix!==void 0?p.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),j=(v==="$"?r:/[%p]/.test(E)?i:"")+(p&&p.suffix!==void 0?p.suffix:""),N=k2e[E],I=/[defgprs%]/.test(E);_=_===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function P(R){var B=T,M=j,L,U,z;if(E==="c")M=N(R)+M,R="";else{R=+R;var q=R<0||1/R<0;if(R=isNaN(R)?c:N(Math.abs(R),_),O&&(R=wLn(R)),q&&+R==0&&g!=="+"&&(q=!1),B=(q?g==="("?g:l:g==="-"||g==="("?"":g)+B,M=(E==="s"&&!isNaN(R)&&nF!==void 0?E2e[8+nF/3]:"")+M+(q&&g==="("?")":""),I){for(L=-1,U=R.length;++L<U;)if(z=R.charCodeAt(L),48>z||z>57){M=(z===46?s+R.slice(L+1):R.slice(L))+M,R=R.slice(0,L);break}}}S&&!x&&(R=t(R,1/0));var Z=B.length+R.length+M.length,D=Z<w?new Array(w-Z+1).join(h):"";switch(S&&x&&(R=t(D+R,D.length?w-M.length:1/0),D=""),m){case"<":R=B+R+M+D;break;case"=":R=B+D+R+M;break;case"^":R=D.slice(0,Z=D.length>>1)+B+R+M+D.slice(Z);break;default:R=D+B+R+M;break}return a(R)}return P.toString=function(){return f+""},P}function d(f,p){var h=Math.max(-8,Math.min(8,Math.floor(bC(p)/3)))*3,m=Math.pow(10,-h),g=u((f=WR(f),f.type="f",f),{suffix:E2e[8+h/3]});return function(v){return g(m*v)}}return{format:u,formatPrefix:d}}var w4,hye,Iht;_Ln({thousands:",",grouping:[3],currency:["$",""]});function _Ln(e){return w4=kLn(e),hye=w4.format,Iht=w4.formatPrefix,w4}function OLn(e){return Math.max(0,-bC(Math.abs(e)))}function ELn(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(bC(t)/3)))*3-bC(Math.abs(e)))}function CLn(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,bC(t)-bC(e))+1}function Rht(e,t,n,r){var s=Fce(e,t,n),a;switch(r=WR(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=ELn(s,i))&&(r.precision=a),Iht(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=CLn(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=OLn(s))&&(r.precision=a-(r.type==="%")*2);break}}return hye(r)}function uw(e){var t=e.domain;return e.ticks=function(n){var r=t();return Lce(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return Rht(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,a=r.length-1,i=r[s],l=r[a],c,u,d=10;for(l<i&&(u=i,i=l,l=u,u=s,s=a,a=u);d-- >0;){if(u=zce(i,l,n),u===c)return r[s]=i,r[a]=l,t(r);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 Pht(){var e=fye();return e.copy=function(){return wM(e,Pht())},Ah.apply(e,arguments),uw(e)}function $ht(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,eF),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return $ht(e).unknown(t)},e=arguments.length?Array.from(e,eF):[0,1],uw(n)}function Mht(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],a=e[r],i;return a<s&&(i=n,n=r,r=i,i=s,s=a,a=i),e[n]=t.floor(s),e[r]=t.ceil(a),e}function C2e(e){return Math.log(e)}function j2e(e){return Math.exp(e)}function jLn(e){return-Math.log(-e)}function TLn(e){return-Math.exp(-e)}function NLn(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ALn(e){return e===10?NLn:e===Math.E?Math.exp:t=>Math.pow(e,t)}function ILn(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 T2e(e){return(t,n)=>-e(-t,n)}function mye(e){const t=e(C2e,j2e),n=t.domain;let r=10,s,a;function i(){return s=ILn(r),a=ALn(r),n()[0]<0?(s=T2e(s),a=T2e(a),e(jLn,TLn)):e(C2e,j2e),t}return t.base=function(l){return arguments.length?(r=+l,i()):r},t.domain=function(l){return arguments.length?(n(l),i()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let p=s(u),h=s(d),m,g;const v=l==null?10:+l;let x=[];if(!(r%1)&&h-p<v){if(p=Math.floor(p),h=Math.ceil(h),u>0){for(;p<=h;++p)for(m=1;m<r;++m)if(g=p<0?m/a(-p):m*a(p),!(g<u)){if(g>d)break;x.push(g)}}else for(;p<=h;++p)for(m=r-1;m>=1;--m)if(g=p>0?m/a(-p):m*a(p),!(g<u)){if(g>d)break;x.push(g)}x.length*2<v&&(x=Lce(u,d,v))}else x=Lce(p,h,Math.min(h-p,v)).map(a);return f?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=WR(c)).precision==null&&(c.trim=!0),c=hye(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(Mht(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function Dht(){const e=mye(xU()).domain([1,10]);return e.copy=()=>wM(e,Dht()).base(e.base()),Ah.apply(e,arguments),e}function N2e(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function A2e(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function gye(e){var t=1,n=e(N2e(t),A2e(t));return n.constant=function(r){return arguments.length?e(N2e(t=+r),A2e(t)):t},uw(n)}function Lht(){var e=gye(xU());return e.copy=function(){return wM(e,Lht()).constant(e.constant())},Ah.apply(e,arguments)}function I2e(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function RLn(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function PLn(e){return e<0?-e*e:e*e}function vye(e){var t=e($u,$u),n=1;function r(){return n===1?e($u,$u):n===.5?e(RLn,PLn):e(I2e(n),I2e(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},uw(t)}function yye(){var e=vye(xU());return e.copy=function(){return wM(e,yye()).exponent(e.exponent())},Ah.apply(e,arguments),e}function $Ln(){return yye.apply(null,arguments).exponent(.5)}function R2e(e){return Math.sign(e)*e*e}function MLn(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function zht(){var e=fye(),t=[0,1],n=!1,r;function s(a){var i=MLn(e(a));return isNaN(i)?r:n?Math.round(i):i}return s.invert=function(a){return e.invert(R2e(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,eF)).map(R2e)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(n=!!a,s):n},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return zht(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ah.apply(s,arguments),uw(s)}function Fht(){var e=[],t=[],n=[],r;function s(){var i=0,l=Math.max(1,t.length);for(n=new Array(l-1);++i<l;)n[i-1]=PDn(e,i/l);return a}function a(i){return i==null||isNaN(i=+i)?r:t[bM(n,i)]}return a.invertExtent=function(i){var l=t.indexOf(i);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[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(Xx),s()},a.range=function(i){return arguments.length?(t=Array.from(i),s()):t.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return Fht().domain(e).range(t).unknown(r)},Ah.apply(a,arguments)}function Bht(){var e=0,t=1,n=1,r=[.5],s=[0,1],a;function i(c){return c!=null&&c<=c?s[bM(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return 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?(n=(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,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},i.unknown=function(c){return arguments.length&&(a=c),i},i.thresholds=function(){return r.slice()},i.copy=function(){return Bht().domain([e,t]).range(s).unknown(a)},Ah.apply(uw(i),arguments)}function Uht(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[bM(e,a,0,r)]:n}return s.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),r=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?(n=a,s):n},s.copy=function(){return Uht().domain(e).range(t).unknown(n)},Ah.apply(s,arguments)}const FG=new Date,BG=new Date;function Dl(e,t,n,r){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=>Dl(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););}),n&&(s.count=(a,i)=>(FG.setTime(+a),BG.setTime(+i),e(FG),e(BG),Math.floor(n(FG,BG))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?i=>r(i)%a===0:i=>s.count(0,i)%a===0):s)),s}const rF=Dl(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rF.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Dl(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rF);rF.range;const Oy=1e3,rh=Oy*60,Ey=rh*60,Gy=Ey*24,bye=Gy*7,P2e=Gy*30,UG=Gy*365,DS=Dl(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Oy)},(e,t)=>(t-e)/Oy,e=>e.getUTCSeconds());DS.range;const xye=Dl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Oy)},(e,t)=>{e.setTime(+e+t*rh)},(e,t)=>(t-e)/rh,e=>e.getMinutes());xye.range;const wye=Dl(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*rh)},(e,t)=>(t-e)/rh,e=>e.getUTCMinutes());wye.range;const Sye=Dl(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Oy-e.getMinutes()*rh)},(e,t)=>{e.setTime(+e+t*Ey)},(e,t)=>(t-e)/Ey,e=>e.getHours());Sye.range;const kye=Dl(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ey)},(e,t)=>(t-e)/Ey,e=>e.getUTCHours());kye.range;const SM=Dl(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rh)/Gy,e=>e.getDate()-1);SM.range;const wU=Dl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Gy,e=>e.getUTCDate()-1);wU.range;const qht=Dl(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Gy,e=>Math.floor(e/Gy));qht.range;function $k(e){return Dl(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*rh)/bye)}const SU=$k(0),sF=$k(1),DLn=$k(2),LLn=$k(3),xC=$k(4),zLn=$k(5),FLn=$k(6);SU.range;sF.range;DLn.range;LLn.range;xC.range;zLn.range;FLn.range;function Mk(e){return Dl(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/bye)}const kU=Mk(0),aF=Mk(1),BLn=Mk(2),ULn=Mk(3),wC=Mk(4),qLn=Mk(5),VLn=Mk(6);kU.range;aF.range;BLn.range;ULn.range;wC.range;qLn.range;VLn.range;const _ye=Dl(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());_ye.range;const Oye=Dl(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());Oye.range;const Yy=Dl(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Yy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Dl(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Yy.range;const Xy=Dl(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Xy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Dl(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Xy.range;function Vht(e,t,n,r,s,a){const i=[[DS,1,Oy],[DS,5,5*Oy],[DS,15,15*Oy],[DS,30,30*Oy],[a,1,rh],[a,5,5*rh],[a,15,15*rh],[a,30,30*rh],[s,1,Ey],[s,3,3*Ey],[s,6,6*Ey],[s,12,12*Ey],[r,1,Gy],[r,2,2*Gy],[n,1,bye],[t,1,P2e],[t,3,3*P2e],[e,1,UG]];function l(u,d,f){const p=d<u;p&&([u,d]=[d,u]);const h=f&&typeof f.range=="function"?f:c(u,d,f),m=h?h.range(u,+d+1):[];return p?m.reverse():m}function c(u,d,f){const p=Math.abs(d-u)/f,h=iye(([,,v])=>v).right(i,p);if(h===i.length)return e.every(Fce(u/UG,d/UG,f));if(h===0)return rF.every(Math.max(Fce(u,d,f),1));const[m,g]=i[p/i[h-1][2]<i[h][2]/p?h-1:h];return m.every(g)}return[l,c]}const[HLn,ZLn]=Vht(Xy,Oye,kU,qht,kye,wye),[WLn,QLn]=Vht(Yy,_ye,SU,SM,Sye,xye);function qG(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 VG(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 $N(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function GLn(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,a=e.days,i=e.shortDays,l=e.months,c=e.shortMonths,u=MN(s),d=DN(s),f=MN(a),p=DN(a),h=MN(i),m=DN(i),g=MN(l),v=DN(l),x=MN(c),w=DN(c),S={a:z,A:q,b:Z,B:D,c:null,d:F2e,e:F2e,f:y4n,g:j4n,G:N4n,H:m4n,I:g4n,j:v4n,L:Hht,m:b4n,M:x4n,p:G,q:V,Q:q2e,s:V2e,S:w4n,u:S4n,U:k4n,V:_4n,w:O4n,W:E4n,x:null,X:null,y:C4n,Y:T4n,Z:A4n,"%":U2e},_={a:$,A:W,b:Q,B:J,c:null,d:B2e,e:B2e,f:$4n,g:H4n,G:W4n,H:I4n,I:R4n,j:P4n,L:Wht,m:M4n,M:D4n,p:ae,q:te,Q:q2e,s:V2e,S:L4n,u:z4n,U:F4n,V:B4n,w:U4n,W:q4n,x:null,X:null,y:V4n,Y:Z4n,Z:Q4n,"%":U2e},O={a:I,A:P,b:R,B,c:M,d:L2e,e:L2e,f:d4n,g:D2e,G:M2e,H:z2e,I:z2e,j:o4n,L:u4n,m:i4n,M:l4n,p:N,q:a4n,Q:p4n,s:h4n,S:c4n,u:e4n,U:t4n,V:n4n,w:JLn,W:r4n,x:L,X:U,y:D2e,Y:M2e,Z:s4n,"%":f4n};S.x=E(n,S),S.X=E(r,S),S.c=E(t,S),_.x=E(n,_),_.X=E(r,_),_.c=E(t,_);function E(re,ie){return function(pe){var X=[],ne=-1,le=0,ge=re.length,de,ue,be;for(pe instanceof Date||(pe=new Date(+pe));++ne<ge;)re.charCodeAt(ne)===37&&(X.push(re.slice(le,ne)),(ue=$2e[de=re.charAt(++ne)])!=null?de=re.charAt(++ne):ue=de==="e"?" ":"0",(be=ie[de])&&(de=be(pe,ue)),X.push(de),le=ne+1);return X.push(re.slice(le,ne)),X.join("")}}function T(re,ie){return function(pe){var X=$N(1900,void 0,1),ne=j(X,re,pe+="",0),le,ge;if(ne!=pe.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(ie&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(le=VG($N(X.y,0,1)),ge=le.getUTCDay(),le=ge>4||ge===0?aF.ceil(le):aF(le),le=wU.offset(le,(X.V-1)*7),X.y=le.getUTCFullYear(),X.m=le.getUTCMonth(),X.d=le.getUTCDate()+(X.w+6)%7):(le=qG($N(X.y,0,1)),ge=le.getDay(),le=ge>4||ge===0?sF.ceil(le):sF(le),le=SM.offset(le,(X.V-1)*7),X.y=le.getFullYear(),X.m=le.getMonth(),X.d=le.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),ge="Z"in X?VG($N(X.y,0,1)).getUTCDay():qG($N(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(ge+5)%7:X.w+X.U*7-(ge+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,VG(X)):qG(X)}}function j(re,ie,pe,X){for(var ne=0,le=ie.length,ge=pe.length,de,ue;ne<le;){if(X>=ge)return-1;if(de=ie.charCodeAt(ne++),de===37){if(de=ie.charAt(ne++),ue=O[de in $2e?ie.charAt(ne++):de],!ue||(X=ue(re,pe,X))<0)return-1}else if(de!=pe.charCodeAt(X++))return-1}return X}function N(re,ie,pe){var X=u.exec(ie.slice(pe));return X?(re.p=d.get(X[0].toLowerCase()),pe+X[0].length):-1}function I(re,ie,pe){var X=h.exec(ie.slice(pe));return X?(re.w=m.get(X[0].toLowerCase()),pe+X[0].length):-1}function P(re,ie,pe){var X=f.exec(ie.slice(pe));return X?(re.w=p.get(X[0].toLowerCase()),pe+X[0].length):-1}function R(re,ie,pe){var X=x.exec(ie.slice(pe));return X?(re.m=w.get(X[0].toLowerCase()),pe+X[0].length):-1}function B(re,ie,pe){var X=g.exec(ie.slice(pe));return X?(re.m=v.get(X[0].toLowerCase()),pe+X[0].length):-1}function M(re,ie,pe){return j(re,t,ie,pe)}function L(re,ie,pe){return j(re,n,ie,pe)}function U(re,ie,pe){return j(re,r,ie,pe)}function z(re){return i[re.getDay()]}function q(re){return a[re.getDay()]}function Z(re){return c[re.getMonth()]}function D(re){return l[re.getMonth()]}function G(re){return s[+(re.getHours()>=12)]}function V(re){return 1+~~(re.getMonth()/3)}function $(re){return i[re.getUTCDay()]}function W(re){return a[re.getUTCDay()]}function Q(re){return c[re.getUTCMonth()]}function J(re){return l[re.getUTCMonth()]}function ae(re){return s[+(re.getUTCHours()>=12)]}function te(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ie=E(re+="",S);return ie.toString=function(){return re},ie},parse:function(re){var ie=T(re+="",!1);return ie.toString=function(){return re},ie},utcFormat:function(re){var ie=E(re+="",_);return ie.toString=function(){return re},ie},utcParse:function(re){var ie=T(re+="",!0);return ie.toString=function(){return re},ie}}}var $2e={"-":"",_:" ",0:"0"},ic=/^\s*\d+/,YLn=/^%/,XLn=/[\\^$*+?|[\]().{}]/g;function oa(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",a=s.length;return r+(a<n?new Array(n-a+1).join(t)+s:s)}function KLn(e){return e.replace(XLn,"\\$&")}function MN(e){return new RegExp("^(?:"+e.map(KLn).join("|")+")","i")}function DN(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function JLn(e,t,n){var r=ic.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function e4n(e,t,n){var r=ic.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function t4n(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function n4n(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function r4n(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function M2e(e,t,n){var r=ic.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function D2e(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function s4n(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function a4n(e,t,n){var r=ic.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function i4n(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function L2e(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function o4n(e,t,n){var r=ic.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function z2e(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function l4n(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function c4n(e,t,n){var r=ic.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function u4n(e,t,n){var r=ic.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function d4n(e,t,n){var r=ic.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function f4n(e,t,n){var r=YLn.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function p4n(e,t,n){var r=ic.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function h4n(e,t,n){var r=ic.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function F2e(e,t){return oa(e.getDate(),t,2)}function m4n(e,t){return oa(e.getHours(),t,2)}function g4n(e,t){return oa(e.getHours()%12||12,t,2)}function v4n(e,t){return oa(1+SM.count(Yy(e),e),t,3)}function Hht(e,t){return oa(e.getMilliseconds(),t,3)}function y4n(e,t){return Hht(e,t)+"000"}function b4n(e,t){return oa(e.getMonth()+1,t,2)}function x4n(e,t){return oa(e.getMinutes(),t,2)}function w4n(e,t){return oa(e.getSeconds(),t,2)}function S4n(e){var t=e.getDay();return t===0?7:t}function k4n(e,t){return oa(SU.count(Yy(e)-1,e),t,2)}function Zht(e){var t=e.getDay();return t>=4||t===0?xC(e):xC.ceil(e)}function _4n(e,t){return e=Zht(e),oa(xC.count(Yy(e),e)+(Yy(e).getDay()===4),t,2)}function O4n(e){return e.getDay()}function E4n(e,t){return oa(sF.count(Yy(e)-1,e),t,2)}function C4n(e,t){return oa(e.getFullYear()%100,t,2)}function j4n(e,t){return e=Zht(e),oa(e.getFullYear()%100,t,2)}function T4n(e,t){return oa(e.getFullYear()%1e4,t,4)}function N4n(e,t){var n=e.getDay();return e=n>=4||n===0?xC(e):xC.ceil(e),oa(e.getFullYear()%1e4,t,4)}function A4n(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+oa(t/60|0,"0",2)+oa(t%60,"0",2)}function B2e(e,t){return oa(e.getUTCDate(),t,2)}function I4n(e,t){return oa(e.getUTCHours(),t,2)}function R4n(e,t){return oa(e.getUTCHours()%12||12,t,2)}function P4n(e,t){return oa(1+wU.count(Xy(e),e),t,3)}function Wht(e,t){return oa(e.getUTCMilliseconds(),t,3)}function $4n(e,t){return Wht(e,t)+"000"}function M4n(e,t){return oa(e.getUTCMonth()+1,t,2)}function D4n(e,t){return oa(e.getUTCMinutes(),t,2)}function L4n(e,t){return oa(e.getUTCSeconds(),t,2)}function z4n(e){var t=e.getUTCDay();return t===0?7:t}function F4n(e,t){return oa(kU.count(Xy(e)-1,e),t,2)}function Qht(e){var t=e.getUTCDay();return t>=4||t===0?wC(e):wC.ceil(e)}function B4n(e,t){return e=Qht(e),oa(wC.count(Xy(e),e)+(Xy(e).getUTCDay()===4),t,2)}function U4n(e){return e.getUTCDay()}function q4n(e,t){return oa(aF.count(Xy(e)-1,e),t,2)}function V4n(e,t){return oa(e.getUTCFullYear()%100,t,2)}function H4n(e,t){return e=Qht(e),oa(e.getUTCFullYear()%100,t,2)}function Z4n(e,t){return oa(e.getUTCFullYear()%1e4,t,4)}function W4n(e,t){var n=e.getUTCDay();return e=n>=4||n===0?wC(e):wC.ceil(e),oa(e.getUTCFullYear()%1e4,t,4)}function Q4n(){return"+0000"}function U2e(){return"%"}function q2e(e){return+e}function V2e(e){return Math.floor(+e/1e3)}var q_,Ght,Yht;G4n({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 G4n(e){return q_=GLn(e),Ght=q_.format,q_.parse,Yht=q_.utcFormat,q_.utcParse,q_}function Y4n(e){return new Date(e)}function X4n(e){return e instanceof Date?+e:+new Date(+e)}function Eye(e,t,n,r,s,a,i,l,c,u){var d=fye(),f=d.invert,p=d.domain,h=u(".%L"),m=u(":%S"),g=u("%I:%M"),v=u("%I %p"),x=u("%a %d"),w=u("%b %d"),S=u("%B"),_=u("%Y");function O(E){return(c(E)<E?h:l(E)<E?m:i(E)<E?g:a(E)<E?v:r(E)<E?s(E)<E?x:w:n(E)<E?S:_)(E)}return d.invert=function(E){return new Date(f(E))},d.domain=function(E){return arguments.length?p(Array.from(E,X4n)):p().map(Y4n)},d.ticks=function(E){var T=p();return e(T[0],T[T.length-1],E??10)},d.tickFormat=function(E,T){return T==null?O:u(T)},d.nice=function(E){var T=p();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?p(Mht(T,E)):d},d.copy=function(){return wM(d,Eye(e,t,n,r,s,a,i,l,c,u))},d}function K4n(){return Ah.apply(Eye(WLn,QLn,Yy,_ye,SU,SM,Sye,xye,DS,Ght).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function J4n(){return Ah.apply(Eye(HLn,ZLn,Xy,Oye,kU,wU,kye,wye,DS,Yht).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function _U(){var e=0,t=1,n,r,s,a,i=$u,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:i(s===0?.5:(f=(a(f)-n)*s,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),s=n===r?0:1/(r-n),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(p){var h,m;return arguments.length?([h,m]=p,i=f(h,m),u):[i(0),i(1)]}}return u.range=d($y),u.rangeRound=d(dye),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,n=f(e),r=f(t),s=n===r?0:1/(r-n),u}}function dw(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Xht(){var e=uw(_U()($u));return e.copy=function(){return dw(e,Xht())},vb.apply(e,arguments)}function Kht(){var e=mye(_U()).domain([1,10]);return e.copy=function(){return dw(e,Kht()).base(e.base())},vb.apply(e,arguments)}function Jht(){var e=gye(_U());return e.copy=function(){return dw(e,Jht()).constant(e.constant())},vb.apply(e,arguments)}function Cye(){var e=vye(_U());return e.copy=function(){return dw(e,Cye()).exponent(e.exponent())},vb.apply(e,arguments)}function e3n(){return Cye.apply(null,arguments).exponent(.5)}function emt(){var e=[],t=$u;function n(r){if(r!=null&&!isNaN(r=+r))return t((bM(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Xx),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,s)=>t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,a)=>RDn(e,a/r))},n.copy=function(){return emt(t).domain(e)},vb.apply(n,arguments)}function OU(){var e=0,t=.5,n=1,r=1,s,a,i,l,c,u=$u,d,f=!1,p;function h(g){return isNaN(g=+g)?p:(g=.5+((g=+d(g))-a)*(r*g<r*a?l:c),u(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,s=d(e=+e),a=d(t=+t),i=d(n=+n),l=s===a?0:.5/(a-s),c=a===i?0:.5/(i-a),r=a<s?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(u=g,h):u};function m(g){return function(v){var x,w,S;return arguments.length?([x,w,S]=v,u=fLn(g,[x,w,S]),h):[u(0),u(.5),u(1)]}}return h.range=m($y),h.rangeRound=m(dye),h.unknown=function(g){return arguments.length?(p=g,h):p},function(g){return d=g,s=g(e),a=g(t),i=g(n),l=s===a?0:.5/(a-s),c=a===i?0:.5/(i-a),r=a<s?-1:1,h}}function tmt(){var e=uw(OU()($u));return e.copy=function(){return dw(e,tmt())},vb.apply(e,arguments)}function nmt(){var e=mye(OU()).domain([.1,1,10]);return e.copy=function(){return dw(e,nmt()).base(e.base())},vb.apply(e,arguments)}function rmt(){var e=gye(OU());return e.copy=function(){return dw(e,rmt()).constant(e.constant())},vb.apply(e,arguments)}function jye(){var e=vye(OU());return e.copy=function(){return dw(e,jye()).exponent(e.exponent())},vb.apply(e,arguments)}function t3n(){return jye.apply(null,arguments).exponent(.5)}const EA=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:lye,scaleDiverging:tmt,scaleDivergingLog:nmt,scaleDivergingPow:jye,scaleDivergingSqrt:t3n,scaleDivergingSymlog:rmt,scaleIdentity:$ht,scaleImplicit:Bce,scaleLinear:Pht,scaleLog:Dht,scaleOrdinal:oye,scalePoint:MDn,scalePow:yye,scaleQuantile:Fht,scaleQuantize:Bht,scaleRadial:zht,scaleSequential:Xht,scaleSequentialLog:Kht,scaleSequentialPow:Cye,scaleSequentialQuantile:emt,scaleSequentialSqrt:e3n,scaleSequentialSymlog:Jht,scaleSqrt:$Ln,scaleSymlog:Lht,scaleThreshold:Uht,scaleTime:K4n,scaleUtc:J4n,tickFormat:Rht},Symbol.toStringTag,{value:"Module"}));function n3n(e){if(e in EA)return EA[e]();var t="scale".concat(fM(e));if(t in EA)return EA[t]()}function H2e(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=n3n(e);if(r!=null)return r.domain(t).range(n),r}}function Tye(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?H2e(e.scale,n,r):H2e(t,n,r)}function r3n(e){return"scale".concat(fM(e))}function s3n(e){return r3n(e)in EA}var smt=(e,t,n)=>{if(e!=null){var{scale:r,type:s}=e;if(r==="auto")return s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof r=="string")return s3n(r)?r:"point"}};function a3n(e,t){for(var n=0,r=e.length,s=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(s?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function amt(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var i;return(i=e(a))!==null&&i!==void 0?i:0}),s=e.range();if(!(n.length===0||s.length<2))return a=>{var i,l,c=a3n(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var u=(i=r[c-1])!==null&&i!==void 0?i:0,d=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-u)<=Math.abs(a-d)?n[c-1]:n[c]}}}function i3n(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):amt(e,void 0)}function Z2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function iF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z2e(Object(n),!0).forEach(function(r){o3n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o3n(e,t,n){return(t=l3n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l3n(e){var t=c3n(e,"string");return typeof t=="symbol"?t:t+""}function c3n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zce=[0,"auto"],jl={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"},imt=(e,t)=>e.cartesianAxis.xAxis[t],yb=(e,t)=>{var n=imt(e,t);return n??jl},Tl={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Zce,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:mM},omt=(e,t)=>e.cartesianAxis.yAxis[t],bb=(e,t)=>{var n=omt(e,t);return n??Tl},u3n={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:""},Nye=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??u3n},Xu=(e,t,n)=>{switch(t){case"xAxis":return yb(e,n);case"yAxis":return bb(e,n);case"zAxis":return Nye(e,n);case"angleAxis":return tye(e,n);case"radiusAxis":return nye(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},d3n=(e,t,n)=>{switch(t){case"xAxis":return yb(e,n);case"yAxis":return bb(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},kM=(e,t,n)=>{switch(t){case"xAxis":return yb(e,n);case"yAxis":return bb(e,n);case"angleAxis":return tye(e,n);case"radiusAxis":return nye(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},lmt=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function cmt(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var umt=e=>e.graphicalItems.cartesianItems,f3n=et([sc,vU],cmt),dmt=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),_M=et([umt,Xu,f3n],dmt,{memoizeOptions:{resultEqualityCheck:bU}}),fmt=et([_M],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(sye)),pmt=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),p3n=et([_M],pmt),hmt=e=>e.map(t=>t.data).filter(Boolean).flat(1),h3n=et([_M],hmt,{memoizeOptions:{resultEqualityCheck:bU}}),mmt=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:s}=t;return e.length>0?e:n.slice(r,s+1)},Aye=et([h3n,Qve],mmt),gmt=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Cc(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(s=>({value:Cc(s,r)}))):e.map(r=>({value:r})),OM=et([Aye,Xu,_M],gmt);function SE(e){if(ev(e)||e instanceof Date){var t=Number(e);if(ia(t))return t}}function W2e(e){if(Array.isArray(e)){var t=[SE(e[0]),SE(e[1])];return Vg(t)?t:void 0}var n=SE(e);if(n!=null)return[n,n]}function Ky(e){return e.map(SE).filter(Ed)}function m3n(e,t){var n=SE(e),r=SE(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var g3n=et([OM],e=>e?.map(t=>t.value).sort(m3n));function vmt(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function v3n(e,t,n){return!n||typeof t!="number"||Wy(t)?[]:n.length?Ky(n.flatMap(r=>{var s=Cc(e,r.dataKey),a,i;if(Array.isArray(s)?[a,i]=s:a=i=s,!(!ia(a)||!ia(i)))return[t-a,t+i]})):[]}var Ll=e=>{var t=ac(e),n=Dj(e);return kM(e,t,n)},EM=et([Ll],e=>e?.dataKey),y3n=et([fmt,Qve,Ll],wht),ymt=(e,t,n,r)=>{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=r?[...c].reverse():c,d=u.map(xht);return[l,{stackedData:I$n(e,d,n),graphicalItems:u}]}))},b3n=et([y3n,fmt,pU,pht],ymt),bmt=(e,t,n,r)=>{var{dataStartIndex:s,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var i=$$n(e,s,a);if(!(i!=null&&i[0]===0&&i[1]===0))return i}},x3n=et([Xu],e=>e.allowDataOverflow),Iye=e=>{var t;if(e==null||!("domain"in e))return Zce;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ky(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:Zce},xmt=et([Xu],Iye),wmt=et([xmt,x3n],nht),w3n=et([b3n,cw,sc,wmt],bmt,{memoizeOptions:{resultEqualityCheck:yU}}),Rye=e=>e.errorBars,S3n=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>vmt(n,r)),oF=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n.filter(Boolean);if(s.length!==0){var a=s.flat(),i=Math.min(...a),l=Math.max(...a);return[i,l]}},Smt=(e,t,n,r,s)=>{var a,i;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var u,d,f=(u=r[c.id])===null||u===void 0?void 0:u.filter(x=>vmt(s,x)),p=Cc(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),h=v3n(l,p,f);if(h.length>=2){var m=Math.min(...h),g=Math.max(...h);(a==null||m<a)&&(a=m),(i==null||g>i)&&(i=g)}var v=W2e(p);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=W2e(Cc(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]))}),ia(a)&&ia(i))return[a,i]},k3n=et([Aye,Xu,p3n,Rye,sc],Smt,{memoizeOptions:{resultEqualityCheck:yU}});function _3n(e){var{value:t}=e;if(ev(t)||t instanceof Date)return t}var O3n=(e,t,n)=>{var r=e.map(_3n).filter(s=>s!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&Pft(r))?tht(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},kmt=e=>e.referenceElements.dots,Lj=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),E3n=et([kmt,sc,vU],Lj),_mt=e=>e.referenceElements.areas,C3n=et([_mt,sc,vU],Lj),Omt=e=>e.referenceElements.lines,j3n=et([Omt,sc,vU],Lj),Emt=(e,t)=>{if(e!=null){var n=Ky(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},T3n=et(E3n,sc,Emt),Cmt=(e,t)=>{if(e!=null){var n=Ky(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},N3n=et([C3n,sc],Cmt);function A3n(e){var t;if(e.x!=null)return Ky([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ky(n)}function I3n(e){var t;if(e.y!=null)return Ky([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ky(n)}var jmt=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?A3n(r):I3n(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},R3n=et([j3n,sc],jmt),P3n=et(T3n,R3n,N3n,(e,t,n)=>oF(e,n,t)),Tmt=(e,t,n,r,s,a,i,l)=>{if(n!=null)return n;var c=i==="vertical"&&l==="xAxis"||i==="horizontal"&&l==="yAxis",u=c?oF(r,a,s):oF(a,s);return lDn(t,u,e.allowDataOverflow)},$3n=et([Xu,xmt,wmt,w3n,k3n,P3n,vo,sc],Tmt,{memoizeOptions:{resultEqualityCheck:yU}}),M3n=[0,1],Nmt=(e,t,n,r,s,a,i)=>{if(!((e==null||n==null||n.length===0)&&i===void 0)){var{dataKey:l,type:c}=e,u=hb(t,a);if(u&&l==null){var d;return tht(0,(d=n?.length)!==null&&d!==void 0?d:0)}return c==="category"?O3n(r,e,u):s==="expand"?M3n:i}},Pye=et([Xu,vo,Aye,OM,pU,sc,$3n],Nmt),zj=et([Xu,lmt,Kve],smt),Amt=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var s=Iye(t),a=Array.isArray(s)&&(s[0]==="auto"||s[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Vg(e)){if(a)return n2e(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return r2e(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Vg(e))return n2e(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Vg(e))return r2e(e,t.tickCount,t.allowDecimals,"adaptive")}}},$ye=et([Pye,kM,zj],Amt),Imt=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Vg(t)&&Array.isArray(n)&&n.length>0){var s,a,i=t[0],l=(s=n[0])!==null&&s!==void 0?s:0,c=t[1],u=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(i,l),Math.max(c,u)]}return t},D3n=et([Xu,Pye,$ye,sc],Imt),L3n=et(OM,Xu,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ky(e.map(f=>f.value))).sort((f,p)=>f-p),s=r[0],a=r[r.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<r.length-1;l++){var c=r[l],u=r[l+1];if(!(c==null||u==null)){var d=u-c;n=Math.min(n,d)}}return n/i}}),Rmt=et(L3n,vo,pDn,Nc,(e,t,n,r,s)=>s,(e,t,n,r,s)=>{if(!ia(e))return 0;var a=t==="vertical"?r.height:r.width;if(s==="gap")return e*a/2;if(s==="no-gap"){var i=O0(n,e*a),l=e*a/2;return l-i-(l-i)/a*i}return 0}),z3n=(e,t,n)=>{var r=yb(e,t);return r==null||typeof r.padding!="string"?0:Rmt(e,"xAxis",t,n,r.padding)},F3n=(e,t,n)=>{var r=bb(e,t);return r==null||typeof r.padding!="string"?0:Rmt(e,"yAxis",t,n,r.padding)},B3n=et(yb,z3n,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((n=s.left)!==null&&n!==void 0?n:0)+t,right:((r=s.right)!==null&&r!==void 0?r:0)+t}}),U3n=et(bb,F3n,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((n=s.top)!==null&&n!==void 0?n:0)+t,bottom:((r=s.bottom)!==null&&r!==void 0?r:0)+t}}),q3n=et([Nc,B3n,oU,iU,(e,t,n)=>n],(e,t,n,r,s)=>{var{padding:a}=r;return s?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),V3n=et([Nc,vo,U3n,oU,iU,(e,t,n)=>n],(e,t,n,r,s,a)=>{var{padding:i}=s;return a?[r.height-i.bottom,i.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),CM=(e,t,n,r)=>{var s;switch(t){case"xAxis":return q3n(e,n,r);case"yAxis":return V3n(e,n,r);case"zAxis":return(s=Nye(e,n))===null||s===void 0?void 0:s.range;case"angleAxis":return vht(e);case"radiusAxis":return yht(e,n);default:return}},Pmt=et([Xu,CM],hU),H3n=et([zj,D3n],wDn),Mye=et([Xu,zj,H3n,Pmt],Tye),$mt=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:s,scale:a}=n,i=hb(e,r);if(i&&(s==="number"||a!=="auto"))return t.map(l=>l.value)}},Dye=et([vo,OM,kM,sc],$mt),EU=et([Mye],aye);et([Mye],i3n);et([Mye,g3n],amt);et([_M,Rye,sc],S3n);function Mmt(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var CU=(e,t)=>t,jU=(e,t,n)=>n,Z3n=et(sU,CU,jU,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Mmt)),W3n=et(aU,CU,jU,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Mmt)),Dmt=(e,t)=>({width:e.width,height:t.height}),Q3n=(e,t)=>{var n=typeof t.width=="number"?t.width:mM;return{width:n,height:e.height}},G3n=et(Nc,yb,Dmt),Y3n=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},X3n=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},K3n=et(gb,Nc,Z3n,CU,jU,(e,t,n,r,s)=>{var a={},i;return n.forEach(l=>{var c=Dmt(t,l);i==null&&(i=Y3n(t,r,e));var u=r==="top"&&!s||r==="bottom"&&s;a[l.id]=i-Number(u)*c.height,i+=(u?-1:1)*c.height}),a}),J3n=et(mb,Nc,W3n,CU,jU,(e,t,n,r,s)=>{var a={},i;return n.forEach(l=>{var c=Q3n(t,l);i==null&&(i=X3n(t,r,e));var u=r==="left"&&!s||r==="right"&&s;a[l.id]=i-Number(u)*c.width,i+=(u?-1:1)*c.width}),a}),e5n=(e,t)=>{var n=yb(e,t);if(n!=null)return K3n(e,n.orientation,n.mirror)},t5n=et([Nc,yb,e5n,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var s=n?.[r];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),n5n=(e,t)=>{var n=bb(e,t);if(n!=null)return J3n(e,n.orientation,n.mirror)},r5n=et([Nc,bb,n5n,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var s=n?.[r];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),s5n=et(Nc,bb,(e,t)=>{var n=typeof t.width=="number"?t.width:mM;return{width:n,height:e.height}}),Lmt=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:s,type:a,dataKey:i}=n,l=hb(e,r),c=t.map(u=>u.value);if(i&&l&&a==="category"&&s&&Pft(c))return c}},Lye=et([vo,OM,Xu,sc],Lmt),Q2e=et([vo,d3n,zj,EU,Lye,Dye,CM,$ye,sc],(e,t,n,r,s,a,i,l,c)=>{if(t!=null){var u=hb(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:n,scale:r}}}),a5n=(e,t,n,r,s,a,i,l,c)=>{if(!(t==null||r==null)){var u=hb(e,c),{type:d,ticks:f,tickCount:p}=t,h=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/h:0;m=c==="angleAxis"&&a!=null&&a.length>=2?th(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=r.map(w);return ia(S)?{index:x,coordinate:S+m,value:v,offset:m}:null}).filter(Ed):u&&l?l.map((v,x)=>{var w=r.map(v);return ia(w)?{coordinate:w+m,value:v,index:x,offset:m}:null}).filter(Ed):r.ticks?r.ticks(p).map((v,x)=>{var w=r.map(v);return ia(w)?{coordinate:w+m,value:v,index:x,offset:m}:null}).filter(Ed):r.domain().map((v,x)=>{var w=r.map(v);return ia(w)?{coordinate:w+m,value:i?i[v]:v,index:x,offset:m}:null}).filter(Ed)}},zmt=et([vo,kM,zj,EU,$ye,CM,Lye,Dye,sc],a5n),i5n=(e,t,n,r,s,a,i)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=hb(e,i),{tickCount:c}=t,u=0;return u=i==="angleAxis"&&r?.length>=2?th(r[0]-r[1])*2*u:u,l&&a?a.map((d,f)=>{var p=n.map(d);return ia(p)?{coordinate:p+u,value:d,index:f,offset:u}:null}).filter(Ed):n.ticks?n.ticks(c).map((d,f)=>{var p=n.map(d);return ia(p)?{coordinate:p+u,value:d,index:f,offset:u}:null}).filter(Ed):n.domain().map((d,f)=>{var p=n.map(d);return ia(p)?{coordinate:p+u,value:s?s[d]:d,index:f,offset:u}:null}).filter(Ed)}},Fmt=et([vo,kM,EU,CM,Lye,Dye,sc],i5n),Bmt=et(Xu,EU,(e,t)=>{if(!(e==null||t==null))return iF(iF({},e),{},{scale:t})}),o5n=et([Xu,zj,Pye,Pmt],Tye),l5n=et([o5n],aye);et((e,t,n)=>Nye(e,n),l5n,(e,t)=>{if(!(e==null||t==null))return iF(iF({},e),{},{scale:t})});var c5n=et([vo,sU,aU],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),u5n=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};et([u5n],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,s=e[0];for(var a of e){var i=Math.abs(a.coordinate-t);i<r&&(r=i,s=a)}return(n=s)===null||n===void 0?void 0:n.value}});var Umt=e=>e.options.defaultTooltipEventType,qmt=e=>e.options.validateTooltipEventTypes;function Vmt(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function zye(e,t){var n=Umt(e),r=qmt(e);return Vmt(t,n,r)}function d5n(e){return fr(t=>zye(t,e))}var Hmt=(e,t)=>{var n,r=Number(t);if(!(Wy(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},f5n=e=>e.tooltip.settings,Tx={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},p5n={itemInteraction:{click:Tx,hover:Tx},axisInteraction:{click:Tx,hover:Tx},keyboardInteraction:Tx,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}},Zmt=cu({name:"tooltip",initialState:p5n,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Ii()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,s=nh(e).tooltipItemPayloads.indexOf(n);s>-1&&(e.tooltipItemPayloads[s]=r)},prepare:Ii()},removeTooltipEntrySettings:{reducer(e,t){var n=nh(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Ii()},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:h5n,replaceTooltipEntrySettings:m5n,removeTooltipEntrySettings:g5n,setTooltipSettingsState:v5n,setActiveMouseOverItemIndex:y5n,mouseLeaveItem:VXr,mouseLeaveChart:Wmt,setActiveClickItemIndex:HXr,setMouseOverAxisIndex:Qmt,setMouseClickAxisIndex:b5n,setSyncInteraction:Wce,setKeyboardInteraction:lF}=Zmt.actions,x5n=Zmt.reducer;function G2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function S4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G2e(Object(n),!0).forEach(function(r){w5n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w5n(e,t,n){return(t=S5n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S5n(e){var t=k5n(e,"string");return typeof t=="symbol"?t:t+""}function k5n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _5n(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function O5n(e){return e.index!=null}var Gmt=(e,t,n,r)=>{if(t==null)return Tx;var s=_5n(e,t,n);if(s==null)return Tx;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(O5n(s)){if(a)return S4(S4({},s),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return S4(S4({},Tx),{},{coordinate:s.coordinate})};function E5n(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function C5n(e,t){var n=E5n(e),r=t[0],s=t[1];if(n===void 0)return!1;var a=Math.min(r,s),i=Math.max(r,s);return n>=a&&n<=i}function j5n(e,t,n){if(n==null||t==null)return!0;var r=Cc(e,t);return r==null||!Vg(n)?!0:C5n(r,n)}var Fye=(e,t,n,r)=>{var s=e?.index;if(s==null)return null;var a=Number(s);if(!ia(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||j5n(u,n,r)?String(c):null},Ymt=(e,t,n,r,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 n==="horizontal"?{x:u.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:u.coordinate}}},Xmt=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(n==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&s==null)return e.tooltipItemPayloads;if(s==null&&r!=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})},Kmt=e=>e.options.tooltipPayloadSearcher,Fj=e=>e.tooltip;function Y2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function X2e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y2e(Object(n),!0).forEach(function(r){T5n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T5n(e,t,n){return(t=N5n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N5n(e){var t=A5n(e,"string");return typeof t=="symbol"?t:t+""}function A5n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I5n(e){if(typeof e=="string"||typeof e=="number")return e}function R5n(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function P5n(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function K2e(e){if(typeof e=="string")return e}function $5n(e){if(!(e==null||typeof e!="object")){var t="name"in e?I5n(e.name):void 0,n="unit"in e?R5n(e.unit):void 0,r="dataKey"in e?P5n(e.dataKey):void 0,s="payload"in e?e.payload:void 0,a="color"in e?K2e(e.color):void 0,i="fill"in e?K2e(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:s,color:a,fill:i}}}function M5n(e,t){return e??t}var Jmt=(e,t,n,r,s,a,i)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:d}=n,f=[];return e.reduce((p,h)=>{var m,{dataDefinedOnItem:g,settings:v}=h,x=M5n(g,l),w=Array.isArray(x)?kpt(x,u,d):x,S=(m=v?.dataKey)!==null&&m!==void 0?m:r,_=v?.nameKey,O;if(r&&Array.isArray(w)&&!Array.isArray(w[0])&&i==="axis"?O=$ft(w,r,s):O=a(w,t,c,_),Array.isArray(O))O.forEach(T=>{var j,N,I=$5n(T),P=I?.name,R=I?.dataKey,B=I?.payload,M=X2e(X2e({},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});p.push(Y$e({tooltipEntrySettings:M,dataKey:R,payload:B,value:Cc(B,R),name:P==null?void 0:String(P)}))});else{var E;p.push(Y$e({tooltipEntrySettings:v,dataKey:S,payload:O,value:Cc(O,S),name:(E=Cc(O,_))!==null&&E!==void 0?E:v?.name}))}return p},f)}},Bye=et([Ll,lmt,Kve],smt),D5n=et([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),L5n=et([ac,Dj],cmt),Bj=et([D5n,Ll,L5n],dmt,{memoizeOptions:{resultEqualityCheck:bU}}),z5n=et([Bj],e=>e.filter(sye)),F5n=et([Bj],hmt,{memoizeOptions:{resultEqualityCheck:bU}}),Uj=et([F5n,cw],mmt),B5n=et([z5n,cw,Ll],wht),Uye=et([Uj,Ll,Bj],gmt),egt=et([Ll],Iye),U5n=et([Ll],e=>e.allowDataOverflow),tgt=et([egt,U5n],nht),q5n=et([Bj],e=>e.filter(sye)),V5n=et([B5n,q5n,pU,pht],ymt),H5n=et([V5n,cw,ac,tgt],bmt),Z5n=et([Bj],pmt),W5n=et([Uj,Ll,Z5n,Rye,ac],Smt,{memoizeOptions:{resultEqualityCheck:yU}}),Q5n=et([kmt,ac,Dj],Lj),G5n=et([Q5n,ac],Emt),Y5n=et([_mt,ac,Dj],Lj),X5n=et([Y5n,ac],Cmt),K5n=et([Omt,ac,Dj],Lj),J5n=et([K5n,ac],jmt),e6n=et([G5n,J5n,X5n],oF),t6n=et([Ll,egt,tgt,H5n,W5n,e6n,vo,ac],Tmt),jM=et([Ll,vo,Uj,Uye,pU,ac,t6n],Nmt),n6n=et([jM,Ll,Bye],Amt),r6n=et([Ll,jM,n6n,ac],Imt),ngt=e=>{var t=ac(e),n=Dj(e),r=!1;return CM(e,t,n,r)},rgt=et([Ll,ngt],hU),s6n=et([Ll,Bye,r6n,rgt],Tye),sgt=et([s6n],aye),a6n=et([vo,Uye,Ll,ac],Lmt),i6n=et([vo,Uye,Ll,ac],$mt),o6n=(e,t,n,r,s,a,i,l)=>{if(t){var{type:c}=t,u=hb(e,l);if(r){var d=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,f=c==="category"&&r.bandwidth?r.bandwidth()/d:0;return f=l==="angleAxis"&&s!=null&&s?.length>=2?th(s[0]-s[1])*2*f:f,u&&i?i.map((p,h)=>{var m=r.map(p);return ia(m)?{coordinate:m+f,value:p,index:h,offset:f}:null}).filter(Ed):r.domain().map((p,h)=>{var m=r.map(p);return ia(m)?{coordinate:m+f,value:a?a[p]:p,index:h,offset:f}:null}).filter(Ed)}}},xb=et([vo,Ll,Bye,sgt,ngt,a6n,i6n,ac],o6n),qye=et([Umt,qmt,f5n],(e,t,n)=>Vmt(n.shared,e,t)),agt=e=>e.tooltip.settings.trigger,Vye=e=>e.tooltip.settings.defaultIndex,TM=et([Fj,qye,agt,Vye],Gmt),QR=et([TM,Uj,EM,jM],Fye),igt=et([xb,QR],Hmt),l6n=et([TM],e=>{if(e)return e.dataKey}),c6n=et([TM],e=>{if(e)return e.graphicalItemId}),ogt=et([Fj,qye,agt,Vye],Xmt),u6n=et([mb,gb,vo,Nc,xb,Vye,ogt],Ymt),d6n=et([TM,u6n],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),f6n=et([TM],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),p6n=et([ogt,QR,cw,EM,igt,Kmt,qye],Jmt),h6n=et([p6n],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function J2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function eDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J2e(Object(n),!0).forEach(function(r){m6n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m6n(e,t,n){return(t=g6n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g6n(e){var t=v6n(e,"string");return typeof t=="symbol"?t:t+""}function v6n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var y6n=()=>fr(Ll),b6n=()=>{var e=y6n(),t=fr(xb),n=fr(sgt);return Lz(!e||!n?void 0:eDe(eDe({},e),{},{scale:n}),t)};function tDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function V_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tDe(Object(n),!0).forEach(function(r){x6n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function x6n(e,t,n){return(t=w6n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w6n(e){var t=S6n(e,"string");return typeof t=="symbol"?t:t+""}function S6n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var k6n=(e,t,n,r)=>{var s=t.find(a=>a&&a.index===n);if(s){if(e==="horizontal")return{x:s.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:s.coordinate}}return{x:0,y:0}},_6n=(e,t,n,r)=>{var s=t.find(u=>u&&u.index===n);if(s){if(e==="centric"){var a=s.coordinate,{radius:i}=r;return V_(V_(V_({},r),Sc(r.cx,r.cy,i,a)),{},{angle:a,radius:i})}var l=s.coordinate,{angle:c}=r;return V_(V_(V_({},r),Sc(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function O6n(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var lgt=(e,t,n,r,s)=>{var a,i=(a=t?.length)!==null&&a!==void 0?a:0;if(i<=1||e==null)return 0;if(r==="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,p,h=l>0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(u=n[i-1])===null||u===void 0?void 0:u.coordinate,m=(d=n[l])===null||d===void 0?void 0:d.coordinate,g=l>=i-1?(f=n[0])===null||f===void 0?void 0:f.coordinate:(p=n[l+1])===null||p===void 0?void 0:p.coordinate,v=void 0;if(!(h==null||m==null||g==null))if(th(m-h)!==th(g-m)){var x=[];if(th(g-m)===th(s[1]-s[0])){v=g;var w=m+s[1]-s[0];x[0]=Math.min(w,(w+h)/2),x[1]=Math.max(w,(w+h)/2)}else{v=h;var S=g+s[1]-s[0];x[0]=Math.min(m,(S+m)/2),x[1]=Math.max(m,(S+m)/2)}var _=[Math.min(m,(v+m)/2),Math.max(m,(v+m)/2)];if(e>_[0]&&e<=_[1]||e>=x[0]&&e<=x[1]){var O;return(O=n[l])===null||O===void 0?void 0:O.index}}else{var E=Math.min(h,g),T=Math.max(h,g);if(e>(E+m)/2&&e<=(T+m)/2){var j;return(j=n[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},E6n=()=>fr(Kve),Hye=(e,t)=>t,cgt=(e,t,n)=>n,Zye=(e,t,n,r)=>r,C6n=et(xb,e=>QB(e,t=>t.coordinate)),Wye=et([Fj,Hye,cgt,Zye],Gmt),Qye=et([Wye,Uj,EM,jM],Fye),j6n=(e,t,n)=>{if(t!=null){var r=Fj(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},ugt=et([Fj,Hye,cgt,Zye],Xmt),cF=et([mb,gb,vo,Nc,xb,Zye,ugt],Ymt),T6n=et([Wye,cF],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),dgt=et([xb,Qye],Hmt),N6n=et([ugt,Qye,cw,EM,dgt,Kmt,Hye],Jmt),A6n=et([Wye,Qye],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),I6n=(e,t,n,r,s,a,i)=>{if(!(!e||!n||!r||!s)&&O6n(e,i)){var l=M$n(e,t),c=lgt(l,a,s,n,r),u=k6n(t,s,c,e);return{activeIndex:String(c),activeCoordinate:u}}},R6n=(e,t,n,r,s,a,i)=>{if(!(!e||!r||!s||!a||!n)){var l=X2n(e,n);if(l){var c=D$n(l,t),u=lgt(c,i,a,r,s),d=_6n(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},P6n=(e,t,n,r,s,a,i,l)=>{if(!(!e||!t||!r||!s||!a))return t==="horizontal"||t==="vertical"?I6n(e,t,r,s,a,i,l):R6n(e,t,n,r,s,a,i)},$6n=et(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),M6n=et(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Pu)),n=Array.from(new Set(t));return n.sort((r,s)=>r-s)},{memoizeOptions:{resultEqualityCheck:xDn}});function nDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function rDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nDe(Object(n),!0).forEach(function(r){D6n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function D6n(e,t,n){return(t=L6n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L6n(e){var t=z6n(e,"string");return typeof t=="symbol"?t:t+""}function z6n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var F6n={},B6n={zIndexMap:Object.values(Pu).reduce((e,t)=>rDe(rDe({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),F6n)},U6n=new Set(Object.values(Pu));function q6n(e){return U6n.has(e)}var fgt=cu({name:"zIndex",initialState:B6n,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Ii()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!q6n(n)&&delete e.zIndexMap[n])},prepare:Ii()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:s}=t.payload;e.zIndexMap[n]?s?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:s?void 0:r,panoramaElement:s?r:void 0}},prepare:Ii()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Ii()}}}),{registerZIndexPortal:V6n,unregisterZIndexPortal:H6n,registerZIndexPortalElement:Z6n,unregisterZIndexPortalElement:W6n}=fgt.actions,Q6n=fgt.reducer;function wb(e){var{zIndex:t,children:n}=e,r=gMn(),s=r&&t!==void 0&&t!==0,a=Qd(),i=wl();b.useLayoutEffect(()=>s?(i(V6n({zIndex:t})),()=>{i(H6n({zIndex:t}))}):Pk,[i,t,s]);var l=fr(c=>$6n(c,t,a));return s?l?Gu.createPortal(n,l):null:n}function Qce(){return Qce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qce.apply(null,arguments)}function sDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function k4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sDe(Object(n),!0).forEach(function(r){G6n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function G6n(e,t,n){return(t=Y6n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y6n(e){var t=X6n(e,"string");return typeof t=="symbol"?t:t+""}function X6n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K6n(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return b.isValidElement(t)?b.cloneElement(t,r):b.createElement(n,r)}function J6n(e){var t,{coordinate:n,payload:r,index:s,offset:a,tooltipAxisBandSize:i,layout:l,cursor:c,tooltipEventType:u,chartName:d}=e,f=n,p=r,h=s;if(!c||!f||d!=="ScatterChart"&&u!=="axis")return null;var m,g,v;if(d==="ScatterChart")m=f,g=d2n,v=Pu.cursorLine;else if(d==="BarChart")m=f2n(l,f,a,i),g=Xpt,v=Pu.cursorRectangle;else if(l==="radial"&&Lft(f)){var{cx:x,cy:w,radius:S,startAngle:_,endAngle:O}=Kpt(f);m={cx:x,cy:w,startAngle:_,endAngle:O,innerRadius:S,outerRadius:S},g=eht,v=Pu.cursorLine}else m={points:tDn(l,f,a)},g=Zpt,v=Pu.cursorLine;var E=typeof c=="object"&&"className"in c?c.className:void 0,T=k4(k4(k4(k4({stroke:"#ccc",pointerEvents:"none"},a),m),qB(c)),{},{payload:p,payloadIndex:h,className:Ba("recharts-tooltip-cursor",E)});return b.createElement(wb,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},b.createElement(K6n,{cursor:c,cursorComp:g,cursorProps:T}))}function ezn(e){var t=b6n(),n=Ipt(),r=Pj(),s=E6n();return t==null||n==null||r==null||s==null?null:b.createElement(J6n,Qce({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:s}))}var pgt=b.createContext(null),tzn=()=>b.useContext(pgt),HG={exports:{}},aDe;function nzn(){return aDe||(aDe=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,p){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new s(d,f||c,p),m=n?n+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],h]:c._events[m].push(h):(c._events[m]=h,c._eventsCount++),c}function i(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,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(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var p=0,h=f.length,m=new Array(h);p<h;p++)m[p]=f[p].fn;return m},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,p,h,m){var g=n?n+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,p),!0;case 5:return v.fn.call(v.context,d,f,p,h),!0;case 6:return v.fn.call(v.context,d,f,p,h,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 _=v.length,O;for(S=0;S<_;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,p);break;default:if(!w)for(O=1,w=new Array(x-1);O<x;O++)w[O-1]=arguments[O];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,p){var h=n?n+u:u;if(!this._events[h])return this;if(!d)return i(this,h),this;var m=this._events[h];if(m.fn)m.fn===d&&(!p||m.once)&&(!f||m.context===f)&&i(this,h);else{for(var g=0,v=[],x=m.length;g<x;g++)(m[g].fn!==d||p&&!m[g].once||f&&m[g].context!==f)&&v.push(m[g]);v.length?this._events[h]=v.length===1?v[0]:v:i(this,h)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&i(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(HG)),HG.exports}var rzn=nzn();const szn=xl(rzn);var GR=new szn,Gce="recharts.syncEvent.tooltip",iDe="recharts.syncEvent.brush",azn=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Wy(n))return e[n]}},izn={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},hgt=cu({name:"options",initialState:izn,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),ozn=hgt.reducer,{createEventEmitter:lzn}=hgt.actions;function czn(e){return e.tooltip.syncInteraction}var uzn={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},mgt=cu({name:"chartData",initialState:uzn,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:oDe,setDataStartEndIndexes:dzn,setComputedData:ZXr}=mgt.actions,fzn=mgt.reducer,pzn=["x","y"];function lDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function H_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lDe(Object(n),!0).forEach(function(r){hzn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hzn(e,t,n){return(t=mzn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mzn(e){var t=gzn(e,"string");return typeof t=="symbol"?t:t+""}function gzn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vzn(e,t){if(e==null)return{};var n,r,s=yzn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function yzn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bzn(){var e=fr(Jve),t=fr(eye),n=wl(),r=fr(hht),s=fr(xb),a=Pj(),i=lU(),l=fr(c=>c.rootProps.className);b.useEffect(()=>{if(e==null)return Pk;var c=(u,d,f)=>{if(t!==f&&e===u){if(r==="index"){var p;if(i&&d!==null&&d!==void 0&&(p=d.payload)!==null&&p!==void 0&&p.coordinate&&d.payload.sourceViewBox){var h=d.payload.coordinate,{x:m,y:g}=h,v=vzn(h,pzn),{x,y:w,width:S,height:_}=d.payload.sourceViewBox,O=H_(H_({},v),{},{x:i.x+(S?(m-x)/S:0)*i.width,y:i.y+(_?(g-w)/_:0)*i.height});n(H_(H_({},d),{},{payload:H_(H_({},d.payload),{},{coordinate:O})}))}else n(d);return}if(s!=null){var E;if(typeof r=="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=r(s,T);E=s[j]}else r==="value"&&(E=s.find(U=>String(U.value)===d.payload.label));var{coordinate:N}=d.payload;if(E==null||d.payload.active===!1||N==null||i==null){n(Wce({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:I,y:P}=N,R=Math.min(I,i.x+i.width),B=Math.min(P,i.y+i.height),M={x:a==="horizontal"?E.coordinate:R,y:a==="horizontal"?B:E.coordinate},L=Wce({active:d.payload.active,coordinate:M,dataKey:d.payload.dataKey,index:String(E.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(L)}}};return GR.on(Gce,c),()=>{GR.off(Gce,c)}},[l,n,t,e,r,s,a,i])}function xzn(){var e=fr(Jve),t=fr(eye),n=wl();b.useEffect(()=>{if(e==null)return Pk;var r=(s,a,i)=>{t!==i&&e===s&&n(dzn(a))};return GR.on(iDe,r),()=>{GR.off(iDe,r)}},[n,t,e])}function wzn(){var e=wl();b.useEffect(()=>{e(lzn())},[e]),bzn(),xzn()}function Szn(e,t,n,r,s,a){var i=fr(m=>j6n(m,e,t)),l=fr(c6n),c=fr(eye),u=fr(Jve),d=fr(hht),f=fr(czn),p=f?.active,h=lU();b.useEffect(()=>{if(!p&&u!=null&&c!=null){var m=Wce({active:a,coordinate:n,dataKey:i,index:s,label:typeof r=="number"?String(r):r,sourceViewBox:h,graphicalItemId:l});GR.emit(Gce,u,m,c)}},[p,n,i,l,s,r,c,u,d,a,h])}function cDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function uDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cDe(Object(n),!0).forEach(function(r){kzn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kzn(e,t,n){return(t=_zn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _zn(e){var t=Ozn(e,"string");return typeof t=="symbol"?t:t+""}function Ozn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ezn(e){return e.dataKey}function Czn(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(FMn,t)}var dDe=[],jzn={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 Tzn(e){var t,n,r=Wd(e,jzn),{active:s,allowEscapeViewBox:a,animationDuration:i,animationEasing:l,content:c,filterNull:u,isAnimationActive:d,offset:f,payloadUniqBy:p,position:h,reverseDirection:m,useTranslate3d:g,wrapperStyle:v,cursor:x,shared:w,trigger:S,defaultIndex:_,portal:O,axisId:E}=r,T=wl(),j=typeof _=="number"?String(_):_;b.useEffect(()=>{T(v5n({shared:w,trigger:S,axisId:E,active:s,defaultIndex:j}))},[T,w,S,E,s,j]);var N=lU(),I=Hpt(),P=d5n(w),{activeIndex:R,isActive:B}=(t=fr(te=>A6n(te,P,S,j)))!==null&&t!==void 0?t:{},M=fr(te=>N6n(te,P,S,j)),L=fr(te=>dgt(te,P,S,j)),U=fr(te=>T6n(te,P,S,j)),z=M,q=tzn(),Z=(n=s??B)!==null&&n!==void 0?n:!1,[D,G]=jPn([z,Z]),V=P==="axis"?L:void 0;Szn(P,S,U,V,R,Z);var $=O??q;if($==null||N==null||P==null)return null;var W=z??dDe;Z||(W=dDe),u&&W.length&&(W=mPn(W.filter(te=>te.value!=null&&(te.hide!==!0||r.includeHidden)),p,Ezn));var Q=W.length>0,J=uDe(uDe({},r),{},{payload:W,label:V,active:Z,activeIndex:R,coordinate:U,accessibilityLayer:I}),ae=b.createElement(XMn,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:Z,coordinate:U,hasPayload:Q,offset:f,position:h,reverseDirection:m,useTranslate3d:g,viewBox:N,wrapperStyle:v,lastBoundingBox:D,innerRef:G,hasPortalFromProps:!!O},Czn(c,J));return b.createElement(b.Fragment,null,Gu.createPortal(ae,$),Z&&b.createElement(ezn,{cursor:x,tooltipEventType:P,coordinate:U,payload:W,index:R}))}function Nzn(e,t,n){return(t=Azn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Azn(e){var t=Izn(e,"string");return typeof t=="symbol"?t:t+""}function Izn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Rzn{constructor(t){Nzn(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function fDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Pzn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fDe(Object(n),!0).forEach(function(r){$zn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $zn(e,t,n){return(t=Mzn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mzn(e){var t=Dzn(e,"string");return typeof t=="symbol"?t:t+""}function Dzn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lzn={cacheSize:2e3,enableCache:!0},ggt=Pzn({},Lzn),pDe=new Rzn(ggt.cacheSize),zzn={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},hDe="recharts_measurement_span";function Fzn(e,t){var n=t.fontSize||"",r=t.fontFamily||"",s=t.fontWeight||"",a=t.fontStyle||"",i=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(s,"|").concat(a,"|").concat(i,"|").concat(l)}var mDe=(e,t)=>{try{var n=document.getElementById(hDe);n||(n=document.createElement("span"),n.setAttribute("id",hDe),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,zzn,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},pI=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||yM.isSsr)return{width:0,height:0};if(!ggt.enableCache)return mDe(t,n);var r=Fzn(t,n),s=pDe.get(r);if(s)return s;var a=mDe(t,n);return pDe.set(r,a),a},vgt;function Bzn(e,t,n){return(t=Uzn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uzn(e){var t=qzn(e,"string");return typeof t=="symbol"?t:t+""}function qzn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gDe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,vDe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Vzn=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Hzn=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Zzn={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Wzn=["cm","mm","pt","pc","in","Q","px"];function Qzn(e){return Wzn.includes(e)}var LO="NaN";function Gzn(e,t){return e*Zzn[t]}class mc{static parse(t){var n,[,r,s]=(n=Hzn.exec(t))!==null&&n!==void 0?n:[];return r==null?mc.NaN:new mc(parseFloat(r),s??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Wy(t)&&(this.unit=""),n!==""&&!Vzn.test(n)&&(this.num=NaN,this.unit=""),Qzn(n)&&(this.num=Gzn(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new mc(NaN,""):new mc(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new mc(NaN,""):new mc(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new mc(NaN,""):new mc(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new mc(NaN,""):new mc(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wy(this.num)}}vgt=mc;Bzn(mc,"NaN",new vgt(NaN,""));function ygt(e){if(e==null||e.includes(LO))return LO;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,s,a]=(n=gDe.exec(t))!==null&&n!==void 0?n:[],i=mc.parse(r??""),l=mc.parse(a??""),c=s==="*"?i.multiply(l):i.divide(l);if(c.isNaN())return LO;t=t.replace(gDe,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,p]=(u=vDe.exec(t))!==null&&u!==void 0?u:[],h=mc.parse(d??""),m=mc.parse(p??""),g=f==="+"?h.add(m):h.subtract(m);if(g.isNaN())return LO;t=t.replace(vDe,g.toString())}return t}var yDe=/\(([^()]*)\)/;function Yzn(e){for(var t=e,n;(n=yDe.exec(t))!=null;){var[,r]=n;t=t.replace(yDe,ygt(r))}return t}function Xzn(e){var t=e.replace(/\s+/g,"");return t=Yzn(t),t=ygt(t),t}function Kzn(e){try{return Xzn(e)}catch{return LO}}function ZG(e){var t=Kzn(e.slice(5,-1));return t===LO?"":t}var Jzn=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],eFn=["dx","dy","angle","className","breakAll"];function Yce(){return Yce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yce.apply(null,arguments)}function bDe(e,t){if(e==null)return{};var n,r,s=tFn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function tFn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var bgt=/[ \f\n\r\t\v\u2028\u2029]+/,xgt=e=>{var{children:t,breakAll:n,style:r}=e;try{var s=[];tc(t)||(n?s=t.toString().split(""):s=t.toString().split(bgt));var a=s.map(l=>({word:l,width:pI(l,r).width})),i=n?0:pI(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:i}}catch{return null}};function wgt(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function nFn(e){return tc(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Sgt=(e,t,n,r)=>e.reduce((s,a)=>{var{word:i,width:l}=a,c=s[s.length-1];if(c&&l!=null&&(t==null||r||c.width+l+n<Number(t)))c.words.push(i),c.width+=l+n;else{var u={words:[i],width:l};s.push(u)}return s},[]),kgt=e=>e.reduce((t,n)=>t.width>n.width?t:n),rFn="…",xDe=(e,t,n,r,s,a,i,l)=>{var c=e.slice(0,t),u=xgt({breakAll:n,style:r,children:c+rFn});if(!u)return[!1,[]];var d=Sgt(u.wordsWithComputedWidth,a,i,l),f=d.length>s||kgt(d).width>Number(a);return[f,d]},sFn=(e,t,n,r,s)=>{var{maxLines:a,children:i,style:l,breakAll:c}=e,u=tr(a),d=String(i),f=Sgt(t,r,n,s);if(!u||s)return f;var p=f.length>a||kgt(f).width>Number(r);if(!p)return f;for(var h=0,m=d.length-1,g=0,v;h<=m&&g<=d.length-1;){var x=Math.floor((h+m)/2),w=x-1,[S,_]=xDe(d,w,c,l,a,r,n,s),[O]=xDe(d,x,c,l,a,r,n,s);if(!S&&!O&&(h=x+1),S&&O&&(m=x-1),!S&&O){v=_;break}g++}return v||f},wDe=e=>{var t=tc(e)?[]:e.toString().split(bgt);return[{words:t,width:void 0}]},aFn=e=>{var{width:t,scaleToFit:n,children:r,style:s,breakAll:a,maxLines:i}=e;if((t||n)&&!yM.isSsr){var l,c,u=xgt({breakAll:a,children:r,style:s});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return wDe(r);return sFn({breakAll:a,children:r,maxLines:i,style:s},l,c,t,!!n)}return wDe(r)},_gt="#808080",iFn={angle:0,breakAll:!1,capHeight:"0.71em",fill:_gt,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Gye=b.forwardRef((e,t)=>{var n=Wd(e,iFn),{x:r,y:s,lineHeight:a,capHeight:i,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,f=bDe(n,Jzn),p=b.useMemo(()=>aFn({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:h,dy:m,angle:g,className:v,breakAll:x}=f,w=bDe(f,eFn);if(!ev(r)||!ev(s)||p.length===0)return null;var S=Number(r)+(tr(h)?h:0),_=Number(s)+(tr(m)?m:0);if(!ia(S)||!ia(_))return null;var O;switch(d){case"start":O=ZG("calc(".concat(i,")"));break;case"middle":O=ZG("calc(".concat((p.length-1)/2," * -").concat(a," + (").concat(i," / 2))"));break;default:O=ZG("calc(".concat(p.length-1," * -").concat(a,")"));break}var E=[],T=p[0];if(c&&T!=null){var j=T.width,{width:N}=f;E.push("scale(".concat(tr(N)&&tr(j)?N/j:1,")"))}return g&&E.push("rotate(".concat(g,", ").concat(S,", ").concat(_,")")),E.length&&(w.transform=E.join(" ")),b.createElement("text",Yce({},Vu(w),{ref:t,x:S,y:_,className:Ba("recharts-text",v),textAnchor:u,fill:l.includes("url")?_gt:l}),p.map((I,P)=>{var R=I.words.join(x?"":" ");return b.createElement("tspan",{x:S,dy:P===0?O:a,key:"".concat(R,"-").concat(P)},R)}))});Gye.displayName="Text";function SDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ng(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SDe(Object(n),!0).forEach(function(r){oFn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oFn(e,t,n){return(t=lFn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lFn(e){var t=cFn(e,"string");return typeof t=="symbol"?t:t+""}function cFn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uFn=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:s}=e,{x:a,y:i,height:l,upperWidth:c,lowerWidth:u}=qve(t),d=a,f=a+(c-u)/2,p=(d+f)/2,h=(c+u)/2,m=d+c/2,g=l>=0?1:-1,v=g*r,x=g>0?"end":"start",w=g>0?"start":"end",S=c>=0?1:-1,_=S*r,O=S>0?"end":"start",E=S>0?"start":"end",T=s;if(n==="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(n==="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(n==="left"){var I={x:p-_,y:i+l/2,horizontalAnchor:O,verticalAnchor:"middle"};return T&&(I.width=Math.max(I.x-T.x,0),I.height=l),I}if(n==="right"){var P={x:p+h+_,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:h,height:l}:{};return n==="insideLeft"?ng({x:p+_,y:i+l/2,horizontalAnchor:E,verticalAnchor:"middle"},R):n==="insideRight"?ng({x:p+h-_,y:i+l/2,horizontalAnchor:O,verticalAnchor:"middle"},R):n==="insideTop"?ng({x:d+c/2,y:i+v,horizontalAnchor:"middle",verticalAnchor:w},R):n==="insideBottom"?ng({x:f+u/2,y:i+l-v,horizontalAnchor:"middle",verticalAnchor:x},R):n==="insideTopLeft"?ng({x:d+_,y:i+v,horizontalAnchor:E,verticalAnchor:w},R):n==="insideTopRight"?ng({x:d+c-_,y:i+v,horizontalAnchor:O,verticalAnchor:w},R):n==="insideBottomLeft"?ng({x:f+_,y:i+l-v,horizontalAnchor:E,verticalAnchor:x},R):n==="insideBottomRight"?ng({x:f+u-_,y:i+l-v,horizontalAnchor:O,verticalAnchor:x},R):n&&typeof n=="object"&&(tr(n.x)||z1(n.x))&&(tr(n.y)||z1(n.y))?ng({x:a+O0(n.x,h),y:i+O0(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},R):ng({x:m,y:i+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},dFn=["labelRef"],fFn=["content"];function kDe(e,t){if(e==null)return{};var n,r,s=pFn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function pFn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function _De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function CA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_De(Object(n),!0).forEach(function(r){hFn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_De(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hFn(e,t,n){return(t=mFn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mFn(e){var t=gFn(e,"string");return typeof t=="symbol"?t:t+""}function gFn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xy.apply(null,arguments)}var Ogt=b.createContext(null),vFn=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:s,width:a,height:i,children:l}=e,c=b.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:s,width:a,height:i}),[t,n,r,s,a,i]);return b.createElement(Ogt.Provider,{value:c},l)},Egt=()=>{var e=b.useContext(Ogt),t=lU();return e||(t?qve(t):void 0)},yFn=b.createContext(null),bFn=()=>{var e=b.useContext(yFn),t=fr(bht);return e||t},xFn=e=>{var{value:t,formatter:n}=e,r=tc(e.children)?t:e.children;return typeof n=="function"?n(r):r},Yye=e=>e!=null&&typeof e=="function",wFn=(e,t)=>{var n=th(t-e),r=Math.min(Math.abs(t-e),360);return n*r},SFn=(e,t,n,r,s)=>{var{offset:a,className:i}=e,{cx:l,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:p,clockWise:h}=s,m=(u+d)/2,g=wFn(f,p),v=g>=0?1:-1,x,w;switch(t){case"insideStart":x=f+v*a,w=h;break;case"insideEnd":x=p-v*a,w=!h;break;case"end":x=p+v*a,w=h;break;default:throw new Error("Unsupported position ".concat(t))}w=g<=0?w:!w;var S=Sc(l,c,m,x),_=Sc(l,c,m,x+(w?1:-1)*359),O="M".concat(S.x,",").concat(S.y,`
|
|
292
292
|
A`).concat(m,",").concat(m,",0,1,").concat(w?0:1,`,
|
|
293
|
-
`).concat(_.x,",").concat(_.y),E=tc(e.id)?MR("recharts-radial-line-"):e.id;return b.createElement("text",xy({},r,{dominantBaseline:"central",className:Ba("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:O})),b.createElement("textPath",{xlinkHref:"#".concat(E)},n))},kFn=(e,t,n)=>{var{cx:r,cy:s,innerRadius:a,outerRadius:i,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(n==="outside"){var{x:d,y:f}=Sc(r,s,i+t,u);return{x:d,y:f,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"end"};var p=(a+i)/2,{x:h,y:m}=Sc(r,s,p,u);return{x:h,y:m,textAnchor:"middle",verticalAnchor:"middle"}},p5=e=>e!=null&&"cx"in e&&tr(e.cx),_Fn={angle:0,offset:5,zIndex:Pu.label,position:"middle",textBreakAll:!1};function OFn(e){if(!p5(e))return e;var{cx:t,cy:n,outerRadius:r}=e,s=r*2;return{x:t-r,y:n-r,width:s,upperWidth:s,lowerWidth:s,height:s}}function _x(e){var t=Wd(e,_Fn),{viewBox:n,parentViewBox:r,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=bFn(),p=Egt(),h=s==="center"?p:f??p,m,g,v;n==null?m=h:p5(n)?m=n:m=qve(n);var x=OFn(m);if(!m||tc(a)&&tc(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=CA(CA({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,_=kDe(w,dFn);return b.cloneElement(l,_)}if(typeof l=="function"){var{content:O}=w,E=kDe(w,fFn);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=xFn(t);var T=Vu(t);if(p5(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return SFn(t,s,g,T,m);v=kFn(m,t.offset,t.position)}else{if(!x)return null;var j=uFn({viewBox:x,position:s,offset:t.offset,parentViewBox:p5(r)?void 0:r});v=CA(CA({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(wb,{zIndex:t.zIndex},b.createElement(Gye,xy({ref:d,className:Ba("recharts-label",c)},T,v,{textAnchor:wgt(T.textAnchor)?T.textAnchor:v.textAnchor,breakAll:u}),g))}_x.displayName="Label";var EFn=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(_x,xy({key:"label-implicit"},r)):ev(e)?b.createElement(_x,xy({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===_x?b.cloneElement(e,CA({key:"label-implicit"},r)):b.createElement(_x,xy({key:"label-implicit",content:e},r)):Yye(e)?b.createElement(_x,xy({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(_x,xy({},e,{key:"label-implicit"},r)):null};function CFn(e){var{label:t,labelRef:n}=e,r=Egt();return EFn(t,r,n)||null}var jFn=["valueAccessor"],TFn=["dataKey","clockWise","id","textBreakAll","zIndex"];function uF(){return uF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uF.apply(null,arguments)}function ODe(e,t){if(e==null)return{};var n,r,s=NFn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function NFn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var AFn=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(nFn(t))return t},Cgt=b.createContext(void 0),IFn=Cgt.Provider,jgt=b.createContext(void 0);jgt.Provider;function RFn(){return b.useContext(Cgt)}function PFn(){return b.useContext(jgt)}function h5(e){var{valueAccessor:t=AFn}=e,n=ODe(e,jFn),{dataKey:r,clockWise:s,id:a,textBreakAll:i,zIndex:l}=n,c=ODe(n,TFn),u=RFn(),d=PFn(),f=u||d;return!f||!f.length?null:b.createElement(wb,{zIndex:l??Pu.label},b.createElement(Zy,{className:"recharts-label-list"},f.map((p,h)=>{var m,g=tc(r)?t(p,h):Cc(p.payload,r),v=tc(a)?{}:{id:"".concat(a,"-").concat(h)};return b.createElement(_x,uF({key:"label-".concat(h)},Vu(p),c,v,{fill:(m=n.fill)!==null&&m!==void 0?m:p.fill,parentViewBox:p.parentViewBox,value:g,textBreakAll:i,viewBox:p.viewBox,index:h,zIndex:0}))})))}h5.displayName="LabelList";function $Fn(e){var{label:t}=e;return t?t===!0?b.createElement(h5,{key:"labelList-implicit"}):b.isValidElement(t)||Yye(t)?b.createElement(h5,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(h5,uF({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Xce(){return Xce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xce.apply(null,arguments)}var Tgt=e=>{var{cx:t,cy:n,r,className:s}=e,a=Ba("recharts-dot",s);return tr(t)&&tr(n)&&tr(r)?b.createElement("circle",Xce({},Jg(e),Pve(e),{className:a,cx:t,cy:n,r})):null},MFn={radiusAxis:{},angleAxis:{}},Ngt=cu({name:"polarAxis",initialState:MFn,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:WXr,removeRadiusAxis:QXr,addAngleAxis:GXr,removeAngleAxis:YXr}=Ngt.actions,DFn=Ngt.reducer;function LFn(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var WG={exports:{}},wa={};var EDe;function zFn(){if(EDe)return wa;EDe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=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"),p=Symbol.for("react.lazy"),h=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 n:case s:case r:case u:case d:return v;default:switch(v=v&&v.$$typeof,v){case l:case i:case c:case p:case f:case a:return v;default:return x}}case t:return x}}}return wa.ContextConsumer=i,wa.ContextProvider=a,wa.Element=e,wa.ForwardRef=c,wa.Fragment=n,wa.Lazy=p,wa.Memo=f,wa.Portal=t,wa.Profiler=s,wa.StrictMode=r,wa.Suspense=u,wa.SuspenseList=d,wa.isAsyncMode=function(){return!1},wa.isConcurrentMode=function(){return!1},wa.isContextConsumer=function(v){return g(v)===i},wa.isContextProvider=function(v){return g(v)===a},wa.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},wa.isForwardRef=function(v){return g(v)===c},wa.isFragment=function(v){return g(v)===n},wa.isLazy=function(v){return g(v)===p},wa.isMemo=function(v){return g(v)===f},wa.isPortal=function(v){return g(v)===t},wa.isProfiler=function(v){return g(v)===s},wa.isStrictMode=function(v){return g(v)===r},wa.isSuspense=function(v){return g(v)===u},wa.isSuspenseList=function(v){return g(v)===d},wa.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===s||v===r||v===u||v===d||v===h||typeof v=="object"&&v!==null&&(v.$$typeof===p||v.$$typeof===f||v.$$typeof===a||v.$$typeof===i||v.$$typeof===c||v.$$typeof===m||v.getModuleId!==void 0)},wa.typeOf=g,wa}var CDe;function FFn(){return CDe||(CDe=1,WG.exports=zFn()),WG.exports}FFn();var Agt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,QG={},jDe;function BFn(){return jDe||(jDe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const s=n[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${s}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(QG)),QG}var GG,TDe;function UFn(){return TDe||(TDe=1,GG=BFn().isPlainObject),GG}var qFn=UFn();const VFn=xl(qFn);var NDe,ADe,IDe,RDe,PDe;function $De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function MDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$De(Object(n),!0).forEach(function(r){HFn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$De(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HFn(e,t,n){return(t=ZFn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZFn(e){var t=WFn(e,"string");return typeof t=="symbol"?t:t+""}function WFn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dF(){return dF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dF.apply(null,arguments)}function LN(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var DDe=(e,t,n,r,s)=>{var a=n-r,i;return i=Eo(NDe||(NDe=LN(["M ",",",""])),e,t),i+=Eo(ADe||(ADe=LN(["L ",",",""])),e+n,t),i+=Eo(IDe||(IDe=LN(["L ",",",""])),e+n-a/2,t+s),i+=Eo(RDe||(RDe=LN(["L ",",",""])),e+n-a/2-r,t+s),i+=Eo(PDe||(PDe=LN(["L ",","," Z"])),e,t),i},QFn={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},GFn=e=>{var t=Wd(e,QFn),{x:n,y:r,upperWidth:s,lowerWidth:a,height:i,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,p=b.useRef(null),[h,m]=b.useState(-1),g=b.useRef(s),v=b.useRef(a),x=b.useRef(i),w=b.useRef(n),S=b.useRef(r),_=Wve(e,"trapezoid-");if(b.useEffect(()=>{if(p.current&&p.current.getTotalLength)try{var M=p.current.getTotalLength();M&&m(M)}catch{}},[]),n!==+n||r!==+r||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var O=Ba("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",dF({},Vu(t),{className:O,d:DDe(n,r,s,a,i)})));var E=g.current,T=v.current,j=x.current,N=w.current,I=S.current,P="0px ".concat(h===-1?1:h,"px"),R="".concat(h,"px ").concat(h,"px"),B=Wpt(["strokeDasharray"],u,c);return b.createElement(Zve,{animationId:_,key:_,canBegin:h>0,duration:u,easing:c,isActive:f,begin:d},M=>{var L=Sd(E,s,M),U=Sd(T,a,M),z=Sd(j,i,M),q=Sd(N,n,M),Z=Sd(I,r,M);p.current&&(g.current=L,v.current=U,x.current=z,w.current=q,S.current=Z);var D=M>0?{transition:B,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",dF({},Vu(t),{className:O,d:DDe(q,Z,L,U,z),ref:p,style:MDe(MDe({},D),t.style)}))})},YFn=["option","shapeType","activeClassName","inActiveClassName"];function XFn(e,t){if(e==null)return{};var n,r,s=KFn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function KFn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function LDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function fF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LDe(Object(n),!0).forEach(function(r){JFn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JFn(e,t,n){return(t=e9n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e9n(e){var t=t9n(e,"string");return typeof t=="symbol"?t:t+""}function t9n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n9n(e,t){return fF(fF({},t),e)}function r9n(e,t){return e==="symbols"}function zDe(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return b.createElement(Xpt,n);case"trapezoid":return b.createElement(GFn,n);case"sector":return b.createElement(eht,n);case"symbols":if(r9n(t))return b.createElement(Dft,n);break;case"curve":return b.createElement(Zpt,n);default:return null}}function s9n(e){return b.isValidElement(e)?e.props:e}function a9n(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=XFn(e,YFn),i;if(b.isValidElement(t))i=b.cloneElement(t,fF(fF({},a),s9n(t)));else if(typeof t=="function")i=t(a,a.index);else if(VFn(t)&&typeof t!="boolean"){var l=n9n(t,a);i=b.createElement(zDe,{shapeType:n,elementProps:l})}else{var c=a;i=b.createElement(zDe,{shapeType:n,elementProps:c})}return a.isActive?b.createElement(Zy,{className:r},i):b.createElement(Zy,{className:s},i)}function i9n(e){var{tooltipEntrySettings:t}=e,n=wl(),r=Qd(),s=b.useRef(null);return b.useLayoutEffect(()=>{r||(s.current===null?n(h5n(t)):s.current!==t&&n(m5n({prev:s.current,next:t})),s.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{s.current&&(n(g5n(s.current)),s.current=null)},[n]),null}function o9n(e){var{legendPayload:t}=e,n=wl(),r=Qd(),s=b.useRef(null);return b.useLayoutEffect(()=>{r||(s.current===null?n(TMn(t)):s.current!==t&&n(NMn({prev:s.current,next:t})),s.current=t)},[n,r,t]),b.useLayoutEffect(()=>()=>{s.current&&(n(AMn(s.current)),s.current=null)},[n]),null}var YG,l9n=()=>{var[e]=b.useState(()=>MR("uid-"));return e},c9n=(YG=gk.useId)!==null&&YG!==void 0?YG:l9n;function u9n(e,t){var n=c9n();return t||(e?"".concat(e,"-").concat(n):n)}var d9n=b.createContext(void 0),f9n=e=>{var{id:t,type:n,children:r}=e,s=u9n("recharts-".concat(n),t);return b.createElement(d9n.Provider,{value:s},r(s))},p9n={cartesianItems:[],polarItems:[]},Igt=cu({name:"graphicalItems",initialState:p9n,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Ii()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,s=nh(e).cartesianItems.indexOf(n);s>-1&&(e.cartesianItems[s]=r)},prepare:Ii()},removeCartesianGraphicalItem:{reducer(e,t){var n=nh(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Ii()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Ii()},removePolarGraphicalItem:{reducer(e,t){var n=nh(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Ii()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,s=nh(e).polarItems.indexOf(n);s>-1&&(e.polarItems[s]=r)},prepare:Ii()}}}),{addCartesianGraphicalItem:h9n,replaceCartesianGraphicalItem:m9n,removeCartesianGraphicalItem:g9n,addPolarGraphicalItem:XXr,removePolarGraphicalItem:KXr,replacePolarGraphicalItem:JXr}=Igt.actions,v9n=Igt.reducer,y9n=e=>{var t=wl(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(h9n(e)):n.current!==e&&t(m9n({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(g9n(n.current)),n.current=null)},[t]),null},b9n=b.memo(y9n),x9n=["points"];function FDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function XG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FDe(Object(n),!0).forEach(function(r){w9n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w9n(e,t,n){return(t=S9n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S9n(e){var t=k9n(e,"string");return typeof t=="symbol"?t:t+""}function k9n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pF(){return pF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pF.apply(null,arguments)}function _9n(e,t){if(e==null)return{};var n,r,s=O9n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function O9n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function E9n(e){var{option:t,dotProps:n,className:r}=e;if(b.isValidElement(t))return b.cloneElement(t,n);if(typeof t=="function")return t(n);var s=Ba(r,typeof t!="boolean"?t.className:""),a=n??{},{points:i}=a,l=_9n(a,x9n);return b.createElement(Tgt,pF({},l,{className:s}))}function C9n(e,t){return e==null?!1:t?!0:e.length===1}function j9n(e){var{points:t,dot:n,className:r,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Pu.scatter}=e;if(!C9n(t,n))return null;var d=Agt(n),f=FIn(n),p=t.map((m,g)=>{var v,x,w=XG(XG(XG({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(E9n,{key:"dot-".concat(g),option:n,dotProps:w,className:s})}),h={};return l&&c!=null&&(h.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),b.createElement(wb,{zIndex:u},b.createElement(Zy,pF({className:r},h),p))}function BDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function UDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BDe(Object(n),!0).forEach(function(r){T9n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T9n(e,t,n){return(t=N9n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N9n(e){var t=A9n(e,"string");return typeof t=="symbol"?t:t+""}function A9n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var I9n={xAxis:{},yAxis:{},zAxis:{}},Rgt=cu({name:"cartesianAxis",initialState:I9n,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Ii()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:Ii()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Ii()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Ii()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:Ii()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Ii()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Ii()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:Ii()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Ii()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,s=e.yAxis[n];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&r===i[1]&&r!==s.width&&Math.abs(r-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...i,r].slice(-3);e.yAxis[n]=UDe(UDe({},s),{},{width:r,widthHistory:l})}}}}),{addXAxis:R9n,replaceXAxis:P9n,removeXAxis:$9n,addYAxis:M9n,replaceYAxis:D9n,removeYAxis:L9n,addZAxis:eKr,replaceZAxis:tKr,removeZAxis:nKr,updateYAxisWidth:z9n}=Rgt.actions,F9n=Rgt.reducer,B9n=et([Nc],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),U9n=et([B9n,mb,gb],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Xye=()=>fr(U9n),q9n=()=>fr(h6n);function qDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function KG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qDe(Object(n),!0).forEach(function(r){V9n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V9n(e,t,n){return(t=H9n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H9n(e){var t=Z9n(e,"string");return typeof t=="symbol"?t:t+""}function Z9n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var W9n=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KG(KG(KG({},l),qB(s)),Pve(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Tgt,c),b.createElement(Zy,{className:"recharts-active-dot",clipPath:i},u)};function Q9n(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:s,clipPath:a,zIndex:i=Pu.activeDot}=e,l=fr(QR),c=q9n();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return tc(u)?null:b.createElement(wb,{zIndex:i},b.createElement(W9n,{point:u,childIndex:Number(l),mainColor:n,dataKey:s,activeDot:r,clipPath:a}))}var G9n=e=>{var{chartData:t}=e,n=wl(),r=Qd();return b.useEffect(()=>r?()=>{}:(n(oDe(t)),()=>{n(oDe(void 0))}),[t,n,r]),null},VDe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Pgt=cu({name:"brush",initialState:VDe,reducers:{setBrushSettings(e,t){return t.payload==null?VDe:t.payload}}}),{setBrushSettings:rKr}=Pgt.actions,Y9n=Pgt.reducer;function X9n(e){return(e%180+180)%180}var K9n=function(t){var{width:n,height:r}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=X9n(s),i=a*Math.PI/180,l=Math.atan(r/n),c=i>l&&i<Math.PI-l?r/Math.sin(i):n/Math.cos(i);return Math.abs(c)},J9n={dots:[],areas:[],lines:[]},$gt=cu({name:"referenceElements",initialState:J9n,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=nh(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=nh(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=nh(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:sKr,removeDot:aKr,addArea:iKr,removeArea:oKr,addLine:lKr,removeLine:cKr}=$gt.actions,e8n=$gt.reducer,t8n=b.createContext(void 0),n8n=e=>{var{children:t}=e,[n]=b.useState("".concat(MR("recharts"),"-clip")),r=Xye();if(r==null)return null;var{x:s,y:a,width:i,height:l}=r;return b.createElement(t8n.Provider,{value:n},b.createElement("defs",null,b.createElement("clipPath",{id:n},b.createElement("rect",{x:s,y:a,height:l,width:i}))),t)};function Mgt(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var s=e[r];s!==void 0&&n.push(s)}return n}function r8n(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return K9n(r,n)}function s8n(e,t,n){var r=n==="width",{x:s,y:a,width:i,height:l}=e;return t===1?{start:r?s:a,end:r?s+i:a+l}:{start:r?s+i:a+l,end:r?s:a}}function YR(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function a8n(e,t){return Mgt(e,t+1)}function i8n(e,t,n,r,s){for(var a=(r||[]).slice(),{start:i,end:l}=t,c=0,u=1,d=i,f=function(){var m=r?.[c];if(m===void 0)return{v:Mgt(r,u)};var g=c,v,x=()=>(v===void 0&&(v=n(m,g)),v),w=m.coordinate,S=c===0||YR(e,w,x,d,l);S||(c=0,d=i,u+=1),S&&(d=w+e*(x()/2+s),c+=u)},p;u<=a.length;)if(p=f(),p)return p.v;return[]}function o8n(e,t,n,r,s){var a=(r||[]).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,p=!0,h=function(){var _=r[g];if(_==null)return 0;var O=g,E,T=()=>(E===void 0&&(E=n(_,O)),E),j=_.coordinate,N=g===d||YR(e,j,T,f,c);if(!N)return p=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=h(),!(m!==0&&m===1));g+=u);if(p){for(var v=[],x=d;x<i;x+=u){var w=r[x];w!=null&&v.push(w)}return v}}return[]}function HDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Lc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HDe(Object(n),!0).forEach(function(r){l8n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l8n(e,t,n){return(t=c8n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c8n(e){var t=u8n(e,"string");return typeof t=="symbol"?t:t+""}function u8n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d8n(e,t,n,r,s){for(var a=(r||[]).slice(),i=a.length,{start:l}=t,{end:c}=t,u=function(p){var h=a[p];if(h==null)return 1;var m=h,g,v=()=>(g===void 0&&(g=n(h,p)),g);if(p===i-1){var x=e*(m.coordinate+e*v()/2-c);a[p]=m=Lc(Lc({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[p]=m=Lc(Lc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=YR(e,m.tickCoord,v,l,c);w&&(c=m.tickCoord-e*(v()/2+s),a[p]=Lc(Lc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function f8n(e,t,n,r,s,a){var i=(r||[]).slice(),l=i.length,{start:c,end:u}=t;if(a){var d=r[l-1];if(d!=null){var f=n(d,l-1),p=e*(d.coordinate+e*f/2-u);if(i[l-1]=d=Lc(Lc({},d),{},{tickCoord:p>0?d.coordinate-p*e:d.coordinate}),d.tickCoord!=null){var h=YR(e,d.tickCoord,()=>f,c,u);h&&(u=d.tickCoord-e*(f/2+s),i[l-1]=Lc(Lc({},d),{},{isShow:!0}))}}}for(var m=a?l-1:l,g=function(w){var S=i[w];if(S==null)return 1;var _=S,O,E=()=>(O===void 0&&(O=n(S,w)),O);if(w===0){var T=e*(_.coordinate-e*E()/2-c);i[w]=_=Lc(Lc({},_),{},{tickCoord:T<0?_.coordinate-T*e:_.coordinate})}else i[w]=_=Lc(Lc({},_),{},{tickCoord:_.coordinate});if(_.tickCoord!=null){var j=YR(e,_.tickCoord,E,c,u);j&&(c=_.tickCoord+e*(E()/2+s),i[w]=Lc(Lc({},_),{},{isShow:!0}))}},v=0;v<m;v++)g(v);return i}function Kye(e,t,n){var{tick:r,ticks:s,viewBox:a,minTickGap:i,orientation:l,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!r)return[];if(tr(c)||yM.isSsr){var p;return(p=a8n(s,tr(c)?c:0))!==null&&p!==void 0?p:[]}var h=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?pI(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},v=(O,E)=>{var T=typeof u=="function"?u(O.value,E):O.value;return m==="width"?r8n(pI(T,{fontSize:t,letterSpacing:n}),g,f):pI(T,{fontSize:t,letterSpacing:n})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?th(w.coordinate-x.coordinate):1,_=s8n(a,S,m);return c==="equidistantPreserveStart"?i8n(S,_,v,s,i):c==="equidistantPreserveEnd"?o8n(S,_,v,s,i):(c==="preserveStart"||c==="preserveStartEnd"?h=f8n(S,_,v,s,i,c==="preserveStartEnd"):h=d8n(S,_,v,s,i),h.filter(O=>O.isShow))}var p8n=e=>{var{ticks:t,label:n,labelGapWithTick:r=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=n?n.getBoundingClientRect().width:0,c=s+a,u=i+c+l+(n?r:0);return Math.round(u)}return 0},h8n={xAxis:{},yAxis:{}},Dgt=cu({name:"renderedTicks",initialState:h8n,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:s}=t.payload;e[n][r]=s},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:m8n,removeRenderedTicks:g8n}=Dgt.actions,v8n=Dgt.reducer,y8n=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function b8n(e,t){if(e==null)return{};var n,r,s=x8n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function x8n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(null,arguments)}function ZDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Oo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZDe(Object(n),!0).forEach(function(r){w8n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w8n(e,t,n){return(t=S8n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S8n(e){var t=k8n(e,"string");return typeof t=="symbol"?t:t+""}function k8n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var My={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:Pu.axis};function _8n(e){var{x:t,y:n,width:r,height:s,orientation:a,mirror:i,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Oo(Oo(Oo({},c),Jg(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=Oo(Oo({},u),{},{x1:t,y1:n+d*s,x2:t+r,y2:n+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=Oo(Oo({},u),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+s})}return b.createElement("line",H1({},u,{className:Ba("recharts-cartesian-axis-line",WB(l,"className"))}))}function O8n(e,t,n,r,s,a,i,l,c){var u,d,f,p,h,m,g=l?-1:1,v=e.tickSize||i,x=tr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,p=n+ +!l*s,f=p-g*v,m=f-g*c,h=x;break;case"left":f=p=e.coordinate,d=t+ +!l*r,u=d-g*v,h=u-g*c,m=x;break;case"right":f=p=e.coordinate,d=t+ +l*r,u=d+g*v,h=u+g*c,m=x;break;default:u=d=e.coordinate,p=n+ +l*s,f=p+g*v,m=f+g*c,h=x;break}return{line:{x1:u,y1:f,x2:d,y2:p},tick:{x:h,y:m}}}function E8n(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function C8n(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function j8n(e){var{option:t,tickProps:n,value:r}=e,s,a=Ba(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))s=b.cloneElement(t,Oo(Oo({},n),{},{className:a}));else if(typeof t=="function")s=t(Oo(Oo({},n),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=Ba(i,LFn(t))),s=b.createElement(Gye,H1({},n,{className:i}),r)}return s}function T8n(e){var{ticks:t,axisType:n,axisId:r}=e,s=wl();return b.useEffect(()=>{if(r==null||n==null)return Pk;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(m8n({ticks:a,axisId:r,axisType:n})),()=>{s(g8n({axisId:r,axisType:n}))}},[s,t,r,n]),null}var N8n=b.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:s,stroke:a,tickFormatter:i,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:f,x:p,y:h,width:m,height:g,tickSize:v,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:_,events:O,axisType:E,axisId:T}=e,j=Kye(Oo(Oo({},_),{},{ticks:n}),w,S),N=Jg(_),I=qB(r),P=wgt(N.textAnchor)?N.textAnchor:E8n(d,f),R=C8n(d,f),B={};typeof s=="object"&&(B=s);var M=Oo(Oo({},N),{},{fill:"none"},B),L=j.map(q=>Oo({entry:q},O8n(q,p,h,m,g,d,v,f,x))),U=L.map(q=>{var{entry:Z,line:D}=q;return b.createElement(Zy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Z.value,"-").concat(Z.coordinate,"-").concat(Z.tickCoord)},s&&b.createElement("line",H1({},M,D,{className:Ba("recharts-cartesian-axis-tick-line",WB(s,"className"))})))}),z=L.map((q,Z)=>{var D,G,{entry:V,tick:$}=q,W=Oo(Oo(Oo(Oo({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},$),{},{index:Z,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(D=(G=u?.angle)!==null&&G!==void 0?G:N.angle)!==null&&D!==void 0?D:0}),Q=Oo(Oo({},W),I);return b.createElement(Zy,H1({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},VRn(O,V,Z)),r&&b.createElement(j8n,{option:r,tickProps:Q,value:"".concat(typeof i=="function"?i(V.value,Z):V.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(T8n,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(wb,{zIndex:Pu.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),U.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},U))}),A8n=b.forwardRef((e,t)=>{var{axisLine:n,width:r,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=b8n(e,y8n),[f,p]=b.useState(""),[h,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return p8n({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 _=window.getComputedStyle(S),O=_.fontSize,E=_.letterSpacing;(O!==f||E!==h)&&(p(O),m(E))}}},[f,h]);return i||r!=null&&r<=0||s!=null&&s<=0?null:b.createElement(wb,{zIndex:e.zIndex},b.createElement(Zy,{className:Ba("recharts-cartesian-axis",a)},b.createElement(_8n,{x:e.x,y:e.y,width:r,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Jg(e)}),b.createElement(N8n,{ref:v,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:h,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(vFn,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(CFn,{label:e.label,labelRef:e.labelRef}),e.children)))}),Jye=b.forwardRef((e,t)=>{var n=Wd(e,My);return b.createElement(A8n,H1({},n,{ref:t}))});Jye.displayName="CartesianAxis";var I8n=["x1","y1","x2","y2","key"],R8n=["offset"],P8n=["xAxisId","yAxisId"],$8n=["xAxisId","yAxisId"];function WDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WDe(Object(n),!0).forEach(function(r){M8n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M8n(e,t,n){return(t=D8n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D8n(e){var t=L8n(e,"string");return typeof t=="symbol"?t:t+""}function L8n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LS(){return LS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LS.apply(null,arguments)}function hF(e,t){if(e==null)return{};var n,r,s=z8n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function z8n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var F8n=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:s,width:a,height:i,ry:l}=e;return b.createElement("rect",{x:r,y:s,ry:l,width:a,height:i,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Lgt(e){var{option:t,lineItemProps:n}=e,r;if(b.isValidElement(t))r=b.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var s,{x1:a,y1:i,x2:l,y2:c,key:u}=n,d=hF(n,I8n),f=(s=Jg(d))!==null&&s!==void 0?s:{},{offset:p}=f,h=hF(f,R8n);r=b.createElement("line",LS({},h,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return r}function B8n(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:s}=e;if(!r||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=hF(e,P8n),c=s.map((u,d)=>{var f=Zc(Zc({},l),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return b.createElement(Lgt,{key:"line-".concat(d),option:r,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function U8n(e){var{y:t,height:n,vertical:r=!0,verticalPoints:s}=e;if(!r||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=hF(e,$8n),c=s.map((u,d)=>{var f=Zc(Zc({},l),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return b.createElement(Lgt,{option:r,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function q8n(e){var{horizontalFill:t,fillOpacity:n,x:r,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,p)=>f-p);s!==u[0]&&u.unshift(0);var d=u.map((f,p)=>{var h=u[p+1],m=h==null,g=m?s+i-f:h-f;if(g<=0)return null;var v=p%t.length;return b.createElement("rect",{key:"react-".concat(p),y:f,x:r,height:g,width:a,stroke:"none",fill:t[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function V8n(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:s,y:a,width:i,height:l,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,p)=>f-p);s!==u[0]&&u.unshift(0);var d=u.map((f,p)=>{var h=u[p+1],m=h==null,g=m?s+i-f:h-f;if(g<=0)return null;var v=p%n.length;return b.createElement("rect",{key:"react-".concat(p),x:f,y:a,width:g,height:l,stroke:"none",fill:n[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var H8n=(e,t)=>{var{xAxis:n,width:r,height:s,offset:a}=e;return _pt(Kye(Zc(Zc(Zc({},My),n),{},{ticks:Opt(n),viewBox:{x:0,y:0,width:r,height:s}})),a.left,a.left+a.width,t)},Z8n=(e,t)=>{var{yAxis:n,width:r,height:s,offset:a}=e;return _pt(Kye(Zc(Zc(Zc({},My),n),{},{ticks:Opt(n),viewBox:{x:0,y:0,width:r,height:s}})),a.top,a.top+a.height,t)},W8n={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Pu.grid};function zgt(e){var t=Rpt(),n=Ppt(),r=Ipt(),s=Zc(Zc({},Wd(e,W8n)),{},{x:tr(e.x)?e.x:r.left,y:tr(e.y)?e.y:r.top,width:tr(e.width)?e.width:r.width,height:tr(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:i,x:l,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:p,verticalValues:h}=s,m=Qd(),g=fr(N=>Q2e(N,"xAxis",a,m)),v=fr(N=>Q2e(N,"yAxis",i,m));if(!tv(u)||!tv(d)||!tr(l)||!tr(c))return null;var x=s.verticalCoordinatesGenerator||H8n,w=s.horizontalCoordinatesGenerator||Z8n,{horizontalPoints:S,verticalPoints:_}=s;if((!S||!S.length)&&typeof w=="function"){var O=p&&p.length,E=w({yAxis:v?Zc(Zc({},v),{},{ticks:O?p:v.ticks}):void 0,width:t??u,height:n??d,offset:r},O?!0:f);zz(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}if((!_||!_.length)&&typeof x=="function"){var T=h&&h.length,j=x({xAxis:g?Zc(Zc({},g),{},{ticks:T?h:g.ticks}):void 0,width:t??u,height:n??d,offset:r},T?!0:f);zz(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(_=j)}return b.createElement(wb,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(F8n,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(q8n,LS({},s,{horizontalPoints:S})),b.createElement(V8n,LS({},s,{verticalPoints:_})),b.createElement(B8n,LS({},s,{offset:r,horizontalPoints:S,xAxis:g,yAxis:v})),b.createElement(U8n,LS({},s,{offset:r,verticalPoints:_,xAxis:g,yAxis:v}))))}zgt.displayName="CartesianGrid";var Q8n={},Fgt=cu({name:"errorBars",initialState:Q8n,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:s}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(s=>s.dataKey!==r.dataKey||s.direction!==r.direction))}}}),{addErrorBar:uKr,replaceErrorBar:dKr,removeErrorBar:fKr}=Fgt.actions,G8n=Fgt.reducer,Y8n=["children"];function X8n(e,t){if(e==null)return{};var n,r,s=K8n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function K8n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var J8n={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},eBn=b.createContext(J8n);function tBn(e){var{children:t}=e,n=X8n(e,Y8n);return b.createElement(eBn.Provider,{value:n},t)}function Bgt(e,t){var n,r,s=fr(u=>yb(u,e)),a=fr(u=>bb(u,t)),i=(n=s?.allowDataOverflow)!==null&&n!==void 0?n:jl.allowDataOverflow,l=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Tl.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function nBn(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,s=Xye(),{needClipX:a,needClipY:i,needClip:l}=Bgt(t,n);if(!l||!s)return null;var{x:c,y:u,width:d,height:f}=s;return b.createElement("clipPath",{id:"clipPath-".concat(r)},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 Ugt=(e,t,n,r)=>Bmt(e,"xAxis",t,r),qgt=(e,t,n,r)=>Fmt(e,"xAxis",t,r),Vgt=(e,t,n,r)=>Bmt(e,"yAxis",n,r),Hgt=(e,t,n,r)=>Fmt(e,"yAxis",n,r),rBn=et([vo,Ugt,Vgt,qgt,Hgt],(e,t,n,r,s)=>hb(e,"xAxis")?Lz(t,r,!1):Lz(n,s,!1)),sBn=(e,t,n,r,s)=>s;function aBn(e){return e.type==="line"}var iBn=et([umt,sBn],(e,t)=>e.filter(aBn).find(n=>n.id===t)),oBn=et([vo,Ugt,Vgt,qgt,Hgt,iBn,rBn,Qve],(e,t,n,r,s,a,i,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(a==null||t==null||n==null||r==null||s==null||r.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:p}=a,h;if(p!=null&&p.length>0?h=p:h=c?.slice(u,d+1),h!=null)return jBn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:h})}});function lBn(e){var t=qB(e),n=3,r=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),l=Number(a);return(Number.isNaN(i)||i<0)&&(i=n),(Number.isNaN(l)||l<0)&&(l=r),{r:i,strokeWidth:l}}return{r:n,strokeWidth:r}}var cBn=["id"],uBn=["type","layout","connectNulls","needClip","shape"],dBn=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function XR(){return XR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XR.apply(null,arguments)}function QDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function pg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QDe(Object(n),!0).forEach(function(r){fBn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fBn(e,t,n){return(t=pBn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pBn(e){var t=hBn(e,"string");return typeof t=="symbol"?t:t+""}function hBn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ebe(e,t){if(e==null)return{};var n,r,s=mBn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function mBn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var gBn=e=>{var{dataKey:t,name:n,stroke:r,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:r,value:Ept(n,t),payload:e}]},vBn=b.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:s,fill:a,name:i,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:Pk,settings:{stroke:r,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Ept(i,t),hide:l,type:u,color:r,unit:c,graphicalItemId:d}};return b.createElement(i9n,{tooltipEntrySettings:f})}),Zgt=(e,t)=>"".concat(t,"px ").concat(e,"px");function yBn(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],s=0;s<t;++s)r.push(...n);return r}var bBn=(e,t,n)=>{var r=n.reduce((p,h)=>p+h,0);if(!r)return Zgt(t,e);for(var s=Math.floor(e/r),a=e%r,i=[],l=0,c=0;l<n.length;c+=(u=n[l])!==null&&u!==void 0?u:0,++l){var u,d=n[l];if(d!=null&&c+d>a){i=[...n.slice(0,l),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...yBn(n,s),...i,...f].map(p=>"".concat(p,"px")).join(", ")};function xBn(e){var{clipPathId:t,points:n,props:r}=e,{dot:s,dataKey:a,needClip:i}=r,{id:l}=r,c=ebe(r,cBn),u=Jg(c);return b.createElement(j9n,{points:n,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function wBn(e){var{showLabels:t,children:n,points:r}=e,s=b.useMemo(()=>r?.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 pg(pg({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return b.createElement(IFn,{value:t?s:void 0},n)}function GDe(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:s,props:a}=e,{type:i,layout:l,connectNulls:c,needClip:u,shape:d}=a,f=ebe(a,uBn),p=pg(pg({},Vu(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:r,type:i,layout:l,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return b.createElement(b.Fragment,null,r?.length>1&&b.createElement(a9n,XR({shapeType:"curve",option:d},p,{pathRef:n})),b.createElement(xBn,{points:r,clipPathId:t,props:a}))}function SBn(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function kBn(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:p,width:h,height:m,onAnimationEnd:g,onAnimationStart:v}=n,x=s.current,w=Wve(i,"recharts-line-"),S=b.useRef(w),[_,O]=b.useState(!1),E=!_,T=b.useCallback(()=>{typeof g=="function"&&g(),O(!1)},[g]),j=b.useCallback(()=>{typeof v=="function"&&v(),O(!0)},[v]),N=SBn(r.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(wBn,{points:i,showLabels:E},n.children,b.createElement(Zve,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Sd(P,N+P,R),M=Math.min(B,N),L;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Z=>parseFloat(Z));L=bBn(M,N,U)}else L=Zgt(N,M);else L=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,M)),x){var z=x.length/i.length,q=R===1?i:i.map((Z,D)=>{var G=Math.floor(D*z);if(x[G]){var V=x[G];return pg(pg({},Z),{},{x:Sd(V.x,Z.x,R),y:Sd(V.y,Z.y,R)})}return p?pg(pg({},Z),{},{x:Sd(h*2,Z.x,R),y:Sd(m/2,Z.y,R)}):pg(pg({},Z),{},{x:Z.x,y:Z.y})});return s.current=q,b.createElement(GDe,{props:n,points:q,clipPathId:t,pathRef:r,strokeDasharray:L})}return b.createElement(GDe,{props:n,points:i,clipPathId:t,pathRef:r,strokeDasharray:L})}),b.createElement($Fn,{label:n.label}))}function _Bn(e){var{clipPathId:t,props:n}=e,r=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(kBn,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:s,pathRef:a})}var OBn=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:Cc(e.payload,t)}};class EBn extends b.Component{render(){var{hide:t,dot:n,points:r,className:s,xAxisId:a,yAxisId:i,top:l,left:c,width:u,height:d,id:f,needClip:p,zIndex:h}=this.props;if(t)return null;var m=Ba("recharts-line",s),g=f,{r:v,strokeWidth:x}=lBn(n),w=Agt(n),S=v*2+x,_=p?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(wb,{zIndex:h},b.createElement(Zy,{className:m},p&&b.createElement("defs",null,b.createElement(nBn,{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(tBn,{xAxisId:a,yAxisId:i,data:r,dataPointFormatter:OBn,errorBarOffset:0},b.createElement(_Bn,{props:this.props,clipPathId:g}))),b.createElement(Q9n,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:_}))}}var Wgt={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:Pu.line,type:"linear"};function CBn(e){var t=Wd(e,Wgt),{activeDot:n,animateNewValues:r,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:f,legendType:p,xAxisId:h,yAxisId:m,id:g}=t,v=ebe(t,dBn),{needClip:x}=Bgt(h,m),w=Xye(),S=Pj(),_=Qd(),O=fr(I=>oBn(I,h,m,_,g));if(S!=="horizontal"&&S!=="vertical"||O==null||w==null)return null;var{height:E,width:T,x:j,y:N}=w;return b.createElement(EBn,XR({},v,{id:g,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:p,xAxisId:h,yAxisId:m,points:O,layout:S,height:E,width:T,left:j,top:N,needClip:x}))}function jBn(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var f=Cc(u,i);if(t==="horizontal"){var p=W$e({axis:n,ticks:s,bandSize:l,entry:u,index:d}),h=tc(f)?null:r.scale.map(f);return{x:p,y:h??null,value:f,payload:u}}var m=tc(f)?null:n.scale.map(f),g=W$e({axis:r,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 TBn(e){var t=Wd(e,Wgt),n=Qd();return b.createElement(f9n,{id:t.id,type:"line"},r=>b.createElement(b.Fragment,null,b.createElement(o9n,{legendPayload:gBn(t)}),b.createElement(vBn,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),b.createElement(b9n,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),b.createElement(CBn,XR({},t,{id:r}))))}var Qgt=b.memo(TBn,fU);Qgt.displayName="Line";var NBn=["domain","range"],ABn=["domain","range"];function YDe(e,t){if(e==null)return{};var n,r,s=IBn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function IBn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function XDe(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 Ggt(e,t){if(e===t)return!0;var{domain:n,range:r}=e,s=YDe(e,NBn),{domain:a,range:i}=t,l=YDe(t,ABn);return!XDe(n,a)||!XDe(r,i)?!1:fU(s,l)}var RBn=["type"],PBn=["dangerouslySetInnerHTML","ticks","scale"],$Bn=["id","scale"];function Kce(){return Kce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kce.apply(null,arguments)}function KDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function JDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KDe(Object(n),!0).forEach(function(r){MBn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MBn(e,t,n){return(t=DBn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DBn(e){var t=LBn(e,"string");return typeof t=="symbol"?t:t+""}function LBn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jce(e,t){if(e==null)return{};var n,r,s=zBn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function zBn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function FBn(e){var t=wl(),n=b.useRef(null),r=$pt(),{type:s}=e,a=Jce(e,RBn),i=mU(r,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return JDe(JDe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(n.current===null?t(R9n(l)):n.current!==l&&t(P9n({prev:n.current,next:l})),n.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{n.current&&(t($9n(n.current)),n.current=null)},[t]),null}var BBn=e=>{var{xAxisId:t,className:n}=e,r=fr(jpt),s=Qd(),a="xAxis",i=fr(x=>zmt(x,a,t,s)),l=fr(x=>G3n(x,t)),c=fr(x=>t5n(x,t)),u=fr(x=>imt(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:p}=e,h=Jce(e,PBn),{id:m,scale:g}=u,v=Jce(u,$Bn);return b.createElement(Jye,Kce({},h,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:Ba("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:i,axisType:a,axisId:t}))},UBn={allowDataOverflow:jl.allowDataOverflow,allowDecimals:jl.allowDecimals,allowDuplicatedCategory:jl.allowDuplicatedCategory,angle:jl.angle,axisLine:My.axisLine,height:jl.height,hide:!1,includeHidden:jl.includeHidden,interval:jl.interval,label:!1,minTickGap:jl.minTickGap,mirror:jl.mirror,orientation:jl.orientation,padding:jl.padding,reversed:jl.reversed,scale:jl.scale,tick:jl.tick,tickCount:jl.tickCount,tickLine:My.tickLine,tickSize:My.tickSize,type:jl.type,niceTicks:jl.niceTicks,xAxisId:0},qBn=e=>{var t=Wd(e,UBn);return b.createElement(b.Fragment,null,b.createElement(FBn,{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(BBn,t))},Ygt=b.memo(qBn,Ggt);Ygt.displayName="XAxis";var VBn=["type"],HBn=["dangerouslySetInnerHTML","ticks","scale"],ZBn=["id","scale"];function eue(){return eue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eue.apply(null,arguments)}function eLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function tLe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eLe(Object(n),!0).forEach(function(r){WBn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WBn(e,t,n){return(t=QBn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QBn(e){var t=GBn(e,"string");return typeof t=="symbol"?t:t+""}function GBn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tue(e,t){if(e==null)return{};var n,r,s=YBn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function YBn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function XBn(e){var t=wl(),n=b.useRef(null),r=$pt(),{type:s}=e,a=tue(e,VBn),i=mU(r,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return tLe(tLe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(n.current===null?t(M9n(l)):n.current!==l&&t(D9n({prev:n.current,next:l})),n.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(L9n(n.current)),n.current=null)},[t]),null}function KBn(e){var{yAxisId:t,className:n,width:r,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=fr(jpt),c=Qd(),u=wl(),d="yAxis",f=fr(E=>s5n(E,t)),p=fr(E=>r5n(E,t)),h=fr(E=>zmt(E,d,t,c)),m=fr(E=>omt(E,t));if(b.useLayoutEffect(()=>{if(!(r!=="auto"||!f||Yye(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(z9n({id:t,width:T}))}}},[h,f,u,s,t,r,m]),f==null||p==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:x}=e,w=tue(e,HBn),{id:S,scale:_}=m,O=tue(m,ZBn);return b.createElement(Jye,eue({},w,O,{ref:a,labelRef:i,x:p.x,y:p.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:f.width,height:f.height,className:Ba("recharts-".concat(d," ").concat(d),n),viewBox:l,ticks:h,axisType:d,axisId:t}))}var JBn={allowDataOverflow:Tl.allowDataOverflow,allowDecimals:Tl.allowDecimals,allowDuplicatedCategory:Tl.allowDuplicatedCategory,angle:Tl.angle,axisLine:My.axisLine,hide:!1,includeHidden:Tl.includeHidden,interval:Tl.interval,label:!1,minTickGap:Tl.minTickGap,mirror:Tl.mirror,orientation:Tl.orientation,padding:Tl.padding,reversed:Tl.reversed,scale:Tl.scale,tick:Tl.tick,tickCount:Tl.tickCount,tickLine:My.tickLine,tickSize:My.tickSize,type:Tl.type,niceTicks:Tl.niceTicks,width:Tl.width,yAxisId:0},eUn=e=>{var t=Wd(e,JBn);return b.createElement(b.Fragment,null,b.createElement(XBn,{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(KBn,t))},Xgt=b.memo(eUn,Ggt);Xgt.displayName="YAxis";var tUn=(e,t)=>t,tbe=et([tUn,vo,bht,ac,rgt,xb,C6n,Nc],P6n);function nUn(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function nbe(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(nUn(e)){var s=e.currentTarget.getBBox();n=s.width>0?t.width/s.width:1,r=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(l,c)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>i(l.clientX,l.clientY)):i(e.clientX,e.clientY)}var Kgt=ep("mouseClick"),Jgt=hM();Jgt.startListening({actionCreator:Kgt,effect:(e,t)=>{var n=e.payload,r=tbe(t.getState(),nbe(n));r?.activeIndex!=null&&t.dispatch(b5n({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var nue=ep("mouseMove"),evt=hM(),Z_=null,Qw=null,JG=null;evt.startListening({actionCreator:nue,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:s,throttledEvents:a}=r.eventSettings,i=a==="all"||a?.includes("mousemove");Z_!==null&&(cancelAnimationFrame(Z_),Z_=null),Qw!==null&&(typeof s!="number"||!i)&&(clearTimeout(Qw),Qw=null),JG=nbe(n);var l=()=>{var c=t.getState(),u=zye(c,c.tooltip.settings.shared);if(!JG){Z_=null,Qw=null;return}if(u==="axis"){var d=tbe(c,JG);d?.activeIndex!=null?t.dispatch(Qmt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(Wmt())}Z_=null,Qw=null};if(!i){l();return}s==="raf"?Z_=requestAnimationFrame(l):typeof s=="number"&&Qw===null&&(Qw=setTimeout(l,s))}});function rUn(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 nLe={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},tvt=cu({name:"rootProps",initialState:nLe,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:nLe.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}}}),sUn=tvt.reducer,{updateOptions:aUn}=tvt.actions,iUn=null,oUn={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)},nvt=cu({name:"polarOptions",initialState:iUn,reducers:oUn}),{updatePolarOptions:pKr}=nvt.actions,lUn=nvt.reducer,rvt=ep("keyDown"),svt=ep("focus"),avt=ep("blur"),TU=hM(),W_=null,Gw=null,_4=null;TU.startListening({actionCreator:rvt,effect:(e,t)=>{_4=e.payload,W_!==null&&(cancelAnimationFrame(W_),W_=null);var n=t.getState(),{throttleDelay:r,throttledEvents:s}=n.eventSettings,a=s==="all"||s.includes("keydown");Gw!==null&&(typeof r!="number"||!a)&&(clearTimeout(Gw),Gw=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=_4;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=Fye(u,Uj(l),EM(l),jM(l)),p=f==null?-1:Number(f);if(!Number.isFinite(p)||p<0)return;var h=xb(l);if(d==="Enter"){var m=cF(l,"axis","hover",String(u.index));t.dispatch(lF({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=c5n(l),v=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=p+x*v;if(h==null||w>=h.length||w<0)return;var S=cF(l,"axis","hover",String(w));t.dispatch(lF({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{W_=null,Gw=null}};if(!a){i();return}r==="raf"?W_=requestAnimationFrame(i):typeof r=="number"&&Gw===null&&(i(),_4=null,Gw=setTimeout(()=>{_4?i():(Gw=null,W_=null)},r))}});TU.startListening({actionCreator:svt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:s}=n.tooltip;if(!s.active&&s.index==null){var a="0",i=cF(n,"axis","hover",String(a));t.dispatch(lF({active:!0,activeIndex:a,activeCoordinate:i}))}}}});TU.startListening({actionCreator:avt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:s}=n.tooltip;s.active&&t.dispatch(lF({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function ivt(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var s=Reflect.get(n,r);return typeof s=="function"?s.bind(n):s}})}var Bp=ep("externalEvent"),ovt=hM(),O4=new Map,zN=new Map,eY=new Map;ovt.startListening({actionCreator:Bp,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var s=r.type,a=ivt(r);eY.set(s,{handler:n,reactEvent:a});var i=O4.get(s);i!==void 0&&(cancelAnimationFrame(i),O4.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),p=zN.get(s);p!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(p),zN.delete(s));var h=()=>{var v=eY.get(s);try{if(!v)return;var{handler:x,reactEvent:w}=v,S=t.getState(),_={activeCoordinate:d6n(S),activeDataKey:l6n(S),activeIndex:QR(S),activeLabel:igt(S),activeTooltipIndex:QR(S),isTooltipActive:f6n(S)};x&&x(_,w)}finally{O4.delete(s),zN.delete(s),eY.delete(s)}};if(!f){h();return}if(c==="raf"){var m=requestAnimationFrame(h);O4.set(s,m)}else if(typeof c=="number"){if(!zN.has(s)){h();var g=setTimeout(h,c);zN.set(s,g)}}else h()}}});var cUn=et([Fj],e=>e.tooltipItemPayloads),uUn=et([cUn,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:s}=r;if(s!=null)return s(t)}}}),lvt=ep("touchMove"),cvt=hM(),Yw=null,ox=null,rLe=null,FN=null;cvt.startListening({actionCreator:lvt,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){FN=ivt(n);var r=t.getState(),{throttleDelay:s,throttledEvents:a}=r.eventSettings,i=a==="all"||a.includes("touchmove");Yw!==null&&(cancelAnimationFrame(Yw),Yw=null),ox!==null&&(typeof s!="number"||!i)&&(clearTimeout(ox),ox=null),rLe=Array.from(n.touches).map(c=>nbe({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(FN!=null){var c=t.getState(),u=zye(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=rLe)===null||d===void 0?void 0:d[0];if(f==null){Yw=null,ox=null;return}var p=tbe(c,f);p?.activeIndex!=null&&t.dispatch(Qmt({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate}))}else if(u==="item"){var h,m=FN.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(z$n),x=(h=g.getAttribute(F$n))!==null&&h!==void 0?h:void 0,w=Bj(c).find(O=>O.id===x);if(v==null||w==null||x==null)return;var{dataKey:S}=w,_=uUn(c,v,x);t.dispatch(y5n({activeDataKey:S,activeIndex:v,activeCoordinate:_,activeGraphicalItemId:x}))}Yw=null,ox=null}};if(!i){l();return}s==="raf"?Yw=requestAnimationFrame(l):typeof s=="number"&&ox===null&&(l(),FN=null,ox=setTimeout(()=>{FN?l():(ox=null,Yw=null)},s))}}});var uvt={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},dvt=cu({name:"eventSettings",initialState:uvt,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:dUn}=dvt.actions,fUn=dvt.reducer,pUn=But({brush:Y9n,cartesianAxis:F9n,chartData:fzn,errorBars:G8n,eventSettings:fUn,graphicalItems:v9n,layout:_$n,legend:IMn,options:ozn,polarAxis:DFn,polarOptions:lUn,referenceElements:e8n,renderedTicks:v8n,rootProps:sUn,tooltip:x5n,zIndex:Q6n}),hUn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return GPn({reducer:pUn,preloadedState:t,middleware:r=>{var s;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([Jgt.middleware,evt.middleware,TU.middleware,ovt.middleware,cvt.middleware])},enhancers:r=>{var s=r;return typeof r=="function"&&(s=r()),s.concat(upt({type:"raf"}))},devTools:{serialize:{replacer:rUn},name:"recharts-".concat(n)}})};function mUn(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,s=Qd(),a=b.useRef(null);if(s)return n;a.current==null&&(a.current=hUn(t,r));var i=Mve;return b.createElement(Yut,{context:i,store:a.current},n)}function gUn(e){var{layout:t,margin:n}=e,r=wl(),s=Qd();return b.useEffect(()=>{s||(r(w$n(t)),r(x$n(n)))},[r,s,t,n]),null}var vUn=b.memo(gUn,fU);function yUn(e){var t=wl();return b.useEffect(()=>{t(aUn(e))},[t,e]),null}var bUn=e=>{var t=wl();return b.useEffect(()=>{t(dUn(e))},[t,e]),null},xUn=b.memo(bUn,fU);function sLe(e){var{zIndex:t,isPanorama:n}=e,r=b.useRef(null),s=wl();return b.useLayoutEffect(()=>(r.current&&s(Z6n({zIndex:t,element:r.current,isPanorama:n})),()=>{s(W6n({zIndex:t,isPanorama:n}))}),[s,t,n]),b.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function aLe(e){var{children:t,isPanorama:n}=e,r=fr(M6n);if(!r||r.length===0)return t;var s=r.filter(i=>i<0),a=r.filter(i=>i>0);return b.createElement(b.Fragment,null,s.map(i=>b.createElement(sLe,{key:i,zIndex:i,isPanorama:n})),t,a.map(i=>b.createElement(sLe,{key:i,zIndex:i,isPanorama:n})))}var wUn=["children"];function SUn(e,t){if(e==null)return{};var n,r,s=kUn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function kUn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function mF(){return mF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mF.apply(null,arguments)}var _Un={width:"100%",height:"100%",display:"block"},OUn=b.forwardRef((e,t)=>{var n=Rpt(),r=Ppt(),s=Hpt();if(!tv(n)||!tv(r))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(gft,mF({},i,{title:l,desc:c,role:d,tabIndex:u,width:n,height:r,style:_Un,ref:t}),a)}),EUn=e=>{var{children:t}=e,n=fr(oU);if(!n)return null;var{width:r,height:s,y:a,x:i}=n;return b.createElement(gft,{width:r,height:s,x:i,y:a},t)},iLe=b.forwardRef((e,t)=>{var{children:n}=e,r=SUn(e,wUn),s=Qd();return s?b.createElement(EUn,null,b.createElement(aLe,{isPanorama:!0},n)):b.createElement(OUn,mF({ref:t},r),b.createElement(aLe,{isPanorama:!1},n))});function CUn(){var e=wl(),[t,n]=b.useState(null),r=fr(L$n);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;ia(a)&&a!==r&&e(k$n(a))}},[t,e,r]),n}function oLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jUn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oLe(Object(n),!0).forEach(function(r){TUn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TUn(e,t,n){return(t=NUn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NUn(e){var t=AUn(e,"string");return typeof t=="symbol"?t:t+""}function AUn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kx(){return Kx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kx.apply(null,arguments)}var IUn=()=>(wzn(),null);function gF(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var RUn=b.forwardRef((e,t)=>{var n,r,s=b.useRef(null),[a,i]=b.useState({containerWidth:gF((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:gF((r=e.style)===null||r===void 0?void 0:r.height)}),l=b.useCallback((u,d)=>{i(f=>{var p=Math.round(u),h=Math.round(d);return f.containerWidth===p&&f.containerHeight===h?f:{containerWidth:p,containerHeight:h}})},[]),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 p=m=>{var g=m[0];if(g!=null){var{width:v,height:x}=g.contentRect;l(v,x)}},h=new ResizeObserver(p);h.observe(u),s.current=h}},[t,l]);return b.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[l]),b.createElement(b.Fragment,null,b.createElement(gM,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Kx({ref:c},e)))}),PUn=b.forwardRef((e,t)=>{var{width:n,height:r}=e,[s,a]=b.useState({containerWidth:gF(n),containerHeight:gF(r)}),i=b.useCallback((c,u)=>{a(d=>{var f=Math.round(c),p=Math.round(u);return d.containerWidth===f&&d.containerHeight===p?d:{containerWidth:f,containerHeight:p}})},[]),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(gM,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Kx({ref:l},e)))}),$Un=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return b.createElement(b.Fragment,null,b.createElement(gM,{width:n,height:r}),b.createElement("div",Kx({ref:t},e)))}),MUn=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?b.createElement(PUn,Kx({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement($Un,Kx({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(gM,{width:n,height:r}),b.createElement("div",Kx({ref:t},e)))});function DUn(e){return e?RUn:MUn}var LUn=b.forwardRef((e,t)=>{var{children:n,className:r,height:s,onClick:a,onContextMenu:i,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:p,onTouchEnd:h,onTouchMove:m,onTouchStart:g,style:v,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,_=b.useRef(null),O=wl(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=CUn(),P=Uve(),R=P?.width>0?P.width:x,B=P?.height>0?P.height:s,M=b.useCallback(ie=>{I(ie),typeof t=="function"&&t(ie),T(ie),N(ie),ie!=null&&(_.current=ie)},[I,t,T,N]),L=b.useCallback(ie=>{O(Kgt(ie)),O(Bp({handler:a,reactEvent:ie}))},[O,a]),U=b.useCallback(ie=>{O(nue(ie)),O(Bp({handler:u,reactEvent:ie}))},[O,u]),z=b.useCallback(ie=>{O(Wmt()),O(Bp({handler:d,reactEvent:ie}))},[O,d]),q=b.useCallback(ie=>{O(nue(ie)),O(Bp({handler:f,reactEvent:ie}))},[O,f]),Z=b.useCallback(()=>{O(svt())},[O]),D=b.useCallback(()=>{O(avt())},[O]),G=b.useCallback(ie=>{O(rvt(ie.key))},[O]),V=b.useCallback(ie=>{O(Bp({handler:i,reactEvent:ie}))},[O,i]),$=b.useCallback(ie=>{O(Bp({handler:l,reactEvent:ie}))},[O,l]),W=b.useCallback(ie=>{O(Bp({handler:c,reactEvent:ie}))},[O,c]),Q=b.useCallback(ie=>{O(Bp({handler:p,reactEvent:ie}))},[O,p]),J=b.useCallback(ie=>{O(Bp({handler:g,reactEvent:ie}))},[O,g]),ae=b.useCallback(ie=>{S&&O(lvt(ie)),O(Bp({handler:m,reactEvent:ie}))},[O,S,m]),te=b.useCallback(ie=>{O(Bp({handler:h,reactEvent:ie}))},[O,h]),re=DUn(w);return b.createElement(pgt.Provider,{value:E},b.createElement(WIn.Provider,{value:j},b.createElement(re,{width:R??v?.width,height:B??v?.height,className:Ba("recharts-wrapper",r),style:jUn({position:"relative",cursor:"default",width:R,height:B},v),onClick:L,onContextMenu:V,onDoubleClick:$,onFocus:Z,onBlur:D,onKeyDown:G,onMouseDown:W,onMouseEnter:U,onMouseLeave:z,onMouseMove:q,onMouseUp:Q,onTouchEnd:te,onTouchMove:ae,onTouchStart:J,ref:M},b.createElement(IUn,null),n)))}),zUn=["width","height","responsive","children","className","style","compact","title","desc"];function FUn(e,t){if(e==null)return{};var n,r,s=BUn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function BUn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var UUn=b.forwardRef((e,t)=>{var{width:n,height:r,responsive:s,children:a,className:i,style:l,compact:c,title:u,desc:d}=e,f=FUn(e,zUn),p=Jg(f);return c?b.createElement(b.Fragment,null,b.createElement(gM,{width:n,height:r}),b.createElement(iLe,{otherAttributes:p,title:u,desc:d},a)):b.createElement(LUn,{className:i,style:l,width:n,height:r,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(iLe,{otherAttributes:p,title:u,desc:d,ref:t},b.createElement(n8n,null,a)))});function rue(){return rue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rue.apply(null,arguments)}function lLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qUn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lLe(Object(n),!0).forEach(function(r){VUn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VUn(e,t,n){return(t=HUn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HUn(e){var t=ZUn(e,"string");return typeof t=="symbol"?t:t+""}function ZUn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WUn={top:5,right:5,bottom:5,left:5},QUn=qUn({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:WUn,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},uvt),GUn=b.forwardRef(function(t,n){var r,s=Wd(t.categoricalChartProps,QUn),{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(mUn,{preloadedState:{options:d},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},b.createElement(G9n,{chartData:u.data}),b.createElement(vUn,{layout:s.layout,margin:s.margin}),b.createElement(xUn,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(yUn,{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(UUn,rue({},s,{ref:n})))}),YUn=["axis"],XUn=b.forwardRef((e,t)=>b.createElement(GUn,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:YUn,tooltipPayloadSearcher:azn,categoricalChartProps:e,ref:t}));function KUn(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function JUn(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function e7n(e){return e/100*window.innerHeight}function t7n(e){return e/100*window.innerWidth}function n7n(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 jA({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,a]=n7n(n);switch(a){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=JUn(t,s);break}case"em":{r=KUn(t,s);break}case"vh":{r=e7n(s);break}case"vw":{r=t7n(s);break}}return r}function jd(e){return parseFloat(e.toFixed(3))}function SC({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,s)=>(r+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,r),0)}function sue(e){const{panels:t}=e,n=SC({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:a}=r;let i=0;if(a.collapsedSize!==void 0){const d=jA({groupSize:n,panelElement:s,styleProp:a.collapsedSize});i=jd(d/n*100)}let l;if(a.defaultSize!==void 0){const d=jA({groupSize:n,panelElement:s,styleProp:a.defaultSize});l=jd(d/n*100)}let c=0;if(a.minSize!==void 0){const d=jA({groupSize:n,panelElement:s,styleProp:a.minSize});c=jd(d/n*100)}let u=100;if(a.maxSize!==void 0){const d=jA({groupSize:n,panelElement:s,styleProp:a.maxSize});u=jd(d/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:l,disabled:a.disabled,minSize:c,maxSize:u,panelId:r.id}})}function Qa(e,t="Assertion error"){if(!e)throw Error(t)}function aue(e,t){return Array.from(t).sort(e==="horizontal"?r7n:s7n)}function r7n(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function s7n(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function fvt(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function pvt(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 a7n({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:l,y:c}=pvt(r,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return Qa(s,"No rect found"),s}let E4;function i7n(){return E4===void 0&&(typeof matchMedia=="function"?E4=!!matchMedia("(pointer:coarse)").matches:E4=!1),E4}function hvt(e){const{element:t,orientation:n,panels:r,separators:s}=e,a=aue(n,Array.from(t.children).filter(fvt).map(m=>({element:m}))).map(({element:m})=>m),i=[];let l=!1,c=!1,u=-1,d=-1,f=0,p,h=[];{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=r.find(x=>x.element===g);if(v){if(p){const x=p.element.getBoundingClientRect(),w=g.getBoundingClientRect();let S;if(c){const _=n==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),O=n==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(h.length){case 0:{S=[_,O];break}case 1:{const E=h[0],T=a7n({orientation:n,rects:[x,w],targetRect:E.element.getBoundingClientRect()});S=[E,T===x?O:_];break}default:{S=h;break}}}else h.length?S=h:S=[n==="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 _ of S){let O="width"in _?_:_.element.getBoundingClientRect();const E=i7n()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(O.width<E){const j=E-O.width;O=new DOMRect(O.x-j/2,O.y,O.width+j,O.height)}if(O.height<E){const j=E-O.height;O=new DOMRect(O.x,O.y-j/2,O.width,O.height+j)}const T=m<=u||m>d;!l&&!T&&i.push({group:e,groupSize:SC({group:e}),panels:[p,v],separator:"width"in _?void 0:_,rect:O}),l=!1}}c=!1,p=v,h=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const v=s.find(x=>x.element===g);v?h.push(v):(p=void 0,h=[])}else c=!0}return i}let mvt=class{#e={};addListener(t,n){const r=this.#e[t];return r===void 0?this.#e[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=this.#e[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,a=null;const i=Array.from(r);for(let l=0;l<i.length;l++){const c=i[l];try{c.call(null,n)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,n){const r=this.#e[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},Pg=new Map;const gvt=new mvt;function o7n(e){Pg=new Map(Pg),Pg.delete(e)}function cLe(e,t){for(const[n]of Pg)if(n.id===e)return n}function Jx(e,t){for(const[n,r]of Pg)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Dk(){return Pg}function rbe(e,t){return gvt.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function Jy(e,t){const n=Pg.get(e);Pg=new Map(Pg),Pg.set(e,t),gvt.emit("groupChange",{group:e,prev:n,next:t})}function l7n(e,t,n){let r,s={x:1/0,y:1/0};for(const a of t){const i=pvt(n,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(r=a,s=i);break}case"vertical":{i.y<=s.y&&(r=a,s=i);break}}}return r?{distance:s,hitRegion:r}:void 0}function c7n(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function u7n(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:fLe(e),b:fLe(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Qa(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:dLe(uLe(n.a)),b:dLe(uLe(n.b))};if(s.a===s.b){const a=r.childNodes,i={a:n.a.at(-1),b:n.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 d7n=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function f7n(e){const t=getComputedStyle(vvt(e)??e).display;return t==="flex"||t==="inline-flex"}function p7n(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||f7n(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"||d7n.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function uLe(e){let t=e.length;for(;t--;){const n=e[t];if(Qa(n,"Missing node"),p7n(n))return n}return null}function dLe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function fLe(e){const t=[];for(;e;)t.push(e),e=vvt(e);return t}function vvt(e){const{parentNode:t}=e;return c7n(t)?t.host:t}function h7n(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 m7n({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!fvt(n)||n.contains(e)||e.contains(n))return!0;if(u7n(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(h7n(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function sbe(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const a=hvt(s),i=l7n(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&m7n({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&n.push(i.hitRegion)}),n}function g7n(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Tu(e,t,n=0){return Math.abs(jd(e)-jd(t))<=n}function cg(e,t){return Tu(e,t)?0:e>t?1:-1}function zO({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return n;if(cg(r,c)<0)if(a){const u=(s+c)/2;cg(r,u)<0?r=s:r=c}else r=c;return r=Math.min(l,r),r=jd(r),r}function KR({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:a}){if(Tu(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=r;Qa(d!=null,"Invalid first pivot index"),Qa(f!=null,"Invalid second pivot index");let p=0;switch(a){case"keyboard":{{const g=e<0?f:d,v=n[g];Qa(v,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=v;if(w){const _=l[g];if(Qa(_!=null,`Previous layout not found for panel index ${g}`),Tu(_,x)){const O=S-_;cg(O,Math.abs(e))>0&&(e=e<0?0-O:O)}}}{const g=e<0?d:f,v=n[g];Qa(v,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=v;if(w){const _=l[g];if(Qa(_!=null,`Previous layout not found for panel index ${g}`),Tu(_,S)){const O=_-x;cg(O,Math.abs(e))>0&&(e=e<0?0-O:O)}}}break}default:{const g=e<0?f:d,v=n[g];Qa(v,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:_}=v;if(w&&cg(x,_)<0)if(e>0){const O=_-S,E=O/2,T=x+e;cg(T,_)<0&&(e=cg(e,E)<=0?0:O)}else{const O=_-S,E=100-O/2,T=x-e;cg(T,_)<0&&(e=cg(100+e,E)>0?0:-O)}break}}{const g=e<0?1:-1;let v=e<0?f:d,x=0;for(;;){const S=l[v];Qa(S!=null,`Previous layout not found for panel index ${v}`);const _=zO({overrideDisabledPanels:i,panelConstraints:n[v],prevSize:S,size:100})-S;if(x+=_,v+=g,v<0||v>=n.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<n.length;){const v=Math.abs(e)-Math.abs(p),x=l[g];Qa(x!=null,`Previous layout not found for panel index ${g}`);const w=x-v,S=zO({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:x,size:w});if(!Tu(x,S)&&(p+=x-S,u[g]=S,p.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(g7n(c,u))return s;{const g=e<0?f:d,v=l[g];Qa(v!=null,`Previous layout not found for panel index ${g}`);const x=v+p,w=zO({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:v,size:x});if(u[g]=w,!Tu(w,x)){let S=x-w,_=e<0?f:d;for(;_>=0&&_<n.length;){const O=u[_];Qa(O!=null,`Previous layout not found for panel index ${_}`);const E=O+S,T=zO({overrideDisabledPanels:i,panelConstraints:n[_],prevSize:O,size:E});if(Tu(O,T)||(S-=T-O,u[_]=T),Tu(S,0))break;e>0?_--:_++}}}const h=Object.values(u).reduce((g,v)=>v+g,0);if(!Tu(h,100,.1))return s;const m=Object.keys(s);return u.reduce((g,v,x)=>(g[m[x]]=v,g),{})}function Z1(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||cg(e[n],t[n])!==0)return!1;return!0}function W1({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((l,c)=>l+c,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(l=>`${l}%`).join(", ")}`);if(!Tu(s,100)&&r.length>0)for(let l=0;l<t.length;l++){const c=r[l];Qa(c!=null,`No layout data found for index ${l}`);const u=100/s*c;r[l]=u}let a=0;for(let l=0;l<t.length;l++){const c=n[l];Qa(c!=null,`No layout data found for index ${l}`);const u=r[l];Qa(u!=null,`No layout data found for index ${l}`);const d=zO({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,r[l]=d)}if(!Tu(a,0))for(let l=0;l<t.length;l++){const c=r[l];Qa(c!=null,`No layout data found for index ${l}`);const u=c+a,d=zO({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,r[l]=d,Tu(a,0)))break}const i=Object.keys(e);return r.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function yvt({groupId:e,panelId:t}){const n=()=>{const l=Dk();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:p,separatorToPanels:h}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:p,layout:f,separatorToPanels:h};throw Error(`Group ${e} not found`)},r=()=>{const l=n().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const l=n().group.panels.find(c=>c.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const l=n().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:p,layout:h,separatorToPanels:m}=n(),g=f.panels.findIndex(S=>S.id===t),v=g===f.panels.length-1,x=KR({delta:v?c-l:l-c,initialLayout:h,panelConstraints:d,pivotIndices:v?[g-1,g]:[g,g+1],prevLayout:h,trigger:"imperative-api"}),w=W1({layout:x,panelConstraints:d});Z1(h,w)||Jy(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:p,layout:w,separatorToPanels:m})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=r(),{mutableValues:u}=s(),d=a();l&&d!==c&&(u.expandToSize=d,i(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=r(),{mutableValues:d}=s(),f=a();if(l&&f===c){let p=d.expandToSize??u;p===0&&(p=1),i(p)}},getSize:()=>{const{group:l}=n(),c=a(),{element:u}=s(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=r(),u=a();return l&&Tu(c,u)},resize:l=>{const{group:c}=n(),{element:u}=s(),d=SC({group:c}),f=jA({groupSize:d,panelElement:u,styleProp:l}),p=jd(f/d*100);i(p)}}}function pLe(e){if(e.defaultPrevented)return;const t=Dk();sbe(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,a=yvt({groupId:n.group.id,panelId:r.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function m5(e){const t=Dk();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function bvt({groupId:e}){const t=()=>{const n=Dk();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:a,groupSize:i,layout:l,separatorToPanels:c}=t(),u=W1({layout:n,panelConstraints:s});return r?l:(Z1(l,u)||Jy(a,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function Xw(e,t){const n=m5(e),r=Jx(n.id,!0),s=n.separators.find(d=>d.element===e);Qa(s,"Matching separator not found");const a=r.separatorToPanels.get(s);Qa(a,"Matching panels not found");const i=a.map(d=>n.panels.indexOf(d)),l=bvt({groupId:n.id}).getLayout(),c=KR({delta:t,initialLayout:l,panelConstraints:r.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=W1({layout:c,panelConstraints:r.derivedPanelConstraints});Z1(l,u)||Jy(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:u,separatorToPanels:r.separatorToPanels})}function hLe(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=m5(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Xw(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Xw(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Xw(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Xw(t,-5);break}case"End":{e.preventDefault(),Xw(t,100);break}case"Enter":{e.preventDefault();const r=m5(t),s=Jx(r.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=r.separators.find(p=>p.element===t);Qa(c,"Matching separator not found");const u=l.get(c);Qa(u,"Matching panels not found");const d=u[0],f=a.find(p=>p.panelId===d.id);if(Qa(f,"Panel metadata not found"),f.collapsible){const p=i[d.id],h=f.collapsedSize===p?r.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;Xw(t,h-p)}break}case"F6":{e.preventDefault();const r=m5(t).separators.map(i=>i.element),s=Array.from(r).findIndex(i=>i===e.currentTarget);Qa(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Xw(t,-100);break}}}let kE={cursorFlags:0,state:"inactive"};const abe=new mvt;function Q1(){return kE}function v7n(e){return abe.addListener("change",e)}function y7n(e){const t=kE,n={...kE};n.cursorFlags=e,kE=n,abe.emit("change",{prev:t,next:n})}function _E(e){const t=kE;kE=e,abe.emit("change",{prev:t,next:e})}function mLe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Dk(),n=sbe(e,t),r=new Map;let s=!1;n.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&r.set(a.group,i.layout)}),_E({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const b7n=e=>e,tY=()=>{},xvt=1,wvt=2,Svt=4,kvt=8,gLe=3,vLe=12;let C4;function yLe(){return C4===void 0&&(C4=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(C4=!0)),C4}function x7n({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&yLe()){const a=(e&xvt)!==0,i=(e&wvt)!==0,l=(e&Svt)!==0,c=(e&kvt)!==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 yLe()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const bLe=new WeakMap;function ibe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=bLe.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=Q1();switch(r.state){case"active":case"hover":{const s=x7n({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(i=>i.group),state:r.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}bLe.set(e,{prevStyle:t,styleSheet:n})}function _vt({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let l=0;n.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:p,panels:h}=d,{disableCursor:m}=d.mutableState;let g=0;a?p==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:p==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const v=r.get(d),x=s.get(d);if(!v||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:_,layout:O,separatorToPanels:E}=x;if(S&&O&&E){const T=KR({delta:g,initialLayout:v,panelConstraints:S,pivotIndices:u.panels.map(j=>h.indexOf(j)),prevLayout:O,trigger:"mouse-or-touch"});if(Z1(T,O)){if(g!==0&&!m)switch(p){case"horizontal":{l|=g<0?xvt:wvt;break}case"vertical":{l|=g<0?Svt:kvt;break}}}else Jy(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:_,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&gLe:c|=l&gLe,t.movementY===0?c|=i&vLe:c|=l&vLe,y7n(c),ibe(e)}function xLe(e){const t=Dk(),n=Q1();n.state==="active"&&_vt({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function wLe(e){if(e.defaultPrevented)return;const t=Q1(),n=Dk();switch(t.state){case"active":{if(e.buttons===0){_E({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=Jx(r.group.id,!0);Jy(r.group,s)});return}_vt({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=sbe(e,n);r.length===0?t.state!=="inactive"&&_E({cursorFlags:0,state:"inactive"}):_E({cursorFlags:0,hitRegions:r,state:"hover"}),ibe(e.currentTarget);break}}}function SLe(e){e.relatedTarget instanceof HTMLIFrameElement&&Q1().state==="hover"&&_E({cursorFlags:0,state:"inactive"})}function kLe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Q1();t.state==="active"&&(_E({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(ibe(e.currentTarget),t.hitRegions.forEach(n=>{const r=Jx(n.group.id,!0);Jy(n.group,r)}),e.preventDefault()))}function _Le(e){let t=0,n=0;const r={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=jd(a.defaultSize);n+=i,r[a.panelId]=i}else r[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=jd((100-n)/s);for(const i of e)i.defaultSize===void 0&&(r[i.panelId]=a)}return r}function w7n(e,t,n){if(!n[0])return;const r=e.panels.find(c=>c.element===t);if(!r||!r.onResize)return;const s=SC({group:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,i=r.mutableValues.prevSize,l={asPercentage:jd(a/s*100),inPixels:a};r.mutableValues.prevSize=l,r.onResize(l,r.id,i)}function S7n(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function k7n({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,a=0,i=!1;const l=new Map,c=[];for(const f of e.panels){const p=r[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const h=p/100*n,m=jd(h/t*100);l.set(f.id,m),s+=m}else c.push(f.id),a+=p}if(!i||c.length===0)return r;const u=100-s,d={...r};if(l.forEach((f,p)=>{d[p]=f}),a>0)for(const f of c){const p=r[f]??0;d[f]=jd(p/a*u)}else{const f=jd(u/c.length);for(const p of c)d[p]=f}return d}function _7n(e,t){const n=e.map(s=>s.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!r.includes(s))return!1;return!0}const Q_=new Map;function O7n(e){let t=!0;Qa(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,a=new n(m=>{for(const g of m){const{borderBoxSize:v,target:x}=g;if(x===e.element){if(t){const w=SC({group:e});if(w===0)return;const S=Jx(e.id);if(!S)return;const _=sue(e),O=S.defaultLayoutDeferred?_Le(_):S.layout,E=k7n({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:O}),T=W1({layout:E,panelConstraints:_});if(!S.defaultLayoutDeferred&&Z1(S.layout,T)&&S7n(S.derivedPanelConstraints,_)&&S.groupSize===w)return;Jy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:_,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else w7n(e,x,v)}});a.observe(e.element),e.panels.forEach(m=>{Qa(!r.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.onResize&&a.observe(m.element)});const i=SC({group:e}),l=sue(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(_7n(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??_Le(l),f=W1({layout:d,panelConstraints:l}),p=e.element.ownerDocument;Q_.set(p,(Q_.get(p)??0)+1);const h=new Map;return hvt(e).forEach(m=>{m.separator&&h.set(m.separator,m.panels)}),Jy(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:h}),e.separators.forEach(m=>{Qa(!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",hLe)}),Q_.get(p)===1&&(p.addEventListener("dblclick",pLe,!0),p.addEventListener("pointerdown",mLe,!0),p.addEventListener("pointerleave",xLe),p.addEventListener("pointermove",wLe),p.addEventListener("pointerout",SLe),p.addEventListener("pointerup",kLe,!0)),function(){t=!1,Q_.set(p,Math.max(0,(Q_.get(p)??0)-1)),o7n(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",hLe)}),Q_.get(p)||(p.removeEventListener("dblclick",pLe,!0),p.removeEventListener("pointerdown",mLe,!0),p.removeEventListener("pointerleave",xLe),p.removeEventListener("pointermove",wLe),p.removeEventListener("pointerout",SLe),p.removeEventListener("pointerup",kLe,!0)),a.disconnect()}}function E7n(){const[e,t]=b.useState({}),n=b.useCallback(()=>t({}),[]);return[e,n]}function obe(e){const t=b.useId();return`${e??t}`}const Lk=typeof window<"u"?b.useLayoutEffect:b.useEffect;function hI(e){const t=b.useRef(e);return Lk(()=>{t.current=e},[e]),b.useCallback((...n)=>t.current?.(...n),[t])}function lbe(...e){return hI(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function cbe(e){const t=b.useRef({...e});return Lk(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Ovt=b.createContext(null);function C7n(e,t){const n=b.useRef({getLayout:()=>({}),setLayout:b7n});b.useImperativeHandle(t,()=>n.current,[]),Lk(()=>{Object.assign(n.current,bvt({groupId:e}))})}function NU({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:a,groupRef:i,id:l,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:p,...h}){const m=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=hI(P=>{Z1(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),v=hI(P=>{Z1(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=obe(l),w=b.useRef(null),[S,_]=E7n(),O=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=lbe(w,a);C7n(x,i);const T=hI((P,R)=>{const B=Q1(),M=cLe(P),L=Jx(P);if(L){let U=!1;return B.state==="active"&&(U=B.hitRegions.some(z=>z.group===M)),{flexGrow:L.layout[R]??1,pointerEvents:U?"none":void 0}}return{flexGrow:n?.[R]??1}}),j=cbe({defaultLayout:n,disableCursor:r}),N=b.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:x,orientation:d,registerPanel:P=>{const R=O.current;return R.panels=aue(d,[...R.panels,P]),_(),()=>{R.panels=R.panels.filter(B=>B!==P),_()}},registerSeparator:P=>{const R=O.current;return R.separators=aue(d,[...R.separators,P]),_(),()=>{R.separators=R.separators.filter(B=>B!==P),_()}},togglePanelDisabled:(P,R)=>{const B=O.current.panels.find(U=>U.id===P);B&&(B.panelConstraints.disabled=R);const M=cLe(x),L=Jx(x);M&&L&&Jy(M,{...L,derivedPanelConstraints:sue(M)})},toggleSeparatorDisabled:(P,R)=>{const B=O.current.separators.find(M=>M.id===P);B&&(B.disabled=R)}}),[T,x,_,d,j]),I=b.useRef(null);return Lk(()=>{const P=w.current;if(P===null)return;const R=O.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){B={};for(const D of R.panels){const G=j.defaultLayout[D.id];G!==void 0&&(B[D.id]=G)}}const M={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:O.current.lastExpandedPanelSizes,layouts:O.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=M;const L=O7n(M),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:q}=Jx(M.id,!0);!U&&z.length>0&&(g(q),v(q));const Z=rbe(x,D=>{const{defaultLayoutDeferred:G,derivedPanelConstraints:V,layout:$}=D.next;if(G||V.length===0)return;const W=M.panels.map(({id:J})=>J).join(",");M.mutableState.layouts[W]=$,V.forEach(J=>{if(J.collapsible){const{layout:ae}=D.prev??{};if(ae){const te=Tu(J.collapsedSize,$[J.panelId]),re=Tu(J.collapsedSize,ae[J.panelId]);te&&!re&&(M.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const Q=Q1().state!=="active";g($),Q&&v($)});return()=>{I.current=null,L(),Z()}},[s,x,v,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=n,P.mutableState.disableCursor=!!r)}),o.jsx(Ovt.Provider,{value:N,children:o.jsx("div",{...h,className:t,"data-group":!0,"data-testid":x,id:x,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...p,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}NU.displayName="Group";function nY(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function ube({debounceSaveMs:e=100,panelIds:t,storage:n=localStorage,...r}){const s=t!==void 0,a="id"in r?r.id:r.groupId,i=nY(a,t??[]),l=b.useSyncExternalStore(j7n,()=>n.getItem(i),()=>n.getItem(i)),c=b.useMemo(()=>l?JSON.parse(l):void 0,[l]),u=b.useRef(null),d=b.useCallback(()=>{const h=u.current;h&&(u.current=null,clearTimeout(h))},[]);b.useLayoutEffect(()=>()=>{d()},[d]);const f=b.useCallback(h=>{d();let m;s?m=nY(a,Object.keys(h)):m=nY(a,[]);try{n.setItem(m,JSON.stringify(h))}catch(g){console.error(g)}},[d,s,a,n]),p=b.useCallback(h=>{d(),e===0?f(h):u.current=setTimeout(()=>{f(h)},e)},[d,e,f]);return{defaultLayout:c,onLayoutChange:p,onLayoutChanged:f}}function j7n(){return function(){}}function dbe(){const e=b.useContext(Ovt);return Qa(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function T7n(e,t){const{id:n}=dbe(),r=b.useRef({collapse:tY,expand:tY,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tY});b.useImperativeHandle(t,()=>r.current,[]),Lk(()=>{Object.assign(r.current,yvt({groupId:n,panelId:e}))})}function kC({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:l="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:p,style:h,...m}){const g=!!c,v=obe(c),x=cbe({disabled:a}),w=b.useRef(null),S=lbe(w,i),{getPanelStyles:_,id:O,orientation:E,registerPanel:T,togglePanelDisabled:j}=dbe(),N=f!==null,I=hI((R,B,M)=>{f?.(R,c,M)});Lk(()=>{const R=w.current;if(R!==null){const B={element:R,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:n,collapsible:r,defaultSize:s,disabled:x.disabled,maxSize:u,minSize:d}};return T(B)}},[l,n,r,s,N,v,g,u,d,I,T,x]),b.useEffect(()=>{j(v,!!a)},[a,v,j]),T7n(v,p);const P=b.useSyncExternalStore(R=>rbe(O,R),()=>JSON.stringify(_(O,v)),()=>JSON.stringify(_(O,v)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":v,id:v,ref:S,style:{...N7n,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",...h,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}kC.displayName="Panel";const N7n={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function A7n(){return b.useRef(null)}function I7n({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,a;const i=e[n],l=t.find(c=>c.panelId===n);if(l){const c=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[r,r+1];a=W1({layout:KR({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n],s=W1({layout:KR({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:a,valueNow:i}}function Evt({children:e,className:t,disabled:n,elementRef:r,id:s,style:a,...i}){const l=obe(s),c=cbe({disabled:n}),[u,d]=b.useState({}),[f,p]=b.useState("inactive"),h=b.useRef(null),m=lbe(h,r),{disableCursor:g,id:v,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=dbe(),_=x==="horizontal"?"vertical":"horizontal";Lk(()=>{const E=h.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=v7n(P=>{p(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=rbe(v,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:M}=P.next,L=M.get(T);if(L){const U=L[0],z=L.indexOf(U);d(I7n({layout:B,panelConstraints:R,panelId:U.id,panelIndex:z}))}});return()=>{N(),I(),j()}}},[v,l,w,c]),b.useEffect(()=>{S(l,!!n)},[n,l,S]);let O;return n&&!g&&(O="not-allowed"),o.jsx("div",{...i,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":_,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?"disabled":f,"data-testid":l,id:l,ref:m,role:"separator",style:{flexBasis:"auto",cursor:O,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}Evt.displayName="Separator";const OLe=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(h=>h(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,s,l);return l},R7n=(e=>e?OLe(e):OLe),P7n=e=>e;function $7n(e,t=P7n){const n=Te.useSyncExternalStore(e.subscribe,Te.useCallback(()=>t(e.getState()),[e,t]),Te.useCallback(()=>t(e.getInitialState()),[e,t]));return Te.useDebugValue(n),n}const ELe=e=>{const t=R7n(e),n=r=>$7n(t,r);return Object.assign(n,t),n},fbe=(e=>e?ELe(e):ELe);function M7n(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),l=(a=n.getItem(s))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const iue=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return iue(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return iue(r)(n)}}}},D7n=(e,t)=>(n,r,s)=>{let a={storage:M7n(()=>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.`),n(...v)},r,s);const f=()=>{const v=a.partialize({...r()});return d.setItem(a.name,{state:v,version:a.version})},p=s.setState;s.setState=(v,x)=>(p(v,x),f());const h=e((...v)=>(n(...v),f()),r,s);s.getInitialState=()=>h;let m;const g=()=>{var v,x;if(!d)return;const w=++l;i=!1,c.forEach(_=>{var O;return _((O=r())!=null?O:h)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(v=r())!=null?v:h))||void 0;return iue(d.getItem.bind(d))(a.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==a.version){if(a.migrate){const O=a.migrate(_.state,_.version);return O instanceof Promise?O.then(E=>[!0,E]):[!0,O]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var O;if(w!==l)return;const[E,T]=_;if(m=a.merge(T,(O=r())!=null?O:h),n(m,!0),E)return f()}).then(()=>{w===l&&(S?.(r(),void 0),m=r(),i=!0,u.forEach(_=>_(m)))}).catch(_=>{w===l&&S?.(void 0,_)})};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||h},L7n=D7n;var zk=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},z7n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},F7n=class{#e=z7n;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},zS=new F7n;function B7n(e){setTimeout(e,0)}var G1=typeof window>"u"||"Deno"in globalThis;function Uc(){}function U7n(e,t){return typeof e=="function"?e(t):e}function oue(e){return typeof e=="number"&&e>=0&&e!==1/0}function Cvt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function e0(e,t){return typeof e=="function"?e(t):e}function qp(e,t){return typeof e=="function"?e(t):e}function CLe(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==pbe(i,t.options))return!1}else if(!JR(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function jLe(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Y1(t.options.mutationKey)!==Y1(a))return!1}else if(!JR(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function pbe(e,t){return(t?.queryKeyHashFn||Y1)(e)}function Y1(e){return JSON.stringify(e,(t,n)=>lue(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function JR(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>JR(e[n],t[n])):!1}var q7n=Object.prototype.hasOwnProperty;function hbe(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=TLe(e)&&TLe(t);if(!r&&!(lue(e)&&lue(t)))return t;const a=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),l=i.length,c=r?new Array(l):{};let u=0;for(let d=0;d<l;d++){const f=r?d:i[d],p=e[f],h=t[f];if(p===h){c[f]=p,(r?d<a:q7n.call(e,f))&&u++;continue}if(p===null||h===null||typeof p!="object"||typeof h!="object"){c[f]=h;continue}const m=hbe(p,h,n+1);c[f]=m,m===p&&u++}return a===l&&u===a?e:c}function eP(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function TLe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lue(e){if(!NLe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!NLe(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function NLe(e){return Object.prototype.toString.call(e)==="[object Object]"}function V7n(e){return new Promise(t=>{zS.setTimeout(t,e)})}function cue(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?hbe(e,t):t}function H7n(e){return e}function Z7n(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function W7n(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mbe=Symbol();function jvt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mbe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gbe(e,t){return typeof e=="function"?e(...t):!!e}function Q7n(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var G7n=class extends zk{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!G1&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},vbe=new G7n;function uue(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Y7n=B7n;function X7n(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=Y7n;const a=l=>{t?e.push(l):s(()=>{n(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var To=X7n(),K7n=class extends zk{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!G1&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},vF=new K7n;function J7n(e){return Math.min(1e3*2**e,3e4)}function Tvt(e){return(e??"online")==="online"?vF.isOnline():!0}var due=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Nvt(e){let t=!1,n=0,r;const s=uue(),a=()=>s.status!=="pending",i=g=>{if(!a()){const v=new due(g);p(v),e.onCancel?.(v)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>vbe.isFocused()&&(e.networkMode==="always"||vF.isOnline())&&e.canRun(),d=()=>Tvt(e.networkMode)&&e.canRun(),f=g=>{a()||(r?.(),s.resolve(g))},p=g=>{a()||(r?.(),s.reject(g))},h=()=>new Promise(g=>{r=v=>{(a()||u())&&g(v)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(a())return;const w=e.retry??(G1?0:3),S=e.retryDelay??J7n,_=typeof S=="function"?S(n,x):S,O=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(t||!O){p(x);return}n++,e.onFail?.(n,x),V7n(_).then(()=>u()?void 0:h()).then(()=>{t?p(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():h().then(m),s)}}var Avt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oue(this.gcTime)&&(this.#e=zS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(G1?1/0:300*1e3))}clearGcTimeout(){this.#e&&(zS.clearTimeout(this.#e),this.#e=void 0)}},eqn=class extends Avt{#e;#t;#n;#s;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ILe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ILe(this.options);t.data!==void 0&&(this.setState(ALe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=cue(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Uc).catch(Uc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>qp(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mbe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>e0(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Cvt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const l=jvt(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return r(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Nvt({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof due&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof due){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ivt(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...ALe(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),To.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Ivt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tvt(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ALe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ILe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var AU=class extends zk{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=uue(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#o;#i;#h;#d;#f;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),RLe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fue(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fue(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qp(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!eP(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&PLe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||qp(this.options.enabled,this.#t)!==qp(t.enabled,this.#t)||e0(this.options.staleTime,this.#t)!==e0(t.staleTime,this.#t))&&this.#g();const s=this.#v();r&&(this.#t!==n||qp(this.options.enabled,this.#t)!==qp(t.enabled,this.#t)||s!==this.#l)&&this.#y(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return nqn(this,n)&&(this.#s=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Uc)),t}#g(){this.#x();const e=e0(this.options.staleTime,this.#t);if(G1||this.#s.isStale||!oue(e))return;const n=Cvt(this.#s.dataUpdatedAt,e)+1;this.#c=zS.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(G1||qp(this.options.enabled,this.#t)===!1||!oue(this.#l)||this.#l===0)&&(this.#u=zS.setInterval(()=>{(this.options.refetchIntervalInBackground||vbe.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(zS.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(zS.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#s,a=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:u}=e;let d={...u},f=!1,p;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&RLe(e,t),I=j&&PLe(e,n,t,r);(N||I)&&(d={...d,...Ivt(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:g}=d;p=d.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,v=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",p=cue(s?.data,j,t),f=!0)}if(t.select&&p!==void 0&&!v)if(s&&p===a?.data&&t.select===this.#h)p=this.#d;else try{this.#h=t.select,p=t.select(p),p=cue(s?.data,p,t),this.#d=p,this.#i=null}catch(j){this.#i=j}this.#i&&(h=this.#i,p=this.#d,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",w=g==="pending",S=g==="error",_=w&&x,O=p!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&O,isStale:ybe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:qp(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=B=>{N?B.reject(T.error):j&&B.resolve(T.data)},P=()=>{const B=this.#o=T.promise=uue();I(B)},R=this.#o;switch(R.status){case"pending":e.queryHash===n.queryHash&&I(R);break;case"fulfilled":(N||T.data!==R.value)&&P();break;case"rejected":(!N||T.error!==R.reason)&&P();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#t),eP(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#p.size)return!0;const a=new Set(s??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const l=i;return this.#s[l]!==e[l]&&a.has(l)})};this.#k({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#k(e){To.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function tqn(e,t){return qp(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function RLe(e,t){return tqn(e,t)||e.state.data!==void 0&&fue(e,t,t.refetchOnMount)}function fue(e,t,n){if(qp(t.enabled,e)!==!1&&e0(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ybe(e,t)}return!1}function PLe(e,t,n,r){return(e!==t||qp(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ybe(e,n)}function ybe(e,t){return qp(t.enabled,e)!==!1&&e.isStaleByTime(e0(t.staleTime,e))}function nqn(e,t){return!eP(e.getCurrentResult(),t)}function yF(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{Q7n(m,()=>t.signal,()=>d=!0)},p=jvt(t.options,t.fetchOptions),h=async(m,g,v)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return f(E),E})(),S=await p(w),{maxPages:_}=t.options,O=v?W7n:Z7n;return{pages:O(m.pages,S,_),pageParams:O(m.pageParams,g,_)}};if(s&&a.length){const m=s==="backward",g=m?Rvt:pue,v={pages:a,pageParams:i},x=g(r,v);l=await h(v,x,m)}else{const m=e??a.length;do{const g=c===0?i[0]??r.initialPageParam:pue(r,l);if(c>0&&g==null)break;l=await h(l,g),c++}while(c<m)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function pue(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Rvt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function rqn(e,t){return t?pue(e,t)!=null:!1}function sqn(e,t){return!t||!e.getPreviousPageParam?!1:Rvt(e,t)!=null}var aqn=class extends AU{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:yF()})}getOptimisticResult(e){return e.behavior=yF(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:l}=r,c=n.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",p=s&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:rqn(t,n.data),hasPreviousPage:sqn(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!p}}},iqn=class extends Avt{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Pvt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Nvt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#r({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#s.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),To.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Pvt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oqn=class extends zk{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new iqn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=j4(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=j4(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=j4(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=j4(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){To.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>jLe(t,n))}findAll(e={}){return this.getAll().filter(t=>jLe(e,t))}notify(e){To.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return To.batch(()=>Promise.all(e.map(t=>t.continue().catch(Uc))))}};function j4(e){return e.options.scope?.id}var lqn=class extends zk{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),eP(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Y1(n.mutationKey)!==Y1(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??Pvt();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){To.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,n,r,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,n,r,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,n,r,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,n,r,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#t)})})}};function $Le(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function cqn(e,t,n){const r=e.slice(0);return r[t]=n,r}var uqn=class extends zk{#e;#t;#n;#s;#r;#a;#o;#i;#h;#d=[];constructor(e,t,n){super(),this.#e=e,this.#s=n,this.#n=[],this.#r=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#s=t,To.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=r.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=n.length!==s.length,l=s.some((d,f)=>d!==n[f]),c=i||l,u=c?!0:a.some((d,f)=>{const p=this.#t[f];return!p||!eP(d,p)});!c&&!u||(c&&(this.#d=r,this.#r=s),this.#t=a,this.hasListeners()&&(c&&($Le(n,s).forEach(d=>{d.destroy()}),$Le(s,n).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#p()))})}getCurrentResult(){return this.#t}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,s),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const s=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#h,s=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,i)=>a!==r[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,n!==void 0&&(this.#h=n),this.#a=hbe(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const s=r.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(r):t.set(s,[r])});const n=[];return e.forEach(r=>{const s=this.#e.defaultQueryOptions(r),i=t.get(s.queryHash)?.shift()??new AU(this.#e,s);n.push({defaultedQueryOptions:s,observer:i})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#t=cqn(this.#t,n,t),this.#p())}#p(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),n=this.#c(t,this.#s?.combine);e!==n&&To.batch(()=>{this.listeners.forEach(r=>{r(this.#t)})})}}},dqn=class extends zk{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??pbe(r,t);let a=this.get(s);return a||(a=new eqn({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){To.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>CLe(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>CLe(e,n)):t}notify(e){To.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){To.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){To.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fqn=class{#e;#t;#n;#s;#r;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new dqn,this.#t=e.mutationCache||new oqn,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=vbe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=vF.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(e0(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(r.queryHash)?.state.data,i=U7n(t,a);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return To.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;To.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return To.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=To.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Uc).catch(Uc)}invalidateQueries(e,t={}){return To.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=To.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Uc)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Uc)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(e0(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Uc).catch(Uc)}fetchInfiniteQuery(e){return e.behavior=yF(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Uc).catch(Uc)}ensureInfiniteQueryData(e){return e.behavior=yF(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vF.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Y1(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{JR(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Y1(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{JR(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pbe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===mbe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},$vt=b.createContext(void 0),la=e=>{const t=b.useContext($vt);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},pqn=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx($vt.Provider,{value:e,children:t})),Mvt=b.createContext(!1),Dvt=()=>b.useContext(Mvt);Mvt.Provider;function hqn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var mqn=b.createContext(hqn()),Lvt=()=>b.useContext(mqn),zvt=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?gbe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Fvt=e=>{b.useEffect(()=>{e.clearReset()},[e])},Bvt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||gbe(n,[e.error,r])),Uvt=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},gqn=(e,t)=>e.isLoading&&e.isFetching&&!t,hue=(e,t)=>e?.suspense&&t.isPending,mue=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vqn({queries:e,...t},n){const r=la(),s=Dvt(),a=Lvt(),i=b.useMemo(()=>e.map(g=>{const v=r.defaultQueryOptions(g);return v._optimisticResults=s?"isRestoring":"optimistic",v}),[e,r,s]);i.forEach(g=>{Uvt(g);const v=r.getQueryCache().get(g.queryHash);zvt(g,a,v)}),Fvt(a);const[l]=b.useState(()=>new uqn(r,i,t)),[c,u,d]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(g=>f?l.subscribe(To.batchCalls(g)):Uc,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const h=c.some((g,v)=>hue(i[v],g))?c.flatMap((g,v)=>{const x=i[v];if(x&&hue(x,g)){const w=new AU(r,x);return mue(x,w,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const m=c.find((g,v)=>{const x=i[v];return x&&Bvt({result:g,errorResetBoundary:a,throwOnError:x.throwOnError,query:r.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m?.error)throw m.error;return u(d())}function qvt(e,t,n){const r=Dvt(),s=Lvt(),a=la(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",Uvt(i),zvt(i,s,l),Fvt(s);const c=!a.getQueryCache().get(i.queryHash),[u]=b.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(p=>{const h=f?u.subscribe(To.batchCalls(p)):Uc;return u.updateResult(),h},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),hue(i,d))throw mue(i,u,s);if(Bvt({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!G1&&gqn(d,r)&&(c?mue(i,u,s):l?.promise)?.catch(Uc).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function Ot(e,t){return qvt(e,AU)}function ar(e,t){const n=la(),[r]=b.useState(()=>new lqn(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const s=b.useSyncExternalStore(b.useCallback(i=>r.subscribe(To.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=b.useCallback((i,l)=>{r.mutate(i,l).catch(Uc)},[r]);if(s.error&&gbe(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function Sb(e,t){return qvt(e,aqn)}var hl=(e=>(e.AGENT="agent",e.SCORER="scorer",e.RAG_INGESTION="rag_ingestion",e.TRAJECTORY="trajectory",e.INPUT_PROCESSOR="input_processor",e.INPUT_STEP_PROCESSOR="input_step_processor",e.OUTPUT_PROCESSOR="output_processor",e.OUTPUT_STEP_PROCESSOR="output_step_processor",e.WORKFLOW_STEP="workflow_step",e.TOOL="tool",e.WORKFLOW_RUN="workflow_run",e.MEMORY="memory",e))(hl||{});yk().describe("Database record creation time");var yqn=yk().describe("Database record last update time");yqn.nullable();var IU=Oe({page:HCe().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:HCe().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),RU=Oe({total:Et().describe("Total number of items available"),page:Et().describe("Current page"),perPage:or([Et(),Qt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:Yo().describe("True if more pages are available")}),bqn=Oe({start:ZCe().optional().describe("Start of date range (inclusive by default)"),end:ZCe().optional().describe("End of date range (inclusive by default)"),startExclusive:Yo().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:Yo().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),NM=Lo(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),wv=Lo(["sum","avg","min","max","count","count_distinct","last"]).describe("Aggregation function"),Fk=Lo(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),bbe=Lo(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),Bk=At(he()).min(1).describe("Fields to group by"),xbe=At(Et().min(0).max(1)).min(1).describe("Percentile values (0-1)"),wbe={value:Et().nullable().describe("Aggregated value"),previousValue:Et().nullable().optional().describe("Value from comparison period"),changePercent:Et().nullable().optional().describe("Percentage change from comparison period")},Sbe=ma(he(),he().nullable()).describe("Dimension values for this group"),qj=Et().describe("Aggregated value"),Vj=yk().describe("Bucket timestamp"),kbe=Et().describe("Percentile value"),_be=Et().describe("Percentile value at this bucket"),Hj=mpe(hl).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),xqn=he().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),Vvt=he().describe("Name of the entity"),Hvt=he().describe("Human end-user who triggered execution"),Zvt=he().describe("Multi-tenant organization/account"),Wvt=he().describe("Broader resource context (Mastra memory compatibility)"),Qvt=he().describe("Unique execution run identifier"),Gvt=he().describe("Session identifier for grouping traces"),Yvt=he().describe("Conversation thread identifier"),Xvt=he().describe("HTTP request ID for log correlation"),Kvt=he().describe('Environment (e.g., "production" | "staging" | "development")'),wqn=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),Jvt=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),eyt=he().describe("Name of the service"),tyt=mpe(hl).describe("Entity type of the parent entity"),Sqn=he().describe("ID of the parent entity"),nyt=he().describe("Name of the parent entity"),ryt=mpe(hl).describe("Entity type of the root entity"),kqn=he().describe("ID of the root entity"),syt=he().describe("Name of the root entity"),ayt=he().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),iyt=he().describe("Version ID of the parent entity that produced this signal"),oyt=he().describe("Version ID of the root entity that produced this signal"),PU=he().describe("Experiment or eval run identifier"),_qn=ma(he(),Ja()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),lyt=ma(he(),Ja()).describe("User-defined metadata for custom filtering"),cyt=At(he()).describe("Labels for filtering"),Oqn={entityType:Hj.nullish(),entityId:xqn.nullish(),entityName:Vvt.nullish(),parentEntityType:tyt.nullish(),parentEntityId:Sqn.nullish(),parentEntityName:nyt.nullish(),rootEntityType:ryt.nullish(),rootEntityId:kqn.nullish(),rootEntityName:syt.nullish(),userId:Hvt.nullish(),organizationId:Zvt.nullish(),resourceId:Wvt.nullish(),runId:Qvt.nullish(),sessionId:Gvt.nullish(),threadId:Yvt.nullish(),requestId:Xvt.nullish(),environment:Kvt.nullish(),serviceName:eyt.nullish(),scope:_qn.nullish(),entityVersionId:ayt.nullish(),parentEntityVersionId:iyt.nullish(),rootEntityVersionId:oyt.nullish(),experimentId:PU.nullish()},$U={...Oqn,executionSource:Jvt.nullish(),tags:cyt.nullish()};wqn.nullish();var MU={timestamp:bqn.optional().describe("Filter by timestamp range"),traceId:he().optional().describe("Filter by trace ID"),spanId:he().optional().describe("Filter by span ID"),entityType:Hj.optional(),entityName:Vvt.optional(),entityVersionId:ayt.optional(),parentEntityVersionId:iyt.optional(),rootEntityVersionId:oyt.optional(),userId:Hvt.optional(),organizationId:Zvt.optional(),experimentId:PU.optional(),serviceName:eyt.optional(),environment:Kvt.optional(),parentEntityType:tyt.optional(),parentEntityName:nyt.optional(),rootEntityType:ryt.optional(),rootEntityName:syt.optional(),resourceId:Wvt.optional(),runId:Qvt.optional(),sessionId:Gvt.optional(),threadId:Yvt.optional(),requestId:Xvt.optional(),executionSource:Jvt.optional(),tags:At(he()).optional().describe("Filter by tags (must have all specified tags)")},DU=he().describe("Unique trace identifier"),LU=he().describe("Unique span identifier within a trace"),bF=Lo(["debug","info","warn","error","fatal"]),uyt=he().describe("Log message"),dyt=ma(he(),Ja()).describe("Structured data attached to the log"),fyt=Oe({logId:he().nullish().describe("Unique id for this log event"),timestamp:yk().describe("When the log was created"),level:bF.describe("Log severity level"),message:uyt,data:dyt.nullish(),traceId:DU.nullish(),spanId:LU.nullish(),...$U,source:he().nullish().describe("Execution source"),metadata:lyt.nullish()}).describe("Log record as stored in the database");Oe({level:bF,message:uyt,data:dyt.optional(),tags:cyt.optional()}).describe("User-provided log input");var Eqn=fyt;Oe({logs:At(Eqn)}).describe("Arguments for batch creating logs");var Cqn=Oe({...MU,source:he().optional().describe("Filter by execution source"),level:or([bF,At(bF)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),jqn=Lo(["timestamp"]).describe("Field to order by: 'timestamp'"),Tqn=Oe({field:jqn.default("timestamp").describe("Field to order by"),direction:NM.default("DESC").describe("Sort direction")}).describe("Order by configuration");Oe({filters:Cqn.optional().describe("Optional filters to apply"),pagination:IU.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Tqn.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");Oe({pagination:RU,logs:At(fyt)});var Zj=he().describe("Identifier of the scorer (e.g., relevance, accuracy)"),pyt=he().describe("Display name of the scorer"),hyt=he().describe("Version of the scorer"),rv=he().describe("How the score was produced (e.g., manual, automated, experiment)"),myt=Et().describe("Score value (range defined by scorer)"),gyt=he().describe("Explanation for the score"),vyt=Oe({scoreId:he().nullish().describe("Unique id for this score event"),timestamp:yk().describe("When the score was recorded"),traceId:DU.nullish().describe("Trace that anchors the scored target when available"),spanId:LU.nullish().describe("Span ID this score applies to"),scorerId:Zj,scorerName:pyt.nullish(),scorerVersion:hyt.nullish(),scoreSource:rv.nullish(),source:rv.nullish(),score:myt,reason:gyt.nullish(),...$U,scoreTraceId:he().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:ma(he(),Ja()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");Oe({scorerId:Zj,scorerName:pyt.optional(),scorerVersion:hyt.optional(),scoreSource:rv.optional(),source:rv.optional(),score:myt,reason:gyt.optional(),metadata:ma(he(),Ja()).optional().describe("Additional scorer-specific metadata"),experimentId:PU.optional(),scoreTraceId:he().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:Hj.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var Obe=vyt;Oe({score:Obe}).describe("Arguments for creating a score");Oe({score:Obe.omit({timestamp:!0})}).describe("Arguments for creating a score");Oe({success:Yo()}).describe("Response from creating a score");Oe({scores:At(Obe)}).describe("Arguments for batch recording scores");var AM=Oe({...MU,scorerId:or([he(),At(he())]).optional().describe("Filter by scorer ID(s)"),scoreSource:rv.optional().describe("Filter by how the score was produced"),source:rv.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),Nqn=Lo(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),Aqn=Oe({field:Nqn.default("timestamp").describe("Field to order by"),direction:NM.default("DESC").describe("Sort direction")}).describe("Order by configuration");Oe({filters:AM.optional(),pagination:IU.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Aqn.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");Oe({pagination:RU,scores:At(vyt)});Oe({scorerId:Zj,scoreSource:rv.optional(),aggregation:wv,filters:AM.optional(),comparePeriod:bbe.optional()}).describe("Arguments for getting a score aggregate");Oe(wbe);Oe({scorerId:Zj,scoreSource:rv.optional(),groupBy:Bk,aggregation:wv,filters:AM.optional()}).describe("Arguments for getting a score breakdown");Oe({groups:At(Oe({dimensions:Sbe,value:qj}))});Oe({scorerId:Zj,scoreSource:rv.optional(),interval:Fk,aggregation:wv,filters:AM.optional(),groupBy:Bk.optional()}).describe("Arguments for getting score time series");Oe({series:At(Oe({name:he().describe("Series name (scorer ID or group key)"),points:At(Oe({timestamp:Vj,value:qj}))}))});Oe({scorerId:Zj,scoreSource:rv.optional(),percentiles:xbe,interval:Fk,filters:AM.optional()}).describe("Arguments for getting score percentiles");Oe({series:At(Oe({percentile:kbe,points:At(Oe({timestamp:Vj,value:_be}))}))});var sv=he().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),Wj=he().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),yyt=or([Et(),he()]).describe("Feedback value (rating number or correction text)"),byt=he().describe("Additional comment or context"),xF=he().describe("User who provided the feedback");function Ebe(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};return typeof t.userId=="string"&&t.feedbackUserId==null&&(t.feedbackUserId=t.userId,delete t.userId),t}var zU=Oe({feedbackId:he().nullish().describe("Unique id for this feedback event"),timestamp:yk().describe("When the feedback was recorded"),traceId:DU.nullish().describe("Trace that anchors the feedback target when available"),spanId:LU.nullish().describe("Span ID this feedback applies to"),feedbackSource:sv.nullish(),source:sv.nullish(),feedbackType:Wj,value:yyt,comment:byt.nullish(),feedbackUserId:xF.nullish(),...$U,sourceId:he().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:ma(he(),Ja()).nullish().describe("User-defined metadata")}),Iqn=Oe(zU.shape).describe("Feedback record as stored in the database"),Rqn=Oe({feedbackSource:sv.optional(),source:sv.optional(),feedbackType:Wj,value:yyt,comment:byt.optional(),feedbackUserId:xF.optional(),userId:xF.optional(),metadata:ma(he(),Ja()).optional().describe("Additional feedback-specific metadata"),experimentId:PU.optional(),sourceId:he().optional().describe("ID of the source record this feedback is linked to")});Oe(Rqn.shape).describe("User-provided feedback input");Oe({feedback:bpe(Ebe,zU)}).describe("Arguments for creating feedback");Oe({feedback:zU.omit({timestamp:!0})}).describe("Arguments for creating feedback");Oe({success:Yo()}).describe("Response from creating feedback");Oe({feedbacks:At(bpe(Ebe,zU))}).describe("Arguments for batch recording feedback");var xyt=Oe({...MU,feedbackType:or([he(),At(he())]).optional().describe("Filter by feedback type(s)"),feedbackSource:sv.optional(),source:sv.optional(),feedbackUserId:xF.optional()}),FU=Oe(xyt.shape).describe("Filters for querying feedback"),Pqn=Lo(["timestamp"]).describe("Field to order by: 'timestamp'"),$qn=Oe({field:Pqn.default("timestamp").describe("Field to order by"),direction:NM.default("DESC").describe("Sort direction")}).describe("Order by configuration");Oe({filters:bpe(Ebe,xyt).optional().describe("Optional filters to apply"),pagination:IU.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:$qn.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");Oe({pagination:RU,feedback:At(Iqn)});Oe({feedbackType:Wj,feedbackSource:sv.optional(),aggregation:wv,filters:FU.optional(),comparePeriod:bbe.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");Oe(wbe);Oe({feedbackType:Wj,feedbackSource:sv.optional(),groupBy:Bk,aggregation:wv,filters:FU.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");Oe({groups:At(Oe({dimensions:Sbe,value:qj}))});Oe({feedbackType:Wj,feedbackSource:sv.optional(),interval:Fk,aggregation:wv,filters:FU.optional(),groupBy:Bk.optional()}).describe("Arguments for getting feedback time series over numeric values");Oe({series:At(Oe({name:he().describe("Series name (feedback type or group key)"),points:At(Oe({timestamp:Vj,value:qj}))}))});Oe({feedbackType:Wj,feedbackSource:sv.optional(),percentiles:xbe,interval:Fk,filters:FU.optional()}).describe("Arguments for getting feedback percentiles over numeric values");Oe({series:At(Oe({percentile:kbe,points:At(Oe({timestamp:Vj,value:_be}))}))});Lo(["counter","gauge","histogram"]);var wyt=he().describe("Metric name (e.g., mastra_agent_duration_ms)"),Syt=Et().describe("Metric value"),kyt=ma(he(),he()).describe("Metric labels for dimensional filtering"),_yt=he().describe("Model provider"),Oyt=he().describe("Model"),Mqn=Et().describe("Estimated cost"),Eyt=he().describe("Unit for the estimated cost (e.g., usd)"),Dqn=ma(he(),Ja()).nullish().describe("Structured costing metadata"),Cyt=Oe({metricId:he().nullish().describe("Unique id for this metric event"),timestamp:yk().describe("When the metric was recorded"),name:wyt,value:Syt,traceId:DU.nullish(),spanId:LU.nullish(),...$U,source:he().nullish().describe("Execution source"),provider:_yt.nullish(),model:Oyt.nullish(),estimatedCost:Mqn.nullish(),costUnit:Eyt.nullish(),costMetadata:Dqn.nullish(),labels:kyt.default({}),metadata:lyt.nullish()}).describe("Metric record as stored in the database");Oe({name:wyt,value:Syt,labels:kyt.optional()}).describe("User-provided metric input");var Lqn=Cyt;Oe({metrics:At(Lqn)}).describe("Arguments for batch recording metrics");Oe({type:wv,interval:Fk.optional(),groupBy:Bk.optional()}).describe("Metrics aggregation configuration");var IM=Oe({...MU,name:At(he()).nonempty().optional().describe("Filter by metric name(s)"),source:he().optional().describe("Filter by execution source"),provider:_yt.optional(),model:Oyt.optional(),costUnit:Eyt.optional(),labels:ma(he(),he()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),zqn=Lo(["timestamp"]).describe("Field to order by: 'timestamp'"),Fqn=Oe({field:zqn.default("timestamp").describe("Field to order by"),direction:NM.default("DESC").describe("Sort direction")}).describe("Order by configuration");Oe({filters:IM.optional(),pagination:IU.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Fqn.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing metrics");Oe({pagination:RU,metrics:At(Cyt)});var Bqn=["entityType","entityName","parentEntityType","parentEntityName","rootEntityType","rootEntityName","name","provider","model","environment","executionSource","serviceName"],Cbe=Lo(Bqn).optional().describe("Column to apply count_distinct over (required when aggregation is 'count_distinct'). Restricted to low/medium-cardinality categorical columns; ID columns are not allowed."),_C={check:e=>e.aggregation!=="count_distinct"||e.distinctColumn!==void 0,options:{message:"distinctColumn is required when aggregation is 'count_distinct'",path:["distinctColumn"]}};Oe({name:At(he()).nonempty().describe("Metric name(s) to aggregate"),aggregation:wv,distinctColumn:Cbe,filters:IM.optional(),comparePeriod:bbe.optional()}).refine(_C.check,_C.options).describe("Arguments for getting a metric aggregate");Oe({...wbe,estimatedCost:Et().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:he().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:Et().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:Et().nullable().optional().describe("Percentage change in estimated cost from comparison period")});Oe({name:At(he()).nonempty().describe("Metric name(s) to break down"),groupBy:Bk,aggregation:wv,distinctColumn:Cbe,filters:IM.optional(),limit:Et().int().positive().max(1e3).optional().describe("Maximum number of groups to return (server-side TopK). Required for high-cardinality groupBy."),orderDirection:NM.optional().describe("Sort direction for the aggregated value (defaults to 'DESC' at the storage layer; pairs with limit for top/bottom-N).")}).refine(_C.check,_C.options).describe("Arguments for getting a metric breakdown");Oe({groups:At(Oe({dimensions:Sbe,value:qj,estimatedCost:Et().nullable().optional().describe("Summed estimated cost for this group"),costUnit:he().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});Oe({name:At(he()).nonempty().describe("Metric name(s)"),interval:Fk,aggregation:wv,distinctColumn:Cbe,filters:IM.optional(),groupBy:Bk.optional()}).refine(_C.check,_C.options).describe("Arguments for getting metric time series");Oe({series:At(Oe({name:he().describe("Series name (metric name or group key)"),costUnit:he().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:At(Oe({timestamp:Vj,value:qj,estimatedCost:Et().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});Oe({name:he().describe("Metric name"),percentiles:xbe,interval:Fk,filters:IM.optional()}).describe("Arguments for getting metric percentiles");Oe({series:At(Oe({percentile:kbe,points:At(Oe({timestamp:Vj,value:_be}))}))});Oe({prefix:he().optional().describe("Filter metric names by prefix"),limit:Et().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");Oe({names:At(he()).describe("Distinct metric names")});Oe({metricName:he().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");Oe({keys:At(he()).describe("Distinct label keys for the metric")});Oe({metricName:he().describe("Metric name"),labelKey:he().describe("Label key to get values for"),prefix:he().optional().describe("Filter values by prefix"),limit:Et().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");Oe({values:At(he()).describe("Distinct label values")});Oe({}).describe("Arguments for getting entity types");Oe({entityTypes:At(Hj).describe("Distinct entity types")});Oe({entityType:Hj.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");Oe({names:At(he()).describe("Distinct entity names")});Oe({}).describe("Arguments for getting service names");Oe({serviceNames:At(he()).describe("Distinct service names")});Oe({}).describe("Arguments for getting environments");Oe({environments:At(he()).describe("Distinct environments")});Oe({entityType:Hj.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");Oe({tags:At(he()).describe("Distinct tags")});function jyt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=jyt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Tyt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=jyt(e))&&(r&&(r+=" "),r+=t);return r}const MLe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,DLe=Tyt,Uk=(e,t)=>n=>{var r;if(t?.variants==null)return DLe(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=n?.[u],f=a?.[u];if(d===null)return null;const p=MLe(d)||MLe(f);return s[u][p]}),l=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...a,...l}[g]):{...a,...l}[g]===v})?[...u,f,p]:u},[]);return DLe(e,i,c,n?.class,n?.className)},Uqn=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},qqn=(e,t)=>({classGroupId:e,validator:t}),Nyt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wF="-",LLe=[],Vqn="arbitrary..",Hqn=e=>{const t=Wqn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Zqn(i);const l=i.split(wF),c=l[0]===""&&l.length>1?1:0;return Ayt(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],u=n[i];return c?u?Uqn(u,c):c:u||LLe}return n[i]||LLe}}},Ayt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=Ayt(e,t+1,a);if(u)return u}const i=n.validators;if(i===null)return;const l=t===0?e.join(wF):e.slice(t).join(wF),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},Zqn=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Vqn+r:void 0})(),Wqn=e=>{const{theme:t,classGroups:n}=e;return Qqn(n,t)},Qqn=(e,t)=>{const n=Nyt();for(const r in e){const s=e[r];jbe(s,n,r,t)}return n},jbe=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];Gqn(i,t,n,r)}},Gqn=(e,t,n,r)=>{if(typeof e=="string"){Yqn(e,t,n);return}if(typeof e=="function"){Xqn(e,t,n,r);return}Kqn(e,t,n,r)},Yqn=(e,t,n)=>{const r=e===""?t:Iyt(t,e);r.classGroupId=n},Xqn=(e,t,n,r)=>{if(Jqn(e)){jbe(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(qqn(n,e))},Kqn=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];jbe(c,Iyt(t,l),n,r)}},Iyt=(e,t)=>{let n=e;const r=t.split(wF),s=r.length;for(let a=0;a<s;a++){const i=r[a];let l=n.nextPart.get(i);l||(l=Nyt(),n.nextPart.set(i,l)),n=l}return n},Jqn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,eVn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,i)=>{n[a]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return s(a,i),i},set(a,i){a in n?n[a]=i:s(a,i)}}},gue="!",zLe=":",tVn=[],FLe=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),nVn=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=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===zLe){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 p=f,h=!1;f.endsWith(gue)?(p=f.slice(0,-1),h=!0):f.startsWith(gue)&&(p=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return FLe(a,h,p,m)};if(t){const s=t+zLe,a=r;r=i=>i.startsWith(s)?a(i.slice(s.length)):FLe(tVn,!1,i,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},rVn=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const i=n[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},sVn=e=>({cache:eVn(e.cacheSize),parseClassName:nVn(e),sortModifiers:rVn(e),...Hqn(e)}),aVn=/\s+/,iVn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(aVn);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!g,x=r(v?m.substring(0,g):m);if(!x){if(!v){c=d+(c.length>0?" "+c:c);continue}if(x=r(m),!x){c=d+(c.length>0?" "+c:c);continue}v=!1}const w=p.length===0?"":p.length===1?p[0]:a(p).join(":"),S=h?w+gue:w,_=S+x;if(i.indexOf(_)>-1)continue;i.push(_);const O=s(x,v);for(let E=0;E<O.length;++E){const T=O[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},oVn=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Ryt(n))&&(s&&(s+=" "),s+=r);return s},Ryt=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ryt(e[r]))&&(n&&(n+=" "),n+=t);return n},BLe=(e,...t)=>{let n,r,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=sVn(u),r=n.cache.get,s=n.cache.set,a=l,l(c)},l=c=>{const u=r(c);if(u)return u;const d=iVn(c,n);return s(c,d),d};return a=i,(...c)=>a(oVn(...c))},lVn=[],El=e=>{const t=n=>n[e]||lVn;return t.isThemeGetter=!0,t},Pyt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$yt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cVn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,uVn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dVn=/\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$/,fVn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pVn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hVn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lx=e=>cVn.test(e),ss=e=>!!e&&!Number.isNaN(Number(e)),cx=e=>!!e&&Number.isInteger(Number(e)),rY=e=>e.endsWith("%")&&ss(e.slice(0,-1)),Kv=e=>uVn.test(e),Myt=()=>!0,mVn=e=>dVn.test(e)&&!fVn.test(e),Tbe=()=>!1,gVn=e=>pVn.test(e),vVn=e=>hVn.test(e),yVn=e=>!An(e)&&!Dn(e),bVn=e=>fw(e,zyt,Tbe),An=e=>Pyt.test(e),Kw=e=>fw(e,Fyt,mVn),ULe=e=>fw(e,CVn,ss),xVn=e=>fw(e,Uyt,Myt),wVn=e=>fw(e,Byt,Tbe),qLe=e=>fw(e,Dyt,Tbe),SVn=e=>fw(e,Lyt,vVn),T4=e=>fw(e,qyt,gVn),Dn=e=>$yt.test(e),BN=e=>qk(e,Fyt),kVn=e=>qk(e,Byt),VLe=e=>qk(e,Dyt),_Vn=e=>qk(e,zyt),OVn=e=>qk(e,Lyt),N4=e=>qk(e,qyt,!0),EVn=e=>qk(e,Uyt,!0),fw=(e,t,n)=>{const r=Pyt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qk=(e,t,n=!1)=>{const r=$yt.exec(e);return r?r[1]?t(r[1]):n:!1},Dyt=e=>e==="position"||e==="percentage",Lyt=e=>e==="image"||e==="url",zyt=e=>e==="length"||e==="size"||e==="bg-size",Fyt=e=>e==="length",CVn=e=>e==="number",Byt=e=>e==="family-name",Uyt=e=>e==="number"||e==="weight",qyt=e=>e==="shadow",HLe=()=>{const e=El("color"),t=El("font"),n=El("text"),r=El("font-weight"),s=El("tracking"),a=El("leading"),i=El("breakpoint"),l=El("container"),c=El("spacing"),u=El("radius"),d=El("shadow"),f=El("inset-shadow"),p=El("text-shadow"),h=El("drop-shadow"),m=El("blur"),g=El("perspective"),v=El("aspect"),x=El("ease"),w=El("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[..._(),Dn,An],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[Dn,An,c],N=()=>[lx,"full","auto",...j()],I=()=>[cx,"none","subgrid",Dn,An],P=()=>["auto",{span:["full",cx,Dn,An]},cx,Dn,An],R=()=>[cx,"auto",Dn,An],B=()=>["auto","min","max","fr",Dn,An],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],z=()=>[lx,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],q=()=>[lx,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Z=()=>[lx,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],D=()=>[e,Dn,An],G=()=>[..._(),VLe,qLe,{position:[Dn,An]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",_Vn,bVn,{size:[Dn,An]}],W=()=>[rY,BN,Kw],Q=()=>["","none","full",u,Dn,An],J=()=>["",ss,BN,Kw],ae=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[ss,rY,VLe,qLe],ie=()=>["","none",m,Dn,An],pe=()=>["none",ss,Dn,An],X=()=>["none",ss,Dn,An],ne=()=>[ss,Dn,An],le=()=>[lx,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kv],breakpoint:[Kv],color:[Myt],container:[Kv],"drop-shadow":[Kv],ease:["in","out","in-out"],font:[yVn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kv],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kv],shadow:[Kv],spacing:["px",ss],text:[Kv],"text-shadow":[Kv],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",lx,An,Dn,v]}],container:["container"],columns:[{columns:[ss,An,Dn,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:O()}],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:[cx,"auto",Dn,An]}],basis:[{basis:[lx,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ss,lx,"auto","initial","none",An]}],grow:[{grow:["",ss,Dn,An]}],shrink:[{shrink:["",ss,Dn,An]}],order:[{order:[cx,"first","last","none",Dn,An]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,BN,Kw]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,EVn,xVn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rY,An]}],"font-family":[{font:[kVn,wVn,t]}],"font-features":[{"font-features":[An]}],"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,Dn,An]}],"line-clamp":[{"line-clamp":[ss,"none",Dn,ULe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",Dn,An]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Dn,An]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[ss,"from-font","auto",Dn,Kw]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[ss,"auto",Dn,An]}],"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",Dn,An]}],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",Dn,An]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cx,Dn,An],radial:["",Dn,An],conic:[cx,Dn,An]},OVn,SVn]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ss,Dn,An]}],"outline-w":[{outline:["",ss,BN,Kw]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,N4,T4]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,N4,T4]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[ss,Kw]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",p,N4,T4]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[ss,Dn,An]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ss]}],"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":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"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":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"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":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"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":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"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":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"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":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"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":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Dn,An]}],"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":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[ss]}],"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":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Dn,An]}],filter:[{filter:["","none",Dn,An]}],blur:[{blur:ie()}],brightness:[{brightness:[ss,Dn,An]}],contrast:[{contrast:[ss,Dn,An]}],"drop-shadow":[{"drop-shadow":["","none",h,N4,T4]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",ss,Dn,An]}],"hue-rotate":[{"hue-rotate":[ss,Dn,An]}],invert:[{invert:["",ss,Dn,An]}],saturate:[{saturate:[ss,Dn,An]}],sepia:[{sepia:["",ss,Dn,An]}],"backdrop-filter":[{"backdrop-filter":["","none",Dn,An]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[ss,Dn,An]}],"backdrop-contrast":[{"backdrop-contrast":[ss,Dn,An]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ss,Dn,An]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ss,Dn,An]}],"backdrop-invert":[{"backdrop-invert":["",ss,Dn,An]}],"backdrop-opacity":[{"backdrop-opacity":[ss,Dn,An]}],"backdrop-saturate":[{"backdrop-saturate":[ss,Dn,An]}],"backdrop-sepia":[{"backdrop-sepia":["",ss,Dn,An]}],"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",Dn,An]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ss,"initial",Dn,An]}],ease:[{ease:["linear","initial",x,Dn,An]}],delay:[{delay:[ss,Dn,An]}],animate:[{animate:["none",w,Dn,An]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Dn,An]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[Dn,An,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"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:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",Dn,An]}],"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",Dn,An]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[ss,BN,Kw,ULe]}],stroke:[{stroke:["none",...D()]}],"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"]}},jVn=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(TA(e,"cacheSize",t),TA(e,"prefix",n),TA(e,"experimentalParseClassName",r),A4(e.theme,a.theme),A4(e.classGroups,a.classGroups),A4(e.conflictingClassGroups,a.conflictingClassGroups),A4(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),TA(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),I4(e.theme,s.theme),I4(e.classGroups,s.classGroups),I4(e.conflictingClassGroups,s.conflictingClassGroups),I4(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Vyt(e,s,"orderSensitiveModifiers"),e),TA=(e,t,n)=>{n!==void 0&&(e[t]=n)},A4=(e,t)=>{if(t)for(const n in t)TA(e,n,t[n])},I4=(e,t)=>{if(t)for(const n in t)Vyt(e,t,n)},Vyt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},TVn=(e,...t)=>typeof e=="function"?BLe(HLe,e,...t):BLe(()=>jVn(HLe(),e),...t),NVn=Object.keys({...ky,...jJt}),AVn=Object.keys(PJt),IVn=Object.keys(TJt),RVn=Object.keys(NJt),PVn=Object.keys(CJt),Jw=Object.keys(RJt),$Vn=Object.keys(AJt).concat(Object.keys(IJt)),MVn=TVn({extend:{theme:{color:NVn,spacing:AVn,radius:PVn,leading:RVn,shadow:$Vn},classGroups:{"font-size":[{text:IVn}],h:[{h:Jw}],w:[{w:Jw}],size:[{size:Jw}],"min-h":[{"min-h":Jw}],"min-w":[{"min-w":Jw}],"max-h":[{"max-h":Jw}],"max-w":[{"max-w":Jw}]}}});function Y(...e){return MVn(Tyt(e))}const Gd=VWt,nr=HWt,rr=ZWt,Kn=b.forwardRef(({className:e,sideOffset:t=4,children:n,...r},s)=>o.jsx(WWt,{children:o.jsxs(pKe,{ref:s,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r,children:[n,o.jsx(QWt,{className:"fill-surface3"})]})}));Kn.displayName=pKe.displayName;const DVn={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"},Ne=({children:e,className:t,size:n="default",...r})=>o.jsx("span",{className:Y("block",DVn[n],t),...r,children:e}),Hc={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},BU="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",LVn="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",zVn="rounded-md",Hyt="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",Nbe="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",Abe="disabled:opacity-50 disabled:cursor-not-allowed",R4=Y("gap-[.75em] rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),Qj=Uk(Y("inline-flex items-center justify-center leading-0 cursor-pointer","transition-all duration-normal ease-out-custom",Abe,Nbe),{variants:{variant:{default:"bg-surface3 border-2 border-border1 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",primary:"bg-surface4 border-2 border-border2 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",cta:"bg-accent1 border-2 border-transparent hover:bg-accent1/90 hover:shadow-glow-accent1 disabled:hover:shadow-none text-surface1 font-medium",ghost:"bg-transparent border-2 border-transparent hover:bg-surface4 hover:text-neutral6 active:bg-surface5 text-neutral4",outline:"bg-transparent border-2 border-border1 hover:bg-surface3 hover:text-neutral6 active:bg-surface4 text-neutral5",link:"inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"},size:{sm:Y(`${Hc.sm} text-ui-sm px-[.75em]`,R4),md:Y(`${Hc.md} text-ui-md px-[.75em]`,R4),default:Y(`${Hc.default} text-ui-md px-[.85em]`,R4),lg:Y(`${Hc.lg} text-ui-lg px-[1em]`,R4),"icon-sm":`${Hc.sm} w-form-sm rounded-md`,"icon-md":`${Hc.md} w-form-md rounded-md`,"icon-lg":`${Hc.lg} w-form-lg rounded-md`}},defaultVariants:{variant:"default",size:"default"}}),FVn={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function Zyt(e){const t=[];return Te.Children.forEach(e,n=>{Te.isValidElement(n)&&n.type===Te.Fragment?t.push(...Zyt(n.props.children)):t.push(n)}),t}function BVn(e){const t=Zyt(e);return t.length>0&&t.every(n=>Te.isValidElement(n))}function UVn(e){return typeof e=="string"&&e.startsWith("icon-")}const ce=Te.forwardRef(({className:e,as:t,size:n,variant:r="default",disabled:s,children:a,tooltip:i,"aria-label":l,...c},u)=>{const d=t||"button",f=UVn(n),p=n??"default",h=!f&&BVn(a),m=l??((f||h)&&typeof i=="string"?i:void 0),g=f?o.jsx(Ne,{size:FVn[n],children:a}):a,v=o.jsx(d,{ref:u,disabled:s,"aria-label":m,className:Y(Qj({variant:r,size:p}),h&&"[&>svg]:opacity-75",e),...c,children:g});return i?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:v}),o.jsx(Kn,{children:i})]}):v});ce.displayName="Button";const Kr=Te.forwardRef(({tooltipContent:e,...t},n)=>o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(ce,{ref:n,...t})}),e&&o.jsx(Kn,{children:e})]}));Kr.displayName="ButtonWithTooltip";const _r={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"},pw={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},Wyt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),SF=({children:e,as:t="a",href:n,className:r,prefetch:s,to:a})=>o.jsx(t,{href:n,prefetch:s,to:a,className:Y("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",_r.colors,r),children:e}),Qyt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),kF=({children:e,isActive:t,className:n})=>o.jsx("li",{className:Y("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",_r.colors,"hover:bg-surface3",t&&"bg-accent1Dark",n),children:e}),Gyt=({onClick:e})=>o.jsx(ce,{variant:"ghost",className:Y("shrink-0 opacity-0",_r.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(Ne,{children:o.jsx(Uu,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),qVn={"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"},VVn={mono:"font-mono"},me=({as:e="p",className:t,variant:n="ui-md",font:r,...s})=>o.jsx(e,{className:Y(qVn[n],r&&VVn[r],t),...s}),HVn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},Yyt=({src:e,name:t,size:n="sm",interactive:r=!1})=>o.jsx("div",{className:Y(HVn[n],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",_r.all,r&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?o.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):o.jsx(me,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),ZVn={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"},WVn={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},kt=({icon:e,variant:t="default",className:n,children:r,...s})=>o.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",_r.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":ZVn[t],n),...s,children:[e&&o.jsx("span",{className:WVn[t],children:o.jsx(Ne,{children:e})}),r]}),QVn=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"})}),wi=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),Fn=({className:e,as:t,isCurrent:n,action:r,...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":n?"page":void 0,className:Y("text-ui-md leading-ui-md flex items-center gap-2",_r.colors,n?"text-white":"text-neutral3 hover:text-neutral5",e),...s}),r]}),!n&&o.jsx("li",{role:"separator",className:"flex h-full items-center",children:o.jsx(Ne,{className:Y("text-neutral2",_r.colors),children:o.jsx(QVn,{})})})]})};function GVn(e,t=5){if(!e?.properties)return[];const n=[];function r(s,a,i){if(i>t)return;const l=Array.isArray(s.type)?s.type.join(" | "):s.type;if(n.push({path:a,label:a,description:s.description??s.title,type:l}),s.properties)for(const[c,u]of Object.entries(s.properties))r(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))r(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))r(a,s,1);return n}function YVn(e){const t=GVn(e);return Ptt({override:[XVn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function XVn(e){return t=>{const r=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!r)return null;const s=r[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,p)=>{const g=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:l,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const KVn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,JVn=dn.mark({class:"cm-variable-highlight"}),ZLe=new Qet({regexp:KVn,decoration:()=>JVn}),eHn=Gi.fromClass(class{decorations;constructor(e){this.decorations=ZLe.createDeco(e)}update(e){this.decorations=ZLe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),tHn=eHn,Xyt=({className:e,toastOptions:t,...n})=>o.jsx(ndn,{...n,closeButton:!0,richColors:!0,className:Y("mastra-toaster",e),toastOptions:{duration:5e3,...t}}),UU=(e,t)=>Array.isArray(e)?e.map(t):t(e),ze=(e,t={})=>{if(Array.isArray(e))return e.map(n=>wm(n,t));if(Te.isValidElement(e)||typeof e=="string")return wm(e,t);throw new Error("Invalid message type")};ze.success=(e,t={})=>UU(e,n=>wm.success(n,t));ze.error=(e,t={})=>UU(e,n=>wm.error(n,t));ze.warning=(e,t={})=>UU(e,n=>wm.warning(n,t));ze.info=(e,t={})=>UU(e,n=>wm.info(n,t));ze.custom=(e,t={})=>wm(e,t);ze.dismiss=e=>wm.dismiss(e);ze.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:s,onError:a,options:i={}})=>wm.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),n),error:l=>(a?.(l),r||(l instanceof Error?l.message:"Error...")),...i});function np({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=b.useState(!1),s=b.useRef(null),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{ze.success(t),r(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{ze.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:a}}function _a({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=np({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(ce,{onClick:c,type:"button",size:r,className:s,"aria-label":a?"Copied!":n,children:a?o.jsx(ub,{}):o.jsx(fJe,{})})}),o.jsx(Kn,{children:a?"Copied!":n})]})}const nHn="mastra-theme",rHn="mastra-playground-store",vue=e=>e==="dark"||e==="light"||e==="system",sHn=e=>{try{const t=e.getItem(rHn);if(!t)return;const r=JSON.parse(t)?.state?.theme;return vue(r)?r:void 0}catch{return}},aHn=(e=nHn)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(vue(t))return t;const n=sHn(window.localStorage);return n?(window.localStorage.setItem(e,n),n):null}catch{return null}},set(t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},subscribe(t){if(typeof window>"u")return()=>{};const n=r=>{if(r.key===e){if(r.newValue===null){t(null);return}vue(r.newValue)&&t(r.newValue)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)}}),Kyt=b.createContext(null),Jyt="(prefers-color-scheme: dark)",iHn=typeof window>"u"?b.useEffect:b.useLayoutEffect,ebt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(Jyt).matches?"dark":"light",tbt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(Jyt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},oHn=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},nbt=({children:e,defaultTheme:t="system",storageKey:n,target:r})=>{const s=b.useMemo(()=>aHn(n),[n]),a=b.useRef(null),[i,l]=b.useState(()=>s.get()??t),c=b.useSyncExternalStore(tbt,ebt,()=>"dark");b.useEffect(()=>s.subscribe(f=>l(f??t)),[s,t]);const u=i==="system"?c:i;iHn(()=>{const f=r??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&oHn(f,u),a.current=f},[u,r]);const d=b.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{l(f),s.set(f)}}),[i,u,c,s]);return o.jsx(Kyt.Provider,{value:d,children:e})},lHn=()=>{},Gj=()=>{const e=b.useContext(Kyt),t=b.useSyncExternalStore(tbt,ebt,()=>"dark");return b.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:lHn},[e,t])};function cHn(){const e=kj({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=vt.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 uHn(){const e=vt.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=Im.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,tw(t)]}const kb=()=>{const e=Gj().resolvedTheme==="dark";return b.useMemo(()=>e?cHn():uHn(),[e])},fs=b.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:l,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...p},h)=>{const m=kb(),g=e?JSON.stringify(e,null,2):t??"",v=b.useMemo(()=>{const x=[];return a==="json"?x.push(Bf):a==="markdown"&&(x.push(fme({base:C1,codeLanguages:nrt})),x.push(vt.lineWrapping)),i&&a==="markdown"&&x.push(tHn),c&&a==="markdown"&&x.push(YVn(c)),f===!1&&x.push(es.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...p,children:[r&&o.jsx(_a,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(eu,{ref:h,value:g,theme:m,extensions:v,onChange:n,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function dHn(e,t){const{codeToTokens:n,bundledLanguages:r}=await tt(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-BZ5mhtuX.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in r))return null;const{tokens:s}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function ki({iconSlot:e,titleSlot:t,descriptionSlot:n,actionSlot:r,className:s,as:a="h3"}){return o.jsxs("div",{className:Y("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&o.jsx("div",{className:"mb-4",children:e}),o.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),n&&o.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:n}),r&&o.jsx("div",{className:"mt-5",children:r})]})}const Ma=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"})]}),fHn=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"})]}),Ibe=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"})]}),Rbe=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"})]}),hw=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"})}),rbt=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)"})})})]}),sbt=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)"})})})]}),pHn=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"})]}),qU=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"})}),Pbe=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"})}),co=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"})}),Yj=e=>o.jsx(OJt,{...e}),uo=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),Gl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),o.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),VU=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 om(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 abt=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)"})})})]}),hHn=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"})}),mHn=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"})})}),ibt=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}})}),gHn=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"})]})]}),vHn=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"})})]}),yHn=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"})}),bHn=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"})]}),xHn=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"})})})]}),WLe=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"})}),wHn=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"})]})}),pp=({children:e,className:t,onClick:n})=>o.jsx("div",{tabIndex:n?0:void 0,onKeyDown:r=>{n&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n?.())},className:Y("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",n&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:n,children:e}),obt=({children:e,className:t,style:n})=>o.jsx(Ne,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:n,children:e}),hp=({children:e,className:t})=>o.jsx(me,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),mp=({children:e,className:t})=>o.jsx(me,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),gp=({children:e,className:t})=>o.jsx("div",{className:Y("flex-1 w-full",t),children:e});function Js({resource:e,title:t,description:n,actionSlot:r,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(ki,{className:s,iconSlot:o.jsx(Ne,{size:"lg",className:"text-neutral3",children:o.jsx(cJt,{})}),titleSlot:t??a,descriptionSlot:n??i,actionSlot:r})}function ca({title:e,description:t,className:n}){const[r,s]=b.useState(!1),a=Ze(),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}),p=`${l}${d}/auth/sso/login?${f}`,h=await fetch(p,{credentials:"include",headers:{"Content-Type":"application/json"}});if(h.ok){const m=await h.json();window.location.href=m.url}}finally{s(!1)}},[a]);return o.jsx(ki,{className:n,iconSlot:o.jsx(Ne,{size:"lg",className:"text-neutral3",children:o.jsx(eJt,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(ce,{variant:"default",onClick:i,disabled:r,children:r?"Redirecting...":"Log in"})})}const Br=({children:e,border:t=!0,className:n})=>o.jsx("header",{className:Y("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},n),children:e}),$d=({children:e})=>o.jsx(me,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),Ku=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),SHn=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),t0=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"})}),kHn={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},_Hn=({className:e,children:t,size:n="default",style:r})=>o.jsx("table",{className:Y("w-full",kHn[n],e),style:r,children:t}),OHn=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Y("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),EHn=({className:e,children:t,...n})=>o.jsx("th",{className:Y("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...n,children:t}),CHn=({className:e,children:t,...n})=>o.jsx("tbody",{className:Y("",e),...n,children:t}),jHn=b.forwardRef(({className:e,children:t,selected:n=!1,style:r,onClick:s,isActive:a=!1,...i},l)=>{const c=b.useRef(null);b.useEffect(()=>{l&&(typeof l=="function"?l(c.current):l.current=c.current)},[l]),b.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return o.jsx("tr",{className:Y("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-hidden focus:ring-1 focus:ring-inset focus:ring-accent1/50",n&&"bg-surface4",s&&"cursor-pointer",e),style:r,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),THn=({className:e,children:t,...n})=>o.jsx("td",{className:Y("text-neutral5 first:pl-3 last:pr-3",e),...n,children:o.jsx("div",{className:Y("flex h-full w-full shrink-0 items-center"),children:t})}),NHn=Uk(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","min-h-[80px] resize-y"),{variants:{variant:{default:Y(Hyt,Nbe,Abe),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"}}),Kc=b.forwardRef(({className:e,size:t,testId:n,variant:r,error:s,...a},i)=>o.jsx("textarea",{className:Y(NHn({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:i,"aria-invalid":s,...a}));Kc.displayName="Textarea";const AHn=hfn,IHn=mfn,lbt=gfn;function Ht({open:e,onOpenChange:t,children:n}){return o.jsx(AHn,{open:e,onOpenChange:t,children:n})}const $be=b.forwardRef(({className:e,...t},n)=>o.jsx($st,{ref:n,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));$be.displayName=$st.displayName;const cbt=b.forwardRef(({className:e,...t},n)=>o.jsxs(lbt,{children:[o.jsx($be,{}),o.jsx(Mst,{ref:n,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...t})]}));cbt.displayName=Mst.displayName;const ubt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});ubt.displayName="AlertDialogHeader";const dbt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});dbt.displayName="AlertDialogFooter";const fbt=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});fbt.displayName="AlertDialogBody";const pbt=b.forwardRef(({className:e,...t},n)=>o.jsx(zst,{ref:n,className:Y("text-ui-md font-medium",e),...t}));pbt.displayName=zst.displayName;const hbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Fst,{ref:n,className:Y("text-ui-sm text-neutral3",e),...t}));hbt.displayName=Fst.displayName;const mbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Dst,{ref:n,className:Y(Qj({variant:"primary",size:"default"}),e),...t}));mbt.displayName=Dst.displayName;const gbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Lst,{ref:n,className:Y(Qj({variant:"default",size:"default"}),e),...t}));gbt.displayName=Lst.displayName;Ht.Trigger=IHn;Ht.Portal=lbt;Ht.Overlay=$be;Ht.Content=cbt;Ht.Header=ubt;Ht.Footer=dbt;Ht.Body=fbt;Ht.Title=pbt;Ht.Description=hbt;Ht.Action=mbt;Ht.Cancel=gbt;const Di=b.forwardRef(({className:e,...t},n)=>o.jsx(Eme,{ref:n,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",_r.all,"hover:border-neutral5 hover:shadow-md",BU,"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(Vst,{className:Y("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(ub,{className:"h-3.5 w-3.5 stroke-3"})})}));Di.displayName=Eme.displayName;const Om=_fn,yh=Te.forwardRef(({className:e,children:t,...n},r)=>o.jsx(jme,{ref:r,className:Y("-outline-offset-2",_r.colors,pw.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...n,children:t}));yh.displayName=jme.displayName;const bh=Te.forwardRef(({className:e,children:t,...n},r)=>o.jsx(Nme,{ref:r,className:Y("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...n,children:t}));bh.displayName=Nme.displayName;const Nr={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:Y("min-w-(--anchor-width) w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-(--transform-origin)","transition-[transform,scale,opacity] duration-150 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0"),positioner:"z-50 pointer-events-auto",searchContainer:Y("flex items-center border-b border-border1 px-3 py-2",_r.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",_r.colors),searchInput:Y("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",_r.colors),empty:"not-empty:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:Y("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",_r.colors,"data-highlighted:bg-surface5 data-highlighted:text-neutral5"),itemSelected:"data-selected:bg-accent1Dark data-selected:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:Y("h-4 w-4 text-accent1",_r.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 jc({options:e,value:t,onValueChange:n,placeholder:r="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="default",open:d,onOpenChange:f,container:p,error:h}){const m=e.find(v=>v.value===t)??null,g=v=>{v&&n?.(v.value)};return o.jsxs("div",{className:Nr.root,children:[o.jsxs(Wat,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(tit,{className:Y(Qj({variant:c,size:u}),Nr.trigger,h&&Nr.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(tmn,{placeholder:r})]}),o.jsx($$,{className:Nr.chevron})]}),o.jsx(ait,{container:p,children:o.jsx(lit,{align:"start",sideOffset:4,className:Nr.positioner,children:o.jsxs(cit,{className:Nr.popup,children:[o.jsxs("div",{className:Nr.searchContainer,children:[o.jsx(WE,{className:Nr.searchIcon}),o.jsx(eit,{className:Nr.searchInput,placeholder:s})]}),o.jsx(hit,{className:Nr.empty,children:a}),o.jsx(rit,{className:Nr.list,children:v=>o.jsxs(pit,{value:v,className:Y(Nr.item,Nr.itemSelected),children:[o.jsx("span",{className:Nr.checkContainer,children:o.jsx(Umn,{children:o.jsx(ub,{className:Nr.checkIcon})})}),o.jsxs("span",{className:Nr.optionContent,children:[v.start,o.jsxs("span",{className:Nr.optionText,children:[o.jsx("span",{className:Nr.optionLabel,children:v.label}),v.description&&o.jsx("span",{className:Nr.optionDescription,children:v.description})]}),v.end?o.jsx("div",{className:Nr.optionEnd,children:v.end}):null]})]},v.value)})]})})})]}),h&&o.jsx("span",{className:Nr.error,children:h})]})}function vbt({options:e,value:t=[],onValueChange:n,placeholder:r="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:p,error:h}){const m=e.filter(x=>t.includes(x.value)),g=x=>{x&&n?.(x.map(w=>w.value))},v=m.length===0?r:`${m.length} selected`;return o.jsxs("div",{className:Nr.root,children:[o.jsxs(Wat,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(tit,{className:Y(Qj({variant:c,size:u}),Nr.trigger,h&&Nr.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&Nr.placeholder),children:v}),o.jsx($$,{className:Nr.chevron})]}),o.jsx(ait,{container:p,children:o.jsx(lit,{align:"start",sideOffset:4,className:Nr.positioner,children:o.jsxs(cit,{className:Nr.popup,children:[o.jsxs("div",{className:Nr.searchContainer,children:[o.jsx(WE,{className:Nr.searchIcon}),o.jsx(eit,{className:Nr.searchInput,placeholder:s})]}),o.jsx(hit,{className:Nr.empty,children:a}),o.jsx(rit,{className:Nr.list,children:x=>{const w=t.includes(x.value);return o.jsxs(pit,{value:x,className:Nr.item,children:[o.jsx("span",{className:Y(Nr.checkbox,w?Nr.checkboxSelected:Nr.checkboxUnselected),children:w&&o.jsx(ub,{className:Nr.checkboxIcon})}),o.jsxs("span",{className:Nr.optionContent,children:[x.start,o.jsxs("span",{className:Nr.optionText,children:[o.jsx("span",{className:Nr.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:Nr.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:Nr.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),h&&o.jsx("span",{className:Nr.error,children:h})]})}const $r=J8,ybt=wst,RHn=eB,PHn=Q$,bbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Z$,{ref:n,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));bbt.displayName=Z$.displayName;const Ar=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(RHn,{children:[o.jsx(bbt,{}),o.jsxs(W$,{ref:r,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...n,children:[t,o.jsx(Q$,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:o.jsx(Uu,{})})})]})]}));Ar.displayName=W$.displayName;const Mr=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Mr.displayName="DialogHeader";const rp=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});rp.displayName="DialogFooter";const ts=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});ts.displayName="DialogBody";const Ir=b.forwardRef(({className:e,...t},n)=>o.jsx(tB,{ref:n,className:Y("text-ui-md font-medium",e),...t}));Ir.displayName=tB.displayName;const fa=b.forwardRef(({className:e,...t},n)=>o.jsx(nB,{ref:n,className:Y("sr-only",e),...t}));fa.displayName=nB.displayName;const xbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd,{ref:n,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));xbt.displayName=Zd.displayName;const $Hn=({children:e,title:t="Command Palette",description:n="Search for commands and actions",...r})=>{const s=b.useCallback((i,l)=>{const c=i.toLowerCase();return l.toLowerCase().split(/\s+/).filter(Boolean).every(p=>c.includes(p))?1:0},[]),a=b.useCallback(i=>{i.stopPropagation()},[]);return o.jsx($r,{...r,children:o.jsxs(Ar,{className:"overflow-hidden p-0",children:[o.jsx(Ir,{className:"sr-only",children:t}),o.jsx(fa,{className:"sr-only",children:n}),o.jsx(xbt,{filter:s,onKeyDown:a,className:Y("**:[[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3","[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2","[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5","**:[[cmdk-input]]:h-12","**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3","[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"),children:e})]})})},wbt=b.forwardRef(({className:e,...t},n)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",_r.colors),"cmdk-input-wrapper":"",children:[o.jsx(WE,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",_r.colors)}),o.jsx(Zd.Input,{ref:n,className:Y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",_r.colors,e),...t})]}));wbt.displayName=Zd.Input.displayName;const Sbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd.List,{ref:n,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Sbt.displayName=Zd.List.displayName;const kbt=b.forwardRef((e,t)=>o.jsx(Zd.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));kbt.displayName=Zd.Empty.displayName;const vx=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd.Group,{ref:n,className:Y("overflow-hidden p-1 text-neutral5","**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3",e),...t}));vx.displayName=Zd.Group.displayName;const gS=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd.Separator,{ref:n,className:Y("-mx-1 h-px bg-border1",e),...t}));gS.displayName=Zd.Separator.displayName;const Cl=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd.Item,{ref:n,className:Y("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",_r.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}));Cl.displayName=Zd.Item.displayName;const _bt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});_bt.displayName="CommandShortcut";function Obt({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const MHn=zvn,DHn=Fvn,LHn=rM,zHn=qvn,FHn=Bvn,Mbe=Y("relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"),Ebt=b.forwardRef(({className:e,children:t,...n},r)=>o.jsx(vot,{ref:r,className:Y("cursor-pointer",e),...n,children:t}));Ebt.displayName=vot.displayName;const Cbt=b.forwardRef(({className:e,inset:t,children:n,...r},s)=>o.jsxs(_ot,{ref:s,className:Y(Mbe,"data-[state=open]:bg-surface4",t&&"pl-8",e),...r,children:[n,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(ahe,{className:"-rotate-90 opacity-50"})})]}));Cbt.displayName=_ot.displayName;const jbt=b.forwardRef(({className:e,...t},n)=>o.jsx(rM,{children:o.jsx(mB,{ref:n,className:Y("bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...t})}));jbt.displayName=mB.displayName;const Tbt=b.forwardRef(({className:e,container:t,sideOffset:n=8,...r},s)=>o.jsx(rM,{container:t,children:o.jsx(yot,{ref:s,sideOffset:n,className:Y("bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...r})}));Tbt.displayName=yot.displayName;const Nbt=b.forwardRef(({className:e,...t},n)=>o.jsx(xot,{ref:n,className:Y(Mbe,e),...t}));Nbt.displayName=xot.displayName;const Abt=b.forwardRef(({className:e,children:t,checked:n,...r},s)=>o.jsxs(wot,{ref:s,className:Y(Mbe,"w-full gap-4 px-2",e),checked:n,...r,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:n&&o.jsx(ub,{})}),t]}));Abt.displayName=wot.displayName;const Ibt=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Sot,{ref:r,className:Y("relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Uvn,{children:o.jsx(dJe,{className:"h-2 w-2 fill-current"})})}),t]}));Ibt.displayName=Sot.displayName;const Rbt=b.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(bot,{ref:r,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Rbt.displayName=bot.displayName;const Pbt=b.forwardRef(({className:e,...t},n)=>o.jsx(kot,{ref:n,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));Pbt.displayName=kot.displayName;const $bt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});$bt.displayName="DropdownMenuShortcut";function St({open:e,onOpenChange:t,children:n,modal:r}){return o.jsx(MHn,{modal:r,open:e,onOpenChange:t,children:n})}St.Trigger=Ebt;St.Content=Tbt;St.Group=DHn;St.Portal=LHn;St.Item=Nbt;St.CheckboxItem=Abt;St.RadioItem=Ibt;St.Label=Rbt;St.Separator=Pbt;St.Shortcut=$bt;St.Sub=zHn;St.SubContent=jbt;St.SubTrigger=Cbt;St.RadioGroup=FHn;const P4=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Dr({className:e,...t}){return o.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:bg-linear-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const Mbt=({icon:e,title:t,isLoading:n,children:r})=>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(Ne,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),n?o.jsx(Dr,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(me,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),r&&o.jsx("div",{className:"pt-2",children:r})]});function BHn({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",t),children:e})}function UHn({children:e}){return o.jsxs("p",{className:Y("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx(M$,{})," ",e]})}function qHn({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function VHn({children:e,name:t,required:n,size:r="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Y("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":r==="bigger"},s),children:[e,n&&o.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function HHn({children:e,className:t,layout:n="vertical",labelColumnWidth:r}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":n==="horizontal"},t),style:n==="horizontal"&&r?{gridTemplateColumns:`${r} 1fr`}:void 0,children:e})}const Qo=Object.assign({},{Layout:HHn,Column:BHn,Label:VHn,HelpText:qHn,ErrorMsg:UHn});function ZHn({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-6 content-start",t),children:e})}function WHn({children:e,className:t,columns:n=1,gap:r}){return o.jsx("div",{className:Y("grid",{"grid-cols-1":n===1,"grid-cols-2":n===2},r??"gap-6",t),children:e})}Object.assign(WHn,{Column:ZHn});const QHn=Uk(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(Hyt,Nbe,Abe),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Hc.sm} text-ui-sm px-[.75em]`,md:`${Hc.md} text-ui-md px-[.75em]`,default:`${Hc.default} text-ui-md px-[.85em]`,lg:`${Hc.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),mn=b.forwardRef(({className:e,size:t,testId:n,variant:r,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Y(QHn({variant:r,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:l,"aria-invalid":a,...i}));mn.displayName="Input";function E0({name:e,value:t,label:n,labelIsHidden:r=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:l=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:p="default",testId:h,className:m,...g}){return o.jsxs(Qo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(Qo.Column,{children:o.jsx(Qo.Label,{name:e,required:l,size:u||"bigger",children:r?o.jsx(Kf,{children:n}):n})}):null,o.jsxs(Qo.Column,{children:[!r&&d==="vertical"?o.jsx(Qo.Label,{name:e,required:l,size:u||"default",children:n}):null,o.jsx(mn,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":h,size:p,...g}),a&&o.jsx(Qo.HelpText,{children:a}),i&&o.jsx(Qo.ErrorMsg,{children:i})]})]})}function C0({name:e,helpText:t,errorMsg:n,required:r=!1,disabled:s=!1,value:a,label:i,labelIsHidden:l=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:p,size:h,isMinimized:m,onMinimizedChange:g}){const v=b.useRef(null);return b.useEffect(()=>{m===!1&&v.current?.focus()},[m]),m?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(ce,{size:h||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(WE,{})})}),o.jsx(Kn,{children:i||"Search"})]}):o.jsxs(Qo.Layout,{layout:c,className:p,children:[c==="horizontal"?o.jsx(Qo.Column,{children:o.jsx(Qo.Label,{name:e,required:r,children:l?o.jsx(Kf,{children:i}):i})}):null,o.jsxs(Qo.Column,{children:[c==="vertical"&&i&&!l?o.jsx(Qo.Label,{name:e,required:r,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(mn,{ref:v,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:h,className:Y(h==="sm"&&"pl-8 pr-8",h==="md"&&"pl-9 pr-9",(!h||h==="default")&&"pl-10 pr-10",h==="lg"&&"pl-11 pr-11")}),o.jsx(WE,{"aria-hidden":"true",className:Y("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",h==="sm"&&"w-3.5 h-3.5",h==="md"&&"w-4 h-4",(!h||h==="default")&&"w-[1.125rem] h-[1.125rem]",h==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&o.jsx(ce,{variant:"ghost",size:h||"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(Uu,{})})]}),t&&o.jsx(Qo.HelpText,{children:t}),n&&o.jsx(Qo.ErrorMsg,{children:n})]})]})}const Li=yyn,zi=byn,_i=b.forwardRef(({className:e,children:t,variant:n="default",size:r="default",...s},a)=>o.jsxs(Got,{ref:a,className:Y(Qj({variant:n,size:r}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(xyn,{asChild:!0,children:o.jsx(ahe,{className:Y("h-4 w-4 text-neutral3",_r.colors)})})]}));_i.displayName=Got.displayName;const Oi=b.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>o.jsx(wyn,{children:o.jsx(Yot,{ref:s,className:Y("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:o.jsx(Syn,{className:Y("p-1",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));Oi.displayName=Yot.displayName;const xs=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Xot,{ref:r,className:Y("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",_r.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),...n,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(_yn,{children:o.jsx(ub,{className:"h-4 w-4 text-accent1"})})}),o.jsx(kyn,{children:t})]}));xs.displayName=Xot.displayName;function gl({name:e,helpText:t,errorMsg:n,required:r=!1,disabled:s=!1,size:a="default",value:i,label:l,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:p="Select an option",onValueChange:h,className:m}){return o.jsxs(Qo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(Qo.Column,{children:o.jsx(Qo.Label,{name:e,required:r,children:c?o.jsx(Kf,{children:l}):l})}):null,o.jsxs(Qo.Column,{children:[u==="vertical"&&l&&!c?o.jsx(Qo.Label,{name:e,required:r,children:l}):null,o.jsxs(Li,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:h,disabled:s,children:[o.jsx(_i,{size:a,children:o.jsx(zi,{placeholder:p})}),o.jsx(Oi,{children:f.map(g=>o.jsx(xs,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(Qo.HelpText,{children:t}),n&&o.jsx(Qo.ErrorMsg,{children:n})]})]})}const GHn=Uk("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ct=b.forwardRef(({className:e,...t},n)=>o.jsx(Jot,{ref:n,className:Y(GHn(),e),...t}));Ct.displayName=Jot.displayName;function OC({children:e}){const t=e.replace(/\\n/g,`
|
|
293
|
+
`).concat(_.x,",").concat(_.y),E=tc(e.id)?MR("recharts-radial-line-"):e.id;return b.createElement("text",xy({},r,{dominantBaseline:"central",className:Ba("recharts-radial-bar-label",i)}),b.createElement("defs",null,b.createElement("path",{id:E,d:O})),b.createElement("textPath",{xlinkHref:"#".concat(E)},n))},kFn=(e,t,n)=>{var{cx:r,cy:s,innerRadius:a,outerRadius:i,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(n==="outside"){var{x:d,y:f}=Sc(r,s,i+t,u);return{x:d,y:f,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"end"};var p=(a+i)/2,{x:h,y:m}=Sc(r,s,p,u);return{x:h,y:m,textAnchor:"middle",verticalAnchor:"middle"}},p5=e=>e!=null&&"cx"in e&&tr(e.cx),_Fn={angle:0,offset:5,zIndex:Pu.label,position:"middle",textBreakAll:!1};function OFn(e){if(!p5(e))return e;var{cx:t,cy:n,outerRadius:r}=e,s=r*2;return{x:t-r,y:n-r,width:s,upperWidth:s,lowerWidth:s,height:s}}function _x(e){var t=Wd(e,_Fn),{viewBox:n,parentViewBox:r,position:s,value:a,children:i,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=bFn(),p=Egt(),h=s==="center"?p:f??p,m,g,v;n==null?m=h:p5(n)?m=n:m=qve(n);var x=OFn(m);if(!m||tc(a)&&tc(i)&&!b.isValidElement(l)&&typeof l!="function")return null;var w=CA(CA({},t),{},{viewBox:m});if(b.isValidElement(l)){var{labelRef:S}=w,_=kDe(w,dFn);return b.cloneElement(l,_)}if(typeof l=="function"){var{content:O}=w,E=kDe(w,fFn);if(g=b.createElement(l,E),b.isValidElement(g))return g}else g=xFn(t);var T=Vu(t);if(p5(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return SFn(t,s,g,T,m);v=kFn(m,t.offset,t.position)}else{if(!x)return null;var j=uFn({viewBox:x,position:s,offset:t.offset,parentViewBox:p5(r)?void 0:r});v=CA(CA({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(wb,{zIndex:t.zIndex},b.createElement(Gye,xy({ref:d,className:Ba("recharts-label",c)},T,v,{textAnchor:wgt(T.textAnchor)?T.textAnchor:v.textAnchor,breakAll:u}),g))}_x.displayName="Label";var EFn=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(_x,xy({key:"label-implicit"},r)):ev(e)?b.createElement(_x,xy({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===_x?b.cloneElement(e,CA({key:"label-implicit"},r)):b.createElement(_x,xy({key:"label-implicit",content:e},r)):Yye(e)?b.createElement(_x,xy({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(_x,xy({},e,{key:"label-implicit"},r)):null};function CFn(e){var{label:t,labelRef:n}=e,r=Egt();return EFn(t,r,n)||null}var jFn=["valueAccessor"],TFn=["dataKey","clockWise","id","textBreakAll","zIndex"];function uF(){return uF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uF.apply(null,arguments)}function ODe(e,t){if(e==null)return{};var n,r,s=NFn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function NFn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var AFn=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(nFn(t))return t},Cgt=b.createContext(void 0),IFn=Cgt.Provider,jgt=b.createContext(void 0);jgt.Provider;function RFn(){return b.useContext(Cgt)}function PFn(){return b.useContext(jgt)}function h5(e){var{valueAccessor:t=AFn}=e,n=ODe(e,jFn),{dataKey:r,clockWise:s,id:a,textBreakAll:i,zIndex:l}=n,c=ODe(n,TFn),u=RFn(),d=PFn(),f=u||d;return!f||!f.length?null:b.createElement(wb,{zIndex:l??Pu.label},b.createElement(Zy,{className:"recharts-label-list"},f.map((p,h)=>{var m,g=tc(r)?t(p,h):Cc(p.payload,r),v=tc(a)?{}:{id:"".concat(a,"-").concat(h)};return b.createElement(_x,uF({key:"label-".concat(h)},Vu(p),c,v,{fill:(m=n.fill)!==null&&m!==void 0?m:p.fill,parentViewBox:p.parentViewBox,value:g,textBreakAll:i,viewBox:p.viewBox,index:h,zIndex:0}))})))}h5.displayName="LabelList";function $Fn(e){var{label:t}=e;return t?t===!0?b.createElement(h5,{key:"labelList-implicit"}):b.isValidElement(t)||Yye(t)?b.createElement(h5,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(h5,uF({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Xce(){return Xce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xce.apply(null,arguments)}var Tgt=e=>{var{cx:t,cy:n,r,className:s}=e,a=Ba("recharts-dot",s);return tr(t)&&tr(n)&&tr(r)?b.createElement("circle",Xce({},Jg(e),Pve(e),{className:a,cx:t,cy:n,r})):null},MFn={radiusAxis:{},angleAxis:{}},Ngt=cu({name:"polarAxis",initialState:MFn,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:WXr,removeRadiusAxis:QXr,addAngleAxis:GXr,removeAngleAxis:YXr}=Ngt.actions,DFn=Ngt.reducer;function LFn(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var WG={exports:{}},wa={};var EDe;function zFn(){if(EDe)return wa;EDe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=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"),p=Symbol.for("react.lazy"),h=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 n:case s:case r:case u:case d:return v;default:switch(v=v&&v.$$typeof,v){case l:case i:case c:case p:case f:case a:return v;default:return x}}case t:return x}}}return wa.ContextConsumer=i,wa.ContextProvider=a,wa.Element=e,wa.ForwardRef=c,wa.Fragment=n,wa.Lazy=p,wa.Memo=f,wa.Portal=t,wa.Profiler=s,wa.StrictMode=r,wa.Suspense=u,wa.SuspenseList=d,wa.isAsyncMode=function(){return!1},wa.isConcurrentMode=function(){return!1},wa.isContextConsumer=function(v){return g(v)===i},wa.isContextProvider=function(v){return g(v)===a},wa.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},wa.isForwardRef=function(v){return g(v)===c},wa.isFragment=function(v){return g(v)===n},wa.isLazy=function(v){return g(v)===p},wa.isMemo=function(v){return g(v)===f},wa.isPortal=function(v){return g(v)===t},wa.isProfiler=function(v){return g(v)===s},wa.isStrictMode=function(v){return g(v)===r},wa.isSuspense=function(v){return g(v)===u},wa.isSuspenseList=function(v){return g(v)===d},wa.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===s||v===r||v===u||v===d||v===h||typeof v=="object"&&v!==null&&(v.$$typeof===p||v.$$typeof===f||v.$$typeof===a||v.$$typeof===i||v.$$typeof===c||v.$$typeof===m||v.getModuleId!==void 0)},wa.typeOf=g,wa}var CDe;function FFn(){return CDe||(CDe=1,WG.exports=zFn()),WG.exports}FFn();var Agt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,QG={},jDe;function BFn(){return jDe||(jDe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const s=n[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${s}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(QG)),QG}var GG,TDe;function UFn(){return TDe||(TDe=1,GG=BFn().isPlainObject),GG}var qFn=UFn();const VFn=xl(qFn);var NDe,ADe,IDe,RDe,PDe;function $De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function MDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$De(Object(n),!0).forEach(function(r){HFn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$De(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HFn(e,t,n){return(t=ZFn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZFn(e){var t=WFn(e,"string");return typeof t=="symbol"?t:t+""}function WFn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dF(){return dF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dF.apply(null,arguments)}function LN(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var DDe=(e,t,n,r,s)=>{var a=n-r,i;return i=Eo(NDe||(NDe=LN(["M ",",",""])),e,t),i+=Eo(ADe||(ADe=LN(["L ",",",""])),e+n,t),i+=Eo(IDe||(IDe=LN(["L ",",",""])),e+n-a/2,t+s),i+=Eo(RDe||(RDe=LN(["L ",",",""])),e+n-a/2-r,t+s),i+=Eo(PDe||(PDe=LN(["L ",","," Z"])),e,t),i},QFn={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},GFn=e=>{var t=Wd(e,QFn),{x:n,y:r,upperWidth:s,lowerWidth:a,height:i,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,p=b.useRef(null),[h,m]=b.useState(-1),g=b.useRef(s),v=b.useRef(a),x=b.useRef(i),w=b.useRef(n),S=b.useRef(r),_=Wve(e,"trapezoid-");if(b.useEffect(()=>{if(p.current&&p.current.getTotalLength)try{var M=p.current.getTotalLength();M&&m(M)}catch{}},[]),n!==+n||r!==+r||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var O=Ba("recharts-trapezoid",l);if(!f)return b.createElement("g",null,b.createElement("path",dF({},Vu(t),{className:O,d:DDe(n,r,s,a,i)})));var E=g.current,T=v.current,j=x.current,N=w.current,I=S.current,P="0px ".concat(h===-1?1:h,"px"),R="".concat(h,"px ").concat(h,"px"),B=Wpt(["strokeDasharray"],u,c);return b.createElement(Zve,{animationId:_,key:_,canBegin:h>0,duration:u,easing:c,isActive:f,begin:d},M=>{var L=Sd(E,s,M),U=Sd(T,a,M),z=Sd(j,i,M),q=Sd(N,n,M),Z=Sd(I,r,M);p.current&&(g.current=L,v.current=U,x.current=z,w.current=q,S.current=Z);var D=M>0?{transition:B,strokeDasharray:R}:{strokeDasharray:P};return b.createElement("path",dF({},Vu(t),{className:O,d:DDe(q,Z,L,U,z),ref:p,style:MDe(MDe({},D),t.style)}))})},YFn=["option","shapeType","activeClassName","inActiveClassName"];function XFn(e,t){if(e==null)return{};var n,r,s=KFn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function KFn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function LDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function fF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LDe(Object(n),!0).forEach(function(r){JFn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JFn(e,t,n){return(t=e9n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e9n(e){var t=t9n(e,"string");return typeof t=="symbol"?t:t+""}function t9n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function n9n(e,t){return fF(fF({},t),e)}function r9n(e,t){return e==="symbols"}function zDe(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return b.createElement(Xpt,n);case"trapezoid":return b.createElement(GFn,n);case"sector":return b.createElement(eht,n);case"symbols":if(r9n(t))return b.createElement(Dft,n);break;case"curve":return b.createElement(Zpt,n);default:return null}}function s9n(e){return b.isValidElement(e)?e.props:e}function a9n(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=XFn(e,YFn),i;if(b.isValidElement(t))i=b.cloneElement(t,fF(fF({},a),s9n(t)));else if(typeof t=="function")i=t(a,a.index);else if(VFn(t)&&typeof t!="boolean"){var l=n9n(t,a);i=b.createElement(zDe,{shapeType:n,elementProps:l})}else{var c=a;i=b.createElement(zDe,{shapeType:n,elementProps:c})}return a.isActive?b.createElement(Zy,{className:r},i):b.createElement(Zy,{className:s},i)}function i9n(e){var{tooltipEntrySettings:t}=e,n=wl(),r=Qd(),s=b.useRef(null);return b.useLayoutEffect(()=>{r||(s.current===null?n(h5n(t)):s.current!==t&&n(m5n({prev:s.current,next:t})),s.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{s.current&&(n(g5n(s.current)),s.current=null)},[n]),null}function o9n(e){var{legendPayload:t}=e,n=wl(),r=Qd(),s=b.useRef(null);return b.useLayoutEffect(()=>{r||(s.current===null?n(TMn(t)):s.current!==t&&n(NMn({prev:s.current,next:t})),s.current=t)},[n,r,t]),b.useLayoutEffect(()=>()=>{s.current&&(n(AMn(s.current)),s.current=null)},[n]),null}var YG,l9n=()=>{var[e]=b.useState(()=>MR("uid-"));return e},c9n=(YG=gk.useId)!==null&&YG!==void 0?YG:l9n;function u9n(e,t){var n=c9n();return t||(e?"".concat(e,"-").concat(n):n)}var d9n=b.createContext(void 0),f9n=e=>{var{id:t,type:n,children:r}=e,s=u9n("recharts-".concat(n),t);return b.createElement(d9n.Provider,{value:s},r(s))},p9n={cartesianItems:[],polarItems:[]},Igt=cu({name:"graphicalItems",initialState:p9n,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Ii()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,s=nh(e).cartesianItems.indexOf(n);s>-1&&(e.cartesianItems[s]=r)},prepare:Ii()},removeCartesianGraphicalItem:{reducer(e,t){var n=nh(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Ii()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Ii()},removePolarGraphicalItem:{reducer(e,t){var n=nh(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Ii()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,s=nh(e).polarItems.indexOf(n);s>-1&&(e.polarItems[s]=r)},prepare:Ii()}}}),{addCartesianGraphicalItem:h9n,replaceCartesianGraphicalItem:m9n,removeCartesianGraphicalItem:g9n,addPolarGraphicalItem:XXr,removePolarGraphicalItem:KXr,replacePolarGraphicalItem:JXr}=Igt.actions,v9n=Igt.reducer,y9n=e=>{var t=wl(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(h9n(e)):n.current!==e&&t(m9n({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(g9n(n.current)),n.current=null)},[t]),null},b9n=b.memo(y9n),x9n=["points"];function FDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function XG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FDe(Object(n),!0).forEach(function(r){w9n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w9n(e,t,n){return(t=S9n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S9n(e){var t=k9n(e,"string");return typeof t=="symbol"?t:t+""}function k9n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pF(){return pF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pF.apply(null,arguments)}function _9n(e,t){if(e==null)return{};var n,r,s=O9n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function O9n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function E9n(e){var{option:t,dotProps:n,className:r}=e;if(b.isValidElement(t))return b.cloneElement(t,n);if(typeof t=="function")return t(n);var s=Ba(r,typeof t!="boolean"?t.className:""),a=n??{},{points:i}=a,l=_9n(a,x9n);return b.createElement(Tgt,pF({},l,{className:s}))}function C9n(e,t){return e==null?!1:t?!0:e.length===1}function j9n(e){var{points:t,dot:n,className:r,dotClassName:s,dataKey:a,baseProps:i,needClip:l,clipPathId:c,zIndex:u=Pu.scatter}=e;if(!C9n(t,n))return null;var d=Agt(n),f=FIn(n),p=t.map((m,g)=>{var v,x,w=XG(XG(XG({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(E9n,{key:"dot-".concat(g),option:n,dotProps:w,className:s})}),h={};return l&&c!=null&&(h.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),b.createElement(wb,{zIndex:u},b.createElement(Zy,pF({className:r},h),p))}function BDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function UDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BDe(Object(n),!0).forEach(function(r){T9n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T9n(e,t,n){return(t=N9n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N9n(e){var t=A9n(e,"string");return typeof t=="symbol"?t:t+""}function A9n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var I9n={xAxis:{},yAxis:{},zAxis:{}},Rgt=cu({name:"cartesianAxis",initialState:I9n,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Ii()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:Ii()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Ii()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Ii()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:Ii()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Ii()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Ii()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:Ii()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Ii()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,s=e.yAxis[n];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&r===i[1]&&r!==s.width&&Math.abs(r-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...i,r].slice(-3);e.yAxis[n]=UDe(UDe({},s),{},{width:r,widthHistory:l})}}}}),{addXAxis:R9n,replaceXAxis:P9n,removeXAxis:$9n,addYAxis:M9n,replaceYAxis:D9n,removeYAxis:L9n,addZAxis:eKr,replaceZAxis:tKr,removeZAxis:nKr,updateYAxisWidth:z9n}=Rgt.actions,F9n=Rgt.reducer,B9n=et([Nc],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),U9n=et([B9n,mb,gb],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Xye=()=>fr(U9n),q9n=()=>fr(h6n);function qDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function KG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qDe(Object(n),!0).forEach(function(r){V9n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V9n(e,t,n){return(t=H9n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H9n(e){var t=Z9n(e,"string");return typeof t=="symbol"?t:t+""}function Z9n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var W9n=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=KG(KG(KG({},l),qB(s)),Pve(s)),u;return b.isValidElement(s)?u=b.cloneElement(s,c):typeof s=="function"?u=s(c):u=b.createElement(Tgt,c),b.createElement(Zy,{className:"recharts-active-dot",clipPath:i},u)};function Q9n(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:s,clipPath:a,zIndex:i=Pu.activeDot}=e,l=fr(QR),c=q9n();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return tc(u)?null:b.createElement(wb,{zIndex:i},b.createElement(W9n,{point:u,childIndex:Number(l),mainColor:n,dataKey:s,activeDot:r,clipPath:a}))}var G9n=e=>{var{chartData:t}=e,n=wl(),r=Qd();return b.useEffect(()=>r?()=>{}:(n(oDe(t)),()=>{n(oDe(void 0))}),[t,n,r]),null},VDe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Pgt=cu({name:"brush",initialState:VDe,reducers:{setBrushSettings(e,t){return t.payload==null?VDe:t.payload}}}),{setBrushSettings:rKr}=Pgt.actions,Y9n=Pgt.reducer;function X9n(e){return(e%180+180)%180}var K9n=function(t){var{width:n,height:r}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=X9n(s),i=a*Math.PI/180,l=Math.atan(r/n),c=i>l&&i<Math.PI-l?r/Math.sin(i):n/Math.cos(i);return Math.abs(c)},J9n={dots:[],areas:[],lines:[]},$gt=cu({name:"referenceElements",initialState:J9n,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=nh(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=nh(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=nh(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:sKr,removeDot:aKr,addArea:iKr,removeArea:oKr,addLine:lKr,removeLine:cKr}=$gt.actions,e8n=$gt.reducer,t8n=b.createContext(void 0),n8n=e=>{var{children:t}=e,[n]=b.useState("".concat(MR("recharts"),"-clip")),r=Xye();if(r==null)return null;var{x:s,y:a,width:i,height:l}=r;return b.createElement(t8n.Provider,{value:n},b.createElement("defs",null,b.createElement("clipPath",{id:n},b.createElement("rect",{x:s,y:a,height:l,width:i}))),t)};function Mgt(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var s=e[r];s!==void 0&&n.push(s)}return n}function r8n(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return K9n(r,n)}function s8n(e,t,n){var r=n==="width",{x:s,y:a,width:i,height:l}=e;return t===1?{start:r?s:a,end:r?s+i:a+l}:{start:r?s+i:a+l,end:r?s:a}}function YR(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function a8n(e,t){return Mgt(e,t+1)}function i8n(e,t,n,r,s){for(var a=(r||[]).slice(),{start:i,end:l}=t,c=0,u=1,d=i,f=function(){var m=r?.[c];if(m===void 0)return{v:Mgt(r,u)};var g=c,v,x=()=>(v===void 0&&(v=n(m,g)),v),w=m.coordinate,S=c===0||YR(e,w,x,d,l);S||(c=0,d=i,u+=1),S&&(d=w+e*(x()/2+s),c+=u)},p;u<=a.length;)if(p=f(),p)return p.v;return[]}function o8n(e,t,n,r,s){var a=(r||[]).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,p=!0,h=function(){var _=r[g];if(_==null)return 0;var O=g,E,T=()=>(E===void 0&&(E=n(_,O)),E),j=_.coordinate,N=g===d||YR(e,j,T,f,c);if(!N)return p=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=h(),!(m!==0&&m===1));g+=u);if(p){for(var v=[],x=d;x<i;x+=u){var w=r[x];w!=null&&v.push(w)}return v}}return[]}function HDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Lc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HDe(Object(n),!0).forEach(function(r){l8n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l8n(e,t,n){return(t=c8n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c8n(e){var t=u8n(e,"string");return typeof t=="symbol"?t:t+""}function u8n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d8n(e,t,n,r,s){for(var a=(r||[]).slice(),i=a.length,{start:l}=t,{end:c}=t,u=function(p){var h=a[p];if(h==null)return 1;var m=h,g,v=()=>(g===void 0&&(g=n(h,p)),g);if(p===i-1){var x=e*(m.coordinate+e*v()/2-c);a[p]=m=Lc(Lc({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[p]=m=Lc(Lc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var w=YR(e,m.tickCoord,v,l,c);w&&(c=m.tickCoord-e*(v()/2+s),a[p]=Lc(Lc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function f8n(e,t,n,r,s,a){var i=(r||[]).slice(),l=i.length,{start:c,end:u}=t;if(a){var d=r[l-1];if(d!=null){var f=n(d,l-1),p=e*(d.coordinate+e*f/2-u);if(i[l-1]=d=Lc(Lc({},d),{},{tickCoord:p>0?d.coordinate-p*e:d.coordinate}),d.tickCoord!=null){var h=YR(e,d.tickCoord,()=>f,c,u);h&&(u=d.tickCoord-e*(f/2+s),i[l-1]=Lc(Lc({},d),{},{isShow:!0}))}}}for(var m=a?l-1:l,g=function(w){var S=i[w];if(S==null)return 1;var _=S,O,E=()=>(O===void 0&&(O=n(S,w)),O);if(w===0){var T=e*(_.coordinate-e*E()/2-c);i[w]=_=Lc(Lc({},_),{},{tickCoord:T<0?_.coordinate-T*e:_.coordinate})}else i[w]=_=Lc(Lc({},_),{},{tickCoord:_.coordinate});if(_.tickCoord!=null){var j=YR(e,_.tickCoord,E,c,u);j&&(c=_.tickCoord+e*(E()/2+s),i[w]=Lc(Lc({},_),{},{isShow:!0}))}},v=0;v<m;v++)g(v);return i}function Kye(e,t,n){var{tick:r,ticks:s,viewBox:a,minTickGap:i,orientation:l,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!r)return[];if(tr(c)||yM.isSsr){var p;return(p=a8n(s,tr(c)?c:0))!==null&&p!==void 0?p:[]}var h=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?pI(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},v=(O,E)=>{var T=typeof u=="function"?u(O.value,E):O.value;return m==="width"?r8n(pI(T,{fontSize:t,letterSpacing:n}),g,f):pI(T,{fontSize:t,letterSpacing:n})[m]},x=s[0],w=s[1],S=s.length>=2&&x!=null&&w!=null?th(w.coordinate-x.coordinate):1,_=s8n(a,S,m);return c==="equidistantPreserveStart"?i8n(S,_,v,s,i):c==="equidistantPreserveEnd"?o8n(S,_,v,s,i):(c==="preserveStart"||c==="preserveStartEnd"?h=f8n(S,_,v,s,i,c==="preserveStartEnd"):h=d8n(S,_,v,s,i),h.filter(O=>O.isShow))}var p8n=e=>{var{ticks:t,label:n,labelGapWithTick:r=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=n?n.getBoundingClientRect().width:0,c=s+a,u=i+c+l+(n?r:0);return Math.round(u)}return 0},h8n={xAxis:{},yAxis:{}},Dgt=cu({name:"renderedTicks",initialState:h8n,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:s}=t.payload;e[n][r]=s},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:m8n,removeRenderedTicks:g8n}=Dgt.actions,v8n=Dgt.reducer,y8n=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function b8n(e,t){if(e==null)return{};var n,r,s=x8n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function x8n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(null,arguments)}function ZDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Oo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZDe(Object(n),!0).forEach(function(r){w8n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w8n(e,t,n){return(t=S8n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S8n(e){var t=k8n(e,"string");return typeof t=="symbol"?t:t+""}function k8n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var My={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:Pu.axis};function _8n(e){var{x:t,y:n,width:r,height:s,orientation:a,mirror:i,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Oo(Oo(Oo({},c),Jg(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=Oo(Oo({},u),{},{x1:t,y1:n+d*s,x2:t+r,y2:n+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=Oo(Oo({},u),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+s})}return b.createElement("line",H1({},u,{className:Ba("recharts-cartesian-axis-line",WB(l,"className"))}))}function O8n(e,t,n,r,s,a,i,l,c){var u,d,f,p,h,m,g=l?-1:1,v=e.tickSize||i,x=tr(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,p=n+ +!l*s,f=p-g*v,m=f-g*c,h=x;break;case"left":f=p=e.coordinate,d=t+ +!l*r,u=d-g*v,h=u-g*c,m=x;break;case"right":f=p=e.coordinate,d=t+ +l*r,u=d+g*v,h=u+g*c,m=x;break;default:u=d=e.coordinate,p=n+ +l*s,f=p+g*v,m=f+g*c,h=x;break}return{line:{x1:u,y1:f,x2:d,y2:p},tick:{x:h,y:m}}}function E8n(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function C8n(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function j8n(e){var{option:t,tickProps:n,value:r}=e,s,a=Ba(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))s=b.cloneElement(t,Oo(Oo({},n),{},{className:a}));else if(typeof t=="function")s=t(Oo(Oo({},n),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=Ba(i,LFn(t))),s=b.createElement(Gye,H1({},n,{className:i}),r)}return s}function T8n(e){var{ticks:t,axisType:n,axisId:r}=e,s=wl();return b.useEffect(()=>{if(r==null||n==null)return Pk;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(m8n({ticks:a,axisId:r,axisType:n})),()=>{s(g8n({axisId:r,axisType:n}))}},[s,t,r,n]),null}var N8n=b.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:s,stroke:a,tickFormatter:i,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:f,x:p,y:h,width:m,height:g,tickSize:v,tickMargin:x,fontSize:w,letterSpacing:S,getTicksConfig:_,events:O,axisType:E,axisId:T}=e,j=Kye(Oo(Oo({},_),{},{ticks:n}),w,S),N=Jg(_),I=qB(r),P=wgt(N.textAnchor)?N.textAnchor:E8n(d,f),R=C8n(d,f),B={};typeof s=="object"&&(B=s);var M=Oo(Oo({},N),{},{fill:"none"},B),L=j.map(q=>Oo({entry:q},O8n(q,p,h,m,g,d,v,f,x))),U=L.map(q=>{var{entry:Z,line:D}=q;return b.createElement(Zy,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Z.value,"-").concat(Z.coordinate,"-").concat(Z.tickCoord)},s&&b.createElement("line",H1({},M,D,{className:Ba("recharts-cartesian-axis-tick-line",WB(s,"className"))})))}),z=L.map((q,Z)=>{var D,G,{entry:V,tick:$}=q,W=Oo(Oo(Oo(Oo({verticalAnchor:R},N),{},{textAnchor:P,stroke:"none",fill:a},$),{},{index:Z,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(D=(G=u?.angle)!==null&&G!==void 0?G:N.angle)!==null&&D!==void 0?D:0}),Q=Oo(Oo({},W),I);return b.createElement(Zy,H1({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},VRn(O,V,Z)),r&&b.createElement(j8n,{option:r,tickProps:Q,value:"".concat(typeof i=="function"?i(V.value,Z):V.value).concat(l||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(T8n,{ticks:j,axisId:T,axisType:E}),z.length>0&&b.createElement(wb,{zIndex:Pu.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),U.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},U))}),A8n=b.forwardRef((e,t)=>{var{axisLine:n,width:r,height:s,className:a,hide:i,ticks:l,axisType:c,axisId:u}=e,d=b8n(e,y8n),[f,p]=b.useState(""),[h,m]=b.useState(""),g=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return p8n({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 _=window.getComputedStyle(S),O=_.fontSize,E=_.letterSpacing;(O!==f||E!==h)&&(p(O),m(E))}}},[f,h]);return i||r!=null&&r<=0||s!=null&&s<=0?null:b.createElement(wb,{zIndex:e.zIndex},b.createElement(Zy,{className:Ba("recharts-cartesian-axis",a)},b.createElement(_8n,{x:e.x,y:e.y,width:r,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Jg(e)}),b.createElement(N8n,{ref:v,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:h,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(vFn,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(CFn,{label:e.label,labelRef:e.labelRef}),e.children)))}),Jye=b.forwardRef((e,t)=>{var n=Wd(e,My);return b.createElement(A8n,H1({},n,{ref:t}))});Jye.displayName="CartesianAxis";var I8n=["x1","y1","x2","y2","key"],R8n=["offset"],P8n=["xAxisId","yAxisId"],$8n=["xAxisId","yAxisId"];function WDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WDe(Object(n),!0).forEach(function(r){M8n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M8n(e,t,n){return(t=D8n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D8n(e){var t=L8n(e,"string");return typeof t=="symbol"?t:t+""}function L8n(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LS(){return LS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LS.apply(null,arguments)}function hF(e,t){if(e==null)return{};var n,r,s=z8n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function z8n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var F8n=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:s,width:a,height:i,ry:l}=e;return b.createElement("rect",{x:r,y:s,ry:l,width:a,height:i,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Lgt(e){var{option:t,lineItemProps:n}=e,r;if(b.isValidElement(t))r=b.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var s,{x1:a,y1:i,x2:l,y2:c,key:u}=n,d=hF(n,I8n),f=(s=Jg(d))!==null&&s!==void 0?s:{},{offset:p}=f,h=hF(f,R8n);r=b.createElement("line",LS({},h,{x1:a,y1:i,x2:l,y2:c,fill:"none",key:u}))}return r}function B8n(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:s}=e;if(!r||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=hF(e,P8n),c=s.map((u,d)=>{var f=Zc(Zc({},l),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return b.createElement(Lgt,{key:"line-".concat(d),option:r,lineItemProps:f})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function U8n(e){var{y:t,height:n,vertical:r=!0,verticalPoints:s}=e;if(!r||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,l=hF(e,$8n),c=s.map((u,d)=>{var f=Zc(Zc({},l),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return b.createElement(Lgt,{option:r,lineItemProps:f,key:"line-".concat(d)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function q8n(e){var{horizontalFill:t,fillOpacity:n,x:r,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,p)=>f-p);s!==u[0]&&u.unshift(0);var d=u.map((f,p)=>{var h=u[p+1],m=h==null,g=m?s+i-f:h-f;if(g<=0)return null;var v=p%t.length;return b.createElement("rect",{key:"react-".concat(p),y:f,x:r,height:g,width:a,stroke:"none",fill:t[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function V8n(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:s,y:a,width:i,height:l,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,p)=>f-p);s!==u[0]&&u.unshift(0);var d=u.map((f,p)=>{var h=u[p+1],m=h==null,g=m?s+i-f:h-f;if(g<=0)return null;var v=p%n.length;return b.createElement("rect",{key:"react-".concat(p),x:f,y:a,width:g,height:l,stroke:"none",fill:n[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var H8n=(e,t)=>{var{xAxis:n,width:r,height:s,offset:a}=e;return _pt(Kye(Zc(Zc(Zc({},My),n),{},{ticks:Opt(n),viewBox:{x:0,y:0,width:r,height:s}})),a.left,a.left+a.width,t)},Z8n=(e,t)=>{var{yAxis:n,width:r,height:s,offset:a}=e;return _pt(Kye(Zc(Zc(Zc({},My),n),{},{ticks:Opt(n),viewBox:{x:0,y:0,width:r,height:s}})),a.top,a.top+a.height,t)},W8n={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Pu.grid};function zgt(e){var t=Rpt(),n=Ppt(),r=Ipt(),s=Zc(Zc({},Wd(e,W8n)),{},{x:tr(e.x)?e.x:r.left,y:tr(e.y)?e.y:r.top,width:tr(e.width)?e.width:r.width,height:tr(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:i,x:l,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:p,verticalValues:h}=s,m=Qd(),g=fr(N=>Q2e(N,"xAxis",a,m)),v=fr(N=>Q2e(N,"yAxis",i,m));if(!tv(u)||!tv(d)||!tr(l)||!tr(c))return null;var x=s.verticalCoordinatesGenerator||H8n,w=s.horizontalCoordinatesGenerator||Z8n,{horizontalPoints:S,verticalPoints:_}=s;if((!S||!S.length)&&typeof w=="function"){var O=p&&p.length,E=w({yAxis:v?Zc(Zc({},v),{},{ticks:O?p:v.ticks}):void 0,width:t??u,height:n??d,offset:r},O?!0:f);zz(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}if((!_||!_.length)&&typeof x=="function"){var T=h&&h.length,j=x({xAxis:g?Zc(Zc({},g),{},{ticks:T?h:g.ticks}):void 0,width:t??u,height:n??d,offset:r},T?!0:f);zz(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(_=j)}return b.createElement(wb,{zIndex:s.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(F8n,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),b.createElement(q8n,LS({},s,{horizontalPoints:S})),b.createElement(V8n,LS({},s,{verticalPoints:_})),b.createElement(B8n,LS({},s,{offset:r,horizontalPoints:S,xAxis:g,yAxis:v})),b.createElement(U8n,LS({},s,{offset:r,verticalPoints:_,xAxis:g,yAxis:v}))))}zgt.displayName="CartesianGrid";var Q8n={},Fgt=cu({name:"errorBars",initialState:Q8n,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:s}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(s=>s.dataKey!==r.dataKey||s.direction!==r.direction))}}}),{addErrorBar:uKr,replaceErrorBar:dKr,removeErrorBar:fKr}=Fgt.actions,G8n=Fgt.reducer,Y8n=["children"];function X8n(e,t){if(e==null)return{};var n,r,s=K8n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function K8n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var J8n={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},eBn=b.createContext(J8n);function tBn(e){var{children:t}=e,n=X8n(e,Y8n);return b.createElement(eBn.Provider,{value:n},t)}function Bgt(e,t){var n,r,s=fr(u=>yb(u,e)),a=fr(u=>bb(u,t)),i=(n=s?.allowDataOverflow)!==null&&n!==void 0?n:jl.allowDataOverflow,l=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Tl.allowDataOverflow,c=i||l;return{needClip:c,needClipX:i,needClipY:l}}function nBn(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,s=Xye(),{needClipX:a,needClipY:i,needClip:l}=Bgt(t,n);if(!l||!s)return null;var{x:c,y:u,width:d,height:f}=s;return b.createElement("clipPath",{id:"clipPath-".concat(r)},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 Ugt=(e,t,n,r)=>Bmt(e,"xAxis",t,r),qgt=(e,t,n,r)=>Fmt(e,"xAxis",t,r),Vgt=(e,t,n,r)=>Bmt(e,"yAxis",n,r),Hgt=(e,t,n,r)=>Fmt(e,"yAxis",n,r),rBn=et([vo,Ugt,Vgt,qgt,Hgt],(e,t,n,r,s)=>hb(e,"xAxis")?Lz(t,r,!1):Lz(n,s,!1)),sBn=(e,t,n,r,s)=>s;function aBn(e){return e.type==="line"}var iBn=et([umt,sBn],(e,t)=>e.filter(aBn).find(n=>n.id===t)),oBn=et([vo,Ugt,Vgt,qgt,Hgt,iBn,rBn,Qve],(e,t,n,r,s,a,i,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(a==null||t==null||n==null||r==null||s==null||r.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:p}=a,h;if(p!=null&&p.length>0?h=p:h=c?.slice(u,d+1),h!=null)return jBn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:h})}});function lBn(e){var t=qB(e),n=3,r=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),l=Number(a);return(Number.isNaN(i)||i<0)&&(i=n),(Number.isNaN(l)||l<0)&&(l=r),{r:i,strokeWidth:l}}return{r:n,strokeWidth:r}}var cBn=["id"],uBn=["type","layout","connectNulls","needClip","shape"],dBn=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function XR(){return XR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XR.apply(null,arguments)}function QDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function pg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QDe(Object(n),!0).forEach(function(r){fBn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fBn(e,t,n){return(t=pBn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pBn(e){var t=hBn(e,"string");return typeof t=="symbol"?t:t+""}function hBn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ebe(e,t){if(e==null)return{};var n,r,s=mBn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function mBn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var gBn=e=>{var{dataKey:t,name:n,stroke:r,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:r,value:Ept(n,t),payload:e}]},vBn=b.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:s,fill:a,name:i,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:Pk,settings:{stroke:r,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Ept(i,t),hide:l,type:u,color:r,unit:c,graphicalItemId:d}};return b.createElement(i9n,{tooltipEntrySettings:f})}),Zgt=(e,t)=>"".concat(t,"px ").concat(e,"px");function yBn(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],s=0;s<t;++s)r.push(...n);return r}var bBn=(e,t,n)=>{var r=n.reduce((p,h)=>p+h,0);if(!r)return Zgt(t,e);for(var s=Math.floor(e/r),a=e%r,i=[],l=0,c=0;l<n.length;c+=(u=n[l])!==null&&u!==void 0?u:0,++l){var u,d=n[l];if(d!=null&&c+d>a){i=[...n.slice(0,l),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...yBn(n,s),...i,...f].map(p=>"".concat(p,"px")).join(", ")};function xBn(e){var{clipPathId:t,points:n,props:r}=e,{dot:s,dataKey:a,needClip:i}=r,{id:l}=r,c=ebe(r,cBn),u=Jg(c);return b.createElement(j9n,{points:n,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function wBn(e){var{showLabels:t,children:n,points:r}=e,s=b.useMemo(()=>r?.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 pg(pg({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return b.createElement(IFn,{value:t?s:void 0},n)}function GDe(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:s,props:a}=e,{type:i,layout:l,connectNulls:c,needClip:u,shape:d}=a,f=ebe(a,uBn),p=pg(pg({},Vu(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:r,type:i,layout:l,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return b.createElement(b.Fragment,null,r?.length>1&&b.createElement(a9n,XR({shapeType:"curve",option:d},p,{pathRef:n})),b.createElement(xBn,{points:r,clipPathId:t,props:a}))}function SBn(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function kBn(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:p,width:h,height:m,onAnimationEnd:g,onAnimationStart:v}=n,x=s.current,w=Wve(i,"recharts-line-"),S=b.useRef(w),[_,O]=b.useState(!1),E=!_,T=b.useCallback(()=>{typeof g=="function"&&g(),O(!1)},[g]),j=b.useCallback(()=>{typeof v=="function"&&v(),O(!0)},[v]),N=SBn(r.current),I=b.useRef(0);S.current!==w&&(I.current=a.current,S.current=w);var P=I.current;return b.createElement(wBn,{points:i,showLabels:E},n.children,b.createElement(Zve,{animationId:w,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:w},R=>{var B=Sd(P,N+P,R),M=Math.min(B,N),L;if(c)if(l){var U="".concat(l).split(/[,\s]+/gim).map(Z=>parseFloat(Z));L=bBn(M,N,U)}else L=Zgt(N,M);else L=l==null?void 0:String(l);if(R>0&&N>0&&(s.current=i,a.current=Math.max(a.current,M)),x){var z=x.length/i.length,q=R===1?i:i.map((Z,D)=>{var G=Math.floor(D*z);if(x[G]){var V=x[G];return pg(pg({},Z),{},{x:Sd(V.x,Z.x,R),y:Sd(V.y,Z.y,R)})}return p?pg(pg({},Z),{},{x:Sd(h*2,Z.x,R),y:Sd(m/2,Z.y,R)}):pg(pg({},Z),{},{x:Z.x,y:Z.y})});return s.current=q,b.createElement(GDe,{props:n,points:q,clipPathId:t,pathRef:r,strokeDasharray:L})}return b.createElement(GDe,{props:n,points:i,clipPathId:t,pathRef:r,strokeDasharray:L})}),b.createElement($Fn,{label:n.label}))}function _Bn(e){var{clipPathId:t,props:n}=e,r=b.useRef(null),s=b.useRef(0),a=b.useRef(null);return b.createElement(kBn,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:s,pathRef:a})}var OBn=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:Cc(e.payload,t)}};class EBn extends b.Component{render(){var{hide:t,dot:n,points:r,className:s,xAxisId:a,yAxisId:i,top:l,left:c,width:u,height:d,id:f,needClip:p,zIndex:h}=this.props;if(t)return null;var m=Ba("recharts-line",s),g=f,{r:v,strokeWidth:x}=lBn(n),w=Agt(n),S=v*2+x,_=p?"url(#clipPath-".concat(w?"":"dots-").concat(g,")"):void 0;return b.createElement(wb,{zIndex:h},b.createElement(Zy,{className:m},p&&b.createElement("defs",null,b.createElement(nBn,{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(tBn,{xAxisId:a,yAxisId:i,data:r,dataPointFormatter:OBn,errorBarOffset:0},b.createElement(_Bn,{props:this.props,clipPathId:g}))),b.createElement(Q9n,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:_}))}}var Wgt={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:Pu.line,type:"linear"};function CBn(e){var t=Wd(e,Wgt),{activeDot:n,animateNewValues:r,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:f,legendType:p,xAxisId:h,yAxisId:m,id:g}=t,v=ebe(t,dBn),{needClip:x}=Bgt(h,m),w=Xye(),S=Pj(),_=Qd(),O=fr(I=>oBn(I,h,m,_,g));if(S!=="horizontal"&&S!=="vertical"||O==null||w==null)return null;var{height:E,width:T,x:j,y:N}=w;return b.createElement(EBn,XR({},v,{id:g,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:p,xAxisId:h,yAxisId:m,points:O,layout:S,height:E,width:T,left:j,top:N,needClip:x}))}function jBn(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var f=Cc(u,i);if(t==="horizontal"){var p=W$e({axis:n,ticks:s,bandSize:l,entry:u,index:d}),h=tc(f)?null:r.scale.map(f);return{x:p,y:h??null,value:f,payload:u}}var m=tc(f)?null:n.scale.map(f),g=W$e({axis:r,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 TBn(e){var t=Wd(e,Wgt),n=Qd();return b.createElement(f9n,{id:t.id,type:"line"},r=>b.createElement(b.Fragment,null,b.createElement(o9n,{legendPayload:gBn(t)}),b.createElement(vBn,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),b.createElement(b9n,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),b.createElement(CBn,XR({},t,{id:r}))))}var Qgt=b.memo(TBn,fU);Qgt.displayName="Line";var NBn=["domain","range"],ABn=["domain","range"];function YDe(e,t){if(e==null)return{};var n,r,s=IBn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function IBn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function XDe(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 Ggt(e,t){if(e===t)return!0;var{domain:n,range:r}=e,s=YDe(e,NBn),{domain:a,range:i}=t,l=YDe(t,ABn);return!XDe(n,a)||!XDe(r,i)?!1:fU(s,l)}var RBn=["type"],PBn=["dangerouslySetInnerHTML","ticks","scale"],$Bn=["id","scale"];function Kce(){return Kce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kce.apply(null,arguments)}function KDe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function JDe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KDe(Object(n),!0).forEach(function(r){MBn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KDe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MBn(e,t,n){return(t=DBn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DBn(e){var t=LBn(e,"string");return typeof t=="symbol"?t:t+""}function LBn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jce(e,t){if(e==null)return{};var n,r,s=zBn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function zBn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function FBn(e){var t=wl(),n=b.useRef(null),r=$pt(),{type:s}=e,a=Jce(e,RBn),i=mU(r,"xAxis",s),l=b.useMemo(()=>{if(i!=null)return JDe(JDe({},a),{},{type:i})},[a,i]);return b.useLayoutEffect(()=>{l!=null&&(n.current===null?t(R9n(l)):n.current!==l&&t(P9n({prev:n.current,next:l})),n.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{n.current&&(t($9n(n.current)),n.current=null)},[t]),null}var BBn=e=>{var{xAxisId:t,className:n}=e,r=fr(jpt),s=Qd(),a="xAxis",i=fr(x=>zmt(x,a,t,s)),l=fr(x=>G3n(x,t)),c=fr(x=>t5n(x,t)),u=fr(x=>imt(x,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:p}=e,h=Jce(e,PBn),{id:m,scale:g}=u,v=Jce(u,$Bn);return b.createElement(Jye,Kce({},h,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:Ba("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:i,axisType:a,axisId:t}))},UBn={allowDataOverflow:jl.allowDataOverflow,allowDecimals:jl.allowDecimals,allowDuplicatedCategory:jl.allowDuplicatedCategory,angle:jl.angle,axisLine:My.axisLine,height:jl.height,hide:!1,includeHidden:jl.includeHidden,interval:jl.interval,label:!1,minTickGap:jl.minTickGap,mirror:jl.mirror,orientation:jl.orientation,padding:jl.padding,reversed:jl.reversed,scale:jl.scale,tick:jl.tick,tickCount:jl.tickCount,tickLine:My.tickLine,tickSize:My.tickSize,type:jl.type,niceTicks:jl.niceTicks,xAxisId:0},qBn=e=>{var t=Wd(e,UBn);return b.createElement(b.Fragment,null,b.createElement(FBn,{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(BBn,t))},Ygt=b.memo(qBn,Ggt);Ygt.displayName="XAxis";var VBn=["type"],HBn=["dangerouslySetInnerHTML","ticks","scale"],ZBn=["id","scale"];function eue(){return eue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eue.apply(null,arguments)}function eLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function tLe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eLe(Object(n),!0).forEach(function(r){WBn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WBn(e,t,n){return(t=QBn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QBn(e){var t=GBn(e,"string");return typeof t=="symbol"?t:t+""}function GBn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tue(e,t){if(e==null)return{};var n,r,s=YBn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function YBn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function XBn(e){var t=wl(),n=b.useRef(null),r=$pt(),{type:s}=e,a=tue(e,VBn),i=mU(r,"yAxis",s),l=b.useMemo(()=>{if(i!=null)return tLe(tLe({},a),{},{type:i})},[i,a]);return b.useLayoutEffect(()=>{l!=null&&(n.current===null?t(M9n(l)):n.current!==l&&t(D9n({prev:n.current,next:l})),n.current=l)},[l,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(L9n(n.current)),n.current=null)},[t]),null}function KBn(e){var{yAxisId:t,className:n,width:r,label:s}=e,a=b.useRef(null),i=b.useRef(null),l=fr(jpt),c=Qd(),u=wl(),d="yAxis",f=fr(E=>s5n(E,t)),p=fr(E=>r5n(E,t)),h=fr(E=>zmt(E,d,t,c)),m=fr(E=>omt(E,t));if(b.useLayoutEffect(()=>{if(!(r!=="auto"||!f||Yye(s)||b.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(z9n({id:t,width:T}))}}},[h,f,u,s,t,r,m]),f==null||p==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:x}=e,w=tue(e,HBn),{id:S,scale:_}=m,O=tue(m,ZBn);return b.createElement(Jye,eue({},w,O,{ref:a,labelRef:i,x:p.x,y:p.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:f.width,height:f.height,className:Ba("recharts-".concat(d," ").concat(d),n),viewBox:l,ticks:h,axisType:d,axisId:t}))}var JBn={allowDataOverflow:Tl.allowDataOverflow,allowDecimals:Tl.allowDecimals,allowDuplicatedCategory:Tl.allowDuplicatedCategory,angle:Tl.angle,axisLine:My.axisLine,hide:!1,includeHidden:Tl.includeHidden,interval:Tl.interval,label:!1,minTickGap:Tl.minTickGap,mirror:Tl.mirror,orientation:Tl.orientation,padding:Tl.padding,reversed:Tl.reversed,scale:Tl.scale,tick:Tl.tick,tickCount:Tl.tickCount,tickLine:My.tickLine,tickSize:My.tickSize,type:Tl.type,niceTicks:Tl.niceTicks,width:Tl.width,yAxisId:0},eUn=e=>{var t=Wd(e,JBn);return b.createElement(b.Fragment,null,b.createElement(XBn,{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(KBn,t))},Xgt=b.memo(eUn,Ggt);Xgt.displayName="YAxis";var tUn=(e,t)=>t,tbe=et([tUn,vo,bht,ac,rgt,xb,C6n,Nc],P6n);function nUn(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function nbe(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(nUn(e)){var s=e.currentTarget.getBBox();n=s.width>0?t.width/s.width:1,r=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(l,c)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>i(l.clientX,l.clientY)):i(e.clientX,e.clientY)}var Kgt=ep("mouseClick"),Jgt=hM();Jgt.startListening({actionCreator:Kgt,effect:(e,t)=>{var n=e.payload,r=tbe(t.getState(),nbe(n));r?.activeIndex!=null&&t.dispatch(b5n({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var nue=ep("mouseMove"),evt=hM(),Z_=null,Qw=null,JG=null;evt.startListening({actionCreator:nue,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:s,throttledEvents:a}=r.eventSettings,i=a==="all"||a?.includes("mousemove");Z_!==null&&(cancelAnimationFrame(Z_),Z_=null),Qw!==null&&(typeof s!="number"||!i)&&(clearTimeout(Qw),Qw=null),JG=nbe(n);var l=()=>{var c=t.getState(),u=zye(c,c.tooltip.settings.shared);if(!JG){Z_=null,Qw=null;return}if(u==="axis"){var d=tbe(c,JG);d?.activeIndex!=null?t.dispatch(Qmt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(Wmt())}Z_=null,Qw=null};if(!i){l();return}s==="raf"?Z_=requestAnimationFrame(l):typeof s=="number"&&Qw===null&&(Qw=setTimeout(l,s))}});function rUn(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 nLe={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},tvt=cu({name:"rootProps",initialState:nLe,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:nLe.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}}}),sUn=tvt.reducer,{updateOptions:aUn}=tvt.actions,iUn=null,oUn={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)},nvt=cu({name:"polarOptions",initialState:iUn,reducers:oUn}),{updatePolarOptions:pKr}=nvt.actions,lUn=nvt.reducer,rvt=ep("keyDown"),svt=ep("focus"),avt=ep("blur"),TU=hM(),W_=null,Gw=null,_4=null;TU.startListening({actionCreator:rvt,effect:(e,t)=>{_4=e.payload,W_!==null&&(cancelAnimationFrame(W_),W_=null);var n=t.getState(),{throttleDelay:r,throttledEvents:s}=n.eventSettings,a=s==="all"||s.includes("keydown");Gw!==null&&(typeof r!="number"||!a)&&(clearTimeout(Gw),Gw=null);var i=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,d=_4;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=Fye(u,Uj(l),EM(l),jM(l)),p=f==null?-1:Number(f);if(!Number.isFinite(p)||p<0)return;var h=xb(l);if(d==="Enter"){var m=cF(l,"axis","hover",String(u.index));t.dispatch(lF({active:!u.active,activeIndex:u.index,activeCoordinate:m}));return}var g=c5n(l),v=g==="left-to-right"?1:-1,x=d==="ArrowRight"?1:-1,w=p+x*v;if(h==null||w>=h.length||w<0)return;var S=cF(l,"axis","hover",String(w));t.dispatch(lF({active:!0,activeIndex:w.toString(),activeCoordinate:S}))}finally{W_=null,Gw=null}};if(!a){i();return}r==="raf"?W_=requestAnimationFrame(i):typeof r=="number"&&Gw===null&&(i(),_4=null,Gw=setTimeout(()=>{_4?i():(Gw=null,W_=null)},r))}});TU.startListening({actionCreator:svt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:s}=n.tooltip;if(!s.active&&s.index==null){var a="0",i=cF(n,"axis","hover",String(a));t.dispatch(lF({active:!0,activeIndex:a,activeCoordinate:i}))}}}});TU.startListening({actionCreator:avt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:s}=n.tooltip;s.active&&t.dispatch(lF({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function ivt(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var s=Reflect.get(n,r);return typeof s=="function"?s.bind(n):s}})}var Bp=ep("externalEvent"),ovt=hM(),O4=new Map,zN=new Map,eY=new Map;ovt.startListening({actionCreator:Bp,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var s=r.type,a=ivt(r);eY.set(s,{handler:n,reactEvent:a});var i=O4.get(s);i!==void 0&&(cancelAnimationFrame(i),O4.delete(s));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,d=u,f=d==="all"||d?.includes(s),p=zN.get(s);p!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(p),zN.delete(s));var h=()=>{var v=eY.get(s);try{if(!v)return;var{handler:x,reactEvent:w}=v,S=t.getState(),_={activeCoordinate:d6n(S),activeDataKey:l6n(S),activeIndex:QR(S),activeLabel:igt(S),activeTooltipIndex:QR(S),isTooltipActive:f6n(S)};x&&x(_,w)}finally{O4.delete(s),zN.delete(s),eY.delete(s)}};if(!f){h();return}if(c==="raf"){var m=requestAnimationFrame(h);O4.set(s,m)}else if(typeof c=="number"){if(!zN.has(s)){h();var g=setTimeout(h,c);zN.set(s,g)}}else h()}}});var cUn=et([Fj],e=>e.tooltipItemPayloads),uUn=et([cUn,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:s}=r;if(s!=null)return s(t)}}}),lvt=ep("touchMove"),cvt=hM(),Yw=null,ox=null,rLe=null,FN=null;cvt.startListening({actionCreator:lvt,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){FN=ivt(n);var r=t.getState(),{throttleDelay:s,throttledEvents:a}=r.eventSettings,i=a==="all"||a.includes("touchmove");Yw!==null&&(cancelAnimationFrame(Yw),Yw=null),ox!==null&&(typeof s!="number"||!i)&&(clearTimeout(ox),ox=null),rLe=Array.from(n.touches).map(c=>nbe({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(FN!=null){var c=t.getState(),u=zye(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=rLe)===null||d===void 0?void 0:d[0];if(f==null){Yw=null,ox=null;return}var p=tbe(c,f);p?.activeIndex!=null&&t.dispatch(Qmt({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate}))}else if(u==="item"){var h,m=FN.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(z$n),x=(h=g.getAttribute(F$n))!==null&&h!==void 0?h:void 0,w=Bj(c).find(O=>O.id===x);if(v==null||w==null||x==null)return;var{dataKey:S}=w,_=uUn(c,v,x);t.dispatch(y5n({activeDataKey:S,activeIndex:v,activeCoordinate:_,activeGraphicalItemId:x}))}Yw=null,ox=null}};if(!i){l();return}s==="raf"?Yw=requestAnimationFrame(l):typeof s=="number"&&ox===null&&(l(),FN=null,ox=setTimeout(()=>{FN?l():(ox=null,Yw=null)},s))}}});var uvt={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},dvt=cu({name:"eventSettings",initialState:uvt,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:dUn}=dvt.actions,fUn=dvt.reducer,pUn=But({brush:Y9n,cartesianAxis:F9n,chartData:fzn,errorBars:G8n,eventSettings:fUn,graphicalItems:v9n,layout:_$n,legend:IMn,options:ozn,polarAxis:DFn,polarOptions:lUn,referenceElements:e8n,renderedTicks:v8n,rootProps:sUn,tooltip:x5n,zIndex:Q6n}),hUn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return GPn({reducer:pUn,preloadedState:t,middleware:r=>{var s;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([Jgt.middleware,evt.middleware,TU.middleware,ovt.middleware,cvt.middleware])},enhancers:r=>{var s=r;return typeof r=="function"&&(s=r()),s.concat(upt({type:"raf"}))},devTools:{serialize:{replacer:rUn},name:"recharts-".concat(n)}})};function mUn(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,s=Qd(),a=b.useRef(null);if(s)return n;a.current==null&&(a.current=hUn(t,r));var i=Mve;return b.createElement(Yut,{context:i,store:a.current},n)}function gUn(e){var{layout:t,margin:n}=e,r=wl(),s=Qd();return b.useEffect(()=>{s||(r(w$n(t)),r(x$n(n)))},[r,s,t,n]),null}var vUn=b.memo(gUn,fU);function yUn(e){var t=wl();return b.useEffect(()=>{t(aUn(e))},[t,e]),null}var bUn=e=>{var t=wl();return b.useEffect(()=>{t(dUn(e))},[t,e]),null},xUn=b.memo(bUn,fU);function sLe(e){var{zIndex:t,isPanorama:n}=e,r=b.useRef(null),s=wl();return b.useLayoutEffect(()=>(r.current&&s(Z6n({zIndex:t,element:r.current,isPanorama:n})),()=>{s(W6n({zIndex:t,isPanorama:n}))}),[s,t,n]),b.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function aLe(e){var{children:t,isPanorama:n}=e,r=fr(M6n);if(!r||r.length===0)return t;var s=r.filter(i=>i<0),a=r.filter(i=>i>0);return b.createElement(b.Fragment,null,s.map(i=>b.createElement(sLe,{key:i,zIndex:i,isPanorama:n})),t,a.map(i=>b.createElement(sLe,{key:i,zIndex:i,isPanorama:n})))}var wUn=["children"];function SUn(e,t){if(e==null)return{};var n,r,s=kUn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function kUn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function mF(){return mF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mF.apply(null,arguments)}var _Un={width:"100%",height:"100%",display:"block"},OUn=b.forwardRef((e,t)=>{var n=Rpt(),r=Ppt(),s=Hpt();if(!tv(n)||!tv(r))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(gft,mF({},i,{title:l,desc:c,role:d,tabIndex:u,width:n,height:r,style:_Un,ref:t}),a)}),EUn=e=>{var{children:t}=e,n=fr(oU);if(!n)return null;var{width:r,height:s,y:a,x:i}=n;return b.createElement(gft,{width:r,height:s,x:i,y:a},t)},iLe=b.forwardRef((e,t)=>{var{children:n}=e,r=SUn(e,wUn),s=Qd();return s?b.createElement(EUn,null,b.createElement(aLe,{isPanorama:!0},n)):b.createElement(OUn,mF({ref:t},r),b.createElement(aLe,{isPanorama:!1},n))});function CUn(){var e=wl(),[t,n]=b.useState(null),r=fr(L$n);return b.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;ia(a)&&a!==r&&e(k$n(a))}},[t,e,r]),n}function oLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jUn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oLe(Object(n),!0).forEach(function(r){TUn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TUn(e,t,n){return(t=NUn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NUn(e){var t=AUn(e,"string");return typeof t=="symbol"?t:t+""}function AUn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kx(){return Kx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kx.apply(null,arguments)}var IUn=()=>(wzn(),null);function gF(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var RUn=b.forwardRef((e,t)=>{var n,r,s=b.useRef(null),[a,i]=b.useState({containerWidth:gF((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:gF((r=e.style)===null||r===void 0?void 0:r.height)}),l=b.useCallback((u,d)=>{i(f=>{var p=Math.round(u),h=Math.round(d);return f.containerWidth===p&&f.containerHeight===h?f:{containerWidth:p,containerHeight:h}})},[]),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 p=m=>{var g=m[0];if(g!=null){var{width:v,height:x}=g.contentRect;l(v,x)}},h=new ResizeObserver(p);h.observe(u),s.current=h}},[t,l]);return b.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[l]),b.createElement(b.Fragment,null,b.createElement(gM,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",Kx({ref:c},e)))}),PUn=b.forwardRef((e,t)=>{var{width:n,height:r}=e,[s,a]=b.useState({containerWidth:gF(n),containerHeight:gF(r)}),i=b.useCallback((c,u)=>{a(d=>{var f=Math.round(c),p=Math.round(u);return d.containerWidth===f&&d.containerHeight===p?d:{containerWidth:f,containerHeight:p}})},[]),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(gM,{width:s.containerWidth,height:s.containerHeight}),b.createElement("div",Kx({ref:l},e)))}),$Un=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return b.createElement(b.Fragment,null,b.createElement(gM,{width:n,height:r}),b.createElement("div",Kx({ref:t},e)))}),MUn=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?b.createElement(PUn,Kx({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement($Un,Kx({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(gM,{width:n,height:r}),b.createElement("div",Kx({ref:t},e)))});function DUn(e){return e?RUn:MUn}var LUn=b.forwardRef((e,t)=>{var{children:n,className:r,height:s,onClick:a,onContextMenu:i,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:p,onTouchEnd:h,onTouchMove:m,onTouchStart:g,style:v,width:x,responsive:w,dispatchTouchEvents:S=!0}=e,_=b.useRef(null),O=wl(),[E,T]=b.useState(null),[j,N]=b.useState(null),I=CUn(),P=Uve(),R=P?.width>0?P.width:x,B=P?.height>0?P.height:s,M=b.useCallback(ie=>{I(ie),typeof t=="function"&&t(ie),T(ie),N(ie),ie!=null&&(_.current=ie)},[I,t,T,N]),L=b.useCallback(ie=>{O(Kgt(ie)),O(Bp({handler:a,reactEvent:ie}))},[O,a]),U=b.useCallback(ie=>{O(nue(ie)),O(Bp({handler:u,reactEvent:ie}))},[O,u]),z=b.useCallback(ie=>{O(Wmt()),O(Bp({handler:d,reactEvent:ie}))},[O,d]),q=b.useCallback(ie=>{O(nue(ie)),O(Bp({handler:f,reactEvent:ie}))},[O,f]),Z=b.useCallback(()=>{O(svt())},[O]),D=b.useCallback(()=>{O(avt())},[O]),G=b.useCallback(ie=>{O(rvt(ie.key))},[O]),V=b.useCallback(ie=>{O(Bp({handler:i,reactEvent:ie}))},[O,i]),$=b.useCallback(ie=>{O(Bp({handler:l,reactEvent:ie}))},[O,l]),W=b.useCallback(ie=>{O(Bp({handler:c,reactEvent:ie}))},[O,c]),Q=b.useCallback(ie=>{O(Bp({handler:p,reactEvent:ie}))},[O,p]),J=b.useCallback(ie=>{O(Bp({handler:g,reactEvent:ie}))},[O,g]),ae=b.useCallback(ie=>{S&&O(lvt(ie)),O(Bp({handler:m,reactEvent:ie}))},[O,S,m]),te=b.useCallback(ie=>{O(Bp({handler:h,reactEvent:ie}))},[O,h]),re=DUn(w);return b.createElement(pgt.Provider,{value:E},b.createElement(WIn.Provider,{value:j},b.createElement(re,{width:R??v?.width,height:B??v?.height,className:Ba("recharts-wrapper",r),style:jUn({position:"relative",cursor:"default",width:R,height:B},v),onClick:L,onContextMenu:V,onDoubleClick:$,onFocus:Z,onBlur:D,onKeyDown:G,onMouseDown:W,onMouseEnter:U,onMouseLeave:z,onMouseMove:q,onMouseUp:Q,onTouchEnd:te,onTouchMove:ae,onTouchStart:J,ref:M},b.createElement(IUn,null),n)))}),zUn=["width","height","responsive","children","className","style","compact","title","desc"];function FUn(e,t){if(e==null)return{};var n,r,s=BUn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function BUn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var UUn=b.forwardRef((e,t)=>{var{width:n,height:r,responsive:s,children:a,className:i,style:l,compact:c,title:u,desc:d}=e,f=FUn(e,zUn),p=Jg(f);return c?b.createElement(b.Fragment,null,b.createElement(gM,{width:n,height:r}),b.createElement(iLe,{otherAttributes:p,title:u,desc:d},a)):b.createElement(LUn,{className:i,style:l,width:n,height:r,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(iLe,{otherAttributes:p,title:u,desc:d,ref:t},b.createElement(n8n,null,a)))});function rue(){return rue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rue.apply(null,arguments)}function lLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qUn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lLe(Object(n),!0).forEach(function(r){VUn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VUn(e,t,n){return(t=HUn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HUn(e){var t=ZUn(e,"string");return typeof t=="symbol"?t:t+""}function ZUn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WUn={top:5,right:5,bottom:5,left:5},QUn=qUn({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:WUn,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},uvt),GUn=b.forwardRef(function(t,n){var r,s=Wd(t.categoricalChartProps,QUn),{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(mUn,{preloadedState:{options:d},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},b.createElement(G9n,{chartData:u.data}),b.createElement(vUn,{layout:s.layout,margin:s.margin}),b.createElement(xUn,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),b.createElement(yUn,{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(UUn,rue({},s,{ref:n})))}),YUn=["axis"],XUn=b.forwardRef((e,t)=>b.createElement(GUn,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:YUn,tooltipPayloadSearcher:azn,categoricalChartProps:e,ref:t}));function KUn(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function JUn(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function e7n(e){return e/100*window.innerHeight}function t7n(e){return e/100*window.innerWidth}function n7n(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 jA({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,a]=n7n(n);switch(a){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=JUn(t,s);break}case"em":{r=KUn(t,s);break}case"vh":{r=e7n(s);break}case"vw":{r=t7n(s);break}}return r}function jd(e){return parseFloat(e.toFixed(3))}function SC({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,s)=>(r+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,r),0)}function sue(e){const{panels:t}=e,n=SC({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:a}=r;let i=0;if(a.collapsedSize!==void 0){const d=jA({groupSize:n,panelElement:s,styleProp:a.collapsedSize});i=jd(d/n*100)}let l;if(a.defaultSize!==void 0){const d=jA({groupSize:n,panelElement:s,styleProp:a.defaultSize});l=jd(d/n*100)}let c=0;if(a.minSize!==void 0){const d=jA({groupSize:n,panelElement:s,styleProp:a.minSize});c=jd(d/n*100)}let u=100;if(a.maxSize!==void 0){const d=jA({groupSize:n,panelElement:s,styleProp:a.maxSize});u=jd(d/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:l,disabled:a.disabled,minSize:c,maxSize:u,panelId:r.id}})}function Qa(e,t="Assertion error"){if(!e)throw Error(t)}function aue(e,t){return Array.from(t).sort(e==="horizontal"?r7n:s7n)}function r7n(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function s7n(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function fvt(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function pvt(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 a7n({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:l,y:c}=pvt(r,i),u=e==="horizontal"?l:c;u<a&&(a=u,s=i)}return Qa(s,"No rect found"),s}let E4;function i7n(){return E4===void 0&&(typeof matchMedia=="function"?E4=!!matchMedia("(pointer:coarse)").matches:E4=!1),E4}function hvt(e){const{element:t,orientation:n,panels:r,separators:s}=e,a=aue(n,Array.from(t.children).filter(fvt).map(m=>({element:m}))).map(({element:m})=>m),i=[];let l=!1,c=!1,u=-1,d=-1,f=0,p,h=[];{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=r.find(x=>x.element===g);if(v){if(p){const x=p.element.getBoundingClientRect(),w=g.getBoundingClientRect();let S;if(c){const _=n==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),O=n==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(h.length){case 0:{S=[_,O];break}case 1:{const E=h[0],T=a7n({orientation:n,rects:[x,w],targetRect:E.element.getBoundingClientRect()});S=[E,T===x?O:_];break}default:{S=h;break}}}else h.length?S=h:S=[n==="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 _ of S){let O="width"in _?_:_.element.getBoundingClientRect();const E=i7n()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(O.width<E){const j=E-O.width;O=new DOMRect(O.x-j/2,O.y,O.width+j,O.height)}if(O.height<E){const j=E-O.height;O=new DOMRect(O.x,O.y-j/2,O.width,O.height+j)}const T=m<=u||m>d;!l&&!T&&i.push({group:e,groupSize:SC({group:e}),panels:[p,v],separator:"width"in _?void 0:_,rect:O}),l=!1}}c=!1,p=v,h=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(l=!0);const v=s.find(x=>x.element===g);v?h.push(v):(p=void 0,h=[])}else c=!0}return i}let mvt=class{#e={};addListener(t,n){const r=this.#e[t];return r===void 0?this.#e[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=this.#e[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,a=null;const i=Array.from(r);for(let l=0;l<i.length;l++){const c=i[l];try{c.call(null,n)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,n){const r=this.#e[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},Pg=new Map;const gvt=new mvt;function o7n(e){Pg=new Map(Pg),Pg.delete(e)}function cLe(e,t){for(const[n]of Pg)if(n.id===e)return n}function Jx(e,t){for(const[n,r]of Pg)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Dk(){return Pg}function rbe(e,t){return gvt.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function Jy(e,t){const n=Pg.get(e);Pg=new Map(Pg),Pg.set(e,t),gvt.emit("groupChange",{group:e,prev:n,next:t})}function l7n(e,t,n){let r,s={x:1/0,y:1/0};for(const a of t){const i=pvt(n,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(r=a,s=i);break}case"vertical":{i.y<=s.y&&(r=a,s=i);break}}}return r?{distance:s,hitRegion:r}:void 0}function c7n(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function u7n(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:fLe(e),b:fLe(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Qa(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:dLe(uLe(n.a)),b:dLe(uLe(n.b))};if(s.a===s.b){const a=r.childNodes,i={a:n.a.at(-1),b:n.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 d7n=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function f7n(e){const t=getComputedStyle(vvt(e)??e).display;return t==="flex"||t==="inline-flex"}function p7n(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||f7n(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"||d7n.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function uLe(e){let t=e.length;for(;t--;){const n=e[t];if(Qa(n,"Missing node"),p7n(n))return n}return null}function dLe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function fLe(e){const t=[];for(;e;)t.push(e),e=vvt(e);return t}function vvt(e){const{parentNode:t}=e;return c7n(t)?t.host:t}function h7n(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 m7n({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!fvt(n)||n.contains(e)||e.contains(n))return!0;if(u7n(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(h7n(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function sbe(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const a=hvt(s),i=l7n(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&m7n({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&n.push(i.hitRegion)}),n}function g7n(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Tu(e,t,n=0){return Math.abs(jd(e)-jd(t))<=n}function cg(e,t){return Tu(e,t)?0:e>t?1:-1}function zO({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:l=100,minSize:c=0}=t;if(i&&!e)return n;if(cg(r,c)<0)if(a){const u=(s+c)/2;cg(r,u)<0?r=s:r=c}else r=c;return r=Math.min(l,r),r=jd(r),r}function KR({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:a}){if(Tu(e,0))return t;const i=a==="imperative-api",l=Object.values(t),c=Object.values(s),u=[...l],[d,f]=r;Qa(d!=null,"Invalid first pivot index"),Qa(f!=null,"Invalid second pivot index");let p=0;switch(a){case"keyboard":{{const g=e<0?f:d,v=n[g];Qa(v,`Panel constraints not found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=v;if(w){const _=l[g];if(Qa(_!=null,`Previous layout not found for panel index ${g}`),Tu(_,x)){const O=S-_;cg(O,Math.abs(e))>0&&(e=e<0?0-O:O)}}}{const g=e<0?d:f,v=n[g];Qa(v,`No panel constraints found for index ${g}`);const{collapsedSize:x=0,collapsible:w,minSize:S=0}=v;if(w){const _=l[g];if(Qa(_!=null,`Previous layout not found for panel index ${g}`),Tu(_,S)){const O=_-x;cg(O,Math.abs(e))>0&&(e=e<0?0-O:O)}}}break}default:{const g=e<0?f:d,v=n[g];Qa(v,`Panel constraints not found for index ${g}`);const x=l[g],{collapsible:w,collapsedSize:S,minSize:_}=v;if(w&&cg(x,_)<0)if(e>0){const O=_-S,E=O/2,T=x+e;cg(T,_)<0&&(e=cg(e,E)<=0?0:O)}else{const O=_-S,E=100-O/2,T=x-e;cg(T,_)<0&&(e=cg(100+e,E)>0?0:-O)}break}}{const g=e<0?1:-1;let v=e<0?f:d,x=0;for(;;){const S=l[v];Qa(S!=null,`Previous layout not found for panel index ${v}`);const _=zO({overrideDisabledPanels:i,panelConstraints:n[v],prevSize:S,size:100})-S;if(x+=_,v+=g,v<0||v>=n.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<n.length;){const v=Math.abs(e)-Math.abs(p),x=l[g];Qa(x!=null,`Previous layout not found for panel index ${g}`);const w=x-v,S=zO({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:x,size:w});if(!Tu(x,S)&&(p+=x-S,u[g]=S,p.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(g7n(c,u))return s;{const g=e<0?f:d,v=l[g];Qa(v!=null,`Previous layout not found for panel index ${g}`);const x=v+p,w=zO({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:v,size:x});if(u[g]=w,!Tu(w,x)){let S=x-w,_=e<0?f:d;for(;_>=0&&_<n.length;){const O=u[_];Qa(O!=null,`Previous layout not found for panel index ${_}`);const E=O+S,T=zO({overrideDisabledPanels:i,panelConstraints:n[_],prevSize:O,size:E});if(Tu(O,T)||(S-=T-O,u[_]=T),Tu(S,0))break;e>0?_--:_++}}}const h=Object.values(u).reduce((g,v)=>v+g,0);if(!Tu(h,100,.1))return s;const m=Object.keys(s);return u.reduce((g,v,x)=>(g[m[x]]=v,g),{})}function Z1(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||cg(e[n],t[n])!==0)return!1;return!0}function W1({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((l,c)=>l+c,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(l=>`${l}%`).join(", ")}`);if(!Tu(s,100)&&r.length>0)for(let l=0;l<t.length;l++){const c=r[l];Qa(c!=null,`No layout data found for index ${l}`);const u=100/s*c;r[l]=u}let a=0;for(let l=0;l<t.length;l++){const c=n[l];Qa(c!=null,`No layout data found for index ${l}`);const u=r[l];Qa(u!=null,`No layout data found for index ${l}`);const d=zO({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});u!=d&&(a+=u-d,r[l]=d)}if(!Tu(a,0))for(let l=0;l<t.length;l++){const c=r[l];Qa(c!=null,`No layout data found for index ${l}`);const u=c+a,d=zO({overrideDisabledPanels:!0,panelConstraints:t[l],prevSize:c,size:u});if(c!==d&&(a-=d-c,r[l]=d,Tu(a,0)))break}const i=Object.keys(e);return r.reduce((l,c,u)=>(l[i[u]]=c,l),{})}function yvt({groupId:e,panelId:t}){const n=()=>{const l=Dk();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:p,separatorToPanels:h}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:p,layout:f,separatorToPanels:h};throw Error(`Group ${e} not found`)},r=()=>{const l=n().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const l=n().group.panels.find(c=>c.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const l=n().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:p,layout:h,separatorToPanels:m}=n(),g=f.panels.findIndex(S=>S.id===t),v=g===f.panels.length-1,x=KR({delta:v?c-l:l-c,initialLayout:h,panelConstraints:d,pivotIndices:v?[g-1,g]:[g,g+1],prevLayout:h,trigger:"imperative-api"}),w=W1({layout:x,panelConstraints:d});Z1(h,w)||Jy(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:p,layout:w,separatorToPanels:m})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=r(),{mutableValues:u}=s(),d=a();l&&d!==c&&(u.expandToSize=d,i(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=r(),{mutableValues:d}=s(),f=a();if(l&&f===c){let p=d.expandToSize??u;p===0&&(p=1),i(p)}},getSize:()=>{const{group:l}=n(),c=a(),{element:u}=s(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=r(),u=a();return l&&Tu(c,u)},resize:l=>{const{group:c}=n(),{element:u}=s(),d=SC({group:c}),f=jA({groupSize:d,panelElement:u,styleProp:l}),p=jd(f/d*100);i(p)}}}function pLe(e){if(e.defaultPrevented)return;const t=Dk();sbe(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,a=yvt({groupId:n.group.id,panelId:r.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function m5(e){const t=Dk();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function bvt({groupId:e}){const t=()=>{const n=Dk();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:a,groupSize:i,layout:l,separatorToPanels:c}=t(),u=W1({layout:n,panelConstraints:s});return r?l:(Z1(l,u)||Jy(a,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function Xw(e,t){const n=m5(e),r=Jx(n.id,!0),s=n.separators.find(d=>d.element===e);Qa(s,"Matching separator not found");const a=r.separatorToPanels.get(s);Qa(a,"Matching panels not found");const i=a.map(d=>n.panels.indexOf(d)),l=bvt({groupId:n.id}).getLayout(),c=KR({delta:t,initialLayout:l,panelConstraints:r.derivedPanelConstraints,pivotIndices:i,prevLayout:l,trigger:"keyboard"}),u=W1({layout:c,panelConstraints:r.derivedPanelConstraints});Z1(l,u)||Jy(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:u,separatorToPanels:r.separatorToPanels})}function hLe(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=m5(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Xw(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Xw(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Xw(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Xw(t,-5);break}case"End":{e.preventDefault(),Xw(t,100);break}case"Enter":{e.preventDefault();const r=m5(t),s=Jx(r.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:l}=s,c=r.separators.find(p=>p.element===t);Qa(c,"Matching separator not found");const u=l.get(c);Qa(u,"Matching panels not found");const d=u[0],f=a.find(p=>p.panelId===d.id);if(Qa(f,"Panel metadata not found"),f.collapsible){const p=i[d.id],h=f.collapsedSize===p?r.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;Xw(t,h-p)}break}case"F6":{e.preventDefault();const r=m5(t).separators.map(i=>i.element),s=Array.from(r).findIndex(i=>i===e.currentTarget);Qa(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Xw(t,-100);break}}}let kE={cursorFlags:0,state:"inactive"};const abe=new mvt;function Q1(){return kE}function v7n(e){return abe.addListener("change",e)}function y7n(e){const t=kE,n={...kE};n.cursorFlags=e,kE=n,abe.emit("change",{prev:t,next:n})}function _E(e){const t=kE;kE=e,abe.emit("change",{prev:t,next:e})}function mLe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Dk(),n=sbe(e,t),r=new Map;let s=!1;n.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({preventScroll:!0})));const i=t.get(a.group);i&&r.set(a.group,i.layout)}),_E({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const b7n=e=>e,tY=()=>{},xvt=1,wvt=2,Svt=4,kvt=8,gLe=3,vLe=12;let C4;function yLe(){return C4===void 0&&(C4=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(C4=!0)),C4}function x7n({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&yLe()){const a=(e&xvt)!==0,i=(e&wvt)!==0,l=(e&Svt)!==0,c=(e&kvt)!==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 yLe()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const bLe=new WeakMap;function ibe(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=bLe.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=Q1();switch(r.state){case"active":case"hover":{const s=x7n({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(i=>i.group),state:r.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}bLe.set(e,{prevStyle:t,styleSheet:n})}function _vt({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let l=0;n.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:p,panels:h}=d,{disableCursor:m}=d.mutableState;let g=0;a?p==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:p==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const v=r.get(d),x=s.get(d);if(!v||!x)return;const{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:_,layout:O,separatorToPanels:E}=x;if(S&&O&&E){const T=KR({delta:g,initialLayout:v,panelConstraints:S,pivotIndices:u.panels.map(j=>h.indexOf(j)),prevLayout:O,trigger:"mouse-or-touch"});if(Z1(T,O)){if(g!==0&&!m)switch(p){case"horizontal":{l|=g<0?xvt:wvt;break}case"vertical":{l|=g<0?Svt:kvt;break}}}else Jy(u.group,{defaultLayoutDeferred:w,derivedPanelConstraints:S,groupSize:_,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&gLe:c|=l&gLe,t.movementY===0?c|=i&vLe:c|=l&vLe,y7n(c),ibe(e)}function xLe(e){const t=Dk(),n=Q1();n.state==="active"&&_vt({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function wLe(e){if(e.defaultPrevented)return;const t=Q1(),n=Dk();switch(t.state){case"active":{if(e.buttons===0){_E({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=Jx(r.group.id,!0);Jy(r.group,s)});return}_vt({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=sbe(e,n);r.length===0?t.state!=="inactive"&&_E({cursorFlags:0,state:"inactive"}):_E({cursorFlags:0,hitRegions:r,state:"hover"}),ibe(e.currentTarget);break}}}function SLe(e){e.relatedTarget instanceof HTMLIFrameElement&&Q1().state==="hover"&&_E({cursorFlags:0,state:"inactive"})}function kLe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Q1();t.state==="active"&&(_E({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(ibe(e.currentTarget),t.hitRegions.forEach(n=>{const r=Jx(n.group.id,!0);Jy(n.group,r)}),e.preventDefault()))}function _Le(e){let t=0,n=0;const r={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=jd(a.defaultSize);n+=i,r[a.panelId]=i}else r[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=jd((100-n)/s);for(const i of e)i.defaultSize===void 0&&(r[i.panelId]=a)}return r}function w7n(e,t,n){if(!n[0])return;const r=e.panels.find(c=>c.element===t);if(!r||!r.onResize)return;const s=SC({group:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,i=r.mutableValues.prevSize,l={asPercentage:jd(a/s*100),inPixels:a};r.mutableValues.prevSize=l,r.onResize(l,r.id,i)}function S7n(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function k7n({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,a=0,i=!1;const l=new Map,c=[];for(const f of e.panels){const p=r[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const h=p/100*n,m=jd(h/t*100);l.set(f.id,m),s+=m}else c.push(f.id),a+=p}if(!i||c.length===0)return r;const u=100-s,d={...r};if(l.forEach((f,p)=>{d[p]=f}),a>0)for(const f of c){const p=r[f]??0;d[f]=jd(p/a*u)}else{const f=jd(u/c.length);for(const p of c)d[p]=f}return d}function _7n(e,t){const n=e.map(s=>s.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!r.includes(s))return!1;return!0}const Q_=new Map;function O7n(e){let t=!0;Qa(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,a=new n(m=>{for(const g of m){const{borderBoxSize:v,target:x}=g;if(x===e.element){if(t){const w=SC({group:e});if(w===0)return;const S=Jx(e.id);if(!S)return;const _=sue(e),O=S.defaultLayoutDeferred?_Le(_):S.layout,E=k7n({group:e,nextGroupSize:w,prevGroupSize:S.groupSize,prevLayout:O}),T=W1({layout:E,panelConstraints:_});if(!S.defaultLayoutDeferred&&Z1(S.layout,T)&&S7n(S.derivedPanelConstraints,_)&&S.groupSize===w)return;Jy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:_,groupSize:w,layout:T,separatorToPanels:S.separatorToPanels})}}else w7n(e,x,v)}});a.observe(e.element),e.panels.forEach(m=>{Qa(!r.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.onResize&&a.observe(m.element)});const i=SC({group:e}),l=sue(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(_7n(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??_Le(l),f=W1({layout:d,panelConstraints:l}),p=e.element.ownerDocument;Q_.set(p,(Q_.get(p)??0)+1);const h=new Map;return hvt(e).forEach(m=>{m.separator&&h.set(m.separator,m.panels)}),Jy(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:l,groupSize:i,layout:f,separatorToPanels:h}),e.separators.forEach(m=>{Qa(!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",hLe)}),Q_.get(p)===1&&(p.addEventListener("dblclick",pLe,!0),p.addEventListener("pointerdown",mLe,!0),p.addEventListener("pointerleave",xLe),p.addEventListener("pointermove",wLe),p.addEventListener("pointerout",SLe),p.addEventListener("pointerup",kLe,!0)),function(){t=!1,Q_.set(p,Math.max(0,(Q_.get(p)??0)-1)),o7n(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",hLe)}),Q_.get(p)||(p.removeEventListener("dblclick",pLe,!0),p.removeEventListener("pointerdown",mLe,!0),p.removeEventListener("pointerleave",xLe),p.removeEventListener("pointermove",wLe),p.removeEventListener("pointerout",SLe),p.removeEventListener("pointerup",kLe,!0)),a.disconnect()}}function E7n(){const[e,t]=b.useState({}),n=b.useCallback(()=>t({}),[]);return[e,n]}function obe(e){const t=b.useId();return`${e??t}`}const Lk=typeof window<"u"?b.useLayoutEffect:b.useEffect;function hI(e){const t=b.useRef(e);return Lk(()=>{t.current=e},[e]),b.useCallback((...n)=>t.current?.(...n),[t])}function lbe(...e){return hI(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function cbe(e){const t=b.useRef({...e});return Lk(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Ovt=b.createContext(null);function C7n(e,t){const n=b.useRef({getLayout:()=>({}),setLayout:b7n});b.useImperativeHandle(t,()=>n.current,[]),Lk(()=>{Object.assign(n.current,bvt({groupId:e}))})}function NU({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:a,groupRef:i,id:l,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:p,...h}){const m=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=hI(P=>{Z1(m.current.onLayoutChange,P)||(m.current.onLayoutChange=P,c?.(P))}),v=hI(P=>{Z1(m.current.onLayoutChanged,P)||(m.current.onLayoutChanged=P,u?.(P))}),x=obe(l),w=b.useRef(null),[S,_]=E7n(),O=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=lbe(w,a);C7n(x,i);const T=hI((P,R)=>{const B=Q1(),M=cLe(P),L=Jx(P);if(L){let U=!1;return B.state==="active"&&(U=B.hitRegions.some(z=>z.group===M)),{flexGrow:L.layout[R]??1,pointerEvents:U?"none":void 0}}return{flexGrow:n?.[R]??1}}),j=cbe({defaultLayout:n,disableCursor:r}),N=b.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:x,orientation:d,registerPanel:P=>{const R=O.current;return R.panels=aue(d,[...R.panels,P]),_(),()=>{R.panels=R.panels.filter(B=>B!==P),_()}},registerSeparator:P=>{const R=O.current;return R.separators=aue(d,[...R.separators,P]),_(),()=>{R.separators=R.separators.filter(B=>B!==P),_()}},togglePanelDisabled:(P,R)=>{const B=O.current.panels.find(U=>U.id===P);B&&(B.panelConstraints.disabled=R);const M=cLe(x),L=Jx(x);M&&L&&Jy(M,{...L,derivedPanelConstraints:sue(M)})},toggleSeparatorDisabled:(P,R)=>{const B=O.current.separators.find(M=>M.id===P);B&&(B.disabled=R)}}),[T,x,_,d,j]),I=b.useRef(null);return Lk(()=>{const P=w.current;if(P===null)return;const R=O.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===R.panels.length){B={};for(const D of R.panels){const G=j.defaultLayout[D.id];G!==void 0&&(B[D.id]=G)}}const M={disabled:!!s,element:P,id:x,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:O.current.lastExpandedPanelSizes,layouts:O.current.layouts},orientation:d,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};I.current=M;const L=O7n(M),{defaultLayoutDeferred:U,derivedPanelConstraints:z,layout:q}=Jx(M.id,!0);!U&&z.length>0&&(g(q),v(q));const Z=rbe(x,D=>{const{defaultLayoutDeferred:G,derivedPanelConstraints:V,layout:$}=D.next;if(G||V.length===0)return;const W=M.panels.map(({id:J})=>J).join(",");M.mutableState.layouts[W]=$,V.forEach(J=>{if(J.collapsible){const{layout:ae}=D.prev??{};if(ae){const te=Tu(J.collapsedSize,$[J.panelId]),re=Tu(J.collapsedSize,ae[J.panelId]);te&&!re&&(M.mutableState.expandedPanelSizes[J.panelId]=ae[J.panelId])}}});const Q=Q1().state!=="active";g($),Q&&v($)});return()=>{I.current=null,L(),Z()}},[s,x,v,g,d,S,j]),b.useEffect(()=>{const P=I.current;P&&(P.mutableState.defaultLayout=n,P.mutableState.disableCursor=!!r)}),o.jsx(Ovt.Provider,{value:N,children:o.jsx("div",{...h,className:t,"data-group":!0,"data-testid":x,id:x,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...p,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}NU.displayName="Group";function nY(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function ube({debounceSaveMs:e=100,panelIds:t,storage:n=localStorage,...r}){const s=t!==void 0,a="id"in r?r.id:r.groupId,i=nY(a,t??[]),l=b.useSyncExternalStore(j7n,()=>n.getItem(i),()=>n.getItem(i)),c=b.useMemo(()=>l?JSON.parse(l):void 0,[l]),u=b.useRef(null),d=b.useCallback(()=>{const h=u.current;h&&(u.current=null,clearTimeout(h))},[]);b.useLayoutEffect(()=>()=>{d()},[d]);const f=b.useCallback(h=>{d();let m;s?m=nY(a,Object.keys(h)):m=nY(a,[]);try{n.setItem(m,JSON.stringify(h))}catch(g){console.error(g)}},[d,s,a,n]),p=b.useCallback(h=>{d(),e===0?f(h):u.current=setTimeout(()=>{f(h)},e)},[d,e,f]);return{defaultLayout:c,onLayoutChange:p,onLayoutChanged:f}}function j7n(){return function(){}}function dbe(){const e=b.useContext(Ovt);return Qa(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function T7n(e,t){const{id:n}=dbe(),r=b.useRef({collapse:tY,expand:tY,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tY});b.useImperativeHandle(t,()=>r.current,[]),Lk(()=>{Object.assign(r.current,yvt({groupId:n,panelId:e}))})}function kC({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:l="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:p,style:h,...m}){const g=!!c,v=obe(c),x=cbe({disabled:a}),w=b.useRef(null),S=lbe(w,i),{getPanelStyles:_,id:O,orientation:E,registerPanel:T,togglePanelDisabled:j}=dbe(),N=f!==null,I=hI((R,B,M)=>{f?.(R,c,M)});Lk(()=>{const R=w.current;if(R!==null){const B={element:R,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:n,collapsible:r,defaultSize:s,disabled:x.disabled,maxSize:u,minSize:d}};return T(B)}},[l,n,r,s,N,v,g,u,d,I,T,x]),b.useEffect(()=>{j(v,!!a)},[a,v,j]),T7n(v,p);const P=b.useSyncExternalStore(R=>rbe(O,R),()=>JSON.stringify(_(O,v)),()=>JSON.stringify(_(O,v)));return o.jsx("div",{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":v,id:v,ref:S,style:{...N7n,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",...h,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}kC.displayName="Panel";const N7n={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function A7n(){return b.useRef(null)}function I7n({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,a;const i=e[n],l=t.find(c=>c.panelId===n);if(l){const c=l.maxSize,u=l.collapsible?l.collapsedSize:l.minSize,d=[r,r+1];a=W1({layout:KR({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n],s=W1({layout:KR({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:a,valueNow:i}}function Evt({children:e,className:t,disabled:n,elementRef:r,id:s,style:a,...i}){const l=obe(s),c=cbe({disabled:n}),[u,d]=b.useState({}),[f,p]=b.useState("inactive"),h=b.useRef(null),m=lbe(h,r),{disableCursor:g,id:v,orientation:x,registerSeparator:w,toggleSeparatorDisabled:S}=dbe(),_=x==="horizontal"?"vertical":"horizontal";Lk(()=>{const E=h.current;if(E!==null){const T={disabled:c.disabled,element:E,id:l},j=w(T),N=v7n(P=>{p(P.next.state!=="inactive"&&P.next.hitRegions.some(R=>R.separator===T)?P.next.state:"inactive")}),I=rbe(v,P=>{const{derivedPanelConstraints:R,layout:B,separatorToPanels:M}=P.next,L=M.get(T);if(L){const U=L[0],z=L.indexOf(U);d(I7n({layout:B,panelConstraints:R,panelId:U.id,panelIndex:z}))}});return()=>{N(),I(),j()}}},[v,l,w,c]),b.useEffect(()=>{S(l,!!n)},[n,l,S]);let O;return n&&!g&&(O="not-allowed"),o.jsx("div",{...i,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":_,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?"disabled":f,"data-testid":l,id:l,ref:m,role:"separator",style:{flexBasis:"auto",cursor:O,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}Evt.displayName="Separator";const OLe=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(h=>h(t,p))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,s,l);return l},R7n=(e=>e?OLe(e):OLe),P7n=e=>e;function $7n(e,t=P7n){const n=Te.useSyncExternalStore(e.subscribe,Te.useCallback(()=>t(e.getState()),[e,t]),Te.useCallback(()=>t(e.getInitialState()),[e,t]));return Te.useDebugValue(n),n}const ELe=e=>{const t=R7n(e),n=r=>$7n(t,r);return Object.assign(n,t),n},fbe=(e=>e?ELe(e):ELe);function M7n(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),l=(a=n.getItem(s))!=null?a:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const iue=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return iue(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return iue(r)(n)}}}},D7n=(e,t)=>(n,r,s)=>{let a={storage:M7n(()=>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.`),n(...v)},r,s);const f=()=>{const v=a.partialize({...r()});return d.setItem(a.name,{state:v,version:a.version})},p=s.setState;s.setState=(v,x)=>(p(v,x),f());const h=e((...v)=>(n(...v),f()),r,s);s.getInitialState=()=>h;let m;const g=()=>{var v,x;if(!d)return;const w=++l;i=!1,c.forEach(_=>{var O;return _((O=r())!=null?O:h)});const S=((x=a.onRehydrateStorage)==null?void 0:x.call(a,(v=r())!=null?v:h))||void 0;return iue(d.getItem.bind(d))(a.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==a.version){if(a.migrate){const O=a.migrate(_.state,_.version);return O instanceof Promise?O.then(E=>[!0,E]):[!0,O]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var O;if(w!==l)return;const[E,T]=_;if(m=a.merge(T,(O=r())!=null?O:h),n(m,!0),E)return f()}).then(()=>{w===l&&(S?.(r(),void 0),m=r(),i=!0,u.forEach(_=>_(m)))}).catch(_=>{w===l&&S?.(void 0,_)})};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||h},L7n=D7n;var zk=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},z7n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},F7n=class{#e=z7n;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},zS=new F7n;function B7n(e){setTimeout(e,0)}var G1=typeof window>"u"||"Deno"in globalThis;function Uc(){}function U7n(e,t){return typeof e=="function"?e(t):e}function oue(e){return typeof e=="number"&&e>=0&&e!==1/0}function Cvt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function e0(e,t){return typeof e=="function"?e(t):e}function qp(e,t){return typeof e=="function"?e(t):e}function CLe(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==pbe(i,t.options))return!1}else if(!JR(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function jLe(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Y1(t.options.mutationKey)!==Y1(a))return!1}else if(!JR(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function pbe(e,t){return(t?.queryKeyHashFn||Y1)(e)}function Y1(e){return JSON.stringify(e,(t,n)=>lue(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function JR(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>JR(e[n],t[n])):!1}var q7n=Object.prototype.hasOwnProperty;function hbe(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=TLe(e)&&TLe(t);if(!r&&!(lue(e)&&lue(t)))return t;const a=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),l=i.length,c=r?new Array(l):{};let u=0;for(let d=0;d<l;d++){const f=r?d:i[d],p=e[f],h=t[f];if(p===h){c[f]=p,(r?d<a:q7n.call(e,f))&&u++;continue}if(p===null||h===null||typeof p!="object"||typeof h!="object"){c[f]=h;continue}const m=hbe(p,h,n+1);c[f]=m,m===p&&u++}return a===l&&u===a?e:c}function eP(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function TLe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lue(e){if(!NLe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!NLe(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function NLe(e){return Object.prototype.toString.call(e)==="[object Object]"}function V7n(e){return new Promise(t=>{zS.setTimeout(t,e)})}function cue(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?hbe(e,t):t}function H7n(e){return e}function Z7n(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function W7n(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mbe=Symbol();function jvt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mbe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gbe(e,t){return typeof e=="function"?e(...t):!!e}function Q7n(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var G7n=class extends zk{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!G1&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},vbe=new G7n;function uue(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Y7n=B7n;function X7n(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=Y7n;const a=l=>{t?e.push(l):s(()=>{n(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||i()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var To=X7n(),K7n=class extends zk{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!G1&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},vF=new K7n;function J7n(e){return Math.min(1e3*2**e,3e4)}function Tvt(e){return(e??"online")==="online"?vF.isOnline():!0}var due=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Nvt(e){let t=!1,n=0,r;const s=uue(),a=()=>s.status!=="pending",i=g=>{if(!a()){const v=new due(g);p(v),e.onCancel?.(v)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>vbe.isFocused()&&(e.networkMode==="always"||vF.isOnline())&&e.canRun(),d=()=>Tvt(e.networkMode)&&e.canRun(),f=g=>{a()||(r?.(),s.resolve(g))},p=g=>{a()||(r?.(),s.reject(g))},h=()=>new Promise(g=>{r=v=>{(a()||u())&&g(v)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(a())return;const w=e.retry??(G1?0:3),S=e.retryDelay??J7n,_=typeof S=="function"?S(n,x):S,O=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(t||!O){p(x);return}n++,e.onFail?.(n,x),V7n(_).then(()=>u()?void 0:h()).then(()=>{t?p(x):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():h().then(m),s)}}var Avt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oue(this.gcTime)&&(this.#e=zS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(G1?1/0:300*1e3))}clearGcTimeout(){this.#e&&(zS.clearTimeout(this.#e),this.#e=void 0)}},eqn=class extends Avt{#e;#t;#n;#s;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ILe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ILe(this.options);t.data!==void 0&&(this.setState(ALe(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=cue(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Uc).catch(Uc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>qp(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mbe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>e0(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Cvt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const l=jvt(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#o=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return r(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=Nvt({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:l=>{l instanceof due&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#i({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof due){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ivt(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...ALe(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),To.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Ivt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tvt(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ALe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ILe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var AU=class extends zk{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=uue(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#o;#i;#h;#d;#f;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),RLe(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fue(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fue(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qp(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!eP(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&PLe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||qp(this.options.enabled,this.#t)!==qp(t.enabled,this.#t)||e0(this.options.staleTime,this.#t)!==e0(t.staleTime,this.#t))&&this.#g();const s=this.#v();r&&(this.#t!==n||qp(this.options.enabled,this.#t)!==qp(t.enabled,this.#t)||s!==this.#l)&&this.#y(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return nqn(this,n)&&(this.#s=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Uc)),t}#g(){this.#x();const e=e0(this.options.staleTime,this.#t);if(G1||this.#s.isStale||!oue(e))return;const n=Cvt(this.#s.dataUpdatedAt,e)+1;this.#c=zS.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(G1||qp(this.options.enabled,this.#t)===!1||!oue(this.#l)||this.#l===0)&&(this.#u=zS.setInterval(()=>{(this.options.refetchIntervalInBackground||vbe.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(zS.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(zS.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#s,a=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:u}=e;let d={...u},f=!1,p;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&RLe(e,t),I=j&&PLe(e,n,t,r);(N||I)&&(d={...d,...Ivt(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:g}=d;p=d.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,v=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",p=cue(s?.data,j,t),f=!0)}if(t.select&&p!==void 0&&!v)if(s&&p===a?.data&&t.select===this.#h)p=this.#d;else try{this.#h=t.select,p=t.select(p),p=cue(s?.data,p,t),this.#d=p,this.#i=null}catch(j){this.#i=j}this.#i&&(h=this.#i,p=this.#d,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",w=g==="pending",S=g==="error",_=w&&x,O=p!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&O,isStale:ybe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:qp(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=B=>{N?B.reject(T.error):j&&B.resolve(T.data)},P=()=>{const B=this.#o=T.promise=uue();I(B)},R=this.#o;switch(R.status){case"pending":e.queryHash===n.queryHash&&I(R);break;case"fulfilled":(N||T.data!==R.value)&&P();break;case"rejected":(!N||T.error!==R.reason)&&P();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#t),eP(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#p.size)return!0;const a=new Set(s??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const l=i;return this.#s[l]!==e[l]&&a.has(l)})};this.#k({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#k(e){To.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function tqn(e,t){return qp(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function RLe(e,t){return tqn(e,t)||e.state.data!==void 0&&fue(e,t,t.refetchOnMount)}function fue(e,t,n){if(qp(t.enabled,e)!==!1&&e0(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ybe(e,t)}return!1}function PLe(e,t,n,r){return(e!==t||qp(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ybe(e,n)}function ybe(e,t){return qp(t.enabled,e)!==!1&&e.isStaleByTime(e0(t.staleTime,e))}function nqn(e,t){return!eP(e.getCurrentResult(),t)}function yF(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{Q7n(m,()=>t.signal,()=>d=!0)},p=jvt(t.options,t.fetchOptions),h=async(m,g,v)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return f(E),E})(),S=await p(w),{maxPages:_}=t.options,O=v?W7n:Z7n;return{pages:O(m.pages,S,_),pageParams:O(m.pageParams,g,_)}};if(s&&a.length){const m=s==="backward",g=m?Rvt:pue,v={pages:a,pageParams:i},x=g(r,v);l=await h(v,x,m)}else{const m=e??a.length;do{const g=c===0?i[0]??r.initialPageParam:pue(r,l);if(c>0&&g==null)break;l=await h(l,g),c++}while(c<m)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function pue(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Rvt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function rqn(e,t){return t?pue(e,t)!=null:!1}function sqn(e,t){return!t||!e.getPreviousPageParam?!1:Rvt(e,t)!=null}var aqn=class extends AU{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:yF()})}getOptimisticResult(e){return e.behavior=yF(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:l}=r,c=n.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",p=s&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:rqn(t,n.data),hasPreviousPage:sqn(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:l&&!u&&!f,isRefetching:a&&!d&&!p}}},iqn=class extends Avt{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Pvt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Nvt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#r({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#s.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),To.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Pvt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oqn=class extends zk{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new iqn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=j4(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=j4(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=j4(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=j4(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){To.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>jLe(t,n))}findAll(e={}){return this.getAll().filter(t=>jLe(e,t))}notify(e){To.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return To.batch(()=>Promise.all(e.map(t=>t.continue().catch(Uc))))}};function j4(e){return e.options.scope?.id}var lqn=class extends zk{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),eP(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Y1(n.mutationKey)!==Y1(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??Pvt();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){To.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,n,r,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,n,r,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,n,r,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,n,r,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#t)})})}};function $Le(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function cqn(e,t,n){const r=e.slice(0);return r[t]=n,r}var uqn=class extends zk{#e;#t;#n;#s;#r;#a;#o;#i;#h;#d=[];constructor(e,t,n){super(),this.#e=e,this.#s=n,this.#n=[],this.#r=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#s=t,To.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=r.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=n.length!==s.length,l=s.some((d,f)=>d!==n[f]),c=i||l,u=c?!0:a.some((d,f)=>{const p=this.#t[f];return!p||!eP(d,p)});!c&&!u||(c&&(this.#d=r,this.#r=s),this.#t=a,this.hasListeners()&&(c&&($Le(n,s).forEach(d=>{d.destroy()}),$Le(s,n).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#p()))})}getCurrentResult(){return this.#t}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,s),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const s=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#h,s=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,i)=>a!==r[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,n!==void 0&&(this.#h=n),this.#a=hbe(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const s=r.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(r):t.set(s,[r])});const n=[];return e.forEach(r=>{const s=this.#e.defaultQueryOptions(r),i=t.get(s.queryHash)?.shift()??new AU(this.#e,s);n.push({defaultedQueryOptions:s,observer:i})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#t=cqn(this.#t,n,t),this.#p())}#p(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),n=this.#c(t,this.#s?.combine);e!==n&&To.batch(()=>{this.listeners.forEach(r=>{r(this.#t)})})}}},dqn=class extends zk{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??pbe(r,t);let a=this.get(s);return a||(a=new eqn({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){To.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>CLe(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>CLe(e,n)):t}notify(e){To.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){To.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){To.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fqn=class{#e;#t;#n;#s;#r;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new dqn,this.#t=e.mutationCache||new oqn,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=vbe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=vF.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(e0(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(r.queryHash)?.state.data,i=U7n(t,a);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return To.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;To.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return To.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=To.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Uc).catch(Uc)}invalidateQueries(e,t={}){return To.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=To.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Uc)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Uc)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(e0(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Uc).catch(Uc)}fetchInfiniteQuery(e){return e.behavior=yF(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Uc).catch(Uc)}ensureInfiniteQueryData(e){return e.behavior=yF(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vF.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Y1(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{JR(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Y1(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{JR(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pbe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===mbe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},$vt=b.createContext(void 0),la=e=>{const t=b.useContext($vt);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},pqn=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx($vt.Provider,{value:e,children:t})),Mvt=b.createContext(!1),Dvt=()=>b.useContext(Mvt);Mvt.Provider;function hqn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var mqn=b.createContext(hqn()),Lvt=()=>b.useContext(mqn),zvt=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?gbe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Fvt=e=>{b.useEffect(()=>{e.clearReset()},[e])},Bvt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||gbe(n,[e.error,r])),Uvt=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},gqn=(e,t)=>e.isLoading&&e.isFetching&&!t,hue=(e,t)=>e?.suspense&&t.isPending,mue=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vqn({queries:e,...t},n){const r=la(),s=Dvt(),a=Lvt(),i=b.useMemo(()=>e.map(g=>{const v=r.defaultQueryOptions(g);return v._optimisticResults=s?"isRestoring":"optimistic",v}),[e,r,s]);i.forEach(g=>{Uvt(g);const v=r.getQueryCache().get(g.queryHash);zvt(g,a,v)}),Fvt(a);const[l]=b.useState(()=>new uqn(r,i,t)),[c,u,d]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(g=>f?l.subscribe(To.batchCalls(g)):Uc,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const h=c.some((g,v)=>hue(i[v],g))?c.flatMap((g,v)=>{const x=i[v];if(x&&hue(x,g)){const w=new AU(r,x);return mue(x,w,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const m=c.find((g,v)=>{const x=i[v];return x&&Bvt({result:g,errorResetBoundary:a,throwOnError:x.throwOnError,query:r.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(m?.error)throw m.error;return u(d())}function qvt(e,t,n){const r=Dvt(),s=Lvt(),a=la(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=a.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",Uvt(i),zvt(i,s,l),Fvt(s);const c=!a.getQueryCache().get(i.queryHash),[u]=b.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(p=>{const h=f?u.subscribe(To.batchCalls(p)):Uc;return u.updateResult(),h},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(i)},[i,u]),hue(i,d))throw mue(i,u,s);if(Bvt({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!G1&&gqn(d,r)&&(c?mue(i,u,s):l?.promise)?.catch(Uc).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function Ot(e,t){return qvt(e,AU)}function ar(e,t){const n=la(),[r]=b.useState(()=>new lqn(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const s=b.useSyncExternalStore(b.useCallback(i=>r.subscribe(To.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=b.useCallback((i,l)=>{r.mutate(i,l).catch(Uc)},[r]);if(s.error&&gbe(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function Sb(e,t){return qvt(e,aqn)}var hl=(e=>(e.AGENT="agent",e.SCORER="scorer",e.RAG_INGESTION="rag_ingestion",e.TRAJECTORY="trajectory",e.INPUT_PROCESSOR="input_processor",e.INPUT_STEP_PROCESSOR="input_step_processor",e.OUTPUT_PROCESSOR="output_processor",e.OUTPUT_STEP_PROCESSOR="output_step_processor",e.WORKFLOW_STEP="workflow_step",e.TOOL="tool",e.WORKFLOW_RUN="workflow_run",e.MEMORY="memory",e))(hl||{});yk().describe("Database record creation time");var yqn=yk().describe("Database record last update time");yqn.nullable();var IU=Oe({page:HCe().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:HCe().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),RU=Oe({total:Et().describe("Total number of items available"),page:Et().describe("Current page"),perPage:or([Et(),Qt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:Yo().describe("True if more pages are available")}),bqn=Oe({start:ZCe().optional().describe("Start of date range (inclusive by default)"),end:ZCe().optional().describe("End of date range (inclusive by default)"),startExclusive:Yo().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:Yo().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),NM=Lo(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),wv=Lo(["sum","avg","min","max","count","count_distinct","last"]).describe("Aggregation function"),Fk=Lo(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),bbe=Lo(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),Bk=At(he()).min(1).describe("Fields to group by"),xbe=At(Et().min(0).max(1)).min(1).describe("Percentile values (0-1)"),wbe={value:Et().nullable().describe("Aggregated value"),previousValue:Et().nullable().optional().describe("Value from comparison period"),changePercent:Et().nullable().optional().describe("Percentage change from comparison period")},Sbe=ma(he(),he().nullable()).describe("Dimension values for this group"),qj=Et().describe("Aggregated value"),Vj=yk().describe("Bucket timestamp"),kbe=Et().describe("Percentile value"),_be=Et().describe("Percentile value at this bucket"),Hj=mpe(hl).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),xqn=he().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),Vvt=he().describe("Name of the entity"),Hvt=he().describe("Human end-user who triggered execution"),Zvt=he().describe("Multi-tenant organization/account"),Wvt=he().describe("Broader resource context (Mastra memory compatibility)"),Qvt=he().describe("Unique execution run identifier"),Gvt=he().describe("Session identifier for grouping traces"),Yvt=he().describe("Conversation thread identifier"),Xvt=he().describe("HTTP request ID for log correlation"),Kvt=he().describe('Environment (e.g., "production" | "staging" | "development")'),wqn=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),Jvt=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),eyt=he().describe("Name of the service"),tyt=mpe(hl).describe("Entity type of the parent entity"),Sqn=he().describe("ID of the parent entity"),nyt=he().describe("Name of the parent entity"),ryt=mpe(hl).describe("Entity type of the root entity"),kqn=he().describe("ID of the root entity"),syt=he().describe("Name of the root entity"),ayt=he().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),iyt=he().describe("Version ID of the parent entity that produced this signal"),oyt=he().describe("Version ID of the root entity that produced this signal"),PU=he().describe("Experiment or eval run identifier"),_qn=ma(he(),Ja()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),lyt=ma(he(),Ja()).describe("User-defined metadata for custom filtering"),cyt=At(he()).describe("Labels for filtering"),Oqn={entityType:Hj.nullish(),entityId:xqn.nullish(),entityName:Vvt.nullish(),parentEntityType:tyt.nullish(),parentEntityId:Sqn.nullish(),parentEntityName:nyt.nullish(),rootEntityType:ryt.nullish(),rootEntityId:kqn.nullish(),rootEntityName:syt.nullish(),userId:Hvt.nullish(),organizationId:Zvt.nullish(),resourceId:Wvt.nullish(),runId:Qvt.nullish(),sessionId:Gvt.nullish(),threadId:Yvt.nullish(),requestId:Xvt.nullish(),environment:Kvt.nullish(),serviceName:eyt.nullish(),scope:_qn.nullish(),entityVersionId:ayt.nullish(),parentEntityVersionId:iyt.nullish(),rootEntityVersionId:oyt.nullish(),experimentId:PU.nullish()},$U={...Oqn,executionSource:Jvt.nullish(),tags:cyt.nullish()};wqn.nullish();var MU={timestamp:bqn.optional().describe("Filter by timestamp range"),traceId:he().optional().describe("Filter by trace ID"),spanId:he().optional().describe("Filter by span ID"),entityType:Hj.optional(),entityName:Vvt.optional(),entityVersionId:ayt.optional(),parentEntityVersionId:iyt.optional(),rootEntityVersionId:oyt.optional(),userId:Hvt.optional(),organizationId:Zvt.optional(),experimentId:PU.optional(),serviceName:eyt.optional(),environment:Kvt.optional(),parentEntityType:tyt.optional(),parentEntityName:nyt.optional(),rootEntityType:ryt.optional(),rootEntityName:syt.optional(),resourceId:Wvt.optional(),runId:Qvt.optional(),sessionId:Gvt.optional(),threadId:Yvt.optional(),requestId:Xvt.optional(),executionSource:Jvt.optional(),tags:At(he()).optional().describe("Filter by tags (must have all specified tags)")},DU=he().describe("Unique trace identifier"),LU=he().describe("Unique span identifier within a trace"),bF=Lo(["debug","info","warn","error","fatal"]),uyt=he().describe("Log message"),dyt=ma(he(),Ja()).describe("Structured data attached to the log"),fyt=Oe({logId:he().nullish().describe("Unique id for this log event"),timestamp:yk().describe("When the log was created"),level:bF.describe("Log severity level"),message:uyt,data:dyt.nullish(),traceId:DU.nullish(),spanId:LU.nullish(),...$U,source:he().nullish().describe("Execution source"),metadata:lyt.nullish()}).describe("Log record as stored in the database");Oe({level:bF,message:uyt,data:dyt.optional(),tags:cyt.optional()}).describe("User-provided log input");var Eqn=fyt;Oe({logs:At(Eqn)}).describe("Arguments for batch creating logs");var Cqn=Oe({...MU,source:he().optional().describe("Filter by execution source"),level:or([bF,At(bF)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),jqn=Lo(["timestamp"]).describe("Field to order by: 'timestamp'"),Tqn=Oe({field:jqn.default("timestamp").describe("Field to order by"),direction:NM.default("DESC").describe("Sort direction")}).describe("Order by configuration");Oe({filters:Cqn.optional().describe("Optional filters to apply"),pagination:IU.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Tqn.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing logs");Oe({pagination:RU,logs:At(fyt)});var Zj=he().describe("Identifier of the scorer (e.g., relevance, accuracy)"),pyt=he().describe("Display name of the scorer"),hyt=he().describe("Version of the scorer"),rv=he().describe("How the score was produced (e.g., manual, automated, experiment)"),myt=Et().describe("Score value (range defined by scorer)"),gyt=he().describe("Explanation for the score"),vyt=Oe({scoreId:he().nullish().describe("Unique id for this score event"),timestamp:yk().describe("When the score was recorded"),traceId:DU.nullish().describe("Trace that anchors the scored target when available"),spanId:LU.nullish().describe("Span ID this score applies to"),scorerId:Zj,scorerName:pyt.nullish(),scorerVersion:hyt.nullish(),scoreSource:rv.nullish(),source:rv.nullish(),score:myt,reason:gyt.nullish(),...$U,scoreTraceId:he().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:ma(he(),Ja()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");Oe({scorerId:Zj,scorerName:pyt.optional(),scorerVersion:hyt.optional(),scoreSource:rv.optional(),source:rv.optional(),score:myt,reason:gyt.optional(),metadata:ma(he(),Ja()).optional().describe("Additional scorer-specific metadata"),experimentId:PU.optional(),scoreTraceId:he().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:Hj.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var Obe=vyt;Oe({score:Obe}).describe("Arguments for creating a score");Oe({score:Obe.omit({timestamp:!0})}).describe("Arguments for creating a score");Oe({success:Yo()}).describe("Response from creating a score");Oe({scores:At(Obe)}).describe("Arguments for batch recording scores");var AM=Oe({...MU,scorerId:or([he(),At(he())]).optional().describe("Filter by scorer ID(s)"),scoreSource:rv.optional().describe("Filter by how the score was produced"),source:rv.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),Nqn=Lo(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),Aqn=Oe({field:Nqn.default("timestamp").describe("Field to order by"),direction:NM.default("DESC").describe("Sort direction")}).describe("Order by configuration");Oe({filters:AM.optional(),pagination:IU.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Aqn.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing scores");Oe({pagination:RU,scores:At(vyt)});Oe({scorerId:Zj,scoreSource:rv.optional(),aggregation:wv,filters:AM.optional(),comparePeriod:bbe.optional()}).describe("Arguments for getting a score aggregate");Oe(wbe);Oe({scorerId:Zj,scoreSource:rv.optional(),groupBy:Bk,aggregation:wv,filters:AM.optional()}).describe("Arguments for getting a score breakdown");Oe({groups:At(Oe({dimensions:Sbe,value:qj}))});Oe({scorerId:Zj,scoreSource:rv.optional(),interval:Fk,aggregation:wv,filters:AM.optional(),groupBy:Bk.optional()}).describe("Arguments for getting score time series");Oe({series:At(Oe({name:he().describe("Series name (scorer ID or group key)"),points:At(Oe({timestamp:Vj,value:qj}))}))});Oe({scorerId:Zj,scoreSource:rv.optional(),percentiles:xbe,interval:Fk,filters:AM.optional()}).describe("Arguments for getting score percentiles");Oe({series:At(Oe({percentile:kbe,points:At(Oe({timestamp:Vj,value:_be}))}))});var sv=he().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),Wj=he().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),yyt=or([Et(),he()]).describe("Feedback value (rating number or correction text)"),byt=he().describe("Additional comment or context"),xF=he().describe("User who provided the feedback");function Ebe(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};return typeof t.userId=="string"&&t.feedbackUserId==null&&(t.feedbackUserId=t.userId,delete t.userId),t}var zU=Oe({feedbackId:he().nullish().describe("Unique id for this feedback event"),timestamp:yk().describe("When the feedback was recorded"),traceId:DU.nullish().describe("Trace that anchors the feedback target when available"),spanId:LU.nullish().describe("Span ID this feedback applies to"),feedbackSource:sv.nullish(),source:sv.nullish(),feedbackType:Wj,value:yyt,comment:byt.nullish(),feedbackUserId:xF.nullish(),...$U,sourceId:he().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:ma(he(),Ja()).nullish().describe("User-defined metadata")}),Iqn=Oe(zU.shape).describe("Feedback record as stored in the database"),Rqn=Oe({feedbackSource:sv.optional(),source:sv.optional(),feedbackType:Wj,value:yyt,comment:byt.optional(),feedbackUserId:xF.optional(),userId:xF.optional(),metadata:ma(he(),Ja()).optional().describe("Additional feedback-specific metadata"),experimentId:PU.optional(),sourceId:he().optional().describe("ID of the source record this feedback is linked to")});Oe(Rqn.shape).describe("User-provided feedback input");Oe({feedback:bpe(Ebe,zU)}).describe("Arguments for creating feedback");Oe({feedback:zU.omit({timestamp:!0})}).describe("Arguments for creating feedback");Oe({success:Yo()}).describe("Response from creating feedback");Oe({feedbacks:At(bpe(Ebe,zU))}).describe("Arguments for batch recording feedback");var xyt=Oe({...MU,feedbackType:or([he(),At(he())]).optional().describe("Filter by feedback type(s)"),feedbackSource:sv.optional(),source:sv.optional(),feedbackUserId:xF.optional()}),FU=Oe(xyt.shape).describe("Filters for querying feedback"),Pqn=Lo(["timestamp"]).describe("Field to order by: 'timestamp'"),$qn=Oe({field:Pqn.default("timestamp").describe("Field to order by"),direction:NM.default("DESC").describe("Sort direction")}).describe("Order by configuration");Oe({filters:bpe(Ebe,xyt).optional().describe("Optional filters to apply"),pagination:IU.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:$qn.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing feedback");Oe({pagination:RU,feedback:At(Iqn)});Oe({feedbackType:Wj,feedbackSource:sv.optional(),aggregation:wv,filters:FU.optional(),comparePeriod:bbe.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");Oe(wbe);Oe({feedbackType:Wj,feedbackSource:sv.optional(),groupBy:Bk,aggregation:wv,filters:FU.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");Oe({groups:At(Oe({dimensions:Sbe,value:qj}))});Oe({feedbackType:Wj,feedbackSource:sv.optional(),interval:Fk,aggregation:wv,filters:FU.optional(),groupBy:Bk.optional()}).describe("Arguments for getting feedback time series over numeric values");Oe({series:At(Oe({name:he().describe("Series name (feedback type or group key)"),points:At(Oe({timestamp:Vj,value:qj}))}))});Oe({feedbackType:Wj,feedbackSource:sv.optional(),percentiles:xbe,interval:Fk,filters:FU.optional()}).describe("Arguments for getting feedback percentiles over numeric values");Oe({series:At(Oe({percentile:kbe,points:At(Oe({timestamp:Vj,value:_be}))}))});Lo(["counter","gauge","histogram"]);var wyt=he().describe("Metric name (e.g., mastra_agent_duration_ms)"),Syt=Et().describe("Metric value"),kyt=ma(he(),he()).describe("Metric labels for dimensional filtering"),_yt=he().describe("Model provider"),Oyt=he().describe("Model"),Mqn=Et().describe("Estimated cost"),Eyt=he().describe("Unit for the estimated cost (e.g., usd)"),Dqn=ma(he(),Ja()).nullish().describe("Structured costing metadata"),Cyt=Oe({metricId:he().nullish().describe("Unique id for this metric event"),timestamp:yk().describe("When the metric was recorded"),name:wyt,value:Syt,traceId:DU.nullish(),spanId:LU.nullish(),...$U,source:he().nullish().describe("Execution source"),provider:_yt.nullish(),model:Oyt.nullish(),estimatedCost:Mqn.nullish(),costUnit:Eyt.nullish(),costMetadata:Dqn.nullish(),labels:kyt.default({}),metadata:lyt.nullish()}).describe("Metric record as stored in the database");Oe({name:wyt,value:Syt,labels:kyt.optional()}).describe("User-provided metric input");var Lqn=Cyt;Oe({metrics:At(Lqn)}).describe("Arguments for batch recording metrics");Oe({type:wv,interval:Fk.optional(),groupBy:Bk.optional()}).describe("Metrics aggregation configuration");var IM=Oe({...MU,name:At(he()).nonempty().optional().describe("Filter by metric name(s)"),source:he().optional().describe("Filter by execution source"),provider:_yt.optional(),model:Oyt.optional(),costUnit:Eyt.optional(),labels:ma(he(),he()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),zqn=Lo(["timestamp"]).describe("Field to order by: 'timestamp'"),Fqn=Oe({field:zqn.default("timestamp").describe("Field to order by"),direction:NM.default("DESC").describe("Sort direction")}).describe("Order by configuration");Oe({filters:IM.optional(),pagination:IU.default({page:0,perPage:10}).describe("Pagination settings"),orderBy:Fqn.default({field:"timestamp",direction:"DESC"}).describe("Ordering configuration (defaults to timestamp desc)")}).describe("Arguments for listing metrics");Oe({pagination:RU,metrics:At(Cyt)});var Bqn=["entityType","entityName","parentEntityType","parentEntityName","rootEntityType","rootEntityName","name","provider","model","environment","executionSource","serviceName"],Cbe=Lo(Bqn).optional().describe("Column to apply count_distinct over (required when aggregation is 'count_distinct'). Restricted to low/medium-cardinality categorical columns; ID columns are not allowed."),_C={check:e=>e.aggregation!=="count_distinct"||e.distinctColumn!==void 0,options:{message:"distinctColumn is required when aggregation is 'count_distinct'",path:["distinctColumn"]}};Oe({name:At(he()).nonempty().describe("Metric name(s) to aggregate"),aggregation:wv,distinctColumn:Cbe,filters:IM.optional(),comparePeriod:bbe.optional()}).refine(_C.check,_C.options).describe("Arguments for getting a metric aggregate");Oe({...wbe,estimatedCost:Et().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:he().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:Et().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:Et().nullable().optional().describe("Percentage change in estimated cost from comparison period")});Oe({name:At(he()).nonempty().describe("Metric name(s) to break down"),groupBy:Bk,aggregation:wv,distinctColumn:Cbe,filters:IM.optional(),limit:Et().int().positive().max(1e3).optional().describe("Maximum number of groups to return (server-side TopK). Required for high-cardinality groupBy."),orderDirection:NM.optional().describe("Sort direction for the aggregated value (defaults to 'DESC' at the storage layer; pairs with limit for top/bottom-N).")}).refine(_C.check,_C.options).describe("Arguments for getting a metric breakdown");Oe({groups:At(Oe({dimensions:Sbe,value:qj,estimatedCost:Et().nullable().optional().describe("Summed estimated cost for this group"),costUnit:he().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});Oe({name:At(he()).nonempty().describe("Metric name(s)"),interval:Fk,aggregation:wv,distinctColumn:Cbe,filters:IM.optional(),groupBy:Bk.optional()}).refine(_C.check,_C.options).describe("Arguments for getting metric time series");Oe({series:At(Oe({name:he().describe("Series name (metric name or group key)"),costUnit:he().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:At(Oe({timestamp:Vj,value:qj,estimatedCost:Et().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});Oe({name:he().describe("Metric name"),percentiles:xbe,interval:Fk,filters:IM.optional()}).describe("Arguments for getting metric percentiles");Oe({series:At(Oe({percentile:kbe,points:At(Oe({timestamp:Vj,value:_be}))}))});Oe({prefix:he().optional().describe("Filter metric names by prefix"),limit:Et().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");Oe({names:At(he()).describe("Distinct metric names")});Oe({metricName:he().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");Oe({keys:At(he()).describe("Distinct label keys for the metric")});Oe({metricName:he().describe("Metric name"),labelKey:he().describe("Label key to get values for"),prefix:he().optional().describe("Filter values by prefix"),limit:Et().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");Oe({values:At(he()).describe("Distinct label values")});Oe({}).describe("Arguments for getting entity types");Oe({entityTypes:At(Hj).describe("Distinct entity types")});Oe({entityType:Hj.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");Oe({names:At(he()).describe("Distinct entity names")});Oe({}).describe("Arguments for getting service names");Oe({serviceNames:At(he()).describe("Distinct service names")});Oe({}).describe("Arguments for getting environments");Oe({environments:At(he()).describe("Distinct environments")});Oe({entityType:Hj.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");Oe({tags:At(he()).describe("Distinct tags")});function jyt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=jyt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Tyt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=jyt(e))&&(r&&(r+=" "),r+=t);return r}const MLe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,DLe=Tyt,Uk=(e,t)=>n=>{var r;if(t?.variants==null)return DLe(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=n?.[u],f=a?.[u];if(d===null)return null;const p=MLe(d)||MLe(f);return s[u][p]}),l=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...a,...l}[g]):{...a,...l}[g]===v})?[...u,f,p]:u},[]);return DLe(e,i,c,n?.class,n?.className)},Uqn=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},qqn=(e,t)=>({classGroupId:e,validator:t}),Nyt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wF="-",LLe=[],Vqn="arbitrary..",Hqn=e=>{const t=Wqn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Zqn(i);const l=i.split(wF),c=l[0]===""&&l.length>1?1:0;return Ayt(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],u=n[i];return c?u?Uqn(u,c):c:u||LLe}return n[i]||LLe}}},Ayt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=Ayt(e,t+1,a);if(u)return u}const i=n.validators;if(i===null)return;const l=t===0?e.join(wF):e.slice(t).join(wF),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(l))return d.classGroupId}},Zqn=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Vqn+r:void 0})(),Wqn=e=>{const{theme:t,classGroups:n}=e;return Qqn(n,t)},Qqn=(e,t)=>{const n=Nyt();for(const r in e){const s=e[r];jbe(s,n,r,t)}return n},jbe=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];Gqn(i,t,n,r)}},Gqn=(e,t,n,r)=>{if(typeof e=="string"){Yqn(e,t,n);return}if(typeof e=="function"){Xqn(e,t,n,r);return}Kqn(e,t,n,r)},Yqn=(e,t,n)=>{const r=e===""?t:Iyt(t,e);r.classGroupId=n},Xqn=(e,t,n,r)=>{if(Jqn(e)){jbe(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(qqn(n,e))},Kqn=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];jbe(c,Iyt(t,l),n,r)}},Iyt=(e,t)=>{let n=e;const r=t.split(wF),s=r.length;for(let a=0;a<s;a++){const i=r[a];let l=n.nextPart.get(i);l||(l=Nyt(),n.nextPart.set(i,l)),n=l}return n},Jqn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,eVn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,i)=>{n[a]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return s(a,i),i},set(a,i){a in n?n[a]=i:s(a,i)}}},gue="!",zLe=":",tVn=[],FLe=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),nVn=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=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===zLe){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 p=f,h=!1;f.endsWith(gue)?(p=f.slice(0,-1),h=!0):f.startsWith(gue)&&(p=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return FLe(a,h,p,m)};if(t){const s=t+zLe,a=r;r=i=>i.startsWith(s)?a(i.slice(s.length)):FLe(tVn,!1,i,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},rVn=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const i=n[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},sVn=e=>({cache:eVn(e.cacheSize),parseClassName:nVn(e),sortModifiers:rVn(e),...Hqn(e)}),aVn=/\s+/,iVn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(aVn);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!g,x=r(v?m.substring(0,g):m);if(!x){if(!v){c=d+(c.length>0?" "+c:c);continue}if(x=r(m),!x){c=d+(c.length>0?" "+c:c);continue}v=!1}const w=p.length===0?"":p.length===1?p[0]:a(p).join(":"),S=h?w+gue:w,_=S+x;if(i.indexOf(_)>-1)continue;i.push(_);const O=s(x,v);for(let E=0;E<O.length;++E){const T=O[E];i.push(S+T)}c=d+(c.length>0?" "+c:c)}return c},oVn=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Ryt(n))&&(s&&(s+=" "),s+=r);return s},Ryt=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ryt(e[r]))&&(n&&(n+=" "),n+=t);return n},BLe=(e,...t)=>{let n,r,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=sVn(u),r=n.cache.get,s=n.cache.set,a=l,l(c)},l=c=>{const u=r(c);if(u)return u;const d=iVn(c,n);return s(c,d),d};return a=i,(...c)=>a(oVn(...c))},lVn=[],El=e=>{const t=n=>n[e]||lVn;return t.isThemeGetter=!0,t},Pyt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$yt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cVn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,uVn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dVn=/\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$/,fVn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pVn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hVn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lx=e=>cVn.test(e),ss=e=>!!e&&!Number.isNaN(Number(e)),cx=e=>!!e&&Number.isInteger(Number(e)),rY=e=>e.endsWith("%")&&ss(e.slice(0,-1)),Kv=e=>uVn.test(e),Myt=()=>!0,mVn=e=>dVn.test(e)&&!fVn.test(e),Tbe=()=>!1,gVn=e=>pVn.test(e),vVn=e=>hVn.test(e),yVn=e=>!An(e)&&!Dn(e),bVn=e=>fw(e,zyt,Tbe),An=e=>Pyt.test(e),Kw=e=>fw(e,Fyt,mVn),ULe=e=>fw(e,CVn,ss),xVn=e=>fw(e,Uyt,Myt),wVn=e=>fw(e,Byt,Tbe),qLe=e=>fw(e,Dyt,Tbe),SVn=e=>fw(e,Lyt,vVn),T4=e=>fw(e,qyt,gVn),Dn=e=>$yt.test(e),BN=e=>qk(e,Fyt),kVn=e=>qk(e,Byt),VLe=e=>qk(e,Dyt),_Vn=e=>qk(e,zyt),OVn=e=>qk(e,Lyt),N4=e=>qk(e,qyt,!0),EVn=e=>qk(e,Uyt,!0),fw=(e,t,n)=>{const r=Pyt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qk=(e,t,n=!1)=>{const r=$yt.exec(e);return r?r[1]?t(r[1]):n:!1},Dyt=e=>e==="position"||e==="percentage",Lyt=e=>e==="image"||e==="url",zyt=e=>e==="length"||e==="size"||e==="bg-size",Fyt=e=>e==="length",CVn=e=>e==="number",Byt=e=>e==="family-name",Uyt=e=>e==="number"||e==="weight",qyt=e=>e==="shadow",HLe=()=>{const e=El("color"),t=El("font"),n=El("text"),r=El("font-weight"),s=El("tracking"),a=El("leading"),i=El("breakpoint"),l=El("container"),c=El("spacing"),u=El("radius"),d=El("shadow"),f=El("inset-shadow"),p=El("text-shadow"),h=El("drop-shadow"),m=El("blur"),g=El("perspective"),v=El("aspect"),x=El("ease"),w=El("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[..._(),Dn,An],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[Dn,An,c],N=()=>[lx,"full","auto",...j()],I=()=>[cx,"none","subgrid",Dn,An],P=()=>["auto",{span:["full",cx,Dn,An]},cx,Dn,An],R=()=>[cx,"auto",Dn,An],B=()=>["auto","min","max","fr",Dn,An],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...j()],z=()=>[lx,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],q=()=>[lx,"screen","full","dvw","lvw","svw","min","max","fit",...j()],Z=()=>[lx,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],D=()=>[e,Dn,An],G=()=>[..._(),VLe,qLe,{position:[Dn,An]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",_Vn,bVn,{size:[Dn,An]}],W=()=>[rY,BN,Kw],Q=()=>["","none","full",u,Dn,An],J=()=>["",ss,BN,Kw],ae=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[ss,rY,VLe,qLe],ie=()=>["","none",m,Dn,An],pe=()=>["none",ss,Dn,An],X=()=>["none",ss,Dn,An],ne=()=>[ss,Dn,An],le=()=>[lx,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kv],breakpoint:[Kv],color:[Myt],container:[Kv],"drop-shadow":[Kv],ease:["in","out","in-out"],font:[yVn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kv],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kv],shadow:[Kv],spacing:["px",ss],text:[Kv],"text-shadow":[Kv],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",lx,An,Dn,v]}],container:["container"],columns:[{columns:[ss,An,Dn,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:O()}],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:[cx,"auto",Dn,An]}],basis:[{basis:[lx,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ss,lx,"auto","initial","none",An]}],grow:[{grow:["",ss,Dn,An]}],shrink:[{shrink:["",ss,Dn,An]}],order:[{order:[cx,"first","last","none",Dn,An]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,BN,Kw]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,EVn,xVn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rY,An]}],"font-family":[{font:[kVn,wVn,t]}],"font-features":[{"font-features":[An]}],"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,Dn,An]}],"line-clamp":[{"line-clamp":[ss,"none",Dn,ULe]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",Dn,An]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Dn,An]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[ss,"from-font","auto",Dn,Kw]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[ss,"auto",Dn,An]}],"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",Dn,An]}],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",Dn,An]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cx,Dn,An],radial:["",Dn,An],conic:[cx,Dn,An]},OVn,SVn]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ss,Dn,An]}],"outline-w":[{outline:["",ss,BN,Kw]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,N4,T4]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,N4,T4]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[ss,Kw]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",p,N4,T4]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[ss,Dn,An]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ss]}],"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":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"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":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"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":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"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":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"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":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"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":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"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":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Dn,An]}],"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":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[ss]}],"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":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Dn,An]}],filter:[{filter:["","none",Dn,An]}],blur:[{blur:ie()}],brightness:[{brightness:[ss,Dn,An]}],contrast:[{contrast:[ss,Dn,An]}],"drop-shadow":[{"drop-shadow":["","none",h,N4,T4]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",ss,Dn,An]}],"hue-rotate":[{"hue-rotate":[ss,Dn,An]}],invert:[{invert:["",ss,Dn,An]}],saturate:[{saturate:[ss,Dn,An]}],sepia:[{sepia:["",ss,Dn,An]}],"backdrop-filter":[{"backdrop-filter":["","none",Dn,An]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[ss,Dn,An]}],"backdrop-contrast":[{"backdrop-contrast":[ss,Dn,An]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ss,Dn,An]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ss,Dn,An]}],"backdrop-invert":[{"backdrop-invert":["",ss,Dn,An]}],"backdrop-opacity":[{"backdrop-opacity":[ss,Dn,An]}],"backdrop-saturate":[{"backdrop-saturate":[ss,Dn,An]}],"backdrop-sepia":[{"backdrop-sepia":["",ss,Dn,An]}],"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",Dn,An]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ss,"initial",Dn,An]}],ease:[{ease:["linear","initial",x,Dn,An]}],delay:[{delay:[ss,Dn,An]}],animate:[{animate:["none",w,Dn,An]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Dn,An]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[Dn,An,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"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:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",Dn,An]}],"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",Dn,An]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[ss,BN,Kw,ULe]}],stroke:[{stroke:["none",...D()]}],"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"]}},jVn=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(TA(e,"cacheSize",t),TA(e,"prefix",n),TA(e,"experimentalParseClassName",r),A4(e.theme,a.theme),A4(e.classGroups,a.classGroups),A4(e.conflictingClassGroups,a.conflictingClassGroups),A4(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),TA(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),I4(e.theme,s.theme),I4(e.classGroups,s.classGroups),I4(e.conflictingClassGroups,s.conflictingClassGroups),I4(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Vyt(e,s,"orderSensitiveModifiers"),e),TA=(e,t,n)=>{n!==void 0&&(e[t]=n)},A4=(e,t)=>{if(t)for(const n in t)TA(e,n,t[n])},I4=(e,t)=>{if(t)for(const n in t)Vyt(e,t,n)},Vyt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},TVn=(e,...t)=>typeof e=="function"?BLe(HLe,e,...t):BLe(()=>jVn(HLe(),e),...t),NVn=Object.keys({...ky,...jJt}),AVn=Object.keys(PJt),IVn=Object.keys(TJt),RVn=Object.keys(NJt),PVn=Object.keys(CJt),Jw=Object.keys(RJt),$Vn=Object.keys(AJt).concat(Object.keys(IJt)),MVn=TVn({extend:{theme:{color:NVn,spacing:AVn,radius:PVn,leading:RVn,shadow:$Vn},classGroups:{"font-size":[{text:IVn}],h:[{h:Jw}],w:[{w:Jw}],size:[{size:Jw}],"min-h":[{"min-h":Jw}],"min-w":[{"min-w":Jw}],"max-h":[{"max-h":Jw}],"max-w":[{"max-w":Jw}]}}});function Y(...e){return MVn(Tyt(e))}const Gd=VWt,nr=HWt,rr=ZWt,Kn=b.forwardRef(({className:e,sideOffset:t=4,children:n,...r},s)=>o.jsx(WWt,{children:o.jsxs(pKe,{ref:s,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface3 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r,children:[n,o.jsx(QWt,{className:"fill-surface3"})]})}));Kn.displayName=pKe.displayName;const DVn={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"},Ne=({children:e,className:t,size:n="default",...r})=>o.jsx("span",{className:Y("block",DVn[n],t),...r,children:e}),Hc={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},BU="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",LVn="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",zVn="rounded-md",Hyt="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",Nbe="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",Abe="disabled:opacity-50 disabled:cursor-not-allowed",R4=Y("gap-[.75em] rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),Qj=Uk(Y("inline-flex items-center justify-center leading-0 cursor-pointer","transition-all duration-normal ease-out-custom",Abe,Nbe),{variants:{variant:{default:"bg-surface3 border-2 border-border1 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",primary:"bg-surface4 border-2 border-border2 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",cta:"bg-accent1 border-2 border-transparent hover:bg-accent1/90 hover:shadow-glow-accent1 disabled:hover:shadow-none text-surface1 font-medium",ghost:"bg-transparent border-2 border-transparent hover:bg-surface4 hover:text-neutral6 active:bg-surface5 text-neutral4",outline:"bg-transparent border-2 border-border1 hover:bg-surface3 hover:text-neutral6 active:bg-surface4 text-neutral5",link:"inline-flex justify-start rounded-none h-auto px-0 bg-transparent text-neutral3 hover:text-neutral4 gap-1 [&>svg]:mx-0 w-auto [&>svg]:opacity-70"},size:{sm:Y(`${Hc.sm} text-ui-sm px-[.75em]`,R4),md:Y(`${Hc.md} text-ui-md px-[.75em]`,R4),default:Y(`${Hc.default} text-ui-md px-[.85em]`,R4),lg:Y(`${Hc.lg} text-ui-lg px-[1em]`,R4),"icon-sm":`${Hc.sm} w-form-sm rounded-md`,"icon-md":`${Hc.md} w-form-md rounded-md`,"icon-lg":`${Hc.lg} w-form-lg rounded-md`}},defaultVariants:{variant:"default",size:"default"}}),FVn={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function Zyt(e){const t=[];return Te.Children.forEach(e,n=>{Te.isValidElement(n)&&n.type===Te.Fragment?t.push(...Zyt(n.props.children)):t.push(n)}),t}function BVn(e){const t=Zyt(e);return t.length>0&&t.every(n=>Te.isValidElement(n))}function UVn(e){return typeof e=="string"&&e.startsWith("icon-")}const ce=Te.forwardRef(({className:e,as:t,size:n,variant:r="default",disabled:s,children:a,tooltip:i,"aria-label":l,...c},u)=>{const d=t||"button",f=UVn(n),p=n??"default",h=!f&&BVn(a),m=l??((f||h)&&typeof i=="string"?i:void 0),g=f?o.jsx(Ne,{size:FVn[n],children:a}):a,v=o.jsx(d,{ref:u,disabled:s,"aria-label":m,className:Y(Qj({variant:r,size:p}),h&&"[&>svg]:opacity-75",e),...c,children:g});return i?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:v}),o.jsx(Kn,{children:i})]}):v});ce.displayName="Button";const Kr=Te.forwardRef(({tooltipContent:e,...t},n)=>o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(ce,{ref:n,...t})}),e&&o.jsx(Kn,{children:e})]}));Kr.displayName="ButtonWithTooltip";const _r={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"},pw={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},Wyt=({children:e})=>o.jsx("nav",{className:"bg-surface2 min-h-full overflow-hidden",children:e}),SF=({children:e,as:t="a",href:n,className:r,prefetch:s,to:a})=>o.jsx(t,{href:n,prefetch:s,to:a,className:Y("text-ui-sm flex h-full w-full flex-col justify-center font-medium cursor-pointer",_r.colors,r),children:e}),Qyt=({children:e})=>o.jsx("ol",{"data-testid":"thread-list",children:e}),kF=({children:e,isActive:t,className:n})=>o.jsx("li",{className:Y("border-b border-border1 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",_r.colors,"hover:bg-surface3",t&&"bg-accent1Dark",n),children:e}),Gyt=({onClick:e})=>o.jsx(ce,{variant:"ghost",className:Y("shrink-0 opacity-0",_r.all,"group-focus-within:opacity-100 group-hover:opacity-100","hover:bg-surface4 hover:text-accent2"),onClick:e,children:o.jsx(Ne,{children:o.jsx(Uu,{"aria-label":"delete thread",className:"text-neutral3 hover:text-accent2 transition-colors"})})}),qVn={"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"},VVn={mono:"font-mono"},me=({as:e="p",className:t,variant:n="ui-md",font:r,...s})=>o.jsx(e,{className:Y(qVn[n],r&&VVn[r],t),...s}),HVn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},Yyt=({src:e,name:t,size:n="sm",interactive:r=!1})=>o.jsx("div",{className:Y(HVn[n],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",_r.all,r&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?o.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):o.jsx(me,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),ZVn={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"},WVn={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},kt=({icon:e,variant:t="default",className:n,children:r,...s})=>o.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",_r.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":ZVn[t],n),...s,children:[e&&o.jsx("span",{className:WVn[t],children:o.jsx(Ne,{children:e})}),r]}),QVn=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"})}),wi=({children:e,label:t})=>o.jsx("nav",{"aria-label":t,children:o.jsx("ol",{className:"gap-0.5 flex items-center",children:e})}),Fn=({className:e,as:t,isCurrent:n,action:r,...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":n?"page":void 0,className:Y("text-ui-md leading-ui-md flex items-center gap-2",_r.colors,n?"text-white":"text-neutral3 hover:text-neutral5",e),...s}),r]}),!n&&o.jsx("li",{role:"separator",className:"flex h-full items-center",children:o.jsx(Ne,{className:Y("text-neutral2",_r.colors),children:o.jsx(QVn,{})})})]})};function GVn(e,t=5){if(!e?.properties)return[];const n=[];function r(s,a,i){if(i>t)return;const l=Array.isArray(s.type)?s.type.join(" | "):s.type;if(n.push({path:a,label:a,description:s.description??s.title,type:l}),s.properties)for(const[c,u]of Object.entries(s.properties))r(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))r(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))r(a,s,1);return n}function YVn(e){const t=GVn(e);return Ptt({override:[XVn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function XVn(e){return t=>{const r=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!r)return null;const s=r[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,p)=>{const g=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:l,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const KVn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,JVn=dn.mark({class:"cm-variable-highlight"}),ZLe=new Qet({regexp:KVn,decoration:()=>JVn}),eHn=Gi.fromClass(class{decorations;constructor(e){this.decorations=ZLe.createDeco(e)}update(e){this.decorations=ZLe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),tHn=eHn,Xyt=({className:e,toastOptions:t,...n})=>o.jsx(ndn,{...n,closeButton:!0,richColors:!0,className:Y("mastra-toaster",e),toastOptions:{duration:5e3,...t}}),UU=(e,t)=>Array.isArray(e)?e.map(t):t(e),ze=(e,t={})=>{if(Array.isArray(e))return e.map(n=>wm(n,t));if(Te.isValidElement(e)||typeof e=="string")return wm(e,t);throw new Error("Invalid message type")};ze.success=(e,t={})=>UU(e,n=>wm.success(n,t));ze.error=(e,t={})=>UU(e,n=>wm.error(n,t));ze.warning=(e,t={})=>UU(e,n=>wm.warning(n,t));ze.info=(e,t={})=>UU(e,n=>wm.info(n,t));ze.custom=(e,t={})=>wm(e,t);ze.dismiss=e=>wm.dismiss(e);ze.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:s,onError:a,options:i={}})=>wm.promise(e,{loading:t??"Loading...",success:l=>(s?.(l),n),error:l=>(a?.(l),r||(l instanceof Error?l.message:"Error...")),...i});function np({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=b.useState(!1),s=b.useRef(null),a=b.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{ze.success(t),r(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{ze.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:a}}function _a({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:s}){const[a,i]=b.useState(!1),{handleCopy:l}=np({text:e,copyMessage:t}),c=()=>{l(),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(ce,{onClick:c,type:"button",size:r,className:s,"aria-label":a?"Copied!":n,children:a?o.jsx(ub,{}):o.jsx(fJe,{})})}),o.jsx(Kn,{children:a?"Copied!":n})]})}const nHn="mastra-theme",rHn="mastra-playground-store",vue=e=>e==="dark"||e==="light"||e==="system",sHn=e=>{try{const t=e.getItem(rHn);if(!t)return;const r=JSON.parse(t)?.state?.theme;return vue(r)?r:void 0}catch{return}},aHn=(e=nHn)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(vue(t))return t;const n=sHn(window.localStorage);return n?(window.localStorage.setItem(e,n),n):null}catch{return null}},set(t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},subscribe(t){if(typeof window>"u")return()=>{};const n=r=>{if(r.key===e){if(r.newValue===null){t(null);return}vue(r.newValue)&&t(r.newValue)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)}}),Kyt=b.createContext(null),Jyt="(prefers-color-scheme: dark)",iHn=typeof window>"u"?b.useEffect:b.useLayoutEffect,ebt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(Jyt).matches?"dark":"light",tbt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(Jyt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},oHn=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},nbt=({children:e,defaultTheme:t="system",storageKey:n,target:r})=>{const s=b.useMemo(()=>aHn(n),[n]),a=b.useRef(null),[i,l]=b.useState(()=>s.get()??t),c=b.useSyncExternalStore(tbt,ebt,()=>"dark");b.useEffect(()=>s.subscribe(f=>l(f??t)),[s,t]);const u=i==="system"?c:i;iHn(()=>{const f=r??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&oHn(f,u),a.current=f},[u,r]);const d=b.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{l(f),s.set(f)}}),[i,u,c,s]);return o.jsx(Kyt.Provider,{value:d,children:e})},lHn=()=>{},Gj=()=>{const e=b.useContext(Kyt),t=b.useSyncExternalStore(tbt,ebt,()=>"dark");return b.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:lHn},[e,t])};function cHn(){const e=kj({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=vt.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 uHn(){const e=vt.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=Im.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,tw(t)]}const kb=()=>{const e=Gj().resolvedTheme==="dark";return b.useMemo(()=>e?cHn():uHn(),[e])},fs=b.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:l,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...p},h)=>{const m=kb(),g=e?JSON.stringify(e,null,2):t??"",v=b.useMemo(()=>{const x=[];return a==="json"?x.push(Bf):a==="markdown"&&(x.push(fme({base:C1,codeLanguages:nrt})),x.push(vt.lineWrapping)),i&&a==="markdown"&&x.push(tHn),c&&a==="markdown"&&x.push(YVn(c)),f===!1&&x.push(es.readOnly.of(!0)),x},[a,i,c,f]);return o.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...p,children:[r&&o.jsx(_a,{content:g,className:"absolute top-2 right-2 z-20"}),o.jsx(eu,{ref:h,value:g,theme:m,extensions:v,onChange:n,editable:f,"aria-label":"Code editor",placeholder:l,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function dHn(e,t){const{codeToTokens:n,bundledLanguages:r}=await tt(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-J2K1uPqD.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in r))return null;const{tokens:s}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function ki({iconSlot:e,titleSlot:t,descriptionSlot:n,actionSlot:r,className:s,as:a="h3"}){return o.jsxs("div",{className:Y("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&o.jsx("div",{className:"mb-4",children:e}),o.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),n&&o.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:n}),r&&o.jsx("div",{className:"mt-5",children:r})]})}const Ma=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"})]}),fHn=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"})]}),Ibe=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"})]}),Rbe=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"})]}),hw=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"})}),rbt=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)"})})})]}),sbt=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)"})})})]}),pHn=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"})]}),qU=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"})}),Pbe=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"})}),co=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"})}),Yj=e=>o.jsx(OJt,{...e}),uo=e=>o.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),Gl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),o.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),VU=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 om(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 abt=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)"})})})]}),hHn=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"})}),mHn=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"})})}),ibt=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}})}),gHn=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"})]})]}),vHn=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"})})]}),yHn=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"})}),bHn=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"})]}),xHn=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"})})})]}),WLe=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"})}),wHn=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"})]})}),pp=({children:e,className:t,onClick:n})=>o.jsx("div",{tabIndex:n?0:void 0,onKeyDown:r=>{n&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n?.())},className:Y("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",n&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:n,children:e}),obt=({children:e,className:t,style:n})=>o.jsx(Ne,{size:"lg",className:Y("text-neutral3 mt-1 shrink-0",t),style:n,children:e}),hp=({children:e,className:t})=>o.jsx(me,{as:"p",variant:"ui-lg",className:Y("text-neutral6 font-medium",t),children:e}),mp=({children:e,className:t})=>o.jsx(me,{as:"div",variant:"ui-sm",className:Y("text-neutral3",t),children:e}),gp=({children:e,className:t})=>o.jsx("div",{className:Y("flex-1 w-full",t),children:e});function Js({resource:e,title:t,description:n,actionSlot:r,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(ki,{className:s,iconSlot:o.jsx(Ne,{size:"lg",className:"text-neutral3",children:o.jsx(cJt,{})}),titleSlot:t??a,descriptionSlot:n??i,actionSlot:r})}function ca({title:e,description:t,className:n}){const[r,s]=b.useState(!1),a=Ze(),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}),p=`${l}${d}/auth/sso/login?${f}`,h=await fetch(p,{credentials:"include",headers:{"Content-Type":"application/json"}});if(h.ok){const m=await h.json();window.location.href=m.url}}finally{s(!1)}},[a]);return o.jsx(ki,{className:n,iconSlot:o.jsx(Ne,{size:"lg",className:"text-neutral3",children:o.jsx(eJt,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:o.jsx(ce,{variant:"default",onClick:i,disabled:r,children:r?"Redirecting...":"Log in"})})}const Br=({children:e,border:t=!0,className:n})=>o.jsx("header",{className:Y("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},n),children:e}),$d=({children:e})=>o.jsx(me,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),Ku=({children:e})=>o.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),SHn=({children:e})=>o.jsx("div",{className:"gap-2 flex items-center",children:e}),t0=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"})}),kHn={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},_Hn=({className:e,children:t,size:n="default",style:r})=>o.jsx("table",{className:Y("w-full",kHn[n],e),style:r,children:t}),OHn=({className:e,children:t})=>o.jsx("thead",{children:o.jsx("tr",{className:Y("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),EHn=({className:e,children:t,...n})=>o.jsx("th",{className:Y("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...n,children:t}),CHn=({className:e,children:t,...n})=>o.jsx("tbody",{className:Y("",e),...n,children:t}),jHn=b.forwardRef(({className:e,children:t,selected:n=!1,style:r,onClick:s,isActive:a=!1,...i},l)=>{const c=b.useRef(null);b.useEffect(()=>{l&&(typeof l=="function"?l(c.current):l.current=c.current)},[l]),b.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return o.jsx("tr",{className:Y("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-hidden focus:ring-1 focus:ring-inset focus:ring-accent1/50",n&&"bg-surface4",s&&"cursor-pointer",e),style:r,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),THn=({className:e,children:t,...n})=>o.jsx("td",{className:Y("text-neutral5 first:pl-3 last:pr-3",e),...n,children:o.jsx("div",{className:Y("flex h-full w-full shrink-0 items-center"),children:t})}),NHn=Uk(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","min-h-[80px] resize-y"),{variants:{variant:{default:Y(Hyt,Nbe,Abe),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"}}),Kc=b.forwardRef(({className:e,size:t,testId:n,variant:r,error:s,...a},i)=>o.jsx("textarea",{className:Y(NHn({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:i,"aria-invalid":s,...a}));Kc.displayName="Textarea";const AHn=hfn,IHn=mfn,lbt=gfn;function Ht({open:e,onOpenChange:t,children:n}){return o.jsx(AHn,{open:e,onOpenChange:t,children:n})}const $be=b.forwardRef(({className:e,...t},n)=>o.jsx($st,{ref:n,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));$be.displayName=$st.displayName;const cbt=b.forwardRef(({className:e,...t},n)=>o.jsxs(lbt,{children:[o.jsx($be,{}),o.jsx(Mst,{ref:n,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...t})]}));cbt.displayName=Mst.displayName;const ubt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});ubt.displayName="AlertDialogHeader";const dbt=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});dbt.displayName="AlertDialogFooter";const fbt=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});fbt.displayName="AlertDialogBody";const pbt=b.forwardRef(({className:e,...t},n)=>o.jsx(zst,{ref:n,className:Y("text-ui-md font-medium",e),...t}));pbt.displayName=zst.displayName;const hbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Fst,{ref:n,className:Y("text-ui-sm text-neutral3",e),...t}));hbt.displayName=Fst.displayName;const mbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Dst,{ref:n,className:Y(Qj({variant:"primary",size:"default"}),e),...t}));mbt.displayName=Dst.displayName;const gbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Lst,{ref:n,className:Y(Qj({variant:"default",size:"default"}),e),...t}));gbt.displayName=Lst.displayName;Ht.Trigger=IHn;Ht.Portal=lbt;Ht.Overlay=$be;Ht.Content=cbt;Ht.Header=ubt;Ht.Footer=dbt;Ht.Body=fbt;Ht.Title=pbt;Ht.Description=hbt;Ht.Action=mbt;Ht.Cancel=gbt;const Di=b.forwardRef(({className:e,...t},n)=>o.jsx(Eme,{ref:n,className:Y("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",_r.all,"hover:border-neutral5 hover:shadow-md",BU,"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(Vst,{className:Y("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(ub,{className:"h-3.5 w-3.5 stroke-3"})})}));Di.displayName=Eme.displayName;const Om=_fn,yh=Te.forwardRef(({className:e,children:t,...n},r)=>o.jsx(jme,{ref:r,className:Y("-outline-offset-2",_r.colors,pw.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...n,children:t}));yh.displayName=jme.displayName;const bh=Te.forwardRef(({className:e,children:t,...n},r)=>o.jsx(Nme,{ref:r,className:Y("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...n,children:t}));bh.displayName=Nme.displayName;const Nr={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:Y("min-w-(--anchor-width) w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-(--transform-origin)","transition-[transform,scale,opacity] duration-150 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0"),positioner:"z-50 pointer-events-auto",searchContainer:Y("flex items-center border-b border-border1 px-3 py-2",_r.colors),searchIcon:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",_r.colors),searchInput:Y("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",_r.colors),empty:"not-empty:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:Y("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",_r.colors,"data-highlighted:bg-surface5 data-highlighted:text-neutral5"),itemSelected:"data-selected:bg-accent1Dark data-selected:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:Y("h-4 w-4 text-accent1",_r.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 jc({options:e,value:t,onValueChange:n,placeholder:r="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:l=!1,variant:c="default",size:u="default",open:d,onOpenChange:f,container:p,error:h}){const m=e.find(v=>v.value===t)??null,g=v=>{v&&n?.(v.value)};return o.jsxs("div",{className:Nr.root,children:[o.jsxs(Wat,{items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(tit,{className:Y(Qj({variant:c,size:u}),Nr.trigger,h&&Nr.triggerError,i),children:[o.jsxs("span",{className:"truncate flex items-center gap-2",children:[m?.start,o.jsx(tmn,{placeholder:r})]}),o.jsx($$,{className:Nr.chevron})]}),o.jsx(ait,{container:p,children:o.jsx(lit,{align:"start",sideOffset:4,className:Nr.positioner,children:o.jsxs(cit,{className:Nr.popup,children:[o.jsxs("div",{className:Nr.searchContainer,children:[o.jsx(WE,{className:Nr.searchIcon}),o.jsx(eit,{className:Nr.searchInput,placeholder:s})]}),o.jsx(hit,{className:Nr.empty,children:a}),o.jsx(rit,{className:Nr.list,children:v=>o.jsxs(pit,{value:v,className:Y(Nr.item,Nr.itemSelected),children:[o.jsx("span",{className:Nr.checkContainer,children:o.jsx(Umn,{children:o.jsx(ub,{className:Nr.checkIcon})})}),o.jsxs("span",{className:Nr.optionContent,children:[v.start,o.jsxs("span",{className:Nr.optionText,children:[o.jsx("span",{className:Nr.optionLabel,children:v.label}),v.description&&o.jsx("span",{className:Nr.optionDescription,children:v.description})]}),v.end?o.jsx("div",{className:Nr.optionEnd,children:v.end}):null]})]},v.value)})]})})})]}),h&&o.jsx("span",{className:Nr.error,children:h})]})}function vbt({options:e,value:t=[],onValueChange:n,placeholder:r="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:p,error:h}){const m=e.filter(x=>t.includes(x.value)),g=x=>{x&&n?.(x.map(w=>w.value))},v=m.length===0?r:`${m.length} selected`;return o.jsxs("div",{className:Nr.root,children:[o.jsxs(Wat,{multiple:!0,items:e,value:m,onValueChange:g,disabled:l,open:d,onOpenChange:f,children:[o.jsxs(tit,{className:Y(Qj({variant:c,size:u}),Nr.trigger,h&&Nr.triggerError,i),children:[o.jsx("span",{className:Y("truncate",m.length===0&&Nr.placeholder),children:v}),o.jsx($$,{className:Nr.chevron})]}),o.jsx(ait,{container:p,children:o.jsx(lit,{align:"start",sideOffset:4,className:Nr.positioner,children:o.jsxs(cit,{className:Nr.popup,children:[o.jsxs("div",{className:Nr.searchContainer,children:[o.jsx(WE,{className:Nr.searchIcon}),o.jsx(eit,{className:Nr.searchInput,placeholder:s})]}),o.jsx(hit,{className:Nr.empty,children:a}),o.jsx(rit,{className:Nr.list,children:x=>{const w=t.includes(x.value);return o.jsxs(pit,{value:x,className:Nr.item,children:[o.jsx("span",{className:Y(Nr.checkbox,w?Nr.checkboxSelected:Nr.checkboxUnselected),children:w&&o.jsx(ub,{className:Nr.checkboxIcon})}),o.jsxs("span",{className:Nr.optionContent,children:[x.start,o.jsxs("span",{className:Nr.optionText,children:[o.jsx("span",{className:Nr.optionLabel,children:x.label}),x.description&&o.jsx("span",{className:Nr.optionDescription,children:x.description})]}),x.end?o.jsx("div",{className:Nr.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),h&&o.jsx("span",{className:Nr.error,children:h})]})}const $r=J8,ybt=wst,RHn=eB,PHn=Q$,bbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Z$,{ref:n,className:Y("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));bbt.displayName=Z$.displayName;const Ar=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(RHn,{children:[o.jsx(bbt,{}),o.jsxs(W$,{ref:r,className:Y("dialog-content-anim","fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%]","w-full max-w-[calc(100%-2rem)] sm:max-w-lg","rounded-xl border border-border1/40 bg-surface2/96 backdrop-blur-md shadow-dialog",e),...n,children:[t,o.jsx(Q$,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:o.jsx(Uu,{})})})]})]}));Ar.displayName=W$.displayName;const Mr=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Mr.displayName="DialogHeader";const rp=({className:e,...t})=>o.jsx("div",{className:Y("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});rp.displayName="DialogFooter";const ts=({className:e,...t})=>o.jsx("div",{className:Y("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});ts.displayName="DialogBody";const Ir=b.forwardRef(({className:e,...t},n)=>o.jsx(tB,{ref:n,className:Y("text-ui-md font-medium",e),...t}));Ir.displayName=tB.displayName;const fa=b.forwardRef(({className:e,...t},n)=>o.jsx(nB,{ref:n,className:Y("sr-only",e),...t}));fa.displayName=nB.displayName;const xbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd,{ref:n,className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-surface3 text-neutral5",e),...t}));xbt.displayName=Zd.displayName;const $Hn=({children:e,title:t="Command Palette",description:n="Search for commands and actions",...r})=>{const s=b.useCallback((i,l)=>{const c=i.toLowerCase();return l.toLowerCase().split(/\s+/).filter(Boolean).every(p=>c.includes(p))?1:0},[]),a=b.useCallback(i=>{i.stopPropagation()},[]);return o.jsx($r,{...r,children:o.jsxs(Ar,{className:"overflow-hidden p-0",children:[o.jsx(Ir,{className:"sr-only",children:t}),o.jsx(fa,{className:"sr-only",children:n}),o.jsx(xbt,{filter:s,onKeyDown:a,className:Y("**:[[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3","[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2","[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5","**:[[cmdk-input]]:h-12","**:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3","[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"),children:e})]})})},wbt=b.forwardRef(({className:e,...t},n)=>o.jsxs("div",{className:Y("flex items-center border-b border-border1 px-3",_r.colors),"cmdk-input-wrapper":"",children:[o.jsx(WE,{className:Y("mr-2 h-4 w-4 shrink-0 text-neutral3",_r.colors)}),o.jsx(Zd.Input,{ref:n,className:Y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-hidden",_r.colors,e),...t})]}));wbt.displayName=Zd.Input.displayName;const Sbt=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd.List,{ref:n,className:Y("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Sbt.displayName=Zd.List.displayName;const kbt=b.forwardRef((e,t)=>o.jsx(Zd.Empty,{ref:t,className:"py-6 text-center text-sm text-neutral3",...e}));kbt.displayName=Zd.Empty.displayName;const vx=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd.Group,{ref:n,className:Y("overflow-hidden p-1 text-neutral5","**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral3",e),...t}));vx.displayName=Zd.Group.displayName;const gS=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd.Separator,{ref:n,className:Y("-mx-1 h-px bg-border1",e),...t}));gS.displayName=Zd.Separator.displayName;const Cl=b.forwardRef(({className:e,...t},n)=>o.jsx(Zd.Item,{ref:n,className:Y("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden",_r.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}));Cl.displayName=Zd.Item.displayName;const _bt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest text-neutral3",e),...t});_bt.displayName="CommandShortcut";function Obt({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg p-6 bg-surface2",t),children:e})}const MHn=zvn,DHn=Fvn,LHn=rM,zHn=qvn,FHn=Bvn,Mbe=Y("relative flex cursor-pointer select-none items-center gap-3 rounded-lg px-3 py-1.5 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-hidden focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&>svg]:mx-[-.25em] [&:hover>svg]:opacity-100"),Ebt=b.forwardRef(({className:e,children:t,...n},r)=>o.jsx(vot,{ref:r,className:Y("cursor-pointer",e),...n,children:t}));Ebt.displayName=vot.displayName;const Cbt=b.forwardRef(({className:e,inset:t,children:n,...r},s)=>o.jsxs(_ot,{ref:s,className:Y(Mbe,"data-[state=open]:bg-surface4",t&&"pl-8",e),...r,children:[n,o.jsx("span",{className:"ml-auto pl-2",children:o.jsx(ahe,{className:"-rotate-90 opacity-50"})})]}));Cbt.displayName=_ot.displayName;const jbt=b.forwardRef(({className:e,...t},n)=>o.jsx(rM,{children:o.jsx(mB,{ref:n,className:Y("bg-surface3 backdrop-blur-xl data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...t})}));jbt.displayName=mB.displayName;const Tbt=b.forwardRef(({className:e,container:t,sideOffset:n=8,...r},s)=>o.jsx(rM,{container:t,children:o.jsx(yot,{ref:s,sideOffset:n,className:Y("bg-surface3 data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 backdrop-blur-xl text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--radix-dropdown-menu-content-available-height))] overflow-x-hidden overflow-y-auto rounded-xl border-2 border-border1/50 p-1 shadow-md",e),...r})}));Tbt.displayName=yot.displayName;const Nbt=b.forwardRef(({className:e,...t},n)=>o.jsx(xot,{ref:n,className:Y(Mbe,e),...t}));Nbt.displayName=xot.displayName;const Abt=b.forwardRef(({className:e,children:t,checked:n,...r},s)=>o.jsxs(wot,{ref:s,className:Y(Mbe,"w-full gap-4 px-2",e),checked:n,...r,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:n&&o.jsx(ub,{})}),t]}));Abt.displayName=wot.displayName;const Ibt=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Sot,{ref:r,className:Y("relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm transition-colors text-neutral4 dark:hover:text-white dark:focus:text-white hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 active:bg-surface5 data-disabled:pointer-events-none data-disabled:opacity-50 focus-visible:outline-hidden focus-visible:ring-0",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Uvn,{children:o.jsx(dJe,{className:"h-2 w-2 fill-current"})})}),t]}));Ibt.displayName=Sot.displayName;const Rbt=b.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(bot,{ref:r,className:Y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Rbt.displayName=bot.displayName;const Pbt=b.forwardRef(({className:e,...t},n)=>o.jsx(kot,{ref:n,className:Y("bg-border1/50 -mx-1.5 my-1 h-0.5",e),...t}));Pbt.displayName=kot.displayName;const $bt=({className:e,...t})=>o.jsx("span",{className:Y("ml-auto text-xs tracking-widest opacity-60",e),...t});$bt.displayName="DropdownMenuShortcut";function St({open:e,onOpenChange:t,children:n,modal:r}){return o.jsx(MHn,{modal:r,open:e,onOpenChange:t,children:n})}St.Trigger=Ebt;St.Content=Tbt;St.Group=DHn;St.Portal=LHn;St.Item=Nbt;St.CheckboxItem=Abt;St.RadioItem=Ibt;St.Label=Rbt;St.Separator=Pbt;St.Shortcut=$bt;St.Sub=zHn;St.SubContent=jbt;St.SubTrigger=Cbt;St.RadioGroup=FHn;const P4=({label:e,children:t})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function Dr({className:e,...t}){return o.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:-translate-x-full","before:animate-[shimmer_2s_infinite]","before:bg-linear-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const Mbt=({icon:e,title:t,isLoading:n,children:r})=>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(Ne,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),n?o.jsx(Dr,{className:"h-3 w-1/3"}):o.jsx("div",{className:"flex min-w-0 items-center gap-4",children:o.jsx(me,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),r&&o.jsx("div",{className:"pt-2",children:r})]});function BHn({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",t),children:e})}function UHn({children:e}){return o.jsxs("p",{className:Y("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[o.jsx(M$,{})," ",e]})}function qHn({children:e}){return o.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function VHn({children:e,name:t,required:n,size:r="default",className:s}){return o.jsxs("label",{htmlFor:`input-${t}`,className:Y("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":r==="bigger"},s),children:[e,n&&o.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function HHn({children:e,className:t,layout:n="vertical",labelColumnWidth:r}){return o.jsx("div",{className:Y("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":n==="horizontal"},t),style:n==="horizontal"&&r?{gridTemplateColumns:`${r} 1fr`}:void 0,children:e})}const Qo=Object.assign({},{Layout:HHn,Column:BHn,Label:VHn,HelpText:qHn,ErrorMsg:UHn});function ZHn({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-6 content-start",t),children:e})}function WHn({children:e,className:t,columns:n=1,gap:r}){return o.jsx("div",{className:Y("grid",{"grid-cols-1":n===1,"grid-cols-2":n===2},r??"gap-6",t),children:e})}Object.assign(WHn,{Column:ZHn});const QHn=Uk(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(Hyt,Nbe,Abe),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Hc.sm} text-ui-sm px-[.75em]`,md:`${Hc.md} text-ui-md px-[.75em]`,default:`${Hc.default} text-ui-md px-[.85em]`,lg:`${Hc.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),mn=b.forwardRef(({className:e,size:t,testId:n,variant:r,type:s,error:a,...i},l)=>o.jsx("input",{type:s,className:Y(QHn({variant:r,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:l,"aria-invalid":a,...i}));mn.displayName="Input";function E0({name:e,value:t,label:n,labelIsHidden:r=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:l=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:p="default",testId:h,className:m,...g}){return o.jsxs(Qo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?o.jsx(Qo.Column,{children:o.jsx(Qo.Label,{name:e,required:l,size:u||"bigger",children:r?o.jsx(Kf,{children:n}):n})}):null,o.jsxs(Qo.Column,{children:[!r&&d==="vertical"?o.jsx(Qo.Label,{name:e,required:l,size:u||"default",children:n}):null,o.jsx(mn,{name:e,disabled:c,required:l,value:t,placeholder:f,"data-testid":h,size:p,...g}),a&&o.jsx(Qo.HelpText,{children:a}),i&&o.jsx(Qo.ErrorMsg,{children:i})]})]})}function C0({name:e,helpText:t,errorMsg:n,required:r=!1,disabled:s=!1,value:a,label:i,labelIsHidden:l=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:p,size:h,isMinimized:m,onMinimizedChange:g}){const v=b.useRef(null);return b.useEffect(()=>{m===!1&&v.current?.focus()},[m]),m?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(ce,{size:h||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:o.jsx(WE,{})})}),o.jsx(Kn,{children:i||"Search"})]}):o.jsxs(Qo.Layout,{layout:c,className:p,children:[c==="horizontal"?o.jsx(Qo.Column,{children:o.jsx(Qo.Label,{name:e,required:r,children:l?o.jsx(Kf,{children:i}):i})}):null,o.jsxs(Qo.Column,{children:[c==="vertical"&&i&&!l?o.jsx(Qo.Label,{name:e,required:r,children:i}):null,o.jsxs("div",{className:"relative group",children:[o.jsx(mn,{ref:v,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:h,className:Y(h==="sm"&&"pl-8 pr-8",h==="md"&&"pl-9 pr-9",(!h||h==="default")&&"pl-10 pr-10",h==="lg"&&"pl-11 pr-11")}),o.jsx(WE,{"aria-hidden":"true",className:Y("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",h==="sm"&&"w-3.5 h-3.5",h==="md"&&"w-4 h-4",(!h||h==="default")&&"w-[1.125rem] h-[1.125rem]",h==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&o.jsx(ce,{variant:"ghost",size:h||"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(Uu,{})})]}),t&&o.jsx(Qo.HelpText,{children:t}),n&&o.jsx(Qo.ErrorMsg,{children:n})]})]})}const Li=yyn,zi=byn,_i=b.forwardRef(({className:e,children:t,variant:n="default",size:r="default",...s},a)=>o.jsxs(Got,{ref:a,className:Y(Qj({variant:n,size:r}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,o.jsx(xyn,{asChild:!0,children:o.jsx(ahe,{className:Y("h-4 w-4 text-neutral3",_r.colors)})})]}));_i.displayName=Got.displayName;const Oi=b.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>o.jsx(wyn,{children:o.jsx(Yot,{ref:s,className:Y("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:o.jsx(Syn,{className:Y("p-1",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));Oi.displayName=Yot.displayName;const xs=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Xot,{ref:r,className:Y("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",_r.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),...n,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(_yn,{children:o.jsx(ub,{className:"h-4 w-4 text-accent1"})})}),o.jsx(kyn,{children:t})]}));xs.displayName=Xot.displayName;function gl({name:e,helpText:t,errorMsg:n,required:r=!1,disabled:s=!1,size:a="default",value:i,label:l,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:p="Select an option",onValueChange:h,className:m}){return o.jsxs(Qo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?o.jsx(Qo.Column,{children:o.jsx(Qo.Label,{name:e,required:r,children:c?o.jsx(Kf,{children:l}):l})}):null,o.jsxs(Qo.Column,{children:[u==="vertical"&&l&&!c?o.jsx(Qo.Label,{name:e,required:r,children:l}):null,o.jsxs(Li,{"aria-label":c?l:void 0,name:e,value:i,onValueChange:h,disabled:s,children:[o.jsx(_i,{size:a,children:o.jsx(zi,{placeholder:p})}),o.jsx(Oi,{children:f.map(g=>o.jsx(xs,{value:g.value,children:g.label},g.value))})]}),t&&o.jsx(Qo.HelpText,{children:t}),n&&o.jsx(Qo.ErrorMsg,{children:n})]})]})}const GHn=Uk("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ct=b.forwardRef(({className:e,...t},n)=>o.jsx(Jot,{ref:n,className:Y(GHn(),e),...t}));Ct.displayName=Jot.displayName;function OC({children:e}){const t=e.replace(/\\n/g,`
|
|
294
294
|
`);return o.jsx(Olt,{remarkPlugins:[Glt],components:XHn,className:"space-y-3",children:t})}const Dbt=Te.memo(({children:e,language:t,...n})=>{const[r,s]=b.useState([]);return b.useEffect(()=>{dHn(e,t).then(a=>{a&&s(a)})},[e,t]),r.length?o.jsx("pre",{...n,children:o.jsx("code",{children:r.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!==r.length-1&&`
|
|
295
295
|
`]}))})}):o.jsx("pre",{...n,children:e})});Dbt.displayName="HighlightedCode";const YHn=({children:e,className:t,language:n,...r})=>{const s=typeof e=="string"?e:yue(e),a=Y("overflow-x-scroll rounded-md border bg-surface1/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return o.jsxs("div",{className:"group/code relative mb-4",children:[o.jsx(b.Suspense,{fallback:o.jsx("pre",{className:a,...r,children:e}),children:o.jsx(Dbt,{language:n,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(_a,{content:s,copyMessage:"Copied code to clipboard"})})]})};function yue(e){if(typeof e=="string")return e;if(e?.props?.children){let t=e.props.children;return Array.isArray(t)?t.map(n=>yue(n)).join(""):yue(t)}return""}const XHn={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,...n})=>{const r=/language-(\w+)/.exec(t||"");return r?o.jsx(YHn,{className:t,language:r[1],...n,children:e}):o.jsx("code",{className:Y("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-surface1/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...n,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 KHn({children:e,className:t}){return o.jsx("div",{className:Y("overflow-x-auto ",t),children:e})}function Lbt({children:e,className:t}){return o.jsx("p",{className:Y("text-ui-md text-neutral2 leading-tight mt-0.5",t),children:e})}function JHn({message:e="Failed to load data",className:t}){return o.jsx("div",{className:Y("flex flex-col gap-3 items-center justify-center",t),children:o.jsx("p",{className:"text-ui-sm text-accent2",children:e})})}const eZn={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Bt({color:e,className:t,size:n="md"}){return o.jsx("svg",{className:Y("animate-spin",eZn[n],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 tZn({className:e}){return o.jsx("div",{className:Y("flex items-center justify-center",e),children:o.jsx(Bt,{size:"md",color:ky.neutral1})})}function nZn({message:e="No data yet",className:t}){return o.jsx("div",{className:Y("flex items-center justify-center h-full",t),children:o.jsx("p",{className:"text-neutral1 text-sm",children:e})})}function QLe({children:e,className:t}){return o.jsx(Obt,{className:Y("flex-1 grid grid-rows-[4rem_1fr] min-h-72 gap-2 min-w-80 md:min-w-[22rem] lg:min-w-[24rem] xl:min-w-[26rem] 2xl:min-w-[30rem]",t),children:e})}function rZn({value:e,label:t,className:n}){return o.jsxs("div",{className:Y("grid justify-end content-start text-right gap-1",n),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 zbt({children:e,className:t,as:n="h2"}){return o.jsx(n,{className:Y("text-ui-md font-normal text-neutral4",t),children:e})}function sZn(e){if("children"in e)return o.jsx("div",{className:e.className,children:e.children});const{title:t,description:n,titleAs:r}=e;return o.jsxs("div",{className:e.className,children:[o.jsx(zbt,{as:r,children:t}),n&&o.jsx(Lbt,{children:n})]})}function aZn({children:e,className:t}){return o.jsx("div",{className:Y("grid grid-cols-[1fr_auto] gap-4",t),children:e})}function iZn({changePct:e,prevValue:t,lowerIsBetter:n,className:r}){const s=n?e<0:e>=0;return o.jsxs("div",{className:Y("flex items-center gap-1 text-sm text-neutral1 flex-wrap",r),children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Y("[&>svg]:w-4 [&>svg]:h-4",s?"text-green-600":"text-red-600"),children:e>=0?o.jsx(bJt,{}):o.jsx(vJt,{})}),o.jsx("span",{className:Y(s?"text-green-600":"text-red-600"),children:`${e>=0?"+":"-"}${Math.abs(e).toFixed(1)}%`})]}),t&&o.jsxs("div",{children:["vs previous ",o.jsx("b",{className:"text-neutral2 font-semibold",children:t})]})]})}function oZn({message:e="Failed to load data",className:t}){return o.jsx("span",{className:Y("text-ui-sm text-accent2",t),children:e})}function lZn({children:e,className:t}){return o.jsx("span",{className:Y("text-ui-md text-neutral3 leading-relaxed",t),children:e})}function cZn({className:e}){return o.jsx("span",{className:Y("text-sm",e),children:o.jsx(Bt,{size:"md",color:ky.neutral1})})}function uZn({message:e="No previous value to compare",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function dZn({message:e="No data yet",className:t}){return o.jsx("span",{className:Y("text-sm text-neutral1",t),children:e})}function fZn({children:e,className:t}){return o.jsx(Obt,{className:Y("flex-1 min-w-60",t),children:o.jsx("div",{className:"grid gap-1",children:e})})}function pZn({children:e,className:t}){return o.jsx("strong",{className:Y("text-header-lg text-neutral4 font-semibold",t),children:e})}const Fr=Object.assign(fZn,{Label:lZn,Value:pZn,Change:iZn,NoChange:uZn,NoData:dZn,Error:oZn,Loading:cZn}),Jt=Object.assign(QLe,{Root:QLe,Kpi:Fr,TopBar:aZn,TitleAndDescription:sZn,Title:zbt,Description:Lbt,Summary:rZn,Loading:tZn,Error:JHn,Content:KHn,NoData:nZn});function bue({children:e,className:t}){return o.jsx("div",{className:Y("flex flex-wrap gap-8",t),children:e})}const vp=f1n,Yd=p1n,Ju=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>o.jsx(h1n,{children:o.jsx(ict,{ref:s,align:t,sideOffset:n,className:Y("z-50 w-72 rounded-xl border-2 border-border1/50 bg-surface3 text-neutral5 shadow-md focus-visible:outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e&&/\bp[trblxy]?-\S+/.test(e)?!1:"py-3.5 px-3",e),...r})}));Ju.displayName=ict.displayName;function Fbt({children:e,...t}){const[n,r]=b.useState(!1),s=b.useRef(void 0),a=b.useCallback(()=>{clearTimeout(s.current),r(!0)},[]),i=b.useCallback(()=>{s.current=setTimeout(()=>r(!1),150)},[]);return b.useEffect(()=>()=>clearTimeout(s.current),[]),o.jsx(vp,{open:n,onOpenChange:r,...t,children:o.jsx("span",{onMouseEnter:a,onMouseLeave:i,onFocusCapture:a,onBlurCapture:i,style:{display:"contents"},children:e})})}function Bbt({disabled:e,onClear:t,onRemoveAll:n,onSave:r,onRemoveSaved:s}){const a=!!(n||r||s),i=!!t;return!i&&!a?null:o.jsxs("div",{className:"flex items-center gap-2",children:[i&&o.jsxs(ce,{disabled:e,size:"md",onClick:()=>t(),children:[o.jsx(Uu,{}),"Clear"]}),a&&o.jsxs(St,{children:[o.jsx(St.Trigger,{asChild:!0,children:o.jsx(ce,{disabled:e,size:"md","aria-label":"More filter actions",children:o.jsx(bKt,{})})}),o.jsxs(St.Content,{align:"end",children:[n&&o.jsxs(St.Item,{onSelect:()=>n(),children:[o.jsx(Uu,{}),"Remove all filters"]}),n&&(r||s)&&o.jsx(St.Separator,{}),r&&o.jsxs(St.Item,{onSelect:()=>r(),children:[o.jsx(mJe,{}),"Save filters for next time"]}),s&&o.jsxs(St.Item,{onSelect:()=>s(),children:[o.jsx(gJe,{}),"Remove saved filters"]})]})]})]})}const Xj=b.forwardRef(({className:e,...t},n)=>o.jsx(bct,{className:Y("grid gap-2",e),...t,ref:n}));Xj.displayName=bct.displayName;const Mu=b.forwardRef(({className:e,...t},n)=>o.jsx(xct,{ref:n,className:Y("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",_r.all,"hover:border-neutral5 hover:shadow-md",BU,"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(_1n,{className:Y("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:o.jsx(dJe,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));Mu.displayName=xct.displayName;function Ubt({field:e,tokens:t,onChange:n}){const[r,s]=b.useState(""),a=b.useMemo(()=>{const u=r.trim().toLowerCase();return u?e.options.filter(d=>d.label.toLowerCase().includes(u)):e.options},[e.options,r]),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(mn,{size:"sm",value:r,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(Bt,{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 h=f===!0?c.includes(u.value)?c:[...c,u.value]:c.filter(m=>m!==u.value);n(e.id,h)},className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)})}):o.jsxs(Xj,{value:l??"",onValueChange:u=>n(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(Mu,{"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(Mu,{"data-pick-multi-item":"",value:"Any",className:"shrink-0"}),o.jsx("span",{className:"truncate min-w-0 flex-1",children:"Any"})]})]})]})}function qbt(e){return Array.isArray(e)?e.length===0?"Any":e.join(", "):e}const Dbe="inline-flex",Vbt=`${Hc.md} border-y-2 border-border1 px-[.75em] text-neutral3 whitespace-nowrap flex items-center`,Lbe=`${Vbt} text-ui-md rounded-l-lg border-l-2 border-r-1`,zbe=`${Vbt} text-ui-md `,Fbe="rounded-tl-none rounded-bl-none border-l-transparent",hZn="rounded-none",mZn="rounded-none";function gZn({field:e,value:t,onChange:n,onRemove:r,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:Dbe,children:[o.jsx("span",{className:Lbe,children:e.label}),o.jsx("span",{className:zbe,children:"is"}),o.jsx(mn,{ref:c,size:"md",disabled:s,value:i,placeholder:e.placeholder??`Enter ${e.label}`,className:hZn,onChange:u=>{const d=u.target.value;l(d),d.trim()!==t&&n(d)},onKeyDown:u=>{if(u.key==="Enter"){u.preventDefault();const d=i.trim();d!==t&&n(d)}else u.key==="Escape"&&(u.preventDefault(),l(t),u.target.blur())}}),o.jsx(ce,{type:"button",disabled:s,"aria-label":`Remove ${e.label} filter`,className:Fbe,size:"md",onMouseDown:u=>u.preventDefault(),onClick:r,children:o.jsx(Uu,{})})]})}function vZn({field:e,token:t,tokens:n,onChange:r,onRemove:s,disabled:a}){const[i,l]=b.useState(!1);return o.jsxs("div",{className:Dbe,children:[o.jsx("span",{className:Lbe,children:e.label}),o.jsx("span",{className:zbe,children:"is"}),o.jsxs(vp,{open:i,onOpenChange:l,children:[o.jsx(Yd,{asChild:!0,children:o.jsx(ce,{type:"button",disabled:a,size:"md",className:mZn,children:qbt(t.value)})}),o.jsx(Ju,{align:"start",sideOffset:8,className:"w-64 p-2","data-pick-multi-panel":!0,children:o.jsx(Ubt,{field:e,tokens:n,onChange:r})})]}),o.jsx(ce,{type:"button",disabled:a,"aria-label":`Remove ${e.label} filter`,className:Fbe,size:"md",onClick:s,children:o.jsx(Uu,{})})]})}function Hbt({fields:e,tokens:t,onTokensChange:n,disabled:r,autoFocusFieldId:s}){if(t.length===0)return null;const a=(l,c)=>{const u=[...t];u[l]=c,n(u)},i=l=>{n(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(gZn,{field:u,value:l.value,disabled:r,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(vZn,{field:u,token:l,tokens:t,disabled:r,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:Dbe,children:[o.jsx("span",{className:Lbe,children:u.label}),o.jsx("span",{className:zbe,children:"is"}),o.jsx("span",{className:"px-2.5 py-1.5 max-w-[20rem] truncate",children:qbt(l.value)}),o.jsx(ce,{type:"button",disabled:r,size:"md","aria-label":`Remove ${u.label} filter`,className:Fbe,onClick:()=>i(c),children:o.jsx(Uu,{})})]},`${l.fieldId}-${c}`):null})})}function Zbt({fields:e,tokens:t,onTokensChange:n,label:r="Add Filter",disabled:s,size:a,onStartTextFilter:i}){const[l,c]=b.useState(!1),[u,d]=b.useState(),[f,p]=b.useState(""),[h,m]=b.useState([]),[g,v]=b.useState(),[x,w]=b.useState(),S=b.useRef(null),_=b.useRef(!1),O=b.useCallback(R=>{w(B=>B===R?void 0:R)},[]),E=b.useCallback(()=>w(void 0),[]);b.useEffect(()=>{l||w(void 0)},[l]);const T=b.useMemo(()=>e.find(R=>R.id===u),[e,u]),j=b.useMemo(()=>{const R=new Set;for(const B of t){const M=e.find(L=>L.id===B.fieldId);M&&M.kind!=="pick-multi"&&R.add(B.fieldId)}return R},[t,e]),N=b.useCallback(()=>{d(void 0),p(""),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,B)=>{const M=t.findIndex(z=>z.fieldId===R);if(B===void 0||Array.isArray(B)&&B.length===0){if(M===-1)return;n(t.filter((z,q)=>q!==M));return}if(M===-1){n([...t,{fieldId:R,value:B}]);return}const U=[...t];U[M]={fieldId:R,value:B},n(U)},[n,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"&&h.length===0){v(`Choose at least one ${T.label.toLowerCase()} value.`);return}const R=T.kind==="multi-select"?{fieldId:T.id,value:h}:{fieldId:T.id,value:f.trim()};n([...t,R]),c(!1)},[h,n,T,j,f,t]);return o.jsxs(vp,{open:l,onOpenChange:c,children:[o.jsx(Yd,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:a,disabled:s,children:[o.jsx(GKt,{}),r]})}),o.jsx(Ju,{align:"end",className:"p-3 w-64",onOpenAutoFocus:R=>R.preventDefault(),onCloseAutoFocus:R=>{_.current&&(_.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),p(""),m([]),v(void 0)},children:o.jsx(vj,{className:"h-4 w-4"})}),o.jsx(PKt,{className:"h-4 w-4 shrink-0 text-neutral3"}),o.jsx("span",{className:"text-ui-sm text-neutral3",children:`${T.label} · is`})]}),!T&&o.jsx("div",{role:"menu",className:"max-h-[80dvh] overflow-auto",onKeyDown:R=>{if(R.key!=="ArrowDown"&&R.key!=="ArrowUp"&&R.key!=="Home"&&R.key!=="End")return;const B=Array.from(R.currentTarget.querySelectorAll("[data-filter-item]:not([disabled])"));if(B.length===0)return;R.preventDefault();const M=document.activeElement,L=B.findIndex(z=>z===M);let U;R.key==="Home"?U=0:R.key==="End"?U=B.length-1:R.key==="ArrowDown"?U=L<0?0:(L+1)%B.length:U=L<=0?B.length-1:L-1,B[U]?.focus()},children:e.length>0?e.map(R=>{const B=j.has(R.id);return R.kind==="pick-multi"?o.jsx(yZn,{field:R,tokens:t,onChange:I,open:x===R.id,onToggle:O,onClose:E},R.id):o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Y("group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-ui-md transition-colors","focus:bg-surface4 focus:text-neutral6 focus:outline-none",B?"cursor-not-allowed text-neutral2 opacity-70":"text-neutral4 hover:bg-surface4 hover:text-neutral6"),disabled:B,onClick:()=>{if(v(void 0),R.kind==="text"){n([...t,{fieldId:R.id,value:""}]),i?.(R.id),_.current=!0,c(!1);return}d(R.id)},children:[o.jsx("span",{className:"truncate",children:R.label}),B?o.jsx("span",{className:"ml-auto text-neutral3",children:"In use"}):o.jsx(dhe,{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(mn,{ref:S,size:"md",value:f,onChange:R=>{p(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(vbt,{options:T.options??[],value:h,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(ce,{variant:"ghost",size:"md",onClick:()=>c(!1),children:"Cancel"}),o.jsx(ce,{variant:"outline",size:"md",onClick:P,children:"Add filter"})]})]})})]})}function yZn({field:e,tokens:t,onChange:n,open:r,onToggle:s,onClose:a}){const i=b.useRef(null);return o.jsxs(vp,{open:r,onOpenChange:l=>{l?s(e.id):a()},children:[o.jsx(Yd,{asChild:!0,children:o.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:Y("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-ui-md text-neutral4 hover:bg-surface4 hover:text-neutral6 transition-colors","focus:bg-surface4 focus:text-neutral6 focus:outline-none"),onKeyDown:l=>{l.key!=="ArrowRight"&&l.key!=="ArrowLeft"||(r||s(e.id),l.preventDefault(),requestAnimationFrame(()=>{i.current?.querySelector('input, button, [tabindex]:not([tabindex="-1"])')?.focus()}))},children:[r&&o.jsx(ihe,{className:"h-4 w-4 text-neutral3 shrink-0"}),o.jsx("span",{className:"truncate",children:e.label}),!r&&o.jsx(ZE,{className:"h-4 w-4 ml-auto text-neutral3 shrink-0"})]})}),o.jsx(Ju,{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(p=>p===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(Ubt,{field:e,tokens:t,onChange:n})})]})}const Wbt=(e,{enabled:t=!0})=>{const n=b.useRef(t);Te.useEffect(()=>{if(!t||!e?.current)return;const r=e.current,s=new MutationObserver(()=>{n.current&&r.scrollTo({top:r.scrollHeight,behavior:"smooth"})});s.observe(r,{childList:!0,subtree:!0,characterData:!0});const a=i=>{const l=i.target,c=l.scrollTop+l.clientHeight,u=l.scrollHeight;c>=u-1?n.current=!0:n.current=!1};return r.addEventListener("scroll",a),()=>{r.removeEventListener("scroll",a),s.disconnect()}},[t,e])},ea=b.forwardRef(({className:e,children:t,viewPortClassName:n,maxHeight:r,autoScroll:s=!1,orientation:a="vertical",...i},l)=>{const c=b.useRef(null);return Wbt(c,{enabled:s}),o.jsxs(Rct,{ref:l,className:Y("relative overflow-hidden",e),...i,children:[o.jsx(M1n,{ref:c,className:Y("h-full w-full rounded-[inherit] [&>div]:block!",n),style:r?{maxHeight:r}:void 0,children:t}),(a==="vertical"||a==="both")&&o.jsx(xue,{orientation:"vertical"}),(a==="horizontal"||a==="both")&&o.jsx(xue,{orientation:"horizontal"}),a==="both"&&o.jsx(D1n,{})]})});ea.displayName=Rct.displayName;const xue=b.forwardRef(({className:e,orientation:t="vertical",...n},r)=>o.jsx(xge,{ref:r,orientation:t,className:Y("flex touch-none select-none transition-all duration-normal ease-out-custom","opacity-0 hover:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...n,children:o.jsx(jct,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));xue.displayName=xge.displayName;const GLe={sm:Hc.sm,md:Hc.md,lg:Hc.lg,default:Hc.default},kg=({onSearch:e,label:t,placeholder:n,debounceMs:r=300,size:s="md"})=>{const a=b.useId(),i=b.useRef(null),l=Ik(u=>{e(u)},r);b.useEffect(()=>()=>{l.cancel()},[l]),b.useEffect(()=>{const u=i.current;if(!u)return;const d=f=>{f.key.toLowerCase()==="f"&&f.shiftKey&&(f.ctrlKey||f.metaKey)&&(f.preventDefault(),u.focus())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]);const c=u=>{l(u.target.value)};return o.jsxs("div",{className:Y("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",zVn,LVn,_r.all,"hover:border-neutral2",GLe[s]),children:[o.jsx(WE,{className:Y("text-neutral3 h-4 w-4",_r.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:n,className:Y("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-hidden",GLe[s]),name:a,ref:i,onChange:c})]})]})},bZn=({children:e})=>o.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e}),_F=b.forwardRef(({className:e,...t},n)=>o.jsxs(Gct,{ref:n,className:Y("relative flex w-full touch-none select-none items-center group",e),...t,children:[o.jsx(tkn,{className:Y("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",_r.colors),children:o.jsx(nkn,{className:Y("absolute h-full bg-accent1",_r.all)})}),o.jsx(rkn,{className:Y("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",BU,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));_F.displayName=Gct.displayName;const tu=b.forwardRef(({className:e,...t},n)=>o.jsx(tut,{className:Y("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent",_r.all,BU,"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:n,children:o.jsx(lkn,{className:Y("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-md","transition-all duration-normal ease-out-custom","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0","data-[state=checked]:shadow-lg")})}));tu.displayName=tut.displayName;function xZn({children:e,untilChar:t,charCount:n,copy:r,withTooltip:s=!0,className:a,as:i="span",...l}){const c=e;let u=c,d=!1;if(t!==void 0){const p=c.indexOf(t);p!==-1&&(u=c.slice(0,p),d=!0)}else n!==void 0&&c.length>n&&(u=c.slice(0,n),d=!0);if(!d)return o.jsx(me,{as:i,className:a,...l,children:c});const f=o.jsxs(me,{as:"span",className:"cursor-default",variant:l.variant,font:l.font,children:[u,"..."]});return o.jsxs(me,{as:i,className:Y("group inline-flex items-center gap-1",a),...l,children:[s?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:f}),o.jsx(Kn,{children:c})]}):f,r&&o.jsx(_a,{content:c,className:"opacity-0 group-hover:opacity-100 transition-opacity"})]})}function ps({children:e,className:t,spacing:n="default"}){return o.jsx("div",{className:Y("flex gap-2 items-center ",{"gap-[2px] [&>*:not(:last-child)]:rounded-r-none [&>*:not(:first-child)]:rounded-l-none":n==="close"},t),children:e})}function Xn({children:e,className:t,style:n}){const r=Qbt("MainContentLayout");return o.jsx("main",{className:Y("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...n,...r?{border:"3px dotted red"}:{}},children:e})}function sp({children:e,className:t,isCentered:n=!1,isDivided:r=!1,hasLeftServiceColumn:s=!1,style:a}){const i=Qbt("MainContentContent"),l=Bbe({isCentered:n,isDivided:r,hasLeftServiceColumn:s,className:t});return o.jsx("div",{className:l,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const Bbe=({isCentered:e,isDivided:t,hasLeftServiceColumn:n,className:r})=>Y("grid overflow-y-auto h-full ","overflow-x-auto min-w-min",{"items-start content-start":!e&&!t&&!n,"grid place-items-center":e,"grid-cols-[1fr_1fr]":t&&!n,"grid-cols-[12rem_1fr_1fr]":t&&n,"grid-cols-[auto_1fr]":!t&&n},r);function Qbt(e){try{const t=localStorage.getItem("add-dev-style-to-components");return t?t.split(",").map(r=>r.trim()).filter(Boolean).includes(e):!1}catch(t){return console.error("Error reading or parsing localStorage:",t),!1}}function wZn({children:e,className:t}){return o.jsx("div",{className:Y("grid content-start",t),children:e})}function SZn({children:e,isLoading:t}){return o.jsx("p",{className:Y("text-neutral3 text-sm max-w-[35rem] flex flex-wrap gap-x-4 gap-y-1 mt-1 first-of-type:mt-3 ml-1",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":t}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function kZn({children:e,title:t,description:n,icon:r,className:s,withMargins:a=!0}){const i=t==="loading",l=n==="loading";return e?o.jsx("header",{className:Y("grid grid-cols-[1fr_auto] gap-16 w-full ",{"mt-[6vh] mb-[4vh]":a},s),children:e}):o.jsxs("header",{className:Y("grid gap-2 pt-8 pb-8 ",s),children:[o.jsx("h1",{className:Y("text-neutral6 text-xl font-normal flex items-center gap-2","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:text-neutral3",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":i}),children:i?o.jsx(o.Fragment,{children:" "}):o.jsxs(o.Fragment,{children:[r&&r," ",t]})}),n&&o.jsx("p",{className:Y("text-neutral4 text-sm m-0",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":l}),children:l?o.jsx(o.Fragment,{children:" "}):n})]})}function _Zn({children:e,isLoading:t,size:n="default"}){return o.jsx("h1",{className:Y("text-neutral5 text-xl font-normal gap-2 flex items-center","[&>svg]:w-[1.25em] [&>svg]:h-[1.25em] [&>svg]:opacity-50",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":t,"text-md":n==="smaller"}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}const qn=Object.assign(kZn,{Title:_Zn,Description:SZn,Column:wZn});function j0({children:e,className:t}){return o.jsx("div",{className:Y("grid gap-12",t),children:e})}function OF({className:e,classNames:t,showOutsideDays:n=!0,...r}){return o.jsx(VEn,{showOutsideDays:n,className:Y("p-3",e),classNames:{months:"flex flex-col space-y-4 sm:space-y-0 ",month:"space-y-4 text-ui-sm ",caption:"flex justify-between pt-1 items-center pl-2",caption_label:"text-text font-medium ",nav:"flex items-center",nav_button_previous:Y("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:Y("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),dropdown_month:"w-full border-collapse space-y-1",weeknumber:"flex",day:Y("relative p-0 text-center focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-surface5 [&:has([aria-selected].day-outside)]:bg-surface5/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md","h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start rounded-l-md",day_range_end:"day-range-end rounded-r-md",day_selected:Y("bg-accent1! text-white! hover:bg-accent1/80! focus:bg-accent1/80! focus:text-white!",r.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},...r})}const sY=["12","1","2","3","4","5","6","7","8","9","10","11"],$4=["00","15","30","45","59"],M4=["AM","PM"];function wue({defaultValue:e,onValueChange:t,className:n}){const[r,s]=b.useState("12"),[a,i]=b.useState("00"),[l,c]=b.useState("AM");b.useEffect(()=>{if(e){const p=/^(\d{1,2}):(\d{2})(?::\d{2})?\s*(AM|PM|am|pm)?$/,h=e.match(p);if(h){let m=parseInt(h[1],10);const g=parseInt(h[2],10),v=h[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=p=>{s(p),t(`${sY[+p]}:${a} ${l}`.trim())},d=p=>{i($4[+p]),t(`${r}:${$4[+p]} ${l}`.trim())},f=p=>{c(M4[+p]),t(`${r}:${a} ${M4[+p]}`.trim())};return o.jsxs("div",{className:Y("flex gap-2 items-center",n),children:[o.jsxs(Li,{name:"hour",value:sY.indexOf(r).toString(),onValueChange:u,children:[o.jsx(_i,{size:"sm",children:o.jsx(zi,{placeholder:"Select..."})}),o.jsx(Oi,{children:sY.map((p,h)=>o.jsx(xs,{value:`${h}`,children:p},p))})]}),":",o.jsxs(Li,{name:"minute",value:$4.indexOf(a).toString(),onValueChange:d,children:[o.jsx(_i,{size:"sm",children:o.jsx(zi,{placeholder:"Select..."})}),o.jsx(Oi,{children:$4.map((p,h)=>o.jsx(xs,{value:`${h}`,children:p},p))})]}),o.jsxs(Li,{name:"period",value:M4.indexOf(l).toString(),onValueChange:f,children:[o.jsx(_i,{size:"sm",children:o.jsx(zi,{placeholder:"Select..."})}),o.jsx(Oi,{children:M4.map((p,h)=>o.jsx(xs,{value:`${h}`,children:p},p))})]})]})}const YLe=({value:e,minValue:t,maxValue:n,defaultTimeStrValue:r,onValueChange:s,children:a,className:i,placeholder:l,...c})=>{const[u,d]=b.useState(!1);return o.jsxs(vp,{open:u,onOpenChange:d,children:[o.jsx(Yd,{asChild:!0,children:a||o.jsx(EZn,{value:e,placeholder:l,className:i,"data-testid":"datepicker-button"})}),o.jsx(Ju,{className:"backdrop-blur-4xl w-auto p-0! bg-surface4 max-w-[16.5rem]",align:"start","data-testid":"datepicker-calendar",children:o.jsx(OZn,{value:e,minValue:t,maxValue:n,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:r,...c})})]})};function D4({date:e,timeStr:t=""}){if(!_y(e))return null;if(t){const n=an(e,"yyyy-MM-dd"),r=new Date(`${n} ${t}`);if(_y(r))return r}return e}const OZn=({value:e,minValue:t,maxValue:n,onValueChange:r,setOpenPopover:s,placeholder:a,className:i,defaultTimeStrValue:l,...c})=>{const[u,d]=b.useState(null),[f,p]=b.useState(e?an(D4({date:e,timeStr:l})||"","PP p"):""),[h,m]=b.useState(l||""),[g,v]=b.useState(e?new Date(e):void 0),x=Ik(B=>{_y(B)&&(v(B),r?.(B),s?.(!1))},500),w=B=>{p(B.currentTarget.value);const M=new Date(B.currentTarget.value);x(M)},S=B=>{_y(B)?n&&B>n?(d(`The selected date should be before ${an(n,"PP p")}`),p("")):t&&B<t?(d(`The selected date should be after ${an(t,"PP p")}`),p("")):(p(an(B,"PP p")),d("")):(p(""),d(""))},_=new Date(f),O=_y(_),E=O&&_.getTime()!==e?.getTime(),T=B=>{if(v(B),B){const M=D4({date:B,timeStr:h});S(M||"")}else S("")},j=B=>{if(v(B),B){const M=D4({date:B,timeStr:h});S(M||"")}else S("")},N=B=>{if(m(B),O){const M=D4({date:_,timeStr:B});S(M||"")}},I=()=>{s?.(!1)},P=()=>{_y(_)&&r(_),s?.(!1)},R=()=>{r(void 0),v(void 0),p(""),m(""),s?.(!1)};return o.jsxs("div",{"aria-label":"Choose date",className:Y("relative flex flex-col",i),onKeyDown:B=>{B.stopPropagation(),B.key==="Escape"&&s?.(!1)},children:[o.jsx(E0,{name:"date-range",type:"text",value:f,onChange:w,placeholder:a,className:"m-4 mb-0 w-auto!"}),u&&o.jsxs("div",{className:Y("text-ui-md m-4 mb-0 text-neutral3","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mt-0.5 [&>svg]:text-red-500 [&>svg]:float-left [&>svg]:mr-2"),children:[o.jsx(uJe,{})," ",u]}),o.jsx(OF,{mode:"single",month:g,selected:g,onMonthChange:j,onSelect:T,...c}),o.jsx(wue,{onValueChange:N,className:"m-4 mt-0 w-auto",defaultValue:e?an(new Date(e),"hh:mm a"):l}),o.jsxs("div",{className:"grid grid-cols-[1fr_2fr] gap-2 m-4 mt-0",children:[E&&o.jsx(ce,{tabIndex:0,size:"md",onClick:R,type:"button",children:"Clear"}),o.jsx(ce,{tabIndex:0,type:"button",size:"md",variant:E?"primary":"default",onClick:()=>{O?P():I()},children:E?"Apply":"Cancel"})]})]})},EZn=b.forwardRef(({value:e,placeholder:t,className:n,...r},s)=>o.jsxs(ce,{ref:s,className:Y("justify-start",n),...r,children:[o.jsx(loe,{className:"h-4 w-4"}),e?o.jsx("span",{className:"text-white",children:an(e,"PP p")}):o.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));function Gbt({children:e}){return o.jsx("ul",{className:"grid bg-surface3 overflow-y-auto",children:e})}function Ybt(e){return!e||e.length===0?"":e?.map(t=>t.size).join(" ")}function Xbt({entry:e,isSelected:t,onClick:n,children:r,columns:s}){const a=()=>{n?.(e?.id)};return o.jsx("li",{className:Y("border-t text-neutral5 border-border1 last:border-b-0 text-ui-md","[&:last-child>button]:rounded-b-lg",_r.colors,{"bg-accent1Dark":t}),children:o.jsx("button",{onClick:a,className:Y("grid w-full px-6 gap-6 text-left items-center min-h-12",_r.colors,pw.visible,{"hover:bg-surface4":e&&!t}),style:{gridTemplateColumns:Ybt(s)},disabled:!e,children:r})})}function CZn({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 jZn({status:e}){return o.jsxs("div",{className:Y("flex justify-center items-center w-full relative"),children:[e?o.jsx("div",{className:Y("w-[0.6rem] h-[0.6rem] rounded-full",{"bg-green-600":e==="success","bg-red-700":e==="failed"})}):o.jsx("div",{className:"text-neutral2 text-ui-sm leading-none",children:"-"}),o.jsxs(Kf,{children:["Status: ",e||"not provided"]})]})}function Kbt({columns:e}){return o.jsx("div",{className:Y("sticky top-0 bg-surface4 z-10 rounded-t-lg px-6"),children:o.jsx("div",{className:Y("grid gap-6 text-left uppercase py-3 text-neutral3 text-ui-sm"),style:{gridTemplateColumns:Ybt(e)},children:e?.map(t=>o.jsx("span",{children:t.label||t.name},t.name))})})}function TZn({children:e,message:t,className:n,type:r}){return!e&&!t?null:o.jsx("div",{className:Y("grid border-t border-border1",n),children:t?o.jsxs("p",{className:Y("text-neutral3 text-ui-md text-center grid p-8 justify-center justify-items-center gap-2","[&>svg]:w-[1.5em] [&>svg]:h-[1.5em] [&>svg]:opacity-75",{"[&>svg]:text-red-500":r==="error"}),children:[r==="error"?o.jsx(M$,{}):o.jsx(che,{})," ",t]}):e})}function NZn({isLoading:e,hasMore:t,setEndOfListElement:n,loadingText:r="Loading more data...",noMoreDataText:s="No more data to load"}){return n?o.jsxs("div",{ref:n,className:"text-ui-md text-neutral3 opacity-50 flex mt-8 justify-center",children:[e&&r,!t&&!e&&s]}):null}function AZn({currentPage:e,hasMore:t,onNextPage:n,onPrevPage:r}){const s=typeof e=="number"&&e>0||t;return o.jsxs("div",{className:Y("flex pt-6 items-center justify-center text-neutral3 text-ui-md gap-8"),children:[o.jsxs("span",{children:["Page ",o.jsx("b",{children:e?e+1:"1"})]}),s&&o.jsxs("div",{className:Y("flex gap-4","[&>button]:flex [&>button]:items-center [&>button]:gap-2 [&>button]:text-neutral4 [&>button:hover]:text-neutral5 [&>button]:transition-colors [&>button]:border [&>button]:border-border1 [&>button]:p-1 [&>button]:px-2 [&>button]:rounded-md","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[typeof e=="number"&&e>0&&o.jsxs("button",{onClick:r,children:[o.jsx(vj,{}),"Previous"]}),t&&o.jsxs("button",{onClick:n,children:["Next",o.jsx(v1,{})]})]})]})}function IZn({children:e}){return o.jsx("div",{className:"grid",children:e})}function Jbt({children:e}){return o.jsx("div",{className:Y("rounded-lg border border-border1 overflow-clip"),children:e})}const Ra=Object.assign(IZn,{Header:Kbt,Trim:Jbt,Entries:Gbt,Entry:Xbt,Message:TZn,NextPageLoading:NZn,Pagination:AZn,EntryText:CZn,EntryStatus:jZn}),XLe=["75%","50%","65%","90%","60%","80%"];function RZn({columns:e,numberOfRows:t=3}){const n=(r,s)=>{const a=(r+s+(e?.length||0)+(t||0))%XLe.length;return XLe[a]};return o.jsx(Gbt,{children:Array.from({length:t}).map((r,s)=>o.jsx(Xbt,{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:`${n(s,i)}`}},l)})},s))})}function ext({columns:e,numberOfRows:t}){return o.jsx(Ra,{children:o.jsxs(Jbt,{children:[o.jsx(Kbt,{columns:e}),o.jsx(RZn,{columns:e,numberOfRows:t})]})})}function txt({entries:e,id:t,update:n}){const r=e.findIndex(a=>a.id===t);if(r<e.length-1)return()=>{const a=e[r+1];n(a.id)}}function nxt({entries:e,id:t,update:n}){const r=e.findIndex(a=>a.id===t);if(r>0)return()=>{const a=e[r-1];n(a.id)}}function rxt({name:e,value:t,label:n,labelIsHidden:r=!1,className:s,required:a,disabled:i,helpMsg:l,options:c,onValueChange:u,placeholder:d="Select an option",size:f="default"}){const p=({children:h})=>r?o.jsx(Kf,{children:h}):h;return o.jsxs("div",{className:Y("flex gap-2 items-center",{"grid-rows-[auto_1fr]":n,"grid-rows-[auto_1fr_auto]":l},s),children:[o.jsx(p,{children:o.jsxs("label",{className:Y("text-ui-sm text-neutral3 flex justify-between items-center shrink-0"),children:[n,a&&o.jsx("i",{className:"text-neutral2",children:"(required)"})]})}),o.jsxs(Li,{name:e,value:t,onValueChange:u,disabled:i,children:[o.jsx(_i,{id:`select-${e}`,size:f,className:"grid grid-cols-[1fr_auto] [&>span]:truncate w-full",children:o.jsx(zi,{placeholder:d})}),o.jsx(Oi,{children:c.map(h=>o.jsx(xs,{value:h.value,disabled:h.disabled,children:o.jsxs("span",{className:"whitespace-nowrap truncate flex items-center gap-2",children:[h.icon,h.label]})},h.value))})]}),l&&o.jsx("p",{className:"text-neutral3 text-ui-sm",children:l})]})}const sxt=b.createContext(null);function PZn({children:e,value:t}){return o.jsx(sxt.Provider,{value:t,children:e})}function HU(){const e=b.useContext(sxt);if(!e)throw new Error("useJSONSchemaForm must be used within a JSONSchemaForm.Root");return e}let $Zn=0;function ZU(e={}){return{id:`field-${Date.now()}-${$Zn++}`,name:"",type:"string",nullable:!1,optional:!1,...e}}function MZn(e){return e==="text"?"string":e}function axt(e){const t=MZn(e.type),r={type:e.nullable?[t,"null"]:t};if(e.description&&(r.description=e.description),e.type==="object"&&e.properties&&e.properties.length>0){const{properties:s,required:a}=ixt(e.properties);r.properties=s,a.length>0&&(r.required=a)}return e.type==="array"&&e.items&&(r.items=axt(e.items)),r}function ixt(e){const t={},n=[];for(const r of e)r.name.trim()&&(t[r.name]=axt(r),r.optional||n.push(r.name));return{properties:t,required:n}}function DZn(e){const{properties:t,required:n}=ixt(e),r={type:"object",properties:t};return n.length>0&&(r.required=n),r}function oxt(e){if(Array.isArray(e)){const t=e.includes("null");return{type:e.find(r=>r!=="null")||"string",nullable:t}}return{type:e||"string",nullable:!1}}function lxt(e){return["string","number","boolean","object","array"].includes(e)?e:"string"}function cxt(e){const{type:t,nullable:n}=oxt(e.type);return ZU({name:"",type:lxt(t),description:e.description,nullable:n,optional:!1,properties:e.properties?WU({properties:e.properties,required:e.required}):void 0,items:e.items?cxt(e.items):void 0})}function WU(e){if(!e?.properties)return[];const t=new Set(e.required||[]);return Object.entries(e.properties).map(([n,r])=>{const{type:s,nullable:a}=oxt(r.type);return ZU({name:n,type:lxt(s),description:r.description,nullable:a,optional:!t.has(n),properties:r.properties?WU({properties:r.properties,required:r.required}):void 0,items:r.items?cxt(r.items):void 0})})}function Sue(e,t,n,r){if(t.length===0)return e.map(i=>i.id===n?{...i,...r}:i);const[s,...a]=t;return e.map(i=>i.id!==s?i:i.type==="object"?{...i,properties:Sue(i.properties||[],a,n,r)}:i.type==="array"&&i.items?{...i,items:{...i.items,properties:Sue(i.items.properties||[],a,n,r)}}:i)}function kue(e,t,n){if(t.length===0)return[...e,n];const[r,...s]=t;return e.map(a=>a.id!==r?a:a.type==="object"?{...a,properties:kue(a.properties||[],s,n)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:kue(a.items.properties||[],s,n)}}:a)}function _ue(e,t,n){if(t.length===0)return e.filter(a=>a.id!==n);const[r,...s]=t;return e.map(a=>a.id!==r?a:a.type==="object"?{...a,properties:_ue(a.properties||[],s,n)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:_ue(a.items.properties||[],s,n)}}:a)}function LZn({onChange:e,onFieldsChange:t,defaultValue:n,maxDepth:r=5,className:s,children:a}){const[i,l]=b.useState(()=>n||[]),c=b.useRef("");b.useEffect(()=>{const h=DZn(i),m=JSON.stringify(h);m!==c.current&&(c.current=m,e?.(h))},[i,e]),b.useEffect(()=>{t?.(i)},[i,t]);const u=b.useCallback(h=>{const m=ZU();l(g=>kue(g,h,m))},[]),d=b.useCallback((h,m)=>{l(g=>_ue(g,h,m))},[]),f=b.useCallback((h,m,g)=>{l(v=>Sue(v,h,m,g))},[]),p=b.useMemo(()=>({fields:i,addField:u,removeField:d,updateField:f,maxDepth:r}),[i,u,d,f,r]);return o.jsx(PZn,{value:p,children:o.jsx("div",{className:Y(s),children:a})})}const uxt=b.createContext(null);function zZn({children:e,value:t}){return o.jsx(uxt.Provider,{value:t,children:e})}function Kj(){const e=b.useContext(uxt);if(!e)throw new Error("useJSONSchemaFormField must be used within a JSONSchemaForm.Field");return e}function FZn({field:e,parentPath:t=[],depth:n=0,className:r,children:s}){const{updateField:a,removeField:i}=HU(),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:n,update:l,remove:c}),[e,t,n,l,c]);return o.jsx(zZn,{value:u,children:o.jsx("div",{className:Y(r),children:s})})}const dxt=b.createContext(null);function BZn({children:e,value:t}){return o.jsx(dxt.Provider,{value:t,children:e})}function fxt(){return b.useContext(dxt)}function UZn({className:e,children:t}){const{fields:n}=HU(),r=fxt(),s=r?r.fields:n,a=r?r.parentPath:[],i=r?r.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 qZn(e){const{field:t,update:n}=Kj(),r=b.useCallback(s=>{n({name:s.target.value})},[n]);return o.jsx(E0,{...e,size:"md",labelIsHidden:!0,name:`field-name-${t.id}`,value:t.name,onChange:r})}const VZn=[{value:"string",label:"String",icon:o.jsx(Ne,{size:"sm",children:o.jsx(phe,{})})},{value:"number",label:"Number",icon:o.jsx(Ne,{size:"sm",children:o.jsx(lhe,{})})},{value:"boolean",label:"Boolean",icon:o.jsx(Ne,{size:"sm",children:o.jsx(fhe,{})})},{value:"text",label:"Text",icon:o.jsx(Ne,{size:"sm",children:o.jsx(KI,{})})},{value:"object",label:"Object",icon:o.jsx(Ne,{size:"sm",children:o.jsx(Dx,{})})},{value:"array",label:"Array",icon:o.jsx(Ne,{size:"sm",children:o.jsx(uhe,{})})}];function HZn({className:e,...t}){const{field:n,update:r}=Kj(),s=b.useCallback(a=>{r({type:a})},[r]);return o.jsx(gl,{className:Y("w-28 shrink-0",e),name:`field-type-${n.id}`,label:"Select type",labelIsHidden:!0,value:n.type,onValueChange:s,options:VZn,size:"md",...t})}function ZZn({label:e="Optional",labelClassName:t,className:n,...r}){const{field:s,update:a}=Kj(),i=b.useCallback(l=>{a({optional:l===!0})},[a]);return o.jsxs("label",{className:Y("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(Di,{...r,className:n,checked:s.optional,onCheckedChange:i}),e]})}function WZn({label:e="Nullable",labelClassName:t,className:n,...r}){const{field:s,update:a}=Kj(),i=b.useCallback(l=>{a({nullable:l===!0})},[a]);return o.jsxs("label",{className:Y("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[o.jsx(Di,{...r,className:n,checked:s.nullable,onCheckedChange:i}),e]})}function QZn({children:e,tooltip:t="Remove field",...n}){const{remove:r}=Kj();return o.jsx(ce,{...n,tooltip:t,onClick:r,size:"icon-md",children:e||o.jsx(gJe,{})})}function GZn({className:e,children:t}){const{maxDepth:n,updateField:r}=HU(),{field:s,parentPath:a,depth:i}=Kj(),l=s.type==="object"||s.type==="array",c=i>=n;if(b.useEffect(()=>{s.type==="object"&&!s.properties&&r(a,s.id,{properties:[]}),s.type==="array"&&!s.items&&r(a,s.id,{items:ZU({name:"items",type:"object",properties:[]})})},[s.type,s.properties,s.items,s.id,a,r]),!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(BZn,{value:{parentPath:u,depth:d,fields:f},children:o.jsx("div",{className:Y("pl-4 border-l border-border1 mt-2",e),children:t})})}function YZn({children:e,...t}){const{addField:n}=HU(),r=fxt(),s=r?r.parentPath:[],a=b.useCallback(()=>{n(s)},[n,s]);return o.jsx(ce,{type:"button",...t,onClick:a,children:e||"Add field"})}const Vi={Root:LZn,Field:FZn,FieldList:UZn,FieldName:qZn,FieldType:HZn,FieldOptional:ZZn,FieldNullable:WZn,FieldRemove:QZn,NestedFields:GZn,AddField:YZn};function Vk({data:e,className:t,labelsAreHidden:n,isLoading:r,LinkComponent:s}){const a=({children:i})=>n?o.jsx(Kf,{children:i}):i;return!e||e.length===0?null:o.jsx("dl",{className:Y("grid grid-cols-[auto_1fr] gap-x-4 items-start content-start",t),children:e.map(({label:i,value:l,icon:c,separator:u},d)=>{const f=Array.isArray(l);return o.jsxs(Te.Fragment,{children:[o.jsxs("dt",{className:Y("text-neutral3 text-ui-md flex items-center gap-8 justify-between min-h-9"),children:[o.jsxs("span",{className:Y("flex items-center gap-2","[&>svg]:w-[1.4em] [&>svg]:h-[1.4em] [&>svg]:text-neutral3 [&>svg]:opacity-50",{"[&>svg]:opacity-20":r}),children:[c," ",o.jsx(a,{children:i})]}),!n&&o.jsx("span",{className:Y("text-neutral3","[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:text-neutral3"),children:u})]}),o.jsx("dd",{className:Y("flex flex-wrap gap-2 py-1 min-h-9 text-ui-md items-center text-neutral5 text-wrap","[&>a]:text-neutral5 [&>a]:max-w-full [&>a]:w-auto truncate [&>a]:bg-surface4 [&>a]:transition-colors [&>a]:flex [&>a]:items-center [&>a]:gap-2 [&>a]:pt-0.5 [&>a]:pb-0.5 [&>a]:px-2 [&>a]:rounded-md [&>a]:text-ui-md [&>a]:min-h-7 [&>a]:leading-none","[&>a:hover]:text-neutral6 [&>a:hover]:bg-surface6","[&>a>svg]:w-[1em] [&>a>svg]:h-[1em] [&>a>svg]:text-neutral3 [&>a>svg]:ml-[-0.5em]"),children:r?o.jsx("span",{className:Y("bg-surface4 rounded-e-lg w-full"),style:{width:`${Math.floor(Math.random()*61)+50}%`},children:" "}):f?l?.map(p=>p.path&&s?o.jsx(KLe,{description:p.description,children:o.jsxs(s,{href:p.path,children:[p?.name," ",o.jsx(ZE,{})]})},p.id):p.path?o.jsx(KLe,{description:p.description,children:o.jsxs("a",{href:p.path,children:[p?.name," ",o.jsx(ZE,{})]})},p.id):o.jsx("span",{children:p?.name},p.id)):o.jsx(o.Fragment,{children:l||o.jsx("span",{className:"text-neutral3 text-ui-sm",children:"n/a"})})})]},i+d)})})}function KLe({description:e,children:t}){return e?o.jsxs(Hge,{openDelay:250,children:[o.jsx(Zge,{asChild:!0,children:t}),o.jsx(Wge,{children:o.jsxs(Qge,{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(Gge,{className:"fill-surface5"})]})})]}):t}function XZn({children:e,className:t}){return o.jsx("div",{className:Y("mt-auto",t),children:e})}function KZn({children:e,className:t}){return o.jsx("nav",{className:Y("",t),children:e})}function pxt({className:e}){return o.jsx("div",{className:Y("min-h-5 relative",'[&:after]:content-[""] [&:after]:block [&:after]:absolute [&:after]:h-0 [&:after]:border-border1 [&:after]:border-t [&:after]:top-1/2 [&:after]:left-3 [&:after]:right-3',e)})}function JZn({children:e,className:t,state:n="default",href:r,isActive:s,LinkComponent:a}){const i=n==="default",l=i?e:o.jsx(Kf,{children:e});return o.jsxs("div",{className:Y("grid grid-cols-[auto_1fr] items-center min-h-11",t),children:[o.jsx("header",{className:Y("text-ui-xs uppercase tracking-widest",{"pl-3":i,"text-black dark:text-white font-semibold":s,"text-neutral3/75":!s}),children:r&&i&&a?o.jsx(a,{href:r,className:Y("transition-colors duration-normal",{"hover:text-neutral5":!s,"text-black dark:text-white":s}),children:l}):l}),o.jsx(pxt,{})]})}function eWn({link:e,state:t="default",children:n,isActive:r,className:s,LinkComponent:a}){const i=t==="collapsed",l=e?.variant==="featured",u=e?.url?.startsWith("http")?{target:"_blank",rel:"noreferrer"}:{};return o.jsx("li",{className:Y("flex relative","[&>a]:flex [&>a]:items-center [&>a]:min-h-8 [&>a]:gap-2.5 [&>a]:text-ui-md [&>a]:text-neutral3 [&>a]:py-1.5 [&>a]:px-3 [&>a]:w-full [&>a]:rounded-lg [&>a]:justify-center","[&>a]:transition-all [&>a]:duration-normal [&>a]:ease-out-custom","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3/60 [&_svg]:transition-colors [&_svg]:duration-normal","[&>a:hover]:bg-surface4 [&>a:hover]:text-neutral5 [&>a:hover_svg]:text-neutral3",{"[&>a]:text-neutral5 [&>a]:bg-surface3":r,"[&_svg]:text-neutral5":r,"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":r&&!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(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsxs(a,{href:e.url,...u,children:[e.icon&&e.icon,i?o.jsx(Kf,{children:e.name}):e.name," ",n]})}),o.jsx(Kn,{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(Kf,{children:e.name}):e.name," ",n,e.isExperimental&&o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(uJe,{className:"ml-auto stroke-accent5"})}),o.jsx(Kn,{side:"right",align:"center",className:"ml-4",children:"Experimental Feature"})]})]})}):n})}function tWn({children:e,className:t}){return o.jsx("ul",{className:Y("grid gap-1 items-start content-center",t),children:e})}function nWn({children:e,className:t}){return o.jsx("section",{className:Y("grid items-start content-center relative",t),children:e})}const hxt="sidebar:state",Ube=Te.createContext(null);function qbe(){const e=Te.useContext(Ube);if(!e)throw new Error("useMainSidebar must be used within a MainSidebarProvider.");return e}function rWn(){return Te.useContext(Ube)}const sWn=e=>{window.localStorage.setItem(hxt,e.toString())};function aWn({children:e}){const[t,n]=Te.useState(()=>"default");Te.useLayoutEffect(()=>{const a=window.localStorage.getItem(hxt);(a==="collapsed"||a==="default")&&n(a)},[]);const r=Te.useCallback(()=>{sWn(t==="default"?"collapsed":"default"),n(t==="default"?"collapsed":"default")},[t]),s=Te.useMemo(()=>({state:t,toggleSidebar:r}),[t,r]);return o.jsx(Ube.Provider,{value:s,children:e})}function iWn({children:e,className:t}){const{state:n,toggleSidebar:r}=qbe(),s=n==="collapsed";return o.jsxs("div",{className:Y("flex flex-col h-full px-4 relative overflow-y-auto","transition-all duration-slow ease-out-custom",{"lg:min-w-52 xl:min-w-56 2xl:min-w-60 3xl:min-w-64 4xl:min-w-72":!s},t),children:[e,o.jsx("button",{onClick:r,className:Y("w-[.75rem] h-full right-0 top-0 absolute opacity-10",{"cursor-w-resize":!s,"cursor-e-resize":s}),"aria-label":"Toggle sidebar"})]})}function oWn({className:e}){const{state:t,toggleSidebar:n}=qbe(),r=t==="collapsed";return b.useEffect(()=>{const s=a=>{a.ctrlKey&&a.key==="b"&&(a.preventDefault(),n())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[n]),o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("button",{onClick:n,className:Y("inline-flex w-auto items-center text-neutral3 h-8 px-3 rounded-md","hover:bg-surface4 hover:text-neutral5","transition-all duration-normal ease-out-custom","focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&_svg]:transition-transform [&_svg]:duration-normal",e),"aria-label":"Toggle sidebar",children:o.jsx(sJt,{className:Y({"rotate-180":r})})})}),o.jsxs(Kn,{children:["Toggle Sidebar",o.jsxs("div",{className:"flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]",children:[o.jsx(VKt,{})," Ctrl+B"]})]})]})}const qh=Object.assign(iWn,{Bottom:XZn,Nav:KZn,NavSection:nWn,NavLink:eWn,NavHeader:JZn,NavList:tWn,NavSeparator:pxt,Trigger:oWn});function mxt({children:e,isLoading:t}){return o.jsx("p",{className:Y("text-neutral2 text-sm max-w-[35rem] flex flex-wrap gap-x-4 gap-y-1 mt-1",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":t}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function gxt({children:e,isLoading:t,size:n="default"}){return o.jsx("h1",{className:Y("text-neutral5 text-xl font-normal gap-2 flex items-center","[&>svg]:w-[1.25em] [&>svg]:h-[1.25em] [&>svg]:opacity-50",{"bg-surface4 w-60 max-w-[50%] rounded-md animate-pulse":t,"text-md":n==="smaller"}),children:t?o.jsx(o.Fragment,{children:" "}):o.jsx(o.Fragment,{children:e})})}function lWn({children:e,className:t,title:n,description:r,icon:s,isLoading:a}){const i=e===void 0&&n!==void 0;return o.jsx("header",{className:Y("w-full grid",t),children:i?o.jsxs(o.Fragment,{children:[o.jsxs(gxt,{isLoading:a,children:[s," ",n]}),r!==void 0&&o.jsx(mxt,{isLoading:a,children:r})]}):e})}const Or=Object.assign(lWn,{Title:gxt,Description:mxt});function cWn({children:e,className:t}){return o.jsx("header",{className:Y("grid items-center grid-cols-[1fr_auto]",t),children:e})}function uWn({headingLevel:e="h2",children:t,className:n}){const r=e;return o.jsx(r,{className:Y("flex items-center gap-2 text-ui-lg font-bold text-neutral4","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",n),children:t})}function vxt({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-4",t),children:e})}function Hk({children:e,className:t}){return o.jsx("section",{className:Y("grid gap-2",t),children:e})}const Wl=Object.assign(vxt,{Header:cWn,Heading:uWn});function dWn({title:e,description:t,tone:n="default",id:r,className:s,descriptionClassName:a}){const i=n==="danger";return o.jsxs(o.Fragment,{children:[o.jsx("h3",{id:r,className:Y("font-serif text-header-md font-normal leading-tight tracking-normal",i?"text-accent2":"text-neutral4",s),children:e}),t!=null&&o.jsx("p",{className:Y("mt-2 max-w-[62ch] font-sans text-[13.5px] leading-ui-xs",i?"text-accent2/70":"text-neutral-500",a),children:t})]})}function JLe({title:e,description:t,action:n,variant:r="default",fillHeight:s=!1,className:a,contentClassName:i,children:l}){const c=r==="danger";return o.jsxs("section",{"data-variant":r,className:Y("overflow-hidden rounded-2xl border",s&&"flex h-full flex-col",c?"border-accent2/25":"border-border2/40",a),children:[o.jsxs("div",{className:Y("flex flex-col gap-3 px-7 pt-7 pb-6 sm:flex-row sm:items-start sm:justify-between sm:gap-6",c?"bg-accent2/[0.08]":"bg-surface2"),children:[o.jsx("div",{className:"min-w-0",children:o.jsx(dWn,{title:e,description:t,tone:c?"danger":"default"})}),n!=null?o.jsx("div",{className:"shrink-0",children:n}):null]}),o.jsx("div",{className:Y("min-w-0 px-7 pt-6 pb-7",s&&"flex-1",c?"bg-accent2/[0.04]":null,i),children:l})]})}function fWn(){return kj({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8125rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[se.className,se.propertyName]}]})}function pWn(){const e=vt.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=Im.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,tw(t)]}const hWn=()=>{const e=Gj().resolvedTheme==="dark";return b.useMemo(()=>e?fWn():pWn(),[e])};function mWn({codeStr:e="",title:t,icon:n,simplified:r=!1}){const s=hWn(),[a,i]=b.useState(!1),l=b.useMemo(()=>{try{const u=JSON.parse(e);return Oue(u||"")}catch{return!1}},[e]),c=a?e?.replace(/\\n/g,`
|
|
296
296
|
`):e;return o.jsxs(Wl,{children:[o.jsxs(Wl.Header,{children:[o.jsxs(Wl.Heading,{children:[n,t]}),o.jsxs(ps,{children:[o.jsx(_a,{content:e||"No content"}),l&&o.jsx(ce,{onClick:()=>i(!a),children:a?o.jsx(KI,{}):o.jsx(h6,{})})]})]}),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:r?o.jsx("div",{className:"text-neutral4 font-mono break-all px-2",children:o.jsx("pre",{className:"text-wrap",children:e})}):o.jsx(eu,{extensions:[eC(),vt.lineWrapping],theme:s,value:c})})]})}function Oue(e){if(typeof e=="string"){const t=e.indexOf(`
|
|
@@ -660,7 +660,7 @@ Token usage: ${n} input + ${r} output = ${s} total`:`The model stopped generatin
|
|
|
660
660
|
"groundTruth": "Expected result (optional)",
|
|
661
661
|
"metadata": { "key": "value" } // optional
|
|
662
662
|
}
|
|
663
|
-
]`})]})]})}function UZr({errors:e,maxErrors:t=5}){if(e.length===0)return null;const n=e.slice(0,t),r=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(Ne,{children:o.jsx(Ny,{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:n.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))}),r>0&&o.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",r," more error",r!==1?"s":""]})]})}function qZr({datasetId:e,open:t,onOpenChange:n,onSuccess:r}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState({current:0,total:0}),[d,f]=b.useState(null),[p,h]=b.useState(!1),{parseFile:m,isParsing:g,error:v}=QHr(),{batchInsertItems:x}=Ei(),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"),h(!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}),h(!1),a("complete")},[i,x,e]),_=b.useCallback(()=>{n(!1),r?.(),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)},[n,r,d]),O=b.useCallback(()=>{p||(n(!1),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150))},[p,n]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return o.jsx(BZr,{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(UZr,{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(FZr,{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(Bt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return o.jsx(ce,{onClick:O,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(ce,{variant:"primary",onClick:S,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return o.jsx(ce,{variant:"primary",onClick:_,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx($r,{open:t,onOpenChange:O,children:o.jsxs(Ar,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:N[s]}),o.jsx(fa,{children:"Import dataset items from a JSON file."})]}),o.jsx(ts,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(rp,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function VZr({dataset:e,isLoading:t=!1,onEditClick:n,onDuplicateClick:r,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(qn,{className:c,children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{isLoading:t,children:[o.jsx(Ya,{})," ",e?.name]}),o.jsx(qn.Description,{isLoading:t,children:e?.description}),o.jsxs(qn.Description,{isLoading:t,children:[o.jsxs(us,{children:[o.jsx(FE,{})," Created at ",e?.createdAt?an(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(us,{children:[o.jsx(Y0,{})," Latest version v",e?.version??""]})]})]}),o.jsx(qn.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(nr,{children:[o.jsx(rr,{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(Kn,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(ce,{disabled:!0,tabIndex:-1,children:[o.jsx(Fy,{}),"Run Experiment"]})})}),o.jsx(Kn,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(ce,{onClick:l,children:[o.jsx(Fy,{}),"Run Experiment"]}):null,o.jsxs(St,{children:[o.jsx(St.Trigger,{asChild:!0,children:o.jsx(ce,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(KYe,{})})}),o.jsxs(St.Content,{align:"end",className:"w-48",children:[o.jsxs(St.Item,{onSelect:n,children:[o.jsx(ob,{})," Edit Dataset"]}),o.jsxs(St.Item,{onSelect:r,children:[o.jsx(Fu,{})," Duplicate Dataset"]}),o.jsxs(St.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(Vd,{})," Delete Dataset"]})]})]})]})})]})}const x2t=e=>{const t=Ze(),{data:n}=v$(e),r=n?.experiments;return Ot({queryKey:["dataset-review-items",e,r?.map(s=>s.id)],queryFn:async()=>!r||r.length===0?[]:(await Promise.all(r.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&&!!r&&r.length>0,refetchOnWindowFocus:!1})},HZr=e=>{const t=Ze(),{data:n}=v$(e),r=n?.experiments;return Ot({queryKey:["dataset-completed-items",e,r?.map(s=>s.id)],queryFn:async()=>!r||r.length===0?[]:(await Promise.all(r.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&&!!r&&r.length>0,refetchOnWindowFocus:!1})};function ZZr(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const n=JSON.stringify(e);return n.length>t?n.slice(0,t)+"...":n}catch{return String(e)}}const WZr=Y("bg-surface5 backdrop-blur-xl z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95");function hQe({className:e,children:t,...n}){return o.jsx(rM,{children:o.jsx(mB,{className:Y(WZr,e),...n,children:t})})}function QZr({datasetId:e}){const t=Ze(),{data:n}=jv(e),{data:r,isLoading:s}=x2t(e),{data:a,isLoading:i}=HZr(e),{updateExperimentResult:l}=Ei(),[c,u]=b.useState(null),[d,f]=b.useState(null),[p,h]=b.useState(new Set),[m,g]=b.useState(!1),[v,x]=b.useState(!1),[w,S]=b.useState(!1),[_,O]=b.useState(""),[E,T]=b.useState(""),[j,N]=b.useState(""),[I,P]=b.useState([]),[R,B]=b.useState(!1),[M,L]=b.useState(null),U=M??r??[];b.useEffect(()=>{r&&M===null&&L(r)},[r]);const z=b.useMemo(()=>{const ye=new Set;if(n?.tags)for(const Ce of n.tags)ye.add(Ce);for(const Ce of U)for(const De of Ce.tags)ye.add(De);return[...ye].sort()},[n,U]),q=b.useCallback(ye=>{!n||!e||(n.tags??[]).includes(ye)},[n,e]),Z=b.useMemo(()=>d?d==="__untagged__"?U.filter(ye=>ye.tags.length===0):U.filter(ye=>ye.tags.includes(d)):U,[U,d]),D=b.useMemo(()=>{const ye=new Map;for(const Ce of U)for(const De of Ce.tags)ye.set(De,(ye.get(De)??0)+1);return[...ye.entries()].sort((Ce,De)=>De[1]-Ce[1])},[U]),G=b.useMemo(()=>U.filter(ye=>ye.tags.length===0).length,[U]),V=b.useMemo(()=>{let ye=0;return d&&ye++,m&&ye++,ye},[d,m]),$=b.useCallback((ye,Ce)=>{L(ut=>(ut??[]).map(jt=>jt.id===ye?{...jt,tags:Ce}:jt));const De=U.find(ut=>ut.id===ye);De?.experimentId&&De?.datasetId&&l.mutate({datasetId:De.datasetId,experimentId:De.experimentId,resultId:De.id,tags:Ce})},[U,l]),W=b.useCallback((ye,Ce)=>{const De=U.find(ut=>ut.id===ye);De?.traceId&&Ce!==void 0&&t.createFeedback({feedback:{traceId:De.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ce==="positive"?1:-1,experimentId:De.experimentId??void 0,sourceId:De.id}}).catch(()=>{}),L(ut=>(ut??[]).map(jt=>jt.id===ye?{...jt,rating:Ce}:jt))},[U,t]),Q=b.useCallback((ye,Ce)=>{const De=U.find(ut=>ut.id===ye);De?.traceId&&t.createFeedback({feedback:{traceId:De.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ce,comment:Ce,experimentId:De.experimentId??void 0,sourceId:De.id}}).catch(()=>{}),L(ut=>(ut??[]).map(jt=>jt.id===ye?{...jt,comment:Ce}:jt))},[U,t]),J=b.useCallback(ye=>{const Ce=U.find(De=>De.id===ye);L(De=>(De??[]).filter(ut=>ut.id!==ye)),h(De=>{const ut=new Set(De);return ut.delete(ye),ut}),c===ye&&u(null),Ce?.experimentId&&Ce?.datasetId&&l.mutate({datasetId:Ce.datasetId,experimentId:Ce.experimentId,resultId:Ce.id,status:null})},[U,l,c]),ae=b.useCallback(ye=>{const Ce=U.find(De=>De.id===ye);L(De=>(De??[]).filter(ut=>ut.id!==ye)),h(De=>{const ut=new Set(De);return ut.delete(ye),ut}),c===ye&&u(null),Ce?.experimentId&&Ce?.datasetId&&l.mutate({datasetId:Ce.datasetId,experimentId:Ce.experimentId,resultId:Ce.id,status:"complete"})},[U,l,c]),te=b.useMemo(()=>{const ye=m?a??[]:Z;return!m||!d?ye:d==="__untagged__"?ye.filter(Ce=>Ce.tags.length===0):ye.filter(Ce=>Ce.tags.includes(d))},[m,a,Z,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(te.map(ye=>ye.id)),[te]),pe=b.useMemo(()=>[...p].filter(ye=>ie.has(ye)).length,[p,ie]),X=te.length>0&&pe===te.length,ne=pe>0&&!X,le=b.useCallback(ye=>{h(Ce=>{const De=new Set(Ce);return De.has(ye)?De.delete(ye):De.add(ye),De})},[]),ge=b.useCallback(()=>{h(X?new Set:new Set(te.map(ye=>ye.id)))},[X,te]),de=b.useCallback(ye=>{for(const Ce of p){const De=U.find(ut=>ut.id===Ce);De&&!De.tags.includes(ye)&&$(Ce,[...De.tags,ye])}},[U,p,$]),ue=b.useCallback(ye=>{for(const Ce of p){const De=U.find(ut=>ut.id===Ce);De&&De.tags.includes(ye)&&$(Ce,De.tags.filter(ut=>ut!==ye))}},[U,p,$]),be=b.useCallback(()=>{for(const ye of p)ae(ye);h(new Set)},[p,ae]),ke=b.useCallback(()=>{for(const ye of p)J(ye);h(new Set)},[p,J]),Ie=b.useCallback(()=>{O(""),S(!0)},[]),K=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ye=U.filter(De=>p.has(De.id));if(ye.length===0){x(!1);return}const Ce=await t.clusterFailures({modelId:`${E}/${j}`,items:ye.map(De=>({id:De.id,input:De.input,output:De.output??void 0,error:typeof De.error=="string"?De.error:De.error?String(De.error):void 0,scores:De.scores,existingTags:De.tags.length>0?De.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:_||void 0});Ce.proposedTags&&Ce.proposedTags.length>0&&(P(Ce.proposedTags.map(De=>({...De,accepted:!0}))),B(!0))}catch(ye){console.error("Analysis failed:",ye)}finally{x(!1)}}},[E,j,U,p,t,z,_]),oe=b.useCallback(()=>{for(const ye of I){if(!ye.accepted)continue;const Ce=U.find(De=>De.id===ye.itemId);if(Ce){const De=[...new Set([...Ce.tags,...ye.tags])];$(Ce.id,De)}}B(!1)},[I,U,$]),we=b.useCallback(ye=>{u(Ce=>Ce===ye?null:ye)},[]),Pe=b.useMemo(()=>c?te.find(ye=>ye.id===c)??null:null,[c,te]),Le=b.useCallback(()=>{if(!c||te.length===0)return;const ye=te.findIndex(Ce=>Ce.id===c);ye<te.length-1&&u(te[ye+1].id)},[c,te]),ve=b.useCallback(()=>{if(!c||te.length===0)return;const ye=te.findIndex(Ce=>Ce.id===c);ye>0&&u(te[ye-1].id)},[c,te]),Ee=Pe?"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(Bt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx($r,{open:w,onOpenChange:S,children:o.jsxs(Ar,{children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:"Analyze Items"}),o.jsx(fa,{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(Ct,{className:"text-xs mb-1 block",children:"Provider"}),o.jsx(Tv,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(Ct,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Nv,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(me,{variant:"ui-xs",className:"text-neutral3",children:[p.size," item",p.size!==1?"s":""," will be analyzed"]}),o.jsxs("div",{children:[o.jsx(Ct,{className:"text-xs",children:"Instructions (optional)"}),o.jsx(Kc,{value:_,onChange:ye=>O(ye.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(rp,{children:[o.jsx(ce,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(ce,{onClick:K,disabled:!E||!j||v,children:[v?o.jsx(Bt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx($r,{open:R,onOpenChange:B,children:o.jsxs(Ar,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:"Review Proposed Tags"}),o.jsxs(fa,{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 De=U.find(ut=>ut.id===ye.itemId);return o.jsx("div",{className:Y("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:ut=>P(jt=>jt.map((bn,Ve)=>Ve===Ce?{...bn,accepted:!!ut}:bn))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate block",children:De?typeof De.input=="string"?De.input.slice(0,100):JSON.stringify(De.input).slice(0,100):ye.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ye.tags.map((ut,jt)=>o.jsx(f2t,{tag:ut,onRename:bn=>P(Ve=>Ve.map((He,Re)=>Re===Ce?{...He,tags:He.tags.map((Qe,Fe)=>Fe===jt?bn:Qe)}:He)),onRemove:()=>P(bn=>bn.map((Ve,He)=>He===Ce?{...Ve,tags:Ve.tags.filter((Re,Qe)=>Qe!==jt)}:Ve))},`${ut}-${jt}`))}),ye.reason&&o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ye.reason})]})]})},ye.itemId)})}),o.jsxs(rp,{children:[o.jsx(ce,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(ce,{onClick:oe,disabled:I.filter(ye=>ye.accepted).length===0,children:["Accept ",I.filter(ye=>ye.accepted).length," proposals"]})]})]})}),o.jsxs(Wf,{className:Pe?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(Cn,{children:[o.jsxs(Cn.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(St,{children:[o.jsx(St.Trigger,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:"md",children:[o.jsx(JYe,{}),"Filter",V>0&&o.jsx("span",{className:Y("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:V})]})}),o.jsxs(St.Content,{align:"start",className:Y("min-w-48"),children:[o.jsxs(St.Sub,{children:[o.jsxs(St.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(hQe,{children:[o.jsx(St.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ye=>ye.preventDefault(),children:"Review Queue"}),o.jsx(St.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ye=>ye.preventDefault(),children:"Completed"})]})]}),o.jsxs(St.Sub,{children:[o.jsxs(St.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(hQe,{children:[o.jsx(St.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ye=>ye.preventDefault(),children:"All"}),G>0&&o.jsx(St.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ye=>ye.preventDefault(),children:"Untagged"}),D.length>0&&o.jsx(St.Separator,{}),D.map(([ye])=>o.jsx(St.CheckboxItem,{checked:d===ye,onCheckedChange:()=>f(d===ye?null:ye),onSelect:Ce=>Ce.preventDefault(),children:ye},ye))]})]}),V>0&&o.jsxs(o.Fragment,{children:[o.jsx(St.Separator,{}),o.jsxs(St.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(Lr,{}),"Clear all filters"]})]})]})]}),V>0&&o.jsxs(ce,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(Lr,{}),"Reset"]})]}),!m&&p.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(d2t,{selectedCount:p.size,vocabulary:z,onApplyTag:de,onRemoveTag:ue,onNewTag:ye=>de(ye)}),o.jsxs(St,{children:[o.jsx(St.Trigger,{asChild:!0,children:o.jsxs(ce,{disabled:v,children:[v?o.jsx(Bt,{className:"w-4 h-4"}):o.jsx(Ne,{size:"sm",children:o.jsx(ws,{})}),"Actions"]})}),o.jsxs(St.Content,{align:"end",children:[o.jsxs(St.Item,{onSelect:be,children:[o.jsx(Ne,{size:"sm",children:o.jsx(h1,{})}),"Complete"]}),o.jsxs(St.Item,{onSelect:ke,children:[o.jsx(Ne,{size:"sm",children:o.jsx(Vd,{})}),"Remove"]}),o.jsx(St.Separator,{}),o.jsxs(St.Item,{onSelect:Ie,children:[o.jsx(Ne,{size:"sm",children:o.jsx(qE,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Bt,{className:"w-6 h-6"})}):te.length===0?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"text-center px-8",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-2 block",children:m?"Items marked as complete will appear here for auditing.":"When experiment results are flagged for review, they will appear here."})]})}):o.jsxs(xe,{columns:Ee,children:[o.jsxs(xe.Top,{children:[!m&&o.jsx(xe.TopCell,{children:o.jsx(Di,{checked:X?!0:ne?"indeterminate":!1,onCheckedChange:()=>ge(),"aria-label":"Select all"})}),m&&o.jsx(xe.TopCell,{children:" "}),o.jsx(xe.TopCell,{children:"Input"}),o.jsx(xe.TopCell,{children:"Comment"}),o.jsx(xe.TopCell,{children:"Tags"}),!Pe&&o.jsx(xe.TopCell,{children:"Rating"}),!Pe&&o.jsx(xe.TopCell,{children:"Scores"})]}),o.jsx(xe.Rows,{children:te.map(ye=>{const Ce=ye.scores?Object.entries(ye.scores):[];return o.jsxs(xe.Row,{onClick:()=>we(ye.id),selected:c===ye.id,children:[o.jsx(xe.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:p.has(ye.id),onCheckedChange:()=>le(ye.id),onClick:De=>De.stopPropagation(),"aria-label":`Select item ${ye.id}`})}),o.jsx(xe.NameCell,{children:ZZr(ye.input,80)}),o.jsx(xe.Cell,{children:ye.comment?o.jsx(me,{variant:"ui-xs",className:"text-neutral3 truncate",children:ye.comment}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(xe.Cell,{children:ye.tags.length>0?o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate",children:ye.tags.join(", ")}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Pe&&o.jsxs(xe.Cell,{children:[ye.rating==="positive"&&o.jsx(Ne,{size:"sm",className:"text-positive1",children:o.jsx(Tpe,{})}),ye.rating==="negative"&&o.jsx(Ne,{size:"sm",className:"text-negative1",children:o.jsx(jpe,{})}),!ye.rating&&o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Pe&&o.jsx(xe.Cell,{children:Ce.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ne,{size:"sm",className:"text-neutral3",children:o.jsx(si,{})}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ce[0][1].toFixed(2)}),Ce.length>1&&o.jsxs(kt,{variant:"default",children:["+",Ce.length-1]})]}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ye.id)})})]})]}),Pe&&o.jsx(u2t,{item:Pe,isCompleted:m,tagVocabulary:z,onRate:ye=>W(Pe.id,ye),onSetTags:ye=>{$(Pe.id,ye);for(const Ce of ye)z.includes(Ce)||q(Ce)},onComment:ye=>Q(Pe.id,ye),onRemove:()=>J(Pe.id),onComplete:m?void 0:()=>ae(Pe.id),onPrevious:ve,onNext:Le,onClose:()=>u(null)})]})]})}function GZr({datasetId:e,onExperimentClick:t,onEditClick:n,onDeleteClick:r,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:l,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=cn(),[p,h]=b.useState(u??"items"),m=Tt=>{h(Tt),d?.(Tt)},[g,v]=b.useState(!1),[x,w]=b.useState(!1),[S,_]=b.useState(!1),[O,E]=b.useState([]),[T,j]=b.useState(!1),[N,I]=b.useState([]),[P,R]=b.useState(!1),[B,M]=b.useState([]),[L,U]=b.useState(!1),[z,q]=b.useState(0),[Z,D]=b.useState(null),[G,V]=b.useState(""),[$]=z1n(G,300),[W,Q]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=jv(e),{data:ie=[],total:pe,isLoading:X,setEndOfListElement:ne,isFetchingNextPage:le,hasNextPage:ge}=ij(e,$||void 0,ae),{data:de=[],total:ue,isLoading:be}=ij(e,void 0,ae),[ke,Ie]=b.useState({}),{data:K,isLoading:oe}=v$(e,void 0,ke),{data:we}=v$(e),{deleteItems:Pe}=Ei(),Le=K?.experiments??[],ve=we?.experiments??[],Ee=fZr({hasSearchQuery:!!$,filteredItemsLength:ie.length,unfilteredItemsTotal:ue,itemsTotal:pe}),{data:ye}=x2t(e),Ce=ye?.length??0,De=Tt=>{D(Tt)},ut=()=>{D(null)},jt=Tt=>{const un=Tt.isCurrent?null:Tt;c?c(un):Q(Tt.isCurrent?null:Tt.version)},bn=Tt=>{E(Tt),_(!0)},Ve=Tt=>{I(Tt),j(!0)},He=Tt=>{j(Tt),Tt||(I([]),q(un=>un+1))},Re=Tt=>{f(`/datasets/${e}/items?items=${Tt.join(",")}`)},Qe=Tt=>{f(`/datasets/${e}/versions?ids=${Tt.join(",")}`)},Fe=Tt=>{M(Tt),R(!0)},Ke=async()=>{await Pe.mutateAsync({datasetId:e,itemIds:B}),ze.success(`Deleted ${B.length} items`),R(!1),M([]),q(Tt=>Tt+1)},rt=Tt=>{_(!1),E([]),q(un=>un+1),i?.(Tt)},_t=Tt=>{_(Tt),Tt||(E([]),q(un=>un+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Y("h-full w-full",_r.allSlow),children:o.jsxs("div",{className:Y("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",Z?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(VZr,{dataset:te,isLoading:re,onEditClick:n,onDuplicateClick:()=>U(!0),onDeleteClick:r,experimentTriggerSlot:a,disableExperimentTrigger:!be&&de.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(ed,{defaultTab:"items",value:p,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(td,{children:[o.jsxs(Xr,{value:"items",children:["Items ",o.jsx(oi,{color:"gray",children:Ee})]}),o.jsxs(Xr,{value:"experiments",children:["Experiments",o.jsx(oi,{color:"gray",children:Le.length})]}),o.jsxs(Xr,{value:"review",children:["Review",Ce>0&&o.jsx(oi,{color:"orange",children:Ce})]})]}),o.jsx(Es,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(zZr,{datasetId:e,items:ie,isLoading:X,featuredItemId:Z,onItemSelect:De,onItemClose:ut,onAddClick:s??(()=>{}),onImportClick:()=>v(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Fe,onCreateDatasetClick:bn,onAddToDatasetClick:Ve,onCompareItemsClick:Re,datasetName:te?.name,clearSelectionTrigger:z,setEndOfListElement:ne,isFetchingNextPage:le,hasNextPage:ge,searchQuery:G,onSearchChange:V,activeDatasetVersion:ae,currentDatasetVersion:te?.version,onVersionSelect:jt,onCompareVersionsClick:Qe})}),o.jsx(Es,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(jZr,{experiments:Le,allExperiments:ve,isLoading:oe,datasetId:e,filters:ke,onFiltersChange:Ie})}),o.jsx(Es,{value:"review",className:"overflow-auto mt-0",children:o.jsx(QZr,{datasetId:e})})]})})]})})}),o.jsx(xZr,{datasetId:e,open:g,onOpenChange:v}),o.jsx(qZr,{datasetId:e,open:x,onOpenChange:w}),o.jsx(iZr,{open:S,onOpenChange:_t,items:O,onSuccess:rt}),o.jsx(oZr,{open:T,onOpenChange:He,items:N,currentDatasetId:e}),o.jsx(lZr,{open:L,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx(Ht,{open:P,onOpenChange:R,children:o.jsxs(Ht.Content,{children:[o.jsxs(Ht.Header,{children:[o.jsx(Ht.Title,{children:"Delete Items"}),o.jsxs(Ht.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs(Ht.Footer,{children:[o.jsx(Ht.Cancel,{children:"Cancel"}),o.jsx(Ht.Action,{onClick:Ke,children:Pe.isPending?"Deleting...":"Delete"})]})]})})]})}function YZr(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const n=JSON.parse(t[1]);if(n.field&&Array.isArray(n.errors))return{field:n.field,errors:n.errors}}catch{}return null}function mQe({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((n,r)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,n.path!=="/"?n.path:""]}),": ",n.message]},r))}):null}function XZr({datasetId:e,open:t,onOpenChange:n,onSuccess:r}){const[s,a]=b.useState("{}"),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(null),{addItem:p}=Ei(),h=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 _;if(c.trim())try{_=JSON.parse(c)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await p.mutateAsync({datasetId:e,input:w,groundTruth:S,expectedTrajectory:_}),ze.success("Item added successfully"),f(null),a("{}"),l(""),u(""),n(!1),r?.()}catch(O){const E=YZr(O);E?f(E):ze.error(`Failed to add item: ${O instanceof Error?O.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),n(!1)};return o.jsx($r,{open:t,onOpenChange:n,children:o.jsxs(Ar,{className:"max-w-lg",children:[o.jsx(Mr,{children:o.jsx(Ir,{children:"Add Item"})}),o.jsx(ts,{children:o.jsxs("form",{onSubmit:h,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ct,{htmlFor:"item-input",children:"Input (JSON) *"}),o.jsx(fs,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(mQe,{field:"input",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ct,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),o.jsx(fs,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(mQe,{field:"groundTruth",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ct,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),o.jsx(fs,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(ce,{type:"button",onClick:v,children:"Cancel"}),o.jsx(ce,{type:"submit",variant:"primary",disabled:p.isPending,children:p.isPending?"Adding...":"Add Item"})]})]})})]})})}function KZr({selectedScorers:e,setSelectedScorers:t,disabled:n=!1,container:r}){const{data:s,isLoading:a}=ef(),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(Ct,{children:"Scorers (Optional)"}),o.jsx(vbt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:n||a,container:r})]})}const JZr=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function eWr({targetType:e,setTargetType:t,targetId:n,setTargetId:r,container:s}){const{data:a,isLoading:i}=Ov(),{data:l,isLoading:c}=vw(),{data:u,isLoading:d}=ef(),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})):[],p=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,h=g=>{t(g),r("")},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(Ct,{children:"Target Type"}),o.jsx(jc,{options:JZr,value:e,onValueChange:h,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(Ct,{children:m}),o.jsx(jc,{options:f,value:n,onValueChange:r,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:p,container:s})]})]})}function tWr({datasetId:e,version:t,open:n,onOpenChange:r,onSuccess:s}){const a=b.useRef(null),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState([]),{triggerExperiment:p}=Ei(),h=i&&c,m=p.isPending,g=async()=>{if(h)try{const x=await p.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});wm.success("Experiment triggered successfully"),r(!1),s?.(x.experimentId),l(""),u(""),f([])}catch(x){const w=x instanceof Error?x.message:"Failed to trigger experiment";wm.error(w)}},v=()=>{m||(r(!1),l(""),u(""),f([]))};return o.jsx($r,{open:n,onOpenChange:v,children:o.jsxs(Ar,{ref:a,children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:"Run Experiment"}),o.jsx(fa,{children:t?`Execute items from ${an(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(ts,{className:"grid gap-6",children:[o.jsx(eWr,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(KZr,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(rp,{className:"px-6 pt-4",children:[o.jsx(ce,{onClick:v,disabled:m,children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:g,disabled:!h||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Bt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const w2t=e=>{const t=Ze();return Ot({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},gQe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function nWr({result:e,scores:t,onPrevious:n,onNext:r,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=lie(e?.input),d=lie(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(Cn.Toolbar,{children:[o.jsx(eT,{onPrevious:n,onNext:r,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(ce,{onClick:a,disabled:!e.traceId,children:[o.jsx(Epe,{}),"Show Trace"]}),o.jsx(ce,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(Lr,{})})]})]}),o.jsxs(Cn.Content,{children:[o.jsx(qn,{withMargins:!1,children:o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(Fy,{})," ",e.id]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:[o.jsx(p0,{})," ",e.itemId]})})]})}),c&&o.jsx(dr,{variant:"destructive",title:"Error",children:o.jsx(dr.Message,{children:lie(e?.error&&typeof e.error=="object"?e.error.message:e?.error)})}),t&&t.length>0&&o.jsxs(Ft,{className:"grid-rows-[auto_auto] overflow-visible",children:[o.jsxs(Ft.Header,{columns:gQe,children:[o.jsx(Ft.HeaderCol,{children:"Scorer"}),o.jsx(Ft.HeaderCol,{children:"Score"})]}),o.jsx(Ft.Items,{children:t.map(f=>o.jsx(Ft.Row,{children:o.jsxs(Ft.RowButton,{item:{id:f.id},columns:gQe,isFeatured:l===f.id,onClick:i,children:[o.jsx(Ft.TextCell,{children:f.scorerId}),o.jsx(Ft.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(fj,{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(Gt.CodeSection,{title:"Input",icon:o.jsx(p0,{}),codeStr:u}),o.jsx(Gt.CodeSection,{title:"Output",icon:o.jsx(zf,{}),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(FE,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:an(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function lie(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function rWr({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Gt.CodeSection,{title:"Input",icon:o.jsx(h0,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Gt.CodeSection,{title:"Output",icon:o.jsx(zf,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Gt.CodeSection,{title:"Metadata",icon:o.jsx(hh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Gt.CodeSection,{title:"Attributes",icon:o.jsx(hh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function sWr({traceId:e,spanId:t,onNext:n,onPrevious:r,onClose:s}){const{data:a}=K1(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(Cn.Toolbar,{children:[o.jsx(eT,{onPrevious:r,onNext:n,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(ce,{onClick:s,"aria-label":"Close span details",children:o.jsx(Lr,{})})]}),o.jsxs(Cn.Content,{children:[o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(hh,{})," Span ",Zf(t)]})})}),o.jsx(rWr,{span:i})]})]})}const aWr=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),n=new Map,r=[];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};n.set(l.spanId,d)}),e.forEach(l=>{const c=n.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}r.push(c)}else{const u=n.get(l.parentSpanId);u?u.spans.push(c):r.push(c)}});const s=l=>l.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(r),i=l=>{l.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function S2t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(n=>{t.push(n.id),t.push(...S2t(n))}),t}const vQe=["agent","workflow","model","mcp","tool","workspace","other"];function k2t(e){const t=e?.toLowerCase().split("_")[0],n={agent:{icon:o.jsx(Ma,{}),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(uo,{}),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(Og,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(Gl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(co,{}),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(VU,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in n?n[t]:{typePrefix:"other"}}function iWr({isSelected:e,isFaded:t,isExpanded:n,toggleChildren:r,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Y("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(yQe,{onClick:()=>r?.(),children:[i?a:l," ",n?i?o.jsx(qYe,{}):o.jsx(G0,{}):o.jsx(ws,{})]}),a>(l??0)&&!i&&o.jsxs(yQe,{onClick:()=>s?.(),children:[a," ",o.jsx(UYe,{})]})]}):null})}function yQe({onClick:e,children:t,className:n}){return o.jsx("button",{onClick:e,className:Y("h-full",n),children:o.jsx("div",{className:Y("flex items-center gap-[0.1rem] text-ui-sm text-neutral5 border border-border1 pl-2 pr-1 rounded-lg transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-4 [&>svg]:h-4 [&>svg]:transition-all"),children:t})})}function oWr({isLastChild:e,hasChildren:t=!1,expanded:n=!1}){return o.jsx("div",{className:Y("w-12 h-[2.8rem] relative opacity-100",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-0 after:border-l after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-0 before:border-b before:border-neutral3 before:border-dashed',"[&_svg]:transition-all","[&:hover_svg]:text-yellow-500 [&:hover_svg]:scale-[1.3] [&:hover_svg]:opacity-100",{"after:bottom-[50%]":e}),children:t&&o.jsx("span",{className:Y("flex absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%] items-center justify-center bg-surface2 p-1","[&>svg]:shrink-0 [&>svg]:opacity-60 [&>svg]:w-[0.8rem] [&>svg]:h-[0.8rem]"),children:n?o.jsx(ZYe,{}):o.jsx(HYe,{})})})}function lWr({span:e,spanUI:t,isFaded:n,depth:r=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:`${r*1.5}rem`},children:[!c&&o.jsx("button",{onClick:()=>d?.(),disabled:!l,className:Y({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(oWr,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function _2t({span:e,depth:t=0,onSpanClick:n,selectedSpanId:r,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:l,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:p}){const h=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=S2t(e),v=g.length,x=t===0,w=k2t(e?.type),S=f?f.includes(e.id):!1,_=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(w?.typePrefix||""):!1)||_;b.useEffect(()=>{x&&p?.([e.id])},[x,e.id,p]),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,p,f]);const T=()=>{if(!(!p||!f))if(S){const I=[e.id,...g];p(f.filter(P=>!I.includes(P)))}else p([...f,e.id])},j=()=>{!p||!f||p([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(lWr,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:n,selectedSpanId:r,isLastChild:s,hasChildren:h,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(iWr,{isSelected:r===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:N,numOfChildren:m}),h&&S&&e.spans?.map((I,P,R)=>{const B=P===R.length-1;return o.jsx(_2t,{span:I,depth:t+1,onSpanClick:n,selectedSpanId:r,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:p,featuredSpanIds:d},I.id)})]})}function cWr({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:n,isLoading:r,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:r?o.jsxs("div",{className:Y("flex items-center text-ui-md gap-4 bg-surface3/50 rounded-md p-6 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Bt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(_2t,{span:f,onSpanClick:t,selectedSpanId:n,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function uWr({spans:e=[],fadedTypes:t,onLegendClick:n,onLegendReset:r,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=vQe.filter(p=>e.some(h=>h?.spanType?.startsWith(p)))||[],u=e.some(p=>!vQe.some(m=>p?.spanType?.startsWith(m))),d=p=>{n?.(p)};b.useEffect(()=>{f(i)},[i,s]);const f=Pct(p=>{s?.(p)},1e3);return o.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[o.jsx("div",{className:"flex",children:o.jsx(C0,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:p=>{l(p.target.value)},onReset:()=>l("")})}),o.jsxs(ps,{spacing:"close",children:[c.map(p=>{const h=k2t(p),m=t?.includes(p);return o.jsx(b.Fragment,{children:o.jsxs(ce,{onClick:()=>d(p),className:m?"opacity-40":"",style:{color:m?void 0:h?.color,backgroundColor:h?.bgColor},children:[h?.icon&&o.jsx(Ne,{children:h.icon}),h?.label]})},p)}),u&&o.jsxs(ce,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ne,{children:o.jsx(d8,{})}),"Other"]}),o.jsx(ce,{onClick:r,disabled:t?.length===0,children:o.jsx(Ne,{children:o.jsx(Lr,{})})})]})]})}function dWr({traceId:e,selectedSpanId:t,onSpanSelect:n,onClose:r}){const{data:s,isLoading:a}=w2t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,p]=b.useState([]),[h,m]=b.useState([]),g=b.useMemo(()=>aWr(i),[i]);b.useEffect(()=>{if(l.trim()===""){p([]);return}const S=l.toLowerCase(),_=i.filter(O=>O.name.toLowerCase().includes(S)).map(O=>O.spanId);p(_)},[l,i]),b.useEffect(()=>{c(""),d([]),p([]),m([])},[e]);const v=S=>{n?.(t===S?void 0:S)},x=S=>{d(_=>_.includes(S)?_.filter(O=>O!==S):[..._,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(Cn.Toolbar,{children:o.jsx(ce,{onClick:r,"aria-label":"Close trace panel",children:o.jsx(Lr,{})})}),o.jsxs(Cn.Content,{children:[o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(Jo,{})," Trace ",Zf(e)]})})}),o.jsx(uWr,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(cWr,{hierarchicalSpans:g,onSpanClick:v,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:h,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function fWr({results:e,isLoading:t,featuredResultId:n,onResultClick:r,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:l,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?o.jsxs(xe,{columns:d,children:[o.jsx(xe.Top,{children:s.map(f=>o.jsx(xe.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Bt,{})})]}):e.length===0?o.jsxs(xe,{columns:d,children:[o.jsx(xe.Top,{children:s.map(f=>o.jsx(xe.TopCell,{children:f.label},f.name))}),o.jsx(xe.NoMatch,{message:"No results yet"})]}):o.jsxs(xe,{columns:d,children:[o.jsx(xe.Top,{children:s.map(f=>o.jsx(xe.TopCell,{children:f.label},f.name))}),o.jsxs(xe.Rows,{children:[e.map(f=>{const p=!!f.error,h=f.id===n;return o.jsxs(xe.Row,{onClick:()=>r(f.id),selected:h,children:[o.jsx(xe.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(xe.Cell,{children:o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",p?"bg-red-700":"bg-green-600")})})}),o.jsx(Kn,{children:p?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(xe.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:hWr(pWr(f.input),200)})}),i?.map(m=>{const v=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(xe.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(Bt,{})}),!u&&e.length>0&&o.jsx(me,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function pWr(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function hWr(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function mWr(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function gWr({score:e,onNext:t,onPrevious:n,onClose:r}){const s=mWr(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(Cn.Toolbar,{children:[o.jsx(eT,{onPrevious:n,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(ce,{onClick:r,"aria-label":"Close score details",children:o.jsx(Lr,{})})]}),o.jsxs(Cn.Content,{children:[o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(si,{})," ",e.scorerId]})})}),o.jsxs(j0,{children:[o.jsx(Gt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(si,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Gt.CodeSection,{title:"Input",icon:o.jsx(p0,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Gt.CodeSection,{title:"Output",icon:o.jsx(zf,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Gt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(Fc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Gt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(Fc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Gt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(Fc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Gt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(Fc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const bQe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function vWr({scoresByItemId:e,experimentStatus:t}){const n=b.useMemo(()=>{if(!e)return[];const r={};for(const s of Object.values(e))for(const a of s)r[a.scorerId]||(r[a.scorerId]={sum:0,count:0}),r[a.scorerId].sum+=a.score,r[a.scorerId].count++;return Object.entries(r).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(n.length===0){const r=t==="running"||t==="pending",s=e!==void 0;let a,i;return r?(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(ki,{iconSlot:o.jsx(si,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Ft,{children:[o.jsxs(Ft.Header,{columns:bQe,children:[o.jsx(Ft.HeaderCol,{children:"Scorer"}),o.jsx(Ft.HeaderCol,{children:"Avg Score"}),o.jsx(Ft.HeaderCol,{children:"Items Scored"})]}),o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:n.map(({scorerId:r,avg:s,count:a})=>o.jsxs(Ft.Row,{columns:bQe,children:[o.jsx(Ft.TextCell,{children:r}),o.jsx(Ft.TextCell,{className:"font-mono",children:s.toFixed(3)}),o.jsx(Ft.TextCell,{className:"font-mono",children:a})]},r))})})]})}function O2t({experimentId:e,experimentStatus:t,results:n,isLoading:r,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[l,c]=b.useState(null),[u,d]=b.useState(null),[f,p]=b.useState(void 0),[h,m]=b.useState(null),g=n.find(z=>z.id===l)??null,{data:v}=t2t(e,t),x=b.useMemo(()=>{if(!v)return[];const z=new Set;for(const q of Object.values(v))for(const Z of q)z.add(Z.scorerId);return[...z].sort()},[v]),{data:w}=w2t(u),S=w?.spans??[],_=()=>{if(!f)return;const z=S.findIndex(q=>q.spanId===f);if(z>=0&&z<S.length-1)return()=>p(S[z+1].spanId)},O=()=>{if(!f)return;const z=S.findIndex(q=>q.spanId===f);if(z>0)return()=>p(S[z-1].spanId)},E=z=>{c(z),d(null),p(void 0),m(null)},T=z=>{E(z===l?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=n.findIndex(q=>q.id===g.id);if(z>=0&&z<n.length-1)return()=>E(n[z+1].id)},I=()=>{if(!g)return;const z=n.findIndex(q=>q.id===g.id);if(z>0)return()=>E(n[z-1].id)},P=g?v?.[g.itemId]:void 0,R=P?.find(z=>z.id===h)??null,B=z=>{m(z===h?null:z),d(null),p(void 0)},M=()=>{if(!h||!P)return;const z=P.findIndex(q=>q.id===h);if(z>=0&&z<P.length-1)return()=>m(P[z+1].id)},L=()=>{if(!h||!P)return;const z=P.findIndex(q=>q.id===h);if(z>0)return()=>m(P[z-1].id)},U=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(z=>({name:z,label:z,size:"1fr"}))],[l,x]);return o.jsxs(ed,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(td,{children:[o.jsx(Xr,{value:"summary",children:"Summary"}),o.jsx(Xr,{value:"results",children:"Results"})]}),o.jsx(Es,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(vWr,{scoresByItemId:v,experimentStatus:t})}),o.jsx(Es,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(Wf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(Cn,{children:o.jsx(fWr,{results:n,isLoading:r,featuredResultId:l,onResultClick:T,columns:U,scoresByItemId:v,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(AWn,{numOfColumns:1+(!u&&h?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(Cn,{withLeftSeparator:!0,children:o.jsx(nWr,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:B,featuredScoreId:h,onShowTrace:()=>{d(g.traceId??null),p(void 0),m(null)}})}),g&&!u&&R&&o.jsx(Cn,{withLeftSeparator:!0,children:o.jsx(gWr,{score:R,onNext:M(),onPrevious:L(),onClose:()=>m(null)})}),g&&u&&o.jsx(Cn,{withLeftSeparator:!0,children:o.jsx(dWr,{traceId:u,selectedSpanId:f,onSpanSelect:p,onClose:()=>{d(null),p(void 0)}})}),g&&u&&f&&o.jsx(Cn,{withLeftSeparator:!0,children:o.jsx(sWr,{traceId:u,spanId:f,onNext:_(),onPrevious:O(),onClose:()=>p(void 0)})})]})]})})]})}const yWr={pending:o.jsx(bk,{}),running:o.jsx(a6,{}),completed:o.jsx(ga,{}),failed:o.jsx(Lr,{})};function bWr({experiment:e,className:t}){const n=e.status,r=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Y("grid justify-items-end gap-3",t),children:[o.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[o.jsx("span",{className:Y("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":n==="completed","bg-red-700":n==="failed","bg-cyan-600":n==="running","bg-yellow-600":n==="pending"}),children:yWr[n]}),e.status]}),o.jsxs("div",{className:Y("flex items-center gap-3 text-neutral3 text-ui-md ","[&>span]:flex [&>span]:gap-1 [&>span]:items-center ","[&_b]:text-neutral4 [&_b]:font-semibold"),children:[o.jsxs("span",{children:["Total: ",o.jsx("b",{children:e.totalItems})]}),o.jsxs("span",{children:["Succeeded: ",o.jsx("b",{children:e.succeededCount})]}),o.jsxs("span",{children:["Failed: ",o.jsx("b",{children:e.failedCount})]}),(n==="pending"||n==="running")&&o.jsxs("span",{children:["Pending: ",o.jsx("b",{children:r})]})]})]})}function E2t({experimentId:e,experiment:t}){const{Link:n,paths:r}=cn(),{data:s}=Ov(),{data:a}=vw(),{data:i}=ef(),l=()=>{switch(t.targetType){case"agent":return r.agentLink(t.targetId);case"workflow":return r.workflowLink(t.targetId);case"scorer":return r.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(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(WYe,{}),e," ",e&&o.jsx(_a,{content:e})]}),o.jsxs(qn.Description,{children:[o.jsxs(us,{children:[o.jsx(FE,{})," Created at ",an(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(us,{children:[o.jsx(FE,{})," Completed at ",an(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(qn.Description,{children:[o.jsxs(us,{children:[o.jsx(M7t,{})," Target",o.jsx(n,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(us,{children:[o.jsx(p8,{})," Version",t.targetType==="agent"&&t.targetId?o.jsx(n,{href:`${r.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(_a,{content:t.agentVersion})]})]})]}),o.jsx(qn.Column,{children:o.jsx(bWr,{experiment:t})})]})}function Ske({delta:e}){const t=e>0?o.jsx(oi,{size:"small",color:"green",intensity:"muted",children:o.jsx(xpe,{})}):e<0?o.jsx(oi,{size:"small",color:"red",intensity:"muted",children:o.jsx(zYe,{})}):null;return o.jsxs("span",{className:Y("font-mono text-sm text-neutral4 min-w-20"),children:[o.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function j3(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function xWr({item:e,baselineId:t,contenderId:n,baselineVersion:r,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[n],d=!!(c&&u),f=new Set;if(c)for(const h of Object.keys(c.scores))f.add(h);if(u)for(const h of Object.keys(u.scores))f.add(h);const p=[...f].sort();return o.jsxs(Cn,{withLeftSeparator:!0,children:[o.jsxs(Cn.Toolbar,{children:[o.jsx(eT,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(ce,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(Lr,{})})})]}),o.jsxs(Cn.Content,{className:"pb-6",children:[o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(p0,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(j0,{children:[p.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:p.map(h=>{const m=c?.scores[h]??null,g=u?.scores[h]??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:h}),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(Ske,{delta:v})]})]},h)})})]}),o.jsx(Gt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(oi,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(zf,{}),codeStr:j3(c?.output)}),o.jsx(Gt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(oi,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(zf,{}),codeStr:j3(u?.output)}),o.jsx(Gt.CodeSection,{title:"Item Input",icon:o.jsx(h0,{}),codeStr:j3(e.input)}),o.jsx(Gt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(dXe,{}),codeStr:j3(e.groundTruth)})]})}):o.jsx(dr,{variant:"warning",title:"Comparison not available",children:o.jsx(dr.Message,{children:(()=>{const h=c?"Contender":"Baseline",m=c?s:r;return o.jsxs(o.Fragment,{children:["The ",h," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item."]})})()})})]})]})}function wWr({items:e,baselineId:t,contenderId:n,scorerIds:r,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(Cn,{children:o.jsxs(Ft,{children:[o.jsxs(Ft.Header,{columns:a,children:[o.jsx(Ft.HeaderCol,{children:"Item ID"}),!s&&r.map(l=>o.jsx(Ft.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[n],d=!!(c&&u);return o.jsx(Ft.Row,{children:o.jsxs(Ft.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Ft.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:r.map(f=>{const p=c?.scores[f]??null,h=u?.scores[f]??null,m=p!=null&&h!=null?h-p:null;return o.jsx(Ft.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:[p?.toFixed(2)," → ",h?.toFixed(2)]}),o.jsx(Ske,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const SWr={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 xQe({datasetId:e,experiment:t,type:n}){const{Link:r}=cn(),{label:s,color:a,customStyle:i}=SWr[n];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:[n==="contender"&&o.jsxs(oi,{size:"small",color:a,children:[s,o.jsx(YS,{})]}),o.jsx(ce,{as:r,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),n==="baseline"&&o.jsxs(oi,{size:"small",color:a,children:[o.jsx(Yf,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(us,{children:[o.jsx(dXe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(us,{children:[o.jsx(eXe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(us,{children:[o.jsx(FYe,{})," ",an(l,"MMM d, yyyy HH:mm")]})]})]})}function kWr({datasetId:e,experimentIdA:t,experimentIdB:n,onSwap:r}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=LHr(e,t,n),{data:u}=K9(e,t),{data:d}=K9(e,n),f=u&&d&&u.datasetVersion!==d.datasetVersion,p=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]),h=b.useMemo(()=>{if(!i||p.length===0)return[];const T=i.baselineId,j=t===T?n:t;return p.map(N=>{let I=0,P=0,R=0,B=0;for(const z of i.items){const q=z.results[T]?.scores[N],Z=z.results[j]?.scores[N];q!=null&&(I+=q,R++),Z!=null&&(P+=Z,B++)}const M=R>0?I/R:null,L=B>0?P/B:null,U=M!=null&&L!=null?L-M:null;return{scorerId:N,avgA:M,avgB:L,delta:U}})},[i,p,t,n]),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?[]:p.map(T=>({name:T,label:T,size:"1fr"}))],[p,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)},_=()=>{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(Bt,{})});if(c)return o.jsx(dr,{variant:"warning",title:"Error loading comparison",children:o.jsx(dr.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 O=i.baselineId,E=t===O?n:t;return o.jsxs("div",{className:"grid gap-10",children:[u&&d&&o.jsxs("div",{className:Y("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(xQe,{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(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(ce,{onClick:r,children:"VS"})}),o.jsx(Kn,{children:"Switch the order"})]})})}),o.jsx(xQe,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsx(dr,{variant:"warning",title:"Version mismatch",children:o.jsxs(dr.Message,{children:["These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})}),h.length>0&&o.jsxs(Ft,{children:[o.jsxs(Ft.Header,{columns:m,children:[o.jsx(Ft.HeaderCol,{children:"Scorer"}),o.jsx(Ft.HeaderCol,{className:"flex justify-center",children:o.jsxs(n4e,{children:[o.jsx(oi,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx(oi,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Ft.HeaderCol,{className:"flex justify-center",children:o.jsxs(n4e,{children:[o.jsx(oi,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx(oi,{color:"cyan",size:"small",children:"Avg"})]})}),o.jsx(Ft.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:h.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>o.jsxs(Ft.Row,{columns:m,children:[o.jsx(Ft.TextCell,{children:T}),o.jsx(Ft.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),o.jsx(Ft.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),o.jsx(Ft.TextCell,{className:"flex justify-center",children:I!=null?o.jsx(Ske,{delta:I}):"-"})]},T))})})]}),o.jsxs(Wf,{className:Y({"grid-cols-[1fr_2fr]":!!v}),children:[o.jsx(wWr,{items:i.items,baselineId:O,contenderId:E,scorerIds:p,featuredItemId:s,columns:g,onItemClick:x}),!!v&&o.jsx(xWr,{item:v,baselineId:O,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:_(),onNext:S(),onClose:w})]})]})}function _Wr({datasetId:e,itemId:t,onVersionSelect:n,onCompareVersionsClick:r,activeVersion:s}){const{data:a,isLoading:i}=wke(e,t),[l,c]=b.useState(!1),[u,d]=b.useState(new Set),f=x=>{n?.(x)},p=x=>s==null?x.isLatest:x.datasetVersion===s,h=x=>{d(w=>{const S=new Set(w);if(S.has(x))S.delete(x);else if(S.size>=2){const[_]=Array.from(S);return new Set([_,x])}else S.add(x);return S})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},v=()=>{u.size===2&&r?.([...u])};return o.jsxs(Cn,{className:"min-w-56",children:[l?o.jsx(Cn.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ce,{onClick:m,children:"Cancel"}),o.jsx(Kr,{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(Cn.Toolbar,{children:o.jsxs(ce,{onClick:g,className:"w-full",children:[o.jsx(Bg,{})," Compare Ver."]})})}),i?o.jsx(OWr,{}):o.jsxs(Ft,{children:[o.jsx(Ft.Header,{children:o.jsx(Ft.HeaderCol,{children:"Item Version History"})}),o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:a?.map(x=>{const w=String(x.datasetVersion),S=typeof x.updatedAt=="string"?new Date(x.updatedAt):x.updatedAt;return o.jsxs(Ft.Row,{isSelected:l&&u.has(w),children:[l&&o.jsx(Ft.LabelCell,{children:o.jsx(Di,{checked:u.has(w),disabled:x.isDeleted,onCheckedChange:()=>{},onClick:_=>{_.stopPropagation(),x.isDeleted||h(w)},"aria-label":`Select version ${x.datasetVersion}`})}),o.jsx(Ft.RowButton,{item:x,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:p(x),onClick:()=>f(x),className:"py-2",children:o.jsx(Ft.VersionCell,{version:x.datasetVersion,date:S,isLatest:x.isLatest,isDeleted:x.isDeleted})})]},String(x.datasetVersion))})})})]})]})}function OWr(){return o.jsxs(Ft,{children:[o.jsx(Ft.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Ft.HeaderCol,{children:"Item Version History"})}),o.jsx(Ft.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Ft.Row,{children:o.jsx(Ft.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Ft.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function EWr(e,t){if(t){const n=typeof t=="string"?new Date(t):t;return`v${e} ${an(n,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function CWr({datasetId:e,versionA:t,versionB:n,onVersionChange:r}){const{data:s}=bke(e),a=(s??[]).map(i=>({value:String(i.version),label:`${EWr(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(Cn.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx(gl,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>r?.(i,n??"")}),o.jsx(gl,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:n??"",onValueChange:i=>r?.(t??"",i)}),o.jsx("div",{})]})}const jWr=[{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"}],TWr={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(js,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(cXe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(W7t,{}),tooltip:"Same in both versions"}};function cie({red:e=!1,tooltip:t}){return o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(CUt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Kn,{children:t})]})}function cS({variant:e,version:t}){if(!e)return o.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:n,icon:r,tooltip:s}=TWr[e];return o.jsxs(nr,{children:[o.jsx(rr,{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(oi,{color:n,size:"small",children:r})]})}),o.jsx(Kn,{children:s})]})}function NWr(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function AWr({datasetId:e,versionA:t,versionB:n,allItems:r,itemsAMap:s,itemsBMap:a}){const{Link:i}=cn(),l=t>n;return o.jsx(Ft,{children:o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:r.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=NWr(u,d);return o.jsxs(Ft.Row,{columns:jWr,children:[o.jsx(Ft.IdCell,{id:c,isShortened:!1}),f!=="same"?o.jsxs(o.Fragment,{children:[u?.datasetVersion?o.jsx(Ft.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&l?o.jsx(cS,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(cS,{variant:"changed",version:u.datasetVersion}):o.jsx(cS,{version:u.datasetVersion})}):o.jsx(Ft.Cell,{className:"justify-center flex items-center",children:o.jsx(cie,{red:l,tooltip:l?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?o.jsx(Ft.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!l?o.jsx(cS,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(cS,{variant:"changed",version:d.datasetVersion}):o.jsx(cS,{version:d.datasetVersion})}):o.jsx(Ft.Cell,{className:"justify-center flex items-center",children:o.jsx(cie,{red:!l,tooltip:l?"Not present in this version":"Deleted in this version"})})]}):o.jsx(Ft.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:o.jsx(cS,{variant:"same",version:d?.datasetVersion})}),f==="changed"?o.jsx(Ft.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):o.jsx(Ft.Cell,{children:o.jsx(cie,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const wQe={needsReview:"#facc15",complete:"#22c55e"},IWr=[{label:"Needs Review",color:wQe.needsReview},{label:"Reviewed",color:wQe.complete}];function RWr({reviewSummary:e,experiments:t,datasets:n,isLoading:r,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(n)for(const m of n)d.set(m.id,m.name);let f=0,p=0;const h=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;p+=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);h.push({name:w,values:[m.needsReview,m.complete]})}return{data:h,maxVal:f,totalInPipeline:p}},[e,t,n]),c=a.length>0;return o.jsxs(Jt,{children:[o.jsxs(Jt.TopBar,{children:[o.jsx(Jt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Jt.Summary,{value:String(l),label:"Items in pipeline"})]}),r?o.jsx(Jt.Loading,{}):s?o.jsx(Jt.Error,{message:"Failed to load review data"}):o.jsx(Jt.Content,{children:c?o.jsx(EC,{data:a,segments:IWr,maxVal:i,fmt:u=>String(u)}):o.jsx(Jt.NoData,{message:"No items have been sent to review yet"})})]})}function kke(){const e=Ze();return Ot({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function C2t(e){const t=new Map;if(!e?.counts)return t;for(const n of e.counts)t.set(n.experimentId,{needsReview:n.needsReview,complete:n.complete,total:n.total});return t}function PWr(e,t){const n=new Map,r=C2t(e);if(!r.size||!t)return n;for(const s of t){const a=r.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const l=n.get(s.datasetId)??{needsReview:0,complete:0};l.needsReview+=a.needsReview,l.complete+=a.complete,n.set(s.datasetId,l)}return n}function $Wr(e){return e?.counts?e.counts.reduce((t,n)=>({needsReview:t.needsReview+n.needsReview,complete:t.complete+n.complete,inPipeline:t.inPipeline+n.needsReview+n.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const MWr=10;function DWr(){const[e,t]=b.useState(!1),[n,r]=b.useState(""),[s,a]=b.useState("all"),[i,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState(0),{data:p,isLoading:h,error:m}=$h({page:d,perPage:MWr}),{data:g,isLoading:v,error:x}=nV(),{data:w}=kke(),S=b.useMemo(()=>p?.datasets??[],[p?.datasets]),_=p?.pagination?.hasMore??!1,O=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>nZr(S),[S]),T=b.useMemo(()=>PWr(w,O),[w,O]),j=h||v,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(Z=>Z+1),[]),R=b.useCallback(()=>f(Z=>Math.max(0,Z-1)),[]),B=b.useCallback(Z=>{r(Z),f(0)},[]),M=b.useCallback(Z=>{a(Z),f(0)},[]),L=b.useCallback(Z=>{l(Z),f(0)},[]),U=b.useCallback(Z=>{u(Z),f(0)},[]);if(N&&Fs(N))return o.jsx(ir,{title:"Datasets",icon:o.jsx(Ya,{}),children:o.jsx(ca,{})});if(N&&$s(N))return o.jsx(ir,{title:"Datasets",icon:o.jsx(Ya,{}),children:o.jsx(Js,{resource:"datasets"})});if(N)return o.jsx(ir,{title:"Datasets",icon:o.jsx(Ya,{}),children:o.jsx(nc,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(ir,{title:"Datasets",icon:o.jsx(Ya,{}),children:o.jsx(rZr,{onCreateClick:I})}),o.jsx(Yfe,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||n!=="",q=()=>{r(""),a("all"),l("all"),u("all"),f(0)};return o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:j,children:[o.jsx(Ya,{})," Datasets"]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Kr,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(js,{})}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Datasets documentation",children:o.jsx(po,{})})]})]}),o.jsx(aZr,{search:n,onSearchChange:B,targetFilter:s,onTargetFilterChange:M,experimentFilter:i,onExperimentFilterChange:L,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:q,hasActiveFilters:z})]}),o.jsx(JHr,{datasets:S,experiments:O,reviewByDataset:T,isLoading:j,search:n,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:_,onNextPage:P,onPrevPage:R}),o.jsx(Yfe,{open:e,onOpenChange:t})]})}const LWr=new Set(["items","experiments","review"]);function zWr(){const{datasetId:e}=ya(),t=Yu(),[n,r]=go(),s=n.get("tab"),a=s&&LWr.has(s)?s:"items",i=E=>{r(E==="items"?{}:{tab:E},{replace:!0})},[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,p]=b.useState(!1),[h,m]=b.useState(!1),[g,v]=b.useState(null),{data:x,error:w}=jv(e??"");if(!e)return o.jsx(Xn,{children:o.jsx(sp,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Fs(w))return o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})});if(w&&$s(w))return o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},_=()=>{t("/datasets")},O=E=>{v(E?.version??null)};return o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(dZr,{value:e,variant:"ghost"})})]})}),o.jsxs(sp,{className:"content-stretch",children:[o.jsx(GZr,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>p(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:O,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(ce,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(Fy,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(tWr,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(XZr,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(cZr,{open:f,onOpenChange:p,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(uZr,{open:h,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:_})]})]})}function FWr(){const{datasetId:e,experimentId:t}=ya(),{data:n}=jv(e??""),{data:r,isLoading:s,error:a}=K9(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=tV({datasetId:e,experimentId:t,experimentStatus:r?.status});return!e||!t?null:s?o.jsx(Xn,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Bt,{})})}):a&&Fs(a)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):a&&$s(a)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):a||!r?o.jsx(Xn,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:n?.name}),o.jsx(Fn,{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(E2t,{experimentId:t,experiment:r}),o.jsx(O2t,{experimentId:t,experimentStatus:r?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function BWr(){const{datasetId:e}=ya(),[t,n]=go(),{data:r,error:s}=jv(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Fs(s)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):s&&$s(s)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsxs(Fn,{isCurrent:!0,as:"span",children:[o.jsx(Ne,{children:o.jsx(Bg,{})}),"Compare Experiments"]})]})}),o.jsx(sp,{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(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:r?.name??e?.slice(0,8)}),o.jsxs(Fn,{isCurrent:!0,as:"span",children:[o.jsx(Ne,{children:o.jsx(Bg,{})}),"Experiments Comparison"]})]})}),o.jsx(sp,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(Bg,{})," Dataset Experiments Comparison"]}),o.jsxs(qn.Description,{children:["Comparing"," ",o.jsx(ln,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(ln,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(qn.Column,{children:o.jsxs(ce,{as:ln,to:`/datasets/${e}`,children:[o.jsx(Yf,{}),"Back to Dataset"]})})]}),o.jsx(kWr,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{n({baseline:i,contender:a})}})]})})]})}function UWr(){const{datasetId:e,itemId:t}=ya(),{Link:n}=cn(),r=Yu(),{data:s,isLoading:a,error:i}=wke(e??"",t??""),{updateItem:l,deleteItem:c}=Ei(),{data:u}=jv(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[p,h]=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),[_,O]=b.useState(m.groundTruth),[E,T]=b.useState(m.metadata),[j,N]=b.useState(g);g!==j&&(N(g),S(m.input),O(m.groundTruth),T(m.metadata));const[I,P]=b.useState(!1),R=V=>{h(f?V:V.isLatest?null:V)},B=()=>{h(null)},M=!f&&p!=null,L=()=>{M||x(!0)},U=()=>{M||P(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(w)}catch{ze.error("Input must be valid JSON");return}let $;if(_.trim())try{$=JSON.parse(_)}catch{ze.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:$,metadata:W}),ze.success("Item updated successfully"),x(!1)}catch(Q){ze.error(`Failed to update item: ${Q instanceof Error?Q.message:"Unknown error"}`)}},q=()=>{d&&(S(JSON.stringify(d.input,null,2)),O(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},Z=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),r(`/datasets/${e}`)}catch(V){ze.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},D=p??d,G=D?{id:t??"",datasetId:e??"",datasetVersion:D.datasetVersion,input:D.input,groundTruth:D.groundTruth,metadata:D.metadata,createdAt:D.createdAt,updatedAt:D.updatedAt}:null;return i&&Fs(i)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):i&&$s(i)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(Xn,{children:o.jsx(sp,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:u?.name}),o.jsx(Fn,{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(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(p0,{}),t," ",o.jsx(_a,{content:t})]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:["Item of ",o.jsx(Ya,{})," ",u?.name]})}),o.jsxs(qn.Description,{children:[o.jsxs(us,{children:[o.jsx(FE,{})," Created at"," ",d?.createdAt?an(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(us,{children:[o.jsx(Y0,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(qn.Column,{children:!v&&!f&&o.jsxs(ps,{children:[o.jsxs(ce,{onClick:L,disabled:M,title:M?"Return to latest version to edit":void 0,children:[o.jsx(cXe,{})," Edit"]}),o.jsxs(ce,{onClick:U,disabled:M,title:M?"Return to latest version to delete":void 0,children:[o.jsx(Vd,{})," Delete"]})]})})]}),o.jsxs(Wf,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(Cn,{withRightSeparator:!v,children:[f&&d&&o.jsx(dr,{variant:"destructive",title:"Item deleted",children:o.jsxs(dr.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&M&&p&&o.jsx(dr,{variant:"warning",title:"Previous version",action:o.jsxs(dr.Button,{onClick:B,children:[o.jsx(_S,{})," Return to the latest version"]}),children:o.jsxs(dr.Message,{children:["Viewing version v",p.datasetVersion]})}),v?o.jsx(y2t,{inputValue:w,setInputValue:S,groundTruthValue:_,setGroundTruthValue:O,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:q,isSaving:l.isPending}):G?o.jsx(rV,{item:G,Link:n}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&o.jsx(Cn,{children:o.jsx(_Wr,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{r(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})]}),o.jsx(Ht,{open:I,onOpenChange:P,children:o.jsxs(Ht.Content,{children:[o.jsxs(Ht.Header,{children:[o.jsx(Ht.Title,{children:"Delete Item"}),o.jsx(Ht.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs(Ht.Footer,{children:[o.jsx(Ht.Cancel,{children:"Cancel"}),o.jsx(Ht.Action,{onClick:Z,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function SQe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function qWr(){const{datasetId:e}=ya(),[t,n]=go(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=jv(e??""),{Link:i}=cn(),[l,c]=b.useState(!1),{data:u}=Wfe(e??"",r[0]??""),{data:d}=Wfe(e??"",r[1]??"");return a&&Fs(a)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):a&&$s(a)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):!e||r.length<2?o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(sp,{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(Xn,{children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ne,{children:o.jsx(Yf,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(Bg,{}),"Compare Dataset Items"]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:["Comparing ",r.length," items of"," ",o.jsx(ln,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),o.jsx(qn.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:ln,to:`/datasets/${e}`,children:[o.jsx(Yf,{}),"Back to Dataset"]}),o.jsx(ce,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(XYe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(z7t,{})," Diff View"]})})]})})]}),o.jsx(Wf,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>o.jsxs(b.Fragment,{children:[o.jsx(VWr,{datasetId:e,itemId:f,Link:i,idx:p,itemIds:r,showContent:!l,onItemChange:h=>{const m=[...r];m[p]=h,n({items:m.join(",")})}}),p==0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(bxt,{codeA:SQe(u),codeB:SQe(d)})]})})]})}function VWr({datasetId:e,itemId:t,Link:n,idx:r,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Wfe(e,t),{data:u}=ij(e),d=new Set(s.filter((p,h)=>h!==r)),f=(u??[]).map(p=>({value:p.id,label:p.id,disabled:d.has(p.id)}));return o.jsxs(Cn,{children:[o.jsxs(Cn.Toolbar,{className:"flex gap-4",children:[o.jsx(Oxe,{label:"Item",name:`compare-item-${r}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(ce,{as:n,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Y0,{}),"Versions"]})]}),i&&o.jsx(Cn.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(b2t,{item:l}),o.jsx(rV,{item:l,Link:n})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function kQe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function HWr(){const{datasetId:e,itemId:t}=ya(),[n,r]=go(),[s,a]=b.useState(!1),i=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:l,error:c}=jv(e??""),{Link:u}=cn(),{data:d}=wke(e??"",t??""),{data:f}=Kfe(e??"",t??"",i[0]??0,l?.version),{data:p}=Kfe(e??"",t??"",i[1]??0,l?.version);return c&&Fs(c)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):c&&$s(c)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(sp,{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(Xn,{children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:l?.name}),o.jsx(Fn,{as:ln,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ne,{children:o.jsx(Yf,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(Bg,{}),"Compare Dataset Item Versions"]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:["Comparing ",i.length," versions of"," ",o.jsx(ln,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(qn.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:ln,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Yf,{}),"Back to Item"]}),o.jsx(ce,{variant:"primary",onClick:()=>a(h=>!h),children:s?o.jsxs(o.Fragment,{children:[o.jsx(XYe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(Sqt,{})," Diff View"]})})]})})]}),o.jsx(Wf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((h,m)=>o.jsxs(b.Fragment,{children:[o.jsx(ZWr,{datasetId:e,itemId:t,datasetVersion:h,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const v=[...i];v[m]=g,r({ids:v.join(",")})}}),m===0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},h))}),s&&f&&p&&o.jsx(bxt,{codeA:kQe(f),codeB:kQe(p)})]})})]})}function ZWr({datasetId:e,itemId:t,datasetVersion:n,latestVersion:r,allVersions:s,versionNumbers:a,Link:i,idx:l,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Kfe(e,t,n,r),p=new Set(a.filter((g,v)=>v!==l)),h=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]})," - ",an(v,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx(oi,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:p.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(Cn,{children:[o.jsxs(Cn.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Y0,{className:"w-6 h-6 opacity-50"}),o.jsx(Oxe,{label:"Version",name:`compare-version-${l}`,value:String(n),onValueChange:g=>u(Number(g)),options:h,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(Cn.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 ",n," not found"]}):o.jsx(rV,{item:m,Link:i})})]})}function WWr(){const{datasetId:e}=ya(),[t]=go(),n=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],r=Yu(),{data:s,error:a}=jv(e??""),i=ij(e??"",void 0,n[0]??null),l=ij(e??"",void 0,n[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]),p=b.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&Fs(a))return o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})});if(a&&$s(a))return o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})});if(!e||n.length<2)return o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(sp,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]});const h=(g,v,x)=>{r(`/datasets/${e}/items/${g}/versions?ids=${v?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,v)=>{r(`/datasets/${e}/versions?ids=${g},${v}`,{replace:!0})};return o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(Fn,{isCurrent:!0,as:"span",children:[o.jsx(Ne,{children:o.jsx(aje,{})}),"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(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(aje,{})," Compare Dataset Versions"]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:[o.jsx(Y0,{})," Comparing ",n.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(qn.Column,{children:o.jsxs(ce,{as:ln,to:`/datasets/${e}`,children:[o.jsx(Yf,{}),"Back to Dataset"]})})]}),o.jsx(Wf,{children:o.jsxs(Cn,{children:[o.jsx(CWr,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:m}),o.jsx(AWr,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})]})}function QWr(e){if(!e||e.length<2)return null;const t=[...e].sort((i,l)=>new Date(i.createdAt).getTime()-new Date(l.createdAt).getTime()),n=Math.floor(t.length/2),r=n,s=t.length-n;if(r===0)return null;const a=(s-r)/r*100;return{changePct:Math.round(a*10)/10,prevValue:String(r)}}function GWr({scorers:e,datasets:t,experiments:n,avgScore:r,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:l,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,p=t?.length,h=n?.length,m=r!=null&&s!=null&&s!==0?{changePct:Math.round((r-s)/s*100*10)/10,prevValue:String(s)}:null,g=QWr(n);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,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(Fr.Value,{children:String(p)}),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,{}):r!=null?o.jsxs(o.Fragment,{children:[o.jsx(Fr.Value,{children:String(r)}),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,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(Fr.Value,{children:String(h)}),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 YWr=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],_Qe="auto 1fr auto auto auto auto auto auto auto";function XWr(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const KWr={completed:"success",running:"warning",failed:"error",pending:"neutral"};function JWr({experiments:e,datasets:t,reviewByExperiment:n,isLoading:r,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=cn(),u=b.useMemo(()=>{const p=new Map;return t?.forEach(h=>p.set(h.id,h.name)),p},[t]),d=b.useMemo(()=>[...e].sort((p,h)=>{const m=p.createdAt?new Date(p.createdAt).getTime():0;return(h.createdAt?new Date(h.createdAt).getTime():0)-m}),[e]),f=b.useMemo(()=>{const p=s.toLowerCase();return d.filter(h=>{const m=h.datasetId?u.get(h.datasetId)??"":"",g=!p||h.id.toLowerCase().includes(p)||m.toLowerCase().includes(p)||(h.targetId??"").toLowerCase().includes(p),v=a==="all"||h.status===a,x=i==="all"||h.datasetId===i;return g&&v&&x})},[d,s,u,a,i]);return r?o.jsx(Md,{columns:_Qe}):o.jsxs(xe,{columns:_Qe,children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Experiment"}),o.jsx(xe.TopCell,{children:"Dataset"}),o.jsx(xe.TopCell,{children:"Target"}),o.jsx(xe.TopCell,{children:"Status"}),o.jsx(xe.TopCell,{className:"text-center",children:"Items"}),o.jsx(xe.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(xe.TopCell,{className:"text-center",children:"Failed"}),o.jsx(xe.TopCell,{className:"text-center",children:"Review"}),o.jsx(xe.TopCell,{children:"Date"})]}),f.map(p=>{const h=p.datasetId?u.get(p.datasetId)??p.datasetId.slice(0,8):"—",m=p.status??"pending",g=p.succeededCount??0,v=p.failedCount??0,x=p.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(xe.RowLink,{to:l.experimentLink(p.id),LinkComponent:c,children:[o.jsx(xe.NameCell,{className:"font-mono",children:p.id.slice(0,8)}),o.jsx(xe.TextCell,{children:h}),o.jsx(xe.Cell,{children:o.jsxs("span",{className:"truncate",children:[p.targetType," ",p.targetId]})}),o.jsx(xe.Cell,{children:o.jsx(X1,{variant:KWr[m]??"neutral",withDot:!0,children:m})}),o.jsx(xe.TextCell,{className:"text-center",children:x}),o.jsx(xe.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(xe.TextCell,{className:"text-center",children:o.jsx("span",{className:v>0?"text-accent2":"",children:v})}),o.jsx(xe.Cell,{className:"text-center",children:(()=>{const S=n?.get(p.id);if(!S)return o.jsx("span",{className:"text-neutral2",children:"—"});const _=S.needsReview+S.complete;return _===0?o.jsx("span",{className:"text-neutral2",children:"—"}):S.needsReview>0?o.jsxs(kt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(kt,{variant:"success",children:[S.complete,"/",_," reviewed"]})})()}),o.jsx(xe.TextCell,{children:XWr(p.createdAt)})]},p.id)})]})}function eQr(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const T3={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},tQr=[{label:"Completed",color:T3.completed},{label:"Running",color:T3.running},{label:"Pending",color:T3.pending},{label:"Failed",color:T3.failed}];function nQr({experiments:e,datasets:t,isLoading:n,isError:r}){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 p=f.datasetId??"unknown";c.has(p)||c.set(p,{completed:0,running:0,pending:0,failed:0});const h=c.get(p),m=f.status;m in h&&h[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,p])=>{const h=p.completed+p.running+p.pending+p.failed;return h>u&&(u=h),{name:l.get(f)??f.slice(0,12),values:[p.completed,p.running,p.pending,p.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return o.jsxs(Jt,{children:[o.jsxs(Jt.TopBar,{children:[o.jsx(Jt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Jt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),n?o.jsx(Jt.Loading,{}):r?o.jsx(Jt.Error,{message:"Failed to load experiments data"}):o.jsx(Jt.Content,{children:i?o.jsx(EC,{data:s,segments:tQr,maxVal:a,fmt:l=>String(l)}):o.jsx(Jt.NoData,{message:"No experiments have been run yet"})})]})}const rQr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No Experiments yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Run an experiment from a dataset to evaluate ",o.jsx("br",{}),"your agents and workflows."]}),actionSlot:o.jsx("div",{className:"flex flex-col items-center gap-2",children:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(Fa,{})]})})})});function sQr({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,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(Lm,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx(gl,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...YWr],value:n,onValueChange:r,className:"whitespace-nowrap"}),o.jsx(gl,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(ce,{onClick:l,size:"sm",variant:"default",children:[o.jsx(Lr,{className:"size-3"})," Reset"]})]})]})}function aQr(){const{data:e,isLoading:t,error:n}=ef(),{data:r,isLoading:s,error:a}=$h(),{data:i,isLoading:l,error:c}=nV(),{data:u,isLoading:d,isError:f,error:p}=nBr(),{data:h,isLoading:m,isError:g,error:v}=kke(),x=r?.datasets,w=i?.experiments,S=b.useMemo(()=>$Wr(h),[h]),_=n||a||c||p||v;return _&&Fs(_)?o.jsx(ir,{title:"Evaluation",icon:o.jsx(gd,{}),children:o.jsx(ca,{})}):_&&$s(_)?o.jsx(ir,{title:"Evaluation",icon:o.jsx(gd,{}),children:o.jsx(Js,{resource:"evaluation"})}):_?o.jsx(ir,{title:"Evaluation",icon:o.jsx(gd,{}),children:o.jsx(nc,{title:"Failed to load evaluation data",message:_.message})}):o.jsxs(pt,{width:"wide",height:"full",children:[o.jsx(pt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(gd,{})," Evaluation"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Evaluation documentation",children:o.jsx(po,{})})})]})}),o.jsxs("div",{className:"flex flex-col gap-6 pt-4",children:[o.jsx(bue,{children:o.jsx(GWr,{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(H8r,{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(sZr,{experiments:w,isLoading:l,isError:!!c}),o.jsx(nQr,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(RWr,{reviewSummary:h,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function iQr(){const[e,t]=b.useState(""),[n,r]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=$h(),{data:u,isLoading:d,error:f}=nV(),{data:p}=kke(),h=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>eQr(h),[h]),v=b.useMemo(()=>C2t(p),[p]),x=l||d,w=f||c;if(w&&Fs(w))return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(ca,{})});if(f&&$s(f))return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(Js,{resource:"experiments"})});if(c&&$s(c))return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(Js,{resource:"datasets"})});if(w)return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(nc,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(rQr,{})});const S=n!=="all"||s!=="all"||e!=="",_=()=>{t(""),r("all"),a("all")};return o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:x,children:[o.jsx(gd,{})," Experiments"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{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(po,{})})})]}),o.jsx(sQr,{search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:_,hasActiveFilters:S})]}),o.jsx(JWr,{experiments:m,datasets:h,reviewByExperiment:v,isLoading:x,search:e,statusFilter:n,datasetFilter:s})]})}function oQr(){const{experimentId:e}=ya(),{data:t,isLoading:n}=nV(),s=t?.experiments?.find(h=>h.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=K9(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p}=tV({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?n||i||!s?o.jsx(Xn,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Bt,{})})}):l&&Fs(l)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):l&&$s(l)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):l||!a?o.jsx(Xn,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/experiments",children:[o.jsx(Ne,{children:o.jsx(gd,{})}),"Experiments"]}),o.jsx(Fn,{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(E2t,{experimentId:e,experiment:a}),o.jsx(O2t,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p})]})})]}):null}function j2t({redirectUri:e,onSuccess:t,initialMode:n="signin",errorMessage:r}){const{data:s,isLoading:a}=tT(),{mutate:i,isPending:l,error:c}=pHr(),{mutate:u,isPending:d,error:f}=hHr(),{mutate:p,isPending:h}=m2t(),[m,g]=b.useState(n),[v,x]=b.useState(""),[w,S]=b.useState(""),[_,O]=b.useState("");if(a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Authentication is not configured"})});const{login:E}=s,T=E.type==="sso"||E.type==="both",j=E.type==="credentials"||E.type==="both",N=E.sso,I=E.signUpEnabled!==!1,P=m==="signin"||!I,R=P?l:d,B=P?c:f,M=()=>{t?t():e?window.location.href=e:window.location.href="/"},L=q=>{q.preventDefault(),P?i({email:w,password:_},{onSuccess:M}):u({email:w,password:_,name:v||void 0},{onSuccess:M})},U=()=>{p({redirectUri:e},{onSuccess:q=>{window.location.href=q.url}})},z=()=>{g(P?"signup":"signin")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[o.jsx(t0,{className:"h-10 w-10"}),o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:P?"Sign in to Mastra Studio":"Create your account"})]}),E.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[o.jsx(nXe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"text-sm text-neutral3",children:E.description})]}),r&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:r}),j&&o.jsxs("form",{onSubmit:L,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(mn,{id:"name",type:"text",value:v,onChange:q=>x(q.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(mn,{id:"email",type:"email",value:w,onChange:q=>S(q.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(mn,{id:"password",type:"password",value:_,onChange:q=>O(q.target.value),placeholder:P?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),o.jsx(ce,{type:"submit",disabled:R,className:"w-full",size:"lg",children:R?P?"Signing in...":"Creating account...":P?"Sign in":"Create account"}),I&&o.jsxs("div",{className:"text-center text-sm",children:[o.jsx("span",{className:"text-neutral3",children:P?"Don't have an account? ":"Already have an account? "}),o.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:P?"Sign up":"Sign in"})]})]}),T&&j&&o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border1"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&o.jsxs(ce,{onClick:U,disabled:h,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&o.jsx("span",{className:"mr-2",children:N.icon}),h?"Redirecting...":N.text||"Sign in"]})]})})}function lQr(){const[e]=go(),t=Yu(),n=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return o.jsx(j2t,{redirectUri:n,onSuccess:i,initialMode:s,errorMessage:a})}function cQr(){const[e,t]=go(),n=fKn(e,t),r=mKn(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=c0t(),{data:d=[],isPending:f}=u0t({entityType:n.selectedEntityOption?.entityType,rootOnly:!0}),{data:p=[],isPending:h}=d0t(),{data:m=[],isPending:g}=f0t(),v=b.useMemo(()=>aKn({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:p,loading:{tags:u,entityNames:f,serviceNames:g,environments:h}}),[c,d,m,p,u,f,g,h]),x=b.useMemo(()=>cKn({rootEntityType:n.selectedEntityOption?.entityType,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo,tokens:n.filterTokens}),[n.filterTokens,n.selectedDateFrom,n.selectedDateTo,n.selectedEntityOption]),{data:w=[],isLoading:S,error:_,isFetchingNextPage:O,hasNextPage:E,setEndOfListElement:T}=JXn({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=yKn(w,n.featuredLogId,n.handleFeaturedChange,n.featuredTraceId),{data:B,isLoading:M}=txe(n.featuredTraceId??null),{data:L,isLoading:U}=K1(n.featuredTraceId??"",n.featuredSpanId??""),z=b.useCallback(()=>n.applyFilterTokens(uKn(v,n.filterTokens)),[v,n]),q=b.useCallback(()=>n.handleFeaturedChange({logId:null}),[n]),Z=b.useCallback(Q=>n.handleFeaturedChange({traceId:Q,spanId:null}),[n]),D=b.useCallback((Q,J)=>n.handleFeaturedChange({traceId:Q,spanId:J}),[n]),G=b.useCallback(()=>{n.handleFeaturedChange({traceId:null,spanId:null}),l(!1)},[n]),V=b.useCallback(()=>n.handleFeaturedChange({spanId:null}),[n]),$=b.useCallback(Q=>n.handleFeaturedChange({spanId:Q??null}),[n]),W=o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:S,children:[o.jsx(rXe,{})," Logs"]})})}),o.jsxs(pt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(Uxt,{preset:n.datePreset,onPresetChange:n.handleDatePresetChange,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo,onDateChange:n.handleDateChange,disabled:S,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(Zbt,{fields:v,tokens:n.filterTokens,onTokensChange:n.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/observability/logging",target:"_blank",rel:"noopener noreferrer","aria-label":"Logs documentation",tooltipContent:"Go to Logs documentation",children:o.jsx(po,{})})]})]}),o.jsx(HXn,{isLoading:S,filterFields:v,filterTokens:n.filterTokens,onFilterTokensChange:n.handleFilterTokensChange,onClear:z,onRemoveAll:n.handleRemoveAll,onSave:r.handleSave,onRemoveSaved:r.hasSavedFilters?r.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]});return _?o.jsxs(pt,{width:"wide",height:"full",children:[W,o.jsx(pt.MainArea,{isCentered:!0,children:o.jsx(UXn,{error:_,resource:"logs",errorTitle:"Failed to load logs"})})]}):w.length===0&&!S&&n.filterTokens.length===0?o.jsxs(pt,{width:"wide",height:"full",children:[W,o.jsx(pt.MainArea,{isCentered:!0,children:o.jsx(GXn,{datePreset:n.datePreset,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo})})]}):o.jsxs(pt,{width:"wide",height:"full",children:[W,o.jsx(qXn,{logCollapsed:i,listSlot:o.jsx(VXn,{logs:w,isLoading:S,isFetchingNextPage:O,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:n.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(BXn,{log:N,onClose:q,onTraceClick:Z,onSpanClick:D,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:n.featuredTraceId?o.jsx(dXn,{traceId:n.featuredTraceId,spans:B?.spans,isLoading:M,onClose:G,onSpanSelect:$,selectedSpanId:n.featuredSpanId}):null,spanPanelSlot:n.featuredTraceId&&n.featuredSpanId?o.jsx(uXn,{spanId:n.featuredSpanId,span:L?.span,isLoading:U,onClose:V}):null})]})}function uQr({server:e}){const{paths:t,Link:n}=cn(),s=Ze().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=m$t(e),l=Object.values(i||{}),c=l.length,u=l.filter(p=>p.toolType==="agent").length,d=l.filter(p=>p.toolType==="workflow").length,f=xh(e.name,50);return o.jsxs(xe.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:n,children:[o.jsx(xe.NameCell,{children:f}),o.jsx(xe.DescriptionCell,{children:a}),o.jsx(xe.TextCell,{className:"text-center",children:u||""}),o.jsx(xe.TextCell,{className:"text-center",children:c||""}),o.jsx(xe.TextCell,{className:"text-center",children:d||""})]})}function dQr({mcpServers:e,isLoading:t,search:n=""}){const r=b.useMemo(()=>{const s=n.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,n]);return t?o.jsx(Md,{columns:"auto 1fr auto auto auto"}):o.jsxs(xe,{columns:"auto 1fr auto auto auto",children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Name"}),o.jsx(xe.TopCell,{children:"URL"}),o.jsx(xe.TopCellSmart,{long:"Agents",short:o.jsx(Ma,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(xe.TopCellSmart,{long:"Tools",short:o.jsx(co,{}),tooltip:"Tools",className:"text-center"}),o.jsx(xe.TopCellSmart,{long:"Workflows",short:o.jsx(uo,{}),tooltip:"Workflow Tools",className:"text-center"})]}),r.length===0&&n?o.jsx(xe.NoMatch,{message:"No MCP Servers match your search"}):null,r.map(s=>o.jsx(uQr,{server:s},s.id))]})}const fQr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No MCP Servers yet",descriptionSlot:o.jsxs(o.Fragment,{children:["MCP servers are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(Fa,{})]})})}),pQr=()=>{const{data:e=[],isLoading:t,error:n}=z2(),[r,s]=b.useState("");return n&&Fs(n)?o.jsx(ir,{title:"MCP Servers",icon:o.jsx(Gl,{}),children:o.jsx(ca,{})}):n&&$s(n)?o.jsx(ir,{title:"MCP Servers",icon:o.jsx(Gl,{}),children:o.jsx(Js,{resource:"MCP servers"})}):n?o.jsx(ir,{title:"MCP Servers",icon:o.jsx(Gl,{}),children:o.jsx(nc,{title:"Failed to load MCP servers",message:n.message})}):e.length===0&&!t?o.jsx(ir,{title:"MCP Servers",icon:o.jsx(Gl,{}),children:o.jsx(fQr,{})}):o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:t,children:[o.jsx(Gl,{})," MCP Servers"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{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(po,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(dQr,{mcpServers:e,isLoading:t,search:r})]})},hQr=(e,t)=>{const n=new Map,r=Object.keys(t);for(const s of r){const a=t[s],i=a.tools,l=Object.keys(i);for(const c of l){const u=i[c];n.has(u.id)||n.set(u.id,{...u,agents:[]}),n.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))n.has(a.id)||n.set(a.id,{...a,agents:[]});return Array.from(n.values())};function mQr({tools:e,agents:t,isLoading:n,search:r=""}){const{paths:s,Link:a}=cn(),i=b.useMemo(()=>hQr(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(r.toLowerCase())),[i,r]);return n?o.jsx(Md,{columns:"auto 1fr auto"}):o.jsxs(xe,{columns:"auto 1fr auto",children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Name"}),o.jsx(xe.TopCell,{children:"Description"}),o.jsx(xe.TopCellSmart,{long:"Agents",short:o.jsx(Ma,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&r?o.jsx(xe.NoMatch,{message:"No Tools match your search"}):null,l.map(c=>{const u=xh(c.id,50),d=xh(c.description??"",200),f=c.agents.length;return o.jsxs(xe.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(xe.NameCell,{children:u}),o.jsx(xe.DescriptionCell,{children:d}),o.jsx(xe.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const gQr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No Tools yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Mastra tools are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(Fa,{})]})})}),vQr=()=>{const e=Ze();return ar({mutationFn:async({toolId:t,input:n,requestContext:r})=>{const s=new zE;Object.entries(r??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:n,requestContext:s})}catch(a){throw ze.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},yQr=({toolId:e})=>{const{canExecute:t}=_b(),n=t("tools"),{data:r={}}=Ov(),s=b.useMemo(()=>{for(const g of Object.values(r))if(g.tools){const v=Object.values(g.tools).find(x=>x.id===e);if(v)return v}return null},[r,e]),{data:a,isLoading:i,error:l}=DUr(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=vQr(),{requestContext:p}=Us();b.useEffect(()=>{if(l){const g=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${g}`)}},[l]);const h=async(g,v)=>{if(!c)return;const x={...p??{},...v??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?lv(av(eb(c?.inputSchema))):cs({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Dr,{className:"h-8 w-48 mb-4"}),o.jsx(Dr,{className:"h-32 w-full"})]}):l?null:c?n?o.jsx(cke,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:h,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function bQr({value:e,onValueChange:t,placeholder:n="Select a tool...",searchPlaceholder:r="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=Jq(),{data:p={},isLoading:h,isError:m,error:g}=Ov(),{navigate:v,paths:x}=cn();b.useEffect(()=>{if(d){const O=f instanceof Error?f.message:"Failed to load tools";ze.error(`Error loading tools: ${O}`)}},[d,f]),b.useEffect(()=>{if(m){const O=g instanceof Error?g.message:"Failed to load agents";ze.error(`Error loading agents: ${O}`)}},[m,g]);const w=new Map;Object.values(p).forEach(O=>{O.tools&&Object.values(O.tools).forEach(E=>{w.has(E.id)||w.set(E.id,E)})}),Object.values(c).forEach(O=>{w.has(O.id)||w.set(O.id,O)});const S=Array.from(w.values()).map(O=>({label:O.id,value:O.id})),_=O=>{t?t(O):O&&O!==e&&v(x.toolLink(O))};return o.jsx(jc,{options:S,value:e,onValueChange:_,placeholder:u||h?"Loading tools...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||h||d||m,variant:l})}const xQr=({isLoading:e,server:t})=>{const[{sseUrl:n,httpStreamUrl:r},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(sp,{children:o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${n}`;return o.jsxs(sp,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),o.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[o.jsx(kt,{icon:o.jsx(VU,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(kt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(me,{className:"text-neutral3 pb-4",children:"This MCP server can be accessed through multiple transport methods. Choose the one that best fits your use case."}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(kt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(_a,{tooltip:"Copy HTTP Stream URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(kt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(_a,{tooltip:"Copy SSE URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(kt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(_a,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(wQr,{server:t})})]})},wQr=({server:e})=>{const{data:t={},isLoading:n}=m$t(e);if(n)return null;const r=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(Ne,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(Gl,{})}),o.jsx(me,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),o.jsx("div",{className:"flex flex-col gap-2 pt-6",children:r.map(s=>{const a=t[s];return o.jsx(kQr,{tool:a,serverId:e.id},s)})})]})};function SQr(e){if(!e)return!1;const t=e.ui;return!!(typeof t?.resourceUri=="string"&&t.resourceUri.startsWith("ui://")||typeof e["ui/resourceUri"]=="string"&&e["ui/resourceUri"].startsWith("ui://"))}const kQr=({tool:e,serverId:t})=>{const n=b.useRef(null),{Link:r,paths:s}=cn(),a=vMt[e.toolType||"tool"],i=SQr(e._meta);return o.jsxs(pp,{onClick:()=>n.current?.click(),children:[o.jsx(obt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(gp,{children:[o.jsx(hp,{children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(r,{ref:n,href:s.mcpServerToolLink(t,e.id),children:e.id}),i&&o.jsx(kt,{className:"text-[10px] py-0",children:"App"})]})}),o.jsx(mp,{children:e.description})]})]})},_Qr=()=>{const{serverId:e}=ya(),{data:t=[],isLoading:n}=z2(),r=t.find(s=>s.id===e);return o.jsxs(Xn,{children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/mcps",children:[o.jsx(Ne,{children:o.jsx(Gl,{})}),"MCP Servers"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(PMt,{value:e,variant:"ghost"})})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(hw,{}),"MCP documentation"]})})]}),o.jsx(xQr,{isLoading:n,server:r})]})};function OQr(e){if(!e)return;const t=e.ui;if(t?.resourceUri)return t.resourceUri;const n=e["ui/resourceUri"];if(typeof n=="string")return n}const EQr=({toolId:e,serverId:t})=>{const{canExecute:n}=_b(),r=n("tools"),s=Ze(),{data:a,isLoading:i,error:l}=g$t(t,e),{mutateAsync:c,isPending:u,data:d}=XMr(t,e),f=a?OQr(a._meta):void 0,{data:p}=Ot({queryKey:["mcp-app-resource",t,f],queryFn:async()=>f?(await s.readMcpServerResource(t,f)).contents[0]?.text??null:null,enabled:!!f}),h=b.useCallback(async(v,x)=>await c(x),[c]);b.useEffect(()=>{if(l){const v=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${v}`)}},[l]);const m=async v=>{if(a)return await c(v)};if(i)return o.jsxs("div",{className:"p-6",children:[o.jsx(Dr,{className:"h-8 w-48 mb-4"}),o.jsx(Dr,{className:"h-32 w-full"})]});if(l)return null;if(!a)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!r)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let g;try{g=lv(av(a.inputSchema))}catch(v){console.error("Error processing input schema:",v),ze.error("Failed to process tool input schema."),g=cs({})}return o.jsxs("div",{className:"flex flex-col gap-4",children:[p&&o.jsx("div",{className:"border-b border-border1 p-4",children:o.jsx(h$t,{html:p,toolName:a.name??a.id,onToolCall:h})}),o.jsx(cke,{executionResult:d,isExecutingTool:u,zodInputSchema:g,handleExecuteTool:m,toolDescription:a.description||"",toolId:a.id})]})},CQr=()=>{const{data:e}=z2(),{serverId:t,toolId:n}=ya(),{data:r,isLoading:s}=g$t(t,n),a=e?.find(c=>c.id===t),i=r?.name,l=a?.name||"";return s||!r?null:o.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-auto",children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/mcps",children:[o.jsx(Ne,{children:o.jsx(Gl,{})}),"MCP Servers"]}),o.jsx(Fn,{as:ln,to:`/mcps/${t}`,children:l}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(hw,{}),"MCP documentation"]})})]}),o.jsx(EQr,{toolId:n,serverId:t})]})};function jQr(){const{data:e,isLoading:t,isError:n}=qYn();return o.jsx(RYn,{data:e,isLoading:t,isError:n})}function TQr(){const{data:e,isLoading:t,isError:n}=t0t();return o.jsx(Kbe,{label:"Total Agent Runs",value:e?.value!=null?e.value.toLocaleString():null,prevValue:e?.previousValue!=null?e.previousValue.toLocaleString():void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function NQr(){const{data:e,isLoading:t,isError:n}=FYn();return o.jsx(Kbe,{label:"Total Model Cost",value:e?.cost!=null?r1(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?r1(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:n})}function AQr(){const{data:e,isLoading:t,isError:n}=BYn();return o.jsx(Kbe,{label:"Total Tokens",value:e?.value!=null?$g(e.value):null,prevValue:e?.previousValue!=null?$g(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function IQr(){const{data:e,isLoading:t,isError:n}=UYn();return o.jsx(PYn,{rows:e,isLoading:t,isError:n})}function RQr(){const{data:e,isLoading:t,isError:n}=HYn();return o.jsx($Yn,{data:e,isLoading:t,isError:n})}function PQr(){const{data:e,isLoading:t,isError:n}=ZYn();return o.jsx(DYn,{data:e,isLoading:t,isError:n})}function $Qr(){const{data:e,isLoading:t,isError:n}=VYn();return o.jsx(LYn,{data:e,isLoading:t,isError:n})}const MQr=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),uie="period";function DQr(){const[e,t]=go(),n=e.get(uie),r=Kxt(n)?n:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(uie):l.set(uie,a),l},{replace:!0})},[t]);return o.jsx(NYn,{initialPreset:r,onPresetChange:s,children:o.jsx(LQr,{})})}function LQr(){const{error:e}=t0t(),{data:t,isLoading:n}=Hq(),r=t?.observabilityStorageType,s=r?MQr.has(r):!1,a=r==="ObservabilityInMemory";return e&&Fs(e)?o.jsx(ir,{title:"Metrics",icon:o.jsx(TO,{}),children:o.jsx(ca,{})}):e&&$s(e)?o.jsx(ir,{title:"Metrics",icon:o.jsx(TO,{}),children:o.jsx(Js,{resource:"metrics"})}):e?o.jsx(ir,{title:"Metrics",icon:o.jsx(TO,{}),children:o.jsx(nc,{title:"Failed to load metrics",message:e.message})}):o.jsxs(pt,{width:"wide",height:"full",children:[o.jsx(pt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(TO,{})," Metrics"]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsx(AYn,{}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:o.jsx(po,{})})]})]})}),n?null:s?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[a&&o.jsx(dr,{variant:"info",title:"Metrics are not persisted",children:o.jsx(dr.Message,{children:"This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB."})}),o.jsxs(bue,{children:[o.jsx(TQr,{}),o.jsx(NQr,{}),o.jsx(AQr,{})]}),o.jsxs(bue,{children:[o.jsx(IQr,{}),o.jsx(PQr,{}),o.jsx(RQr,{}),o.jsx($Qr,{}),o.jsx(jQr,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"Metrics are not available with your current storage",descriptionSlot:"Metrics require ClickHouse, DuckDB, or in-memory storage for observability. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(Fa,{})]})})})]})}const zQr=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:TO,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:Jo,href:"/observability"}];function FQr(){return o.jsxs(FO,{children:[o.jsx(FO.Top,{children:o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{children:[o.jsx(Jo,{})," 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:zQr.map(e=>o.jsxs(ln,{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 BQr=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:Ma,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:No,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:uo,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:m1,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:Gl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:co,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:zc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:uj,href:"/request-context"}];function UQr(){return o.jsxs(pt,{width:"narrow",children:[o.jsx(pt.TopArea,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(Tqt,{})," Primitives"]})})}),o.jsx(pt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:BQr.map(e=>o.jsxs(ln,{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 qQr(){const{paths:e}=cn(),{data:t,isLoading:n,error:r}=_Mt(),{isCmsAvailable:s}=U2(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return r&&Fs(r)?o.jsx(ir,{title:"Prompts",icon:o.jsx(No,{}),children:o.jsx(ca,{})}):r&&$s(r)?o.jsx(ir,{title:"Prompts",icon:o.jsx(No,{}),children:o.jsx(Js,{resource:"prompt blocks"})}):r?o.jsx(ir,{title:"Prompts",icon:o.jsx(No,{}),children:o.jsx(nc,{title:"Failed to load prompt blocks",message:r.message})}):l.length===0&&!n?o.jsx(ir,{title:"Prompts",icon:o.jsx(No,{}),children:o.jsx(CUr,{})}):o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:n,children:[o.jsx(No,{})," Prompts"]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Kr,{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(po,{})}),s&&o.jsxs(ce,{as:ln,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(js,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(EUr,{promptBlocks:l,isLoading:n,search:a})]})}function VQr(){return o.jsxs(pt,{width:"narrow",children:[o.jsx(pt.TopArea,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(uj,{})," Request Context"]})})}),o.jsx(pt.MainArea,{children:o.jsx(P9r,{children:o.jsx(tMt,{})})})]})}const HQr=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:V7t,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:po,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:Fa,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:VI,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:YYe,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:zUt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function ZQr(){return o.jsxs(pt,{width:"narrow",children:[o.jsx(pt.TopArea,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(po,{})," Resources"]})})}),o.jsx(pt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:HQr.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(Fa,{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 WQr(){const{data:e={},isLoading:t,error:n}=ef(),[r,s]=b.useState(""),[a,i]=b.useState("all");if(n&&Fs(n))return o.jsx(ir,{title:"Scorers",icon:o.jsx(si,{}),children:o.jsx(ca,{})});if(n&&$s(n))return o.jsx(ir,{title:"Scorers",icon:o.jsx(si,{}),children:o.jsx(Js,{resource:"scorers"})});if(n)return o.jsx(ir,{title:"Scorers",icon:o.jsx(si,{}),children:o.jsx(nc,{title:"Failed to load scorers",message:n.message})});if(Object.keys(e).length===0&&!t)return o.jsx(ir,{title:"Scorers",icon:o.jsx(si,{}),children:o.jsx(W8r,{})});const l=a!=="all"||r!=="",c=()=>{s(""),i("all")};return o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:t,children:[o.jsx(si,{})," Scorers"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:o.jsx(po,{})})})]}),o.jsx(G8r,{search:r,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(Z8r,{scorers:e,isLoading:t,search:r,sourceFilter:a})]})}function QQr(){const{scorerId:e}=ya(),[t,n]=go(),r=t.get("scoreId")??void 0,[s,a]=b.useState(r),[i,l]=b.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,isLoading:u,error:d}=q8r(e),{data:f={},isLoading:p,error:h}=Ov(),{isLoading:m,error:g}=vw(),{data:v=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:_,setEndOfListElement:O}=U8r({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=b.useMemo(()=>c?.agentIds?.filter(D=>f[D]).map(D=>({value:D,label:f[D].name,type:"AGENT"}))||[],[c?.agentIds,f]),T=b.useMemo(()=>c?.workflowIds?.map(D=>({value:D,label:D,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(D=>D.value===N);I&&I.value!==i?.value&&l(I),b.useEffect(()=>{if(d){const D=d instanceof Error?d.message:"Failed to load scorer";ze.error(`Error loading scorer: ${D}`)}},[d]),b.useEffect(()=>{if(h){const D=h instanceof Error?h.message:"Failed to load agents";ze.error(`Error loading agents: ${D}`)}},[h]),b.useEffect(()=>{if(g){const D=g instanceof Error?g.message:"Failed to load workflows";ze.error(`Error loading workflows: ${D}`)}},[g]);const P=D=>{D?.value&&n(G=>{const V=new URLSearchParams(G);return V.set("entity",D.value),V})};b.useEffect(()=>{const D=t.get("scoreId")??void 0;if(D===s)return;if(!D){a(void 0);return}v.find(V=>V.id===D)&&a(D)},[t,v]);const R=b.useCallback(D=>{a(D||void 0),n(G=>{const V=new URLSearchParams(G);return D?V.set("scoreId",D):V.delete("scoreId"),V})},[n]);if(!c)return null;const B=Fs(d)||Fs(h)||Fs(g),M=d&&$s(d),L=!B&&!M&&(d||h||g),U=!x&&v.length===0,z=i?.value!=="all",q=o.jsxs(o.Fragment,{children:[o.jsxs(wi,{children:[o.jsx(Fn,{as:ln,to:"/scorers",children:"Scorers"}),o.jsx(V8r,{value:e,variant:"link"})]}),o.jsxs(pt.Row,{children:[o.jsxs(Or,{children:[o.jsxs(Or.Title,{isLoading:u,children:[o.jsx(si,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(Or.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Kr,{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(po,{})}),c?.scorer?.source==="stored"&&o.jsxs(ce,{variant:"default",as:ln,to:`/cms/scorers/${e}/edit`,children:[o.jsx(ob,{})," Edit"]})]})]})]});if(B||M||L||U&&!z){const D=(d instanceof Error?d.message:void 0)??(h instanceof Error?h.message:void 0)??(g instanceof Error?g.message:void 0)??"An unexpected error occurred";return o.jsxs(pt,{width:"wide",height:"full",children:[o.jsx(pt.TopArea,{children:q}),o.jsx(pt.MainArea,{isCentered:!0,children:B?o.jsx(ca,{}):M?o.jsx(Js,{resource:"scorers"}):L?o.jsx(nc,{title:"Failed to load scorer",message:D}):o.jsx($8r,{})})]})}return o.jsxs(pt,{width:"wide",children:[o.jsxs(pt.TopArea,{children:[q,o.jsx(L8r,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{n(D=>{const G=new URLSearchParams(D);return G.set("entity","all"),G})},isLoading:x||p||m})]}),o.jsx(P8r,{scores:v,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:_,setEndOfListElement:O,onScoreClick:R,errorMsg:w?.message})]})}const GQr=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],YQr=()=>{const{baseUrl:e,headers:t,apiPrefix:n}=K1e(),{theme:r,setTheme:s}=Gj();return o.jsxs(pt,{width:"narrow",children:[o.jsx(pt.TopArea,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(Pbe,{})," Settings"]})})}),o.jsxs(pt.MainArea,{className:"flex flex-col gap-5 mt-6",children:[o.jsx(JLe,{title:"Theme",description:"Customize the appearance of the studio.",children:o.jsx(rxt,{name:"theme",label:"Theme mode",value:r,onValueChange:a=>s(a),options:GQr.map(a=>({...a}))})}),o.jsx(JLe,{title:"Mastra Connection",description:"Configure the Mastra instance URL, API prefix, and request headers used by the studio.",children:o.jsx(sMt,{initialConfig:{baseUrl:e,headers:t,apiPrefix:n}})})]})]})};function XQr(){const[e]=go(),t=Yu(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return o.jsx(j2t,{redirectUri:n,onSuccess:r,initialMode:"signup"})}function KQr(e){return e.replace(/\/$/,"").split("/").pop()}function sV({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function JQr({templates:e,linkComponent:t,className:n,isLoading:r}){const s=t||"a";return r?o.jsx("div",{className:Y("grid gap-y-4",n),children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):o.jsx("div",{className:Y("grid gap-y-4",n),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return o.jsxs("article",{className:Y("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[o.jsxs(s,{to:`/templates/${a.slug}`,className:Y("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Y("overflow-hidden"),children:o.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),o.jsxs("div",{className:Y("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[o.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),o.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),o.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&o.jsxs("ul",{className:Y("flex gap-4 text-ui-md text-neutral3 m-0 p-0 list-none","[&>li]:flex [&>li]:items-center [&>li]:gap-0.5 text-neutral4"),children:[a?.agents&&a.agents.length>0&&o.jsxs("li",{children:[o.jsx(Ma,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(co,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(iXe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(v8,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(Gl,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&o.jsx("small",{children:"|"}),o.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(l=>o.jsx("span",{className:"",children:l},l))})]})]})]}),o.jsx("a",{href:a.githubUrl,className:Y("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:o.jsxs("span",{className:"flex items-center gap-2 px-2 py-1 rounded bg-surface1 group-hover:bg-surface2 text-neutral3 transition-colors group-hover:text-neutral5",children:[o.jsx(rbt,{})," ",KQr(a.githubUrl)]})})]},a.slug)})})}function eGr({tagOptions:e,selectedTag:t,providerOptions:n,selectedProvider:r,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:l,onReset:c,className:u,isLoading:d}){return d?o.jsxs("div",{className:Y("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[o.jsx("div",{})," ",o.jsx("div",{})," ",o.jsx("div",{})]}):o.jsxs("div",{className:Y("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(C0,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx(gl,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx(gl,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:r,onValueChange:a,options:n}),c&&o.jsxs(ce,{onClick:c,children:["Reset ",o.jsx(Lr,{})]})]})}function tGr(){const{data:e,isLoading:t}=EKn(),{templates:n,tags:r,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"}];(r||[]).forEach(w=>{f.push({value:w,label:w})});const p=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{p.push({value:w,label:w})});const h=(w,S)=>{S==="tag"?i(w):S==="provider"&&c(w)},m=w=>{d(w)},g=()=>{i("all"),c("all"),d("")},v=n.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(Xn,{children:[o.jsx(Br,{children:o.jsxs($d,{children:[o.jsx(Ne,{children:o.jsx(Vx,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(eGr,{selectedTag:a,onTagChange:w=>h(w,"tag"),tagOptions:f,selectedProvider:l,onProviderChange:w=>h(w,"provider"),providerOptions:p,searchTerm:u,onSearchChange:m,onReset:x?g:void 0,className:"max-w-[80rem]",isLoading:t}),o.jsx(JQr,{templates:v,linkComponent:ln,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const nGr="1.32.1-alpha.0";function rGr({errorMsg:e,validationErrors:t}){const n=typeof e=="string"?e:e!=null?String(e):void 0,r=n?.includes("Invalid schema for function"),s=n?.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.":r?"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(Ny,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(vqt,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(sV,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l,o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),o.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&o.jsxs("details",{className:"text-xs",children:[o.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto max-h-60 text-left space-y-2",children:t.map((u,d)=>o.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[o.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),o.jsx("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap wrap-break-word",children:u.message})]},d))})]}),n&&!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:n})})]})]})}function sGr({providerOptions:e,selectedProvider:t,onProviderChange:n,variables:r,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:l,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return o.jsx(sV,{children:o.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[o.jsxs("h2",{className:Y("text-neutral4 text-header-sm font-semibold flex items-center gap-2","[&>svg]:w-[1.2em] [&_svg]:h-[1.2em] [&_svg]:opacity-70"),children:["Install Template ",o.jsx(oXe,{})]}),o.jsx(gl,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:n,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(r||{}).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),o.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:l?o.jsxs("div",{className:Y("flex items-center justify-center col-span-2 text-neutral3 text-ui-sm gap-4","[&_svg]:opacity-50 [&_svg]:w-[1.1em] [&_svg]:h-[1.1em]","animate-in fade-in duration-300"),children:[o.jsx(Bt,{})," Loading variables..."]}):Object.entries(r).map(([p,h])=>o.jsxs(b.Fragment,{children:[o.jsx(E0,{name:`env-${p}`,labelIsHidden:!0,label:"Key",value:p,disabled:!0,className:"w-full"}),o.jsx(E0,{name:p,labelIsHidden:!0,label:"Value",value:h,onChange:i,errorMsg:s.includes(p)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},p))}),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(nMt,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(ce,{className:Y("flex items-center gap-2 mt-4 justify-center text-ui-md w-full bg-surface5 min-h-10 rounded-lg text-neutral5 hover:bg-surface6 transition-colors","[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-neutral5"),onClick:a,disabled:!t||!u||!d||s.length>0||c,children:c?o.jsxs(o.Fragment,{children:[o.jsx(Bt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(YS,{})]})})]})})}function aGr({title:e,description:t,githubUrl:n,isLoading:r,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Y("grid mt-8 items-center"),children:o.jsxs("div",{className:Y("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":r}),children:[o.jsx(Vx,{}),o.jsx("h2",{className:Y({"bg-surface4 flex rounded-lg min-w-[50%]":r}),children:r?o.jsx(o.Fragment,{children:" "}):e})]})}),o.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[o.jsxs("div",{className:"grid",children:[o.jsx("p",{className:Y("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":r}),children:r?o.jsx(o.Fragment,{children:" "}):t}),!r&&a&&o.jsxs("div",{className:Y("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[o.jsx("div",{className:"shrink-0 mt-0.5",children:o.jsx(X0,{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(p8,{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."})]})]})]}),n&&o.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[o.jsx(rbt,{}),n?.split("/")?.pop()]})]}),s&&o.jsx(Vk,{data:s,labelsAreHidden:!0,isLoading:r})]})]})}function iGr({name:e,streamResult:t,workflowInfo:n}){const r=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:n?.allSteps?m in n.allSteps:!0,d=Object.entries(l).filter(([m,g])=>u(m)),f=d.length,p=()=>{switch(r){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..."}},h=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(sV,{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:p()}),t?.runId&&o.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(r)&&o.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:o.jsx(OWn,{steps:h})}),i&&r==="error"&&o.jsxs("div",{className:Y("rounded-lg text-neutral5 p-6 flex items-center gap-3 text-ui-md bg-red-500/10","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:opacity-70 [&>svg]:text-red-500"),children:[o.jsx(cVt,{}),i||"Something went wrong"]}),c&&o.jsx(_Wn,{steps:h,currentStep:a,className:"pb-4"}),!c&&r==="initializing"&&o.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[o.jsx(Bt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function oGr({name:e,installedEntities:t}){return o.jsxs(sV,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(oXe,{}),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(Vk,{data:t})]})}function lGr(){const{templateSlug:e}=ya(),[t,n]=go(),[r,s]=b.useState(""),[a,i]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState({}),[f,p]=b.useState([]),[h,m]=b.useState(null),[g,v]=b.useState(!1),[x,w]=b.useState(""),[S,_]=b.useState(!1),[O,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=CKn({repoOrSlug:e,owner:"mastra-ai"}),R=nGr?.includes("beta")??!1?"beta":"main",{data:B,isLoading:M}=jKn({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:L,isLoading:U}=TKn(),{mutateAsync:z,isPending:q}=NKn(),{mutateAsync:Z}=AKn(),{streamInstall:D,streamResult:G,isStreaming:V}=RKn(L),{observeInstall:$,streamResult:W,isStreaming:Q}=PKn(L);b.useEffect(()=>{const ne=t.get("runId");ne&&!g&&!h&&!V&&!Q&&(console.info("🔄 Checking completed run after hot reload:",{runId:ne}),w(ne),Z({runId:ne}).then(le=>{const ge=le.snapshot;if(ge?.status==="success"&&ge?.result?.success)v(!0);else if(ge?.result?.success===!1)if(ge?.result?.validationResults&&!ge?.result?.validationResults?.valid&&ge?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ue,errors:be}=ge.result.validationResults,ke=`Template installation completed but ${ue} validation issue${ue>1?"s":""} remain unresolved.`;m(ke),j(be||[])}else{const ue=ge?.result?.message||ge?.result?.error||"Template installation failed";m(typeof ue=="string"?ue:String(ue))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,h,V,Q,Z]),b.useEffect(()=>{const ne=t.get("runId"),le=t.get("resume"),ge=t.get("provider");if(ne&&le==="true"&&ge&&!V&&!Q&&!S&&!O&&L){w(ne),_(!0);try{Z({runId:ne}).then(de=>{if(de.snapshot?.status==="running")return $.mutateAsync({runId:ne})}).then(()=>{n(de=>{const ue=new URLSearchParams(de);return ue.delete("resume"),ue})}).catch(de=>{console.error("❌ Failed to resume template installation:",de),de.message?.includes("404")||de.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(de){console.error("❌ Auto-resume failed with error:",de),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,Q,S,O,L,Z,$,n]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ae=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(ne=>ne).join(", "):"n/a",icon:o.jsx(co,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(ne=>ne).join(", "):"n/a",icon:o.jsx(Ma,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(ne=>ne).join(", "):"n/a",icon:o.jsx(v8,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Og,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(fj,{})}],te=[{...ae[0]},{...ae[1]},{...ae[2]}].filter(ne=>ne.value!=="n/a");b.useEffect(()=>{B&&d(B)},[B]),b.useEffect(()=>{const ne=G||W;ne?.phase==="error"&&ne?.error&&m(typeof ne.error=="string"?ne.error:String(ne.error))},[G?.phase,G?.error,W?.phase,W?.error]);const re=ne=>{s(ne)},ie=async ne=>(i(ne.provider),c(ne.modelId),{message:"Model updated successfully"}),pe=async()=>{const ne=Object.entries(u).reduce((le,[ge,de])=>(de===""&&le.push(ge),le),[]);if(ne.length>0){p(ne);return}if(N){m(null),v(!1),w(""),E(!0);try{const ge={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:R,slug:N.slug,variables:u},{runId:de}=await z({});w(de),n(ue=>{const be=new URLSearchParams(ue);return be.set("runId",de),be.set("resume","true"),be.set("provider",r||"openai"),be}),await D.mutateAsync({inputData:ge,selectedModel:{provider:a,modelId:l},runId:de})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},X=ne=>{const{name:le,value:ge}=ne.target;ge.trim()===""?p(de=>[...de,le]):p(de=>de.filter(ue=>ue!==le)),d(de=>({...de,[le]:ge}))};return o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/templates",children:[o.jsx(Ne,{children:o.jsx(Vx,{})}),"Templates"]}),o.jsx(Fn,{as:ln,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:o.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[o.jsx(aGr,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ae,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(V||Q)&&o.jsx(iGr,{name:N.title,streamResult:Q?W:G,runId:x,workflowInfo:L}),g&&o.jsx(oGr,{name:N.title,installedEntities:te,linkComponent:ln}),h&&o.jsx(rGr,{errorMsg:h,validationErrors:T.length>0?T:G?.validationResults?.errors||W?.validationResults?.errors}),!V&&!Q&&!g&&!h&&o.jsx(sGr,{providerOptions:J,selectedProvider:r,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:pe,handleVariableChange:X,isLoadingEnvVars:M||U,isInstalling:q,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const cGr=()=>{const{toolId:e,agentId:t}=ya();return o.jsxs(Xn,{children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/agents",children:[o.jsx(Ne,{children:o.jsx(Ma,{})}),"Agents"]}),o.jsx(Fn,{as:ln,to:`/agents/${t}/chat`,children:t}),o.jsx(Fn,{as:ln,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ne,{children:o.jsx(hw,{})}),"Tools documentation"]})})]}),o.jsx(SBr,{toolId:e,agentId:t})]})},uGr=()=>{const{toolId:e}=ya();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/tools",children:[o.jsx(Ne,{children:o.jsx(co,{})}),"Tools"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(bQr,{value:e,variant:"ghost"})})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(hw,{}),"Tools documentation"]})})]}),o.jsx(yQr,{toolId:e})]})};function dGr(e){return e.feedbackType==="thumbs"?e.value===1?"👍 Positive (1)":e.value===0||e.value===-1?"👎 Negative":String(e.value):e.feedbackType==="rating"?String(e.value):e.feedbackType==="comment"?String(e.value??e.comment??"-"):String(e.value??"-")}function fGr({feedback:e,isOpen:t,onClose:n,onNext:r,onPrevious:s}){const a=e?.metadata&&Object.keys(e.metadata).length>0?JSON.stringify(e.metadata,null,2):void 0;return o.jsxs(Gt,{dialogTitle:"Feedback Detail",dialogDescription:"View feedback details",isOpen:t,onClose:n,level:3,children:[o.jsxs(Gt.Top,{children:[o.jsxs(us,{children:[o.jsx(VI,{})," Feedback"]}),"|",o.jsx(Gt.Nav,{onNext:r,onPrevious:s})]}),o.jsxs(Gt.Content,{children:[o.jsxs(Gt.Header,{children:[o.jsxs(Gt.Heading,{children:[o.jsx(VI,{})," Feedback"]}),e?.traceId&&o.jsxs(us,{children:[o.jsx(UE,{})," ",e.traceId]})]}),o.jsxs(j0,{children:[o.jsx(Vk,{data:[{label:"Created at",value:e?.timestamp?an(new Date(e.timestamp),"MMM d, h:mm:ss aaa"):"n/a",key:"timestamp"},{label:"Type",value:e?.feedbackType??"n/a",key:"type"},{label:"Value",value:e?dGr(e):"n/a",key:"value"},...e?.comment?[{label:"Comment",value:e.comment,key:"comment"}]:[],{label:"Source",value:e?.feedbackSource??e?.source??"n/a",key:"source"},...e?.feedbackUserId?[{label:"User",value:e.feedbackUserId,key:"userId"}]:[],...e?.traceId?[{label:"Trace ID",value:e.traceId,key:"traceId"}]:[],...e?.spanId?[{label:"Span ID",value:e.spanId,key:"spanId"}]:[]]}),a&&o.jsx(Gt.CodeSection,{title:"Metadata",icon:o.jsx(UE,{}),codeStr:a,simplified:!0})]})]})]})}const N3=[{name:"source",label:"Source",size:"1fr"},{name:"date",label:"Date",size:"0.8fr"},{name:"time",label:"Time",size:"0.8fr"},{name:"value",label:"Value",size:"0.6fr"},{name:"comment",label:"Comment",size:"2fr"}];function pGr(e){return e.feedbackType==="thumbs"?e.value===1?"👍":e.value===0||e.value===-1?"👎":String(e.value):typeof e.value=="number"?String(e.value):"—"}function hGr(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function T2t({feedbackData:e,isLoadingFeedbackData:t,onPageChange:n}){const[r,s]=b.useState(!1),[a,i]=b.useState(),l=e?.feedback??[],c=p=>{i(l[p]),s(!0)};if(t)return o.jsx(ext,{columns:N3});const u=a?l.indexOf(a):-1,d=u>=0&&u<l.length-1?()=>i(l[u+1]):void 0,f=u>0?()=>i(l[u-1]):void 0;return o.jsxs(o.Fragment,{children:[o.jsxs(Ra,{children:[o.jsxs(Ra.Trim,{children:[o.jsx(Ra.Header,{columns:N3}),l.length>0?o.jsx(Ra.Entries,{children:l.map((p,h)=>{const m=new Date(p.timestamp),g=xv(m),v={id:`${p.traceId}-${h}`,source:p.feedbackUserId||p.feedbackSource||"unknown",date:g?"Today":an(m,"MMM dd"),time:an(m,"h:mm:ss aaa"),value:pGr(p),comment:hGr(p)};return o.jsx(Ra.Entry,{columns:N3,onClick:()=>c(h),entry:v,children:N3.map(x=>o.jsx(Ra.EntryText,{children:String(v[x.name]??"")},`col-${x.name}`))},v.id)})}):o.jsx(Ra.Message,{message:"No feedback found",type:"info"})]}),o.jsx(Ra.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>n?.((e?.pagination?.page||0)+1),onPrevPage:()=>{const p=e?.pagination?.page||0;p>0&&n?.(p-1)}})]}),o.jsx(fGr,{feedback:a,isOpen:r,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const OQe="auto auto auto auto 1fr";function N2t({scoresData:e,isLoadingScoresData:t,onPageChange:n,onScoreSelect:r}){return t?o.jsx(JU,{columns:OQe}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(hu,{columns:OQe,className:"min-w-0",children:[o.jsxs(hu.Top,{children:[o.jsx(hu.TopCell,{children:"ID"}),o.jsx(hu.TopCell,{children:"Date"}),o.jsx(hu.TopCell,{children:"Time"}),o.jsx(hu.TopCell,{children:"Score"}),o.jsx(hu.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=xv(a);return o.jsxs(hu.RowButton,{onClick:()=>r?.(s),children:[o.jsx(hu.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:Zf(s?.id)||"n/a"}),o.jsx(hu.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":an(a,"MMM dd")}),o.jsx(hu.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:an(a,"h:mm:ss aaa")}),o.jsx(hu.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(hu.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(hu.NoMatch,{message:"No scores found"})]}),o.jsx(hu.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>n?.((e?.pagination?.page||0)+1),onPrevPage:()=>n?.((e?.pagination?.page||0)-1)})]})}const A2t=({traceId:e="",page:t})=>{const n=Ze(),r=t??0;return Ot({queryKey:["trace-feedback",e,r],queryFn:()=>n.listFeedback({filters:{traceId:e},pagination:{page:r,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})};function mGr(){const[e,t]=go(),[n,r]=b.useState(!1),s=MXn(e,t,{onRemoveAll:()=>r(!1)}),[a,i]=b.useState(),[l,c]=b.useState(0),[u,d]=b.useState(!1),[f,p]=b.useState(null);b.useEffect(()=>c(0),[s.traceIdParam,s.spanIdParam]);const{data:h,isLoading:m}=ef(),{data:g,isLoading:v}=oke({traceId:s.traceIdParam,spanId:s.spanIdParam,page:l}),[x,w]=b.useState(0);b.useEffect(()=>w(0),[s.traceIdParam,s.spanIdParam]);const{data:S,isLoading:_}=A2t({traceId:s.traceIdParam,page:x}),{data:O,isLoading:E}=txe(s.traceIdParam??null),T=b.useMemo(()=>O?.spans,[O?.spans]),{data:j,isLoading:N}=K1(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ue=>ue.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=c0t(),{data:B=[],isPending:M}=u0t({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:L=[],isPending:U}=d0t(),{data:z=[],isPending:q}=f0t(),Z=b.useMemo(()=>jXn({availableTags:P,availableRootEntityNames:B,availableServiceNames:z,availableEnvironments:L,loading:{tags:R,entityNames:M,serviceNames:q,environments:U}}),[P,B,z,L,R,M,q,U]),D=b.useMemo(()=>IXn({rootEntityType:s.selectedEntityOption?.entityType,status:s.selectedStatus,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,tokens:s.filterTokens}),[s.filterTokens,s.selectedDateFrom,s.selectedDateTo,s.selectedEntityOption,s.selectedStatus]),{data:G,isLoading:V,isFetchingNextPage:$,hasNextPage:W,setEndOfListElement:Q,error:J}=wXn({filters:D}),ae=b.useMemo(()=>G?.spans??[],[G?.spans]),te=G?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=p0t(T,s.spanIdParam??null,ue=>s.handleSpanChange(ue)),pe=zXn(e,t),X=b.useCallback(()=>s.applyFilterTokens(RXn(Z,s.filterTokens)),[Z,s]),{handlePreviousTrace:ne,handleNextTrace:le}=PXn(ae,s.traceIdParam,s.handleTraceClick),ge=b.useCallback(()=>{const ue=T?.find(be=>be.parentSpanId==null);ue&&(s.handleSpanChange(ue.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(ir,{title:"Traces",icon:o.jsx(Jo,{}),children:o.jsx(l0t,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const de=!!s.selectedEntityOption||!!s.selectedStatus||s.filterTokens.length>0||s.datePreset!=="last-24h"||!!s.selectedDateTo;return o.jsxs(pt,{width:"wide",height:"full",children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:V,children:[o.jsx(Jo,{})," Traces"]})})}),o.jsxs(pt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(Uxt,{preset:s.datePreset,onPresetChange:s.handleDatePresetChange,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,onDateChange:s.handleDateChange,disabled:V,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(Zbt,{fields:Z,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Kr,{disabled:V,"aria-pressed":n,"aria-label":n?"Ungroup traces":"Group traces by thread",tooltipContent:n?"Ungroup traces":"Group traces by thread",onClick:()=>r(ue=>!ue),children:n?o.jsx(s6,{}):o.jsx(tXe,{})}),o.jsx(Kr,{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(po,{})})]})]}),o.jsx(sXn,{isLoading:V,filterFields:Z,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:pe.handleSave,onRemoveSaved:pe.hasSavedFilters?pe.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx(fXn,{traceCollapsed:u,listSlot:o.jsx(hXn,{traces:ae,isLoading:V,isFetchingNextPage:$,hasNextPage:W,setEndOfListElement:Q,filtersApplied:de,featuredTraceId:s.traceIdParam,onTraceClick:ue=>s.handleTraceClick(s.traceIdParam===ue.traceId?"":ue.traceId),groupByThread:n,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(i0t,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ue=>s.handleSpanChange(ue??null),onEvaluateTrace:ge,onSaveAsDatasetItem:ue=>p(ue),initialSpanId:s.spanIdParam,onPrevious:ne,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:j7,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(o0t,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ue=>s.handleSpanTabChange(ue),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(T2t,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:_}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ue,traceId:be,spanId:ke})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(gke,{traceId:be,isTopLevelSpan:!ue.parentSpanId,spanId:ke,entityType:ue.attributes?.agentId||ue.entityType===hl.AGENT?"Agent":ue.attributes?.workflowId||ue.entityType===hl.WORKFLOW_RUN?"Workflow":void 0,scorers:h,isLoadingScorers:m}),o.jsx(N2t,{scoresData:g,onPageChange:c,isLoadingScoresData:v,onScoreSelect:Ie=>s.handleScoreChange(Ie.id)})]})}):null,scorePanelSlot:I?o.jsx(ake,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(vke,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>p(null)})]})}function gGr(){const{traceId:e}=ya(),[t,n]=go(),r=Yu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",l=t.get("scoreId")||void 0,[c,u]=b.useState(s??null),[d,f]=b.useState(),[p,h]=b.useState(i),[m,g]=b.useState(0),[v,x]=b.useState(!1),{data:w,isLoading:S,error:_}=txe(e),O=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>O.find(re=>re.parentSpanId==null),[O]),{data:T,isLoading:j}=K1(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=ef(),{data:P,isLoading:R}=oke({traceId:e,spanId:c??void 0,page:m}),[B,M]=b.useState(0);b.useEffect(()=>M(0),[e,c]);const{data:L,isLoading:U}=A2t({traceId:e,page:B});b.useEffect(()=>{if(l&&P?.scores&&!d){const re=P.scores.find(ie=>ie.id===l);re&&f(re)}},[l,P?.scores,d]);const z=b.useCallback(re=>{const ie=new URLSearchParams(t);for(const[pe,X]of Object.entries(re))X===null||X===""?ie.delete(pe):ie.set(pe,X);n(ie,{replace:!0})},[t,n]),q=b.useCallback(re=>{const ie=re??null,pe=ie===c;u(ie),pe||(f(void 0),h("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),Z=b.useCallback(()=>{u(null),f(void 0),h("details"),z({spanId:null,tab:null,scoreId:null})},[z]),D=b.useCallback(re=>{u(re),f(void 0),h("details"),z({spanId:re,tab:null,scoreId:null})},[z]),{handlePreviousSpan:G,handleNextSpan:V}=p0t(O,c,D),$=b.useCallback(re=>{const ie=re;h(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=b.useCallback(re=>{f(re),z({scoreId:re.id})},[z]),Q=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),J=b.useCallback(()=>{r("/observability")},[r]),ae=b.useCallback(()=>{h("scoring"),E&&c!==E.spanId?(u(E.spanId),f(void 0),z({spanId:E.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[E,c,z]),te=o.jsxs(o.Fragment,{children:[o.jsxs(ce,{as:j7,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(Yf,{}),"Back to Traces"]}),o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:S,children:[o.jsx(Jo,{})," Trace ",o.jsx("span",{className:"text-neutral3",children:e})]})})}),o.jsx(pt.Column,{children:o.jsxs(ps,{children:[o.jsx(Kr,{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(po,{})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs(Kr,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(r6,{}),"Evaluate"]}),o.jsxs(Kr,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(Jc,{}),"Save"]})]})]})})]}),E&&o.jsx(pt.Row,{children:o.jsx(pt.Column,{children:o.jsx(r0t,{rootSpan:E,numOfCol:3})})})]});return _?o.jsxs(pt,{height:"full",children:[o.jsx(pt.TopArea,{children:te}),o.jsx(pt.MainArea,{isCentered:!0,children:o.jsx(l0t,{error:_,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(pt,{children:[o.jsx(pt.TopArea,{children:te}),o.jsx(vke,{rootSpanId:E?.spanId,traceId:e,isOpen:v,onClose:()=>x(!1)}),o.jsxs("div",{className:Y("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[o.jsx(i0t,{traceId:e,spans:O,isLoading:S,onClose:J,onSpanSelect:q,onEvaluateTrace:ae,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Y("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(o0t,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:Z,onPrevious:G,onNext:V,activeTab:p,onTabChange:$,feedbackTabBadge:L?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(T2t,{feedbackData:L,onPageChange:M,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:pe})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(gke,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:pe,entityType:re.attributes?.agentId||re.entityType===hl.AGENT?"Agent":re.attributes?.workflowId||re.entityType===hl.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),o.jsx(N2t,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(ake,{score:d,onClose:Q})]})]})]})}function vGr(){const{data:e,isLoading:t,error:n}=vw(),[r,s]=b.useState("");return n&&Fs(n)?o.jsx(ir,{title:"Workflows",icon:o.jsx(uo,{}),children:o.jsx(ca,{})}):n&&$s(n)?o.jsx(ir,{title:"Workflows",icon:o.jsx(uo,{}),children:o.jsx(Js,{resource:"workflows"})}):n?o.jsx(ir,{title:"Workflows",icon:o.jsx(uo,{}),children:o.jsx(nc,{title:"Failed to load workflows",message:n.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(ir,{title:"Workflows",icon:o.jsx(uo,{}),children:o.jsx(YEr,{})}):o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:t,children:[o.jsx(uo,{})," Workflows"]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsxs(ce,{as:ln,to:"/workflows/schedules",children:[o.jsx(Eg,{}),"Schedules"]}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:o.jsx(po,{})})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(GEr,{workflows:e||{},isLoading:t,search:r})]})}const yGr={active:"bg-accent1",paused:"bg-accent3"},bGr={active:"text-accent1",paused:"text-accent3"},I2t=({status:e})=>o.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[o.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${yGr[e]}`,"aria-hidden":!0}),o.jsx("span",{className:`text-ui-sm ${bGr[e]}`,children:e})]}),PE=e=>!e||e<=0?"—":new Date(e).toLocaleString(),AI=e=>{if(!e||e<=0)return"—";const t=e-Date.now(),n=Math.abs(t),r=Math.floor(n/1e3);if(r<60)return t>=0?`in ${r}s`:`${r}s ago`;const s=Math.floor(r/60);if(s<60)return t>=0?`in ${s}m`:`${s}m ago`;const a=Math.floor(s/60);if(a<24)return t>=0?`in ${a}h`:`${a}h ago`;const i=Math.floor(a/24);return t>=0?`in ${i}d`:`${i}d ago`};function R2t({status:e}){const{icon:t,color:n}=xGr(e);return o.jsxs("span",{className:`inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm ${n}`,children:[o.jsx("span",{className:"inline-flex shrink-0 items-center","aria-hidden":!0,children:t}),o.jsx("span",{children:e})]})}function xGr(e){switch(e){case"success":return{icon:o.jsx(ga,{size:14}),color:"text-accent1"};case"failed":return{icon:o.jsx(Lr,{size:14}),color:"text-accent2"};case"running":return{icon:o.jsx(Bt,{}),color:"text-neutral3"};case"suspended":return{icon:o.jsx(wpe,{size:14}),color:"text-accent3"};case"canceled":return{icon:o.jsx(qd,{size:14}),color:"text-neutral3"};case"pending":case"waiting":return{icon:o.jsx(bk,{size:14}),color:"text-neutral3"};default:return{icon:null,color:"text-neutral3"}}}const EQe="auto auto auto auto 1fr";function wGr(e){if(e===void 0)return"—";if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t}m ${n}s`}function SGr(e){const t=Math.abs(e),n=e<0?"-":"";return t<1e3?`${n}${t}ms`:t<6e4?`${n}${(t/1e3).toFixed(1)}s`:t<36e5?`${n}${(t/6e4).toFixed(1)}m`:`${n}${(t/36e5).toFixed(1)}h`}const kGr=3e4,_Gr=5*6e4;function OGr({triggers:e,isLoading:t,workflowId:n,hasNextPage:r,isFetchingNextPage:s,setEndOfListElement:a}){const{Link:i,paths:l}=cn();return t?o.jsx(Md,{columns:EQe}):e.length===0?o.jsx(me,{variant:"ui-md",className:"text-neutral4 p-4",children:"No trigger history yet."}):o.jsxs(xe,{columns:EQe,children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Run"}),o.jsx(xe.TopCell,{children:"Status"}),o.jsx(xe.TopCell,{children:"Started"}),o.jsx(xe.TopCell,{children:"Duration"}),o.jsx(xe.TopCell,{children:" "})]}),e.map(c=>{const u=c.actualFireAt-c.scheduledFireAt,d=SGr(u),f=`Scheduled ${PE(c.scheduledFireAt)} — published ${PE(c.actualFireAt)} (drift ${d})`,p=c.outcome==="failed",h=p?c.error:c.run?.error,m=Math.abs(u),g=!p&&m>kGr&&m<=_Gr,v=`${c.scheduleId}-${c.runId}-${c.actualFireAt}`,x=o.jsx("span",{className:n&&!p?"text-accent1 font-mono text-ui-sm whitespace-nowrap":"text-neutral3 font-mono text-ui-sm whitespace-nowrap",children:c.runId}),w=o.jsxs(o.Fragment,{children:[o.jsx(xe.NameCell,{children:x}),o.jsx(xe.TextCell,{children:o.jsxs("span",{className:"inline-flex items-center gap-2",children:[p?o.jsxs("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm text-accent2",children:[o.jsx(Ny,{size:14}),"publish failed"]}):c.run?o.jsx(R2t,{status:c.run.status}):o.jsx("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm text-neutral3",children:"pending"}),h?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{className:"text-accent2 inline-flex",children:o.jsx(Ny,{size:14})})}),o.jsx(Kn,{children:h})]}):null]})}),o.jsx(xe.TextCell,{children:o.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[o.jsx("span",{title:f,children:AI(c.actualFireAt)}),g?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{className:"text-accent3 inline-flex",children:o.jsx(Ny,{size:14})})}),o.jsxs(Kn,{children:["Published ",d," after the scheduled fire time"]})]}):null]})}),o.jsx(xe.TextCell,{children:c.run?o.jsx("span",{children:wGr(c.run.durationMs)}):o.jsx("span",{className:"text-neutral4",children:"—"})}),o.jsx(xe.TextCell,{children:" "})]});return n&&c.run&&!p?o.jsx(xe.RowLink,{to:l.workflowRunLink(n,c.runId),LinkComponent:i,children:w},v):o.jsx(xe.Row,{children:w},v)}),a?o.jsxs("div",{ref:a,className:"h-1 col-span-full",children:[s?o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Bt,{})}):null,!r&&e.length>0?o.jsx(me,{variant:"ui-xs",className:"text-neutral4 text-center py-4 block",children:"All triggers loaded"}):null]}):null]})}const EGr=e=>{const t=Ze();return Ot({queryKey:["schedule",e],enabled:!!e,queryFn:async()=>{if(!e)throw new Error("scheduleId is required");return t.getSchedule(e)}})},CQe=25,CGr=e=>{const t=Ze(),{inView:n,setRef:r}=mw(),s=Sb({queryKey:["schedule-triggers",e],enabled:!!e,initialPageParam:void 0,queryFn:async({pageParam:u})=>e?t.listScheduleTriggers(e,{limit:CQe,toActualFireAt:u}):{triggers:[]},getNextPageParam:u=>{if(!(!u?.triggers?.length||u.triggers.length<CQe))return u.triggers[u.triggers.length-1].actualFireAt},refetchInterval:u=>(u.state.data?.pages.flatMap(p=>p.triggers)??[]).some(p=>p.run?p.run.status==="pending"||p.run.status==="running"||p.run.status==="waiting":p.outcome==="published")?5e3:!1}),a=s.data?.pages.flatMap(u=>u?.triggers??[])??[],{hasNextPage:i,isFetchingNextPage:l,fetchNextPage:c}=s;return b.useEffect(()=>{n&&i&&!l&&c()},[n,i,l,c]),{...s,data:a,setEndOfListElement:r}},jGr=e=>{const t=Ze(),n=la();return ar({mutationFn:async r=>{if(!e)throw new Error("scheduleId is required");return r==="pause"?t.pauseSchedule(e):t.resumeSchedule(e)},onSuccess:(r,s)=>{n.invalidateQueries({queryKey:["schedule",e]}),n.invalidateQueries({queryKey:["schedules"]}),ze.success(s==="pause"?"Schedule paused":"Schedule resumed")},onError:r=>{ze.error(r.message)}})};function A3({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(me,{variant:"ui-xs",className:"text-neutral4 uppercase tracking-wide",children:e}),o.jsx("div",{className:"text-ui-md",children:t})]})}function TGr(){const{scheduleId:e}=ya(),{paths:t}=cn(),{data:n,isLoading:r,error:s}=EGr(e),{data:a,isLoading:i,error:l,hasNextPage:c,isFetchingNextPage:u,setEndOfListElement:d}=CGr(e),f=jGr(e);if(s&&Fs(s))return o.jsx(ir,{title:"Schedule",icon:o.jsx(Eg,{}),children:o.jsx(ca,{})});if(s&&$s(s))return o.jsx(ir,{title:"Schedule",icon:o.jsx(Eg,{}),children:o.jsx(Js,{resource:"schedules"})});if(s)return o.jsx(ir,{title:"Schedule",icon:o.jsx(Eg,{}),children:o.jsx(nc,{title:"Failed to load schedule",message:s.message})});const p=n?.target.type==="workflow"?n.target.workflowId:void 0;return o.jsxs(pt,{children:[o.jsx(pt.TopArea,{children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:r,children:[o.jsx(Eg,{}),o.jsx("span",{className:"font-mono",children:n?.id??e})]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsxs(ce,{as:ln,to:t.schedulesLink(),variant:"ghost",children:[o.jsx(Yf,{}),"Back to schedules"]}),p?o.jsx(ce,{as:ln,to:t.workflowLink(p),variant:"ghost",children:"Open workflow"}):null,n?o.jsx(ce,{onClick:()=>f.mutate(n.status==="active"?"pause":"resume"),disabled:f.isPending,"data-testid":"schedule-toggle-button",children:n.status==="active"?o.jsxs(o.Fragment,{children:[o.jsx(Cpe,{}),"Pause"]}):o.jsxs(o.Fragment,{children:[o.jsx(Fy,{}),"Resume"]})}):null]})]})}),n?o.jsxs("div",{className:"grid gap-6 h-full overflow-hidden grid-cols-[minmax(0,20rem)_1fr]",children:[o.jsxs("div",{className:"flex flex-col gap-4 border border-border1 rounded-md p-4 h-fit",children:[o.jsx(A3,{label:"Workflow",children:p?o.jsx(ln,{to:t.workflowLink(p),className:"text-accent1 hover:underline",children:p}):"—"}),o.jsxs(A3,{label:"Cron",children:[o.jsx("code",{className:"font-mono text-ui-md",children:n.cron}),n.timezone?o.jsx("span",{className:"text-neutral4 ml-2 text-ui-sm",children:n.timezone}):null]}),o.jsx(A3,{label:"Status",children:o.jsx(I2t,{status:n.status})}),o.jsx(A3,{label:"Next fire",children:o.jsx("span",{title:PE(n.nextFireAt),children:AI(n.nextFireAt)})})]}),o.jsxs("div",{className:"overflow-y-auto","data-testid":"schedule-triggers-panel",children:[o.jsx(me,{variant:"ui-md",className:"mb-3",children:"Trigger history"}),l?o.jsx(nc,{title:"Failed to load trigger history",message:l.message}):o.jsx(OGr,{triggers:a??[],isLoading:i,workflowId:p,hasNextPage:c,isFetchingNextPage:u,setEndOfListElement:d})]})]}):null]})}const jQe="minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto auto auto";function NGr({schedules:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=cn(),a=b.useMemo(()=>{const i=n.toLowerCase();return i?e.filter(l=>l.id.toLowerCase().includes(i)||l.target.workflowId.toLowerCase().includes(i)):e},[e,n]);return t?o.jsx(Md,{columns:jQe}):o.jsxs(xe,{columns:jQe,children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Workflow"}),o.jsx(xe.TopCell,{children:"Schedule ID"}),o.jsx(xe.TopCell,{children:"Cron"}),o.jsx(xe.TopCell,{children:"Status"}),o.jsx(xe.TopCell,{children:"Next fire"}),o.jsx(xe.TopCell,{children:"Last run"})]}),a.length===0&&n?o.jsx(xe.NoMatch,{message:"No schedules match your search"}):null,a.length===0&&!n?o.jsx(xe.NoMatch,{message:"No schedules configured"}):null,a.map(i=>o.jsxs(xe.RowLink,{to:r.scheduleLink(i.id),LinkComponent:s,children:[o.jsx(xe.NameCell,{children:o.jsx("span",{className:"truncate",children:i.target.workflowId})}),o.jsx(xe.TextCell,{children:o.jsx("span",{className:"truncate font-mono text-ui-sm",title:i.id,children:i.id})}),o.jsx(xe.TextCell,{children:o.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[o.jsx("code",{className:"font-mono text-ui-sm",children:i.cron}),i.timezone?o.jsx("span",{className:"text-neutral4 text-ui-xs",children:i.timezone}):null]})}),o.jsx(xe.TextCell,{children:o.jsx(I2t,{status:i.status})}),o.jsx(xe.TextCell,{children:o.jsx("span",{className:"whitespace-nowrap",title:PE(i.nextFireAt),children:AI(i.nextFireAt)})}),o.jsx(xe.TextCell,{children:i.lastRun?o.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[o.jsx(R2t,{status:i.lastRun.status}),o.jsx("span",{className:"text-neutral4 text-ui-sm",title:PE(i.lastFireAt),children:i.lastFireAt?AI(i.lastFireAt):""})]}):i.lastFireAt?o.jsx("span",{className:"whitespace-nowrap",title:PE(i.lastFireAt),children:AI(i.lastFireAt)}):o.jsx("span",{className:"text-neutral4",children:"Never"})})]},i.id))]})}function AGr({workflowId:e}={}){const{data:t,isLoading:n,error:r}=ixe(e?{workflowId:e}:{}),[s,a]=b.useState("");return r?o.jsx(nc,{title:"Failed to load schedules",message:r.message}):o.jsxs("div",{className:"grid grid-rows-[auto_1fr] gap-4 h-full overflow-hidden",children:[o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:a,label:"Filter schedules",placeholder:"Filter by id or workflow"})}),o.jsx("div",{className:"overflow-y-auto",children:o.jsx(NGr,{schedules:t??[],isLoading:n,search:s})})]})}function IGr(){const[e]=go(),t=e.get("workflowId")??void 0,{error:n}=ixe(t?{workflowId:t}:{});if(n&&Fs(n))return o.jsx(ir,{title:"Schedules",icon:o.jsx(Eg,{}),children:o.jsx(ca,{})});if(n&&$s(n))return o.jsx(ir,{title:"Schedules",icon:o.jsx(Eg,{}),children:o.jsx(Js,{resource:"schedules"})});const r=t?`/workflows/${t}`:"/workflows",s=t?"Back to workflow":"Back to workflows";return o.jsxs(pt,{children:[o.jsx(pt.TopArea,{children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(Eg,{})," ",t?`Schedules · ${t}`:"Schedules"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsxs(ce,{as:ln,to:r,variant:"ghost",children:[o.jsx(Yf,{}),s]})})]})}),o.jsx(AGr,{workflowId:t})]})}const TQe=()=>{const{workflowId:e}=ya(),{data:t,isLoading:n,error:r}=LM(e);return r&&Fs(r)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})}):r&&$s(r)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"workflows"})}):o.jsx(gjt,{workflowId:e,workflow:t??void 0,isLoading:n})};function RGr(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(abt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(sbt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(ibt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(vZ,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Vie,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(Ya,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(zc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Vie,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(vZ,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(vZ,{className:"h-4 w-4 text-neutral4"})}}function P2t(e,t=!1){const{name:n,type:r,mount:s}=e;if(r==="directory")return s?RGr(s):t?o.jsx(cj,{className:"h-4 w-4 text-amber-400"}):o.jsx(zc,{className:"h-4 w-4 text-amber-400"});switch(n.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(p0,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(S$,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return o.jsx(No,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return o.jsx(_pe,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(Spe,{className:"h-4 w-4 text-neutral4"})}}function $2t(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+$2t(-e);if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function PGr(e){if("body"in e&&e.body&&typeof e.body=="object"){const r=e.body;if(typeof r.error=="string")return r.error;if(typeof r.message=="string")return r.message}const t=e.message,n=t.lastIndexOf(" - {");if(n!==-1)try{const r=t.slice(n+3),s=JSON.parse(r);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function M2t(e){return e==="."||e===""}function $Gr({path:e,onNavigate:t}){const r=M2t(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(cj,{className:"h-4 w-4"})}),r.map((s,a)=>{const i=r.slice(0,a+1).join("/");return o.jsxs("div",{className:"flex items-center",children:[o.jsx(da,{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 MGr({entries:e,currentPath:t,isLoading:n,error:r,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:l,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[p,h]=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=M2t(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}`;h(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($Gr,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(ce,{variant:"ghost",size:"md",onClick:i,disabled:n,"aria-label":"Refresh files",children:o.jsx(k$,{className:`h-4 w-4 ${n?"animate-spin":""}`})}),c&&o.jsx(ce,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const w=prompt("Directory name:");if(w){const S=g?w:`${t}/${w}`;c(S)}},children:d?o.jsx(Xa,{className:"h-4 w-4 animate-spin"}):o.jsx(f8,{className:"h-4 w-4"})}),l&&o.jsx(ce,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(g8,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"max-h-[400px] overflow-auto",children:n?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Xa,{className:"h-6 w-6 animate-spin text-neutral3"})}):r?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(qI,{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:PGr(r)})]}):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(Gd,{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(cj,{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,_=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:[P2t(w),o.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:w.name}),w.mount&&_&&o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(qI,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Kn,{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(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${_?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})}),o.jsx(Kn,{children:w.mount.description})]}):o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${_?"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:$2t(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(Vd,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx(Ht,{open:!!p,onOpenChange:w=>!f&&!w&&h(null),children:o.jsxs(Ht.Content,{children:[o.jsxs(Ht.Header,{children:[o.jsx(Ht.Title,{children:"Delete Item"}),o.jsxs(Ht.Description,{children:['Are you sure you want to delete "',p,'"? This action cannot be undone.']})]}),o.jsxs(Ht.Footer,{children:[o.jsx(Ht.Cancel,{disabled:f,children:"Cancel"}),o.jsxs(Ht.Action,{disabled:f,onClick:async()=>{try{p&&u&&await u(p)}finally{h(null)}},children:[f?o.jsx(Xa,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function DGr(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 LGr({content:e,language:t}){return o.jsx(Z1e,{language:t,style:W1e.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function zGr({path:e,content:t,isLoading:n,mimeType:r,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),l=r?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=DGr(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:[P2t({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(_a,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(ce,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),o.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:n?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Xa,{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:${r||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?o.jsx(LGr,{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 FGr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No Workspaces yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Add a workspace to your Mastra configuration to ",o.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(Fa,{})]})})}),BGr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(C7t,{}),titleSlot:"Workspace Not Configured",descriptionSlot:o.jsxs(o.Fragment,{children:["No workspace is configured. Add a workspace to your ",o.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(Fa,{})]})})}),UGr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qI,{}),titleSlot:"Workspace Not Supported",descriptionSlot:o.jsxs(o.Fragment,{children:["The workspace feature requires a newer version of ",o.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",o.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(Fa,{})]})})}),die={bm25:{label:"Keyword",icon:o.jsx(No,{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(qE,{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(dHt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function D2t(e){return e.id.replace(/#chunk-\d+$/,"")}function qGr({onSearch:e,isSearching:t,searchResults:n,canBM25:r,canVector:s,onViewResult:a}){const[i,l]=b.useState(""),[c,u]=b.useState(5),d=()=>r&&s?"hybrid":r?"bm25":s?"vector":"bm25",[f,p]=b.useState(d()),h=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...r?["bm25"]:[],...s?["vector"]:[],...r&&s?["hybrid"]:[]];return o.jsxs("div",{className:"rounded-lg bg-surface4",children:[o.jsxs("form",{onSubmit:h,className:"p-4",children:[o.jsxs("div",{className:"flex gap-3 items-center",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(dj,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(mn,{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(mn,{type:"number",min:1,max:50,value:c,onChange:g=>u(parseInt(g.target.value)||5),className:"w-14 h-10 text-center bg-surface2 border-border1",title:"Number of results"})]}),o.jsx(ce,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Xa,{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=die[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>p(g),className:`
|
|
663
|
+
]`})]})]})}function UZr({errors:e,maxErrors:t=5}){if(e.length===0)return null;const n=e.slice(0,t),r=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(Ne,{children:o.jsx(Ny,{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:n.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))}),r>0&&o.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",r," more error",r!==1?"s":""]})]})}function qZr({datasetId:e,open:t,onOpenChange:n,onSuccess:r}){const[s,a]=b.useState("upload"),[i,l]=b.useState(null),[c,u]=b.useState({current:0,total:0}),[d,f]=b.useState(null),[p,h]=b.useState(!1),{parseFile:m,isParsing:g,error:v}=QHr(),{batchInsertItems:x}=Ei(),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"),h(!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}),h(!1),a("complete")},[i,x,e]),_=b.useCallback(()=>{n(!1),r?.(),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)},[n,r,d]),O=b.useCallback(()=>{p||(n(!1),setTimeout(()=>{a("upload"),l(null),u({current:0,total:0}),f(null)},150))},[p,n]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return o.jsx(BZr,{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(UZr,{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(FZr,{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(Bt,{size:"lg"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return o.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[o.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),o.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&o.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return o.jsx(ce,{onClick:O,children:"Cancel"});case"preview":return o.jsxs(o.Fragment,{children:[o.jsx(ce,{onClick:()=>a("upload"),children:"Back"}),o.jsxs(ce,{variant:"primary",onClick:S,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return o.jsx(ce,{variant:"primary",onClick:_,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return o.jsx($r,{open:t,onOpenChange:O,children:o.jsxs(Ar,{className:"max-w-2xl max-h-[90vh]",children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:N[s]}),o.jsx(fa,{children:"Import dataset items from a JSON file."})]}),o.jsx(ts,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),o.jsx(rp,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function VZr({dataset:e,isLoading:t=!1,onEditClick:n,onDuplicateClick:r,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:l,className:c}){return o.jsxs(qn,{className:c,children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{isLoading:t,children:[o.jsx(Ya,{})," ",e?.name]}),o.jsx(qn.Description,{isLoading:t,children:e?.description}),o.jsxs(qn.Description,{isLoading:t,children:[o.jsxs(us,{children:[o.jsx(FE,{})," Created at ",e?.createdAt?an(new Date(e.createdAt),"MMM d, yyyy"):""]}),o.jsxs(us,{children:[o.jsx(Y0,{})," Latest version v",e?.version??""]})]})]}),o.jsx(qn.Column,{children:o.jsxs(ps,{children:[a?i?o.jsxs(nr,{children:[o.jsx(rr,{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(Kn,{children:"Add items to the dataset before running an experiment"})]}):a:l?i?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed",children:o.jsxs(ce,{disabled:!0,tabIndex:-1,children:[o.jsx(Fy,{}),"Run Experiment"]})})}),o.jsx(Kn,{children:"Add items to the dataset before running an experiment"})]}):o.jsxs(ce,{onClick:l,children:[o.jsx(Fy,{}),"Run Experiment"]}):null,o.jsxs(St,{children:[o.jsx(St.Trigger,{asChild:!0,children:o.jsx(ce,{size:"default","aria-label":"Dataset actions menu",children:o.jsx(KYe,{})})}),o.jsxs(St.Content,{align:"end",className:"w-48",children:[o.jsxs(St.Item,{onSelect:n,children:[o.jsx(ob,{})," Edit Dataset"]}),o.jsxs(St.Item,{onSelect:r,children:[o.jsx(Fu,{})," Duplicate Dataset"]}),o.jsxs(St.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[o.jsx(Vd,{})," Delete Dataset"]})]})]})]})})]})}const x2t=e=>{const t=Ze(),{data:n}=v$(e),r=n?.experiments;return Ot({queryKey:["dataset-review-items",e,r?.map(s=>s.id)],queryFn:async()=>!r||r.length===0?[]:(await Promise.all(r.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&&!!r&&r.length>0,refetchOnWindowFocus:!1})},HZr=e=>{const t=Ze(),{data:n}=v$(e),r=n?.experiments;return Ot({queryKey:["dataset-completed-items",e,r?.map(s=>s.id)],queryFn:async()=>!r||r.length===0?[]:(await Promise.all(r.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&&!!r&&r.length>0,refetchOnWindowFocus:!1})};function ZZr(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const n=JSON.stringify(e);return n.length>t?n.slice(0,t)+"...":n}catch{return String(e)}}const WZr=Y("bg-surface5 backdrop-blur-xl z-50 min-w-32 overflow-auto rounded-lg p-2 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95");function hQe({className:e,children:t,...n}){return o.jsx(rM,{children:o.jsx(mB,{className:Y(WZr,e),...n,children:t})})}function QZr({datasetId:e}){const t=Ze(),{data:n}=jv(e),{data:r,isLoading:s}=x2t(e),{data:a,isLoading:i}=HZr(e),{updateExperimentResult:l}=Ei(),[c,u]=b.useState(null),[d,f]=b.useState(null),[p,h]=b.useState(new Set),[m,g]=b.useState(!1),[v,x]=b.useState(!1),[w,S]=b.useState(!1),[_,O]=b.useState(""),[E,T]=b.useState(""),[j,N]=b.useState(""),[I,P]=b.useState([]),[R,B]=b.useState(!1),[M,L]=b.useState(null),U=M??r??[];b.useEffect(()=>{r&&M===null&&L(r)},[r]);const z=b.useMemo(()=>{const ye=new Set;if(n?.tags)for(const Ce of n.tags)ye.add(Ce);for(const Ce of U)for(const De of Ce.tags)ye.add(De);return[...ye].sort()},[n,U]),q=b.useCallback(ye=>{!n||!e||(n.tags??[]).includes(ye)},[n,e]),Z=b.useMemo(()=>d?d==="__untagged__"?U.filter(ye=>ye.tags.length===0):U.filter(ye=>ye.tags.includes(d)):U,[U,d]),D=b.useMemo(()=>{const ye=new Map;for(const Ce of U)for(const De of Ce.tags)ye.set(De,(ye.get(De)??0)+1);return[...ye.entries()].sort((Ce,De)=>De[1]-Ce[1])},[U]),G=b.useMemo(()=>U.filter(ye=>ye.tags.length===0).length,[U]),V=b.useMemo(()=>{let ye=0;return d&&ye++,m&&ye++,ye},[d,m]),$=b.useCallback((ye,Ce)=>{L(ut=>(ut??[]).map(jt=>jt.id===ye?{...jt,tags:Ce}:jt));const De=U.find(ut=>ut.id===ye);De?.experimentId&&De?.datasetId&&l.mutate({datasetId:De.datasetId,experimentId:De.experimentId,resultId:De.id,tags:Ce})},[U,l]),W=b.useCallback((ye,Ce)=>{const De=U.find(ut=>ut.id===ye);De?.traceId&&Ce!==void 0&&t.createFeedback({feedback:{traceId:De.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:Ce==="positive"?1:-1,experimentId:De.experimentId??void 0,sourceId:De.id}}).catch(()=>{}),L(ut=>(ut??[]).map(jt=>jt.id===ye?{...jt,rating:Ce}:jt))},[U,t]),Q=b.useCallback((ye,Ce)=>{const De=U.find(ut=>ut.id===ye);De?.traceId&&t.createFeedback({feedback:{traceId:De.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:Ce,comment:Ce,experimentId:De.experimentId??void 0,sourceId:De.id}}).catch(()=>{}),L(ut=>(ut??[]).map(jt=>jt.id===ye?{...jt,comment:Ce}:jt))},[U,t]),J=b.useCallback(ye=>{const Ce=U.find(De=>De.id===ye);L(De=>(De??[]).filter(ut=>ut.id!==ye)),h(De=>{const ut=new Set(De);return ut.delete(ye),ut}),c===ye&&u(null),Ce?.experimentId&&Ce?.datasetId&&l.mutate({datasetId:Ce.datasetId,experimentId:Ce.experimentId,resultId:Ce.id,status:null})},[U,l,c]),ae=b.useCallback(ye=>{const Ce=U.find(De=>De.id===ye);L(De=>(De??[]).filter(ut=>ut.id!==ye)),h(De=>{const ut=new Set(De);return ut.delete(ye),ut}),c===ye&&u(null),Ce?.experimentId&&Ce?.datasetId&&l.mutate({datasetId:Ce.datasetId,experimentId:Ce.experimentId,resultId:Ce.id,status:"complete"})},[U,l,c]),te=b.useMemo(()=>{const ye=m?a??[]:Z;return!m||!d?ye:d==="__untagged__"?ye.filter(Ce=>Ce.tags.length===0):ye.filter(Ce=>Ce.tags.includes(d))},[m,a,Z,d]),re=m?i:!1,ie=b.useMemo(()=>new Set(te.map(ye=>ye.id)),[te]),pe=b.useMemo(()=>[...p].filter(ye=>ie.has(ye)).length,[p,ie]),X=te.length>0&&pe===te.length,ne=pe>0&&!X,le=b.useCallback(ye=>{h(Ce=>{const De=new Set(Ce);return De.has(ye)?De.delete(ye):De.add(ye),De})},[]),ge=b.useCallback(()=>{h(X?new Set:new Set(te.map(ye=>ye.id)))},[X,te]),de=b.useCallback(ye=>{for(const Ce of p){const De=U.find(ut=>ut.id===Ce);De&&!De.tags.includes(ye)&&$(Ce,[...De.tags,ye])}},[U,p,$]),ue=b.useCallback(ye=>{for(const Ce of p){const De=U.find(ut=>ut.id===Ce);De&&De.tags.includes(ye)&&$(Ce,De.tags.filter(ut=>ut!==ye))}},[U,p,$]),be=b.useCallback(()=>{for(const ye of p)ae(ye);h(new Set)},[p,ae]),ke=b.useCallback(()=>{for(const ye of p)J(ye);h(new Set)},[p,J]),Ie=b.useCallback(()=>{O(""),S(!0)},[]),K=b.useCallback(async()=>{if(!(!E||!j)){x(!0),S(!1);try{const ye=U.filter(De=>p.has(De.id));if(ye.length===0){x(!1);return}const Ce=await t.clusterFailures({modelId:`${E}/${j}`,items:ye.map(De=>({id:De.id,input:De.input,output:De.output??void 0,error:typeof De.error=="string"?De.error:De.error?String(De.error):void 0,scores:De.scores,existingTags:De.tags.length>0?De.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:_||void 0});Ce.proposedTags&&Ce.proposedTags.length>0&&(P(Ce.proposedTags.map(De=>({...De,accepted:!0}))),B(!0))}catch(ye){console.error("Analysis failed:",ye)}finally{x(!1)}}},[E,j,U,p,t,z,_]),oe=b.useCallback(()=>{for(const ye of I){if(!ye.accepted)continue;const Ce=U.find(De=>De.id===ye.itemId);if(Ce){const De=[...new Set([...Ce.tags,...ye.tags])];$(Ce.id,De)}}B(!1)},[I,U,$]),we=b.useCallback(ye=>{u(Ce=>Ce===ye?null:ye)},[]),Pe=b.useMemo(()=>c?te.find(ye=>ye.id===c)??null:null,[c,te]),Le=b.useCallback(()=>{if(!c||te.length===0)return;const ye=te.findIndex(Ce=>Ce.id===c);ye<te.length-1&&u(te[ye+1].id)},[c,te]),ve=b.useCallback(()=>{if(!c||te.length===0)return;const ye=te.findIndex(Ce=>Ce.id===c);ye>0&&u(te[ye-1].id)},[c,te]),Ee=Pe?"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(Bt,{className:"w-6 h-6"})}):o.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o.jsx($r,{open:w,onOpenChange:S,children:o.jsxs(Ar,{children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:"Analyze Items"}),o.jsx(fa,{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(Ct,{className:"text-xs mb-1 block",children:"Provider"}),o.jsx(Tv,{value:E,onValueChange:T})]}),o.jsxs("div",{children:[o.jsx(Ct,{className:"text-xs mb-1 block",children:"Model"}),o.jsx(Nv,{llmId:E,value:j,onValueChange:N})]})]}),o.jsxs(me,{variant:"ui-xs",className:"text-neutral3",children:[p.size," item",p.size!==1?"s":""," will be analyzed"]}),o.jsxs("div",{children:[o.jsx(Ct,{className:"text-xs",children:"Instructions (optional)"}),o.jsx(Kc,{value:_,onChange:ye=>O(ye.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),o.jsxs(rp,{children:[o.jsx(ce,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),o.jsxs(ce,{onClick:K,disabled:!E||!j||v,children:[v?o.jsx(Bt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),o.jsx($r,{open:R,onOpenChange:B,children:o.jsxs(Ar,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:"Review Proposed Tags"}),o.jsxs(fa,{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 De=U.find(ut=>ut.id===ye.itemId);return o.jsx("div",{className:Y("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:ut=>P(jt=>jt.map((bn,Ve)=>Ve===Ce?{...bn,accepted:!!ut}:bn))}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate block",children:De?typeof De.input=="string"?De.input.slice(0,100):JSON.stringify(De.input).slice(0,100):ye.itemId}),o.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ye.tags.map((ut,jt)=>o.jsx(f2t,{tag:ut,onRename:bn=>P(Ve=>Ve.map((He,Re)=>Re===Ce?{...He,tags:He.tags.map((Qe,Fe)=>Fe===jt?bn:Qe)}:He)),onRemove:()=>P(bn=>bn.map((Ve,He)=>He===Ce?{...Ve,tags:Ve.tags.filter((Re,Qe)=>Qe!==jt)}:Ve))},`${ut}-${jt}`))}),ye.reason&&o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ye.reason})]})]})},ye.itemId)})}),o.jsxs(rp,{children:[o.jsx(ce,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),o.jsxs(ce,{onClick:oe,disabled:I.filter(ye=>ye.accepted).length===0,children:["Accept ",I.filter(ye=>ye.accepted).length," proposals"]})]})]})}),o.jsxs(Wf,{className:Pe?"grid-cols-[1fr_1fr]":"",children:[o.jsxs(Cn,{children:[o.jsxs(Cn.Toolbar,{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs(St,{children:[o.jsx(St.Trigger,{asChild:!0,children:o.jsxs(ce,{variant:"outline",size:"md",children:[o.jsx(JYe,{}),"Filter",V>0&&o.jsx("span",{className:Y("ml-0.5 inline-flex items-center justify-center rounded-full bg-accent1/50 text-neutral5 text-ui-sm w-5 h-5"),children:V})]})}),o.jsxs(St.Content,{align:"start",className:Y("min-w-48"),children:[o.jsxs(St.Sub,{children:[o.jsxs(St.SubTrigger,{children:["Status",m&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(hQe,{children:[o.jsx(St.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ye=>ye.preventDefault(),children:"Review Queue"}),o.jsx(St.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ye=>ye.preventDefault(),children:"Completed"})]})]}),o.jsxs(St.Sub,{children:[o.jsxs(St.SubTrigger,{children:["Tags",d&&o.jsx("span",{className:Y("ml-auto text-ui-sm text-accent1"),children:"1"})]}),o.jsxs(hQe,{children:[o.jsx(St.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ye=>ye.preventDefault(),children:"All"}),G>0&&o.jsx(St.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ye=>ye.preventDefault(),children:"Untagged"}),D.length>0&&o.jsx(St.Separator,{}),D.map(([ye])=>o.jsx(St.CheckboxItem,{checked:d===ye,onCheckedChange:()=>f(d===ye?null:ye),onSelect:Ce=>Ce.preventDefault(),children:ye},ye))]})]}),V>0&&o.jsxs(o.Fragment,{children:[o.jsx(St.Separator,{}),o.jsxs(St.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[o.jsx(Lr,{}),"Clear all filters"]})]})]})]}),V>0&&o.jsxs(ce,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[o.jsx(Lr,{}),"Reset"]})]}),!m&&p.size>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(d2t,{selectedCount:p.size,vocabulary:z,onApplyTag:de,onRemoveTag:ue,onNewTag:ye=>de(ye)}),o.jsxs(St,{children:[o.jsx(St.Trigger,{asChild:!0,children:o.jsxs(ce,{disabled:v,children:[v?o.jsx(Bt,{className:"w-4 h-4"}):o.jsx(Ne,{size:"sm",children:o.jsx(ws,{})}),"Actions"]})}),o.jsxs(St.Content,{align:"end",children:[o.jsxs(St.Item,{onSelect:be,children:[o.jsx(Ne,{size:"sm",children:o.jsx(h1,{})}),"Complete"]}),o.jsxs(St.Item,{onSelect:ke,children:[o.jsx(Ne,{size:"sm",children:o.jsx(Vd,{})}),"Remove"]}),o.jsx(St.Separator,{}),o.jsxs(St.Item,{onSelect:Ie,children:[o.jsx(Ne,{size:"sm",children:o.jsx(qE,{})}),"Analyze"]})]})]})]})]}),re?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Bt,{className:"w-6 h-6"})}):te.length===0?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"text-center px-8",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),o.jsx(me,{variant:"ui-xs",className:"text-neutral3 mt-2 block",children:m?"Items marked as complete will appear here for auditing.":"When experiment results are flagged for review, they will appear here."})]})}):o.jsxs(xe,{columns:Ee,children:[o.jsxs(xe.Top,{children:[!m&&o.jsx(xe.TopCell,{children:o.jsx(Di,{checked:X?!0:ne?"indeterminate":!1,onCheckedChange:()=>ge(),"aria-label":"Select all"})}),m&&o.jsx(xe.TopCell,{children:" "}),o.jsx(xe.TopCell,{children:"Input"}),o.jsx(xe.TopCell,{children:"Comment"}),o.jsx(xe.TopCell,{children:"Tags"}),!Pe&&o.jsx(xe.TopCell,{children:"Rating"}),!Pe&&o.jsx(xe.TopCell,{children:"Scores"})]}),o.jsx(xe.Rows,{children:te.map(ye=>{const Ce=ye.scores?Object.entries(ye.scores):[];return o.jsxs(xe.Row,{onClick:()=>we(ye.id),selected:c===ye.id,children:[o.jsx(xe.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:p.has(ye.id),onCheckedChange:()=>le(ye.id),onClick:De=>De.stopPropagation(),"aria-label":`Select item ${ye.id}`})}),o.jsx(xe.NameCell,{children:ZZr(ye.input,80)}),o.jsx(xe.Cell,{children:ye.comment?o.jsx(me,{variant:"ui-xs",className:"text-neutral3 truncate",children:ye.comment}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),o.jsx(xe.Cell,{children:ye.tags.length>0?o.jsx(me,{variant:"ui-xs",className:"text-neutral4 truncate",children:ye.tags.join(", ")}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!Pe&&o.jsxs(xe.Cell,{children:[ye.rating==="positive"&&o.jsx(Ne,{size:"sm",className:"text-positive1",children:o.jsx(Tpe,{})}),ye.rating==="negative"&&o.jsx(Ne,{size:"sm",className:"text-negative1",children:o.jsx(jpe,{})}),!ye.rating&&o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!Pe&&o.jsx(xe.Cell,{children:Ce.length>0?o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ne,{size:"sm",className:"text-neutral3",children:o.jsx(si,{})}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4 font-mono",children:Ce[0][1].toFixed(2)}),Ce.length>1&&o.jsxs(kt,{variant:"default",children:["+",Ce.length-1]})]}):o.jsx(me,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ye.id)})})]})]}),Pe&&o.jsx(u2t,{item:Pe,isCompleted:m,tagVocabulary:z,onRate:ye=>W(Pe.id,ye),onSetTags:ye=>{$(Pe.id,ye);for(const Ce of ye)z.includes(Ce)||q(Ce)},onComment:ye=>Q(Pe.id,ye),onRemove:()=>J(Pe.id),onComplete:m?void 0:()=>ae(Pe.id),onPrevious:ve,onNext:Le,onClose:()=>u(null)})]})]})}function GZr({datasetId:e,onExperimentClick:t,onEditClick:n,onDeleteClick:r,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:l,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=cn(),[p,h]=b.useState(u??"items"),m=Tt=>{h(Tt),d?.(Tt)},[g,v]=b.useState(!1),[x,w]=b.useState(!1),[S,_]=b.useState(!1),[O,E]=b.useState([]),[T,j]=b.useState(!1),[N,I]=b.useState([]),[P,R]=b.useState(!1),[B,M]=b.useState([]),[L,U]=b.useState(!1),[z,q]=b.useState(0),[Z,D]=b.useState(null),[G,V]=b.useState(""),[$]=z1n(G,300),[W,Q]=b.useState(null),ae=l!==void 0?l:W,{data:te,isLoading:re}=jv(e),{data:ie=[],total:pe,isLoading:X,setEndOfListElement:ne,isFetchingNextPage:le,hasNextPage:ge}=ij(e,$||void 0,ae),{data:de=[],total:ue,isLoading:be}=ij(e,void 0,ae),[ke,Ie]=b.useState({}),{data:K,isLoading:oe}=v$(e,void 0,ke),{data:we}=v$(e),{deleteItems:Pe}=Ei(),Le=K?.experiments??[],ve=we?.experiments??[],Ee=fZr({hasSearchQuery:!!$,filteredItemsLength:ie.length,unfilteredItemsTotal:ue,itemsTotal:pe}),{data:ye}=x2t(e),Ce=ye?.length??0,De=Tt=>{D(Tt)},ut=()=>{D(null)},jt=Tt=>{const un=Tt.isCurrent?null:Tt;c?c(un):Q(Tt.isCurrent?null:Tt.version)},bn=Tt=>{E(Tt),_(!0)},Ve=Tt=>{I(Tt),j(!0)},He=Tt=>{j(Tt),Tt||(I([]),q(un=>un+1))},Re=Tt=>{f(`/datasets/${e}/items?items=${Tt.join(",")}`)},Qe=Tt=>{f(`/datasets/${e}/versions?ids=${Tt.join(",")}`)},Fe=Tt=>{M(Tt),R(!0)},Ke=async()=>{await Pe.mutateAsync({datasetId:e,itemIds:B}),ze.success(`Deleted ${B.length} items`),R(!1),M([]),q(Tt=>Tt+1)},rt=Tt=>{_(!1),E([]),q(un=>un+1),i?.(Tt)},_t=Tt=>{_(Tt),Tt||(E([]),q(un=>un+1))};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsx("div",{className:Y("h-full w-full",_r.allSlow),children:o.jsxs("div",{className:Y("grid grid-rows-[auto_1fr] mx-auto h-full w-full m-auto",Z?"max-w-[120rem]":"max-w-[90rem]"),children:[o.jsx(VZr,{dataset:te,isLoading:re,onEditClick:n,onDuplicateClick:()=>U(!0),onDeleteClick:r,experimentTriggerSlot:a,disableExperimentTrigger:!be&&de.length===0,onExperimentClick:t}),o.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:o.jsxs(ed,{defaultTab:"items",value:p,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[o.jsxs(td,{children:[o.jsxs(Xr,{value:"items",children:["Items ",o.jsx(oi,{color:"gray",children:Ee})]}),o.jsxs(Xr,{value:"experiments",children:["Experiments",o.jsx(oi,{color:"gray",children:Le.length})]}),o.jsxs(Xr,{value:"review",children:["Review",Ce>0&&o.jsx(oi,{color:"orange",children:Ce})]})]}),o.jsx(Es,{value:"items",className:"grid overflow-auto mt-5",children:o.jsx(zZr,{datasetId:e,items:ie,isLoading:X,featuredItemId:Z,onItemSelect:De,onItemClose:ut,onAddClick:s??(()=>{}),onImportClick:()=>v(!0),onImportJsonClick:()=>w(!0),onBulkDeleteClick:Fe,onCreateDatasetClick:bn,onAddToDatasetClick:Ve,onCompareItemsClick:Re,datasetName:te?.name,clearSelectionTrigger:z,setEndOfListElement:ne,isFetchingNextPage:le,hasNextPage:ge,searchQuery:G,onSearchChange:V,activeDatasetVersion:ae,currentDatasetVersion:te?.version,onVersionSelect:jt,onCompareVersionsClick:Qe})}),o.jsx(Es,{value:"experiments",className:"grid overflow-auto mt-5",children:o.jsx(jZr,{experiments:Le,allExperiments:ve,isLoading:oe,datasetId:e,filters:ke,onFiltersChange:Ie})}),o.jsx(Es,{value:"review",className:"overflow-auto mt-0",children:o.jsx(QZr,{datasetId:e})})]})})]})})}),o.jsx(xZr,{datasetId:e,open:g,onOpenChange:v}),o.jsx(qZr,{datasetId:e,open:x,onOpenChange:w}),o.jsx(iZr,{open:S,onOpenChange:_t,items:O,onSuccess:rt}),o.jsx(oZr,{open:T,onOpenChange:He,items:N,currentDatasetId:e}),o.jsx(lZr,{open:L,onOpenChange:U,sourceDatasetId:e,sourceDatasetName:te?.name||"",sourceDatasetDescription:te?.description,onSuccess:i}),o.jsx(Ht,{open:P,onOpenChange:R,children:o.jsxs(Ht.Content,{children:[o.jsxs(Ht.Header,{children:[o.jsx(Ht.Title,{children:"Delete Items"}),o.jsxs(Ht.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),o.jsxs(Ht.Footer,{children:[o.jsx(Ht.Cancel,{children:"Cancel"}),o.jsx(Ht.Action,{onClick:Ke,children:Pe.isPending?"Deleting...":"Delete"})]})]})})]})}function YZr(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const n=JSON.parse(t[1]);if(n.field&&Array.isArray(n.errors))return{field:n.field,errors:n.errors}}catch{}return null}function mQe({field:e,errors:t}){return t.length?o.jsx("div",{className:"mt-2 space-y-1",children:t.map((n,r)=>o.jsxs("p",{className:"text-xs text-destructive",children:[o.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,n.path!=="/"?n.path:""]}),": ",n.message]},r))}):null}function XZr({datasetId:e,open:t,onOpenChange:n,onSuccess:r}){const[s,a]=b.useState("{}"),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(null),{addItem:p}=Ei(),h=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 _;if(c.trim())try{_=JSON.parse(c)}catch{ze.error("Expected Trajectory must be valid JSON");return}try{await p.mutateAsync({datasetId:e,input:w,groundTruth:S,expectedTrajectory:_}),ze.success("Item added successfully"),f(null),a("{}"),l(""),u(""),n(!1),r?.()}catch(O){const E=YZr(O);E?f(E):ze.error(`Failed to add item: ${O instanceof Error?O.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),n(!1)};return o.jsx($r,{open:t,onOpenChange:n,children:o.jsxs(Ar,{className:"max-w-lg",children:[o.jsx(Mr,{children:o.jsx(Ir,{children:"Add Item"})}),o.jsx(ts,{children:o.jsxs("form",{onSubmit:h,className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ct,{htmlFor:"item-input",children:"Input (JSON) *"}),o.jsx(fs,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&o.jsx(mQe,{field:"input",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ct,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),o.jsx(fs,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&o.jsx(mQe,{field:"groundTruth",errors:d.errors})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ct,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),o.jsx(fs,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),o.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[o.jsx(ce,{type:"button",onClick:v,children:"Cancel"}),o.jsx(ce,{type:"submit",variant:"primary",disabled:p.isPending,children:p.isPending?"Adding...":"Add Item"})]})]})})]})})}function KZr({selectedScorers:e,setSelectedScorers:t,disabled:n=!1,container:r}){const{data:s,isLoading:a}=ef(),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(Ct,{children:"Scorers (Optional)"}),o.jsx(vbt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:n||a,container:r})]})}const JZr=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function eWr({targetType:e,setTargetType:t,targetId:n,setTargetId:r,container:s}){const{data:a,isLoading:i}=Ov(),{data:l,isLoading:c}=vw(),{data:u,isLoading:d}=ef(),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})):[],p=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,h=g=>{t(g),r("")},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(Ct,{children:"Target Type"}),o.jsx(jc,{options:JZr,value:e,onValueChange:h,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&o.jsxs("div",{className:"grid gap-2",children:[o.jsx(Ct,{children:m}),o.jsx(jc,{options:f,value:n,onValueChange:r,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:p,container:s})]})]})}function tWr({datasetId:e,version:t,open:n,onOpenChange:r,onSuccess:s}){const a=b.useRef(null),[i,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState([]),{triggerExperiment:p}=Ei(),h=i&&c,m=p.isPending,g=async()=>{if(h)try{const x=await p.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});wm.success("Experiment triggered successfully"),r(!1),s?.(x.experimentId),l(""),u(""),f([])}catch(x){const w=x instanceof Error?x.message:"Failed to trigger experiment";wm.error(w)}},v=()=>{m||(r(!1),l(""),u(""),f([]))};return o.jsx($r,{open:n,onOpenChange:v,children:o.jsxs(Ar,{ref:a,children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:"Run Experiment"}),o.jsx(fa,{children:t?`Execute items from ${an(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),o.jsxs(ts,{className:"grid gap-6",children:[o.jsx(eWr,{targetType:i,setTargetType:l,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&o.jsx(KZr,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),o.jsxs(rp,{className:"px-6 pt-4",children:[o.jsx(ce,{onClick:v,disabled:m,children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:g,disabled:!h||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(Bt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const w2t=e=>{const t=Ze();return Ot({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},gQe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function nWr({result:e,scores:t,onPrevious:n,onNext:r,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:l}){const c=!!e?.error,u=lie(e?.input),d=lie(e?.output);return o.jsxs(o.Fragment,{children:[o.jsxs(Cn.Toolbar,{children:[o.jsx(eT,{onPrevious:n,onNext:r,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),o.jsxs(ps,{children:[o.jsxs(ce,{onClick:a,disabled:!e.traceId,children:[o.jsx(Epe,{}),"Show Trace"]}),o.jsx(ce,{onClick:s,"aria-label":"Close result details panel",children:o.jsx(Lr,{})})]})]}),o.jsxs(Cn.Content,{children:[o.jsx(qn,{withMargins:!1,children:o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(Fy,{})," ",e.id]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:[o.jsx(p0,{})," ",e.itemId]})})]})}),c&&o.jsx(dr,{variant:"destructive",title:"Error",children:o.jsx(dr.Message,{children:lie(e?.error&&typeof e.error=="object"?e.error.message:e?.error)})}),t&&t.length>0&&o.jsxs(Ft,{className:"grid-rows-[auto_auto] overflow-visible",children:[o.jsxs(Ft.Header,{columns:gQe,children:[o.jsx(Ft.HeaderCol,{children:"Scorer"}),o.jsx(Ft.HeaderCol,{children:"Score"})]}),o.jsx(Ft.Items,{children:t.map(f=>o.jsx(Ft.Row,{children:o.jsxs(Ft.RowButton,{item:{id:f.id},columns:gQe,isFeatured:l===f.id,onClick:i,children:[o.jsx(Ft.TextCell,{children:f.scorerId}),o.jsx(Ft.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(fj,{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(Gt.CodeSection,{title:"Input",icon:o.jsx(p0,{}),codeStr:u}),o.jsx(Gt.CodeSection,{title:"Output",icon:o.jsx(zf,{}),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(FE,{className:"w-4 h-4"})," Created"]}),o.jsx("p",{className:"text-sm text-neutral4",children:an(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function lie(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function rWr({span:e}){return e?o.jsxs(o.Fragment,{children:[o.jsx(Gt.CodeSection,{title:"Input",icon:o.jsx(h0,{}),codeStr:JSON.stringify(e.input||null,null,2)}),o.jsx(Gt.CodeSection,{title:"Output",icon:o.jsx(zf,{}),codeStr:JSON.stringify(e.output||null,null,2)}),o.jsx(Gt.CodeSection,{title:"Metadata",icon:o.jsx(hh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),o.jsx(Gt.CodeSection,{title:"Attributes",icon:o.jsx(hh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function sWr({traceId:e,spanId:t,onNext:n,onPrevious:r,onClose:s}){const{data:a}=K1(e,t),i=a?.span;return o.jsxs(o.Fragment,{children:[o.jsxs(Cn.Toolbar,{children:[o.jsx(eT,{onPrevious:r,onNext:n,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),o.jsx(ce,{onClick:s,"aria-label":"Close span details",children:o.jsx(Lr,{})})]}),o.jsxs(Cn.Content,{children:[o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(hh,{})," Span ",Zf(t)]})})}),o.jsx(rWr,{span:i})]})]})}const aWr=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),n=new Map,r=[];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};n.set(l.spanId,d)}),e.forEach(l=>{const c=n.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}r.push(c)}else{const u=n.get(l.parentSpanId);u?u.spans.push(c):r.push(c)}});const s=l=>l.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(r),i=l=>{l.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function S2t(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(n=>{t.push(n.id),t.push(...S2t(n))}),t}const vQe=["agent","workflow","model","mcp","tool","workspace","other"];function k2t(e){const t=e?.toLowerCase().split("_")[0],n={agent:{icon:o.jsx(Ma,{}),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(uo,{}),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(Og,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:o.jsx(Gl,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:o.jsx(co,{}),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(VU,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in n?n[t]:{typePrefix:"other"}}function iWr({isSelected:e,isFaded:t,isExpanded:n,toggleChildren:r,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:l}){return o.jsx("div",{className:Y("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:l&&l>0?o.jsxs("div",{className:"flex gap-1",children:[o.jsxs(yQe,{onClick:()=>r?.(),children:[i?a:l," ",n?i?o.jsx(qYe,{}):o.jsx(G0,{}):o.jsx(ws,{})]}),a>(l??0)&&!i&&o.jsxs(yQe,{onClick:()=>s?.(),children:[a," ",o.jsx(UYe,{})]})]}):null})}function yQe({onClick:e,children:t,className:n}){return o.jsx("button",{onClick:e,className:Y("h-full",n),children:o.jsx("div",{className:Y("flex items-center gap-[0.1rem] text-ui-sm text-neutral5 border border-border1 pl-2 pr-1 rounded-lg transition-all","hover:text-yellow-500","[&>svg]:shrink-0 [&>svg]:opacity-80 [&>svg]:w-4 [&>svg]:h-4 [&>svg]:transition-all"),children:t})})}function oWr({isLastChild:e,hasChildren:t=!1,expanded:n=!1}){return o.jsx("div",{className:Y("w-12 h-[2.8rem] relative opacity-100",'after:content-[""] after:absolute after:left-[-1px] after:top-0 after:bottom-0 after:w-0 after:border-l after:border-neutral3 after:border-dashed ','before:content-[""] before:absolute before:left-0 before:top-[50%] before:w-full before:h-0 before:border-b before:border-neutral3 before:border-dashed',"[&_svg]:transition-all","[&:hover_svg]:text-yellow-500 [&:hover_svg]:scale-[1.3] [&:hover_svg]:opacity-100",{"after:bottom-[50%]":e}),children:t&&o.jsx("span",{className:Y("flex absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%] items-center justify-center bg-surface2 p-1","[&>svg]:shrink-0 [&>svg]:opacity-60 [&>svg]:w-[0.8rem] [&>svg]:h-[0.8rem]"),children:n?o.jsx(ZYe,{}):o.jsx(HYe,{})})})}function lWr({span:e,spanUI:t,isFaded:n,depth:r=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:`${r*1.5}rem`},children:[!c&&o.jsx("button",{onClick:()=>d?.(),disabled:!l,className:Y({"cursor-default":!l,"cursor-pointer":l}),children:o.jsx(oWr,{isLastChild:i,hasChildren:!!l,expanded:u})}),o.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function _2t({span:e,depth:t=0,onSpanClick:n,selectedSpanId:r,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:l,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:p}){const h=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=S2t(e),v=g.length,x=t===0,w=k2t(e?.type),S=f?f.includes(e.id):!1,_=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(w?.typePrefix||""):!1)||_;b.useEffect(()=>{x&&p?.([e.id])},[x,e.id,p]),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,p,f]);const T=()=>{if(!(!p||!f))if(S){const I=[e.id,...g];p(f.filter(P=>!I.includes(P)))}else p([...f,e.id])},j=()=>{!p||!f||p([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return o.jsxs(o.Fragment,{children:[o.jsx(lWr,{span:e,spanUI:w,isFaded:E,depth:t,onSpanClick:n,selectedSpanId:r,isLastChild:s,hasChildren:h,isRootSpan:x,isExpanded:S,toggleChildren:T}),o.jsx(iWr,{isSelected:r===e.id,isFaded:E,isExpanded:S,toggleChildren:T,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:N,numOfChildren:m}),h&&S&&e.spans?.map((I,P,R)=>{const B=P===R.length-1;return o.jsx(_2t,{span:I,depth:t+1,onSpanClick:n,selectedSpanId:r,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:p,featuredSpanIds:d},I.id)})]})}function cWr({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:n,isLoading:r,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:r?o.jsxs("div",{className:Y("flex items-center text-ui-md gap-4 bg-surface3/50 rounded-md p-6 justify-center text-neutral3","[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"),children:[o.jsx(Bt,{})," Loading Trace Timeline ..."]}):o.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>o.jsx(_2t,{span:f,onSpanClick:t,selectedSpanId:n,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:l,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function uWr({spans:e=[],fadedTypes:t,onLegendClick:n,onLegendReset:r,onSearchPhraseChange:s,traceId:a}){const[i,l]=b.useState("");b.useEffect(()=>{l("")},[a]);const c=vQe.filter(p=>e.some(h=>h?.spanType?.startsWith(p)))||[],u=e.some(p=>!vQe.some(m=>p?.spanType?.startsWith(m))),d=p=>{n?.(p)};b.useEffect(()=>{f(i)},[i,s]);const f=Pct(p=>{s?.(p)},1e3);return o.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[o.jsx("div",{className:"flex",children:o.jsx(C0,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:p=>{l(p.target.value)},onReset:()=>l("")})}),o.jsxs(ps,{spacing:"close",children:[c.map(p=>{const h=k2t(p),m=t?.includes(p);return o.jsx(b.Fragment,{children:o.jsxs(ce,{onClick:()=>d(p),className:m?"opacity-40":"",style:{color:m?void 0:h?.color,backgroundColor:h?.bgColor},children:[h?.icon&&o.jsx(Ne,{children:h.icon}),h?.label]})},p)}),u&&o.jsxs(ce,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[o.jsx(Ne,{children:o.jsx(d8,{})}),"Other"]}),o.jsx(ce,{onClick:r,disabled:t?.length===0,children:o.jsx(Ne,{children:o.jsx(Lr,{})})})]})]})}function dWr({traceId:e,selectedSpanId:t,onSpanSelect:n,onClose:r}){const{data:s,isLoading:a}=w2t(e),i=s?.spans??[],[l,c]=b.useState(""),[u,d]=b.useState([]),[f,p]=b.useState([]),[h,m]=b.useState([]),g=b.useMemo(()=>aWr(i),[i]);b.useEffect(()=>{if(l.trim()===""){p([]);return}const S=l.toLowerCase(),_=i.filter(O=>O.name.toLowerCase().includes(S)).map(O=>O.spanId);p(_)},[l,i]),b.useEffect(()=>{c(""),d([]),p([]),m([])},[e]);const v=S=>{n?.(t===S?void 0:S)},x=S=>{d(_=>_.includes(S)?_.filter(O=>O!==S):[..._,S])},w=()=>{d([])};return o.jsxs(o.Fragment,{children:[o.jsx(Cn.Toolbar,{children:o.jsx(ce,{onClick:r,"aria-label":"Close trace panel",children:o.jsx(Lr,{})})}),o.jsxs(Cn.Content,{children:[o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(Jo,{})," Trace ",Zf(e)]})})}),o.jsx(uWr,{spans:i,fadedTypes:u,onLegendClick:x,onLegendReset:w,searchPhrase:l,onSearchPhraseChange:c,traceId:e}),o.jsx(cWr,{hierarchicalSpans:g,onSpanClick:v,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:h,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function fWr({results:e,isLoading:t,featuredResultId:n,onResultClick:r,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:l,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?o.jsxs(xe,{columns:d,children:[o.jsx(xe.Top,{children:s.map(f=>o.jsx(xe.TopCell,{children:f.label},f.name))}),o.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:o.jsx(Bt,{})})]}):e.length===0?o.jsxs(xe,{columns:d,children:[o.jsx(xe.Top,{children:s.map(f=>o.jsx(xe.TopCell,{children:f.label},f.name))}),o.jsx(xe.NoMatch,{message:"No results yet"})]}):o.jsxs(xe,{columns:d,children:[o.jsx(xe.Top,{children:s.map(f=>o.jsx(xe.TopCell,{children:f.label},f.name))}),o.jsxs(xe.Rows,{children:[e.map(f=>{const p=!!f.error,h=f.id===n;return o.jsxs(xe.Row,{onClick:()=>r(f.id),selected:h,children:[o.jsx(xe.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),o.jsx(xe.Cell,{children:o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:o.jsx("div",{className:Y("w-2 h-2 rounded-full",p?"bg-red-700":"bg-green-600")})})}),o.jsx(Kn,{children:p?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&o.jsx(xe.TextCell,{children:o.jsx("span",{className:"truncate block font-mono",children:hWr(pWr(f.input),200)})}),i?.map(m=>{const v=a?.[f.itemId]?.find(x=>x.scorerId===m);return o.jsx(xe.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(Bt,{})}),!u&&e.length>0&&o.jsx(me,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function pWr(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function hWr(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function mWr(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function gWr({score:e,onNext:t,onPrevious:n,onClose:r}){const s=mWr(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return o.jsxs(o.Fragment,{children:[o.jsxs(Cn.Toolbar,{children:[o.jsx(eT,{onPrevious:n,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),o.jsx(ce,{onClick:r,"aria-label":"Close score details",children:o.jsx(Lr,{})})]}),o.jsxs(Cn.Content,{children:[o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(si,{})," ",e.scorerId]})})}),o.jsxs(j0,{children:[o.jsx(Gt.CodeSection,{title:`Score: ${e.score}`,icon:o.jsx(si,{}),codeStr:e.reason||a,simplified:!0}),o.jsx(Gt.CodeSection,{title:"Input",icon:o.jsx(p0,{}),codeStr:JSON.stringify(e.input??null,null,2)}),o.jsx(Gt.CodeSection,{title:"Output",icon:o.jsx(zf,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&o.jsxs(o.Fragment,{children:[o.jsx(Gt.CodeSection,{title:"Preprocess Prompt",icon:o.jsx(Fc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),o.jsx(Gt.CodeSection,{title:"Analyze Prompt",icon:o.jsx(Fc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),o.jsx(Gt.CodeSection,{title:"Generate Score Prompt",icon:o.jsx(Fc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),o.jsx(Gt.CodeSection,{title:"Generate Reason Prompt",icon:o.jsx(Fc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const bQe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function vWr({scoresByItemId:e,experimentStatus:t}){const n=b.useMemo(()=>{if(!e)return[];const r={};for(const s of Object.values(e))for(const a of s)r[a.scorerId]||(r[a.scorerId]={sum:0,count:0}),r[a.scorerId].sum+=a.score,r[a.scorerId].count++;return Object.entries(r).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(n.length===0){const r=t==="running"||t==="pending",s=e!==void 0;let a,i;return r?(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(ki,{iconSlot:o.jsx(si,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return o.jsxs(Ft,{children:[o.jsxs(Ft.Header,{columns:bQe,children:[o.jsx(Ft.HeaderCol,{children:"Scorer"}),o.jsx(Ft.HeaderCol,{children:"Avg Score"}),o.jsx(Ft.HeaderCol,{children:"Items Scored"})]}),o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:n.map(({scorerId:r,avg:s,count:a})=>o.jsxs(Ft.Row,{columns:bQe,children:[o.jsx(Ft.TextCell,{children:r}),o.jsx(Ft.TextCell,{className:"font-mono",children:s.toFixed(3)}),o.jsx(Ft.TextCell,{className:"font-mono",children:a})]},r))})})]})}function O2t({experimentId:e,experimentStatus:t,results:n,isLoading:r,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[l,c]=b.useState(null),[u,d]=b.useState(null),[f,p]=b.useState(void 0),[h,m]=b.useState(null),g=n.find(z=>z.id===l)??null,{data:v}=t2t(e,t),x=b.useMemo(()=>{if(!v)return[];const z=new Set;for(const q of Object.values(v))for(const Z of q)z.add(Z.scorerId);return[...z].sort()},[v]),{data:w}=w2t(u),S=w?.spans??[],_=()=>{if(!f)return;const z=S.findIndex(q=>q.spanId===f);if(z>=0&&z<S.length-1)return()=>p(S[z+1].spanId)},O=()=>{if(!f)return;const z=S.findIndex(q=>q.spanId===f);if(z>0)return()=>p(S[z-1].spanId)},E=z=>{c(z),d(null),p(void 0),m(null)},T=z=>{E(z===l?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=n.findIndex(q=>q.id===g.id);if(z>=0&&z<n.length-1)return()=>E(n[z+1].id)},I=()=>{if(!g)return;const z=n.findIndex(q=>q.id===g.id);if(z>0)return()=>E(n[z-1].id)},P=g?v?.[g.itemId]:void 0,R=P?.find(z=>z.id===h)??null,B=z=>{m(z===h?null:z),d(null),p(void 0)},M=()=>{if(!h||!P)return;const z=P.findIndex(q=>q.id===h);if(z>=0&&z<P.length-1)return()=>m(P[z+1].id)},L=()=>{if(!h||!P)return;const z=P.findIndex(q=>q.id===h);if(z>0)return()=>m(P[z-1].id)},U=b.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...l?[]:x.map(z=>({name:z,label:z,size:"1fr"}))],[l,x]);return o.jsxs(ed,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[o.jsxs(td,{children:[o.jsx(Xr,{value:"summary",children:"Summary"}),o.jsx(Xr,{value:"results",children:"Results"})]}),o.jsx(Es,{value:"summary",className:"overflow-y-auto mt-5",children:o.jsx(vWr,{scoresByItemId:v,experimentStatus:t})}),o.jsx(Es,{value:"results",className:"grid overflow-hidden mt-5",children:o.jsxs(Wf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[o.jsx(Cn,{children:o.jsx(fWr,{results:n,isLoading:r,featuredResultId:l,onResultClick:T,columns:U,scoresByItemId:v,scorerIds:l?void 0:x,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&o.jsxs(AWn,{numOfColumns:1+(!u&&h?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&o.jsx(Cn,{withLeftSeparator:!0,children:o.jsx(nWr,{result:g,scores:P,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:B,featuredScoreId:h,onShowTrace:()=>{d(g.traceId??null),p(void 0),m(null)}})}),g&&!u&&R&&o.jsx(Cn,{withLeftSeparator:!0,children:o.jsx(gWr,{score:R,onNext:M(),onPrevious:L(),onClose:()=>m(null)})}),g&&u&&o.jsx(Cn,{withLeftSeparator:!0,children:o.jsx(dWr,{traceId:u,selectedSpanId:f,onSpanSelect:p,onClose:()=>{d(null),p(void 0)}})}),g&&u&&f&&o.jsx(Cn,{withLeftSeparator:!0,children:o.jsx(sWr,{traceId:u,spanId:f,onNext:_(),onPrevious:O(),onClose:()=>p(void 0)})})]})]})})]})}const yWr={pending:o.jsx(bk,{}),running:o.jsx(a6,{}),completed:o.jsx(ga,{}),failed:o.jsx(Lr,{})};function bWr({experiment:e,className:t}){const n=e.status,r=e.totalItems-e.succeededCount-e.failedCount;return o.jsxs("div",{className:Y("grid justify-items-end gap-3",t),children:[o.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[o.jsx("span",{className:Y("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":n==="completed","bg-red-700":n==="failed","bg-cyan-600":n==="running","bg-yellow-600":n==="pending"}),children:yWr[n]}),e.status]}),o.jsxs("div",{className:Y("flex items-center gap-3 text-neutral3 text-ui-md ","[&>span]:flex [&>span]:gap-1 [&>span]:items-center ","[&_b]:text-neutral4 [&_b]:font-semibold"),children:[o.jsxs("span",{children:["Total: ",o.jsx("b",{children:e.totalItems})]}),o.jsxs("span",{children:["Succeeded: ",o.jsx("b",{children:e.succeededCount})]}),o.jsxs("span",{children:["Failed: ",o.jsx("b",{children:e.failedCount})]}),(n==="pending"||n==="running")&&o.jsxs("span",{children:["Pending: ",o.jsx("b",{children:r})]})]})]})}function E2t({experimentId:e,experiment:t}){const{Link:n,paths:r}=cn(),{data:s}=Ov(),{data:a}=vw(),{data:i}=ef(),l=()=>{switch(t.targetType){case"agent":return r.agentLink(t.targetId);case"workflow":return r.workflowLink(t.targetId);case"scorer":return r.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(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(WYe,{}),e," ",e&&o.jsx(_a,{content:e})]}),o.jsxs(qn.Description,{children:[o.jsxs(us,{children:[o.jsx(FE,{})," Created at ",an(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&o.jsxs(us,{children:[o.jsx(FE,{})," Completed at ",an(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),o.jsxs(qn.Description,{children:[o.jsxs(us,{children:[o.jsx(M7t,{})," Target",o.jsx(n,{href:l(),children:c()})]}),t.agentVersion&&o.jsxs(us,{children:[o.jsx(p8,{})," Version",t.targetType==="agent"&&t.targetId?o.jsx(n,{href:`${r.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(_a,{content:t.agentVersion})]})]})]}),o.jsx(qn.Column,{children:o.jsx(bWr,{experiment:t})})]})}function Ske({delta:e}){const t=e>0?o.jsx(oi,{size:"small",color:"green",intensity:"muted",children:o.jsx(xpe,{})}):e<0?o.jsx(oi,{size:"small",color:"red",intensity:"muted",children:o.jsx(zYe,{})}):null;return o.jsxs("span",{className:Y("font-mono text-sm text-neutral4 min-w-20"),children:[o.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function j3(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function xWr({item:e,baselineId:t,contenderId:n,baselineVersion:r,contenderVersion:s,onPrevious:a,onNext:i,onClose:l}){const c=e.results[t],u=e.results[n],d=!!(c&&u),f=new Set;if(c)for(const h of Object.keys(c.scores))f.add(h);if(u)for(const h of Object.keys(u.scores))f.add(h);const p=[...f].sort();return o.jsxs(Cn,{withLeftSeparator:!0,children:[o.jsxs(Cn.Toolbar,{children:[o.jsx(eT,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),o.jsx(ps,{children:o.jsx(ce,{onClick:l,"aria-label":"Close comparison detail panel",children:o.jsx(Lr,{})})})]}),o.jsxs(Cn.Content,{className:"pb-6",children:[o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{size:"smaller",children:[o.jsx(p0,{})," ",e.itemId]})})}),d?o.jsx(o.Fragment,{children:o.jsxs(j0,{children:[p.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:p.map(h=>{const m=c?.scores[h]??null,g=u?.scores[h]??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:h}),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(Ske,{delta:v})]})]},h)})})]}),o.jsx(Gt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(oi,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:o.jsx(zf,{}),codeStr:j3(c?.output)}),o.jsx(Gt.CodeSection,{title:o.jsxs(o.Fragment,{children:[o.jsx(oi,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:o.jsx(zf,{}),codeStr:j3(u?.output)}),o.jsx(Gt.CodeSection,{title:"Item Input",icon:o.jsx(h0,{}),codeStr:j3(e.input)}),o.jsx(Gt.CodeSection,{title:"Item Ground Truth",icon:o.jsx(dXe,{}),codeStr:j3(e.groundTruth)})]})}):o.jsx(dr,{variant:"warning",title:"Comparison not available",children:o.jsx(dr.Message,{children:(()=>{const h=c?"Contender":"Baseline",m=c?s:r;return o.jsxs(o.Fragment,{children:["The ",h," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item."]})})()})})]})]})}function wWr({items:e,baselineId:t,contenderId:n,scorerIds:r,featuredItemId:s,columns:a,onItemClick:i}){return o.jsx(Cn,{children:o.jsxs(Ft,{children:[o.jsxs(Ft.Header,{columns:a,children:[o.jsx(Ft.HeaderCol,{children:"Item ID"}),!s&&r.map(l=>o.jsx(Ft.HeaderCol,{className:"flex justify-center",children:l},l))]}),o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:e.map(l=>{const c=l.results[t],u=l.results[n],d=!!(c&&u);return o.jsx(Ft.Row,{children:o.jsxs(Ft.RowButton,{item:{id:l.itemId},columns:a,isFeatured:s===l.itemId,onClick:i,children:[o.jsx(Ft.IdCell,{id:l.itemId,className:d?"":"text-neutral1"}),!s&&o.jsx(o.Fragment,{children:r.map(f=>{const p=c?.scores[f]??null,h=u?.scores[f]??null,m=p!=null&&h!=null?h-p:null;return o.jsx(Ft.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:[p?.toFixed(2)," → ",h?.toFixed(2)]}),o.jsx(Ske,{delta:m})]}):o.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},l.itemId)})})})]})})}const SWr={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 xQe({datasetId:e,experiment:t,type:n}){const{Link:r}=cn(),{label:s,color:a,customStyle:i}=SWr[n];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:[n==="contender"&&o.jsxs(oi,{size:"small",color:a,children:[s,o.jsx(YS,{})]}),o.jsx(ce,{as:r,href:`/datasets/${e}/experiments/${t.id}`,children:o.jsx("span",{className:"truncate min-w-0",children:t.id})}),n==="baseline"&&o.jsxs(oi,{size:"small",color:a,children:[o.jsx(Yf,{})," ",s]})]}),o.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[o.jsxs(us,{children:[o.jsx(dXe,{})," ",t.targetType," / ",t.targetId]}),o.jsxs(us,{children:[o.jsx(eXe,{})," v",t.datasetVersion??"—"]}),l&&o.jsxs(us,{children:[o.jsx(FYe,{})," ",an(l,"MMM d, yyyy HH:mm")]})]})]})}function kWr({datasetId:e,experimentIdA:t,experimentIdB:n,onSwap:r}){const[s,a]=b.useState(null),{data:i,isLoading:l,error:c}=LHr(e,t,n),{data:u}=K9(e,t),{data:d}=K9(e,n),f=u&&d&&u.datasetVersion!==d.datasetVersion,p=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]),h=b.useMemo(()=>{if(!i||p.length===0)return[];const T=i.baselineId,j=t===T?n:t;return p.map(N=>{let I=0,P=0,R=0,B=0;for(const z of i.items){const q=z.results[T]?.scores[N],Z=z.results[j]?.scores[N];q!=null&&(I+=q,R++),Z!=null&&(P+=Z,B++)}const M=R>0?I/R:null,L=B>0?P/B:null,U=M!=null&&L!=null?L-M:null;return{scorerId:N,avgA:M,avgB:L,delta:U}})},[i,p,t,n]),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?[]:p.map(T=>({name:T,label:T,size:"1fr"}))],[p,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)},_=()=>{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(Bt,{})});if(c)return o.jsx(dr,{variant:"warning",title:"Error loading comparison",children:o.jsx(dr.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 O=i.baselineId,E=t===O?n:t;return o.jsxs("div",{className:"grid gap-10",children:[u&&d&&o.jsxs("div",{className:Y("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[o.jsx(xQe,{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(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(ce,{onClick:r,children:"VS"})}),o.jsx(Kn,{children:"Switch the order"})]})})}),o.jsx(xQe,{datasetId:e,experiment:d,type:"contender"})]}),f&&o.jsx(dr,{variant:"warning",title:"Version mismatch",children:o.jsxs(dr.Message,{children:["These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})}),h.length>0&&o.jsxs(Ft,{children:[o.jsxs(Ft.Header,{columns:m,children:[o.jsx(Ft.HeaderCol,{children:"Scorer"}),o.jsx(Ft.HeaderCol,{className:"flex justify-center",children:o.jsxs(n4e,{children:[o.jsx(oi,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),o.jsx(oi,{color:"purple",size:"small",children:"Avg"})]})}),o.jsx(Ft.HeaderCol,{className:"flex justify-center",children:o.jsxs(n4e,{children:[o.jsx(oi,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),o.jsx(oi,{color:"cyan",size:"small",children:"Avg"})]})}),o.jsx(Ft.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:h.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>o.jsxs(Ft.Row,{columns:m,children:[o.jsx(Ft.TextCell,{children:T}),o.jsx(Ft.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),o.jsx(Ft.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),o.jsx(Ft.TextCell,{className:"flex justify-center",children:I!=null?o.jsx(Ske,{delta:I}):"-"})]},T))})})]}),o.jsxs(Wf,{className:Y({"grid-cols-[1fr_2fr]":!!v}),children:[o.jsx(wWr,{items:i.items,baselineId:O,contenderId:E,scorerIds:p,featuredItemId:s,columns:g,onItemClick:x}),!!v&&o.jsx(xWr,{item:v,baselineId:O,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:_(),onNext:S(),onClose:w})]})]})}function _Wr({datasetId:e,itemId:t,onVersionSelect:n,onCompareVersionsClick:r,activeVersion:s}){const{data:a,isLoading:i}=wke(e,t),[l,c]=b.useState(!1),[u,d]=b.useState(new Set),f=x=>{n?.(x)},p=x=>s==null?x.isLatest:x.datasetVersion===s,h=x=>{d(w=>{const S=new Set(w);if(S.has(x))S.delete(x);else if(S.size>=2){const[_]=Array.from(S);return new Set([_,x])}else S.add(x);return S})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},v=()=>{u.size===2&&r?.([...u])};return o.jsxs(Cn,{className:"min-w-56",children:[l?o.jsx(Cn.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:o.jsxs(ps,{children:[o.jsx(ce,{onClick:m,children:"Cancel"}),o.jsx(Kr,{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(Cn.Toolbar,{children:o.jsxs(ce,{onClick:g,className:"w-full",children:[o.jsx(Bg,{})," Compare Ver."]})})}),i?o.jsx(OWr,{}):o.jsxs(Ft,{children:[o.jsx(Ft.Header,{children:o.jsx(Ft.HeaderCol,{children:"Item Version History"})}),o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:a?.map(x=>{const w=String(x.datasetVersion),S=typeof x.updatedAt=="string"?new Date(x.updatedAt):x.updatedAt;return o.jsxs(Ft.Row,{isSelected:l&&u.has(w),children:[l&&o.jsx(Ft.LabelCell,{children:o.jsx(Di,{checked:u.has(w),disabled:x.isDeleted,onCheckedChange:()=>{},onClick:_=>{_.stopPropagation(),x.isDeleted||h(w)},"aria-label":`Select version ${x.datasetVersion}`})}),o.jsx(Ft.RowButton,{item:x,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:p(x),onClick:()=>f(x),className:"py-2",children:o.jsx(Ft.VersionCell,{version:x.datasetVersion,date:S,isLatest:x.isLatest,isDeleted:x.isDeleted})})]},String(x.datasetVersion))})})})]})]})}function OWr(){return o.jsxs(Ft,{children:[o.jsx(Ft.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Ft.HeaderCol,{children:"Item Version History"})}),o.jsx(Ft.Items,{children:Array.from({length:3}).map((e,t)=>o.jsx(Ft.Row,{children:o.jsx(Ft.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:o.jsx(Ft.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function EWr(e,t){if(t){const n=typeof t=="string"?new Date(t):t;return`v${e} ${an(n,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function CWr({datasetId:e,versionA:t,versionB:n,onVersionChange:r}){const{data:s}=bke(e),a=(s??[]).map(i=>({value:String(i.version),label:`${EWr(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return o.jsxs(Cn.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[o.jsx("div",{}),o.jsx(gl,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>r?.(i,n??"")}),o.jsx(gl,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:n??"",onValueChange:i=>r?.(t??"",i)}),o.jsx("div",{})]})}const jWr=[{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"}],TWr={added:{color:"blue",borderColor:"border-blue-900",icon:o.jsx(js,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:o.jsx(cXe,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:o.jsx(W7t,{}),tooltip:"Same in both versions"}};function cie({red:e=!1,tooltip:t}){return o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx(CUt,{className:Y("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&o.jsx(Kn,{children:t})]})}function cS({variant:e,version:t}){if(!e)return o.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:n,icon:r,tooltip:s}=TWr[e];return o.jsxs(nr,{children:[o.jsx(rr,{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(oi,{color:n,size:"small",children:r})]})}),o.jsx(Kn,{children:s})]})}function NWr(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function AWr({datasetId:e,versionA:t,versionB:n,allItems:r,itemsAMap:s,itemsBMap:a}){const{Link:i}=cn(),l=t>n;return o.jsx(Ft,{children:o.jsx(Ft.Scroller,{children:o.jsx(Ft.Items,{children:r.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=NWr(u,d);return o.jsxs(Ft.Row,{columns:jWr,children:[o.jsx(Ft.IdCell,{id:c,isShortened:!1}),f!=="same"?o.jsxs(o.Fragment,{children:[u?.datasetVersion?o.jsx(Ft.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&l?o.jsx(cS,{variant:"added",version:u.datasetVersion}):f==="changed"&&l?o.jsx(cS,{variant:"changed",version:u.datasetVersion}):o.jsx(cS,{version:u.datasetVersion})}):o.jsx(Ft.Cell,{className:"justify-center flex items-center",children:o.jsx(cie,{red:l,tooltip:l?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?o.jsx(Ft.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!l?o.jsx(cS,{variant:"added",version:d.datasetVersion}):f==="changed"&&!l?o.jsx(cS,{variant:"changed",version:d.datasetVersion}):o.jsx(cS,{version:d.datasetVersion})}):o.jsx(Ft.Cell,{className:"justify-center flex items-center",children:o.jsx(cie,{red:!l,tooltip:l?"Not present in this version":"Deleted in this version"})})]}):o.jsx(Ft.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:o.jsx(cS,{variant:"same",version:d?.datasetVersion})}),f==="changed"?o.jsx(Ft.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):o.jsx(Ft.Cell,{children:o.jsx(cie,{tooltip:o.jsxs(o.Fragment,{children:["Comparing is available",o.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const wQe={needsReview:"#facc15",complete:"#22c55e"},IWr=[{label:"Needs Review",color:wQe.needsReview},{label:"Reviewed",color:wQe.complete}];function RWr({reviewSummary:e,experiments:t,datasets:n,isLoading:r,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(n)for(const m of n)d.set(m.id,m.name);let f=0,p=0;const h=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;p+=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);h.push({name:w,values:[m.needsReview,m.complete]})}return{data:h,maxVal:f,totalInPipeline:p}},[e,t,n]),c=a.length>0;return o.jsxs(Jt,{children:[o.jsxs(Jt.TopBar,{children:[o.jsx(Jt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&o.jsx(Jt.Summary,{value:String(l),label:"Items in pipeline"})]}),r?o.jsx(Jt.Loading,{}):s?o.jsx(Jt.Error,{message:"Failed to load review data"}):o.jsx(Jt.Content,{children:c?o.jsx(EC,{data:a,segments:IWr,maxVal:i,fmt:u=>String(u)}):o.jsx(Jt.NoData,{message:"No items have been sent to review yet"})})]})}function kke(){const e=Ze();return Ot({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function C2t(e){const t=new Map;if(!e?.counts)return t;for(const n of e.counts)t.set(n.experimentId,{needsReview:n.needsReview,complete:n.complete,total:n.total});return t}function PWr(e,t){const n=new Map,r=C2t(e);if(!r.size||!t)return n;for(const s of t){const a=r.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const l=n.get(s.datasetId)??{needsReview:0,complete:0};l.needsReview+=a.needsReview,l.complete+=a.complete,n.set(s.datasetId,l)}return n}function $Wr(e){return e?.counts?e.counts.reduce((t,n)=>({needsReview:t.needsReview+n.needsReview,complete:t.complete+n.complete,inPipeline:t.inPipeline+n.needsReview+n.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const MWr=10;function DWr(){const[e,t]=b.useState(!1),[n,r]=b.useState(""),[s,a]=b.useState("all"),[i,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState(0),{data:p,isLoading:h,error:m}=$h({page:d,perPage:MWr}),{data:g,isLoading:v,error:x}=nV(),{data:w}=kke(),S=b.useMemo(()=>p?.datasets??[],[p?.datasets]),_=p?.pagination?.hasMore??!1,O=b.useMemo(()=>g?.experiments??[],[g?.experiments]),E=b.useMemo(()=>nZr(S),[S]),T=b.useMemo(()=>PWr(w,O),[w,O]),j=h||v,N=m||x,I=()=>t(!0),P=b.useCallback(()=>f(Z=>Z+1),[]),R=b.useCallback(()=>f(Z=>Math.max(0,Z-1)),[]),B=b.useCallback(Z=>{r(Z),f(0)},[]),M=b.useCallback(Z=>{a(Z),f(0)},[]),L=b.useCallback(Z=>{l(Z),f(0)},[]),U=b.useCallback(Z=>{u(Z),f(0)},[]);if(N&&Fs(N))return o.jsx(ir,{title:"Datasets",icon:o.jsx(Ya,{}),children:o.jsx(ca,{})});if(N&&$s(N))return o.jsx(ir,{title:"Datasets",icon:o.jsx(Ya,{}),children:o.jsx(Js,{resource:"datasets"})});if(N)return o.jsx(ir,{title:"Datasets",icon:o.jsx(Ya,{}),children:o.jsx(nc,{title:"Failed to load datasets",message:N.message})});if(S.length===0&&!j&&d===0)return o.jsxs(o.Fragment,{children:[o.jsx(ir,{title:"Datasets",icon:o.jsx(Ya,{}),children:o.jsx(rZr,{onCreateClick:I})}),o.jsx(Yfe,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||n!=="",q=()=>{r(""),a("all"),l("all"),u("all"),f(0)};return o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:j,children:[o.jsx(Ya,{})," Datasets"]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Kr,{onClick:I,tooltipContent:"Create a dataset",children:o.jsx(js,{})}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/evals/datasets/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Datasets documentation",children:o.jsx(po,{})})]})]}),o.jsx(aZr,{search:n,onSearchChange:B,targetFilter:s,onTargetFilterChange:M,experimentFilter:i,onExperimentFilterChange:L,tagFilter:c,onTagFilterChange:U,tagOptions:E,onReset:q,hasActiveFilters:z})]}),o.jsx(JHr,{datasets:S,experiments:O,reviewByDataset:T,isLoading:j,search:n,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:_,onNextPage:P,onPrevPage:R}),o.jsx(Yfe,{open:e,onOpenChange:t})]})}const LWr=new Set(["items","experiments","review"]);function zWr(){const{datasetId:e}=ya(),t=Yu(),[n,r]=go(),s=n.get("tab"),a=s&&LWr.has(s)?s:"items",i=E=>{r(E==="items"?{}:{tab:E},{replace:!0})},[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,p]=b.useState(!1),[h,m]=b.useState(!1),[g,v]=b.useState(null),{data:x,error:w}=jv(e??"");if(!e)return o.jsx(Xn,{children:o.jsx(sp,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(w&&Fs(w))return o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})});if(w&&$s(w))return o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})});const S=E=>{t(`/datasets/${e}/experiments/${E}`)},_=()=>{t("/datasets")},O=E=>{v(E?.version??null)};return o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(dZr,{value:e,variant:"ghost"})})]})}),o.jsxs(sp,{className:"content-stretch",children:[o.jsx(GZr,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>p(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:O,initialTab:a,onTabChange:i,experimentTriggerSlot:o.jsxs(ce,{variant:"primary",onClick:()=>c(!0),children:[o.jsx(Fy,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),o.jsx(tWr,{datasetId:e,version:g??void 0,open:l,onOpenChange:c,onSuccess:S}),o.jsx(XZr,{datasetId:e,open:u,onOpenChange:d}),x&&o.jsx(cZr,{open:f,onOpenChange:p,dataset:{id:x.id,name:x.name,description:x?.description||"",inputSchema:x.inputSchema,groundTruthSchema:x.groundTruthSchema}}),x&&o.jsx(uZr,{open:h,onOpenChange:m,datasetId:x.id,datasetName:x.name,onSuccess:_})]})]})}function FWr(){const{datasetId:e,experimentId:t}=ya(),{data:n}=jv(e??""),{data:r,isLoading:s,error:a}=K9(e,t),{data:i,isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=tV({datasetId:e,experimentId:t,experimentStatus:r?.status});return!e||!t?null:s?o.jsx(Xn,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Bt,{})})}):a&&Fs(a)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):a&&$s(a)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):a||!r?o.jsx(Xn,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:n?.name}),o.jsx(Fn,{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(E2t,{experimentId:t,experiment:r}),o.jsx(O2t,{experimentId:t,experimentStatus:r?.status,results:i??[],isLoading:l,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function BWr(){const{datasetId:e}=ya(),[t,n]=go(),{data:r,error:s}=jv(e??""),a=t.get("baseline")??"",i=t.get("contender")??"";return s&&Fs(s)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):s&&$s(s)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):!e||!a||!i?o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsxs(Fn,{isCurrent:!0,as:"span",children:[o.jsx(Ne,{children:o.jsx(Bg,{})}),"Compare Experiments"]})]})}),o.jsx(sp,{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(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:r?.name??e?.slice(0,8)}),o.jsxs(Fn,{isCurrent:!0,as:"span",children:[o.jsx(Ne,{children:o.jsx(Bg,{})}),"Experiments Comparison"]})]})}),o.jsx(sp,{children:o.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[o.jsxs(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(Bg,{})," Dataset Experiments Comparison"]}),o.jsxs(qn.Description,{children:["Comparing"," ",o.jsx(ln,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",o.jsx(ln,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),o.jsx(qn.Column,{children:o.jsxs(ce,{as:ln,to:`/datasets/${e}`,children:[o.jsx(Yf,{}),"Back to Dataset"]})})]}),o.jsx(kWr,{datasetId:e,experimentIdA:a,experimentIdB:i,onSwap:()=>{n({baseline:i,contender:a})}})]})})]})}function UWr(){const{datasetId:e,itemId:t}=ya(),{Link:n}=cn(),r=Yu(),{data:s,isLoading:a,error:i}=wke(e??"",t??""),{updateItem:l,deleteItem:c}=Ei(),{data:u}=jv(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[p,h]=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),[_,O]=b.useState(m.groundTruth),[E,T]=b.useState(m.metadata),[j,N]=b.useState(g);g!==j&&(N(g),S(m.input),O(m.groundTruth),T(m.metadata));const[I,P]=b.useState(!1),R=V=>{h(f?V:V.isLatest?null:V)},B=()=>{h(null)},M=!f&&p!=null,L=()=>{M||x(!0)},U=()=>{M||P(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(w)}catch{ze.error("Input must be valid JSON");return}let $;if(_.trim())try{$=JSON.parse(_)}catch{ze.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{ze.error("Metadata must be valid JSON");return}try{await l.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:$,metadata:W}),ze.success("Item updated successfully"),x(!1)}catch(Q){ze.error(`Failed to update item: ${Q instanceof Error?Q.message:"Unknown error"}`)}},q=()=>{d&&(S(JSON.stringify(d.input,null,2)),O(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},Z=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),ze.success("Item deleted successfully"),P(!1),r(`/datasets/${e}`)}catch(V){ze.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},D=p??d,G=D?{id:t??"",datasetId:e??"",datasetVersion:D.datasetVersion,input:D.input,groundTruth:D.groundTruth,metadata:D.metadata,createdAt:D.createdAt,updatedAt:D.updatedAt}:null;return i&&Fs(i)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):i&&$s(i)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?o.jsx(Xn,{children:o.jsx(sp,{children:o.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):o.jsxs(o.Fragment,{children:[o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:u?.name}),o.jsx(Fn,{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(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(p0,{}),t," ",o.jsx(_a,{content:t})]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:["Item of ",o.jsx(Ya,{})," ",u?.name]})}),o.jsxs(qn.Description,{children:[o.jsxs(us,{children:[o.jsx(FE,{})," Created at"," ",d?.createdAt?an(new Date(d.createdAt),"MMM d, yyyy"):""]}),o.jsxs(us,{children:[o.jsx(Y0,{})," Latest version v",d?.datasetVersion??""]})]})]}),o.jsx(qn.Column,{children:!v&&!f&&o.jsxs(ps,{children:[o.jsxs(ce,{onClick:L,disabled:M,title:M?"Return to latest version to edit":void 0,children:[o.jsx(cXe,{})," Edit"]}),o.jsxs(ce,{onClick:U,disabled:M,title:M?"Return to latest version to delete":void 0,children:[o.jsx(Vd,{})," Delete"]})]})})]}),o.jsxs(Wf,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[o.jsxs(Cn,{withRightSeparator:!v,children:[f&&d&&o.jsx(dr,{variant:"destructive",title:"Item deleted",children:o.jsxs(dr.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&M&&p&&o.jsx(dr,{variant:"warning",title:"Previous version",action:o.jsxs(dr.Button,{onClick:B,children:[o.jsx(_S,{})," Return to the latest version"]}),children:o.jsxs(dr.Message,{children:["Viewing version v",p.datasetVersion]})}),v?o.jsx(y2t,{inputValue:w,setInputValue:S,groundTruthValue:_,setGroundTruthValue:O,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:q,isSaving:l.isPending}):G?o.jsx(rV,{item:G,Link:n}):o.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&o.jsx(Cn,{children:o.jsx(_Wr,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:R,onCompareVersionsClick:V=>{r(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})]}),o.jsx(Ht,{open:I,onOpenChange:P,children:o.jsxs(Ht.Content,{children:[o.jsxs(Ht.Header,{children:[o.jsx(Ht.Title,{children:"Delete Item"}),o.jsx(Ht.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),o.jsxs(Ht.Footer,{children:[o.jsx(Ht.Cancel,{children:"Cancel"}),o.jsx(Ht.Action,{onClick:Z,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function SQe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function qWr(){const{datasetId:e}=ya(),[t,n]=go(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=jv(e??""),{Link:i}=cn(),[l,c]=b.useState(!1),{data:u}=Wfe(e??"",r[0]??""),{data:d}=Wfe(e??"",r[1]??"");return a&&Fs(a)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):a&&$s(a)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):!e||r.length<2?o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),o.jsx(sp,{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(Xn,{children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Items"})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:`/datasets/${e}`,variant:"outline",children:[o.jsx(Ne,{children:o.jsx(Yf,{})}),"Back to Dataset"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":l}),children:[o.jsxs(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(Bg,{}),"Compare Dataset Items"]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:["Comparing ",r.length," items of"," ",o.jsx(ln,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),o.jsx(qn.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:ln,to:`/datasets/${e}`,children:[o.jsx(Yf,{}),"Back to Dataset"]}),o.jsx(ce,{variant:"primary",onClick:()=>c(f=>!f),children:l?o.jsxs(o.Fragment,{children:[o.jsx(XYe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(z7t,{})," Diff View"]})})]})})]}),o.jsx(Wf,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>o.jsxs(b.Fragment,{children:[o.jsx(VWr,{datasetId:e,itemId:f,Link:i,idx:p,itemIds:r,showContent:!l,onItemChange:h=>{const m=[...r];m[p]=h,n({items:m.join(",")})}}),p==0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),l&&u&&d&&o.jsx(bxt,{codeA:SQe(u),codeB:SQe(d)})]})})]})}function VWr({datasetId:e,itemId:t,Link:n,idx:r,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:l,isLoading:c}=Wfe(e,t),{data:u}=ij(e),d=new Set(s.filter((p,h)=>h!==r)),f=(u??[]).map(p=>({value:p.id,label:p.id,disabled:d.has(p.id)}));return o.jsxs(Cn,{children:[o.jsxs(Cn.Toolbar,{className:"flex gap-4",children:[o.jsx(Oxe,{label:"Item",name:`compare-item-${r}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),o.jsxs(ce,{as:n,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Y0,{}),"Versions"]})]}),i&&o.jsx(Cn.Content,{children:c?o.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):l?o.jsxs(o.Fragment,{children:[o.jsx(b2t,{item:l}),o.jsx(rV,{item:l,Link:n})]}):o.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function kQe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function HWr(){const{datasetId:e,itemId:t}=ya(),[n,r]=go(),[s,a]=b.useState(!1),i=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:l,error:c}=jv(e??""),{Link:u}=cn(),{data:d}=wke(e??"",t??""),{data:f}=Kfe(e??"",t??"",i[0]??0,l?.version),{data:p}=Kfe(e??"",t??"",i[1]??0,l?.version);return c&&Fs(c)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):c&&$s(c)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):!e||!t||i.length<2?o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(sp,{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(Xn,{children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:l?.name}),o.jsx(Fn,{as:ln,to:`/datasets/${e}/items/${t}`,children:"Item"}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[o.jsx(Ne,{children:o.jsx(Yf,{})}),"Back to Item"]})})]}),o.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:o.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[o.jsxs(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(Bg,{}),"Compare Dataset Item Versions"]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:["Comparing ",i.length," versions of"," ",o.jsx(ln,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),o.jsx(qn.Column,{children:o.jsxs(ps,{children:[o.jsxs(ce,{as:ln,to:`/datasets/${e}/items/${t}`,children:[o.jsx(Yf,{}),"Back to Item"]}),o.jsx(ce,{variant:"primary",onClick:()=>a(h=>!h),children:s?o.jsxs(o.Fragment,{children:[o.jsx(XYe,{})," Default View"]}):o.jsxs(o.Fragment,{children:[o.jsx(Sqt,{})," Diff View"]})})]})})]}),o.jsx(Wf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((h,m)=>o.jsxs(b.Fragment,{children:[o.jsx(ZWr,{datasetId:e,itemId:t,datasetVersion:h,latestVersion:l?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const v=[...i];v[m]=g,r({ids:v.join(",")})}}),m===0&&o.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},h))}),s&&f&&p&&o.jsx(bxt,{codeA:kQe(f),codeB:kQe(p)})]})})]})}function ZWr({datasetId:e,itemId:t,datasetVersion:n,latestVersion:r,allVersions:s,versionNumbers:a,Link:i,idx:l,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Kfe(e,t,n,r),p=new Set(a.filter((g,v)=>v!==l)),h=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]})," - ",an(v,"MMM d, yyyy h:mm a"),g.isLatest?o.jsx(oi,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:p.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(Cn,{children:[o.jsxs(Cn.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[o.jsx(Y0,{className:"w-6 h-6 opacity-50"}),o.jsx(Oxe,{label:"Version",name:`compare-version-${l}`,value:String(n),onValueChange:g=>u(Number(g)),options:h,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&o.jsx(Cn.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 ",n," not found"]}):o.jsx(rV,{item:m,Link:i})})]})}function WWr(){const{datasetId:e}=ya(),[t]=go(),n=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],r=Yu(),{data:s,error:a}=jv(e??""),i=ij(e??"",void 0,n[0]??null),l=ij(e??"",void 0,n[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]),p=b.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&Fs(a))return o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})});if(a&&$s(a))return o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})});if(!e||n.length<2)return o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),o.jsx(sp,{children:o.jsx("div",{className:"text-neutral4 text-center py-8",children:o.jsx("p",{children:"Select at least two versions to compare."})})})]});const h=(g,v,x)=>{r(`/datasets/${e}/items/${g}/versions?ids=${v?.datasetVersion??""},${x?.datasetVersion??""}`)},m=(g,v)=>{r(`/datasets/${e}/versions?ids=${g},${v}`,{replace:!0})};return o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/datasets",children:[o.jsx(Ne,{children:o.jsx(Ya,{})}),"Datasets"]}),o.jsx(Fn,{as:ln,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),o.jsxs(Fn,{isCurrent:!0,as:"span",children:[o.jsx(Ne,{children:o.jsx(aje,{})}),"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(qn,{children:[o.jsxs(qn.Column,{children:[o.jsxs(qn.Title,{children:[o.jsx(aje,{})," Compare Dataset Versions"]}),o.jsx(qn.Description,{children:o.jsxs(us,{children:[o.jsx(Y0,{})," Comparing ",n.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),o.jsx(qn.Column,{children:o.jsxs(ce,{as:ln,to:`/datasets/${e}`,children:[o.jsx(Yf,{}),"Back to Dataset"]})})]}),o.jsx(Wf,{children:o.jsxs(Cn,{children:[o.jsx(CWr,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:m}),o.jsx(AWr,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})]})}function QWr(e){if(!e||e.length<2)return null;const t=[...e].sort((i,l)=>new Date(i.createdAt).getTime()-new Date(l.createdAt).getTime()),n=Math.floor(t.length/2),r=n,s=t.length-n;if(r===0)return null;const a=(s-r)/r*100;return{changePct:Math.round(a*10)/10,prevValue:String(r)}}function GWr({scorers:e,datasets:t,experiments:n,avgScore:r,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:l,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,p=t?.length,h=n?.length,m=r!=null&&s!=null&&s!==0?{changePct:Math.round((r-s)/s*100*10)/10,prevValue:String(s)}:null,g=QWr(n);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,{}):p!=null?o.jsxs(o.Fragment,{children:[o.jsx(Fr.Value,{children:String(p)}),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,{}):r!=null?o.jsxs(o.Fragment,{children:[o.jsx(Fr.Value,{children:String(r)}),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,{}):h!=null?o.jsxs(o.Fragment,{children:[o.jsx(Fr.Value,{children:String(h)}),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 YWr=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],_Qe="auto 1fr auto auto auto auto auto auto auto";function XWr(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const KWr={completed:"success",running:"warning",failed:"error",pending:"neutral"};function JWr({experiments:e,datasets:t,reviewByExperiment:n,isLoading:r,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:l,Link:c}=cn(),u=b.useMemo(()=>{const p=new Map;return t?.forEach(h=>p.set(h.id,h.name)),p},[t]),d=b.useMemo(()=>[...e].sort((p,h)=>{const m=p.createdAt?new Date(p.createdAt).getTime():0;return(h.createdAt?new Date(h.createdAt).getTime():0)-m}),[e]),f=b.useMemo(()=>{const p=s.toLowerCase();return d.filter(h=>{const m=h.datasetId?u.get(h.datasetId)??"":"",g=!p||h.id.toLowerCase().includes(p)||m.toLowerCase().includes(p)||(h.targetId??"").toLowerCase().includes(p),v=a==="all"||h.status===a,x=i==="all"||h.datasetId===i;return g&&v&&x})},[d,s,u,a,i]);return r?o.jsx(Md,{columns:_Qe}):o.jsxs(xe,{columns:_Qe,children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Experiment"}),o.jsx(xe.TopCell,{children:"Dataset"}),o.jsx(xe.TopCell,{children:"Target"}),o.jsx(xe.TopCell,{children:"Status"}),o.jsx(xe.TopCell,{className:"text-center",children:"Items"}),o.jsx(xe.TopCell,{className:"text-center",children:"Succeeded"}),o.jsx(xe.TopCell,{className:"text-center",children:"Failed"}),o.jsx(xe.TopCell,{className:"text-center",children:"Review"}),o.jsx(xe.TopCell,{children:"Date"})]}),f.map(p=>{const h=p.datasetId?u.get(p.datasetId)??p.datasetId.slice(0,8):"—",m=p.status??"pending",g=p.succeededCount??0,v=p.failedCount??0,x=p.totalItems??0,w=x>0?Math.round(g/x*100):0;return o.jsxs(xe.RowLink,{to:l.experimentLink(p.id),LinkComponent:c,children:[o.jsx(xe.NameCell,{className:"font-mono",children:p.id.slice(0,8)}),o.jsx(xe.TextCell,{children:h}),o.jsx(xe.Cell,{children:o.jsxs("span",{className:"truncate",children:[p.targetType," ",p.targetId]})}),o.jsx(xe.Cell,{children:o.jsx(X1,{variant:KWr[m]??"neutral",withDot:!0,children:m})}),o.jsx(xe.TextCell,{className:"text-center",children:x}),o.jsx(xe.TextCell,{className:"text-center",children:o.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",w,"%)"]})}),o.jsx(xe.TextCell,{className:"text-center",children:o.jsx("span",{className:v>0?"text-accent2":"",children:v})}),o.jsx(xe.Cell,{className:"text-center",children:(()=>{const S=n?.get(p.id);if(!S)return o.jsx("span",{className:"text-neutral2",children:"—"});const _=S.needsReview+S.complete;return _===0?o.jsx("span",{className:"text-neutral2",children:"—"}):S.needsReview>0?o.jsxs(kt,{variant:"warning",children:[S.needsReview," pending"]}):o.jsxs(kt,{variant:"success",children:[S.complete,"/",_," reviewed"]})})()}),o.jsx(xe.TextCell,{children:XWr(p.createdAt)})]},p.id)})]})}function eQr(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const T3={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},tQr=[{label:"Completed",color:T3.completed},{label:"Running",color:T3.running},{label:"Pending",color:T3.pending},{label:"Failed",color:T3.failed}];function nQr({experiments:e,datasets:t,isLoading:n,isError:r}){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 p=f.datasetId??"unknown";c.has(p)||c.set(p,{completed:0,running:0,pending:0,failed:0});const h=c.get(p),m=f.status;m in h&&h[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,p])=>{const h=p.completed+p.running+p.pending+p.failed;return h>u&&(u=h),{name:l.get(f)??f.slice(0,12),values:[p.completed,p.running,p.pending,p.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return o.jsxs(Jt,{children:[o.jsxs(Jt.TopBar,{children:[o.jsx(Jt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&o.jsx(Jt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),n?o.jsx(Jt.Loading,{}):r?o.jsx(Jt.Error,{message:"Failed to load experiments data"}):o.jsx(Jt.Content,{children:i?o.jsx(EC,{data:s,segments:tQr,maxVal:a,fmt:l=>String(l)}):o.jsx(Jt.NoData,{message:"No experiments have been run yet"})})]})}const rQr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No Experiments yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Run an experiment from a dataset to evaluate ",o.jsx("br",{}),"your agents and workflows."]}),actionSlot:o.jsx("div",{className:"flex flex-col items-center gap-2",children:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",o.jsx(Fa,{})]})})})});function sQr({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,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(Lm,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),o.jsxs(ps,{children:[o.jsx(gl,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...YWr],value:n,onValueChange:r,className:"whitespace-nowrap"}),o.jsx(gl,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),l&&c&&o.jsxs(ce,{onClick:l,size:"sm",variant:"default",children:[o.jsx(Lr,{className:"size-3"})," Reset"]})]})]})}function aQr(){const{data:e,isLoading:t,error:n}=ef(),{data:r,isLoading:s,error:a}=$h(),{data:i,isLoading:l,error:c}=nV(),{data:u,isLoading:d,isError:f,error:p}=nBr(),{data:h,isLoading:m,isError:g,error:v}=kke(),x=r?.datasets,w=i?.experiments,S=b.useMemo(()=>$Wr(h),[h]),_=n||a||c||p||v;return _&&Fs(_)?o.jsx(ir,{title:"Evaluation",icon:o.jsx(gd,{}),children:o.jsx(ca,{})}):_&&$s(_)?o.jsx(ir,{title:"Evaluation",icon:o.jsx(gd,{}),children:o.jsx(Js,{resource:"evaluation"})}):_?o.jsx(ir,{title:"Evaluation",icon:o.jsx(gd,{}),children:o.jsx(nc,{title:"Failed to load evaluation data",message:_.message})}):o.jsxs(pt,{width:"wide",height:"full",children:[o.jsx(pt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(gd,{})," Evaluation"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Evaluation documentation",children:o.jsx(po,{})})})]})}),o.jsxs("div",{className:"flex flex-col gap-6 pt-4",children:[o.jsx(bue,{children:o.jsx(GWr,{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(H8r,{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(sZr,{experiments:w,isLoading:l,isError:!!c}),o.jsx(nQr,{experiments:w,datasets:x,isLoading:l,isError:!!c})]}),o.jsx(RWr,{reviewSummary:h,experiments:w,datasets:x,isLoading:m,isError:!!g})]})]})}function iQr(){const[e,t]=b.useState(""),[n,r]=b.useState("all"),[s,a]=b.useState("all"),{data:i,isLoading:l,error:c}=$h(),{data:u,isLoading:d,error:f}=nV(),{data:p}=kke(),h=b.useMemo(()=>i?.datasets??[],[i?.datasets]),m=b.useMemo(()=>u?.experiments??[],[u?.experiments]),g=b.useMemo(()=>eQr(h),[h]),v=b.useMemo(()=>C2t(p),[p]),x=l||d,w=f||c;if(w&&Fs(w))return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(ca,{})});if(f&&$s(f))return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(Js,{resource:"experiments"})});if(c&&$s(c))return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(Js,{resource:"datasets"})});if(w)return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(nc,{title:"Failed to load experiments",message:w.message})});if(m.length===0&&!x)return o.jsx(ir,{title:"Experiments",icon:o.jsx(gd,{}),children:o.jsx(rQr,{})});const S=n!=="all"||s!=="all"||e!=="",_=()=>{t(""),r("all"),a("all")};return o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:x,children:[o.jsx(gd,{})," Experiments"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{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(po,{})})})]}),o.jsx(sQr,{search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:_,hasActiveFilters:S})]}),o.jsx(JWr,{experiments:m,datasets:h,reviewByExperiment:v,isLoading:x,search:e,statusFilter:n,datasetFilter:s})]})}function oQr(){const{experimentId:e}=ya(),{data:t,isLoading:n}=nV(),s=t?.experiments?.find(h=>h.id===e)?.datasetId??"",{data:a,isLoading:i,error:l}=K9(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p}=tV({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?n||i||!s?o.jsx(Xn,{children:o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx(Bt,{})})}):l&&Fs(l)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})}):l&&$s(l)?o.jsx(Xn,{children:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"datasets"})})}):l||!a?o.jsx(Xn,{children:o.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",l instanceof Error?l.message:"Unknown error"]})}):o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/experiments",children:[o.jsx(Ne,{children:o.jsx(gd,{})}),"Experiments"]}),o.jsx(Fn,{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(E2t,{experimentId:e,experiment:a}),o.jsx(O2t,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p})]})})]}):null}function j2t({redirectUri:e,onSuccess:t,initialMode:n="signin",errorMessage:r}){const{data:s,isLoading:a}=tT(),{mutate:i,isPending:l,error:c}=pHr(),{mutate:u,isPending:d,error:f}=hHr(),{mutate:p,isPending:h}=m2t(),[m,g]=b.useState(n),[v,x]=b.useState(""),[w,S]=b.useState(""),[_,O]=b.useState("");if(a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsx("div",{className:"text-neutral3",children:"Authentication is not configured"})});const{login:E}=s,T=E.type==="sso"||E.type==="both",j=E.type==="credentials"||E.type==="both",N=E.sso,I=E.signUpEnabled!==!1,P=m==="signin"||!I,R=P?l:d,B=P?c:f,M=()=>{t?t():e?window.location.href=e:window.location.href="/"},L=q=>{q.preventDefault(),P?i({email:w,password:_},{onSuccess:M}):u({email:w,password:_,name:v||void 0},{onSuccess:M})},U=()=>{p({redirectUri:e},{onSuccess:q=>{window.location.href=q.url}})},z=()=>{g(P?"signup":"signin")};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:o.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[o.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[o.jsx(t0,{className:"h-10 w-10"}),o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:P?"Sign in to Mastra Studio":"Create your account"})]}),E.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[o.jsx(nXe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"text-sm text-neutral3",children:E.description})]}),r&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:r}),j&&o.jsxs("form",{onSubmit:L,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(mn,{id:"name",type:"text",value:v,onChange:q=>x(q.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(mn,{id:"email",type:"email",value:w,onChange:q=>S(q.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(mn,{id:"password",type:"password",value:_,onChange:q=>O(q.target.value),placeholder:P?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&o.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),o.jsx(ce,{type:"submit",disabled:R,className:"w-full",size:"lg",children:R?P?"Signing in...":"Creating account...":P?"Sign in":"Create account"}),I&&o.jsxs("div",{className:"text-center text-sm",children:[o.jsx("span",{className:"text-neutral3",children:P?"Don't have an account? ":"Already have an account? "}),o.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:P?"Sign up":"Sign in"})]})]}),T&&j&&o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border1"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&o.jsxs(ce,{onClick:U,disabled:h,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&o.jsx("span",{className:"mr-2",children:N.icon}),h?"Redirecting...":N.text||"Sign in"]})]})})}function lQr(){const[e]=go(),t=Yu(),n=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return o.jsx(j2t,{redirectUri:n,onSuccess:i,initialMode:s,errorMessage:a})}function cQr(){const[e,t]=go(),n=fKn(e,t),r=mKn(e,t),[s,a]=b.useState(),[i,l]=b.useState(!1),{data:c=[],isPending:u}=c0t(),{data:d=[],isPending:f}=u0t({entityType:n.selectedEntityOption?.entityType,rootOnly:!0}),{data:p=[],isPending:h}=d0t(),{data:m=[],isPending:g}=f0t(),v=b.useMemo(()=>aKn({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:p,loading:{tags:u,entityNames:f,serviceNames:g,environments:h}}),[c,d,m,p,u,f,g,h]),x=b.useMemo(()=>cKn({rootEntityType:n.selectedEntityOption?.entityType,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo,tokens:n.filterTokens}),[n.filterTokens,n.selectedDateFrom,n.selectedDateTo,n.selectedEntityOption]),{data:w=[],isLoading:S,error:_,isFetchingNextPage:O,hasNextPage:E,setEndOfListElement:T}=JXn({filters:x}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:P,handleNextLog:R}=yKn(w,n.featuredLogId,n.handleFeaturedChange,n.featuredTraceId),{data:B,isLoading:M}=txe(n.featuredTraceId??null),{data:L,isLoading:U}=K1(n.featuredTraceId??"",n.featuredSpanId??""),z=b.useCallback(()=>n.applyFilterTokens(uKn(v,n.filterTokens)),[v,n]),q=b.useCallback(()=>n.handleFeaturedChange({logId:null}),[n]),Z=b.useCallback(Q=>n.handleFeaturedChange({traceId:Q,spanId:null}),[n]),D=b.useCallback((Q,J)=>n.handleFeaturedChange({traceId:Q,spanId:J}),[n]),G=b.useCallback(()=>{n.handleFeaturedChange({traceId:null,spanId:null}),l(!1)},[n]),V=b.useCallback(()=>n.handleFeaturedChange({spanId:null}),[n]),$=b.useCallback(Q=>n.handleFeaturedChange({spanId:Q??null}),[n]),W=o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:S,children:[o.jsx(rXe,{})," Logs"]})})}),o.jsxs(pt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(Uxt,{preset:n.datePreset,onPresetChange:n.handleDatePresetChange,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo,onDateChange:n.handleDateChange,disabled:S,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(Zbt,{fields:v,tokens:n.filterTokens,onTokensChange:n.handleFilterTokensChange,disabled:S,onStartTextFilter:a}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/observability/logging",target:"_blank",rel:"noopener noreferrer","aria-label":"Logs documentation",tooltipContent:"Go to Logs documentation",children:o.jsx(po,{})})]})]}),o.jsx(HXn,{isLoading:S,filterFields:v,filterTokens:n.filterTokens,onFilterTokensChange:n.handleFilterTokensChange,onClear:z,onRemoveAll:n.handleRemoveAll,onSave:r.handleSave,onRemoveSaved:r.hasSavedFilters?r.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]});return _?o.jsxs(pt,{width:"wide",height:"full",children:[W,o.jsx(pt.MainArea,{isCentered:!0,children:o.jsx(UXn,{error:_,resource:"logs",errorTitle:"Failed to load logs"})})]}):w.length===0&&!S&&n.filterTokens.length===0?o.jsxs(pt,{width:"wide",height:"full",children:[W,o.jsx(pt.MainArea,{isCentered:!0,children:o.jsx(GXn,{datePreset:n.datePreset,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo})})]}):o.jsxs(pt,{width:"wide",height:"full",children:[W,o.jsx(qXn,{logCollapsed:i,listSlot:o.jsx(VXn,{logs:w,isLoading:S,isFetchingNextPage:O,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:n.featuredLogId,onLogClick:I}),logPanelSlot:N?o.jsx(BXn,{log:N,onClose:q,onTraceClick:Z,onSpanClick:D,onPrevious:P,onNext:R,collapsed:i,onCollapsedChange:l}):null,tracePanelSlot:n.featuredTraceId?o.jsx(dXn,{traceId:n.featuredTraceId,spans:B?.spans,isLoading:M,onClose:G,onSpanSelect:$,selectedSpanId:n.featuredSpanId}):null,spanPanelSlot:n.featuredTraceId&&n.featuredSpanId?o.jsx(uXn,{spanId:n.featuredSpanId,span:L?.span,isLoading:U,onClose:V}):null})]})}function uQr({server:e}){const{paths:t,Link:n}=cn(),s=Ze().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=m$t(e),l=Object.values(i||{}),c=l.length,u=l.filter(p=>p.toolType==="agent").length,d=l.filter(p=>p.toolType==="workflow").length,f=xh(e.name,50);return o.jsxs(xe.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:n,children:[o.jsx(xe.NameCell,{children:f}),o.jsx(xe.DescriptionCell,{children:a}),o.jsx(xe.TextCell,{className:"text-center",children:u||""}),o.jsx(xe.TextCell,{className:"text-center",children:c||""}),o.jsx(xe.TextCell,{className:"text-center",children:d||""})]})}function dQr({mcpServers:e,isLoading:t,search:n=""}){const r=b.useMemo(()=>{const s=n.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,n]);return t?o.jsx(Md,{columns:"auto 1fr auto auto auto"}):o.jsxs(xe,{columns:"auto 1fr auto auto auto",children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Name"}),o.jsx(xe.TopCell,{children:"URL"}),o.jsx(xe.TopCellSmart,{long:"Agents",short:o.jsx(Ma,{}),tooltip:"Agent Tools",className:"text-center"}),o.jsx(xe.TopCellSmart,{long:"Tools",short:o.jsx(co,{}),tooltip:"Tools",className:"text-center"}),o.jsx(xe.TopCellSmart,{long:"Workflows",short:o.jsx(uo,{}),tooltip:"Workflow Tools",className:"text-center"})]}),r.length===0&&n?o.jsx(xe.NoMatch,{message:"No MCP Servers match your search"}):null,r.map(s=>o.jsx(uQr,{server:s},s.id))]})}const fQr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No MCP Servers yet",descriptionSlot:o.jsxs(o.Fragment,{children:["MCP servers are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",o.jsx(Fa,{})]})})}),pQr=()=>{const{data:e=[],isLoading:t,error:n}=z2(),[r,s]=b.useState("");return n&&Fs(n)?o.jsx(ir,{title:"MCP Servers",icon:o.jsx(Gl,{}),children:o.jsx(ca,{})}):n&&$s(n)?o.jsx(ir,{title:"MCP Servers",icon:o.jsx(Gl,{}),children:o.jsx(Js,{resource:"MCP servers"})}):n?o.jsx(ir,{title:"MCP Servers",icon:o.jsx(Gl,{}),children:o.jsx(nc,{title:"Failed to load MCP servers",message:n.message})}):e.length===0&&!t?o.jsx(ir,{title:"MCP Servers",icon:o.jsx(Gl,{}),children:o.jsx(fQr,{})}):o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:t,children:[o.jsx(Gl,{})," MCP Servers"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{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(po,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),o.jsx(dQr,{mcpServers:e,isLoading:t,search:r})]})},hQr=(e,t)=>{const n=new Map,r=Object.keys(t);for(const s of r){const a=t[s],i=a.tools,l=Object.keys(i);for(const c of l){const u=i[c];n.has(u.id)||n.set(u.id,{...u,agents:[]}),n.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))n.has(a.id)||n.set(a.id,{...a,agents:[]});return Array.from(n.values())};function mQr({tools:e,agents:t,isLoading:n,search:r=""}){const{paths:s,Link:a}=cn(),i=b.useMemo(()=>hQr(e,t),[e,t]),l=b.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(r.toLowerCase())),[i,r]);return n?o.jsx(Md,{columns:"auto 1fr auto"}):o.jsxs(xe,{columns:"auto 1fr auto",children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Name"}),o.jsx(xe.TopCell,{children:"Description"}),o.jsx(xe.TopCellSmart,{long:"Agents",short:o.jsx(Ma,{}),tooltip:"Attached Agents",className:"text-center"})]}),l.length===0&&r?o.jsx(xe.NoMatch,{message:"No Tools match your search"}):null,l.map(c=>{const u=xh(c.id,50),d=xh(c.description??"",200),f=c.agents.length;return o.jsxs(xe.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[o.jsx(xe.NameCell,{children:u}),o.jsx(xe.DescriptionCell,{children:d}),o.jsx(xe.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const gQr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No Tools yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Mastra tools are not configured yet. ",o.jsx("br",{}),"More information in the documentation."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",o.jsx(Fa,{})]})})}),vQr=()=>{const e=Ze();return ar({mutationFn:async({toolId:t,input:n,requestContext:r})=>{const s=new zE;Object.entries(r??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:n,requestContext:s})}catch(a){throw ze.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},yQr=({toolId:e})=>{const{canExecute:t}=_b(),n=t("tools"),{data:r={}}=Ov(),s=b.useMemo(()=>{for(const g of Object.values(r))if(g.tools){const v=Object.values(g.tools).find(x=>x.id===e);if(v)return v}return null},[r,e]),{data:a,isLoading:i,error:l}=DUr(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=vQr(),{requestContext:p}=Us();b.useEffect(()=>{if(l){const g=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${g}`)}},[l]);const h=async(g,v)=>{if(!c)return;const x={...p??{},...v??{}};return u({toolId:c.id,input:g,requestContext:x})},m=c?.inputSchema?lv(av(eb(c?.inputSchema))):cs({});return i?o.jsxs("div",{className:"p-6",children:[o.jsx(Dr,{className:"h-8 w-48 mb-4"}),o.jsx(Dr,{className:"h-32 w-full"})]}):l?null:c?n?o.jsx(cke,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:h,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function bQr({value:e,onValueChange:t,placeholder:n="Select a tool...",searchPlaceholder:r="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=Jq(),{data:p={},isLoading:h,isError:m,error:g}=Ov(),{navigate:v,paths:x}=cn();b.useEffect(()=>{if(d){const O=f instanceof Error?f.message:"Failed to load tools";ze.error(`Error loading tools: ${O}`)}},[d,f]),b.useEffect(()=>{if(m){const O=g instanceof Error?g.message:"Failed to load agents";ze.error(`Error loading agents: ${O}`)}},[m,g]);const w=new Map;Object.values(p).forEach(O=>{O.tools&&Object.values(O.tools).forEach(E=>{w.has(E.id)||w.set(E.id,E)})}),Object.values(c).forEach(O=>{w.has(O.id)||w.set(O.id,O)});const S=Array.from(w.values()).map(O=>({label:O.id,value:O.id})),_=O=>{t?t(O):O&&O!==e&&v(x.toolLink(O))};return o.jsx(jc,{options:S,value:e,onValueChange:_,placeholder:u||h?"Loading tools...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||h||d||m,variant:l})}const xQr=({isLoading:e,server:t})=>{const[{sseUrl:n,httpStreamUrl:r},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(sp,{children:o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${n}`;return o.jsxs(sp,{isDivided:!0,children:[o.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[o.jsx(me,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),o.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[o.jsx(kt,{icon:o.jsx(VU,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),o.jsx(kt,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),o.jsx(me,{className:"text-neutral3 pb-4",children:"This MCP server can be accessed through multiple transport methods. Choose the one that best fits your use case."}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(kt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),o.jsx("div",{className:"pt-1",children:o.jsx(_a,{tooltip:"Copy HTTP Stream URL",content:r})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(kt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),o.jsx("div",{className:"pt-1",children:o.jsx(_a,{tooltip:"Copy SSE URL",content:n})})]})]}),o.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[o.jsx(kt,{icon:o.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),o.jsx(me,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(me,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),o.jsx("div",{className:"pt-1",children:o.jsx(_a,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),o.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:o.jsx(wQr,{server:t})})]})},wQr=({server:e})=>{const{data:t={},isLoading:n}=m$t(e);if(n)return null;const r=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(Ne,{size:"lg",className:"bg-surface4 rounded-md p-1",children:o.jsx(Gl,{})}),o.jsx(me,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),o.jsx("div",{className:"flex flex-col gap-2 pt-6",children:r.map(s=>{const a=t[s];return o.jsx(kQr,{tool:a,serverId:e.id},s)})})]})};function SQr(e){if(!e)return!1;const t=e.ui;return!!(typeof t?.resourceUri=="string"&&t.resourceUri.startsWith("ui://")||typeof e["ui/resourceUri"]=="string"&&e["ui/resourceUri"].startsWith("ui://"))}const kQr=({tool:e,serverId:t})=>{const n=b.useRef(null),{Link:r,paths:s}=cn(),a=vMt[e.toolType||"tool"],i=SQr(e._meta);return o.jsxs(pp,{onClick:()=>n.current?.click(),children:[o.jsx(obt,{children:o.jsx(a,{className:"group-hover/entity:text-accent6"})}),o.jsxs(gp,{children:[o.jsx(hp,{children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(r,{ref:n,href:s.mcpServerToolLink(t,e.id),children:e.id}),i&&o.jsx(kt,{className:"text-[10px] py-0",children:"App"})]})}),o.jsx(mp,{children:e.description})]})]})},_Qr=()=>{const{serverId:e}=ya(),{data:t=[],isLoading:n}=z2(),r=t.find(s=>s.id===e);return o.jsxs(Xn,{children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/mcps",children:[o.jsx(Ne,{children:o.jsx(Gl,{})}),"MCP Servers"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(PMt,{value:e,variant:"ghost"})})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(hw,{}),"MCP documentation"]})})]}),o.jsx(xQr,{isLoading:n,server:r})]})};function OQr(e){if(!e)return;const t=e.ui;if(t?.resourceUri)return t.resourceUri;const n=e["ui/resourceUri"];if(typeof n=="string")return n}const EQr=({toolId:e,serverId:t})=>{const{canExecute:n}=_b(),r=n("tools"),s=Ze(),{data:a,isLoading:i,error:l}=g$t(t,e),{mutateAsync:c,isPending:u,data:d}=XMr(t,e),f=a?OQr(a._meta):void 0,{data:p}=Ot({queryKey:["mcp-app-resource",t,f],queryFn:async()=>f?(await s.readMcpServerResource(t,f)).contents[0]?.text??null:null,enabled:!!f}),h=b.useCallback(async(v,x)=>await c(x),[c]);b.useEffect(()=>{if(l){const v=l instanceof Error?l.message:"Failed to load tool";ze.error(`Error loading tool: ${v}`)}},[l]);const m=async v=>{if(a)return await c(v)};if(i)return o.jsxs("div",{className:"p-6",children:[o.jsx(Dr,{className:"h-8 w-48 mb-4"}),o.jsx(Dr,{className:"h-32 w-full"})]});if(l)return null;if(!a)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!r)return o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let g;try{g=lv(av(a.inputSchema))}catch(v){console.error("Error processing input schema:",v),ze.error("Failed to process tool input schema."),g=cs({})}return o.jsxs("div",{className:"flex flex-col gap-4",children:[p&&o.jsx("div",{className:"border-b border-border1 p-4",children:o.jsx(h$t,{html:p,toolName:a.name??a.id,onToolCall:h})}),o.jsx(cke,{executionResult:d,isExecutingTool:u,zodInputSchema:g,handleExecuteTool:m,toolDescription:a.description||"",toolId:a.id})]})},CQr=()=>{const{data:e}=z2(),{serverId:t,toolId:n}=ya(),{data:r,isLoading:s}=g$t(t,n),a=e?.find(c=>c.id===t),i=r?.name,l=a?.name||"";return s||!r?null:o.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-auto",children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/mcps",children:[o.jsx(Ne,{children:o.jsx(Gl,{})}),"MCP Servers"]}),o.jsx(Fn,{as:ln,to:`/mcps/${t}`,children:l}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:i})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(hw,{}),"MCP documentation"]})})]}),o.jsx(EQr,{toolId:n,serverId:t})]})};function jQr(){const{data:e,isLoading:t,isError:n}=qYn();return o.jsx(RYn,{data:e,isLoading:t,isError:n})}function TQr(){const{data:e,isLoading:t,isError:n}=t0t();return o.jsx(Kbe,{label:"Total Agent Runs",value:e?.value!=null?e.value.toLocaleString():null,prevValue:e?.previousValue!=null?e.previousValue.toLocaleString():void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function NQr(){const{data:e,isLoading:t,isError:n}=FYn();return o.jsx(Kbe,{label:"Total Model Cost",value:e?.cost!=null?r1(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?r1(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:n})}function AQr(){const{data:e,isLoading:t,isError:n}=BYn();return o.jsx(Kbe,{label:"Total Tokens",value:e?.value!=null?$g(e.value):null,prevValue:e?.previousValue!=null?$g(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function IQr(){const{data:e,isLoading:t,isError:n}=UYn();return o.jsx(PYn,{rows:e,isLoading:t,isError:n})}function RQr(){const{data:e,isLoading:t,isError:n}=HYn();return o.jsx($Yn,{data:e,isLoading:t,isError:n})}function PQr(){const{data:e,isLoading:t,isError:n}=ZYn();return o.jsx(DYn,{data:e,isLoading:t,isError:n})}function $Qr(){const{data:e,isLoading:t,isError:n}=VYn();return o.jsx(LYn,{data:e,isLoading:t,isError:n})}const MQr=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),uie="period";function DQr(){const[e,t]=go(),n=e.get(uie),r=Kxt(n)?n:"24h",s=b.useCallback(a=>{t(i=>{const l=new URLSearchParams(i);return a==="24h"?l.delete(uie):l.set(uie,a),l},{replace:!0})},[t]);return o.jsx(NYn,{initialPreset:r,onPresetChange:s,children:o.jsx(LQr,{})})}function LQr(){const{error:e}=t0t(),{data:t,isLoading:n}=Hq(),r=t?.observabilityStorageType,s=r?MQr.has(r):!1,a=r==="ObservabilityInMemory";return e&&Fs(e)?o.jsx(ir,{title:"Metrics",icon:o.jsx(TO,{}),children:o.jsx(ca,{})}):e&&$s(e)?o.jsx(ir,{title:"Metrics",icon:o.jsx(TO,{}),children:o.jsx(Js,{resource:"metrics"})}):e?o.jsx(ir,{title:"Metrics",icon:o.jsx(TO,{}),children:o.jsx(nc,{title:"Failed to load metrics",message:e.message})}):o.jsxs(pt,{width:"wide",height:"full",children:[o.jsx(pt.TopArea,{className:"sticky top-0 z-100 bg-surface1 ",children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(TO,{})," Metrics"]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsx(AYn,{}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:o.jsx(po,{})})]})]})}),n?null:s?o.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[a&&o.jsx(dr,{variant:"info",title:"Metrics are not persisted",children:o.jsx(dr.Message,{children:"This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB."})}),o.jsxs(bue,{children:[o.jsx(TQr,{}),o.jsx(NQr,{}),o.jsx(AQr,{})]}),o.jsxs(bue,{children:[o.jsx(IQr,{}),o.jsx(PQr,{}),o.jsx(RQr,{}),o.jsx($Qr,{}),o.jsx(jQr,{})]})]}):o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"Metrics are not available with your current storage",descriptionSlot:"Metrics require ClickHouse, DuckDB, or in-memory storage for observability. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",o.jsx(Fa,{})]})})})]})}const zQr=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:TO,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:Jo,href:"/observability"}];function FQr(){return o.jsxs(FO,{children:[o.jsx(FO.Top,{children:o.jsx(qn,{withMargins:!1,children:o.jsx(qn.Column,{children:o.jsxs(qn.Title,{children:[o.jsx(Jo,{})," 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:zQr.map(e=>o.jsxs(ln,{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 BQr=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:Ma,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:No,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:uo,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:m1,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:Gl,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:co,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:zc,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:uj,href:"/request-context"}];function UQr(){return o.jsxs(pt,{width:"narrow",children:[o.jsx(pt.TopArea,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(Tqt,{})," Primitives"]})})}),o.jsx(pt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:BQr.map(e=>o.jsxs(ln,{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 qQr(){const{paths:e}=cn(),{data:t,isLoading:n,error:r}=_Mt(),{isCmsAvailable:s}=U2(),[a,i]=b.useState(""),l=t?.promptBlocks??[];return r&&Fs(r)?o.jsx(ir,{title:"Prompts",icon:o.jsx(No,{}),children:o.jsx(ca,{})}):r&&$s(r)?o.jsx(ir,{title:"Prompts",icon:o.jsx(No,{}),children:o.jsx(Js,{resource:"prompt blocks"})}):r?o.jsx(ir,{title:"Prompts",icon:o.jsx(No,{}),children:o.jsx(nc,{title:"Failed to load prompt blocks",message:r.message})}):l.length===0&&!n?o.jsx(ir,{title:"Prompts",icon:o.jsx(No,{}),children:o.jsx(CUr,{})}):o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:n,children:[o.jsx(No,{})," Prompts"]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsx(Kr,{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(po,{})}),s&&o.jsxs(ce,{as:ln,to:e.cmsPromptBlockCreateLink(),variant:"primary",children:[o.jsx(js,{}),"Create Prompt"]})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),o.jsx(EUr,{promptBlocks:l,isLoading:n,search:a})]})}function VQr(){return o.jsxs(pt,{width:"narrow",children:[o.jsx(pt.TopArea,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(uj,{})," Request Context"]})})}),o.jsx(pt.MainArea,{children:o.jsx(P9r,{children:o.jsx(tMt,{})})})]})}const HQr=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:V7t,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:po,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:Fa,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:VI,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:YYe,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:zUt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function ZQr(){return o.jsxs(pt,{width:"narrow",children:[o.jsx(pt.TopArea,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(po,{})," Resources"]})})}),o.jsx(pt.MainArea,{children:o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:HQr.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(Fa,{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 WQr(){const{data:e={},isLoading:t,error:n}=ef(),[r,s]=b.useState(""),[a,i]=b.useState("all");if(n&&Fs(n))return o.jsx(ir,{title:"Scorers",icon:o.jsx(si,{}),children:o.jsx(ca,{})});if(n&&$s(n))return o.jsx(ir,{title:"Scorers",icon:o.jsx(si,{}),children:o.jsx(Js,{resource:"scorers"})});if(n)return o.jsx(ir,{title:"Scorers",icon:o.jsx(si,{}),children:o.jsx(nc,{title:"Failed to load scorers",message:n.message})});if(Object.keys(e).length===0&&!t)return o.jsx(ir,{title:"Scorers",icon:o.jsx(si,{}),children:o.jsx(W8r,{})});const l=a!=="all"||r!=="",c=()=>{s(""),i("all")};return o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:t,children:[o.jsx(si,{})," Scorers"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:o.jsx(po,{})})})]}),o.jsx(G8r,{search:r,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:l})]}),o.jsx(Z8r,{scorers:e,isLoading:t,search:r,sourceFilter:a})]})}function QQr(){const{scorerId:e}=ya(),[t,n]=go(),r=t.get("scoreId")??void 0,[s,a]=b.useState(r),[i,l]=b.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,isLoading:u,error:d}=q8r(e),{data:f={},isLoading:p,error:h}=Ov(),{isLoading:m,error:g}=vw(),{data:v=[],isLoading:x,error:w,isFetchingNextPage:S,hasNextPage:_,setEndOfListElement:O}=U8r({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=b.useMemo(()=>c?.agentIds?.filter(D=>f[D]).map(D=>({value:D,label:f[D].name,type:"AGENT"}))||[],[c?.agentIds,f]),T=b.useMemo(()=>c?.workflowIds?.map(D=>({value:D,label:D,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(D=>D.value===N);I&&I.value!==i?.value&&l(I),b.useEffect(()=>{if(d){const D=d instanceof Error?d.message:"Failed to load scorer";ze.error(`Error loading scorer: ${D}`)}},[d]),b.useEffect(()=>{if(h){const D=h instanceof Error?h.message:"Failed to load agents";ze.error(`Error loading agents: ${D}`)}},[h]),b.useEffect(()=>{if(g){const D=g instanceof Error?g.message:"Failed to load workflows";ze.error(`Error loading workflows: ${D}`)}},[g]);const P=D=>{D?.value&&n(G=>{const V=new URLSearchParams(G);return V.set("entity",D.value),V})};b.useEffect(()=>{const D=t.get("scoreId")??void 0;if(D===s)return;if(!D){a(void 0);return}v.find(V=>V.id===D)&&a(D)},[t,v]);const R=b.useCallback(D=>{a(D||void 0),n(G=>{const V=new URLSearchParams(G);return D?V.set("scoreId",D):V.delete("scoreId"),V})},[n]);if(!c)return null;const B=Fs(d)||Fs(h)||Fs(g),M=d&&$s(d),L=!B&&!M&&(d||h||g),U=!x&&v.length===0,z=i?.value!=="all",q=o.jsxs(o.Fragment,{children:[o.jsxs(wi,{children:[o.jsx(Fn,{as:ln,to:"/scorers",children:"Scorers"}),o.jsx(V8r,{value:e,variant:"link"})]}),o.jsxs(pt.Row,{children:[o.jsxs(Or,{children:[o.jsxs(Or.Title,{isLoading:u,children:[o.jsx(si,{})," ",c?.scorer?.config?.name||e]}),(u||c?.scorer?.config?.description)&&o.jsx(Or.Description,{isLoading:u,children:c?.scorer?.config?.description})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(Kr,{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(po,{})}),c?.scorer?.source==="stored"&&o.jsxs(ce,{variant:"default",as:ln,to:`/cms/scorers/${e}/edit`,children:[o.jsx(ob,{})," Edit"]})]})]})]});if(B||M||L||U&&!z){const D=(d instanceof Error?d.message:void 0)??(h instanceof Error?h.message:void 0)??(g instanceof Error?g.message:void 0)??"An unexpected error occurred";return o.jsxs(pt,{width:"wide",height:"full",children:[o.jsx(pt.TopArea,{children:q}),o.jsx(pt.MainArea,{isCentered:!0,children:B?o.jsx(ca,{}):M?o.jsx(Js,{resource:"scorers"}):L?o.jsx(nc,{title:"Failed to load scorer",message:D}):o.jsx($8r,{})})]})}return o.jsxs(pt,{width:"wide",children:[o.jsxs(pt.TopArea,{children:[q,o.jsx(L8r,{selectedEntity:i,entityOptions:j,onEntityChange:P,onReset:()=>{n(D=>{const G=new URLSearchParams(D);return G.set("entity","all"),G})},isLoading:x||p||m})]}),o.jsx(P8r,{scores:v,isLoading:x,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:_,setEndOfListElement:O,onScoreClick:R,errorMsg:w?.message})]})}const GQr=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],YQr=()=>{const{baseUrl:e,headers:t,apiPrefix:n}=K1e(),{theme:r,setTheme:s}=Gj();return o.jsxs(pt,{width:"narrow",children:[o.jsx(pt.TopArea,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(Pbe,{})," Settings"]})})}),o.jsxs(pt.MainArea,{className:"flex flex-col gap-5 mt-6",children:[o.jsx(JLe,{title:"Theme",description:"Customize the appearance of the studio.",children:o.jsx(rxt,{name:"theme",label:"Theme mode",value:r,onValueChange:a=>s(a),options:GQr.map(a=>({...a}))})}),o.jsx(JLe,{title:"Mastra Connection",description:"Configure the Mastra instance URL, API prefix, and request headers used by the studio.",children:o.jsx(sMt,{initialConfig:{baseUrl:e,headers:t,apiPrefix:n}})})]})]})};function XQr(){const[e]=go(),t=Yu(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return o.jsx(j2t,{redirectUri:n,onSuccess:r,initialMode:"signup"})}function KQr(e){return e.replace(/\/$/,"").split("/").pop()}function sV({children:e,className:t}){return o.jsx("div",{className:Y("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function JQr({templates:e,linkComponent:t,className:n,isLoading:r}){const s=t||"a";return r?o.jsx("div",{className:Y("grid gap-y-4",n),children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):o.jsx("div",{className:Y("grid gap-y-4",n),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return o.jsxs("article",{className:Y("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[o.jsxs(s,{to:`/templates/${a.slug}`,className:Y("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&o.jsx("div",{className:Y("overflow-hidden"),children:o.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),o.jsxs("div",{className:Y("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[o.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),o.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),o.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&o.jsxs("ul",{className:Y("flex gap-4 text-ui-md text-neutral3 m-0 p-0 list-none","[&>li]:flex [&>li]:items-center [&>li]:gap-0.5 text-neutral4"),children:[a?.agents&&a.agents.length>0&&o.jsxs("li",{children:[o.jsx(Ma,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&o.jsxs("li",{children:[o.jsx(co,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&o.jsxs("li",{children:[o.jsx(iXe,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&o.jsxs("li",{children:[o.jsx(v8,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&o.jsxs("li",{children:[o.jsx(Gl,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&o.jsx("small",{children:"|"}),o.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(l=>o.jsx("span",{className:"",children:l},l))})]})]})]}),o.jsx("a",{href:a.githubUrl,className:Y("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:o.jsxs("span",{className:"flex items-center gap-2 px-2 py-1 rounded bg-surface1 group-hover:bg-surface2 text-neutral3 transition-colors group-hover:text-neutral5",children:[o.jsx(rbt,{})," ",KQr(a.githubUrl)]})})]},a.slug)})})}function eGr({tagOptions:e,selectedTag:t,providerOptions:n,selectedProvider:r,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:l,onReset:c,className:u,isLoading:d}){return d?o.jsxs("div",{className:Y("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[o.jsx("div",{})," ",o.jsx("div",{})," ",o.jsx("div",{})]}):o.jsxs("div",{className:Y("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[o.jsx(C0,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>l?.(f.target.value),placeholder:"Search Template"}),o.jsx(gl,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),o.jsx(gl,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:r,onValueChange:a,options:n}),c&&o.jsxs(ce,{onClick:c,children:["Reset ",o.jsx(Lr,{})]})]})}function tGr(){const{data:e,isLoading:t}=EKn(),{templates:n,tags:r,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"}];(r||[]).forEach(w=>{f.push({value:w,label:w})});const p=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{p.push({value:w,label:w})});const h=(w,S)=>{S==="tag"?i(w):S==="provider"&&c(w)},m=w=>{d(w)},g=()=>{i("all"),c("all"),d("")},v=n.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(Xn,{children:[o.jsx(Br,{children:o.jsxs($d,{children:[o.jsx(Ne,{children:o.jsx(Vx,{})}),"Templates"]})}),o.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[o.jsx(eGr,{selectedTag:a,onTagChange:w=>h(w,"tag"),tagOptions:f,selectedProvider:l,onProviderChange:w=>h(w,"provider"),providerOptions:p,searchTerm:u,onSearchChange:m,onReset:x?g:void 0,className:"max-w-[80rem]",isLoading:t}),o.jsx(JQr,{templates:v,linkComponent:ln,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const nGr="1.32.1";function rGr({errorMsg:e,validationErrors:t}){const n=typeof e=="string"?e:e!=null?String(e):void 0,r=n?.includes("Invalid schema for function"),s=n?.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.":r?"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(Ny,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:o.jsx(vqt,{}),title:"Template Installation Failed"},{icon:l,title:c}=i();return o.jsxs(sV,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[o.jsxs("div",{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l,o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),o.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&o.jsxs("details",{className:"text-xs",children:[o.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),o.jsx("div",{className:"mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto max-h-60 text-left space-y-2",children:t.map((u,d)=>o.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[o.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),o.jsx("div",{className:"text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap wrap-break-word",children:u.message})]},d))})]}),n&&!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:n})})]})]})}function sGr({providerOptions:e,selectedProvider:t,onProviderChange:n,variables:r,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:l,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return o.jsx(sV,{children:o.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[o.jsxs("h2",{className:Y("text-neutral4 text-header-sm font-semibold flex items-center gap-2","[&>svg]:w-[1.2em] [&_svg]:h-[1.2em] [&_svg]:opacity-70"),children:["Install Template ",o.jsx(oXe,{})]}),o.jsx(gl,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:n,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(r||{}).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),o.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:l?o.jsxs("div",{className:Y("flex items-center justify-center col-span-2 text-neutral3 text-ui-sm gap-4","[&_svg]:opacity-50 [&_svg]:w-[1.1em] [&_svg]:h-[1.1em]","animate-in fade-in duration-300"),children:[o.jsx(Bt,{})," Loading variables..."]}):Object.entries(r).map(([p,h])=>o.jsxs(b.Fragment,{children:[o.jsx(E0,{name:`env-${p}`,labelIsHidden:!0,label:"Key",value:p,disabled:!0,className:"w-full"}),o.jsx(E0,{name:p,labelIsHidden:!0,label:"Value",value:h,onChange:i,errorMsg:s.includes(p)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},p))}),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(nMt,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!l&&o.jsx(ce,{className:Y("flex items-center gap-2 mt-4 justify-center text-ui-md w-full bg-surface5 min-h-10 rounded-lg text-neutral5 hover:bg-surface6 transition-colors","[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-neutral5"),onClick:a,disabled:!t||!u||!d||s.length>0||c,children:c?o.jsxs(o.Fragment,{children:[o.jsx(Bt,{className:"w-4 h-4"})," Installing..."]}):o.jsxs(o.Fragment,{children:["Install ",o.jsx(YS,{})]})})]})})}function aGr({title:e,description:t,githubUrl:n,isLoading:r,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:Y("grid mt-8 items-center"),children:o.jsxs("div",{className:Y("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":r}),children:[o.jsx(Vx,{}),o.jsx("h2",{className:Y({"bg-surface4 flex rounded-lg min-w-[50%]":r}),children:r?o.jsx(o.Fragment,{children:" "}):e})]})}),o.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[o.jsxs("div",{className:"grid",children:[o.jsx("p",{className:Y("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":r}),children:r?o.jsx(o.Fragment,{children:" "}):t}),!r&&a&&o.jsxs("div",{className:Y("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[o.jsx("div",{className:"shrink-0 mt-0.5",children:o.jsx(X0,{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(p8,{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."})]})]})]}),n&&o.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[o.jsx(rbt,{}),n?.split("/")?.pop()]})]}),s&&o.jsx(Vk,{data:s,labelsAreHidden:!0,isLoading:r})]})]})}function iGr({name:e,streamResult:t,workflowInfo:n}){const r=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:n?.allSteps?m in n.allSteps:!0,d=Object.entries(l).filter(([m,g])=>u(m)),f=d.length,p=()=>{switch(r){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..."}},h=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(sV,{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:p()}),t?.runId&&o.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(r)&&o.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:o.jsx(OWn,{steps:h})}),i&&r==="error"&&o.jsxs("div",{className:Y("rounded-lg text-neutral5 p-6 flex items-center gap-3 text-ui-md bg-red-500/10","[&>svg]:w-6 [&>svg]:h-6 [&>svg]:opacity-70 [&>svg]:text-red-500"),children:[o.jsx(cVt,{}),i||"Something went wrong"]}),c&&o.jsx(_Wn,{steps:h,currentStep:a,className:"pb-4"}),!c&&r==="initializing"&&o.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[o.jsx(Bt,{}),o.jsx("p",{children:"This may take some time..."})]})]})}function oGr({name:e,installedEntities:t}){return o.jsxs(sV,{className:Y("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o.jsx(oXe,{}),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(Vk,{data:t})]})}function lGr(){const{templateSlug:e}=ya(),[t,n]=go(),[r,s]=b.useState(""),[a,i]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState({}),[f,p]=b.useState([]),[h,m]=b.useState(null),[g,v]=b.useState(!1),[x,w]=b.useState(""),[S,_]=b.useState(!1),[O,E]=b.useState(!1),[T,j]=b.useState([]),{data:N,isLoading:I}=CKn({repoOrSlug:e,owner:"mastra-ai"}),R=nGr?.includes("beta")??!1?"beta":"main",{data:B,isLoading:M}=jKn({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:R}),{data:L,isLoading:U}=TKn(),{mutateAsync:z,isPending:q}=NKn(),{mutateAsync:Z}=AKn(),{streamInstall:D,streamResult:G,isStreaming:V}=RKn(L),{observeInstall:$,streamResult:W,isStreaming:Q}=PKn(L);b.useEffect(()=>{const ne=t.get("runId");ne&&!g&&!h&&!V&&!Q&&(console.info("🔄 Checking completed run after hot reload:",{runId:ne}),w(ne),Z({runId:ne}).then(le=>{const ge=le.snapshot;if(ge?.status==="success"&&ge?.result?.success)v(!0);else if(ge?.result?.success===!1)if(ge?.result?.validationResults&&!ge?.result?.validationResults?.valid&&ge?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ue,errors:be}=ge.result.validationResults,ke=`Template installation completed but ${ue} validation issue${ue>1?"s":""} remain unresolved.`;m(ke),j(be||[])}else{const ue=ge?.result?.message||ge?.result?.error||"Template installation failed";m(typeof ue=="string"?ue:String(ue))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,h,V,Q,Z]),b.useEffect(()=>{const ne=t.get("runId"),le=t.get("resume"),ge=t.get("provider");if(ne&&le==="true"&&ge&&!V&&!Q&&!S&&!O&&L){w(ne),_(!0);try{Z({runId:ne}).then(de=>{if(de.snapshot?.status==="running")return $.mutateAsync({runId:ne})}).then(()=>{n(de=>{const ue=new URLSearchParams(de);return ue.delete("resume"),ue})}).catch(de=>{console.error("❌ Failed to resume template installation:",de),de.message?.includes("404")||de.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(de){console.error("❌ Auto-resume failed with error:",de),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,Q,S,O,L,Z,$,n]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ae=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(ne=>ne).join(", "):"n/a",icon:o.jsx(co,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(ne=>ne).join(", "):"n/a",icon:o.jsx(Ma,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(ne=>ne).join(", "):"n/a",icon:o.jsx(v8,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:o.jsx(Og,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:o.jsx(fj,{})}],te=[{...ae[0]},{...ae[1]},{...ae[2]}].filter(ne=>ne.value!=="n/a");b.useEffect(()=>{B&&d(B)},[B]),b.useEffect(()=>{const ne=G||W;ne?.phase==="error"&&ne?.error&&m(typeof ne.error=="string"?ne.error:String(ne.error))},[G?.phase,G?.error,W?.phase,W?.error]);const re=ne=>{s(ne)},ie=async ne=>(i(ne.provider),c(ne.modelId),{message:"Model updated successfully"}),pe=async()=>{const ne=Object.entries(u).reduce((le,[ge,de])=>(de===""&&le.push(ge),le),[]);if(ne.length>0){p(ne);return}if(N){m(null),v(!1),w(""),E(!0);try{const ge={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:R,slug:N.slug,variables:u},{runId:de}=await z({});w(de),n(ue=>{const be=new URLSearchParams(ue);return be.set("runId",de),be.set("resume","true"),be.set("provider",r||"openai"),be}),await D.mutateAsync({inputData:ge,selectedModel:{provider:a,modelId:l},runId:de})}catch(le){E(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},X=ne=>{const{name:le,value:ge}=ne.target;ge.trim()===""?p(de=>[...de,le]):p(de=>de.filter(ue=>ue!==le)),d(de=>({...de,[le]:ge}))};return o.jsxs(Xn,{children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/templates",children:[o.jsx(Ne,{children:o.jsx(Vx,{})}),"Templates"]}),o.jsx(Fn,{as:ln,to:`/templates/${N?.slug}`,isCurrent:!0,children:N?.title&&N.title})]})}),o.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:o.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[o.jsx(aGr,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:ae,templateSlug:e}),N&&o.jsxs(o.Fragment,{children:[(V||Q)&&o.jsx(iGr,{name:N.title,streamResult:Q?W:G,runId:x,workflowInfo:L}),g&&o.jsx(oGr,{name:N.title,installedEntities:te,linkComponent:ln}),h&&o.jsx(rGr,{errorMsg:h,validationErrors:T.length>0?T:G?.validationResults?.errors||W?.validationResults?.errors}),!V&&!Q&&!g&&!h&&o.jsx(sGr,{providerOptions:J,selectedProvider:r,onProviderChange:re,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:pe,handleVariableChange:X,isLoadingEnvVars:M||U,isInstalling:q,defaultModelProvider:a,defaultModelId:l,onModelUpdate:ie})]})]})})]})}const cGr=()=>{const{toolId:e,agentId:t}=ya();return o.jsxs(Xn,{children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/agents",children:[o.jsx(Ne,{children:o.jsx(Ma,{})}),"Agents"]}),o.jsx(Fn,{as:ln,to:`/agents/${t}/chat`,children:t}),o.jsx(Fn,{as:ln,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[o.jsx(Ne,{children:o.jsx(hw,{})}),"Tools documentation"]})})]}),o.jsx(SBr,{toolId:e,agentId:t})]})},uGr=()=>{const{toolId:e}=ya();return o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/tools",children:[o.jsx(Ne,{children:o.jsx(co,{})}),"Tools"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(bQr,{value:e,variant:"ghost"})})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(hw,{}),"Tools documentation"]})})]}),o.jsx(yQr,{toolId:e})]})};function dGr(e){return e.feedbackType==="thumbs"?e.value===1?"👍 Positive (1)":e.value===0||e.value===-1?"👎 Negative":String(e.value):e.feedbackType==="rating"?String(e.value):e.feedbackType==="comment"?String(e.value??e.comment??"-"):String(e.value??"-")}function fGr({feedback:e,isOpen:t,onClose:n,onNext:r,onPrevious:s}){const a=e?.metadata&&Object.keys(e.metadata).length>0?JSON.stringify(e.metadata,null,2):void 0;return o.jsxs(Gt,{dialogTitle:"Feedback Detail",dialogDescription:"View feedback details",isOpen:t,onClose:n,level:3,children:[o.jsxs(Gt.Top,{children:[o.jsxs(us,{children:[o.jsx(VI,{})," Feedback"]}),"|",o.jsx(Gt.Nav,{onNext:r,onPrevious:s})]}),o.jsxs(Gt.Content,{children:[o.jsxs(Gt.Header,{children:[o.jsxs(Gt.Heading,{children:[o.jsx(VI,{})," Feedback"]}),e?.traceId&&o.jsxs(us,{children:[o.jsx(UE,{})," ",e.traceId]})]}),o.jsxs(j0,{children:[o.jsx(Vk,{data:[{label:"Created at",value:e?.timestamp?an(new Date(e.timestamp),"MMM d, h:mm:ss aaa"):"n/a",key:"timestamp"},{label:"Type",value:e?.feedbackType??"n/a",key:"type"},{label:"Value",value:e?dGr(e):"n/a",key:"value"},...e?.comment?[{label:"Comment",value:e.comment,key:"comment"}]:[],{label:"Source",value:e?.feedbackSource??e?.source??"n/a",key:"source"},...e?.feedbackUserId?[{label:"User",value:e.feedbackUserId,key:"userId"}]:[],...e?.traceId?[{label:"Trace ID",value:e.traceId,key:"traceId"}]:[],...e?.spanId?[{label:"Span ID",value:e.spanId,key:"spanId"}]:[]]}),a&&o.jsx(Gt.CodeSection,{title:"Metadata",icon:o.jsx(UE,{}),codeStr:a,simplified:!0})]})]})]})}const N3=[{name:"source",label:"Source",size:"1fr"},{name:"date",label:"Date",size:"0.8fr"},{name:"time",label:"Time",size:"0.8fr"},{name:"value",label:"Value",size:"0.6fr"},{name:"comment",label:"Comment",size:"2fr"}];function pGr(e){return e.feedbackType==="thumbs"?e.value===1?"👍":e.value===0||e.value===-1?"👎":String(e.value):typeof e.value=="number"?String(e.value):"—"}function hGr(e){const t=e.comment||(typeof e.value=="string"?e.value:"");return t?t.length>60?t.slice(0,60)+"…":t:"—"}function T2t({feedbackData:e,isLoadingFeedbackData:t,onPageChange:n}){const[r,s]=b.useState(!1),[a,i]=b.useState(),l=e?.feedback??[],c=p=>{i(l[p]),s(!0)};if(t)return o.jsx(ext,{columns:N3});const u=a?l.indexOf(a):-1,d=u>=0&&u<l.length-1?()=>i(l[u+1]):void 0,f=u>0?()=>i(l[u-1]):void 0;return o.jsxs(o.Fragment,{children:[o.jsxs(Ra,{children:[o.jsxs(Ra.Trim,{children:[o.jsx(Ra.Header,{columns:N3}),l.length>0?o.jsx(Ra.Entries,{children:l.map((p,h)=>{const m=new Date(p.timestamp),g=xv(m),v={id:`${p.traceId}-${h}`,source:p.feedbackUserId||p.feedbackSource||"unknown",date:g?"Today":an(m,"MMM dd"),time:an(m,"h:mm:ss aaa"),value:pGr(p),comment:hGr(p)};return o.jsx(Ra.Entry,{columns:N3,onClick:()=>c(h),entry:v,children:N3.map(x=>o.jsx(Ra.EntryText,{children:String(v[x.name]??"")},`col-${x.name}`))},v.id)})}):o.jsx(Ra.Message,{message:"No feedback found",type:"info"})]}),o.jsx(Ra.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>n?.((e?.pagination?.page||0)+1),onPrevPage:()=>{const p=e?.pagination?.page||0;p>0&&n?.(p-1)}})]}),o.jsx(fGr,{feedback:a,isOpen:r,onClose:()=>s(!1),onNext:d,onPrevious:f})]})}const OQe="auto auto auto auto 1fr";function N2t({scoresData:e,isLoadingScoresData:t,onPageChange:n,onScoreSelect:r}){return t?o.jsx(JU,{columns:OQe}):o.jsxs("div",{className:"grid gap-2",children:[o.jsxs(hu,{columns:OQe,className:"min-w-0",children:[o.jsxs(hu.Top,{children:[o.jsx(hu.TopCell,{children:"ID"}),o.jsx(hu.TopCell,{children:"Date"}),o.jsx(hu.TopCell,{children:"Time"}),o.jsx(hu.TopCell,{children:"Score"}),o.jsx(hu.TopCell,{children:"Scorer"})]}),e?.scores&&e.scores.length>0?e.scores.map(s=>{const a=new Date(s.createdAt),i=xv(a);return o.jsxs(hu.RowButton,{onClick:()=>r?.(s),children:[o.jsx(hu.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:Zf(s?.id)||"n/a"}),o.jsx(hu.Cell,{height:"compact",className:"text-neutral2 text-ui-smd",children:i?"Today":an(a,"MMM dd")}),o.jsx(hu.Cell,{height:"compact",className:"font-mono text-neutral3 text-ui-smd",children:an(a,"h:mm:ss aaa")}),o.jsx(hu.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.score??"")}),o.jsx(hu.Cell,{height:"compact",className:"text-ui-smd",children:String(s?.scorer?.name||s?.scorer?.id||"")})]},s.id)}):o.jsx(hu.NoMatch,{message:"No scores found"})]}),o.jsx(hu.Pagination,{currentPage:e?.pagination?.page||0,hasMore:e?.pagination?.hasMore,onNextPage:()=>n?.((e?.pagination?.page||0)+1),onPrevPage:()=>n?.((e?.pagination?.page||0)-1)})]})}const A2t=({traceId:e="",page:t})=>{const n=Ze(),r=t??0;return Ot({queryKey:["trace-feedback",e,r],queryFn:()=>n.listFeedback({filters:{traceId:e},pagination:{page:r,perPage:10}}),enabled:!!e,refetchInterval:3e3,gcTime:0,staleTime:0})};function mGr(){const[e,t]=go(),[n,r]=b.useState(!1),s=MXn(e,t,{onRemoveAll:()=>r(!1)}),[a,i]=b.useState(),[l,c]=b.useState(0),[u,d]=b.useState(!1),[f,p]=b.useState(null);b.useEffect(()=>c(0),[s.traceIdParam,s.spanIdParam]);const{data:h,isLoading:m}=ef(),{data:g,isLoading:v}=oke({traceId:s.traceIdParam,spanId:s.spanIdParam,page:l}),[x,w]=b.useState(0);b.useEffect(()=>w(0),[s.traceIdParam,s.spanIdParam]);const{data:S,isLoading:_}=A2t({traceId:s.traceIdParam,page:x}),{data:O,isLoading:E}=txe(s.traceIdParam??null),T=b.useMemo(()=>O?.spans,[O?.spans]),{data:j,isLoading:N}=K1(s.traceIdParam??"",s.spanIdParam??""),I=s.scoreIdParam?g?.scores?.find(ue=>ue.id===s.scoreIdParam):void 0,{data:P=[],isPending:R}=c0t(),{data:B=[],isPending:M}=u0t({entityType:s.selectedEntityOption?.entityType,rootOnly:!0}),{data:L=[],isPending:U}=d0t(),{data:z=[],isPending:q}=f0t(),Z=b.useMemo(()=>jXn({availableTags:P,availableRootEntityNames:B,availableServiceNames:z,availableEnvironments:L,loading:{tags:R,entityNames:M,serviceNames:q,environments:U}}),[P,B,z,L,R,M,q,U]),D=b.useMemo(()=>IXn({rootEntityType:s.selectedEntityOption?.entityType,status:s.selectedStatus,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,tokens:s.filterTokens}),[s.filterTokens,s.selectedDateFrom,s.selectedDateTo,s.selectedEntityOption,s.selectedStatus]),{data:G,isLoading:V,isFetchingNextPage:$,hasNextPage:W,setEndOfListElement:Q,error:J}=wXn({filters:D}),ae=b.useMemo(()=>G?.spans??[],[G?.spans]),te=G?.threadTitles??{},{handlePreviousSpan:re,handleNextSpan:ie}=p0t(T,s.spanIdParam??null,ue=>s.handleSpanChange(ue)),pe=zXn(e,t),X=b.useCallback(()=>s.applyFilterTokens(RXn(Z,s.filterTokens)),[Z,s]),{handlePreviousTrace:ne,handleNextTrace:le}=PXn(ae,s.traceIdParam,s.handleTraceClick),ge=b.useCallback(()=>{const ue=T?.find(be=>be.parentSpanId==null);ue&&(s.handleSpanChange(ue.spanId),s.handleSpanTabChange("scoring"))},[T,s]);if(J)return o.jsx(ir,{title:"Traces",icon:o.jsx(Jo,{}),children:o.jsx(l0t,{error:J,resource:"traces",errorTitle:"Failed to load traces"})});const de=!!s.selectedEntityOption||!!s.selectedStatus||s.filterTokens.length>0||s.datePreset!=="last-24h"||!!s.selectedDateTo;return o.jsxs(pt,{width:"wide",height:"full",children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:V,children:[o.jsx(Jo,{})," Traces"]})})}),o.jsxs(pt.Column,{className:"flex justify-end items-center gap-2",children:[o.jsx(Uxt,{preset:s.datePreset,onPresetChange:s.handleDatePresetChange,dateFrom:s.selectedDateFrom,dateTo:s.selectedDateTo,onDateChange:s.handleDateChange,disabled:V,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),o.jsx(Zbt,{fields:Z,tokens:s.filterTokens,onTokensChange:s.handleFilterTokensChange,disabled:V,onStartTextFilter:i}),o.jsx(Kr,{disabled:V,"aria-pressed":n,"aria-label":n?"Ungroup traces":"Group traces by thread",tooltipContent:n?"Ungroup traces":"Group traces by thread",onClick:()=>r(ue=>!ue),children:n?o.jsx(s6,{}):o.jsx(tXe,{})}),o.jsx(Kr,{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(po,{})})]})]}),o.jsx(sXn,{isLoading:V,filterFields:Z,filterTokens:s.filterTokens,onFilterTokensChange:s.handleFilterTokensChange,onClear:X,onRemoveAll:s.handleRemoveAll,onSave:pe.handleSave,onRemoveSaved:pe.hasSavedFilters?pe.handleRemoveSaved:void 0,autoFocusFilterFieldId:a})]}),o.jsx(fXn,{traceCollapsed:u,listSlot:o.jsx(hXn,{traces:ae,isLoading:V,isFetchingNextPage:$,hasNextPage:W,setEndOfListElement:Q,filtersApplied:de,featuredTraceId:s.traceIdParam,onTraceClick:ue=>s.handleTraceClick(s.traceIdParam===ue.traceId?"":ue.traceId),groupByThread:n,threadTitles:te}),tracePanelSlot:s.traceIdParam?o.jsx(i0t,{traceId:s.traceIdParam,spans:T,isLoading:E,onClose:s.handleTraceClose,onSpanSelect:ue=>s.handleSpanChange(ue??null),onEvaluateTrace:ge,onSaveAsDatasetItem:ue=>p(ue),initialSpanId:s.spanIdParam,onPrevious:ne,onNext:le,collapsed:u,onCollapsedChange:d,placement:"traces-list",LinkComponent:j7,traceHref:`/traces/${s.traceIdParam}`}):null,spanPanelSlot:s.traceIdParam&&s.spanIdParam?o.jsx(o0t,{traceId:s.traceIdParam,spanId:s.spanIdParam,span:j?.span,isLoading:N,onClose:s.handleSpanClose,onPrevious:re,onNext:ie,activeTab:s.spanTabParam??"details",onTabChange:ue=>s.handleSpanTabChange(ue),feedbackTabBadge:S?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(T2t,{feedbackData:S,onPageChange:w,isLoadingFeedbackData:_}),scoringTabBadge:g?.pagination?.total??void 0,scoringTabSlot:({span:ue,traceId:be,spanId:ke})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(gke,{traceId:be,isTopLevelSpan:!ue.parentSpanId,spanId:ke,entityType:ue.attributes?.agentId||ue.entityType===hl.AGENT?"Agent":ue.attributes?.workflowId||ue.entityType===hl.WORKFLOW_RUN?"Workflow":void 0,scorers:h,isLoadingScorers:m}),o.jsx(N2t,{scoresData:g,onPageChange:c,isLoadingScoresData:v,onScoreSelect:Ie=>s.handleScoreChange(Ie.id)})]})}):null,scorePanelSlot:I?o.jsx(ake,{score:I,onClose:()=>s.handleScoreChange(null)}):null}),f&&o.jsx(vke,{rootSpanId:f.rootSpanId,traceId:f.traceId,isOpen:!0,onClose:()=>p(null)})]})}function gGr(){const{traceId:e}=ya(),[t,n]=go(),r=Yu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",l=t.get("scoreId")||void 0,[c,u]=b.useState(s??null),[d,f]=b.useState(),[p,h]=b.useState(i),[m,g]=b.useState(0),[v,x]=b.useState(!1),{data:w,isLoading:S,error:_}=txe(e),O=b.useMemo(()=>w?.spans??[],[w?.spans]),E=b.useMemo(()=>O.find(re=>re.parentSpanId==null),[O]),{data:T,isLoading:j}=K1(e,c??"");b.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=ef(),{data:P,isLoading:R}=oke({traceId:e,spanId:c??void 0,page:m}),[B,M]=b.useState(0);b.useEffect(()=>M(0),[e,c]);const{data:L,isLoading:U}=A2t({traceId:e,page:B});b.useEffect(()=>{if(l&&P?.scores&&!d){const re=P.scores.find(ie=>ie.id===l);re&&f(re)}},[l,P?.scores,d]);const z=b.useCallback(re=>{const ie=new URLSearchParams(t);for(const[pe,X]of Object.entries(re))X===null||X===""?ie.delete(pe):ie.set(pe,X);n(ie,{replace:!0})},[t,n]),q=b.useCallback(re=>{const ie=re??null,pe=ie===c;u(ie),pe||(f(void 0),h("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),Z=b.useCallback(()=>{u(null),f(void 0),h("details"),z({spanId:null,tab:null,scoreId:null})},[z]),D=b.useCallback(re=>{u(re),f(void 0),h("details"),z({spanId:re,tab:null,scoreId:null})},[z]),{handlePreviousSpan:G,handleNextSpan:V}=p0t(O,c,D),$=b.useCallback(re=>{const ie=re;h(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=b.useCallback(re=>{f(re),z({scoreId:re.id})},[z]),Q=b.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),J=b.useCallback(()=>{r("/observability")},[r]),ae=b.useCallback(()=>{h("scoring"),E&&c!==E.spanId?(u(E.spanId),f(void 0),z({spanId:E.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[E,c,z]),te=o.jsxs(o.Fragment,{children:[o.jsxs(ce,{as:j7,href:"/observability",variant:"link",size:"md",className:"text-neutral2",children:[o.jsx(Yf,{}),"Back to Traces"]}),o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:S,children:[o.jsx(Jo,{})," Trace ",o.jsx("span",{className:"text-neutral3",children:e})]})})}),o.jsx(pt.Column,{children:o.jsxs(ps,{children:[o.jsx(Kr,{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(po,{})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs(Kr,{tooltipContent:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ae,children:[o.jsx(r6,{}),"Evaluate"]}),o.jsxs(Kr,{tooltipContent:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>x(!0),children:[o.jsx(Jc,{}),"Save"]})]})]})})]}),E&&o.jsx(pt.Row,{children:o.jsx(pt.Column,{children:o.jsx(r0t,{rootSpan:E,numOfCol:3})})})]});return _?o.jsxs(pt,{height:"full",children:[o.jsx(pt.TopArea,{children:te}),o.jsx(pt.MainArea,{isCentered:!0,children:o.jsx(l0t,{error:_,resource:"traces",errorTitle:"Failed to load trace"})})]}):o.jsxs(pt,{children:[o.jsx(pt.TopArea,{children:te}),o.jsx(vke,{rootSpanId:E?.spanId,traceId:e,isOpen:v,onClose:()=>x(!1)}),o.jsxs("div",{className:Y("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[o.jsx(i0t,{traceId:e,spans:O,isLoading:S,onClose:J,onSpanSelect:q,onEvaluateTrace:ae,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!S&&o.jsxs("div",{className:Y("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[o.jsx(o0t,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:Z,onPrevious:G,onNext:V,activeTab:p,onTabChange:$,feedbackTabBadge:L?.pagination?.total??void 0,feedbackTabSlot:()=>o.jsx(T2t,{feedbackData:L,onPageChange:M,isLoadingFeedbackData:U}),scoringTabBadge:P?.pagination?.total??void 0,scoringTabSlot:({span:re,traceId:ie,spanId:pe})=>o.jsxs("div",{className:"grid gap-6",children:[o.jsx(gke,{traceId:ie,isTopLevelSpan:!re.parentSpanId,spanId:pe,entityType:re.attributes?.agentId||re.entityType===hl.AGENT?"Agent":re.attributes?.workflowId||re.entityType===hl.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),o.jsx(N2t,{scoresData:P,onPageChange:g,isLoadingScoresData:R,onScoreSelect:W})]})}),d&&o.jsx(ake,{score:d,onClose:Q})]})]})]})}function vGr(){const{data:e,isLoading:t,error:n}=vw(),[r,s]=b.useState("");return n&&Fs(n)?o.jsx(ir,{title:"Workflows",icon:o.jsx(uo,{}),children:o.jsx(ca,{})}):n&&$s(n)?o.jsx(ir,{title:"Workflows",icon:o.jsx(uo,{}),children:o.jsx(Js,{resource:"workflows"})}):n?o.jsx(ir,{title:"Workflows",icon:o.jsx(uo,{}),children:o.jsx(nc,{title:"Failed to load workflows",message:n.message})}):Object.keys(e||{}).length===0&&!t?o.jsx(ir,{title:"Workflows",icon:o.jsx(uo,{}),children:o.jsx(YEr,{})}):o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:t,children:[o.jsx(uo,{})," Workflows"]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsxs(ce,{as:ln,to:"/workflows/schedules",children:[o.jsx(Eg,{}),"Schedules"]}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:o.jsx(po,{})})]})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),o.jsx(GEr,{workflows:e||{},isLoading:t,search:r})]})}const yGr={active:"bg-accent1",paused:"bg-accent3"},bGr={active:"text-accent1",paused:"text-accent3"},I2t=({status:e})=>o.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[o.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${yGr[e]}`,"aria-hidden":!0}),o.jsx("span",{className:`text-ui-sm ${bGr[e]}`,children:e})]}),PE=e=>!e||e<=0?"—":new Date(e).toLocaleString(),AI=e=>{if(!e||e<=0)return"—";const t=e-Date.now(),n=Math.abs(t),r=Math.floor(n/1e3);if(r<60)return t>=0?`in ${r}s`:`${r}s ago`;const s=Math.floor(r/60);if(s<60)return t>=0?`in ${s}m`:`${s}m ago`;const a=Math.floor(s/60);if(a<24)return t>=0?`in ${a}h`:`${a}h ago`;const i=Math.floor(a/24);return t>=0?`in ${i}d`:`${i}d ago`};function R2t({status:e}){const{icon:t,color:n}=xGr(e);return o.jsxs("span",{className:`inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm ${n}`,children:[o.jsx("span",{className:"inline-flex shrink-0 items-center","aria-hidden":!0,children:t}),o.jsx("span",{children:e})]})}function xGr(e){switch(e){case"success":return{icon:o.jsx(ga,{size:14}),color:"text-accent1"};case"failed":return{icon:o.jsx(Lr,{size:14}),color:"text-accent2"};case"running":return{icon:o.jsx(Bt,{}),color:"text-neutral3"};case"suspended":return{icon:o.jsx(wpe,{size:14}),color:"text-accent3"};case"canceled":return{icon:o.jsx(qd,{size:14}),color:"text-neutral3"};case"pending":case"waiting":return{icon:o.jsx(bk,{size:14}),color:"text-neutral3"};default:return{icon:null,color:"text-neutral3"}}}const EQe="auto auto auto auto 1fr";function wGr(e){if(e===void 0)return"—";if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t}m ${n}s`}function SGr(e){const t=Math.abs(e),n=e<0?"-":"";return t<1e3?`${n}${t}ms`:t<6e4?`${n}${(t/1e3).toFixed(1)}s`:t<36e5?`${n}${(t/6e4).toFixed(1)}m`:`${n}${(t/36e5).toFixed(1)}h`}const kGr=3e4,_Gr=5*6e4;function OGr({triggers:e,isLoading:t,workflowId:n,hasNextPage:r,isFetchingNextPage:s,setEndOfListElement:a}){const{Link:i,paths:l}=cn();return t?o.jsx(Md,{columns:EQe}):e.length===0?o.jsx(me,{variant:"ui-md",className:"text-neutral4 p-4",children:"No trigger history yet."}):o.jsxs(xe,{columns:EQe,children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Run"}),o.jsx(xe.TopCell,{children:"Status"}),o.jsx(xe.TopCell,{children:"Started"}),o.jsx(xe.TopCell,{children:"Duration"}),o.jsx(xe.TopCell,{children:" "})]}),e.map(c=>{const u=c.actualFireAt-c.scheduledFireAt,d=SGr(u),f=`Scheduled ${PE(c.scheduledFireAt)} — published ${PE(c.actualFireAt)} (drift ${d})`,p=c.outcome==="failed",h=p?c.error:c.run?.error,m=Math.abs(u),g=!p&&m>kGr&&m<=_Gr,v=`${c.scheduleId}-${c.runId}-${c.actualFireAt}`,x=o.jsx("span",{className:n&&!p?"text-accent1 font-mono text-ui-sm whitespace-nowrap":"text-neutral3 font-mono text-ui-sm whitespace-nowrap",children:c.runId}),w=o.jsxs(o.Fragment,{children:[o.jsx(xe.NameCell,{children:x}),o.jsx(xe.TextCell,{children:o.jsxs("span",{className:"inline-flex items-center gap-2",children:[p?o.jsxs("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm text-accent2",children:[o.jsx(Ny,{size:14}),"publish failed"]}):c.run?o.jsx(R2t,{status:c.run.status}):o.jsx("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm text-neutral3",children:"pending"}),h?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{className:"text-accent2 inline-flex",children:o.jsx(Ny,{size:14})})}),o.jsx(Kn,{children:h})]}):null]})}),o.jsx(xe.TextCell,{children:o.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[o.jsx("span",{title:f,children:AI(c.actualFireAt)}),g?o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{className:"text-accent3 inline-flex",children:o.jsx(Ny,{size:14})})}),o.jsxs(Kn,{children:["Published ",d," after the scheduled fire time"]})]}):null]})}),o.jsx(xe.TextCell,{children:c.run?o.jsx("span",{children:wGr(c.run.durationMs)}):o.jsx("span",{className:"text-neutral4",children:"—"})}),o.jsx(xe.TextCell,{children:" "})]});return n&&c.run&&!p?o.jsx(xe.RowLink,{to:l.workflowRunLink(n,c.runId),LinkComponent:i,children:w},v):o.jsx(xe.Row,{children:w},v)}),a?o.jsxs("div",{ref:a,className:"h-1 col-span-full",children:[s?o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Bt,{})}):null,!r&&e.length>0?o.jsx(me,{variant:"ui-xs",className:"text-neutral4 text-center py-4 block",children:"All triggers loaded"}):null]}):null]})}const EGr=e=>{const t=Ze();return Ot({queryKey:["schedule",e],enabled:!!e,queryFn:async()=>{if(!e)throw new Error("scheduleId is required");return t.getSchedule(e)}})},CQe=25,CGr=e=>{const t=Ze(),{inView:n,setRef:r}=mw(),s=Sb({queryKey:["schedule-triggers",e],enabled:!!e,initialPageParam:void 0,queryFn:async({pageParam:u})=>e?t.listScheduleTriggers(e,{limit:CQe,toActualFireAt:u}):{triggers:[]},getNextPageParam:u=>{if(!(!u?.triggers?.length||u.triggers.length<CQe))return u.triggers[u.triggers.length-1].actualFireAt},refetchInterval:u=>(u.state.data?.pages.flatMap(p=>p.triggers)??[]).some(p=>p.run?p.run.status==="pending"||p.run.status==="running"||p.run.status==="waiting":p.outcome==="published")?5e3:!1}),a=s.data?.pages.flatMap(u=>u?.triggers??[])??[],{hasNextPage:i,isFetchingNextPage:l,fetchNextPage:c}=s;return b.useEffect(()=>{n&&i&&!l&&c()},[n,i,l,c]),{...s,data:a,setEndOfListElement:r}},jGr=e=>{const t=Ze(),n=la();return ar({mutationFn:async r=>{if(!e)throw new Error("scheduleId is required");return r==="pause"?t.pauseSchedule(e):t.resumeSchedule(e)},onSuccess:(r,s)=>{n.invalidateQueries({queryKey:["schedule",e]}),n.invalidateQueries({queryKey:["schedules"]}),ze.success(s==="pause"?"Schedule paused":"Schedule resumed")},onError:r=>{ze.error(r.message)}})};function A3({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(me,{variant:"ui-xs",className:"text-neutral4 uppercase tracking-wide",children:e}),o.jsx("div",{className:"text-ui-md",children:t})]})}function TGr(){const{scheduleId:e}=ya(),{paths:t}=cn(),{data:n,isLoading:r,error:s}=EGr(e),{data:a,isLoading:i,error:l,hasNextPage:c,isFetchingNextPage:u,setEndOfListElement:d}=CGr(e),f=jGr(e);if(s&&Fs(s))return o.jsx(ir,{title:"Schedule",icon:o.jsx(Eg,{}),children:o.jsx(ca,{})});if(s&&$s(s))return o.jsx(ir,{title:"Schedule",icon:o.jsx(Eg,{}),children:o.jsx(Js,{resource:"schedules"})});if(s)return o.jsx(ir,{title:"Schedule",icon:o.jsx(Eg,{}),children:o.jsx(nc,{title:"Failed to load schedule",message:s.message})});const p=n?.target.type==="workflow"?n.target.workflowId:void 0;return o.jsxs(pt,{children:[o.jsx(pt.TopArea,{children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:r,children:[o.jsx(Eg,{}),o.jsx("span",{className:"font-mono",children:n?.id??e})]})})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[o.jsxs(ce,{as:ln,to:t.schedulesLink(),variant:"ghost",children:[o.jsx(Yf,{}),"Back to schedules"]}),p?o.jsx(ce,{as:ln,to:t.workflowLink(p),variant:"ghost",children:"Open workflow"}):null,n?o.jsx(ce,{onClick:()=>f.mutate(n.status==="active"?"pause":"resume"),disabled:f.isPending,"data-testid":"schedule-toggle-button",children:n.status==="active"?o.jsxs(o.Fragment,{children:[o.jsx(Cpe,{}),"Pause"]}):o.jsxs(o.Fragment,{children:[o.jsx(Fy,{}),"Resume"]})}):null]})]})}),n?o.jsxs("div",{className:"grid gap-6 h-full overflow-hidden grid-cols-[minmax(0,20rem)_1fr]",children:[o.jsxs("div",{className:"flex flex-col gap-4 border border-border1 rounded-md p-4 h-fit",children:[o.jsx(A3,{label:"Workflow",children:p?o.jsx(ln,{to:t.workflowLink(p),className:"text-accent1 hover:underline",children:p}):"—"}),o.jsxs(A3,{label:"Cron",children:[o.jsx("code",{className:"font-mono text-ui-md",children:n.cron}),n.timezone?o.jsx("span",{className:"text-neutral4 ml-2 text-ui-sm",children:n.timezone}):null]}),o.jsx(A3,{label:"Status",children:o.jsx(I2t,{status:n.status})}),o.jsx(A3,{label:"Next fire",children:o.jsx("span",{title:PE(n.nextFireAt),children:AI(n.nextFireAt)})})]}),o.jsxs("div",{className:"overflow-y-auto","data-testid":"schedule-triggers-panel",children:[o.jsx(me,{variant:"ui-md",className:"mb-3",children:"Trigger history"}),l?o.jsx(nc,{title:"Failed to load trigger history",message:l.message}):o.jsx(OGr,{triggers:a??[],isLoading:i,workflowId:p,hasNextPage:c,isFetchingNextPage:u,setEndOfListElement:d})]})]}):null]})}const jQe="minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto auto auto";function NGr({schedules:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=cn(),a=b.useMemo(()=>{const i=n.toLowerCase();return i?e.filter(l=>l.id.toLowerCase().includes(i)||l.target.workflowId.toLowerCase().includes(i)):e},[e,n]);return t?o.jsx(Md,{columns:jQe}):o.jsxs(xe,{columns:jQe,children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Workflow"}),o.jsx(xe.TopCell,{children:"Schedule ID"}),o.jsx(xe.TopCell,{children:"Cron"}),o.jsx(xe.TopCell,{children:"Status"}),o.jsx(xe.TopCell,{children:"Next fire"}),o.jsx(xe.TopCell,{children:"Last run"})]}),a.length===0&&n?o.jsx(xe.NoMatch,{message:"No schedules match your search"}):null,a.length===0&&!n?o.jsx(xe.NoMatch,{message:"No schedules configured"}):null,a.map(i=>o.jsxs(xe.RowLink,{to:r.scheduleLink(i.id),LinkComponent:s,children:[o.jsx(xe.NameCell,{children:o.jsx("span",{className:"truncate",children:i.target.workflowId})}),o.jsx(xe.TextCell,{children:o.jsx("span",{className:"truncate font-mono text-ui-sm",title:i.id,children:i.id})}),o.jsx(xe.TextCell,{children:o.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[o.jsx("code",{className:"font-mono text-ui-sm",children:i.cron}),i.timezone?o.jsx("span",{className:"text-neutral4 text-ui-xs",children:i.timezone}):null]})}),o.jsx(xe.TextCell,{children:o.jsx(I2t,{status:i.status})}),o.jsx(xe.TextCell,{children:o.jsx("span",{className:"whitespace-nowrap",title:PE(i.nextFireAt),children:AI(i.nextFireAt)})}),o.jsx(xe.TextCell,{children:i.lastRun?o.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[o.jsx(R2t,{status:i.lastRun.status}),o.jsx("span",{className:"text-neutral4 text-ui-sm",title:PE(i.lastFireAt),children:i.lastFireAt?AI(i.lastFireAt):""})]}):i.lastFireAt?o.jsx("span",{className:"whitespace-nowrap",title:PE(i.lastFireAt),children:AI(i.lastFireAt)}):o.jsx("span",{className:"text-neutral4",children:"Never"})})]},i.id))]})}function AGr({workflowId:e}={}){const{data:t,isLoading:n,error:r}=ixe(e?{workflowId:e}:{}),[s,a]=b.useState("");return r?o.jsx(nc,{title:"Failed to load schedules",message:r.message}):o.jsxs("div",{className:"grid grid-rows-[auto_1fr] gap-4 h-full overflow-hidden",children:[o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:a,label:"Filter schedules",placeholder:"Filter by id or workflow"})}),o.jsx("div",{className:"overflow-y-auto",children:o.jsx(NGr,{schedules:t??[],isLoading:n,search:s})})]})}function IGr(){const[e]=go(),t=e.get("workflowId")??void 0,{error:n}=ixe(t?{workflowId:t}:{});if(n&&Fs(n))return o.jsx(ir,{title:"Schedules",icon:o.jsx(Eg,{}),children:o.jsx(ca,{})});if(n&&$s(n))return o.jsx(ir,{title:"Schedules",icon:o.jsx(Eg,{}),children:o.jsx(Js,{resource:"schedules"})});const r=t?`/workflows/${t}`:"/workflows",s=t?"Back to workflow":"Back to workflows";return o.jsxs(pt,{children:[o.jsx(pt.TopArea,{children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{children:[o.jsx(Eg,{})," ",t?`Schedules · ${t}`:"Schedules"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsxs(ce,{as:ln,to:r,variant:"ghost",children:[o.jsx(Yf,{}),s]})})]})}),o.jsx(AGr,{workflowId:t})]})}const TQe=()=>{const{workflowId:e}=ya(),{data:t,isLoading:n,error:r}=LM(e);return r&&Fs(r)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})}):r&&$s(r)?o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"workflows"})}):o.jsx(gjt,{workflowId:e,workflow:t??void 0,isLoading:n})};function RGr(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return o.jsx(abt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return o.jsx(sbt,{className:"h-4 w-4"});case"azure-blob":case"azure":return o.jsx(ibt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return o.jsx(vZ,{className:"h-4 w-4 text-[#F38020]"});case"minio":return o.jsx(Vie,{className:"h-4 w-4 text-red-400"});case"database":return o.jsx(Ya,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return o.jsx(zc,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return o.jsx(Vie,{className:"h-4 w-4 text-slate-400"});case"cloud":return o.jsx(vZ,{className:"h-4 w-4 text-sky-400"});default:return o.jsx(vZ,{className:"h-4 w-4 text-neutral4"})}}function P2t(e,t=!1){const{name:n,type:r,mount:s}=e;if(r==="directory")return s?RGr(s):t?o.jsx(cj,{className:"h-4 w-4 text-amber-400"}):o.jsx(zc,{className:"h-4 w-4 text-amber-400"});switch(n.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return o.jsx(p0,{className:"h-4 w-4 text-blue-400"});case"json":return o.jsx(S$,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return o.jsx(No,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return o.jsx(_pe,{className:"h-4 w-4 text-purple-400"});default:return o.jsx(Spe,{className:"h-4 w-4 text-neutral4"})}}function $2t(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+$2t(-e);if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function PGr(e){if("body"in e&&e.body&&typeof e.body=="object"){const r=e.body;if(typeof r.error=="string")return r.error;if(typeof r.message=="string")return r.message}const t=e.message,n=t.lastIndexOf(" - {");if(n!==-1)try{const r=t.slice(n+3),s=JSON.parse(r);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function M2t(e){return e==="."||e===""}function $Gr({path:e,onNavigate:t}){const r=M2t(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(cj,{className:"h-4 w-4"})}),r.map((s,a)=>{const i=r.slice(0,a+1).join("/");return o.jsxs("div",{className:"flex items-center",children:[o.jsx(da,{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 MGr({entries:e,currentPath:t,isLoading:n,error:r,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:l,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[p,h]=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=M2t(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}`;h(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($Gr,{path:t,onNavigate:s}),o.jsxs("div",{className:"flex items-center gap-1",children:[i&&o.jsx(ce,{variant:"ghost",size:"md",onClick:i,disabled:n,"aria-label":"Refresh files",children:o.jsx(k$,{className:`h-4 w-4 ${n?"animate-spin":""}`})}),c&&o.jsx(ce,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const w=prompt("Directory name:");if(w){const S=g?w:`${t}/${w}`;c(S)}},children:d?o.jsx(Xa,{className:"h-4 w-4 animate-spin"}):o.jsx(f8,{className:"h-4 w-4"})}),l&&o.jsx(ce,{variant:"ghost",size:"md",onClick:l,"aria-label":"Upload files",children:o.jsx(g8,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"max-h-[400px] overflow-auto",children:n?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Xa,{className:"h-6 w-6 animate-spin text-neutral3"})}):r?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(qI,{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:PGr(r)})]}):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(Gd,{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(cj,{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,_=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:[P2t(w),o.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:w.name}),w.mount&&_&&o.jsxs(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:"flex items-center",children:o.jsx(qI,{className:"h-4 w-4 text-red-400"})})}),o.jsxs(Kn,{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(nr,{children:[o.jsx(rr,{asChild:!0,children:o.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${_?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:S})}),o.jsx(Kn,{children:w.mount.description})]}):o.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${_?"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:$2t(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(Vd,{className:"h-3.5 w-3.5"})})]})},w.name)})]})})}),o.jsx(Ht,{open:!!p,onOpenChange:w=>!f&&!w&&h(null),children:o.jsxs(Ht.Content,{children:[o.jsxs(Ht.Header,{children:[o.jsx(Ht.Title,{children:"Delete Item"}),o.jsxs(Ht.Description,{children:['Are you sure you want to delete "',p,'"? This action cannot be undone.']})]}),o.jsxs(Ht.Footer,{children:[o.jsx(Ht.Cancel,{disabled:f,children:"Cancel"}),o.jsxs(Ht.Action,{disabled:f,onClick:async()=>{try{p&&u&&await u(p)}finally{h(null)}},children:[f?o.jsx(Xa,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function DGr(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 LGr({content:e,language:t}){return o.jsx(Z1e,{language:t,style:W1e.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function zGr({path:e,content:t,isLoading:n,mimeType:r,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),l=r?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=DGr(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:[P2t({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(_a,{content:t,copyMessage:"Copied file content"}),s&&o.jsx(ce,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),o.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:n?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Xa,{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:${r||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?o.jsx(LGr,{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 FGr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No Workspaces yet",descriptionSlot:o.jsxs(o.Fragment,{children:["Add a workspace to your Mastra configuration to ",o.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(Fa,{})]})})}),BGr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(C7t,{}),titleSlot:"Workspace Not Configured",descriptionSlot:o.jsxs(o.Fragment,{children:["No workspace is configured. Add a workspace to your ",o.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(Fa,{})]})})}),UGr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qI,{}),titleSlot:"Workspace Not Supported",descriptionSlot:o.jsxs(o.Fragment,{children:["The workspace feature requires a newer version of ",o.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",o.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",o.jsx(Fa,{})]})})}),die={bm25:{label:"Keyword",icon:o.jsx(No,{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(qE,{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(dHt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function D2t(e){return e.id.replace(/#chunk-\d+$/,"")}function qGr({onSearch:e,isSearching:t,searchResults:n,canBM25:r,canVector:s,onViewResult:a}){const[i,l]=b.useState(""),[c,u]=b.useState(5),d=()=>r&&s?"hybrid":r?"bm25":s?"vector":"bm25",[f,p]=b.useState(d()),h=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...r?["bm25"]:[],...s?["vector"]:[],...r&&s?["hybrid"]:[]];return o.jsxs("div",{className:"rounded-lg bg-surface4",children:[o.jsxs("form",{onSubmit:h,className:"p-4",children:[o.jsxs("div",{className:"flex gap-3 items-center",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(dj,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx(mn,{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(mn,{type:"number",min:1,max:50,value:c,onChange:g=>u(parseInt(g.target.value)||5),className:"w-14 h-10 text-center bg-surface2 border-border1",title:"Number of results"})]}),o.jsx(ce,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?o.jsx(Xa,{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=die[g],x=f===g;return o.jsxs("button",{type:"button",onClick:()=>p(g),className:`
|
|
664
664
|
inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-xs font-medium border transition-colors
|
|
665
665
|
${x?v.color:"bg-surface2 text-neutral4 border-transparent hover:bg-surface3"}
|
|
666
666
|
`,children:[v.icon,v.label]},g)})})]}),n&&o.jsxs("div",{className:"border-t border-border1",children:[o.jsxs("div",{className:"px-4 py-2 flex items-center justify-between text-xs",children:[o.jsxs("span",{className:"text-neutral4",children:[n.results.length," result",n.results.length!==1?"s":"",' for "',o.jsx("span",{className:"text-neutral6",children:n.query}),'"']}),o.jsx("span",{className:`px-1.5 py-0.5 rounded ${die[n.mode].color}`,children:die[n.mode].label})]}),n.results.length===0?o.jsx("div",{className:"px-4 py-8 text-center text-neutral4 text-sm",children:"No results found. Try a different query."}):o.jsx("ul",{className:"max-h-[320px] overflow-auto",children:n.results.map((g,v)=>o.jsx(VGr,{result:g,rank:v+1,onClick:()=>a?.(D2t(g))},`${g.id}-${v}`))})]})]})}function VGr({result:e,rank:t,onClick:n}){const r=Math.min(100,Math.max(0,e.score*100)),s=D2t(e);return o.jsx("li",{className:"border-t border-border1 first:border-t-0",children:o.jsxs("button",{onClick:n,className:"w-full px-4 py-3 text-left hover:bg-surface5 transition-colors flex gap-3",children:[o.jsx("span",{className:"text-xs text-neutral3 tabular-nums w-4 shrink-0",children:t}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(cj,{className:"h-3.5 w-3.5 text-neutral4 shrink-0"}),o.jsx("span",{className:"font-mono text-sm text-neutral6 truncate",children:s}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o.jsx("div",{className:"w-12 h-1 rounded-full bg-surface2 overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full bg-accent1",style:{width:`${r}%`}})}),o.jsx("span",{className:"text-ui-xs text-neutral3 tabular-nums",children:e.score.toFixed(2)})]})]}),o.jsx("p",{className:"text-xs text-neutral4 line-clamp-2",children:e.content}),e.lineRange&&o.jsxs("p",{className:"text-xs text-neutral3 mt-1",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function HGr({onSearch:e,results:t,isSearching:n,onResultClick:r}){const[s,a]=b.useState(""),[i,l]=b.useState(5),[c,u]=b.useState(!0),d=f=>{f.preventDefault(),s.trim()&&e({query:s.trim(),topK:i,includeReferences:c})};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("form",{onSubmit:d,className:"space-y-3",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"flex-1 relative",children:[o.jsx(dj,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),o.jsx("input",{type:"text",value:s,onChange:f=>a(f.target.value),placeholder:"Search across skills...",className:"w-full pl-10 pr-4 py-2 rounded-lg bg-surface3 border border-border1 text-sm text-neutral6 placeholder:text-neutral3 focus:outline-hidden focus:ring-2 focus:ring-accent1"})]}),o.jsx(ce,{type:"submit",disabled:!s.trim()||n,children:n?o.jsx(Xa,{className:"h-4 w-4 animate-spin"}):"Search"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[o.jsxs("label",{className:"flex items-center gap-2 text-neutral4",children:[o.jsx("span",{children:"Results:"}),o.jsxs("select",{value:i,onChange:f=>l(Number(f.target.value)),className:"px-2 py-1 rounded bg-surface3 border border-border1 text-neutral5",children:[o.jsx("option",{value:3,children:"3"}),o.jsx("option",{value:5,children:"5"}),o.jsx("option",{value:10,children:"10"}),o.jsx("option",{value:20,children:"20"})]})]}),o.jsxs("label",{className:"flex items-center gap-2 text-neutral4 cursor-pointer",children:[o.jsx("input",{type:"checkbox",checked:c,onChange:f=>u(f.target.checked),className:"rounded border-border1 bg-surface3"}),o.jsx("span",{children:"Include references"})]})]})]}),t.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5",children:["Found ",t.length," result",t.length!==1?"s":""]}),o.jsx("div",{className:"space-y-2",children:t.map((f,p)=>o.jsx(ZGr,{result:f,onClick:()=>r?.(f)},`${f.skillName}-${f.source}-${p}`))})]})]})}function ZGr({result:e,onClick:t}){const n=e.source!=="SKILL.md";return o.jsx("button",{onClick:t,className:"w-full p-4 rounded-lg bg-surface3 border border-border1 hover:border-accent1/50 text-left transition-colors",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5 shrink-0 mt-0.5",children:n?o.jsx(No,{className:"h-3.5 w-3.5 text-neutral4"}):o.jsx(Yj,{className:"h-3.5 w-3.5 text-neutral4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"font-medium text-neutral6",children:e.skillName}),o.jsx("span",{className:"text-xs text-neutral3",children:e.source}),o.jsxs("span",{className:"ml-auto text-xs text-neutral3",children:["Score: ",e.score.toFixed(3)]})]}),o.jsxs("p",{className:"text-sm text-neutral4 line-clamp-3 whitespace-pre-wrap",children:[e.content.slice(0,300),e.content.length>300&&"..."]}),e.lineRange&&o.jsxs("p",{className:"text-xs text-neutral3 mt-2",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function WGr({skillName:e,onUpdate:t,isUpdating:n}){return o.jsx(ce,{variant:"default",size:"icon-sm",disabled:n,tooltip:`Update ${e}`,onClick:t,children:n?o.jsx(Xa,{className:"h-4 w-4 animate-spin"}):o.jsx(tE,{className:"h-4 w-4"})})}function QGr({skillName:e,onRemove:t,isRemoving:n}){return o.jsxs(Ht,{children:[o.jsx(Ht.Trigger,{asChild:!0,children:o.jsx(ce,{variant:"default",size:"icon-sm",disabled:n,tooltip:`Remove ${e}`,children:n?o.jsx(Xa,{className:"h-4 w-4 animate-spin"}):o.jsx(Vd,{className:"h-4 w-4"})})}),o.jsxs(Ht.Content,{children:[o.jsxs(Ht.Header,{children:[o.jsx(Ht.Title,{children:"Remove Skill"}),o.jsxs(Ht.Description,{children:['Are you sure you want to remove the skill "',e,'"? This action cannot be undone.']})]}),o.jsxs(Ht.Footer,{children:[o.jsx(Ht.Cancel,{children:"Cancel"}),o.jsx(Ht.Action,{onClick:t,children:"Remove"})]})]})]})}const GGr=".agents/skills/",_ke=[{name:"name",label:"Skill",size:"1fr"},{name:"description",label:"Description",size:"2fr"}],L2t=[..._ke,{name:"actions",label:"",size:"48px"}];function YGr(e,t){if(!e||!t||t.length===0)return null;for(const n of t)if(e.startsWith(n+"/")||e===n)return n;return null}function XGr({skills:e,isLoading:t,isSkillsConfigured:n=!0,hasUndiscoveredAgentSkills:r=!1,basePath:s="/workspace/skills",onAddSkill:a,onUpdateSkill:i,onRemoveSkill:l,updatingSkillName:c,removingSkillName:u,mountPaths:d}){const{navigate:f}=cn(),p=d&&d.length>0,h=w=>w.path?.includes(GGr)??!1,m=e.some(h),g=!!l||!!i,v=g&&m,x=v?L2t:_ke;return!n&&!t?o.jsx(JGr,{onAddSkill:a}):t?o.jsx(KGr,{hasRowActions:g}):o.jsxs("div",{className:"space-y-4",children:[a&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(ce,{variant:"default",size:"sm",onClick:a,children:[o.jsx(Ne,{children:o.jsx(js,{className:"h-4 w-4"})}),"Add Skill"]})}),r&&o.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[o.jsx(Ny,{className:"h-5 w-5 text-amber-500 shrink-0 mt-0.5"}),o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"font-medium text-amber-500",children:"Skills installed but not discovered"}),o.jsxs("p",{className:"text-neutral4 mt-1",children:["You have skills in ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4 text-xs",children:".agents/skills"})," that aren't being discovered. Add this path to your workspace skills configuration to see them."]})]})]}),o.jsx(Ra,{children:o.jsxs(Ra.Trim,{children:[o.jsx(Ra.Header,{columns:x}),e.length>0?o.jsx(Ra.Entries,{children:e.map(w=>{const S={id:w.path,name:w.name,description:w.description||"—"},_=p?YGr(w.path,d):null;return o.jsxs(Ra.Entry,{entry:S,columns:x,onClick:()=>{const O=`${s}/${encodeURIComponent(w.name)}?path=${encodeURIComponent(w.path)}`;f(O)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5",children:o.jsx(Yj,{className:"h-3.5 w-3.5 text-neutral4"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"font-medium text-neutral6",children:w.name}),w.path&&o.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[_&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral3 shrink-0",children:_}),o.jsx("span",{className:"text-[11px] text-neutral3 truncate",title:w.path,children:w.path})]})]})]}),o.jsx(Ra.EntryText,{children:w.description||"—"}),v&&o.jsx("div",{className:"flex justify-end gap-1",onClick:O=>O.stopPropagation(),children:h(w)&&o.jsxs(o.Fragment,{children:[i&&o.jsx(WGr,{skillName:w.name,onUpdate:()=>i(w.name),isUpdating:c===w.name}),l&&o.jsx(QGr,{skillName:w.name,onRemove:()=>l(w.name),isRemoving:u===w.name})]})})]},w.path)})}):o.jsx(Ra.Message,{message:a?'No skills discovered. Click "Add Skill" to install from skills.sh.':"No skills discovered. Add SKILL.md files to your skills directory."})]})})]})}function KGr({hasRowActions:e}){const t=e?L2t:_ke;return o.jsx(Ra,{children:o.jsxs(Ra.Trim,{children:[o.jsx(Ra.Header,{columns:t}),o.jsx(Ra.Entries,{children:Array.from({length:3}).map((n,r)=>o.jsxs(Ra.Entry,{columns:t,isLoading:!0,children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-7 w-7 rounded bg-surface4 animate-pulse"}),o.jsxs("div",{children:[o.jsx("div",{className:"h-4 w-32 rounded bg-surface4 animate-pulse"}),o.jsx("div",{className:"h-3 w-40 rounded bg-surface4 animate-pulse mt-1"})]})]}),o.jsx("div",{className:"h-4 w-48 rounded bg-surface4 animate-pulse"}),e&&o.jsx("div",{className:"h-4 w-6 rounded bg-surface4 animate-pulse"})]},r))})]})})}function JGr({onAddSkill:e}){return o.jsx("div",{className:"grid place-items-center py-16",children:o.jsxs("div",{className:"flex flex-col items-center text-center max-w-md",children:[o.jsx("div",{className:"p-4 rounded-full bg-surface4 mb-4",children:o.jsx(Yj,{className:"h-8 w-8 text-neutral3"})}),o.jsx("h2",{className:"text-lg font-medium text-neutral6 mb-2",children:"Skills Not Configured"}),o.jsx("p",{className:"text-sm text-neutral4 mb-6",children:"No skills are configured in the workspace. Add SKILL.md files to your skills directory to discover and manage agent skills."}),o.jsxs("div",{className:"flex gap-3",children:[e&&o.jsxs(ce,{size:"lg",variant:"default",onClick:e,children:[o.jsx(Ne,{children:o.jsx(js,{className:"h-4 w-4"})}),"Add Skill from skills.sh"]}),o.jsxs(ce,{size:"lg",variant:"default",as:"a",href:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ne,{children:o.jsx(TUt,{className:"h-4 w-4"})}),"Learn about Skills"]})]})]})})}function eYr(e){switch(e.type){case"external":return{icon:o.jsx(Vx,{className:"h-3.5 w-3.5"}),label:"External Package",path:e.packagePath};case"local":return{icon:o.jsx($qt,{className:"h-3.5 w-3.5"}),label:"Local Project",path:e.projectPath};case"managed":return{icon:o.jsx(z3,{className:"h-3.5 w-3.5"}),label:"Managed",path:e.mastraPath}}}function tYr({skill:e,rawSkillMd:t,onReferenceClick:n}){const[r,s]=b.useState(new Set(["instructions"])),[a,i]=b.useState(!1),l=eYr(e.source),c=u=>{s(d=>{const f=new Set(d);return f.has(u)?f.delete(u):f.add(u),f})};return o.jsxs("div",{className:"space-y-6 min-w-0 overflow-hidden",children:[o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"p-3 rounded-lg bg-surface5",children:o.jsx(Yj,{className:"h-6 w-6 text-neutral4"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:e.name}),o.jsx("p",{className:"text-sm text-neutral4 mt-1",children:e.description})]})]}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[o.jsx(uA,{label:"Source",value:l.label,icon:l.icon}),o.jsx(uA,{label:"Path",value:e.path,icon:o.jsx(cj,{className:"h-3.5 w-3.5"})}),e.license&&o.jsx(uA,{label:"License",value:e.license}),e.compatibility!=null&&o.jsx(uA,{label:"Compatibility",value:e.compatibility}),o.jsx(uA,{label:"References",value:`${e.references.length} files`,icon:o.jsx(No,{className:"h-3.5 w-3.5"})})]}),o.jsx(I3,{title:"Instructions",isExpanded:r.has("instructions"),onToggle:()=>c("instructions"),headerAction:o.jsxs("button",{onClick:u=>{u.stopPropagation(),i(!a)},className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs text-neutral4 hover:text-neutral5 hover:bg-surface4 transition-colors",title:a?"Show rendered":"Show source",children:[a?o.jsx(Jo,{className:"h-3.5 w-3.5"}):o.jsx(J7t,{className:"h-3.5 w-3.5"}),a?"Rendered":"Source"]}),children:a?o.jsx("div",{style:{backgroundColor:"black"},className:"rounded-lg overflow-x-auto w-0 min-w-full",children:o.jsx(Z1e,{language:"markdown",style:W1e.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},children:t??e.instructions})}):o.jsx(OC,{children:e.instructions})}),e.references.length>0&&o.jsx(I3,{title:`References (${e.references.length})`,isExpanded:r.has("references"),onToggle:()=>c("references"),children:o.jsx("div",{className:"space-y-1",children:e.references.map(u=>o.jsxs("button",{onClick:()=>n?.(u),className:"flex items-center gap-2 w-full px-3 py-2 rounded hover:bg-surface4 text-left transition-colors",children:[o.jsx(No,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.scripts.length>0&&o.jsx(I3,{title:`Scripts (${e.scripts.length})`,isExpanded:r.has("scripts"),onToggle:()=>c("scripts"),children:o.jsx("div",{className:"space-y-1",children:e.scripts.map(u=>o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[o.jsx(O7t,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.assets.length>0&&o.jsx(I3,{title:`Assets (${e.assets.length})`,isExpanded:r.has("assets"),onToggle:()=>c("assets"),children:o.jsx("div",{className:"space-y-1",children:e.assets.map(u=>o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[o.jsx(_pe,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),o.jsx("div",{className:"pt-4 border-t border-border1",children:o.jsxs("p",{className:"text-xs text-neutral3",children:["Path: ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4",children:e.path})]})})]})}function z2t(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(t=>typeof t=="string"?t:JSON.stringify(t)).join(", ");if(typeof e=="object"&&e!==null){const t=Object.keys(e);if(t.length===0)return"{}";if(t.length===1){const n=t[0],r=e[n];return Array.isArray(r)?`${n}: ${r.join(", ")}`:`${n}: ${z2t(r)}`}return`{${t.join(", ")}}`}return String(e)}function uA({label:e,value:t,icon:n}){const r=z2t(t);return o.jsxs("div",{className:"p-3 rounded-lg bg-surface3",children:[o.jsx("p",{className:"text-xs text-neutral3 mb-1",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[n&&o.jsx("span",{className:"text-neutral4",children:n}),o.jsx("p",{className:"text-sm font-medium text-neutral5 truncate",title:r,children:r})]})]})}function I3({title:e,isExpanded:t,onToggle:n,headerAction:r,children:s}){return o.jsxs("div",{className:"border border-border1 rounded-lg overflow-hidden min-w-0",children:[o.jsxs("div",{className:"flex items-center bg-surface3 hover:bg-surface4 transition-colors",children:[o.jsxs("button",{onClick:n,className:"flex items-center gap-2 flex-1 px-4 py-3",children:[t?o.jsx(ws,{className:"h-4 w-4 text-neutral3"}):o.jsx(da,{className:"h-4 w-4 text-neutral3"}),o.jsx("span",{className:"text-sm font-medium text-neutral5",children:e})]}),r&&o.jsx("div",{className:"pr-3",children:r})]}),t&&o.jsx("div",{className:"p-4 bg-surface2 overflow-x-auto w-0 min-w-full",children:s})]})}function nYr({open:e,onOpenChange:t,skillName:n,referencePath:r,content:s,isLoading:a,error:i}){const{isCopied:l,copyToClipboard:c}=z7({copiedDuration:2e3});if(!e)return null;const u=()=>{s&&c(s)};return o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[o.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),o.jsxs("div",{className:"relative w-full max-w-4xl max-h-[85vh] mx-4 bg-surface2 rounded-xl border border-border1 shadow-2xl flex flex-col overflow-hidden",role:"dialog","aria-modal":"true","aria-labelledby":"reference-viewer-title",onKeyDown:d=>{d.key==="Escape"&&t(!1)},children:[o.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border1 bg-surface3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-1.5 rounded bg-surface5",children:o.jsx(No,{className:"h-4 w-4 text-neutral4"})}),o.jsxs("div",{children:[o.jsx("h2",{id:"reference-viewer-title",className:"text-base font-medium text-neutral6",children:r}),o.jsxs("p",{className:"text-xs text-neutral3",children:["from ",n]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ce,{size:"md",variant:"default",onClick:u,disabled:!s||a,children:[o.jsx(Ne,{children:l?o.jsx(ga,{className:"h-3.5 w-3.5 text-green-400"}):o.jsx(Fu,{className:"h-3.5 w-3.5"})}),l?"Copied!":"Copy"]}),o.jsx("button",{onClick:()=>t(!1),"aria-label":"Close reference viewer",className:"p-2 rounded-lg hover:bg-surface4 text-neutral3 hover:text-neutral5 transition-colors",children:o.jsx(Lr,{className:"h-4 w-4"})})]})]}),o.jsx("div",{className:"flex-1 overflow-auto p-6",children:a?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx("div",{className:"h-6 w-6 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})}):i?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load reference"}),o.jsx("p",{className:"text-sm text-neutral3",children:i})]}):s?o.jsx("pre",{className:"whitespace-pre-wrap text-sm text-neutral5 font-mono bg-surface3 p-4 rounded-lg overflow-auto",children:s}):o.jsx("div",{className:"flex items-center justify-center py-12 text-neutral3",children:"No content available"})})]})]})}function NQe(e){return`${e.topSource}/${e.name}`}function AQe(e){const t=ZMt(e.topSource,e.name);return t?`${t.owner}/${t.repo}/${e.name}`:null}function rYr({open:e,onOpenChange:t,workspaceId:n,onInstall:r,isInstalling:s,installedSkillIds:a=[],installedSkillNames:i=[],writableMounts:l,installedSkillPaths:c}){const[u,d]=b.useState(""),[f,p]=b.useState(null),[h,m]=b.useState(l&&l.length>0?l[0]?.path:void 0),{data:g,isLoading:v}=q7r(n),x=U7r(n),w=b.useMemo(()=>f?.topSource?ZMt(f.topSource,f.name):null,[f]),S=b.useMemo(()=>!w||!f?null:`https://skills.sh/${w.owner}/${w.repo}/${f.name}`,[w,f]),{data:_,isLoading:O}=V7r(n,w?.owner,w?.repo,f?.name,{enabled:!!w&&!!f}),E=Ik(M=>{M.trim().length>=2&&x.mutate(M)},300),T=b.useCallback(M=>{d(M),E(M)},[E]),j=b.useMemo(()=>u.trim().length>=2?x.data?.skills??[]:g?.skills??[],[u,x.data,g]),N=x.isPending,I=u.trim().length>=2,P=b.useMemo(()=>{if(!f)return!1;const M=AQe(f);return!!(M&&a.includes(M)||i.includes(f.name))},[f,a,i]),R=b.useCallback(()=>{!f||!w||r({repository:`${w.owner}/${w.repo}`,skillName:f.name,mount:l&&l.length>1?h:void 0})},[f,w,r,l,h]),B=b.useCallback(M=>{M||(d(""),p(null),m(l?.[0]?.path)),t(M)},[t,l]);return o.jsx($r,{open:e,onOpenChange:B,children:o.jsxs(Ar,{className:"max-w-4xl h-[80vh] flex flex-col",children:[o.jsxs(Mr,{children:[o.jsx(Ir,{children:"Add Skill"}),o.jsx(fa,{children:"Search and install skills from the community registry"})]}),o.jsxs(ts,{className:"flex-1 flex flex-col gap-4 overflow-hidden max-h-none",children:[o.jsxs("div",{className:"relative",children:[o.jsx(dj,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral3"}),o.jsx(mn,{placeholder:"Search skills...",value:u,onChange:M=>T(M.target.value),className:"pl-9"})]}),o.jsxs("div",{className:"flex flex-1 gap-4 min-h-0",children:[o.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[o.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:I?"Search Results":"Popular Skills"}),o.jsx(ea,{className:"flex-1 border border-border1 rounded-lg",children:v||N?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx(Xa,{className:"h-6 w-6 animate-spin text-neutral3"})}):j.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-neutral4",children:[o.jsx(Vx,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:I?"No skills found":"No skills available"})]}):o.jsx("div",{className:"p-2 space-y-1",children:j.map(M=>{const L=NQe(M),U=AQe(M),z=U&&a.includes(U)||i.includes(M.name),q=f?NQe(f):null;return o.jsx("button",{onClick:()=>p(M),className:Y("w-full text-left px-3 py-2 rounded-md transition-colors","hover:bg-surface4",q===L&&"bg-surface5 border border-accent1"),children:o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium text-sm text-neutral6 truncate",children:M.name}),z&&o.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-accent1/20 text-accent1",children:[o.jsx(ga,{className:"h-2.5 w-2.5"}),"Installed"]})]}),o.jsx("div",{className:"text-xs text-neutral4 truncate",children:M.topSource})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral3 shrink-0",children:[o.jsx(tE,{className:"h-3 w-3"}),o.jsx("span",{children:M.installs.toLocaleString()})]})]})},L)})})})]}),o.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[o.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:"Preview"}),o.jsx("div",{className:"flex-1 border border-border1 rounded-lg overflow-hidden flex flex-col",children:f?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-4 border-b border-border1 bg-surface3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"p-2 rounded-lg bg-surface5",children:o.jsx(Yj,{className:"h-5 w-5 text-neutral4"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-semibold text-neutral6 truncate",children:f.name}),o.jsxs("div",{className:"flex items-center gap-3 mt-1 text-xs text-neutral4",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Oqt,{className:"h-3 w-3"}),f.topSource]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(tE,{className:"h-3 w-3"}),f.installs.toLocaleString()," installs"]})]})]}),w&&o.jsx("a",{href:`https://github.com/${w.owner}/${w.repo}`,target:"_blank",rel:"noopener noreferrer",className:"text-neutral4 hover:text-neutral5 transition-colors",title:"View on GitHub",children:o.jsx(Fa,{className:"h-4 w-4"})})]})}),O?o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xa,{className:"h-6 w-6 animate-spin text-neutral3"})}):_?o.jsx(ea,{className:"flex-1",children:o.jsx("div",{className:"p-4",children:o.jsx(OC,{children:_})})}):o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-neutral4",children:[o.jsx(Vx,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:"Preview unavailable"}),S&&o.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs mt-2 text-accent1 hover:underline flex items-center gap-1",children:["View on skills.sh ",o.jsx(Fa,{className:"h-3 w-3"})]})]})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-neutral4",children:[o.jsx(Vx,{className:"h-8 w-8 mb-2"}),o.jsx("p",{className:"text-sm",children:"Select a skill to preview"})]})})]})]}),f&&o.jsxs("div",{className:"flex flex-col gap-3 pt-4 border-t border-border1",children:[l&&l.length>1&&o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-surface3 border border-border1",children:[o.jsx(zc,{className:"h-4 w-4 text-icon4 shrink-0"}),o.jsx("label",{htmlFor:"mount-select",className:"text-sm text-icon5 whitespace-nowrap font-medium",children:"Install to"}),o.jsx("select",{id:"mount-select",value:h??"",onChange:M=>m(M.target.value),className:"flex-1 text-sm px-3 py-1.5 rounded-md border border-border1 bg-surface2 text-icon6",children:l.map(M=>{const L=M.displayName??M.name??M.provider??"unknown";return o.jsxs("option",{value:M.path,children:[L," (",M.path,")"]},M.path)})})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[P&&l&&l.length>1&&f&&c?.[f.name]&&(()=>{const M=c[f.name],L=l.find(U=>M.startsWith(U.path+"/")||M===U.path);return L?o.jsxs("span",{className:"text-xs text-icon4",children:["Installed at ",L.path]}):null})(),o.jsx(ce,{variant:"default",onClick:()=>B(!1),children:"Cancel"}),o.jsx(ce,{variant:"primary",onClick:R,disabled:!w||s||P,"data-testid":"install-skill-button",children:s?o.jsxs(o.Fragment,{children:[o.jsx(Xa,{className:"h-4 w-4 mr-2 animate-spin"}),"Installing..."]}):P?o.jsxs(o.Fragment,{children:[o.jsx(ga,{className:"h-4 w-4 mr-2"}),"Already Installed"]}):o.jsxs(o.Fragment,{children:[o.jsx(tE,{className:"h-4 w-4 mr-2"}),"Install"]})})]})]})]})]})})}function IQe(){const{workspaceId:e}=ya(),[t,n]=go(),r=Yu(),[s,a]=b.useState(!1),[i,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState(null),[p,h]=b.useState(null),[m,g]=b.useState(!1),v=t.get("file"),x=t.get("tab"),{data:w,error:S,isLoading:_}=VMt(),O=w?.workspaces??[],E=e??O[0]?.id,{data:T,isLoading:j,error:N}=I7r(E),I=Fs(S)||Fs(N),P=$s(S)||$s(N),R=t.get("path")||".",B=qfe(S)||qfe(N),M=E?O.find(Fe=>Fe.id===E):void 0,L=Fe=>{const Ke=new URLSearchParams(t);for(const[rt,_t]of Object.entries(Fe))_t===null?Ke.delete(rt):Ke.set(rt,_t);n(Ke)},U=Fe=>{g(!1),a(!1),r(`/workspaces/${Fe}`)},z=Fe=>{L({path:Fe==="."||Fe===""?null:Fe,file:null})},q=Fe=>{L({file:Fe})},Z=Fe=>{L({tab:Fe})},D=R,G=v,{data:V,isLoading:$,error:W,refetch:Q}=R7r(D,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:E}),J=$7r(),ae=M7r(),{data:te,isLoading:re}=HMt(G??"",{enabled:!!G,workspaceId:E}),{data:ie,isLoading:pe,refetch:X}=L7r({workspaceId:E}),ne=H7r(),le=Z7r(),ge=W7r(),de=T?.isWorkspaceConfigured??!1,ue=T?.capabilities?.hasFilesystem??!1,be=T?.capabilities?.hasSkills??!1,ke=T?.capabilities?.canBM25??!1,Ie=T?.capabilities?.canVector??!1,K=M?.safety?.readOnly??!1,oe=ue&&!K,we=T?.mounts,Pe=we?.filter(Fe=>!Fe.readOnly).map(Fe=>({path:Fe.path,displayName:Fe.displayName,icon:Fe.icon,provider:Fe.provider,name:Fe.name})),Le=we&&we.length>1?we.map(Fe=>Fe.path):void 0,ve=b.useCallback(Fe=>{E&&ne.mutate({...Fe,workspaceId:E},{onSuccess:async Ke=>{if(Ke.success){u(!1);const{data:rt,error:_t}=await X();if(_t||!rt){ze.success(`Skill "${Ke.skillName}" installed successfully (${Ke.filesWritten} files)`);return}rt.skills.some(un=>un.name===Ke.skillName)?ze.success(`Skill "${Ke.skillName}" installed successfully (${Ke.filesWritten} files)`):(g(!0),ze.warning(`Skill "${Ke.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else ze.error("Failed to install skill")},onError:Ke=>{ze.error(`Failed to install skill: ${Ke instanceof Error?Ke.message:"Unknown error"}`)}})},[E,ne,X]),Ee=b.useCallback(Fe=>{E&&(h(Fe),le.mutate({workspaceId:E,skillName:Fe},{onSuccess:Ke=>{if(h(null),Ke.updated.length>0){const rt=Ke.updated[0];rt.success?(ze.success(`Skill "${Fe}" updated successfully (${rt.filesWritten} files)`),X()):ze.error(`Failed to update skill: ${rt.error??"Unknown error"}`)}else ze.error("Failed to update skill: No update result returned")},onError:Ke=>{h(null),ze.error(`Failed to update skill: ${Ke instanceof Error?Ke.message:"Unknown error"}`)}}))},[E,le,X]),ye=b.useCallback(Fe=>{E&&(f(Fe),ge.mutate({workspaceId:E,skillName:Fe},{onSuccess:Ke=>{f(null),Ke.success?(ze.success(`Skill "${Ke.skillName}" removed successfully`),X()):ze.error(`Failed to remove skill "${Ke.skillName}"`)},onError:Ke=>{f(null),ze.error(`Failed to remove skill: ${Ke instanceof Error?Ke.message:"Unknown error"}`)}}))},[E,ge,X]),De=x==="files"&&ue?"files":x==="skills"&&be?"skills":ue?"files":be?"skills":"files",ut=ie?.skills??[],jt=ie?.isSkillsConfigured??!1,bn=V?.entries??[],Ve=ue&&(ke||Ie),He=be&&jt&&ut.length>0,Re=Ve||He;if(_)return o.jsx(ir,{title:"Workspace",icon:o.jsx(zc,{}),children:o.jsx(Bt,{})});if(I)return o.jsx(ir,{title:"Workspace",icon:o.jsx(zc,{}),children:o.jsx(ca,{})});if(P)return o.jsx(ir,{title:"Workspace",icon:o.jsx(zc,{}),children:o.jsx(Js,{resource:"workspaces"})});if(B)return o.jsx(ir,{title:"Workspace",icon:o.jsx(zc,{}),children:o.jsx(UGr,{})});const Qe=S||N;return Qe?o.jsx(ir,{title:"Workspace",icon:o.jsx(zc,{}),children:o.jsx(nc,{title:"Failed to load workspace",message:Qe.message})}):!_&&O.length===0?o.jsx(ir,{title:"Workspace",icon:o.jsx(zc,{}),children:o.jsx(FGr,{})}):!j&&!_&&!de?o.jsx(ir,{title:"Workspace",icon:o.jsx(zc,{}),children:o.jsx(BGr,{})}):o.jsxs(pt,{children:[o.jsx(pt.TopArea,{children:o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsxs(Or,{children:[o.jsxs(Or.Title,{children:[o.jsx(zc,{})," Workspace"]}),o.jsx(Or.Description,{children:"Manage files, skills, and search your workspace"})]})}),o.jsxs(pt.Column,{className:"flex justify-end gap-2",children:[Re&&o.jsx(Kr,{onClick:()=>a(!s),tooltipContent:"Search workspace","aria-label":"Search workspace",children:o.jsx(dj,{})}),o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workspaces documentation","aria-label":"Workspaces documentation",children:o.jsx(po,{})})]})]})}),o.jsxs(pt.MainArea,{className:"grid content-start gap-6",children:[O.length>1&&o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>l(!i),className:"flex items-center gap-2 px-3 py-2 text-sm border border-border1 rounded-lg bg-surface2 hover:bg-surface3 transition-colors w-full max-w-md",children:[M?.source==="agent"?o.jsx(L3,{className:"h-4 w-4 text-accent1"}):o.jsx(z3,{className:"h-4 w-4 text-neutral4"}),o.jsxs("span",{className:"flex-1 text-left truncate",children:[M?.name??"Select workspace",M?.source==="agent"&&M.agentName&&o.jsxs("span",{className:"text-neutral4 ml-1",children:["(",M.agentName,")"]})]}),o.jsx(ws,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&o.jsx("div",{className:"absolute z-50 mt-1 w-full max-w-md bg-surface2 border border-border1 rounded-lg shadow-lg overflow-hidden",children:O.map(Fe=>o.jsxs("button",{onClick:()=>{U(Fe.id),l(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${M?.id===Fe.id?"bg-surface3":""}`,children:[Fe.source==="agent"?o.jsx(L3,{className:"h-4 w-4 text-accent1 shrink-0"}):o.jsx(z3,{className:"h-4 w-4 text-neutral4 shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:Fe.name}),o.jsx("div",{className:"text-xs text-neutral4 truncate",children:Fe.source==="agent"?`Agent: ${Fe.agentName}`:"Global workspace"})]}),o.jsxs("div",{className:"flex gap-1 shrink-0",children:[Fe.safety?.readOnly&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),Fe.capabilities.hasFilesystem&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Fe.capabilities.hasSandbox&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Fe.capabilities.hasSkills&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Fe.id))})]}),O.length===1&&M&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[M.source==="agent"?o.jsx(L3,{className:"h-4 w-4 text-accent1"}):o.jsx(z3,{className:"h-4 w-4"}),o.jsx("span",{children:M.name}),M.source==="agent"&&M.agentName&&o.jsxs("span",{className:"text-neutral3",children:["(",M.agentName,")"]}),K&&o.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&Re&&E&&o.jsx(sYr,{workspaceId:E,canSearchFiles:Ve,canSearchSkills:He,canBM25:ke,canVector:Ie,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:Fe=>{L({file:Fe,tab:"files"})},onViewSkillResult:(Fe,Ke)=>{E&&r(`/workspaces/${E}/skills/${encodeURIComponent(Fe)}?path=${encodeURIComponent(Ke)}`)}},E),(ue||be)&&o.jsxs(ed,{value:De,onValueChange:Z,defaultTab:De,children:[o.jsxs(td,{children:[ue&&o.jsxs(Xr,{value:"files",children:[o.jsx(No,{className:"h-4 w-4"}),"Files"]}),be&&o.jsxs(Xr,{value:"skills",children:[o.jsx(i6,{className:"h-4 w-4"}),"Skills",jt&&ut.length>0&&o.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:ut.length})]})]}),ue&&o.jsx(Es,{value:"files",className:"pb-8",children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[o.jsx(MGr,{entries:bn,currentPath:D,isLoading:$,error:W,onNavigate:z,onFileSelect:q,onRefresh:()=>Q(),onCreateDirectory:K?void 0:Fe=>ae.mutate({path:Fe,workspaceId:E}),onDelete:K?void 0:Fe=>J.mutate({path:Fe,recursive:!0,force:!0,workspaceId:E})}),G&&o.jsx(zGr,{path:G,content:te?.content??"",isLoading:re,mimeType:te?.mimeType,onClose:()=>q(null)})]})}),be&&o.jsx(Es,{value:"skills",className:"pb-8",children:o.jsx(XGr,{skills:ut,isLoading:pe,isSkillsConfigured:jt,hasUndiscoveredAgentSkills:m,basePath:E?`/workspaces/${E}/skills`:"/workspaces",onAddSkill:oe?()=>u(!0):void 0,onUpdateSkill:oe?Ee:void 0,onRemoveSkill:oe?ye:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:Le})})]}),!ue&&!be&&!j&&o.jsx("div",{className:"py-12 text-center text-neutral4",children:o.jsx("p",{children:"No workspace capabilities are configured."})})]}),E&&oe&&o.jsx(rYr,{open:c,onOpenChange:u,workspaceId:E,onInstall:ve,isInstalling:ne.isPending,installedSkillIds:ut.filter(Fe=>Fe.skillsShSource).map(Fe=>`${Fe.skillsShSource.owner}/${Fe.skillsShSource.repo}/${Fe.name}`),installedSkillNames:ut.filter(Fe=>!Fe.skillsShSource).map(Fe=>Fe.name),writableMounts:Pe,installedSkillPaths:Object.fromEntries(ut.filter(Fe=>Fe.path).map(Fe=>[Fe.name,Fe.path]))})]})}function sYr({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:l}){const c=D7r(),u=B7r();return o.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[o.jsx(No,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&o.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",o.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",o.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),o.jsx(qGr,{onSearch:d=>c.mutate({...d,workspaceId:e}),isSearching:c.isPending,searchResults:c.data?{...c.data,results:c.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:r,canVector:s,onViewResult:i})]}),n&&o.jsxs("div",{children:[o.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[o.jsx(i6,{className:"h-4 w-4"}),"Search Skills"]}),o.jsx(HGr,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>l(d.skillName,d.skillPath)})]})]})}function aYr(e,t){return e==null||t==null?null:e in t?e:null}function iYr(){const{skillName:e,workspaceId:t}=ya(),[n]=go(),r=la(),s=e?decodeURIComponent(e):"",a=n.get("path"),i=a?decodeURIComponent(a):void 0,l=n.get("agentId"),c=l?decodeURIComponent(l):null,d=r.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=aYr(c,d),p=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[h,m]=b.useState(null),{data:g,isLoading:v,error:x}=z7r(s,{workspaceId:t,path:i}),{data:w}=HMt(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:S,isLoading:_}=F7r(s,h??"",{enabled:!!h,workspaceId:t,path:i}),O=E=>f?o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:p,children:[o.jsx(Ne,{children:o.jsx(L3,{className:"h-4 w-4"})}),f]}),o.jsxs(Fn,{as:"span",to:"",isCurrent:!0,children:[o.jsx(Ne,{children:o.jsx(i6,{className:"h-4 w-4"})}),E]})]}):o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:p,children:[o.jsx(Ne,{children:o.jsx(zc,{className:"h-4 w-4"})}),"Workspace"]}),o.jsxs(Fn,{as:ln,to:p,children:[o.jsx(Ne,{children:o.jsx(i6,{className:"h-4 w-4"})}),"Skills"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:E})]});return v?o.jsxs(Xn,{children:[o.jsx(Br,{children:O("Loading...")}),o.jsx("div",{className:"grid place-items-center h-full",children:o.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):x&&Fs(x)?o.jsxs(Xn,{children:[o.jsx(Br,{children:O("Session Expired")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})]}):x&&$s(x)?o.jsxs(Xn,{children:[o.jsx(Br,{children:O("Permission Denied")}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"workspaces"})})]}):x||!g?o.jsxs(Xn,{children:[o.jsx(Br,{children:O("Error")}),o.jsx("div",{className:"grid place-items-center h-full",children:o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),o.jsx("p",{className:"text-sm text-neutral3",children:x?.message??"Skill not found"})]})})]}):o.jsxs(Xn,{children:[o.jsxs(Br,{children:[O(g.name),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[o.jsx(Ne,{children:o.jsx(hw,{})}),"Documentation"]})})]}),o.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:o.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:o.jsx(tYr,{skill:g,rawSkillMd:w?.content,onReferenceClick:m})})}),o.jsx(nYr,{open:!!h,onOpenChange:E=>!E&&m(null),skillName:g.name,referencePath:h??"",content:S?.content,isLoading:_})]})}const F2t=()=>{const e=window.MASTRA_CLOUD_API_ENDPOINT;return{isMastraPlatform:!!e,mastraPlatformEndpoint:e}},oYr=[{key:"primitives",title:"Primitives",href:"/primitives",links:[{name:"Agents",url:"/agents",icon:o.jsx(Ma,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:o.jsx(No,{}),isOnMastraPlatform:!0,indent:!0},{name:"Workflows",url:"/workflows",icon:o.jsx(uo,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:o.jsx(m1,{}),isOnMastraPlatform:!1,indent:!0,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:o.jsx(Gl,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:o.jsx(co,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"tools:read"},{name:"Workspaces",url:"/workspaces",icon:o.jsx(zc,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:o.jsx(uj,{}),isOnMastraPlatform:!0,indent:!0}]},{key:"evaluation",title:"Evaluation",href:"/evaluation",links:[{name:"Scorers",url:"/scorers",icon:o.jsx(si,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"scorers:read"},{name:"Datasets",url:"/datasets",icon:o.jsx(Ya,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]},{name:"Experiments",url:"/experiments",icon:o.jsx(gd,{}),isOnMastraPlatform:!0,indent:!0,requiredAnyPermission:["datasets:read"]}]},{key:"observability",title:"Observability",href:"/observability-overview",links:[{name:"Metrics",url:"/metrics",icon:o.jsx(TO,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"},{name:"Traces",url:"/observability",activePaths:["/traces"],icon:o.jsx(Jo,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"},{name:"Logs",url:"/logs",icon:o.jsx(rXe,{}),isOnMastraPlatform:!0,indent:!0,requiredPermission:"observability:read"}]},{key:"bottom",separator:!0,links:[{name:"Settings",url:"/settings",icon:o.jsx(Pbe,{}),isOnMastraPlatform:!1},{name:"Resources",url:"/resources",icon:o.jsx(po,{}),isOnMastraPlatform:!0}]}];function RQe(e,t){const n=r=>t===r||t.startsWith(r+"/");return n(e.url)?!0:e.activePaths?.some(n)??!1}function lYr(){const{Link:e}=cn(),{state:t}=qbe(),r=iu().pathname,{isMastraPlatform:s}=F2t(),{data:a}=tT(),{isCmsAvailable:i,isLoading:l}=U2(),{hasPermission:c,hasAnyPermission:u,rbacEnabled:d,isAuthenticated:f,isLoading:p}=_b(),h=a&&VM(a),m=new Set(["/prompts"]),g=v=>m.has(v.url)&&!i&&!l||s&&!v.isOnMastraPlatform?!1:d&&f&&p?!0:!(v.requiredPermission&&!c(v.requiredPermission)||v.requiredAnyPermission&&!u(v.requiredAnyPermission));return o.jsxs(qh,{children:[o.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:t==="collapsed"?o.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[o.jsx(t0,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),h&&o.jsx(Xfe,{})]}):h?o.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(t0,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),o.jsx(Xfe,{})]}):o.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[o.jsx(t0,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),o.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),o.jsx(qh.Nav,{children:oYr.map(v=>{const x=v.links.filter(g),w=x.length>0&&v?.separator,S=x.some(O=>RQe(O,r)),_=!!(v.href&&r===v.href&&!S);return o.jsxs(qh.NavSection,{children:[v?.title?o.jsx(qh.NavHeader,{LinkComponent:e,state:t,href:v.href,isActive:_,children:v.title}):o.jsx(o.Fragment,{children:w&&o.jsx(qh.NavSeparator,{})}),o.jsx(qh.NavList,{children:x.map(O=>{const E=RQe(O,r);return o.jsx(qh.NavLink,{LinkComponent:e,state:t,link:O,isActive:E},O.name)})})]},v.key)})}),o.jsxs(qh.Bottom,{children:[t!=="collapsed"&&o.jsxs(o.Fragment,{children:[o.jsx(qh.NavSeparator,{}),o.jsx(O8r,{collapsed:!1})]}),o.jsx(qh.NavSeparator,{}),o.jsx("div",{className:"flex justify-end pb-3",children:o.jsx(qh.Trigger,{})})]})]})}function B2t({children:e,loginUrl:t="/login",signupUrl:n="/signup"}){const{data:r,isLoading:s}=tT();if(s)return o.jsx(o.Fragment,{children:e});if(!r?.enabled)return o.jsx(o.Fragment,{children:e});if(VM(r))return o.jsx(o.Fragment,{children:e});const a=typeof window<"u"?window.location.href:void 0;if(!r.login)return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[o.jsx(t0,{className:"h-16 w-16 opacity-50"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Authentication Required"}),o.jsx("p",{className:"max-w-sm text-neutral3",children:"This page requires authentication, but no login method is configured. Please contact your administrator."})]})]})});const i=()=>{const l=new URL(n,window.location.origin);a&&l.searchParams.set("redirect",a),window.location.href=l.toString()};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[o.jsx(t0,{className:"h-16 w-16 opacity-50"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Sign in to continue"}),o.jsx("p",{className:"max-w-sm text-neutral3",children:"You need to sign in to access this page."})]}),r.login.description&&o.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface2 p-3 text-left",children:[o.jsx(nXe,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),o.jsx("p",{className:"max-w-sm text-sm text-neutral3",children:r.login.description})]}),o.jsx(g2t,{config:r.login,redirectUri:a,loginUrl:t}),(r.login.type==="credentials"||r.login.type==="both")&&r.login.signUpEnabled!==!1&&o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"text-neutral3",children:"Don't have an account? "}),o.jsx("button",{type:"button",onClick:i,className:"text-neutral6 hover:underline",children:"Sign up"})]})]})})}const U2t="experimental-ui:",q2t="current",cYr=Te.createContext(null);function uYr(e,t){const n=window.localStorage.getItem(U2t+e);return n&&t.has(n)?n:q2t}function dYr({experiments:e,children:t}){const n=Te.useMemo(()=>new Map(e.map(c=>[c.key,new Set(c.variants.map(u=>u.value))])),[e]),[r,s]=Te.useState({});Te.useLayoutEffect(()=>{const c={};for(const u of e){const d=n.get(u.key);c[u.key]=uYr(u.key,d)}s(c)},[e,n]);const a=Te.useCallback(c=>r[c]??q2t,[r]),i=Te.useCallback((c,u)=>{window.localStorage.setItem(U2t+c,u),s(d=>({...d,[c]:u}))},[]),l=Te.useMemo(()=>({experiments:e,getVariant:a,setVariant:i}),[e,a,i]);return o.jsx(cYr.Provider,{value:l,children:t})}const fYr=[{key:"entity-list-page",name:"Entity List page UI",path:["/agents","/prompts","/tools","/datasets","/scorers","/mcps","/workflows","/processors"],variants:[{value:"current",label:"Current state"},{value:"new-proposal",label:"New proposal"}]}],pYr=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"}),hYr=()=>{const[e,t]=b.useState(!1),n=b.useCallback(()=>{t(r=>!r)},[]);return b.useEffect(()=>{const r=s=>{s.key==="k"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),n())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n]),{open:e,setOpen:t,toggle:n}},Oke=()=>{const{requestContext:e}=Us(),t=Ze();return Ot({queryKey:["processors"],queryFn:()=>t.listProcessors(e)})},V2t=(e,t)=>{const n=Ze(),{requestContext:r}=Us();return Ot({queryKey:["processor",e],queryFn:()=>n.getProcessor(e).details(r),enabled:!!e})},mYr=()=>{const e=Ze(),{requestContext:t}=Us();return ar({mutationFn:async({processorId:n,phase:r,messages:s,agentId:a})=>e.getProcessor(n).execute({phase:r,messages:s,agentId:a,requestContext:t})})},gYr=()=>{const{open:e,setOpen:t}=hYr(),{navigate:n,paths:r}=cn(),{isMastraPlatform:s}=F2t(),a=rWn(),{data:i={}}=Ov(),{data:l={}}=vw(),{data:c={}}=Jq(),{data:u={}}=Oke(),{data:d=[]}=z2(),{data:f={}}=ef(),p=w=>{n(w),t(!1)},h=Object.entries(i),m=Object.entries(l),g=Object.entries(c),v=Object.values(u).filter(w=>w.phases&&w.phases.length>0),x=Object.entries(f);return o.jsxs($Hn,{open:e,onOpenChange:t,title:"Navigation",description:"Search and navigate to any entity",children:[o.jsx(wbt,{placeholder:"Search or navigate..."}),o.jsxs(Sbt,{children:[o.jsx(kbt,{children:"No results found."}),o.jsxs(vx,{heading:"Navigation",children:[a&&o.jsxs(Cl,{value:"toggle sidebar collapse expand",onSelect:()=>{a.toggleSidebar(),t(!1)},children:[o.jsx(lXe,{className:"text-neutral3"}),o.jsx("span",{children:"Toggle Sidebar"}),o.jsx(_bt,{children:"Ctrl+B"})]}),o.jsxs(Cl,{value:"all agents",onSelect:()=>p("/agents"),children:[o.jsx(Ma,{className:"text-neutral3"}),o.jsx("span",{children:"All Agents"})]}),o.jsxs(Cl,{value:"all workflows",onSelect:()=>p("/workflows"),children:[o.jsx(uo,{className:"text-neutral3"}),o.jsx("span",{children:"All Workflows"})]}),o.jsxs(Cl,{value:"all tools",onSelect:()=>p("/tools"),children:[o.jsx(co,{className:"text-neutral3"}),o.jsx("span",{children:"All Tools"})]}),o.jsxs(Cl,{value:"all scorers",onSelect:()=>p("/scorers"),children:[o.jsx(si,{className:"text-neutral3"}),o.jsx("span",{children:"All Scorers"})]}),o.jsxs(Cl,{value:"all processors",onSelect:()=>p("/processors"),children:[o.jsx(m1,{className:"text-neutral3"}),o.jsx("span",{children:"All Processors"})]}),o.jsxs(Cl,{value:"all mcp servers",onSelect:()=>p("/mcps"),children:[o.jsx(Gl,{className:"text-neutral3"}),o.jsx("span",{children:"All MCP Servers"})]}),o.jsxs(Cl,{value:"observability traces",onSelect:()=>p("/observability"),children:[o.jsx(Jo,{className:"text-neutral3"}),o.jsx("span",{children:"Observability"})]}),!s&&o.jsxs(o.Fragment,{children:[o.jsxs(Cl,{value:"settings",onSelect:()=>p("/settings"),children:[o.jsx(Pbe,{className:"text-neutral3"}),o.jsx("span",{children:"Settings"})]}),o.jsxs(Cl,{value:"templates",onSelect:()=>p("/templates"),children:[o.jsx(Vx,{className:"text-neutral3"}),o.jsx("span",{children:"Templates"})]})]})]}),h.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(gS,{}),o.jsx(vx,{heading:"Agents",children:h.map(([w,S])=>o.jsxs(Te.Fragment,{children:[o.jsxs(Cl,{value:`${S.name} chat agent`,onSelect:()=>p(r.agentLink(w)),children:[o.jsx(Ma,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Chat"]})]}),o.jsxs(Cl,{value:`${S.name} traces agent observability`,onSelect:()=>p(`/observability?entity=${w}`),children:[o.jsx(Jo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Traces"]})]})]},w))})]}),m.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(gS,{}),o.jsx(vx,{heading:"Workflows",children:m.map(([w,S])=>o.jsxs(Te.Fragment,{children:[o.jsxs(Cl,{value:`${S.name} graph workflow view`,onSelect:()=>p(r.workflowLink(w)),children:[o.jsx(uo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Graph"]})]}),o.jsxs(Cl,{value:`${S.name} traces workflow observability`,onSelect:()=>p(`/observability?entity=${S.name}`),children:[o.jsx(Jo,{className:"text-neutral3"}),o.jsxs("span",{children:[S.name,": Traces"]})]})]},w))})]}),g.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(gS,{}),o.jsx(vx,{heading:"Tools",children:g.map(([w,S])=>o.jsxs(Cl,{value:`tool ${S.id}`,onSelect:()=>p(r.toolLink(w)),children:[o.jsx(co,{className:"text-neutral3"}),o.jsx("span",{children:S.id})]},w))})]}),x.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(gS,{}),o.jsx(vx,{heading:"Scorers",children:x.map(([w,S])=>{const _=S.scorer?.config?.name||S.scorer?.config?.id||w;return o.jsxs(Cl,{value:`scorer ${_}`,onSelect:()=>p(r.scorerLink(w)),children:[o.jsx(si,{className:"text-neutral3"}),o.jsx("span",{children:_})]},w)})})]}),v.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(gS,{}),o.jsx(vx,{heading:"Processors",children:v.map(w=>{const S=w.name||w.id,_=w.isWorkflow?r.workflowLink(w.id)+"/graph":r.processorLink(w.id);return o.jsxs(Cl,{value:`processor ${S}`,onSelect:()=>p(_),children:[o.jsx(m1,{className:"text-neutral3"}),o.jsx("span",{children:S})]},w.id)})})]}),d.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(gS,{}),o.jsx(vx,{heading:"MCP Servers",children:d.map(w=>o.jsxs(Cl,{value:`mcp server ${w.name}`,onSelect:()=>p(r.mcpServerLink(w.id)),children:[o.jsx(Gl,{className:"text-neutral3"}),o.jsx("span",{children:w.name})]},w.id))})]})]})]})};function vYr({children:e}){const{data:t,isFetched:n}=tT(),{pathname:r}=iu(),s=n&&t?.enabled&&!VM(t),a=n&&!s;return o.jsxs(o.Fragment,{children:[o.jsx(gYr,{}),o.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&o.jsx(lYr,{}),o.jsx("div",{className:Y("bg-transparent overflow-y-auto",{"h-[calc(100%-1.5rem)]":s}),children:o.jsx(B2t,{children:o.jsx(nGn,{resetKeys:[r],children:e})})})]})]})}const yYr=({children:e})=>{const{experimentalUIEnabled:t}=pYr();return o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(Xyt,{position:"bottom-right"}),o.jsx(nbt,{defaultTheme:"dark",children:o.jsx(Gd,{delayDuration:0,children:o.jsx(dYr,{experiments:t?fYr:[],children:o.jsx(aWn,{children:o.jsx(vYr,{children:e})})})})})]})},bYr=({children:e})=>o.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[o.jsx(Xyt,{position:"bottom-right"}),o.jsx(nbt,{defaultTheme:"dark",children:o.jsx(Gd,{delayDuration:0,children:o.jsx("div",{className:"h-full overflow-y-auto",children:o.jsx(B2t,{children:e})})})})]});function xYr({agentId:e}){return o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/agents",children:[o.jsx(Ne,{children:o.jsx(Ma,{})}),"Agents"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(gBr,{value:e,variant:"ghost"})})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[o.jsx(hw,{}),"Agents documentation"]})})]})}const wYr=({children:e})=>{const{agentId:t}=ya(),n=iu(),{isCmsAvailable:r}=U2(),{hasObservability:s}=T8r(),a=Jfe.has("datasets"),i=r&&a,l=s&&a,{data:c}=_p(t),u=Lu(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,p=n.pathname.includes("/editor")?"versions":n.pathname.includes("/evaluate")?"evaluate":n.pathname.includes("/review")?"review":n.pathname.includes("/traces")?"traces":"chat",h=(p==="versions"||p==="evaluate"||p==="review")&&(i||l),m=o.jsxs(Xn,{className:"grid-rows-[auto_auto_1fr]",children:[o.jsx(xYr,{agentId:t}),o.jsx(CVr,{agentId:t,activeTab:p,showPlayground:i,showObservability:l,rightSlot:h?o.jsx(jVr,{requestContextSchema:f}):void 0}),e]});return o.jsx(DM,{children:o.jsx(C9r,{defaultProvider:u,defaultModel:d,children:o.jsx(hVr,{children:o.jsx(j9r,{children:m})})})})},SYr=({children:e,options:t})=>{const n=new fqn({...t,defaultOptions:{...t?.defaultOptions,queries:{retry:aYn,...t?.defaultOptions?.queries}}});return o.jsx(pqn,{client:n,children:e})},kYr=()=>o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ki,{iconSlot:o.jsx(qd,{}),titleSlot:"No Processors yet",descriptionSlot:"Configure processors. Add input or output processors to your agents to transform messages.",actionSlot:o.jsxs(ce,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:["Processors Documentation ",o.jsx(Fa,{})]})})}),_Yr=["input","inputStep","outputStep","outputStream","outputResult"];function OYr({processors:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=cn(),a=b.useMemo(()=>Object.values(e??{}).filter(l=>l.phases&&l.phases.length>0),[e]),i=b.useMemo(()=>{const l=n.toLowerCase();return a.filter(c=>c.id.toLowerCase().includes(l)||(c.name||"").toLowerCase().includes(l))},[a,n]);return t?o.jsx(Md,{columns:"auto 1fr auto auto auto auto auto auto"}):o.jsxs(xe,{columns:"auto 1fr auto auto auto auto auto auto",children:[o.jsxs(xe.Top,{children:[o.jsx(xe.TopCell,{children:"Name"}),o.jsx(xe.TopCell,{children:"Description"}),o.jsx(xe.TopCellSmart,{long:"Input",short:"Input",tooltip:"Contains Input phase",className:"text-center"}),o.jsx(xe.TopCellSmart,{long:"Input Step",short:o.jsxs(o.Fragment,{children:[o.jsx(h0,{})," Step"]}),tooltip:"Contains Input Step phase",className:"text-center"}),o.jsx(xe.TopCellSmart,{long:"Output Step",short:o.jsxs(o.Fragment,{children:[o.jsx(zf,{})," Step"]}),tooltip:"Contains Output Step phase",className:"text-center"}),o.jsx(xe.TopCellSmart,{long:"Output Stream",short:o.jsxs(o.Fragment,{children:[o.jsx(zf,{})," Stream"]}),tooltip:"Contains Output Stream phase",className:"text-center"}),o.jsx(xe.TopCellSmart,{long:"Output Result",short:o.jsxs(o.Fragment,{children:[o.jsx(zf,{})," Result"]}),tooltip:"Contains Output Result phase",className:"text-center"}),o.jsx(xe.TopCellSmart,{short:"Used by",long:"Used by Agents",className:"text-center"})]}),i.length===0&&n?o.jsx(xe.NoMatch,{message:"No Processors match your search"}):null,i.map(l=>{const c=xh(l.name||l.id,50),u=xh(l.description??"",200),d=l.agentIds?.length??0,f=new Set(l.phases||[]),p=l.isWorkflow?r.workflowLink(l.id)+"/graph":r.processorLink(l.id);return o.jsxs(xe.RowLink,{to:p,LinkComponent:s,children:[o.jsx(xe.NameCell,{children:c}),o.jsx(xe.DescriptionCell,{children:u}),_Yr.map(h=>o.jsx(xe.TextCell,{className:"text-center",children:f.has(h)&&o.jsx(ga,{className:"size-4 mx-auto"})},h)),o.jsx(xe.TextCell,{className:"text-center",children:d||""})]},l.id)})]})}function EYr(){const{data:e={},isLoading:t,error:n}=Oke(),[r,s]=b.useState("");return n&&Fs(n)?o.jsx(ir,{title:"Processors",icon:o.jsx(om,{}),children:o.jsx(ca,{})}):n&&$s(n)?o.jsx(ir,{title:"Processors",icon:o.jsx(om,{}),children:o.jsx(Js,{resource:"processors"})}):n?o.jsx(ir,{title:"Processors",icon:o.jsx(om,{}),children:o.jsx(nc,{title:"Failed to load processors",message:n.message})}):Object.keys(e).length===0&&!t?o.jsx(ir,{title:"Processors",icon:o.jsx(om,{}),children:o.jsx(kYr,{})}):o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:t,children:[o.jsx(om,{})," Processors"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Processors documentation",children:o.jsx(po,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),o.jsx(OYr,{processors:e,isLoading:t,search:r})]})}function CYr({value:e,onValueChange:t,placeholder:n="Select a processor...",searchPlaceholder:r="Search processors...",emptyText:s="No processors found.",className:a,disabled:i=!1,variant:l="default"}){const{data:c={},isLoading:u,isError:d,error:f}=Oke(),{navigate:p,paths:h}=cn();b.useEffect(()=>{if(d){const v=f instanceof Error?f.message:"Failed to load processors";ze.error(`Error loading processors: ${v}`)}},[d,f]);const m=Object.keys(c).filter(v=>{const x=c[v];return x?.phases&&x.phases.length>0}).map(v=>({label:c[v]?.name||v,value:v})),g=v=>{t?t(v):v&&v!==e&&(c[v]?.isWorkflow?p(h.workflowLink(v)+"/graph"):p(h.processorLink(v)))};return o.jsx(jc,{options:m,value:e,onValueChange:g,placeholder:u?"Loading processors...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||d,variant:l})}const jYr={input:"Input - Process input messages before LLM (once at start)",inputStep:"Input Step - Process at each agentic loop step",outputStream:"Output Stream - Process streaming chunks",outputResult:"Output Result - Process complete output after streaming",outputStep:"Output Step - Process after each LLM response (before tools)"};function TYr({processorId:e}){const{data:t,isLoading:n,error:r}=V2t(e);return b.useEffect(()=>{if(r){const s=r instanceof Error?r.message:"Failed to load processor";ze.error(`Error loading processor: ${s}`)}},[r]),n?o.jsxs("div",{className:"p-6",children:[o.jsx(Dr,{className:"h-8 w-48 mb-4"}),o.jsx(Dr,{className:"h-32 w-full"})]}):r?null:t?o.jsx(NYr,{processor:t}):o.jsx("div",{className:"py-12 text-center px-6",children:o.jsx(me,{variant:"header-md",className:"text-neutral3",children:"Processor not found"})})}function NYr({processor:e}){const t=kb(),n=b.useId(),[r,s]=b.useState(e.phases[0]||"input"),[a,i]=b.useState(e.configurations[0]?.agentId||""),[l,c]=b.useState("Hello, this is a test message."),[u,d]=b.useState(null),[f,p]=b.useState(),h=mYr(),m=async()=>{p(void 0),d(null);const x=r==="outputStep"||r==="outputResult"?"assistant":"user",w=[{id:crypto.randomUUID(),role:x,createdAt:new Date,content:{format:2,parts:[{type:"text",text:l}]}}];try{const S=await h.mutateAsync({processorId:e.id,phase:r,messages:w,agentId:a||void 0});d(S),!S.success&&S.error&&p(S.error)}catch(S){p(S.message||"An error occurred")}},g=u?JSON.stringify(u,null,2):"{}";return o.jsxs(sp,{hasLeftServiceColumn:!0,className:"relative",children:[o.jsxs("div",{className:"bg-surface2 border-r border-border1 w-[22rem] overflow-y-auto",children:[o.jsx(AYr,{processor:e}),o.jsxs("div",{className:"p-5 space-y-5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),o.jsxs(Li,{value:r,onValueChange:v=>s(v),children:[o.jsx(_i,{className:"w-full",children:o.jsx(zi,{placeholder:"Select phase"})}),o.jsx(Oi,{children:e.phases.map(v=>o.jsx(xs,{value:v,children:v},v))})]}),o.jsx(me,{variant:"ui-xs",className:"text-neutral4",children:jYr[r]})]}),e.configurations.length>1&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Agent Configuration"}),o.jsxs(Li,{value:a,onValueChange:i,children:[o.jsx(_i,{className:"w-full",children:o.jsx(zi,{placeholder:"Select agent"})}),o.jsx(Oi,{children:e.configurations.map(v=>o.jsxs(xs,{value:v.agentId,children:[v.agentName," (",v.type,")"]},v.agentId))})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(me,{as:"label",htmlFor:n,variant:"ui-sm",className:"text-neutral3",children:"Test Message"}),o.jsx("textarea",{id:n,value:l,onChange:v=>c(v.target.value),placeholder:"Enter a test message...",rows:4,className:"w-full bg-transparent border border-border1 rounded-md p-3 text-ui-sm text-neutral6 placeholder:text-neutral3 focus:outline-hidden focus:ring-2 focus:ring-accent1"})]}),o.jsx(ce,{onClick:m,disabled:h.isPending||r==="outputStream",className:"w-full",children:h.isPending?"Running...":"Run Processor"}),r==="outputStream"&&o.jsx(me,{variant:"ui-xs",className:"text-accent6",children:"Output Stream phase cannot be executed directly. Use streaming instead."}),u&&o.jsxs("div",{className:"space-y-2 pt-4 border-t border-border1",children:[o.jsx(me,{variant:"ui-sm",className:"text-neutral3",children:"Status"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(kt,{variant:u.success?"success":"error",children:u.success?"Success":"Failed"}),u.tripwire?.triggered&&o.jsx(kt,{variant:"info",children:"Tripwire Triggered"})]}),u.tripwire?.triggered&&u.tripwire.reason&&o.jsxs("div",{className:"mt-2 p-3 bg-accent6Dark rounded-md border border-accent6/20",children:[o.jsx(me,{variant:"ui-sm",className:"text-accent6 font-medium",children:"Tripwire Reason"}),o.jsx(me,{variant:"ui-sm",className:"text-neutral3 mt-1",children:u.tripwire.reason})]})]})]})]}),o.jsx("div",{className:"absolute top-4 right-4 z-10",children:o.jsx(_a,{content:g,tooltip:"Copy JSON result to clipboard"})}),o.jsx("div",{className:"p-5 h-full relative overflow-x-auto overflow-y-auto",children:o.jsx(eu,{value:f||g,editable:!0,theme:t,extensions:[Bf]})})]})}function AYr({processor:e}){return o.jsxs("div",{className:"px-5 pt-5 pb-4 border-b border-border1",children:[o.jsx(me,{variant:"header-md",className:"text-neutral1 mb-2",children:e.name||e.id}),e.name&&e.name!==e.id&&o.jsx(me,{variant:"ui-sm",className:"text-neutral4 mb-3",children:e.id}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:e.phases.map(t=>o.jsx(kt,{variant:"default",children:t},t))}),o.jsx("div",{className:"mt-3",children:o.jsxs(me,{variant:"ui-xs",className:"text-neutral4",children:["Attached to ",e.configurations.length," agent",e.configurations.length!==1?"s":""]})})]})}function IYr(){const{processorId:e}=ya(),{data:t,isLoading:n,error:r}=V2t(e);return r&&Fs(r)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/processors",children:[o.jsx(Ne,{children:o.jsx(om,{})}),"Processors"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:e})]})}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ca,{})})]}):r&&$s(r)?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/processors",children:[o.jsx(Ne,{children:o.jsx(om,{})}),"Processors"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:e})]})}),o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Js,{resource:"processors"})})]}):!n&&t?.isWorkflow?o.jsx(ZYt,{to:`/workflows/${e}/graph`,replace:!0}):n?o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsx(Br,{children:o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/processors",children:[o.jsx(Ne,{children:o.jsx(om,{})}),"Processors"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(Dr,{className:"h-6 w-32"})})]})}),o.jsxs("div",{className:"p-6",children:[o.jsx(Dr,{className:"h-8 w-48 mb-4"}),o.jsx(Dr,{className:"h-32 w-full"})]})]}):o.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[o.jsxs(Br,{children:[o.jsxs(wi,{children:[o.jsxs(Fn,{as:ln,to:"/processors",children:[o.jsx(Ne,{children:o.jsx(om,{})}),"Processors"]}),o.jsx(Fn,{as:"span",to:"",isCurrent:!0,children:o.jsx(CYr,{value:e,variant:"ghost"})})]}),o.jsx(Ku,{children:o.jsxs(ce,{as:ln,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[o.jsx(hw,{}),"Processors documentation"]})})]}),o.jsx(TYr,{processorId:e})]})}function RYr(){const{data:e={},isLoading:t,error:n}=Ov(),{data:r={},isLoading:s,error:a}=Jq(),[i,l]=b.useState(""),c=t||s,u=a||n;return u&&Fs(u)?o.jsx(ir,{title:"Tools",icon:o.jsx(co,{}),children:o.jsx(ca,{})}):u&&$s(u)?o.jsx(ir,{title:"Tools",icon:o.jsx(co,{}),children:o.jsx(Js,{resource:"tools"})}):u?o.jsx(ir,{title:"Tools",icon:o.jsx(co,{}),children:o.jsx(nc,{title:"Failed to load tools",message:u.message})}):Object.keys(r).length===0&&!c?o.jsx(ir,{title:"Tools",icon:o.jsx(co,{}),children:o.jsx(gQr,{})}):o.jsxs(pt,{children:[o.jsxs(pt.TopArea,{children:[o.jsxs(pt.Row,{children:[o.jsx(pt.Column,{children:o.jsx(Or,{children:o.jsxs(Or.Title,{isLoading:c,children:[o.jsx(co,{})," Tools"]})})}),o.jsx(pt.Column,{className:"flex justify-end gap-2",children:o.jsx(Kr,{as:"a",href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Tools documentation",children:o.jsx(po,{})})})]}),o.jsx("div",{className:"max-w-120",children:o.jsx(Lm,{onSearch:l,label:"Filter tools",placeholder:"Filter by name"})})]}),o.jsx(mQr,{tools:r,agents:e,isLoading:c,search:i})]})}const H2t={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,n,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${n?`&path=${encodeURIComponent(n)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,n)=>n?`/agents/${e}/chat/${t}?messageId=${n}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,schedulesLink:()=>"/workflows/schedules",scheduleLink:e=>`/workflows/schedules/${encodeURIComponent(e)}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${Io()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspacesLink:()=>"/workspaces",processorsLink:()=>"/processors",processorLink:e=>`/processors/${e}`,mcpServerLink:e=>`/mcps/${e}`,mcpServerToolLink:(e,t)=>`/mcps/${e}/tools/${t}`,workflowRunLink:(e,t)=>`/workflows/${e}/graph/${t}`,datasetLink:e=>`/datasets/${e}`,datasetItemLink:(e,t)=>`/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/datasets/${e}/experiments/${t}`,experimentLink:e=>`/experiments/${e}`},PYr=()=>{const e=Yu(),t=n=>e(n,{viewTransition:!0});return o.jsx(g0t,{Link:j7,navigate:t,paths:H2t,children:o.jsx(yYr,{children:o.jsx(HE,{})})})},$Yr=()=>{const e=Yu(),t=n=>e(n,{viewTransition:!0});return o.jsx(g0t,{Link:j7,navigate:t,paths:H2t,children:o.jsx(bYr,{children:o.jsx(HE,{})})})},MYr=!!window.MASTRA_CLOUD_API_ENDPOINT,PQe=Jfe.has("datasets"),$Qe=[{index:!0,element:o.jsx(_Hr,{})},{path:"instruction-blocks",element:o.jsx(OHr,{})},{path:"tools",element:o.jsx(THr,{})},{path:"agents",element:o.jsx(wHr,{})},{path:"scorers",element:o.jsx(CHr,{})},{path:"workflows",element:o.jsx(AHr,{})},{path:"skills",element:o.jsx(jHr,{})},{path:"memory",element:o.jsx(EHr,{})},{path:"variables",element:o.jsx(NHr,{})}],DYr=[{path:"/login",element:o.jsx(lQr,{})},{path:"/signup",element:o.jsx(XQr,{})},{element:o.jsx($Yr,{}),children:[{path:"/agents/:agentId/session",element:o.jsx(eQe,{})},{path:"/agents/:agentId/session/:threadId",element:o.jsx(eQe,{})}]},{element:o.jsx(PYr,{}),children:[...MYr?[]:[{path:"/settings",element:o.jsx(YQr,{})},{path:"/templates",element:o.jsx(tGr,{})},{path:"/templates/:templateSlug",element:o.jsx(lGr,{})}],{path:"/logs",element:o.jsx(cQr,{})},{path:"/primitives",element:o.jsx(UQr,{})},{path:"/evaluation",element:o.jsx(aQr,{})},{path:"/scorers",element:o.jsx(WQr,{})},{path:"/scorers/:scorerId",element:o.jsx(QQr,{})},{path:"/metrics",element:o.jsx(DQr,{})},{path:"/observability-overview",element:o.jsx(FQr,{})},{path:"/observability",element:o.jsx(mGr,{})},{path:"/traces/:traceId",element:o.jsx(gGr,{})},{path:"/resources",element:o.jsx(ZQr,{})},{path:"/agents",element:o.jsx(vpr,{})},{path:"/cms/agents/create",element:o.jsx(SHr,{}),children:$Qe},{path:"/cms/agents/:agentId/edit",element:o.jsx(kHr,{}),children:$Qe},{path:"/cms/scorers/create",element:o.jsx($Hr,{})},{path:"/cms/scorers/:scorerId/edit",element:o.jsx(DHr,{})},{path:"/prompts",element:o.jsx(qQr,{})},{path:"/cms/prompts/create",element:o.jsx(IHr,{})},{path:"/cms/prompts/:promptBlockId/edit",element:o.jsx(PHr,{})},{path:"/agents/:agentId/tools/:toolId",element:o.jsx(cGr,{})},{path:"/agents/:agentId",element:o.jsx(wYr,{children:o.jsx(HE,{})}),children:[{index:!0,loader:({params:e})=>TZ(`/agents/${e.agentId}/chat`)},{path:"chat",element:o.jsx(KWe,{})},{path:"chat/:threadId",element:o.jsx(KWe,{})},...PQe?[{path:"editor",element:o.jsx(yHr,{})},{path:"evaluate",element:o.jsx(vHr,{})},{path:"review",element:o.jsx(bHr,{})}]:[],{path:"traces",element:o.jsx(xHr,{})}]},{path:"/tools",element:o.jsx(RYr,{})},{path:"/tools/:toolId",element:o.jsx(uGr,{})},{path:"/processors",element:o.jsx(EYr,{})},{path:"/processors/:processorId",element:o.jsx(IYr,{})},{path:"/mcps",element:o.jsx(pQr,{})},{path:"/mcps/:serverId",element:o.jsx(_Qr,{})},{path:"/mcps/:serverId/tools/:toolId",element:o.jsx(CQr,{})},{path:"/workspaces",element:o.jsx(IQe,{})},{path:"/workspaces/:workspaceId",element:o.jsx(IQe,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:o.jsx(iYr,{})},{path:"/workflows",element:o.jsx(vGr,{})},{path:"/workflows/schedules",element:o.jsx(IGr,{})},{path:"/workflows/schedules/:scheduleId",element:o.jsx(TGr,{})},{path:"/workflows/:workflowId",element:o.jsx(Kur,{children:o.jsx(HE,{})}),children:[{index:!0,loader:({params:e})=>TZ(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:o.jsx(TQe,{})},{path:"graph/:runId",element:o.jsx(TQe,{})}]},...PQe?[{path:"/datasets",element:o.jsx(DWr,{})},{path:"/datasets/:datasetId",element:o.jsx(zWr,{})},{path:"/datasets/:datasetId/items/:itemId",element:o.jsx(UWr,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:o.jsx(HWr,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:o.jsx(FWr,{})},{path:"/experiments",element:o.jsx(iQr,{})},{path:"/experiments/:experimentId",element:o.jsx(oQr,{})},{path:"/datasets/:datasetId/experiments",element:o.jsx(BWr,{})},{path:"/datasets/:datasetId/items",element:o.jsx(qWr,{})},{path:"/datasets/:datasetId/versions",element:o.jsx(WWr,{})}]:[],{index:!0,loader:()=>TZ("/agents")},{path:"/request-context",element:o.jsx(VQr,{})}]}];function LYr(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:s}=K1e(),a=b.useMemo(()=>t?cHr(t,r):void 0,[t,r]);if(s)return null;if(!t)return o.jsx(j8r,{});const i=yXt(DYr,{basename:e});return o.jsx(qQt,{baseUrl:t,headers:n,apiPrefix:r,customFetch:a,children:o.jsx(cpr,{children:o.jsx(qYt,{router:i})})})}function zYr(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",n=window.MASTRA_SERVER_PORT||4111,r=window.MASTRA_API_PREFIX||"/api",s=window.MASTRA_CLOUD_API_ENDPOINT||"",a=window.MASTRA_AUTO_DETECT_URL==="true",i=s||(a?window.location.origin:`${e}://${t}:${n}`);return o.jsx(SYr,{children:o.jsx(W9r,{endpoint:i,defaultApiPrefix:r,children:o.jsx(LYr,{})})})}n4t.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(zYr,{})}));const AJr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{SJe as A,bnt as B,_Je as C,ytt as D,dp as E,oh as F,AJr as G,Sa as I,S1 as L,wJe as N,GWt as a,dQt as b,NJr as c,$je as d,_1 as e,oQt as f,dE as g,uQt as h,Ck as i,jk as j,Ek as k,vsn as l,Ott as m,y1 as n,ei as o,Irn as p,Arn as q,Lhe as r,Vpe as s,se as t,y6 as u,dd as v,eQt as w,vt as x,it as y,Unt as z};
|