diff --git a/internal/dashboard/ui/dist/assets/index-l8iQ2u1V.js b/internal/dashboard/ui/dist/assets/index-BXEceZQg.js similarity index 98% rename from internal/dashboard/ui/dist/assets/index-l8iQ2u1V.js rename to internal/dashboard/ui/dist/assets/index-BXEceZQg.js index 1972b0d7..1493021e 100644 --- a/internal/dashboard/ui/dist/assets/index-l8iQ2u1V.js +++ b/internal/dashboard/ui/dist/assets/index-BXEceZQg.js @@ -43,4 +43,4 @@ Error generating stack: `+s.message+` A`).concat(O,",").concat(O,",0,1,").concat(N?0:1,`, `).concat(k.x,",").concat(k.y),P=_t(e.id)?uo("recharts-radial-line-"):e.id;return S.createElement("text",qr({},a,{dominantBaseline:"central",className:Re("recharts-radial-bar-label",c)}),S.createElement("defs",null,S.createElement("path",{id:P,d:M})),S.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Gq=(e,t,n)=>{var{cx:a,cy:l,innerRadius:o,outerRadius:c,startAngle:f,endAngle:d}=e,h=(f+d)/2;if(n==="outside"){var{x:v,y:p}=xt(a,l,c+t,h);return{x:v,y:p,textAnchor:v>=a?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:a,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(o+c)/2,{x,y:O}=xt(a,l,b,h);return{x,y:O,textAnchor:"middle",verticalAnchor:"middle"}},x0=e=>"cx"in e&&me(e.cx),Vq=(e,t)=>{var{parentViewBox:n,offset:a,position:l}=e,o;n!=null&&!x0(n)&&(o=n);var{x:c,y:f,upperWidth:d,lowerWidth:h,height:v}=t,p=c,b=c+(d-h)/2,x=(p+b)/2,O=(d+h)/2,w=p+d/2,_=v>=0?1:-1,E=_*a,N=_>0?"end":"start",T=_>0?"start":"end",k=d>=0?1:-1,M=k*a,P=k>0?"end":"start",L=k>0?"start":"end";if(l==="top"){var W={x:p+d/2,y:f-E,textAnchor:"middle",verticalAnchor:N};return mt(mt({},W),o?{height:Math.max(f-o.y,0),width:d}:{})}if(l==="bottom"){var re={x:b+h/2,y:f+v+E,textAnchor:"middle",verticalAnchor:T};return mt(mt({},re),o?{height:Math.max(o.y+o.height-(f+v),0),width:h}:{})}if(l==="left"){var H={x:x-M,y:f+v/2,textAnchor:P,verticalAnchor:"middle"};return mt(mt({},H),o?{width:Math.max(H.x-o.x,0),height:v}:{})}if(l==="right"){var $={x:x+O+M,y:f+v/2,textAnchor:L,verticalAnchor:"middle"};return mt(mt({},$),o?{width:Math.max(o.x+o.width-$.x,0),height:v}:{})}var K=o?{width:O,height:v}:{};return l==="insideLeft"?mt({x:x+M,y:f+v/2,textAnchor:L,verticalAnchor:"middle"},K):l==="insideRight"?mt({x:x+O-M,y:f+v/2,textAnchor:P,verticalAnchor:"middle"},K):l==="insideTop"?mt({x:p+d/2,y:f+E,textAnchor:"middle",verticalAnchor:T},K):l==="insideBottom"?mt({x:b+h/2,y:f+v-E,textAnchor:"middle",verticalAnchor:N},K):l==="insideTopLeft"?mt({x:p+M,y:f+E,textAnchor:L,verticalAnchor:T},K):l==="insideTopRight"?mt({x:p+d-M,y:f+E,textAnchor:P,verticalAnchor:T},K):l==="insideBottomLeft"?mt({x:b+M,y:f+v-E,textAnchor:L,verticalAnchor:N},K):l==="insideBottomRight"?mt({x:b+h-M,y:f+v-E,textAnchor:P,verticalAnchor:N},K):l&&typeof l=="object"&&(me(l.x)||Yr(l.x))&&(me(l.y)||Yr(l.y))?mt({x:c+Nn(l.x,O),y:f+Nn(l.y,v),textAnchor:"end",verticalAnchor:"end"},K):mt({x:w,y:f+v/2,textAnchor:"middle",verticalAnchor:"middle"},K)},Xq={angle:0,offset:5,zIndex:Vt.label,position:"middle",textBreakAll:!1};function Ca(e){var t=At(e,Xq),{viewBox:n,position:a,value:l,children:o,content:c,className:f="",textBreakAll:d,labelRef:h}=t,v=Iq(),p=uM(),b=a==="center"?p:v??p,x,O,w;if(n==null?x=b:x0(n)?x=n:x=_E(n),!x||_t(l)&&_t(o)&&!S.isValidElement(c)&&typeof c!="function")return null;var _=mt(mt({},t),{},{viewBox:x});if(S.isValidElement(c)){var{labelRef:E}=_,N=zO(_,kq);return S.cloneElement(c,N)}if(typeof c=="function"){var{content:T}=_,k=zO(_,zq);if(O=S.createElement(c,k),S.isValidElement(O))return O}else O=Hq(t);var M=tn(t);if(x0(x)){if(a==="insideStart"||a==="insideEnd"||a==="end")return Yq(t,a,O,M,x);w=Gq(x,t.offset,t.position)}else w=Vq(t,x);return S.createElement(ir,{zIndex:t.zIndex},S.createElement(yd,qr({ref:h,className:Re("recharts-label",f)},M,w,{textAnchor:Tq(M.textAnchor)?M.textAnchor:w.textAnchor,breakAll:d}),O))}Ca.displayName="Label";var Fq=(e,t,n)=>{if(!e)return null;var a={viewBox:t,labelRef:n};return e===!0?S.createElement(Ca,qr({key:"label-implicit"},a)):pr(e)?S.createElement(Ca,qr({key:"label-implicit",value:e},a)):S.isValidElement(e)?e.type===Ca?S.cloneElement(e,mt({key:"label-implicit"},a)):S.createElement(Ca,qr({key:"label-implicit",content:e},a)):bg(e)?S.createElement(Ca,qr({key:"label-implicit",content:e},a)):e&&typeof e=="object"?S.createElement(Ca,qr({},e,{key:"label-implicit"},a)):null};function Zq(e){var{label:t,labelRef:n}=e,a=uM();return Fq(t,a,n)||null}var fp={},dp={},LO;function Qq(){return LO||(LO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(dp)),dp}var hp={},UO;function Wq(){return UO||(UO=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(hp)),hp}var $O;function Jq(){return $O||($O=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qq(),n=Wq(),a=X0();function l(o){if(a.isArrayLike(o))return t.last(n.toArray(o))}e.last=l})(fp)),fp}var mp,qO;function eB(){return qO||(qO=1,mp=Jq().last),mp}var tB=eB();const nB=Qr(tB);var rB=["valueAccessor"],aB=["dataKey","clockWise","id","textBreakAll","zIndex"];function Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?nB(e.value):e.value,oM=S.createContext(void 0),uB=oM.Provider,sM=S.createContext(void 0),oB=sM.Provider;function sB(){return S.useContext(oM)}function cB(){return S.useContext(sM)}function Mc(e){var{valueAccessor:t=lB}=e,n=BO(e,rB),{dataKey:a,clockWise:l,id:o,textBreakAll:c,zIndex:f}=n,d=BO(n,aB),h=sB(),v=cB(),p=h||v;return!p||!p.length?null:S.createElement(ir,{zIndex:f??Vt.label},S.createElement(dn,{className:"recharts-label-list"},p.map((b,x)=>{var O,w=_t(a)?t(b,x):tt(b&&b.payload,a),_=_t(o)?{}:{id:"".concat(o,"-").concat(x)};return S.createElement(Ca,Sf({key:"label-".concat(x)},tn(b),d,_,{fill:(O=n.fill)!==null&&O!==void 0?O:b.fill,parentViewBox:b.parentViewBox,value:w,textBreakAll:c,viewBox:b.viewBox,index:x,zIndex:0}))})))}Mc.displayName="LabelList";function cM(e){var{label:t}=e;return t?t===!0?S.createElement(Mc,{key:"labelList-implicit"}):S.isValidElement(t)||bg(t)?S.createElement(Mc,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Mc,Sf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function S0(){return S0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r:a,className:l}=e,o=Re("recharts-dot",l);return me(t)&&me(n)&&me(a)?S.createElement("circle",S0({},Gn(e),G0(e),{className:o,cx:t,cy:n,r:a})):null},dM=e=>e.graphicalItems.polarItems,fB=V([it,Ro],Ky),gd=V([dM,lt,fB],Yy),dB=V([gd],Gy),bd=V([dB,Dy],Vy),hB=V([bd,lt,gd],Fy);V([bd,lt,gd],(e,t,n)=>n.length>0?e.flatMap(a=>n.flatMap(l=>{var o,c=tt(a,(o=t.dataKey)!==null&&o!==void 0?o:l.dataKey);return{value:c,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(a=>({value:tt(a,t.dataKey),errorDomain:[]})):e.map(a=>({value:a,errorDomain:[]})));var IO=()=>{},mB=V([bd,lt,gd,dd,it],Jy),vB=V([lt,Qy,Wy,IO,mB,IO,Ge,it],eg),hM=V([lt,Ge,bd,hB,zo,it,vB],tg),pB=V([hM,lt,ql],ag);V([lt,hM,pB,it],lg);var yB={radiusAxis:{},angleAxis:{}},mM=hn({name:"polarAxis",initialState:yB,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:KG,removeRadiusAxis:YG,addAngleAxis:GG,removeAngleAxis:VG}=mM.actions,gB=mM.reducer;function HO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function KO(e){for(var t=1;tt,xg=V([dM,wB],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),jB=[],Sg=(e,t,n)=>n?.length===0?jB:n,vM=V([Dy,xg,Sg],(e,t,n)=>{var{chartData:a}=e;if(t!=null){var l;if(t?.data!=null&&t.data.length>0?l=t.data:l=a,(!l||!l.length)&&n!=null&&(l=n.map(o=>KO(KO({},t.presentationProps),o.props))),l!=null)return l}}),OB=V([vM,xg,Sg],(e,t,n)=>{if(!(e==null||t==null))return e.map((a,l)=>{var o,c=tt(a,t.nameKey,t.name),f;return n!=null&&(o=n[l])!==null&&o!==void 0&&(o=o.props)!==null&&o!==void 0&&o.fill?f=n[l].props.fill:typeof a=="object"&&a!=null&&"fill"in a?f=a.fill:f=t.fill,{value:If(c,t.dataKey),color:f,payload:a,type:t.legendType}})}),_B=V([vM,xg,Sg,zt],(e,t,n,a)=>{if(!(t==null||e==null))return DI({offset:a,pieSettings:t,displayedData:e,cells:n})}),vp={exports:{}},Ye={};var YO;function AB(){if(YO)return Ye;YO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function O(w){if(typeof w=="object"&&w!==null){var _=w.$$typeof;switch(_){case e:switch(w=w.type,w){case n:case l:case a:case d:case h:case b:return w;default:switch(w=w&&w.$$typeof,w){case c:case f:case p:case v:return w;case o:return w;default:return _}}case t:return _}}}return Ye.ContextConsumer=o,Ye.ContextProvider=c,Ye.Element=e,Ye.ForwardRef=f,Ye.Fragment=n,Ye.Lazy=p,Ye.Memo=v,Ye.Portal=t,Ye.Profiler=l,Ye.StrictMode=a,Ye.Suspense=d,Ye.SuspenseList=h,Ye.isContextConsumer=function(w){return O(w)===o},Ye.isContextProvider=function(w){return O(w)===c},Ye.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Ye.isForwardRef=function(w){return O(w)===f},Ye.isFragment=function(w){return O(w)===n},Ye.isLazy=function(w){return O(w)===p},Ye.isMemo=function(w){return O(w)===v},Ye.isPortal=function(w){return O(w)===t},Ye.isProfiler=function(w){return O(w)===l},Ye.isStrictMode=function(w){return O(w)===a},Ye.isSuspense=function(w){return O(w)===d},Ye.isSuspenseList=function(w){return O(w)===h},Ye.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===l||w===a||w===d||w===h||typeof w=="object"&&w!==null&&(w.$$typeof===p||w.$$typeof===v||w.$$typeof===c||w.$$typeof===o||w.$$typeof===f||w.$$typeof===x||w.getModuleId!==void 0)},Ye.typeOf=O,Ye}var GO;function EB(){return GO||(GO=1,vp.exports=AB()),vp.exports}var NB=EB(),VO=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",XO=null,pp=null,pM=e=>{if(e===XO&&Array.isArray(pp))return pp;var t=[];return S.Children.forEach(e,n=>{_t(n)||(NB.isFragment(n)?t=t.concat(pM(n.props.children)):t.push(n))}),pp=t,XO=e,t};function yM(e,t){var n=[],a=[];return Array.isArray(t)?a=t.map(l=>VO(l)):a=[VO(t)],pM(e).forEach(l=>{var o=xi(l,"type.displayName")||xi(l,"type.name");o&&a.indexOf(o)!==-1&&n.push(l)}),n}var gM=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,yp={},FO;function TB(){return FO||(FO=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 l=n[Symbol.toStringTag];return l==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${l}]`}let a=n;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(n)===a}e.isPlainObject=t})(yp)),yp}var gp,ZO;function MB(){return ZO||(ZO=1,gp=TB().isPlainObject),gp}var CB=MB();const DB=Qr(CB);var QO,WO,JO,e_,t_;function n_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function r_(e){for(var t=1;t{var o=n-a,c;return c=ct(QO||(QO=Vu(["M ",",",""])),e,t),c+=ct(WO||(WO=Vu(["L ",",",""])),e+n,t),c+=ct(JO||(JO=Vu(["L ",",",""])),e+n-o/2,t+l),c+=ct(e_||(e_=Vu(["L ",",",""])),e+n-o/2-a,t+l),c+=ct(t_||(t_=Vu(["L ",","," Z"])),e,t),c},RB={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},LB=e=>{var t=At(e,RB),{x:n,y:a,upperWidth:l,lowerWidth:o,height:c,className:f}=t,{animationEasing:d,animationDuration:h,animationBegin:v,isUpdateAnimationActive:p}=t,b=S.useRef(null),[x,O]=S.useState(-1),w=S.useRef(l),_=S.useRef(o),E=S.useRef(c),N=S.useRef(n),T=S.useRef(a),k=ed(e,"trapezoid-");if(S.useEffect(()=>{if(b.current&&b.current.getTotalLength)try{var ue=b.current.getTotalLength();ue&&O(ue)}catch{}},[]),n!==+n||a!==+a||l!==+l||o!==+o||c!==+c||l===0&&o===0||c===0)return null;var M=Re("recharts-trapezoid",f);if(!p)return S.createElement("g",null,S.createElement("path",wf({},tn(t),{className:M,d:a_(n,a,l,o,c)})));var P=w.current,L=_.current,W=E.current,re=N.current,H=T.current,$="0px ".concat(x===-1?1:x,"px"),K="".concat(x,"px 0px"),ce=$E(["strokeDasharray"],h,d);return S.createElement(Jf,{animationId:k,key:k,canBegin:x>0,duration:h,easing:d,isActive:p,begin:v},ue=>{var ve=Qt(P,l,ue),I=Qt(L,o,ue),ee=Qt(W,c,ue),z=Qt(re,n,ue),G=Qt(H,a,ue);b.current&&(w.current=ve,_.current=I,E.current=ee,N.current=z,T.current=G);var ne=ue>0?{transition:ce,strokeDasharray:K}:{strokeDasharray:$};return S.createElement("path",wf({},tn(t),{className:M,d:a_(z,G,ve,I,ee),ref:b,style:r_(r_({},ne),t.style)}))})},UB=["option","shapeType","activeClassName"];function $B(e,t){if(e==null)return{};var n,a,l=qB(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(ET({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}},XB=e=>{var t=Qe();return(n,a)=>l=>{e?.(n,a,l),t(WU())}},FB=(e,t,n)=>{var a=Qe();return(l,o)=>c=>{e?.(l,o,c),a(JU({activeIndex:String(o),activeDataKey:t,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:n}))}};function xM(e){var{tooltipEntrySettings:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(XU(t)):l.current!==t&&n(FU({prev:l.current,next:t})),l.current=t)},[t,n,a]),S.useLayoutEffect(()=>()=>{l.current&&(n(ZU(l.current)),l.current=null)},[n]),null}function ZB(e){var{legendPayload:t}=e,n=Qe(),a=mn(),l=S.useRef(null);return S.useLayoutEffect(()=>{a||(l.current===null?n(kE(t)):l.current!==t&&n(zE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n(RE(l.current)),l.current=null)},[n]),null}function QB(e){var{legendPayload:t}=e,n=Qe(),a=de(Ge),l=S.useRef(null);return S.useLayoutEffect(()=>{a!=="centric"&&a!=="radial"||(l.current===null?n(kE(t)):l.current!==t&&n(zE({prev:l.current,next:t})),l.current=t)},[n,a,t]),S.useLayoutEffect(()=>()=>{l.current&&(n(RE(l.current)),l.current=null)},[n]),null}var bp,WB=()=>{var[e]=S.useState(()=>uo("uid-"));return e},JB=(bp=N4.useId)!==null&&bp!==void 0?bp:WB;function eI(e,t){var n=JB();return t||(e?"".concat(e,"-").concat(n):n)}var tI=S.createContext(void 0),SM=e=>{var{id:t,type:n,children:a}=e,l=eI("recharts-".concat(n),t);return S.createElement(tI.Provider,{value:l},a(l))},nI={cartesianItems:[],polarItems:[]},wM=hn({name:"graphicalItems",initialState:nI,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:rt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:a}=t.payload,l=nr(e).cartesianItems.indexOf(n);l>-1&&(e.cartesianItems[l]=a)},prepare:rt()},removeCartesianGraphicalItem:{reducer(e,t){var n=nr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:rt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:rt()},removePolarGraphicalItem:{reducer(e,t){var n=nr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:rt()}}}),{addCartesianGraphicalItem:rI,replaceCartesianGraphicalItem:aI,removeCartesianGraphicalItem:iI,addPolarGraphicalItem:lI,removePolarGraphicalItem:uI}=wM.actions,oI=wM.reducer,sI=e=>{var t=Qe(),n=S.useRef(null);return S.useLayoutEffect(()=>{n.current===null?t(rI(e)):n.current!==e&&t(aI({prev:n.current,next:e})),n.current=e},[t,e]),S.useLayoutEffect(()=>()=>{n.current&&(t(iI(n.current)),n.current=null)},[t]),null},cI=S.memo(sI);function fI(e){var t=Qe();return S.useLayoutEffect(()=>(t(lI(e)),()=>{t(uI(e))}),[t,e]),null}var dI=["key"],hI=["onMouseEnter","onClick","onMouseLeave"],mI=["id"],vI=["id"];function u_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function ft(e){for(var t=1;tyM(e.children,pd),[e.children]),n=de(a=>OB(a,e.id,t));return n==null?null:S.createElement(QB,{legendPayload:n})}var SI=S.memo(e=>{var{dataKey:t,nameKey:n,sectors:a,stroke:l,strokeWidth:o,fill:c,name:f,hide:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:a.map(b=>b.tooltipPayload),positions:a.map(b=>b.tooltipPosition),settings:{stroke:l,strokeWidth:o,fill:c,dataKey:t,nameKey:n,name:If(f,t),hide:d,type:h,color:c,unit:"",graphicalItemId:v}};return S.createElement(xM,{tooltipEntrySettings:p})}),wI=(e,t)=>e>t?"start":eNn(typeof t=="function"?t(e):t,n,n*.8),OI=(e,t,n)=>{var{top:a,left:l,width:o,height:c}=t,f=KE(o,c),d=l+Nn(e.cx,o,o/2),h=a+Nn(e.cy,c,c/2),v=Nn(e.innerRadius,f,0),p=jI(n,e.outerRadius,f),b=e.maxRadius||Math.sqrt(o*o+c*c)/2;return{cx:d,cy:h,innerRadius:v,outerRadius:p,maxRadius:b}},_I=(e,t)=>{var n=Wt(t-e),a=Math.min(Math.abs(t-e),360);return n*a};function AI(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var EI=(e,t)=>{if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Re("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:a}=t,l=xd(t,dI);return S.createElement(oy,Ua({},l,{type:"linear",className:n}))},NI=(e,t,n)=>{if(S.isValidElement(e))return S.cloneElement(e,t);var a=n;if(typeof e=="function"&&(a=e(t),S.isValidElement(a)))return a;var l=Re("recharts-pie-label-text",AI(e));return S.createElement(yd,Ua({},t,{alignmentBaseline:"middle",className:l}),a)};function TI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l,labelLine:o,dataKey:c}=n;if(!a||!l||!t)return null;var f=Gn(n),d=_l(l),h=_l(o),v=typeof l=="object"&&"offsetRadius"in l&&typeof l.offsetRadius=="number"&&l.offsetRadius||20,p=t.map((b,x)=>{var O=(b.startAngle+b.endAngle)/2,w=xt(b.cx,b.cy,b.outerRadius+v,O),_=ft(ft(ft(ft({},f),b),{},{stroke:"none"},d),{},{index:x,textAnchor:wI(w.x,b.cx)},w),E=ft(ft(ft(ft({},f),b),{},{fill:"none",stroke:b.fill},h),{},{index:x,points:[xt(b.cx,b.cy,b.outerRadius,O),w],key:"line"});return S.createElement(ir,{zIndex:Vt.label,key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},S.createElement(dn,null,o&&EI(o,E),NI(l,_,tt(b,c))))});return S.createElement(dn,{className:"recharts-pie-labels"},p)}function MI(e){var{sectors:t,props:n,showLabels:a}=e,{label:l}=n;return typeof l=="object"&&l!=null&&"position"in l?S.createElement(cM,{label:l}):S.createElement(TI,{sectors:t,props:n,showLabels:a})}function CI(e){var{sectors:t,activeShape:n,inactiveShape:a,allOtherPieProps:l,shape:o,id:c}=e,f=de(Dl),d=de(BT),h=de(U7),{onMouseEnter:v,onClick:p,onMouseLeave:b}=l,x=xd(l,hI),O=VB(v,l.dataKey,c),w=XB(b),_=FB(p,l.dataKey,c);return t==null||t.length===0?null:S.createElement(S.Fragment,null,t.map((E,N)=>{if(E?.startAngle===0&&E?.endAngle===0&&t.length!==1)return null;var T=h==null||h===c,k=String(N)===f&&(d==null||l.dataKey===d)&&T,M=f?a:null,P=n&&k?n:M,L=ft(ft({},E),{},{stroke:E.stroke,tabIndex:-1,[bE]:N,[xE]:c});return S.createElement(dn,Ua({key:"sector-".concat(E?.startAngle,"-").concat(E?.endAngle,"-").concat(E.midAngle,"-").concat(N),tabIndex:-1,className:"recharts-pie-sector"},V0(x,E,N),{onMouseEnter:O(E,N),onMouseLeave:w(E,N),onClick:_(E,N)}),S.createElement(bM,Ua({option:o??P,index:N,shapeType:"sector",isActive:k},L)))}))}function DI(e){var t,{pieSettings:n,displayedData:a,cells:l,offset:o}=e,{cornerRadius:c,startAngle:f,endAngle:d,dataKey:h,nameKey:v,tooltipType:p}=n,b=Math.abs(n.minAngle),x=_I(f,d),O=Math.abs(x),w=a.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,_=a.filter(P=>tt(P,h,0)!==0).length,E=(O>=360?_:_-1)*w,N=O-_*b-E,T=a.reduce((P,L)=>{var W=tt(L,h,0);return P+(me(W)?W:0)},0),k;if(T>0){var M;k=a.map((P,L)=>{var W=tt(P,h,0),re=tt(P,v,L),H=OI(n,o,P),$=(me(W)?W:0)/T,K,ce=ft(ft({},P),l&&l[L]&&l[L].props);L?K=M.endAngle+Wt(x)*w*(W!==0?1:0):K=f;var ue=K+Wt(x)*((W!==0?b:0)+$*N),ve=(K+ue)/2,I=(H.innerRadius+H.outerRadius)/2,ee=[{name:re,value:W,payload:ce,dataKey:h,type:p,graphicalItemId:n.id}],z=xt(H.cx,H.cy,I,ve);return M=ft(ft(ft(ft({},n.presentationProps),{},{percent:$,cornerRadius:typeof c=="string"?parseFloat(c):c,name:re,tooltipPayload:ee,midAngle:ve,middleRadius:I,tooltipPosition:z},ce),H),{},{value:W,dataKey:h,startAngle:K,endAngle:ue,payload:ce,paddingAngle:Wt(x)*w}),M})}return k}function PI(e){var{showLabels:t,sectors:n,children:a}=e,l=S.useMemo(()=>!t||!n?[]:n.map(o=>({value:o.value,payload:o.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:o.cx,cy:o.cy,innerRadius:o.innerRadius,outerRadius:o.outerRadius,startAngle:o.startAngle,endAngle:o.endAngle,clockWise:!1},fill:o.fill})),[n,t]);return S.createElement(oB,{value:t?l:void 0},a)}function kI(e){var{props:t,previousSectorsRef:n,id:a}=e,{sectors:l,isAnimationActive:o,animationBegin:c,animationDuration:f,animationEasing:d,activeShape:h,inactiveShape:v,onAnimationStart:p,onAnimationEnd:b}=t,x=ed(t,"recharts-pie-"),O=n.current,[w,_]=S.useState(!1),E=S.useCallback(()=>{typeof b=="function"&&b(),_(!1)},[b]),N=S.useCallback(()=>{typeof p=="function"&&p(),_(!0)},[p]);return S.createElement(PI,{showLabels:!w,sectors:l},S.createElement(Jf,{animationId:x,begin:c,duration:f,isActive:o,easing:d,onAnimationStart:N,onAnimationEnd:E,key:x},T=>{var k=[],M=l&&l[0],P=M?.startAngle;return l?.forEach((L,W)=>{var re=O&&O[W],H=W>0?xi(L,"paddingAngle",0):0;if(re){var $=Qt(re.endAngle-re.startAngle,L.endAngle-L.startAngle,T),K=ft(ft({},L),{},{startAngle:P+H,endAngle:P+$+H});k.push(K),P=K.endAngle}else{var{endAngle:ce,startAngle:ue}=L,ve=Qt(0,ce-ue,T),I=ft(ft({},L),{},{startAngle:P+H,endAngle:P+ve+H});k.push(I),P=I.endAngle}}),n.current=k,S.createElement(dn,null,S.createElement(CI,{sectors:k,activeShape:h,inactiveShape:v,allOtherPieProps:t,shape:t.shape,id:a}))}),S.createElement(MI,{showLabels:!w,sectors:l,props:t}),t.children)}var zI={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Vt.area};function RI(e){var{id:t}=e,n=xd(e,mI),{hide:a,className:l,rootTabIndex:o}=e,c=S.useMemo(()=>yM(e.children,pd),[e.children]),f=de(v=>_B(v,t,c)),d=S.useRef(null),h=Re("recharts-pie",l);return a||f==null?(d.current=null,S.createElement(dn,{tabIndex:o,className:h})):S.createElement(ir,{zIndex:e.zIndex},S.createElement(SI,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:f,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),S.createElement(dn,{tabIndex:o,className:h},S.createElement(kI,{props:ft(ft({},n),{},{sectors:f}),previousSectorsRef:d,id:t})))}function jM(e){var t=At(e,zI),{id:n}=t,a=xd(t,vI),l=Gn(a);return S.createElement(SM,{id:n,type:"pie"},o=>S.createElement(S.Fragment,null,S.createElement(fI,{type:"pie",id:o,data:a.data,dataKey:a.dataKey,hide:a.hide,angleAxisId:0,radiusAxisId:0,name:a.name,nameKey:a.nameKey,tooltipType:a.tooltipType,legendType:a.legendType,fill:a.fill,cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,paddingAngle:a.paddingAngle,minAngle:a.minAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,cornerRadius:a.cornerRadius,presentationProps:l,maxRadius:t.maxRadius}),S.createElement(xI,Ua({},a,{id:o})),S.createElement(RI,Ua({},a,{id:o}))))}jM.displayName="Pie";var LI=["points"];function o_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function xp(e){for(var t=1;t{var _,E,N=xp(xp(xp({r:3},c),p),{},{index:w,cx:(_=O.x)!==null&&_!==void 0?_:void 0,cy:(E=O.y)!==null&&E!==void 0?E:void 0,dataKey:o,value:O.value,payload:O.payload,points:t});return S.createElement(HI,{key:"dot-".concat(w),option:n,dotProps:N,className:l})}),x={};return f&&d!=null&&(x.clipPath="url(#clipPath-".concat(v?"":"dots-").concat(d,")")),S.createElement(ir,{zIndex:h},S.createElement(dn,Of({className:a},x),b))}function s_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function c_(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),iH=V([aH,Wr,Jr],(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)}}),wg=()=>de(iH),lH=()=>de(H7);function f_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Sp(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:a,activeDot:l,dataKey:o,clipPath:c}=e;if(l===!1||t.x==null||t.y==null)return null;var f={index:n,dataKey:o,cx:t.x,cy:t.y,r:4,fill:a??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=Sp(Sp(Sp({},f),_l(l)),G0(l)),h;return S.isValidElement(l)?h=S.cloneElement(l,d):typeof l=="function"?h=l(d):h=S.createElement(fM,d),S.createElement(dn,{className:"recharts-active-dot",clipPath:c},h)};function fH(e){var{points:t,mainColor:n,activeDot:a,itemDataKey:l,clipPath:o,zIndex:c=Vt.activeDot}=e,f=de(Dl),d=lH();if(t==null||d==null)return null;var h=t.find(v=>d.includes(v.payload));return _t(h)?null:S.createElement(ir,{zIndex:c},S.createElement(cH,{point:h,childIndex:Number(f),mainColor:n,dataKey:l,activeDot:a,clipPath:o}))}var _M=e=>{var{chartData:t}=e,n=Qe(),a=mn();return S.useEffect(()=>a?()=>{}:(n(xO(t)),()=>{n(xO(void 0))}),[t,n,a]),null},d_={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},AM=hn({name:"brush",initialState:d_,reducers:{setBrushSettings(e,t){return t.payload==null?d_:t.payload}}}),{setBrushSettings:QG}=AM.actions,dH=AM.reducer;function hH(e,t,n){return(t=mH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mH(e){var t=vH(e,"string");return typeof t=="symbol"?t:t+""}function vH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class jg{static create(t){return new jg(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:n,position:a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(a)switch(a){case"start":return this.scale(t);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+l}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(t)+o}default:return this.scale(t)}if(n){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+c}return this.scale(t)}}isInRange(t){var n=this.range(),a=n[0],l=n[n.length-1];return a<=l?t>=a&&t<=l:t>=l&&t<=a}}hH(jg,"EPS",1e-4);function pH(e){return(e%180+180)%180}var yH=function(t){var{width:n,height:a}=t,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=pH(l),c=o*Math.PI/180,f=Math.atan(a/n),d=c>f&&c{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=nr(e).dots.findIndex(a=>a===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=nr(e).areas.findIndex(a=>a===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=nr(e).lines.findIndex(a=>a===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:WG,removeDot:JG,addArea:eV,removeArea:tV,addLine:nV,removeLine:rV}=EM.actions,bH=EM.reducer,xH=S.createContext(void 0),SH=e=>{var{children:t}=e,[n]=S.useState("".concat(uo("recharts"),"-clip")),a=wg();if(a==null)return null;var{x:l,y:o,width:c,height:f}=a;return S.createElement(xH.Provider,{value:n},S.createElement("defs",null,S.createElement("clipPath",{id:n},S.createElement("rect",{x:l,y:o,height:f,width:c}))),t)};function NM(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],a=0;ae*l)return!1;var o=n();return e*(t-e*o/2-a)>=0&&e*(t+e*o/2-l)<=0}function OH(e,t){return NM(e,t+1)}function _H(e,t,n,a,l){for(var o=(a||[]).slice(),{start:c,end:f}=t,d=0,h=1,v=c,p=function(){var O=a?.[d];if(O===void 0)return{v:NM(a,h)};var w=d,_,E=()=>(_===void 0&&(_=n(O,w)),_),N=O.coordinate,T=d===0||wo(e,N,E,v,f);T||(d=0,v=c,h+=1),T&&(v=N+e*(E()/2+l),d+=h)},b;h<=o.length;)if(b=p(),b)return b.v;return[]}function AH(e,t,n,a,l){var o=(a||[]).slice(),c=o.length;if(c===0)return[];for(var{start:f,end:d}=t,h=1;h<=c;h++){for(var v=(c-1)%h,p=f,b=!0,x=function(){var N=a[O],T=O,k,M=()=>(k===void 0&&(k=n(N,T)),k),P=N.coordinate,L=O===v||wo(e,P,M,p,d);if(!L)return b=!1,1;L&&(p=P+e*(M()/2+l))},O=v;O(O===void 0&&(O=n(x,b)),O);if(b===c-1){var _=e*(x.coordinate+e*w()/2-d);o[b]=x=Ft(Ft({},x),{},{tickCoord:_>0?x.coordinate-_*e:x.coordinate})}else o[b]=x=Ft(Ft({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var E=wo(e,x.tickCoord,w,f,d);E&&(d=x.tickCoord-e*(w()/2+l),o[b]=Ft(Ft({},x),{},{isShow:!0}))}},v=c-1;v>=0;v--)h(v);return o}function CH(e,t,n,a,l,o){var c=(a||[]).slice(),f=c.length,{start:d,end:h}=t;if(o){var v=a[f-1],p=n(v,f-1),b=e*(v.coordinate+e*p/2-h);if(c[f-1]=v=Ft(Ft({},v),{},{tickCoord:b>0?v.coordinate-b*e:v.coordinate}),v.tickCoord!=null){var x=wo(e,v.tickCoord,()=>p,d,h);x&&(h=v.tickCoord-e*(p/2+l),c[f-1]=Ft(Ft({},v),{},{isShow:!0}))}}for(var O=o?f-1:f,w=function(N){var T=c[N],k,M=()=>(k===void 0&&(k=n(T,N)),k);if(N===0){var P=e*(T.coordinate-e*M()/2-d);c[N]=T=Ft(Ft({},T),{},{tickCoord:P<0?T.coordinate-P*e:T.coordinate})}else c[N]=T=Ft(Ft({},T),{},{tickCoord:T.coordinate});if(T.tickCoord!=null){var L=wo(e,T.tickCoord,M,d,h);L&&(d=T.tickCoord+e*(M()/2+l),c[N]=Ft(Ft({},T),{},{isShow:!0}))}},_=0;_{var M=typeof h=="function"?h(T.value,k):T.value;return O==="width"?wH(no(M,{fontSize:t,letterSpacing:n}),w,p):no(M,{fontSize:t,letterSpacing:n})[O]},E=l.length>=2?Wt(l[1].coordinate-l[0].coordinate):1,N=jH(o,E,O);return d==="equidistantPreserveStart"?_H(E,N,_,l,c):d==="equidistantPreserveEnd"?AH(E,N,_,l,c):(d==="preserveStart"||d==="preserveStartEnd"?x=CH(E,N,_,l,c,d==="preserveStartEnd"):x=MH(E,N,_,l,c),x.filter(T=>T.isShow))}var DH=e=>{var{ticks:t,label:n,labelGapWithTick:a=5,tickSize:l=0,tickMargin:o=0}=e,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.width>c&&(c=p.width)}});var f=n?n.getBoundingClientRect().width:0,d=l+o,h=c+d+f+(n?a:0);return Math.round(h)}return 0},PH=["axisLine","width","height","className","hide","ticks","axisType"];function kH(e,t){if(e==null)return{};var n,a,l=zH(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{ticks:n=[],tick:a,tickLine:l,stroke:o,tickFormatter:c,unit:f,padding:d,tickTextProps:h,orientation:v,mirror:p,x:b,y:x,width:O,height:w,tickSize:_,tickMargin:E,fontSize:N,letterSpacing:T,getTicksConfig:k,events:M,axisType:P}=e,L=Og(bt(bt({},k),{},{ticks:n}),N,T),W=BH(v,p),re=IH(v,p),H=Gn(k),$=_l(a),K={};typeof l=="object"&&(K=l);var ce=bt(bt({},H),{},{fill:"none"},K),ue=L.map(ee=>bt({entry:ee},qH(ee,b,x,O,w,v,_,p,E))),ve=ue.map(ee=>{var{entry:z,line:G}=ee;return S.createElement(dn,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(z.value,"-").concat(z.coordinate,"-").concat(z.tickCoord)},l&&S.createElement("line",_i({},ce,G,{className:Re("recharts-cartesian-axis-tick-line",xi(l,"className"))})))}),I=ue.map((ee,z)=>{var{entry:G,tick:ne}=ee,D=bt(bt(bt(bt({textAnchor:W,verticalAnchor:re},H),{},{stroke:"none",fill:o},$),ne),{},{index:z,payload:G,visibleTicksCount:L.length,tickFormatter:c,padding:d},h);return S.createElement(dn,_i({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(G.value,"-").concat(G.coordinate,"-").concat(G.tickCoord)},V0(M,G,z)),a&&S.createElement(HH,{option:a,tickProps:D,value:"".concat(typeof c=="function"?c(G.value,z):G.value).concat(f||"")}))});return S.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(P,"-ticks")},I.length>0&&S.createElement(ir,{zIndex:Vt.label},S.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(P,"-tick-labels"),ref:t},I)),ve.length>0&&S.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(P,"-tick-lines")},ve))}),YH=S.forwardRef((e,t)=>{var{axisLine:n,width:a,height:l,className:o,hide:c,ticks:f,axisType:d}=e,h=kH(e,PH),[v,p]=S.useState(""),[b,x]=S.useState(""),O=S.useRef(null);S.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return DH({ticks:O.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var w=S.useCallback(_=>{if(_){var E=_.getElementsByClassName("recharts-cartesian-axis-tick-value");O.current=E;var N=E[0];if(N){var T=window.getComputedStyle(N),k=T.fontSize,M=T.letterSpacing;(k!==v||M!==b)&&(p(k),x(M))}}},[v,b]);return c||a!=null&&a<=0||l!=null&&l<=0?null:S.createElement(ir,{zIndex:e.zIndex},S.createElement(dn,{className:Re("recharts-cartesian-axis",o)},S.createElement($H,{x:e.x,y:e.y,width:a,height:l,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Gn(e)}),S.createElement(KH,{ref:w,axisType:d,events:h,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:b,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:f,unit:e.unit,width:e.width,x:e.x,y:e.y}),S.createElement(qq,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},S.createElement(Zq,{label:e.label,labelRef:e.labelRef}),e.children)))}),_g=S.forwardRef((e,t)=>{var n=At(e,Kr);return S.createElement(YH,_i({},n,{ref:t}))});_g.displayName="CartesianAxis";var GH=["x1","y1","x2","y2","key"],VH=["offset"],XH=["xAxisId","yAxisId"],FH=["xAxisId","yAxisId"];function v_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function Zt(e){for(var t=1;t{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:a,y:l,width:o,height:c,ry:f}=e;return S.createElement("rect",{x:a,y:l,ry:f,width:o,height:c,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function TM(e){var{option:t,lineItemProps:n}=e,a;if(S.isValidElement(t))a=S.cloneElement(t,n);else if(typeof t=="function")a=t(n);else{var l,{x1:o,y1:c,x2:f,y2:d,key:h}=n,v=_f(n,GH),p=(l=Gn(v))!==null&&l!==void 0?l:{},{offset:b}=p,x=_f(p,VH);a=S.createElement("line",vi({},x,{x1:o,y1:c,x2:f,y2:d,fill:"none",key:h}))}return a}function tK(e){var{x:t,width:n,horizontal:a=!0,horizontalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=_f(e,XH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(v),index:v});return S.createElement(TM,{key:"line-".concat(v),option:a,lineItemProps:p})});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function nK(e){var{y:t,height:n,vertical:a=!0,verticalPoints:l}=e;if(!a||!l||!l.length)return null;var{xAxisId:o,yAxisId:c}=e,f=_f(e,FH),d=l.map((h,v)=>{var p=Zt(Zt({},f),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(v),index:v});return S.createElement(TM,{option:a,lineItemProps:p,key:"line-".concat(v)})});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function rK(e){var{horizontalFill:t,fillOpacity:n,x:a,y:l,width:o,height:c,horizontalPoints:f,horizontal:d=!0}=e;if(!d||!t||!t.length||f==null)return null;var h=f.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var w=b%t.length;return S.createElement("rect",{key:"react-".concat(b),y:p,x:a,height:O,width:o,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function aK(e){var{vertical:t=!0,verticalFill:n,fillOpacity:a,x:l,y:o,width:c,height:f,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var h=d.map(p=>Math.round(p+l-l)).sort((p,b)=>p-b);l!==h[0]&&h.unshift(0);var v=h.map((p,b)=>{var x=!h[b+1],O=x?l+c-p:h[b+1]-p;if(O<=0)return null;var w=b%n.length;return S.createElement("rect",{key:"react-".concat(b),x:p,y:o,width:O,height:f,stroke:"none",fill:n[w],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var iK=(e,t)=>{var{xAxis:n,width:a,height:l,offset:o}=e;return pE(Og(Zt(Zt(Zt({},Kr),n),{},{ticks:yE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.left,o.left+o.width,t)},lK=(e,t)=>{var{yAxis:n,width:a,height:l,offset:o}=e;return pE(Og(Zt(Zt(Zt({},Kr),n),{},{ticks:yE(n),viewBox:{x:0,y:0,width:a,height:l}})),o.top,o.top+o.height,t)},uK={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Vt.grid};function ro(e){var t=ay(),n=iy(),a=AE(),l=Zt(Zt({},At(e,uK)),{},{x:me(e.x)?e.x:a.left,y:me(e.y)?e.y:a.top,width:me(e.width)?e.width:a.width,height:me(e.height)?e.height:a.height}),{xAxisId:o,yAxisId:c,x:f,y:d,width:h,height:v,syncWithTicks:p,horizontalValues:b,verticalValues:x}=l,O=mn(),w=de(re=>oO(re,"xAxis",o,O)),_=de(re=>oO(re,"yAxis",c,O));if(!yr(h)||!yr(v)||!me(f)||!me(d))return null;var E=l.verticalCoordinatesGenerator||iK,N=l.horizontalCoordinatesGenerator||lK,{horizontalPoints:T,verticalPoints:k}=l;if((!T||!T.length)&&typeof N=="function"){var M=b&&b.length,P=N({yAxis:_?Zt(Zt({},_),{},{ticks:M?b:_.ticks}):void 0,width:t??h,height:n??v,offset:a},M?!0:p);Qc(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(T=P)}if((!k||!k.length)&&typeof E=="function"){var L=x&&x.length,W=E({xAxis:w?Zt(Zt({},w),{},{ticks:L?x:w.ticks}):void 0,width:t??h,height:n??v,offset:a},L?!0:p);Qc(Array.isArray(W),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof W,"]")),Array.isArray(W)&&(k=W)}return S.createElement(ir,{zIndex:l.zIndex},S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(eK,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),S.createElement(rK,vi({},l,{horizontalPoints:T})),S.createElement(aK,vi({},l,{verticalPoints:k})),S.createElement(tK,vi({},l,{offset:a,horizontalPoints:T,xAxis:w,yAxis:_})),S.createElement(nK,vi({},l,{offset:a,verticalPoints:k,xAxis:w,yAxis:_}))))}ro.displayName="CartesianGrid";var oK={},MM=hn({name:"errorBars",initialState:oK,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]||(e[n]=[]),e[n].push(a)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:a,next:l}=t.payload;e[n]&&(e[n]=e[n].map(o=>o.dataKey===a.dataKey&&o.direction===a.direction?l:o))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:a}=t.payload;e[n]&&(e[n]=e[n].filter(l=>l.dataKey!==a.dataKey||l.direction!==a.direction))}}}),{addErrorBar:aV,replaceErrorBar:iV,removeErrorBar:lV}=MM.actions,sK=MM.reducer,cK=["children"];function fK(e,t){if(e==null)return{};var n,a,l=dK(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a({x:0,y:0,value:0}),errorBarOffset:0},mK=S.createContext(hK);function vK(e){var{children:t}=e,n=fK(e,cK);return S.createElement(mK.Provider,{value:n},t)}function CM(e,t){var n,a,l=de(h=>ta(h,e)),o=de(h=>na(h,t)),c=(n=l?.allowDataOverflow)!==null&&n!==void 0?n:Dt.allowDataOverflow,f=(a=o?.allowDataOverflow)!==null&&a!==void 0?a:Pt.allowDataOverflow,d=c||f;return{needClip:d,needClipX:c,needClipY:f}}function pK(e){var{xAxisId:t,yAxisId:n,clipPathId:a}=e,l=wg(),{needClipX:o,needClipY:c,needClip:f}=CM(t,n);if(!f||!l)return null;var{x:d,y:h,width:v,height:p}=l;return S.createElement("clipPath",{id:"clipPath-".concat(a)},S.createElement("rect",{x:o?d:d-v/2,y:c?h:h-p/2,width:o?v:v*2,height:c?p:p*2}))}var DM=(e,t,n,a)=>ST(e,"xAxis",t,a),PM=(e,t,n,a)=>xT(e,"xAxis",t,a),kM=(e,t,n,a)=>ST(e,"yAxis",n,a),zM=(e,t,n,a)=>xT(e,"yAxis",n,a),yK=V([Ge,DM,kM,PM,zM],(e,t,n,a,l)=>$a(e,"xAxis")?Zc(t,a,!1):Zc(n,l,!1)),gK=(e,t,n,a,l)=>l;function bK(e){return e.type==="line"}var xK=V([eT,gK],(e,t)=>e.filter(bK).find(n=>n.id===t)),SK=V([Ge,DM,kM,PM,zM,xK,yK,Py],(e,t,n,a,l,o,c,f)=>{var{chartData:d,dataStartIndex:h,dataEndIndex:v}=f;if(!(o==null||t==null||n==null||a==null||l==null||a.length===0||l.length===0||c==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:p,data:b}=o,x;if(b!=null&&b.length>0?x=b:x=d?.slice(h,v+1),x!=null)return oY({layout:e,xAxis:t,yAxis:n,xAxisTicks:a,yAxisTicks:l,dataKey:p,bandSize:c,displayedData:x})}});function wK(e){var t=_l(e),n=3,a=2;if(t!=null){var{r:l,strokeWidth:o}=t,c=Number(l),f=Number(o);return(Number.isNaN(c)||c<0)&&(c=n),(Number.isNaN(f)||f<0)&&(f=a),{r:c,strokeWidth:f}}return{r:n,strokeWidth:a}}var wp={exports:{}},jp={};var p_;function jK(){if(p_)return jp;p_=1;var e=Pl();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,l=e.useRef,o=e.useEffect,c=e.useMemo,f=e.useDebugValue;return jp.useSyncExternalStoreWithSelector=function(d,h,v,p,b){var x=l(null);if(x.current===null){var O={hasValue:!1,value:null};x.current=O}else O=x.current;x=c(function(){function _(M){if(!E){if(E=!0,N=M,M=p(M),b!==void 0&&O.hasValue){var P=O.value;if(b(P,M))return T=P}return T=M}if(P=T,n(N,M))return P;var L=p(M);return b!==void 0&&b(P,L)?(N=M,P):(N=M,T=L)}var E=!1,N,T,k=v===void 0?null:v;return[function(){return _(h())},k===null?void 0:function(){return _(k())}]},[h,v,p,b]);var w=a(d,x[0],x[1]);return o(function(){O.hasValue=!0,O.value=w},[w]),f(w),w},jp}var y_;function OK(){return y_||(y_=1,wp.exports=jK()),wp.exports}OK();function _K(e){e()}function AK(){let e=null,t=null;return{clear(){e=null,t=null},notify(){_K(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let a=e;for(;a;)n.push(a),a=a.next;return n},subscribe(n){let a=!0;const l=t={callback:n,next:null,prev:t};return l.prev?l.prev.next=l:e=l,function(){!a||e===null||(a=!1,l.next?l.next.prev=l.prev:t=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var g_={notify(){},get:()=>[]};function EK(e,t){let n,a=g_,l=0,o=!1;function c(w){v();const _=a.subscribe(w);let E=!1;return()=>{E||(E=!0,_(),p())}}function f(){a.notify()}function d(){O.onStateChange&&O.onStateChange()}function h(){return o}function v(){l++,n||(n=e.subscribe(d),a=AK())}function p(){l--,n&&l===0&&(n(),n=void 0,a.clear(),a=g_)}function b(){o||(o=!0,v())}function x(){o&&(o=!1,p())}const O={addNestedSub:c,notifyNestedSubs:f,handleChangeWrapper:d,isSubscribed:h,trySubscribe:b,tryUnsubscribe:x,getListeners:()=>a};return O}var NK=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TK=NK(),MK=()=>typeof navigator<"u"&&navigator.product==="ReactNative",CK=MK(),DK=()=>TK||CK?S.useLayoutEffect:S.useEffect,PK=DK();function b_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function kK(e,t){if(b_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(let l=0;l{const d=EK(l);return{store:l,subscription:d,getServerState:a?()=>a:void 0}},[l,a]),c=S.useMemo(()=>l.getState(),[l]);PK(()=>{const{subscription:d}=o;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),c!==l.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[o,c]);const f=n||UK;return S.createElement(f.Provider,{value:o},t)}var qK=$K,BK=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function IK(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ag(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of n)if(BK.has(a)){if(e[a]==null&&t[a]==null)continue;if(!kK(e[a],t[a]))return!1}else if(!IK(e[a],t[a]))return!1;return!0}var HK=["id"],KK=["type","layout","connectNulls","needClip","shape"],YK=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:a,legendType:l,hide:o}=e;return[{inactive:o,dataKey:t,type:l,color:a,value:If(n,t),payload:e}]},QK=S.memo(e=>{var{dataKey:t,data:n,stroke:a,strokeWidth:l,fill:o,name:c,hide:f,unit:d,tooltipType:h,id:v}=e,p={dataDefinedOnItem:n,positions:void 0,settings:{stroke:a,strokeWidth:l,fill:o,dataKey:t,nameKey:void 0,name:If(c,t),hide:f,type:h,color:a,unit:d,graphicalItemId:v}};return S.createElement(xM,{tooltipEntrySettings:p})}),RM=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function WK(e,t){for(var n=e.length%2!==0?[...e,0]:e,a=[],l=0;l{var a=n.reduce((p,b)=>p+b);if(!a)return RM(t,e);for(var l=Math.floor(e/a),o=e%a,c=t-e,f=[],d=0,h=0;do){f=[...n.slice(0,d),o-h];break}var v=f.length%2===0?[0,c]:[c];return[...WK(n,l),...f,...v].map(p=>"".concat(p,"px")).join(", ")};function eY(e){var{clipPathId:t,points:n,props:a}=e,{dot:l,dataKey:o,needClip:c}=a,{id:f}=a,d=Eg(a,HK),h=Gn(d);return S.createElement(YI,{points:n,dot:l,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:o,baseProps:h,needClip:c,clipPathId:t})}function tY(e){var{showLabels:t,children:n,points:a}=e,l=S.useMemo(()=>a?.map(o=>{var c,f,d={x:(c=o.x)!==null&&c!==void 0?c:0,y:(f=o.y)!==null&&f!==void 0?f:0,width:0,lowerWidth:0,upperWidth:0,height:0};return dr(dr({},d),{},{value:o.value,payload:o.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[a]);return S.createElement(uB,{value:t?l:void 0},n)}function S_(e){var{clipPathId:t,pathRef:n,points:a,strokeDasharray:l,props:o}=e,{type:c,layout:f,connectNulls:d,needClip:h,shape:v}=o,p=Eg(o,KK),b=dr(dr({},tn(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):void 0,points:a,type:c,layout:f,connectNulls:d,strokeDasharray:l??o.strokeDasharray});return S.createElement(S.Fragment,null,a?.length>1&&S.createElement(bM,jo({shapeType:"curve",option:v},b,{pathRef:n})),S.createElement(eY,{points:a,clipPathId:t,props:o}))}function nY(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function rY(e){var{clipPathId:t,props:n,pathRef:a,previousPointsRef:l,longestAnimatedLengthRef:o}=e,{points:c,strokeDasharray:f,isAnimationActive:d,animationBegin:h,animationDuration:v,animationEasing:p,animateNewValues:b,width:x,height:O,onAnimationEnd:w,onAnimationStart:_}=n,E=l.current,N=ed(c,"recharts-line-"),T=S.useRef(N),[k,M]=S.useState(!1),P=!k,L=S.useCallback(()=>{typeof w=="function"&&w(),M(!1)},[w]),W=S.useCallback(()=>{typeof _=="function"&&_(),M(!0)},[_]),re=nY(a.current),H=S.useRef(0);T.current!==N&&(H.current=o.current,T.current=N);var $=H.current;return S.createElement(tY,{points:c,showLabels:P},n.children,S.createElement(Jf,{animationId:N,begin:h,duration:v,isActive:d,easing:p,onAnimationEnd:L,onAnimationStart:W,key:N},K=>{var ce=Qt($,re+$,K),ue=Math.min(ce,re),ve;if(d)if(f){var I="".concat(f).split(/[,\s]+/gim).map(G=>parseFloat(G));ve=JK(ue,re,I)}else ve=RM(re,ue);else ve=f==null?void 0:String(f);if(K>0&&re>0&&(l.current=c,o.current=Math.max(o.current,ue)),E){var ee=E.length/c.length,z=K===1?c:c.map((G,ne)=>{var D=Math.floor(ne*ee);if(E[D]){var F=E[D];return dr(dr({},G),{},{x:Qt(F.x,G.x,K),y:Qt(F.y,G.y,K)})}return b?dr(dr({},G),{},{x:Qt(x*2,G.x,K),y:Qt(O/2,G.y,K)}):dr(dr({},G),{},{x:G.x,y:G.y})});return l.current=z,S.createElement(S_,{props:n,points:z,clipPathId:t,pathRef:a,strokeDasharray:ve})}return S.createElement(S_,{props:n,points:c,clipPathId:t,pathRef:a,strokeDasharray:ve})}),S.createElement(cM,{label:n.label}))}function aY(e){var{clipPathId:t,props:n}=e,a=S.useRef(null),l=S.useRef(0),o=S.useRef(null);return S.createElement(rY,{props:n,clipPathId:t,previousPointsRef:a,longestAnimatedLengthRef:l,pathRef:o})}var iY=(e,t)=>{var n,a;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(a=e.y)!==null&&a!==void 0?a:void 0,value:e.value,errorVal:tt(e.payload,t)}};class lY extends S.Component{render(){var{hide:t,dot:n,points:a,className:l,xAxisId:o,yAxisId:c,top:f,left:d,width:h,height:v,id:p,needClip:b,zIndex:x}=this.props;if(t)return null;var O=Re("recharts-line",l),w=p,{r:_,strokeWidth:E}=wK(n),N=gM(n),T=_*2+E,k=b?"url(#clipPath-".concat(N?"":"dots-").concat(w,")"):void 0;return S.createElement(ir,{zIndex:x},S.createElement(dn,{className:O},b&&S.createElement("defs",null,S.createElement(pK,{clipPathId:w,xAxisId:o,yAxisId:c}),!N&&S.createElement("clipPath",{id:"clipPath-dots-".concat(w)},S.createElement("rect",{x:d-T/2,y:f-T/2,width:h+T,height:v+T}))),S.createElement(vK,{xAxisId:o,yAxisId:c,data:a,dataPointFormatter:iY,errorBarOffset:0},S.createElement(aY,{props:this.props,clipPathId:w}))),S.createElement(fH,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var LM={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:Vt.line,type:"linear"};function uY(e){var t=At(e,LM),{activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,connectNulls:f,dot:d,hide:h,isAnimationActive:v,label:p,legendType:b,xAxisId:x,yAxisId:O,id:w}=t,_=Eg(t,YK),{needClip:E}=CM(x,O),N=wg(),T=To(),k=mn(),M=de(H=>SK(H,x,O,k,w));if(T!=="horizontal"&&T!=="vertical"||M==null||N==null)return null;var{height:P,width:L,x:W,y:re}=N;return S.createElement(lY,jo({},_,{id:w,connectNulls:f,dot:d,activeDot:n,animateNewValues:a,animationBegin:l,animationDuration:o,animationEasing:c,isAnimationActive:v,hide:h,label:p,legendType:b,xAxisId:x,yAxisId:O,points:M,layout:T,height:P,width:L,left:W,top:re,needClip:E}))}function oY(e){var{layout:t,xAxis:n,yAxis:a,xAxisTicks:l,yAxisTicks:o,dataKey:c,bandSize:f,displayedData:d}=e;return d.map((h,v)=>{var p=tt(h,c);if(t==="horizontal"){var b=dj({axis:n,ticks:l,bandSize:f,entry:h,index:v}),x=_t(p)?null:a.scale(p);return{x:b,y:x,value:p,payload:h}}var O=_t(p)?null:n.scale(p),w=dj({axis:a,ticks:o,bandSize:f,entry:h,index:v});return O==null||w==null?null:{x:O,y:w,value:p,payload:h}}).filter(Boolean)}function sY(e){var t=At(e,LM),n=mn();return S.createElement(SM,{id:t.id,type:"line"},a=>S.createElement(S.Fragment,null,S.createElement(ZB,{legendPayload:ZK(t)}),S.createElement(QK,{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:a}),S.createElement(cI,{type:"line",id:a,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),S.createElement(uY,jo({},t,{id:a}))))}var Sl=S.memo(sY,Ag);Sl.displayName="Line";var cY=["domain","range"],fY=["domain","range"];function w_(e,t){if(e==null)return{};var n,a,l=dY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{n.current===null?t(ZI(e)):n.current!==e&&t(QI({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(WI(n.current)),n.current=null)},[t]),null}var yY=e=>{var{xAxisId:t,className:n}=e,a=de(SE),l=mn(),o="xAxis",c=de(E=>bT(E,o,t,l)),f=de(E=>CU(E,t)),d=de(E=>LU(E,t)),h=de(E=>QN(E,t));if(f==null||d==null||h==null)return null;var{dangerouslySetInnerHTML:v,ticks:p,scale:b}=e,x=O_(e,hY),{id:O,scale:w}=h,_=O_(h,mY);return S.createElement(_g,w0({},x,_,{x:d.x,y:d.y,width:f.width,height:f.height,className:Re("recharts-".concat(o," ").concat(o),n),viewBox:a,ticks:c,axisType:o}))},gY={allowDataOverflow:Dt.allowDataOverflow,allowDecimals:Dt.allowDecimals,allowDuplicatedCategory:Dt.allowDuplicatedCategory,angle:Dt.angle,axisLine:Kr.axisLine,height:Dt.height,hide:!1,includeHidden:Dt.includeHidden,interval:Dt.interval,minTickGap:Dt.minTickGap,mirror:Dt.mirror,orientation:Dt.orientation,padding:Dt.padding,reversed:Dt.reversed,scale:Dt.scale,tick:Dt.tick,tickCount:Dt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:Dt.type,xAxisId:0},bY=e=>{var t=At(e,gY);return S.createElement(S.Fragment,null,S.createElement(pY,{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}),S.createElement(yY,t))},ao=S.memo(bY,UM);ao.displayName="XAxis";var xY=["dangerouslySetInnerHTML","ticks","scale"],SY=["id","scale"];function j0(){return j0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current===null?t(JI(e)):n.current!==e&&t(eH({prev:n.current,next:e})),n.current=e},[e,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(tH(n.current)),n.current=null)},[t]),null}var OY=e=>{var{yAxisId:t,className:n,width:a,label:l}=e,o=S.useRef(null),c=S.useRef(null),f=de(SE),d=mn(),h=Qe(),v="yAxis",p=de(P=>qU(P,t)),b=de(P=>$U(P,t)),x=de(P=>bT(P,v,t,d)),O=de(P=>WN(P,t));if(S.useLayoutEffect(()=>{if(!(a!=="auto"||!p||bg(l)||S.isValidElement(l)||O==null)){var P=o.current;if(P){var L=P.getCalculatedWidth();Math.round(p.width)!==Math.round(L)&&h(nH({id:t,width:L}))}}},[x,p,h,l,t,a,O]),p==null||b==null||O==null)return null;var{dangerouslySetInnerHTML:w,ticks:_,scale:E}=e,N=__(e,xY),{id:T,scale:k}=O,M=__(O,SY);return S.createElement(_g,j0({},N,M,{ref:o,labelRef:c,x:b.x,y:b.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:p.width,height:p.height,className:Re("recharts-".concat(v," ").concat(v),n),viewBox:f,ticks:x,axisType:v}))},_Y={allowDataOverflow:Pt.allowDataOverflow,allowDecimals:Pt.allowDecimals,allowDuplicatedCategory:Pt.allowDuplicatedCategory,angle:Pt.angle,axisLine:Kr.axisLine,hide:!1,includeHidden:Pt.includeHidden,interval:Pt.interval,minTickGap:Pt.minTickGap,mirror:Pt.mirror,orientation:Pt.orientation,padding:Pt.padding,reversed:Pt.reversed,scale:Pt.scale,tick:Pt.tick,tickCount:Pt.tickCount,tickLine:Kr.tickLine,tickSize:Kr.tickSize,type:Pt.type,width:Pt.width,yAxisId:0},AY=e=>{var t=At(e,_Y);return S.createElement(S.Fragment,null,S.createElement(jY,{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}),S.createElement(OY,t))},io=S.memo(AY,UM);io.displayName="YAxis";var EY=(e,t)=>t,Ng=V([EY,Ge,XN,Nt,LT,ra,n$,zt],s$),Tg=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,a=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/a)}},$M=Vn("mouseClick"),qM=Eo();qM.startListening({actionCreator:$M,effect:(e,t)=>{var n=e.payload,a=Ng(t.getState(),Tg(n));a?.activeIndex!=null&&t.dispatch(e7({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var O0=Vn("mouseMove"),BM=Eo(),jc=null;BM.startListening({actionCreator:O0,effect:(e,t)=>{var n=e.payload;jc!==null&&cancelAnimationFrame(jc);var a=Tg(n);jc=requestAnimationFrame(()=>{var l=t.getState(),o=sg(l,l.tooltip.settings.shared);if(o==="axis"){var c=Ng(l,a);c?.activeIndex!=null?t.dispatch(TT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate})):t.dispatch(NT())}jc=null})}});function NY(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?"<>":t}var A_={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},IM=hn({name:"rootProps",initialState:A_,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:A_.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}}}),TY=IM.reducer,{updateOptions:MY}=IM.actions,HM=hn({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:CY}=HM.actions,DY=HM.reducer,KM=Vn("keyDown"),YM=Vn("focus"),Mg=Eo();Mg.startListening({actionCreator:KM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip,o=e.payload;if(!(o!=="ArrowRight"&&o!=="ArrowLeft"&&o!=="Enter")){var c=cg(l,Hl(n),$o(n),Io(n)),f=c==null?-1:Number(c);if(!(!Number.isFinite(f)||f<0)){var d=ra(n);if(o==="Enter"){var h=xf(n,"axis","hover",String(l.index));t.dispatch(p0({active:!l.active,activeIndex:l.index,activeCoordinate:h}));return}var v=KU(n),p=v==="left-to-right"?1:-1,b=o==="ArrowRight"?1:-1,x=f+b*p;if(!(d==null||x>=d.length||x<0)){var O=xf(n,"axis","hover",String(x));t.dispatch(p0({active:!0,activeIndex:x.toString(),activeCoordinate:O}))}}}}}});Mg.startListening({actionCreator:YM,effect:(e,t)=>{var n=t.getState(),a=n.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:l}=n.tooltip;if(!l.active&&l.index==null){var o="0",c=xf(n,"axis","hover",String(o));t.dispatch(p0({active:!0,activeIndex:o,activeCoordinate:c}))}}}});var Hn=Vn("externalEvent"),GM=Eo(),Op=new Map;GM.startListening({actionCreator:Hn,effect:(e,t)=>{var{handler:n,reactEvent:a}=e.payload;if(n!=null){a.persist();var l=a.type,o=Op.get(l);o!==void 0&&cancelAnimationFrame(o);var c=requestAnimationFrame(()=>{try{var f=t.getState(),d={activeCoordinate:q7(f),activeDataKey:BT(f),activeIndex:Dl(f),activeLabel:qT(f),activeTooltipIndex:Dl(f),isTooltipActive:B7(f)};n(d,a)}finally{Op.delete(l)}});Op.set(l,c)}}});var PY=V([Bl],e=>e.tooltipItemPayloads),kY=V([PY,Bo,(e,t)=>t,(e,t,n)=>n],(e,t,n,a)=>{var l=e.find(f=>f.settings.graphicalItemId===a);if(l!=null){var{positions:o}=l;if(o!=null){var c=t(o,n);return c}}}),VM=Vn("touchMove"),XM=Eo();XM.startListening({actionCreator:VM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var a=t.getState(),l=sg(a,a.tooltip.settings.shared);if(l==="axis"){var o=n.touches[0];if(o==null)return;var c=Ng(a,Tg({clientX:o.clientX,clientY:o.clientY,currentTarget:n.currentTarget}));c?.activeIndex!=null&&t.dispatch(TT({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate}))}else if(l==="item"){var f,d=n.touches[0];if(document.elementFromPoint==null||d==null)return;var h=document.elementFromPoint(d.clientX,d.clientY);if(!h||!h.getAttribute)return;var v=h.getAttribute(bE),p=(f=h.getAttribute(xE))!==null&&f!==void 0?f:void 0,b=Il(a).find(w=>w.id===p);if(v==null||b==null||p==null)return;var{dataKey:x}=b,O=kY(a,v,p);t.dispatch(ET({activeDataKey:x,activeIndex:v,activeCoordinate:O,activeGraphicalItemId:p}))}}}});var zY=BA({brush:dH,cartesianAxis:rH,chartData:q$,errorBars:sK,graphicalItems:oI,layout:h5,legend:gR,options:z$,polarAxis:gB,polarOptions:DY,referenceElements:bH,rootProps:TY,tooltip:t7,zIndex:j$}),RY=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Uz({reducer:zY,preloadedState:t,middleware:a=>{var l;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((l="es6")!==null&&l!==void 0?l:"")}).concat([qM.middleware,BM.middleware,Mg.middleware,GM.middleware,XM.middleware])},enhancers:a=>{var l=a;return typeof a=="function"&&(l=a()),l.concat(nE({type:"raf"}))},devTools:{serialize:{replacer:NY},name:"recharts-".concat(n)}})};function FM(e){var{preloadedState:t,children:n,reduxStoreName:a}=e,l=mn(),o=S.useRef(null);if(l)return n;o.current==null&&(o.current=RY(t,a));var c=Z0;return S.createElement(qK,{context:c,store:o.current},n)}function LY(e){var{layout:t,margin:n}=e,a=Qe(),l=mn();return S.useEffect(()=>{l||(a(c5(t)),a(s5(n)))},[a,l,t,n]),null}var ZM=S.memo(LY,Ag);function QM(e){var t=Qe();return S.useEffect(()=>{t(MY(e))},[t,e]),null}function E_(e){var{zIndex:t,isPanorama:n}=e,a=S.useRef(null),l=Qe();return S.useLayoutEffect(()=>(a.current&&l(S$({zIndex:t,element:a.current,isPanorama:n})),()=>{l(w$({zIndex:t,isPanorama:n}))}),[l,t,n]),S.createElement("g",{tabIndex:-1,ref:a})}function N_(e){var{children:t,isPanorama:n}=e,a=de(f$);if(!a||a.length===0)return t;var l=a.filter(c=>c<0),o=a.filter(c=>c>0);return S.createElement(S.Fragment,null,l.map(c=>S.createElement(E_,{key:c,zIndex:c,isPanorama:n})),t,o.map(c=>S.createElement(E_,{key:c,zIndex:c,isPanorama:n})))}var UY=["children"];function $Y(e,t){if(e==null)return{};var n,a,l=qY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var n=ay(),a=iy(),l=UE();if(!yr(n)||!yr(a))return null;var{children:o,otherAttributes:c,title:f,desc:d}=e,h,v;return c!=null&&(typeof c.tabIndex=="number"?h=c.tabIndex:h=l?0:void 0,typeof c.role=="string"?v=c.role:v=l?"application":void 0),S.createElement(L0,Af({},c,{title:f,desc:d,role:v,tabIndex:h,width:n,height:a,style:BY,ref:t}),o)}),HY=e=>{var{children:t}=e,n=de(Gf);if(!n)return null;var{width:a,height:l,y:o,x:c}=n;return S.createElement(L0,{width:a,height:l,x:c,y:o},t)},T_=S.forwardRef((e,t)=>{var{children:n}=e,a=$Y(e,UY),l=mn();return l?S.createElement(HY,null,S.createElement(N_,{isPanorama:!0},n)):S.createElement(IY,Af({ref:t},a),S.createElement(N_,{isPanorama:!1},n))});function KY(){var e=Qe(),[t,n]=S.useState(null),a=de(N5);return S.useEffect(()=>{if(t!=null){var l=t.getBoundingClientRect(),o=l.width/t.offsetWidth;wt(o)&&o!==a&&e(d5(o))}},[t,e,a]),n}function M_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function YY(e){for(var t=1;t(F$(),null);function Ef(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var ZY=S.forwardRef((e,t)=>{var n,a,l=S.useRef(null),[o,c]=S.useState({containerWidth:Ef((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Ef((a=e.style)===null||a===void 0?void 0:a.height)}),f=S.useCallback((h,v)=>{c(p=>{var b=Math.round(h),x=Math.round(v);return p.containerWidth===b&&p.containerHeight===x?p:{containerWidth:b,containerHeight:x}})},[]),d=S.useCallback(h=>{if(typeof t=="function"&&t(h),h!=null&&typeof ResizeObserver<"u"){var{width:v,height:p}=h.getBoundingClientRect();f(v,p);var b=O=>{var{width:w,height:_}=O[0].contentRect;f(w,_)},x=new ResizeObserver(b);x.observe(h),l.current=x}},[t,f]);return S.useEffect(()=>()=>{var h=l.current;h?.disconnect()},[f]),S.createElement(S.Fragment,null,S.createElement(Xf,{width:o.containerWidth,height:o.containerHeight}),S.createElement("div",Ai({ref:d},e)))}),QY=S.forwardRef((e,t)=>{var{width:n,height:a}=e,[l,o]=S.useState({containerWidth:Ef(n),containerHeight:Ef(a)}),c=S.useCallback((d,h)=>{o(v=>{var p=Math.round(d),b=Math.round(h);return v.containerWidth===p&&v.containerHeight===b?v:{containerWidth:p,containerHeight:b}})},[]),f=S.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:h,height:v}=d.getBoundingClientRect();c(h,v)}},[t,c]);return S.createElement(S.Fragment,null,S.createElement(Xf,{width:l.containerWidth,height:l.containerHeight}),S.createElement("div",Ai({ref:f},e)))}),WY=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return S.createElement(S.Fragment,null,S.createElement(Xf,{width:n,height:a}),S.createElement("div",Ai({ref:t},e)))}),JY=S.forwardRef((e,t)=>{var{width:n,height:a}=e;return Yr(n)||Yr(a)?S.createElement(QY,Ai({},e,{ref:t})):S.createElement(WY,Ai({},e,{ref:t}))});function eG(e){return e===!0?ZY:JY}var tG=S.forwardRef((e,t)=>{var{children:n,className:a,height:l,onClick:o,onContextMenu:c,onDoubleClick:f,onMouseDown:d,onMouseEnter:h,onMouseLeave:v,onMouseMove:p,onMouseUp:b,onTouchEnd:x,onTouchMove:O,onTouchStart:w,style:_,width:E,responsive:N,dispatchTouchEvents:T=!0}=e,k=S.useRef(null),M=Qe(),[P,L]=S.useState(null),[W,re]=S.useState(null),H=KY(),$=ry(),K=$?.width>0?$.width:E,ce=$?.height>0?$.height:l,ue=S.useCallback(Q=>{H(Q),typeof t=="function"&&t(Q),L(Q),re(Q),Q!=null&&(k.current=Q)},[H,t,L,re]),ve=S.useCallback(Q=>{M($M(Q)),M(Hn({handler:o,reactEvent:Q}))},[M,o]),I=S.useCallback(Q=>{M(O0(Q)),M(Hn({handler:h,reactEvent:Q}))},[M,h]),ee=S.useCallback(Q=>{M(NT()),M(Hn({handler:v,reactEvent:Q}))},[M,v]),z=S.useCallback(Q=>{M(O0(Q)),M(Hn({handler:p,reactEvent:Q}))},[M,p]),G=S.useCallback(()=>{M(YM())},[M]),ne=S.useCallback(Q=>{M(KM(Q.key))},[M]),D=S.useCallback(Q=>{M(Hn({handler:c,reactEvent:Q}))},[M,c]),F=S.useCallback(Q=>{M(Hn({handler:f,reactEvent:Q}))},[M,f]),ie=S.useCallback(Q=>{M(Hn({handler:d,reactEvent:Q}))},[M,d]),le=S.useCallback(Q=>{M(Hn({handler:b,reactEvent:Q}))},[M,b]),ye=S.useCallback(Q=>{M(Hn({handler:w,reactEvent:Q}))},[M,w]),be=S.useCallback(Q=>{T&&M(VM(Q)),M(Hn({handler:O,reactEvent:Q}))},[M,T,O]),he=S.useCallback(Q=>{M(Hn({handler:x,reactEvent:Q}))},[M,x]),ut=eG(N);return S.createElement(XT.Provider,{value:P},S.createElement(aA.Provider,{value:W},S.createElement(ut,{width:K??_?.width,height:ce??_?.height,className:Re("recharts-wrapper",a),style:YY({position:"relative",cursor:"default",width:K,height:ce},_),onClick:ve,onContextMenu:D,onDoubleClick:F,onFocus:G,onKeyDown:ne,onMouseDown:ie,onMouseEnter:I,onMouseLeave:ee,onMouseMove:z,onMouseUp:le,onTouchEnd:he,onTouchMove:be,onTouchStart:ye,ref:ue},S.createElement(FY,null),n)))}),nG=["width","height","responsive","children","className","style","compact","title","desc"];function rG(e,t){if(e==null)return{};var n,a,l=aG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a{var{width:n,height:a,responsive:l,children:o,className:c,style:f,compact:d,title:h,desc:v}=e,p=rG(e,nG),b=Gn(p);return d?S.createElement(S.Fragment,null,S.createElement(Xf,{width:n,height:a}),S.createElement(T_,{otherAttributes:b,title:h,desc:v},o)):S.createElement(tG,{className:c,style:f,width:n,height:a,responsive:l??!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},S.createElement(T_,{otherAttributes:b,title:h,desc:v,ref:t},S.createElement(SH,null,o)))});function _0(){return _0=Object.assign?Object.assign.bind():function(e){for(var t=1;tS.createElement(uG,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:oG,tooltipPayloadSearcher:FT,categoricalChartProps:e,ref:t}));function sG(e){var t=Qe();return S.useEffect(()=>{t(CY(e))},[t,e]),null}var cG=["layout"];function A0(){return A0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=At(e,bG);return S.createElement(mG,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:gG,tooltipPayloadSearcher:FT,categoricalChartProps:n,ref:t})});function SG(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function wG(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function jG({earnings:e,loading:t,error:n}){const[a,l]=S.useState("earnings"),[o,c]=S.useState(null),f=(e?.models??[]).map(p=>({model:p.model,value:a==="earnings"?p.total_usd:p.tokens_in+p.tokens_out,usd:p.total_usd,tokens:p.tokens_in+p.tokens_out,priced:p.priced})).filter(p=>p.value>0).sort((p,b)=>b.value-p.value),d=eA(e?.models),h=f.reduce((p,b)=>p+b.value,0),v=(e?.models??[]).filter(p=>!p.priced).length;return t&&!e?g.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-slate-800/50"}):g.jsxs("div",{className:"min-w-0 overflow-hidden rounded-xl border border-slate-800 bg-slate-900/60",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 px-4 py-3",children:[g.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Share by model"}),g.jsx("div",{className:"flex gap-1",role:"group","aria-label":"Distribute by",children:["earnings","tokens"].map(p=>g.jsx("button",{type:"button",onClick:()=>l(p),"aria-pressed":a===p,className:`rounded-lg px-3 py-1.5 text-xs font-medium capitalize transition focus:outline-none focus:ring-2 focus:ring-blue-500 ${a===p?"bg-slate-700 text-white":"text-slate-400 hover:bg-slate-800 hover:text-slate-200"}`,children:p},p))})]}),n&&!e?g.jsxs("div",{className:"px-4 py-8",children:[g.jsx("p",{className:"text-sm font-medium text-amber-200",children:"Traffic mix is unavailable"}),g.jsx("p",{className:"mt-1 text-xs text-slate-300",children:n.message})]}):f.length===0?g.jsxs("p",{className:"px-4 py-8 text-sm text-slate-400",children:["No ",a==="earnings"?"priced earnings":"traffic"," recorded since the node started."]}):g.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4 sm:flex-row sm:items-center",children:[g.jsx("div",{className:"h-40 w-40 shrink-0 self-center",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsx(xG,{children:g.jsx(jM,{data:f,dataKey:"value",nameKey:"model",innerRadius:"55%",outerRadius:"100%",paddingAngle:1,stroke:"none",isAnimationActive:!1,onMouseEnter:(p,b)=>c(b),onMouseLeave:()=>c(null),children:f.map((p,b)=>g.jsx(pd,{fill:Pc(d,f[b]?.model??""),opacity:o===null||o===b?1:.35},b))})})})}),g.jsx("ul",{className:"min-w-0 flex-1 space-y-1",children:f.map((p,b)=>{const x=h>0?p.value/h*100:0;return g.jsxs("li",{onMouseEnter:()=>c(b),onMouseLeave:()=>c(null),className:`flex items-start gap-2 rounded px-1 py-0.5 text-xs transition ${o===b?"bg-slate-800":""}`,children:[g.jsx("span",{className:"mt-0.5 block h-2.5 w-2.5 shrink-0 rounded-sm",style:{background:Pc(d,p.model)}}),g.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-slate-300",children:p.model}),g.jsxs("span",{className:"shrink-0 tabular-nums text-slate-300",children:[x.toFixed(1),"%"]}),g.jsx("span",{className:"w-20 shrink-0 text-right tabular-nums text-slate-400",children:a==="earnings"?SG(p.usd):wG(p.tokens)})]},p.model)})})]}),g.jsxs("p",{className:"flex items-start gap-2 border-t border-slate-800 px-4 py-3 text-xs text-slate-300",children:[g.jsx(Nf,{"aria-hidden":"true",size:14,className:"mt-px shrink-0"}),g.jsxs("span",{children:["Share of traffic served since this node last started — its counters reset on restart, so this is the recent mix rather than an all-time split. Probes are excluded.",v>0&&a==="earnings"&&` ${v} model(s) had no rate available and are absent from the earnings split; switch to tokens to see them.`]})]})]})}const P_={green:"text-green-400",red:"text-red-400",yellow:"text-yellow-400",blue:"text-blue-400",gray:"text-gray-400"};function Xu({title:e,value:t,subtitle:n,icon:a,color:l="blue"}){return g.jsxs("div",{className:"min-w-0 rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[g.jsx("span",{className:"truncate text-xs text-slate-300 sm:text-sm",children:e}),a&&g.jsx("span",{"aria-hidden":"true",className:P_[l],children:a})]}),g.jsx("div",{className:`truncate text-lg font-bold sm:text-2xl ${P_[l]}`,title:String(t),children:t}),n&&g.jsx("div",{className:"mt-1 truncate text-[11px] text-slate-400 sm:text-xs",title:n,children:n})]})}function OG(e){return e===0?"$0.00":e<.01?`$${e.toFixed(5)}`:e<1?`$${e.toFixed(4)}`:`$${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function _G(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(0)}function AG({metrics:e,loading:t,error:n,earnings:a,earningsError:l,earningsLoading:o}){if(t)return g.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[...Array(5)].map((x,O)=>g.jsxs("div",{className:"animate-pulse rounded-xl border border-slate-700 bg-slate-900 p-3 sm:p-4",children:[g.jsx("div",{className:"h-4 bg-slate-700 rounded w-20 mb-2"}),g.jsx("div",{className:"h-8 bg-slate-700 rounded w-16"})]},O))});const c=!!(e&&e.total_requests>0),f=c&&e?(e.successful_requests/e.total_requests*100).toFixed(1):null,d=!!a?.platform?.unavailable,h=!!l||!a&&!o||d,v=h?null:a?.platform?.uptime_7d_percent,p=v==null?"gray":v>=99?"green":v>=95?"yellow":"red",b=f==null?"gray":parseFloat(f)>=99?"green":parseFloat(f)>=95?"yellow":"red";return g.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 md:gap-4 xl:grid-cols-5",children:[g.jsx(Xu,{title:"7-day uptime",value:v==null?"--":`${v.toFixed(2)}%`,subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"reported by Swan Inference",icon:g.jsx(F_,{"aria-hidden":"true",size:20}),color:p}),g.jsx(Xu,{title:"Session success",value:f==null?"--":`${f}%`,subtitle:e?c?`${e.failed_requests} failed of ${_G(e.total_requests)}`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(G_,{"aria-hidden":"true",size:20}),color:b}),g.jsx(Xu,{title:"P95 latency",value:e&&c?`${e.p95_latency_ms.toFixed(0)}ms`:"--",subtitle:e?c?`Average ${e.avg_latency_ms.toFixed(0)}ms · no SLA applied`:"No requests served yet":n?"Metrics API unavailable":"No data",icon:g.jsx(N0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Request rate",value:e?`${e.requests_per_minute.toFixed(1)}/min`:"--",subtitle:e?`${e.active_requests} active now`:n?"Metrics API unavailable":"No data",icon:g.jsx(T0,{"aria-hidden":"true",size:20}),color:"blue"}),g.jsx(Xu,{title:"Lifetime earned",value:h||!a?"--":OG(a.platform.total_usd),subtitle:o&&!a?"Loading platform data":h?"Platform data unavailable":"authoritative platform total",icon:g.jsx(sD,{"aria-hidden":"true",size:20}),color:h?"gray":"green"})]})}function k_({value:e,max:t,color:n,label:a}){const l=t>0?e/t*100:0;return g.jsx("div",{className:"h-2 w-full rounded-full bg-slate-700",role:"progressbar","aria-label":a,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(Math.min(l,100)),children:g.jsx("div",{className:`h-2 rounded-full ${n}`,style:{width:`${Math.min(l,100)}%`}})})}function EG({gpus:e,loading:t,error:n}){if(t)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("div",{className:"animate-pulse space-y-4",children:g.jsx("div",{className:"h-20 bg-slate-700 rounded"})})]});if(!e||e.length===0)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"GPU Status"}),g.jsx("p",{className:"text-slate-400",children:n?"API unreachable":"No GPUs detected"})]});const a=Math.max(...e.map(o=>o.temperature_c)),l=e.filter(o=>o.utilization_percent>5).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"GPU capacity"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[l," active · peak ",a,"°C"]})]}),g.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-300",children:[g.jsx(fD,{"aria-hidden":"true",size:16}),g.jsxs("span",{children:[e.length," GPU",e.length>1?"s":""]})]})]}),g.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:e.map(o=>g.jsxs("div",{className:"border border-slate-700 rounded-lg p-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-slate-200",title:o.name,children:o.name}),g.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[g.jsx(qD,{"aria-hidden":"true",size:14,className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300"}),g.jsxs("span",{className:o.temperature_c>=90?"text-red-300":o.temperature_c>=85?"text-amber-300":"text-slate-300",children:[o.temperature_c,"°C"]})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Utilization"}),g.jsxs("span",{children:[o.utilization_percent.toFixed(0),"%"]})]}),g.jsx(k_,{value:o.utilization_percent,max:100,color:"bg-blue-500",label:`${o.name} utilization`})]}),o.memory_total_mb>0&&g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 flex justify-between text-xs text-slate-300",children:[g.jsx("span",{children:"Memory"}),g.jsxs("span",{children:[(o.memory_used_mb/1024).toFixed(1)," / ",(o.memory_total_mb/1024).toFixed(1)," GB"]})]}),g.jsx(k_,{value:o.memory_used_mb,max:o.memory_total_mb,color:o.memory_used_mb/o.memory_total_mb>=.98?"bg-red-500":o.memory_used_mb/o.memory_total_mb>=.95?"bg-amber-400":"bg-blue-500",label:`${o.name} memory allocation`})]})]})]},o.index))})]})}const z_={healthy:"bg-emerald-400",degraded:"bg-amber-400",unhealthy:"bg-red-500",unknown:"bg-slate-600"};function NG({samples:e}){if(!e||e.length===0)return null;const t=e.slice(-40),n=t.reduce((l,o)=>(l[o]=(l[o]??0)+1,l),{}),a=Object.entries(n).map(([l,o])=>`${o} ${l}`).join(", ");return g.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[g.jsx("div",{className:"flex gap-px",role:"img","aria-label":`Recent health: ${a}`,children:t.map((l,o)=>g.jsx("span",{title:l,className:`block h-3 w-1 rounded-sm ${z_[l]??z_.unknown}`},o))}),g.jsx("span",{className:"text-[10px] text-slate-400",children:"recent"})]})}const R_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});function TG({models:e,healthLog:t,prices:n,loading:a,error:l,onRefresh:o,onModelClick:c,authenticated:f,onUnlock:d,summary:h,compact:v=!1}){const[p,b]=S.useState(null),[x,O]=S.useState(""),[w,_]=S.useState(!1),E=()=>f?!0:(d(),!1),N=async $=>{if(E()){b($.id),O("");try{$.enabled?await Ze.disableModel($.id):await Ze.enableModel($.id),o()}catch(K){O(K instanceof Error?K.message:"Failed to update model")}finally{b(null)}}},T=async $=>{if(E()){b(`health-${$}`),O("");try{await Ze.forceHealthCheck($),o()}catch(K){O(K instanceof Error?K.message:"Failed to run health check")}finally{b(null)}}},k=async()=>{if(E()){b("reload"),O("");try{await Ze.reloadModels(),o()}catch($){O($ instanceof Error?$.message:"Failed to reload models")}finally{b(null)}}};if(a)return g.jsxs("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200 mb-4",children:"Models"}),g.jsx("div",{className:"animate-pulse space-y-3",children:[...Array(2)].map(($,K)=>g.jsx("div",{className:"h-16 bg-slate-700 rounded"},K))})]});const M=$=>$.health_string==="healthy",P=e.filter($=>!$.enabled||!M($)),L=v&&!w?P:e,W=h?.ready??e.filter($=>$.enabled&&M($)).length,re=h?.unhealthy??e.filter($=>$.enabled&&!M($)).length,H=h?.disabled??e.filter($=>!$.enabled).length;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Models"}),g.jsxs("p",{className:"mt-0.5 text-xs text-slate-400",children:[W," ready",re>0&&` · ${re} unhealthy`,H>0&&` · ${H} disabled`]})]}),g.jsxs("button",{type:"button",onClick:k,disabled:p==="reload",className:"flex min-h-10 items-center gap-1.5 rounded-lg border border-slate-600 bg-slate-800 px-3 text-sm transition-colors hover:bg-slate-700 disabled:opacity-50",children:[f?g.jsx(C0,{"aria-hidden":"true",size:14,className:p==="reload"?"animate-spin":""}):g.jsx(M0,{"aria-hidden":"true",size:14}),"Reload Config"]})]}),x&&g.jsx("p",{role:"alert",className:"mb-3 rounded-lg border border-red-800/60 bg-red-950/30 px-3 py-2 text-sm text-red-300",children:x}),!e||e.length===0?g.jsx("p",{className:"text-slate-400",children:l?"API unreachable":"No models configured"}):v&&!w&&P.length===0?g.jsxs("div",{className:"rounded-lg border border-emerald-900/60 bg-emerald-950/20 px-4 py-5 text-center",children:[g.jsx(wl,{"aria-hidden":"true",size:24,className:"mx-auto text-emerald-300"}),g.jsx("p",{className:"mt-2 text-sm font-medium text-emerald-100",children:"All configured models are ready"}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Healthy models are collapsed to keep operational exceptions visible."})]}):g.jsx("div",{className:"space-y-3",children:L.map($=>{const K=n[$.id];return g.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border border-slate-600 bg-slate-700/50 p-3 transition-colors hover:border-slate-500 sm:items-center",children:[g.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-start gap-3 rounded text-left focus:outline-none focus:ring-2 focus:ring-blue-500 sm:items-center",onClick:()=>c?.($.id),"aria-label":`View details for ${$.id}`,children:[g.jsx("div",{className:"flex-shrink-0",children:$.enabled?M($)?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(ka,{size:20,className:"text-red-400"}):g.jsx(Nf,{size:20,className:"text-slate-400"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"break-words font-medium text-slate-200",children:$.id}),g.jsxs("div",{className:"mt-0.5 break-all text-xs text-slate-400",children:[$.endpoint," • ",$.category,$.gpu_memory>0&&` • ${($.gpu_memory/1024).toFixed(1)}GB VRAM`]}),g.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[$.state_string," • ",$.health_string]}),g.jsx(NG,{samples:t?.[$.id]??[]}),K&&g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[g.jsx("span",{className:"font-medium text-emerald-300",children:"Provider payout / 1M"}),g.jsxs("span",{className:"text-blue-200",children:["In ",R_.format(K.provider_input_price)]}),g.jsxs("span",{className:"text-violet-200",children:["Out ",R_.format(K.provider_output_price)]})]})]})]}),g.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1 sm:gap-2",children:[g.jsx("button",{type:"button",onClick:()=>T($.id),disabled:p===`health-${$.id}`||!$.enabled,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-slate-600 rounded transition-colors disabled:opacity-50",title:"Force health check","aria-label":`Run health check for ${$.id}`,children:g.jsx(kl,{size:16,className:p===`health-${$.id}`?"animate-spin":""})}),g.jsx("button",{type:"button",onClick:()=>N($),disabled:p===$.id,className:`p-2 rounded transition-colors ${$.enabled?"text-green-400 hover:text-green-300 hover:bg-green-900/30":"text-slate-400 hover:text-slate-300 hover:bg-slate-600"} disabled:opacity-50`,title:$.enabled?"Disable model":"Enable model","aria-label":`${$.enabled?"Disable":"Enable"} ${$.id}`,children:g.jsx(OD,{size:16})})]})]},$.id)})}),v&&e.length>0&&g.jsxs("button",{type:"button",onClick:()=>_($=>!$),className:"mt-4 inline-flex min-h-10 w-full items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-950/40 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-expanded":w,children:[w?g.jsx(Ap,{"aria-hidden":"true",size:16}):g.jsx(Dc,{"aria-hidden":"true",size:16}),w?"Hide healthy models":`Show all ${e.length} models`]})]})}function MG({data:e,loading:t,error:n,onOpenSettings:a}){if(t)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("div",{className:"h-28 animate-pulse rounded-lg bg-slate-800"})]});if(!e)return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsx("h3",{className:"mb-4 text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"text-sm text-slate-400",children:n?"API unreachable":"No control data available"})]});const{rate_limiter:l,concurrency_limiter:o,retry_policy:c}=e;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-200",children:"Request controls"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Current admission and retry state"})]}),g.jsx("button",{type:"button",onClick:a,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg text-slate-400 transition hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Open request limit settings",children:g.jsx(RD,{"aria-hidden":"true",size:18})})]}),g.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:[g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(T0,{"aria-hidden":"true",size:14,className:"text-blue-400"}),g.jsx("span",{children:"Rate limit"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[l.current_rate.toFixed(0)," ",g.jsx("span",{className:"text-xs font-normal text-slate-400",children:"req/s"})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[l.total_throttled," throttled · burst ",l.burst_size]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(vD,{"aria-hidden":"true",size:14,className:"text-emerald-400"}),g.jsx("span",{children:"Concurrency"})]}),g.jsxs("div",{className:"mt-2 text-lg font-semibold text-white",children:[o.global_active,g.jsxs("span",{className:"text-slate-400",children:["/",o.global_max]})]}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:["active slots · ",o.total_rejected," rejected"]})]}),g.jsxs("div",{className:"min-w-0 rounded-lg border border-slate-800 bg-slate-950/50 p-3",children:[g.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-slate-300",children:[g.jsx(C0,{"aria-hidden":"true",size:14,className:"text-amber-300"}),g.jsx("span",{children:"Retry recovery"})]}),g.jsx("div",{className:"mt-2 text-lg font-semibold text-white",children:c.total_retries>0?`${(c.retry_success_rate*100).toFixed(0)}%`:"—"}),g.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[c.total_successes," recovered · ",c.total_failures," failed"]})]})]})]})}function CG(e){return e?`Updated ${e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}`:""}function DG({status:e,loading:t,error:n,lastUpdated:a}){return t?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx("div",{className:"w-3 h-3 bg-slate-600 rounded-full animate-pulse"}),g.jsx("span",{className:"text-sm text-slate-300",children:"Connecting…"})]}):!e&&n?g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg border border-amber-800 bg-amber-900/20 px-3 py-2",children:[g.jsx(Ep,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm text-amber-200",children:"API unavailable"})]}):e?g.jsxs("div",{title:n?.message,className:`flex min-h-10 items-center gap-2 rounded-lg border px-2.5 py-2 sm:gap-3 sm:px-3 ${n?"border-amber-800 bg-amber-900/20":e.connected?"border-green-800 bg-green-900/20":"border-red-800 bg-red-900/20"}`,children:[g.jsx("div",{className:"flex items-center gap-2",children:n?g.jsxs(g.Fragment,{children:[g.jsx(Ep,{"aria-hidden":"true",size:16,className:"text-amber-300"}),g.jsx("span",{className:"text-sm font-medium text-amber-200",children:"Stale"})]}):e.connected?g.jsxs(g.Fragment,{children:[g.jsx(GD,{"aria-hidden":"true",size:16,className:"text-green-400"}),g.jsx("span",{className:"text-sm font-medium text-green-300",children:"Connected"})]}):g.jsxs(g.Fragment,{children:[g.jsx(IS,{"aria-hidden":"true",size:16,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Disconnected"})]})}),!n&&g.jsxs("div",{className:"ml-auto hidden text-xs text-slate-300 md:block",children:[CG(a),e.active_models?.length>0&&` · ${e.active_models.length} model${e.active_models.length>1?"s":""}`]})]}):g.jsxs("div",{className:"flex min-h-10 items-center gap-2 rounded-lg bg-slate-700/50 px-3 py-2",children:[g.jsx(IS,{"aria-hidden":"true",size:16,className:"text-slate-300"}),g.jsx("span",{className:"text-sm text-slate-300",children:"No data"})]})}function E0(e,t=!1){if(!e)return"—";const n=new Date(e);return t?n.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"}):n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"})}function L_(e){return e<1e3?`${e.toFixed(0)} ms`:`${(e/1e3).toFixed(2)} s`}function U_(e){return e>5e3?"text-red-300":e>2e3?"text-amber-300":"text-emerald-300"}const lo={hub:{label:"Hub",title:"Routed to this node by Swan Inference",className:"bg-blue-500/10 text-blue-300 ring-blue-500/30"},health:{label:"Health",title:"This node's own engine probe: a one-token completion checking the backend can serve",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"},selfcheck:{label:"Self-check",title:"This node's periodic audit probe",className:"bg-slate-500/10 text-slate-400 ring-slate-500/30"}},$_=[25,50,100];function q_({source:e}){const t=lo[e??"hub"]??lo.hub;return g.jsx("span",{title:t.title,className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset ${t.className}`,children:t.label})}function B_({success:e}){return e?g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-800/70 bg-emerald-950/40 px-2 py-1 text-xs font-medium text-emerald-300",children:[g.jsx(wl,{"aria-hidden":"true",size:13})," Success"]}):g.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-red-800/70 bg-red-950/40 px-2 py-1 text-xs font-medium text-red-300",children:[g.jsx(ka,{"aria-hidden":"true",size:13})," Failed"]})}function I_({request:e}){return g.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Request ID"}),g.jsx("span",{className:"mt-1 block break-all font-mono text-slate-300",children:e.request_id})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Completed"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:E0(e.end_time,!0)})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Total tokens"}),g.jsx("span",{className:"mt-1 block font-mono text-slate-300",children:(e.tokens_in+e.tokens_out).toLocaleString()})]}),g.jsxs("div",{children:[g.jsx("span",{className:"block text-slate-400",children:"Delivery"}),g.jsx("span",{className:"mt-1 block text-slate-300",children:e.streaming?"Streaming":"Single response"})]}),e.error_reason&&g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("span",{className:"block text-slate-400",children:"Error"}),g.jsx("span",{className:"mt-1 block break-words text-red-300",children:e.error_reason})]})]})}function PG({models:e}){const[t,n]=S.useState(""),[a,l]=S.useState(""),[o,c]=S.useState($_[0]),[f,d]=S.useState(0),[h,v]=S.useState(null),p=H=>{H(),d(0),v(null)},{data:b,error:x,loading:O,refetch:w}=Da(S.useCallback(()=>Ze.getRequestHistory({limit:o,offset:f*o,model:t||void 0,source:a||void 0}),[o,f,t,a]),f===0?1e4:0),_=b?.requests??[],E=b?.total??0,N=_.reduce((H,$)=>H+$.tokens_in,0),T=_.reduce((H,$)=>H+$.tokens_out,0),k=H=>v($=>$===H?null:H),M=Math.max(1,Math.ceil(E/o)),P=E===0?0:f*o+1,L=f*o+_.length,W=f>0,re=Lp(()=>n(H.target.value)),className:"min-h-10 min-w-0 flex-1 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 sm:min-w-56",children:[g.jsx("option",{value:"",children:"All models"}),e.map(H=>g.jsx("option",{value:H.id,children:H.id},H.id))]}),g.jsx("label",{htmlFor:"transaction-source-filter",className:"sr-only",children:"Filter requests by source"}),g.jsxs("select",{id:"transaction-source-filter",value:a,onChange:H=>p(()=>l(H.target.value)),className:"min-h-10 min-w-0 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:[g.jsx("option",{value:"",children:"All sources"}),Object.entries(lo).map(([H,$])=>g.jsx("option",{value:H,children:$.label},H))]}),g.jsx("button",{type:"button",onClick:w,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh requests",children:g.jsx(kl,{"aria-hidden":"true",size:16,className:O?"animate-spin":""})})]})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[g.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-3 sm:p-4",children:[g.jsx("p",{className:"text-xs text-slate-400",children:"Matching"}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:E.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:t||a?"requests match the filters":"requests in history"})]}),g.jsxs("div",{className:"rounded-xl border border-blue-900/70 bg-blue-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-blue-300",children:[g.jsx(Im,{"aria-hidden":"true",size:13})," Input tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:N.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]}),g.jsxs("div",{className:"rounded-xl border border-violet-900/70 bg-violet-950/20 p-3 sm:p-4",children:[g.jsxs("p",{className:"flex items-center gap-1 text-xs text-violet-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Output tokens"]}),g.jsx("p",{className:"mt-1 text-lg font-semibold text-white sm:text-xl",children:T.toLocaleString()}),g.jsx("p",{className:"mt-1 hidden text-xs text-slate-400 sm:block",children:"across rows shown"})]})]}),g.jsx("div",{className:"overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:O&&_.length===0?g.jsx("div",{className:"animate-pulse space-y-3 p-4",role:"status","aria-label":"Loading transactions",children:[...Array(6)].map((H,$)=>g.jsx("div",{className:"h-14 rounded-lg bg-slate-800"},$))}):x&&_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center",children:[g.jsx(ka,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-red-400"}),g.jsx("p",{className:"font-medium text-red-200",children:"Requests are unavailable"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:x.message}),g.jsx("button",{type:"button",onClick:w,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]}):_.length===0?g.jsxs("div",{className:"px-4 py-12 text-center text-slate-400",children:[g.jsx(N0,{"aria-hidden":"true",size:32,className:"mx-auto mb-3 text-slate-600"}),t||a?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests match these filters"}),g.jsxs("p",{className:"mt-1 text-sm",children:["Nothing recorded for ",a?`${lo[a].label.toLowerCase()} traffic`:"this source",t?` on ${t}`:""," yet."]}),g.jsx("button",{type:"button",onClick:()=>p(()=>{n(""),l("")}),className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:"Clear filters"})]}):g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"font-medium text-slate-300",children:"No requests yet"}),g.jsx("p",{className:"mt-1 text-sm",children:"Requests will appear here after the provider serves inference."})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"hidden overflow-x-auto md:block",children:g.jsxs("table",{className:"w-full min-w-[840px] text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"border-b border-slate-800 bg-slate-950/40 text-xs uppercase tracking-wide text-slate-400",children:[g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Started"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Model"}),g.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Latency"}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Im,{"aria-hidden":"true",size:13})," Input tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(Hm,{"aria-hidden":"true",size:13})," Output tokens"]})}),g.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Status"}),g.jsx("th",{className:"w-12 px-3 py-3",children:g.jsx("span",{className:"sr-only",children:"Details"})})]})}),g.jsx("tbody",{children:_.map(H=>{const $=h===H.request_id;return g.jsxs(S.Fragment,{children:[g.jsxs("tr",{className:`border-b border-slate-800/80 ${H.success?"hover:bg-slate-800/35":"bg-red-950/10 hover:bg-red-950/20"}`,children:[g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-slate-300",title:new Date(H.start_time).toLocaleString(),children:E0(H.start_time)}),g.jsxs("td",{className:"max-w-xs px-4 py-3",children:[g.jsx("span",{className:"block truncate font-mono text-xs text-slate-200",title:H.model,children:H.model}),H.streaming&&g.jsx("span",{className:"mt-0.5 block text-xs text-blue-300",children:"Streaming"})]}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3",children:g.jsx(q_,{source:H.source})}),g.jsx("td",{className:`whitespace-nowrap px-4 py-3 text-right font-mono text-xs ${U_(H.latency_ms)}`,children:L_(H.latency_ms)}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-blue-200",children:H.tokens_in.toLocaleString()}),g.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-right font-mono text-sm text-violet-200",children:H.tokens_out.toLocaleString()}),g.jsx("td",{className:"px-4 py-3 text-right",children:g.jsx(B_,{success:H.success})}),g.jsx("td",{className:"px-3 py-3 text-right",children:g.jsx("button",{type:"button",onClick:()=>k(H.request_id),"aria-expanded":$,"aria-controls":`receipt-${H.request_id}`,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":`${$?"Hide":"Show"} details for request ${H.request_id}`,children:$?g.jsx(Ap,{"aria-hidden":"true",size:16}):g.jsx(Dc,{"aria-hidden":"true",size:16})})})]}),$&&g.jsx("tr",{id:`receipt-${H.request_id}`,className:"border-b border-slate-800 bg-slate-950/60",children:g.jsx("td",{colSpan:8,className:"px-4 py-4",children:g.jsx(I_,{request:H})})})]},H.request_id)})})]})}),g.jsx("div",{className:"divide-y divide-slate-800 md:hidden",children:_.map(H=>{const $=h===H.request_id;return g.jsxs("article",{className:H.success?"":"bg-red-950/10",children:[g.jsxs("button",{type:"button",onClick:()=>k(H.request_id),"aria-expanded":$,"aria-controls":`mobile-receipt-${H.request_id}`,className:"w-full p-4 text-left focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-sm text-white",children:H.model}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[E0(H.start_time,!0),H.streaming?" · Streaming":""]})]}),g.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-slate-400",children:[g.jsx(q_,{source:H.source}),$?g.jsx(Ap,{"aria-hidden":"true",size:18}):g.jsx(Dc,{"aria-hidden":"true",size:18})]})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[g.jsxs("div",{children:[g.jsx("span",{className:"block text-[11px] text-slate-400",children:"Latency"}),g.jsx("span",{className:`mt-0.5 block font-mono text-xs ${U_(H.latency_ms)}`,children:L_(H.latency_ms)})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-blue-300",children:[g.jsx(Im,{"aria-hidden":"true",size:11})," Input"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-blue-100",children:H.tokens_in.toLocaleString()})]}),g.jsxs("div",{children:[g.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-violet-300",children:[g.jsx(Hm,{"aria-hidden":"true",size:11})," Output"]}),g.jsx("span",{className:"mt-0.5 block font-mono text-sm text-violet-100",children:H.tokens_out.toLocaleString()})]})]}),g.jsx("div",{className:"mt-3",children:g.jsx(B_,{success:H.success})})]}),$&&g.jsx("div",{id:`mobile-receipt-${H.request_id}`,className:"border-t border-slate-800 bg-slate-950/60 p-4",children:g.jsx(I_,{request:H})})]},H.request_id)})})]})}),g.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("p",{className:"text-xs text-slate-400","aria-live":"polite",children:[E===0?"No requests to show.":`Showing ${P.toLocaleString()}–${L.toLocaleString()} of ${E.toLocaleString()}`,t?` for ${t}`:"",a?` from ${lo[a].label.toLowerCase()}`:"",". ",f===0?"Auto-refreshes every 10 seconds.":"Auto-refresh is paused while viewing older pages."]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("label",{htmlFor:"transaction-page-size",className:"text-xs text-slate-400",children:"Per page"}),g.jsx("select",{id:"transaction-page-size",value:o,onChange:H=>p(()=>c(Number(H.target.value))),className:"min-h-9 rounded-lg border border-slate-700 bg-slate-900 px-2 text-xs text-slate-200 outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",children:$_.map(H=>g.jsx("option",{value:H,children:H},H))}),g.jsxs("div",{className:"ml-1 flex items-center gap-1",children:[g.jsx("button",{type:"button",onClick:()=>{d(H=>Math.max(0,H-1)),v(null)},disabled:!W,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Previous page",children:g.jsx(Z4,{"aria-hidden":"true",size:16})}),g.jsxs("span",{className:"px-2 text-xs tabular-nums text-slate-400",children:[f+1," / ",M]}),g.jsx("button",{type:"button",onClick:()=>{d(H=>H+1),v(null)},disabled:!re,className:"inline-flex min-h-9 min-w-9 items-center justify-center rounded-lg border border-slate-700 bg-slate-900 text-slate-300 hover:bg-slate-800 disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Next page",children:g.jsx(W4,{"aria-hidden":"true",size:16})})]})]})]})]})}const _p={"1h":{duration:"1h",resolution:"1m",label:"1 Hour"},"6h":{duration:"6h",resolution:"5m",label:"6 Hours"},"24h":{duration:"24h",resolution:"15m",label:"24 Hours"},"7d":{duration:"168h",resolution:"1h",label:"7 Days"}};function kG(){const[e,t]=S.useState("1h"),n=_p[e],{data:a,error:l,loading:o,refetch:c}=Da(S.useCallback(()=>Ze.getMetricsHistory(n.duration,n.resolution),[n.duration,n.resolution]),6e4),f=a?.data??[],d=N=>{const T=new Date(N);return e==="7d"?T.toLocaleDateString(void 0,{weekday:"short",day:"numeric"}):e==="24h"?T.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):T.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},h=f.map(N=>({time:d(N.timestamp),requests:N.total_requests,successRate:N.success_rate,avgLatency:N.avg_latency_ms,p99Latency:N.p99_latency_ms,tokensPerSec:N.tokens_per_second})),v=h[h.length-1],p=h.flatMap(N=>[N.avgLatency,N.p99Latency]),b=p.length>0?Math.min(...p):0,x=p.length>0?Math.max(...p):0,O=h.length>0?Math.min(...h.map(N=>N.successRate)):0,w=h.length>0?Math.max(...h.map(N=>N.successRate)):0,_=h.length>0?Math.min(...h.map(N=>N.tokensPerSec)):0,E=h.length>0?Math.max(...h.map(N=>N.tokensPerSec)):0;return g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(BS,{size:20,className:"text-purple-400"}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Performance trends"}),g.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"Persisted service signals across one shared time range"})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("div",{className:"flex min-w-0 flex-1 overflow-x-auto rounded-lg bg-slate-800 p-0.5 sm:flex-none",children:Object.keys(_p).map(N=>g.jsx("button",{onClick:()=>t(N),className:`min-h-10 flex-1 whitespace-nowrap rounded px-2 py-1 text-xs font-medium transition-colors sm:flex-none sm:px-3 ${e===N?"bg-blue-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:_p[N].label},N))}),g.jsx("button",{type:"button",onClick:c,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",title:"Refresh","aria-label":"Refresh performance trends",children:g.jsx(kl,{size:16,className:o?"animate-spin":""})})]})]}),l&&g.jsxs("div",{role:"alert",className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-3 py-2 text-sm text-amber-100",children:[g.jsx("span",{children:a?"Showing the last loaded trends; refresh failed.":`Performance trends are unavailable: ${l.message}`}),g.jsx("button",{type:"button",onClick:c,className:"min-h-10 rounded-lg border border-amber-700/70 px-3 text-sm hover:bg-amber-900/30",children:"Try again"})]}),o&&h.length===0?g.jsx("div",{className:"h-64 flex items-center justify-center",children:g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full"})}):h.length<2?g.jsx("div",{className:"h-64 flex items-center justify-center text-slate-400",children:g.jsxs("div",{className:"text-center",children:[g.jsx(BS,{size:32,className:"mx-auto mb-2 opacity-50"}),g.jsx("p",{children:"Not enough historical data yet"}),g.jsx("p",{className:"text-xs mt-1",children:"Data is recorded every minute"})]})}):g.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[g.jsxs("div",{role:"img","aria-label":`Latency ranged from ${b.toFixed(0)} to ${x.toFixed(0)} milliseconds. Latest average ${v?.avgLatency.toFixed(0)} milliseconds and P99 ${v?.p99Latency.toFixed(0)} milliseconds.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Latency (ms)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Cc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Tc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[(typeof N=="number"?N.toFixed(1):N)+"ms",""]}),g.jsx(LE,{wrapperStyle:{fontSize:"10px"},formatter:N=>g.jsx("span",{className:"text-slate-400",children:N})}),g.jsx(Sl,{type:"monotone",dataKey:"avgLatency",stroke:"#3b82f6",strokeWidth:2,dot:!1,name:"Avg"}),g.jsx(Sl,{type:"monotone",dataKey:"p99Latency",stroke:"#ef4444",strokeWidth:1.5,dot:!1,name:"P99"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Success rate ranged from ${O.toFixed(1)} to ${w.toFixed(1)} percent. Latest ${v?.successRate.toFixed(1)} percent.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Success rate (%)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Cc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,domain:[0,100]}),g.jsx(Tc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[(typeof N=="number"?N.toFixed(1):N)+"%","Success Rate"]}),g.jsx(Sl,{type:"monotone",dataKey:"successRate",stroke:"#22c55e",strokeWidth:2,dot:!1,name:"Success Rate"})]})})})]}),g.jsxs("div",{role:"img","aria-label":`Throughput ranged from ${_.toFixed(1)} to ${E.toFixed(1)} tokens per second. Latest ${v?.tokensPerSec.toFixed(1)} tokens per second.`,children:[g.jsx("h4",{className:"mb-2 text-sm font-medium text-slate-300",children:"Throughput (tokens/sec)"}),g.jsx("div",{className:"h-40","aria-hidden":"true",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Cc,{data:h,accessibilityLayer:!1,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1,interval:"preserveStartEnd"}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(Tc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"},formatter:N=>[typeof N=="number"?N.toFixed(1):N,"Tokens/sec"]}),g.jsx(Sl,{type:"monotone",dataKey:"tokensPerSec",stroke:"#a855f7",strokeWidth:2,dot:!1,name:"Tokens/sec"})]})})})]})]}),g.jsxs("div",{className:"mt-4 text-center text-xs text-slate-400",children:["Showing ",n.label," of data (",n.resolution," resolution)"]})]})}function zG({modelId:e,onClose:t}){const[n,a]=S.useState(null),[l,o]=S.useState(!0),[c,f]=S.useState(null),d=S.useRef(null),h=S.useRef(null),v=S.useRef(null);S.useEffect(()=>{v.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const N=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const T=k=>{if(k.key==="Escape"){k.preventDefault(),t();return}if(k.key!=="Tab"||!d.current)return;const M=Array.from(d.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),P=M[0],L=M[M.length-1];!P||!L||(k.shiftKey&&document.activeElement===P?(k.preventDefault(),L.focus()):!k.shiftKey&&document.activeElement===L&&(k.preventDefault(),P.focus()))};return window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T),document.body.style.overflow=N,v.current?.focus()}},[t]),S.useEffect(()=>{const N=async()=>{o(!0),f(null);try{const k=await Ze.getModelMetrics(e);a(k)}catch(k){f(k instanceof Error?k.message:"Failed to load model metrics")}finally{o(!1)}};N();const T=setInterval(N,5e3);return()=>clearInterval(T)},[e]);const p=N=>N?new Date(N).toLocaleTimeString():"-",b=N=>N<1e3?`${N.toFixed(0)}ms`:`${(N/1e3).toFixed(2)}s`,x=N=>N<1e3?N.toLocaleString():N<1e6?`${(N/1e3).toFixed(1)}K`:`${(N/1e6).toFixed(1)}M`,O=N=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(N),w=n?.price?((n.metrics?.total_tokens_in??0)*n.price.provider_input_price+(n.metrics?.total_tokens_out??0)*n.price.provider_output_price)/1e6:null,_=n?.health?.health_string==="healthy"||n?.model?.health_string==="healthy",E=(n?.recent_requests??[]).slice().reverse().map(N=>({time:p(N.start_time),latency:N.latency_ms}));return g.jsx("div",{ref:d,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-2 sm:p-4",onClick:t,role:"dialog","aria-modal":"true","aria-labelledby":"model-detail-title","aria-describedby":"model-detail-description",children:g.jsxs("div",{className:"max-h-[94vh] w-full max-w-4xl overflow-y-auto rounded-xl border border-slate-700 bg-slate-900",onClick:N=>N.stopPropagation(),children:[g.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-slate-700 bg-slate-900 p-4",children:[g.jsxs("div",{children:[g.jsx("h2",{id:"model-detail-title",className:"break-words text-xl font-semibold text-slate-100",children:e}),g.jsx("p",{id:"model-detail-description",className:"text-sm text-slate-300",children:"Health, usage, pricing, and recent requests"})]}),g.jsx("button",{ref:h,type:"button",onClick:t,className:"inline-flex min-h-10 min-w-10 items-center justify-center rounded text-slate-300 transition-colors hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close model details",children:g.jsx(Z_,{"aria-hidden":"true",size:20})})]}),l&&!n?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full mx-auto"}),g.jsx("p",{className:"mt-4 text-slate-400",children:"Loading model metrics..."})]}):c?g.jsxs("div",{className:"p-8 text-center",children:[g.jsx(ka,{size:32,className:"mx-auto text-red-400 mb-2"}),g.jsx("p",{className:"text-red-400",children:c})]}):g.jsxs("div",{className:"p-4 space-y-6",children:[g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[_?g.jsx(wl,{size:20,className:"text-green-400"}):g.jsx(ka,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Health Status"})]}),g.jsx("p",{className:`text-lg font-semibold ${_?"text-green-400":"text-red-400"}`,children:_?"Healthy":"Unhealthy"}),n?.health?.consecutive_fails?g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n.health.consecutive_fails," consecutive failures"]}):null]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(G_,{size:20,className:"text-blue-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Total Requests"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:n?.metrics?.total_requests?.toLocaleString()??0}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.successful_requests??0," successful, ",n?.metrics?.failed_requests??0," failed"]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(N0,{size:20,className:"text-yellow-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Avg Latency"})]}),g.jsx("p",{className:"text-lg font-semibold text-slate-100",children:b(n?.metrics?.avg_latency_ms??0)}),g.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[n?.metrics?.active_requests??0," active requests"]})]})]}),g.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[g.jsxs("div",{className:"rounded-lg bg-slate-700/50 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(FD,{size:20,className:"text-purple-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Token usage"})]}),g.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center sm:gap-4",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_in??0)}),g.jsx("p",{className:"text-xs text-blue-200",children:"Input tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:x(n?.metrics?.total_tokens_out??0)}),g.jsx("p",{className:"text-xs text-violet-200",children:"Output tokens"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-2xl font-semibold text-slate-100",children:(n?.metrics?.tokens_per_second??0).toFixed(1)}),g.jsx("p",{className:"text-xs text-slate-400",children:"Tokens/sec"})]})]})]}),g.jsxs("div",{className:"rounded-lg border border-emerald-800/50 bg-emerald-950/20 p-4",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[g.jsx(iD,{size:20,className:"text-emerald-400"}),g.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Provider payout / 1M tokens"}),n?.price?.tier&&g.jsx("span",{className:"ml-auto rounded-full border border-slate-600 px-2 py-0.5 text-[10px] uppercase tracking-wide text-slate-400",children:n.price.tier})]}),n?.price?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-blue-100",children:O(n.price.provider_input_price)}),g.jsx("p",{className:"text-xs text-blue-300",children:"Input"})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xl font-semibold text-violet-100",children:O(n.price.provider_output_price)}),g.jsx("p",{className:"text-xs text-violet-300",children:"Output"})]})]}),w!==null&&g.jsxs("p",{className:"mt-3 border-t border-emerald-900/60 pt-2 text-xs text-slate-400",children:["Estimated payout for recorded tokens: ",g.jsx("span",{className:"font-medium text-emerald-300",children:O(w)})]})]}):g.jsx("p",{className:"text-sm text-slate-400",children:"Current catalog price is unavailable."})]})]}),g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-200",children:"Transactions for this model"}),g.jsx("p",{className:"mb-3 mt-1 text-xs text-slate-400",children:"Latest 20 local requests, with input and output tokens shown separately."}),(n?.recent_requests??[]).length===0?g.jsx("p",{className:"text-slate-400 text-center py-4",children:"No transactions recorded for this model"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"space-y-2 sm:hidden",children:(n?.recent_requests??[]).map(N=>g.jsxs("div",{className:"rounded-lg border border-slate-600 bg-slate-800/60 p-3",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:"truncate font-mono text-xs text-slate-300",title:N.request_id,children:N.request_id}),g.jsxs("p",{className:"mt-1 text-xs text-slate-400",children:[p(N.start_time)," · ",b(N.latency_ms)]})]}),N.success?g.jsx(wl,{size:16,className:"shrink-0 text-green-400"}):g.jsx(ka,{size:16,className:"shrink-0 text-red-400"})]}),g.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[g.jsxs("div",{className:"rounded bg-blue-950/30 px-2 py-1.5 text-blue-200",children:["Input ",g.jsx("span",{className:"float-right font-mono",children:N.tokens_in.toLocaleString()})]}),g.jsxs("div",{className:"rounded bg-violet-950/30 px-2 py-1.5 text-violet-200",children:["Output ",g.jsx("span",{className:"float-right font-mono",children:N.tokens_out.toLocaleString()})]})]})]},N.request_id))}),g.jsx("div",{className:"hidden overflow-x-auto sm:block",children:g.jsxs("table",{className:"w-full text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"text-slate-400 border-b border-slate-600",children:[g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Transaction"}),g.jsx("th",{className:"text-left py-2 px-2 font-medium",children:"Time"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Latency"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Input"}),g.jsx("th",{className:"text-right py-2 px-2 font-medium",children:"Output"}),g.jsx("th",{className:"text-center py-2 px-2 font-medium",children:"Status"})]})}),g.jsx("tbody",{children:(n?.recent_requests??[]).map(N=>g.jsxs("tr",{className:"border-b border-slate-600/50",children:[g.jsx("td",{className:"max-w-36 truncate px-2 py-2 font-mono text-xs text-slate-400",title:N.request_id,children:N.request_id}),g.jsx("td",{className:"py-2 px-2 text-slate-300 text-xs",children:p(N.start_time)}),g.jsx("td",{className:"py-2 px-2 text-right font-mono text-xs",children:g.jsx("span",{className:N.latency_ms>5e3?"text-red-400":N.latency_ms>2e3?"text-yellow-400":"text-green-400",children:b(N.latency_ms)})}),g.jsx("td",{className:"py-2 px-2 text-right text-blue-200 font-mono text-xs",children:N.tokens_in.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-right text-violet-200 font-mono text-xs",children:N.tokens_out.toLocaleString()}),g.jsx("td",{className:"py-2 px-2 text-center",children:N.success?g.jsx(wl,{size:14,className:"inline text-green-400"}):g.jsx(ka,{size:14,className:"inline text-red-400"})})]},N.request_id))})]})})]})]}),E.length>1&&g.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-4",children:[g.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-3",children:"Recent transaction latency"}),g.jsx("div",{className:"h-40",children:g.jsx(to,{width:"100%",height:"100%",children:g.jsxs(Cc,{data:E,children:[g.jsx(ro,{strokeDasharray:"3 3",stroke:"#334155"}),g.jsx(ao,{dataKey:"time",stroke:"#64748b",fontSize:10,tickLine:!1}),g.jsx(io,{stroke:"#64748b",fontSize:10,tickLine:!1,unit:"ms"}),g.jsx(Tc,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#94a3b8"}}),g.jsx(Sl,{type:"monotone",dataKey:"latency",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",strokeWidth:0,r:3},name:"Latency"})]})})})]}),n?.health?.last_error&&g.jsxs("div",{className:"bg-red-900/20 border border-red-800/50 rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(Nf,{size:20,className:"text-red-400"}),g.jsx("span",{className:"text-sm font-medium text-red-300",children:"Last Error"})]}),g.jsx("p",{className:"text-sm text-red-400 font-mono",children:n.health.last_error})]})]})]})})}function RG({open:e,onClose:t,onAuthenticated:n}){const[a,l]=S.useState(""),[o,c]=S.useState(""),[f,d]=S.useState(!1),h=S.useRef(null),v=S.useRef(null),p=S.useRef(null);if(S.useEffect(()=>{if(!e)return;c(""),p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const x=document.body.style.overflow;document.body.style.overflow="hidden",window.setTimeout(()=>h.current?.focus(),0);const O=w=>{if(w.key==="Escape"){w.preventDefault(),t();return}if(w.key!=="Tab"||!v.current)return;const _=Array.from(v.current.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')),E=_[0],N=_[_.length-1];!E||!N||(w.shiftKey&&document.activeElement===E?(w.preventDefault(),N.focus()):!w.shiftKey&&document.activeElement===N&&(w.preventDefault(),E.focus()))};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O),document.body.style.overflow=x,p.current?.focus()}},[e,t]),!e)return null;const b=async x=>{if(x.preventDefault(),!!a.trim()){d(!0),c(""),Ze.setAccessToken(a);try{await Ze.getSettings(),l(""),n()}catch(O){Ze.clearAccessToken(),c(O instanceof Error?O.message:"The access token was rejected")}finally{d(!1)}}};return g.jsx("div",{ref:v,className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/80 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-labelledby":"unlock-title","aria-describedby":"unlock-description",onMouseDown:x=>{x.target===x.currentTarget&&t()},children:g.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-slate-700 bg-slate-900 shadow-2xl shadow-black/40",children:[g.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-slate-800 p-5",children:[g.jsxs("div",{className:"flex gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(V_,{"aria-hidden":"true",size:22})}),g.jsxs("div",{children:[g.jsx("h2",{id:"unlock-title",className:"text-lg font-semibold text-white",children:"Unlock operator controls"}),g.jsx("p",{id:"unlock-description",className:"mt-1 text-sm text-slate-300",children:"Monitoring stays read-only until this browser tab is unlocked."})]})]}),g.jsx("button",{type:"button",onClick:t,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Close unlock dialog",children:g.jsx(Z_,{"aria-hidden":"true",size:20})})]}),g.jsxs("form",{onSubmit:b,className:"space-y-4 p-5",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"control-token",className:"mb-2 block text-sm font-medium text-slate-200",children:"Control token"}),g.jsx("input",{ref:h,id:"control-token",type:"password",autoComplete:"off",value:a,onChange:x=>l(x.target.value),className:"min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 font-mono text-sm text-white outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30",placeholder:"Paste dashboard.token","aria-describedby":"token-help"}),g.jsxs("p",{id:"token-help",className:"mt-2 text-xs leading-5 text-slate-300",children:["On the provider host, read ",g.jsx("code",{className:"rounded bg-slate-800 px-1.5 py-0.5 text-slate-300",children:"$CP_PATH/dashboard.token"}),". The token is kept only for this browser tab."]})]}),o&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/70 bg-red-950/40 px-3 py-2 text-sm text-red-300",children:o}),g.jsxs("div",{className:"flex justify-end gap-3",children:[g.jsx("button",{type:"button",onClick:t,className:"min-h-10 rounded-lg px-4 text-sm text-slate-300 hover:bg-slate-800",children:"Cancel"}),g.jsx("button",{type:"submit",disabled:f||!a.trim(),className:"min-h-10 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",children:f?"Checking…":"Unlock"})]})]})]})})}const LG=[{id:"limits",label:"Limits"},{id:"models",label:"Models"},{id:"alerts",label:"Alerts"},{id:"self-check",label:"Self-check"},{id:"logging",label:"Logging"}],Le="min-h-11 w-full rounded-lg border border-slate-600 bg-slate-950 px-3 text-sm text-slate-100 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",Ue="mb-1.5 block text-sm font-medium text-slate-200";function UG({restartRequired:e}){return g.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium ${e?"border-amber-800/70 bg-amber-950/40 text-amber-300":"border-emerald-800/70 bg-emerald-950/40 text-emerald-300"}`,children:e?"Restart required":"Applies now"})}function Fu({id:e,title:t,description:n,icon:a,restartRequired:l,dirty:o,children:c}){return g.jsxs("section",{"aria-labelledby":`${e}-title`,className:"scroll-mt-14 overflow-hidden rounded-xl border border-slate-800 bg-slate-900",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b border-slate-800 px-4 py-4 sm:px-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-3",children:[g.jsx("div",{className:"mt-0.5 rounded-lg bg-slate-800 p-2 text-blue-400",children:a}),g.jsxs("div",{children:[g.jsx("h2",{id:`${e}-title`,className:"font-semibold text-white",children:t}),g.jsx("p",{className:"mt-1 max-w-2xl text-sm leading-5 text-slate-400",children:n})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o&&g.jsx("span",{className:"inline-flex items-center rounded-full border border-blue-800/70 bg-blue-950/40 px-2.5 py-1 text-xs font-medium text-blue-200",children:"Unsaved"}),g.jsx(UG,{restartRequired:l})]})]}),g.jsx("div",{className:"p-4 sm:p-5",children:c})]})}function Zu({state:e,section:t}){return!e||e.key!==t?null:g.jsx("p",{role:e.type==="error"?"alert":"status",className:`rounded-lg border px-3 py-2 text-sm ${e.type==="error"?"border-red-800/70 bg-red-950/30 text-red-300":"border-emerald-800/70 bg-emerald-950/30 text-emerald-300"}`,children:e.message})}function Qu({checked:e,onChange:t,label:n,description:a}){return g.jsxs("label",{className:"flex min-h-11 cursor-pointer items-start justify-between gap-4 rounded-lg border border-slate-700 bg-slate-950/60 px-3 py-2.5",children:[g.jsxs("span",{children:[g.jsx("span",{className:"block text-sm font-medium text-slate-200",children:n}),a&&g.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-slate-400",children:a})]}),g.jsx("input",{type:"checkbox",checked:e,onChange:l=>t(l.target.checked),className:"mt-0.5 h-5 w-5 rounded border-slate-600 bg-slate-900 text-blue-600 focus:ring-2 focus:ring-blue-500"})]})}function Wu({saving:e,label:t="Save settings"}){return g.jsxs("button",{type:"submit",disabled:e,className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition hover:bg-blue-500 disabled:cursor-wait disabled:opacity-60",children:[e?g.jsx(kl,{"aria-hidden":"true",className:"animate-spin",size:16}):g.jsx(MD,{"aria-hidden":"true",size:16}),e?"Saving…":t]})}function $G({authenticated:e,onUnlock:t,onModelsSaved:n,onDirtyChange:a}){const[l,o]=S.useState(null),[c,f]=S.useState(!1),[d,h]=S.useState(""),[v,p]=S.useState(null),[b,x]=S.useState(null),[O,w]=S.useState([]),[_,E]=S.useState(()=>new Set),[N,T]=S.useState(()=>sessionStorage.getItem("computing-provider-restart-pending")==="true"),k=z=>{E(G=>{const ne=new Set(G);return ne.add(z),ne}),x(G=>G?.key===z?null:G)},M=S.useCallback(async()=>{if(e){f(!0),h("");try{const z=await Ze.getSettings();o({...z,models:z.models.map(G=>({...G}))}),w(z.models.map(G=>G.id)),E(new Set)}catch(z){h(z instanceof Error?z.message:"Unable to load settings")}finally{f(!1)}}},[e]);S.useEffect(()=>{e?M():(o(null),E(new Set))},[e,M]),S.useEffect(()=>{const z=_.size>0;a(z);const G=ne=>{z&&(ne.preventDefault(),ne.returnValue="")};return window.addEventListener("beforeunload",G),()=>{window.removeEventListener("beforeunload",G),a(!1)}},[_,a]);const P=async(z,G)=>{p(z),x(null);try{const ne=await G();return x({key:z,type:"success",message:ne.restart_required?"Saved. Restart computing-provider when convenient to apply this section.":"Saved and applied to the running provider."}),E(D=>{const F=new Set(D);return F.delete(z),F}),ne.restart_required&&(sessionStorage.setItem("computing-provider-restart-pending","true"),T(!0)),!0}catch(ne){return x({key:z,type:"error",message:ne instanceof Error?ne.message:"Save failed"}),!1}finally{p(null)}},L=S.useMemo(()=>{if(!l)return 0;const z=new Set(l.models.map(G=>G.id));return O.filter(G=>!z.has(G)).length},[O,l]);if(!e)return g.jsx("div",{className:"mx-auto max-w-2xl py-8 sm:py-16",children:g.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900 p-6 text-center sm:p-10",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-blue-500/10 text-blue-400",children:g.jsx(M0,{"aria-hidden":"true",size:24})}),g.jsx("h2",{className:"text-xl font-semibold text-white",children:"Settings are locked"}),g.jsx("p",{className:"mx-auto mt-2 max-w-lg text-sm leading-6 text-slate-400",children:"Unlock this browser tab with the local control token before reading or changing provider configuration. Monitoring remains available without it."}),g.jsxs("button",{type:"button",onClick:t,className:"mt-5 inline-flex min-h-11 items-center gap-2 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white hover:bg-blue-500",children:[g.jsx(V_,{"aria-hidden":"true",size:17})," Unlock settings"]})]})});if(c&&!l)return g.jsxs("div",{className:"flex min-h-64 items-center justify-center text-slate-400",role:"status",children:[g.jsx(kl,{"aria-hidden":"true",className:"mr-2 animate-spin",size:18})," Loading settings…"]});if(!l)return g.jsxs("div",{className:"rounded-xl border border-red-800/60 bg-red-950/20 p-5",children:[g.jsx("h2",{className:"font-semibold text-red-200",children:"Settings could not be loaded"}),g.jsx("p",{className:"mt-1 text-sm text-red-300",children:d}),g.jsx("button",{type:"button",onClick:M,className:"mt-4 rounded-lg bg-slate-800 px-4 py-2 text-sm text-white",children:"Try again"})]});const W=z=>{k("alerts"),o(G=>G&&{...G,alerts:{...G.alerts,...z}})},re=z=>{k("self-check"),o(G=>G&&{...G,self_check:{...G.self_check,...z}})},H=z=>{k("logging"),o(G=>G&&{...G,log:{...G.log,...z}})},$=z=>{k("limits"),o(G=>G&&{...G,limits:{...G.limits,...z}})},K=z=>W({email:{...l.alerts.email,...z}}),ce=(z,G)=>{k("models"),o(ne=>{if(!ne)return ne;const D=ne.models.map((F,ie)=>ie===z?{...F,...G}:F);return{...ne,models:D}})},ue=async z=>{z.preventDefault();const G=l.alerts.email.to.flatMap(D=>D.split(/[\n,]/)).map(D=>D.trim()).filter(Boolean),ne={...l.alerts,email:{...l.alerts.email,to:G}};await P("alerts",()=>Ze.updateAlerts(ne))&&o(D=>D&&{...D,alerts:{...D.alerts,email:{...D.alerts.email,password:"",clear_password:!1,to:G,password_set:ne.email.clear_password?!1:ne.email.password_set||!!ne.email.password}}})},ve=async z=>{z.preventDefault(),!(L>0&&!window.confirm(`Save and remove ${L} model${L===1?"":"s"} from routing?`))&&await P("models",()=>Ze.updateModels(l.models))&&(n(),await M())},I=()=>{_.size>0&&!window.confirm("Reload settings from disk and discard unsaved changes?")||M()},ee=()=>{sessionStorage.removeItem("computing-provider-restart-pending"),T(!1)};return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Provider settings"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Validated edits to config.toml and models.json. Secrets are write-only."})]}),g.jsxs("button",{type:"button",onClick:I,disabled:c,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 bg-slate-900 px-3 text-sm text-slate-200 hover:bg-slate-800 disabled:opacity-50",children:[g.jsx(C0,{"aria-hidden":"true",className:c?"animate-spin":"",size:16})," Reload from disk"]})]}),g.jsx("nav",{"aria-label":"Settings sections",className:"sticky top-0 z-20 -mx-1 overflow-x-auto rounded-xl border border-slate-800 bg-slate-950/95 p-1 shadow-lg shadow-slate-950/30 backdrop-blur",children:g.jsx("div",{className:"flex min-w-max gap-1",children:LG.map(z=>g.jsxs("button",{type:"button",onClick:()=>document.getElementById(`${z.id}-title`)?.scrollIntoView({behavior:"smooth",block:"start"}),className:"inline-flex min-h-10 items-center rounded-lg px-3 text-sm text-slate-300 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500",children:[z.label,_.has(z.id)&&g.jsx("span",{className:"ml-2 h-2 w-2 rounded-full bg-blue-400","aria-label":"Unsaved changes"})]},z.id))})}),_.size>0&&g.jsxs("p",{role:"status",className:"rounded-lg border border-blue-800/70 bg-blue-950/30 px-4 py-3 text-sm text-blue-100",children:["Unsaved changes in ",_.size," section",_.size===1?"":"s",". Save each marked section before leaving Settings."]}),N&&g.jsxs("div",{role:"status",className:"flex flex-col gap-3 rounded-lg border border-amber-800/70 bg-amber-950/30 px-4 py-3 text-sm text-amber-100 sm:flex-row sm:items-center sm:justify-between",children:[g.jsx("span",{children:"Saved configuration is waiting for a provider-daemon restart before it takes effect."}),g.jsx("button",{type:"button",onClick:ee,className:"min-h-10 self-start rounded-lg border border-amber-700/70 px-3 text-amber-100 hover:bg-amber-900/30 sm:self-auto",children:"Dismiss"})]}),d&&g.jsx("p",{role:"alert",className:"rounded-lg border border-red-800/60 bg-red-950/20 px-4 py-3 text-sm text-red-300",children:d}),g.jsx(Fu,{id:"limits",title:"Request limits",description:"Protect the provider from more work than it can serve. Both values are persisted and applied immediately.",icon:g.jsx(T0,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("limits"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),P("limits",()=>Ze.updateLimits(l.limits))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"requests-per-second",children:"Requests per second"}),g.jsx("input",{id:"requests-per-second",type:"number",min:"0.1",max:"100000",step:"0.1",required:!0,value:l.limits.requests_per_second,onChange:z=>$({requests_per_second:Number(z.target.value)}),className:Le}),g.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Base global rate; GPU-aware adaptation may lower or raise the live rate."})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"max-concurrent",children:"Maximum concurrent requests"}),g.jsx("input",{id:"max-concurrent",type:"number",min:"1",max:"100000",required:!0,value:l.limits.max_concurrent,onChange:z=>$({max_concurrent:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"limits"}),g.jsx(Wu,{saving:v==="limits"})]})]})}),g.jsx(Fu,{id:"models",title:"Model endpoint map",description:"Add, repoint, or remove local inference endpoints. Saving hot-reloads models.json and updates the advertised model list.",icon:g.jsx(DD,{"aria-hidden":"true",size:19}),restartRequired:!1,dirty:_.has("models"),children:g.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[l.models.length===0?g.jsx("div",{className:"rounded-lg border border-dashed border-slate-700 px-4 py-8 text-center text-sm text-slate-400",children:"No models configured. Add one to begin serving inference."}):g.jsx("div",{className:"space-y-3",children:l.models.map((z,G)=>g.jsxs("div",{className:"rounded-xl border border-slate-700 bg-slate-950/50 p-4",children:[g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(180px,0.8fr)_minmax(240px,1.2fr)_auto]",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`model-id-${G}`,children:"Model ID"}),g.jsx("input",{id:`model-id-${G}`,required:!0,readOnly:!z.isNew,value:z.id,onChange:ne=>ce(G,{id:ne.target.value}),className:`${Le} font-mono ${z.isNew?"":"cursor-not-allowed bg-slate-900 text-slate-400"}`})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`model-endpoint-${G}`,children:"Endpoint"}),g.jsx("input",{id:`model-endpoint-${G}`,type:"url",required:!0,value:z.endpoint,onChange:ne=>ce(G,{endpoint:ne.target.value}),placeholder:"http://127.0.0.1:8000",className:`${Le} font-mono`})]}),g.jsxs("button",{type:"button",onClick:()=>{window.confirm(`Remove ${z.id||"this model"} from the configuration? The change takes effect when you save.`)&&(k("models"),o(ne=>ne&&{...ne,models:ne.models.filter((D,F)=>F!==G)}))},className:"mt-auto inline-flex min-h-11 items-center justify-center gap-2 rounded-lg border border-red-900/70 px-3 text-sm text-red-300 hover:bg-red-950/40","aria-label":`Remove ${z.id||"new model"}`,children:[g.jsx(ID,{"aria-hidden":"true",size:16})," ",g.jsx("span",{className:"lg:hidden",children:"Remove"})]})]}),g.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-3",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`model-category-${G}`,children:"Category"}),g.jsx("input",{id:`model-category-${G}`,required:!0,value:z.category,onChange:ne=>ce(G,{category:ne.target.value}),placeholder:"text-generation",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`local-model-${G}`,children:"Local model name"}),g.jsx("input",{id:`local-model-${G}`,value:z.local_model??"",onChange:ne=>ce(G,{local_model:ne.target.value}),placeholder:"Optional Ollama name",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`context-length-${G}`,children:"Context length"}),g.jsx("input",{id:`context-length-${G}`,type:"number",min:"0",value:z.context_length??0,onChange:ne=>ce(G,{context_length:Number(ne.target.value)}),className:Le})]})]}),g.jsxs("details",{className:"mt-4 rounded-lg border border-slate-800 bg-slate-950/60",children:[g.jsx("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium text-slate-300",children:"Advanced endpoint details"}),g.jsxs("div",{className:"grid gap-4 border-t border-slate-800 p-3 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`gpu-memory-${G}`,children:"GPU memory (MB)"}),g.jsx("input",{id:`gpu-memory-${G}`,type:"number",min:"0",value:z.gpu_memory,onChange:ne=>ce(G,{gpu_memory:Number(ne.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`container-${G}`,children:"Container"}),g.jsx("input",{id:`container-${G}`,value:z.container??"",onChange:ne=>ce(G,{container:ne.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`format-${G}`,children:"Format"}),g.jsx("input",{id:`format-${G}`,value:z.format??"",onChange:ne=>ce(G,{format:ne.target.value}),placeholder:"awq, gguf…",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:`quantization-${G}`,children:"Quantization"}),g.jsx("input",{id:`quantization-${G}`,value:z.quantization??"",onChange:ne=>ce(G,{quantization:ne.target.value}),className:Le})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[g.jsx("label",{className:Ue,htmlFor:`endpoint-key-${G}`,children:"Endpoint API key"}),g.jsx("input",{id:`endpoint-key-${G}`,type:"password",autoComplete:"new-password",value:z.api_key??"",onChange:ne=>ce(G,{api_key:ne.target.value,clear_api_key:!1}),placeholder:z.api_key_set?"Configured •••• — leave blank to keep":"Optional write-only replacement",className:Le}),z.api_key_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!z.clear_api_key,onChange:ne=>ce(G,{clear_api_key:ne.target.checked,api_key:""})})," Clear stored endpoint key"]})]})]})]})]},`${z.id}-${G}`))}),g.jsxs("button",{type:"button",onClick:()=>{k("models"),o(z=>z&&{...z,models:[...z.models,{id:"",endpoint:"",gpu_memory:0,category:"text-generation",api_key_set:!1,context_length:0,isNew:!0}]})},className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-dashed border-slate-600 px-3 text-sm text-slate-200 hover:border-blue-500 hover:text-white",children:[g.jsx(wD,{"aria-hidden":"true",size:16})," Add model"]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"models"}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[L>0&&g.jsxs("span",{className:"text-xs text-amber-300",children:[L," removal pending"]}),g.jsx(Wu,{saving:v==="models",label:"Save and hot-reload"})]})]})]})}),g.jsx(Fu,{id:"alerts",title:"Alert delivery",description:"Configure webhook and SMTP delivery. Stored passwords are never returned to the browser.",icon:g.jsx(K4,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("alerts"),children:g.jsxs("form",{onSubmit:ue,className:"space-y-5",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"webhook-url",children:"Webhook URL"}),g.jsx("input",{id:"webhook-url",type:"url",value:l.alerts.webhook_url,onChange:z=>W({webhook_url:z.target.value}),placeholder:"https://alerts.example.com/provider",className:Le})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"cooldown",children:"Repeat cooldown (minutes)"}),g.jsx("input",{id:"cooldown",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.cooldown_minutes,onChange:z=>W({cooldown_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"disconnect-delay",children:"Disconnect alert after (minutes)"}),g.jsx("input",{id:"disconnect-delay",type:"number",min:"1",max:"10080",required:!0,value:l.alerts.disconnect_after_min,onChange:z=>W({disconnect_after_min:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"failure-threshold",children:"Failure threshold (%)"}),g.jsx("input",{id:"failure-threshold",type:"number",min:"1",max:"100",step:"1",required:!0,value:Math.round(l.alerts.error_rate_threshold*100),onChange:z=>W({error_rate_threshold:Number(z.target.value)/100}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"minimum-requests",children:"Minimum requests"}),g.jsx("input",{id:"minimum-requests",type:"number",min:"1",required:!0,value:l.alerts.error_rate_min_requests,onChange:z=>W({error_rate_min_requests:Number(z.target.value)}),className:Le})]})]}),g.jsxs("fieldset",{className:"rounded-xl border border-slate-700 p-4",children:[g.jsx("legend",{className:"px-2 text-sm font-semibold text-slate-200",children:"Email (SMTP)"}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[g.jsxs("div",{className:"sm:col-span-2",children:[g.jsx("label",{className:Ue,htmlFor:"smtp-host",children:"SMTP host"}),g.jsx("input",{id:"smtp-host",value:l.alerts.email.host,onChange:z=>K({host:z.target.value}),placeholder:"smtp.example.com",className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"smtp-port",children:"Port"}),g.jsx("input",{id:"smtp-port",type:"number",min:"1",max:"65535",value:l.alerts.email.port,onChange:z=>K({port:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"smtp-username",children:"Username"}),g.jsx("input",{id:"smtp-username",value:l.alerts.email.username,onChange:z=>K({username:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"smtp-from",children:"From address"}),g.jsx("input",{id:"smtp-from",type:"email",value:l.alerts.email.from,onChange:z=>K({from:z.target.value}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"smtp-recipients",children:"Recipients"}),g.jsx("textarea",{id:"smtp-recipients",rows:2,value:l.alerts.email.to.join(` `),onChange:z=>K({to:z.target.value.split(` -`)}),placeholder:"One address per line",className:`${Le} py-2`})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:Ue,htmlFor:"smtp-password",children:"SMTP password"}),g.jsx("input",{id:"smtp-password",type:"password",autoComplete:"new-password",value:l.alerts.email.password??"",onChange:z=>K({password:z.target.value,clear_password:!1}),placeholder:l.alerts.email.password_set?"Configured •••• — leave blank to keep":"Write-only password",className:Le}),l.alerts.email.password_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!l.alerts.email.clear_password,onChange:z=>K({clear_password:z.target.checked,password:""})})," Clear password stored in config.toml"]})]})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"alerts"}),g.jsx(Wu,{saving:v==="alerts"})]})]})}),g.jsx(Fu,{id:"self-check",title:"Self-check behavior",description:"Control periodic inference audits and automatic routing recovery.",icon:g.jsx(F_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("self-check"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),P("self-check",()=>Ze.updateSelfCheck(l.self_check))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.self_check.enable,onChange:z=>re({enable:z}),label:"Periodic self-check",description:"Audit configured models on a schedule."}),g.jsx(Qu,{checked:l.self_check.auto_disable,onChange:z=>re({auto_disable:z}),label:"Auto-disable failing models",description:"Remove repeatedly failing backends from routing."}),g.jsx(Qu,{checked:l.self_check.auto_recover,onChange:z=>re({auto_recover:z}),label:"Auto-recover healthy models",description:"Return recovered backends to routing."})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"self-check-interval",children:"Interval (minutes)"}),g.jsx("input",{id:"self-check-interval",type:"number",min:"1",max:"10080",required:!0,value:l.self_check.interval_minutes,onChange:z=>re({interval_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"failures-before-disable",children:"Failures before disable"}),g.jsx("input",{id:"failures-before-disable",type:"number",min:"1",max:"100",required:!0,value:l.self_check.failures_before_disable,onChange:z=>re({failures_before_disable:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"self-check"}),g.jsx(Wu,{saving:v==="self-check"})]})]})}),g.jsx(Fu,{id:"logging",title:"Logging and retention",description:"Choose log verbosity, destination, rotation, and retention.",icon:g.jsx(X_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("logging"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),P("logging",()=>Ze.updateLogging(l.log))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:Ue,htmlFor:"log-dir",children:"Log directory"}),g.jsx("input",{id:"log-dir",required:!0,value:l.log.dir,onChange:z=>H({dir:z.target.value}),className:`${Le} font-mono`})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-level",children:"Level"}),g.jsx("select",{id:"log-level",value:l.log.level,onChange:z=>H({level:z.target.value}),className:Le,children:["trace","debug","info","warn","error"].map(z=>g.jsx("option",{value:z,children:z},z))})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-max-size",children:"Rotate at (MB)"}),g.jsx("input",{id:"log-max-size",type:"number",min:"1",max:"102400",required:!0,value:l.log.max_size_mb,onChange:z=>H({max_size_mb:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-backups",children:"Backups to keep"}),g.jsx("input",{id:"log-backups",type:"number",min:"1",max:"1000",required:!0,value:l.log.max_backups,onChange:z=>H({max_backups:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-age",children:"Retention days (-1 = forever)"}),g.jsx("input",{id:"log-age",type:"number",min:"-1",max:"36500",required:!0,value:l.log.max_age_days,onChange:z=>H({max_age_days:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.log.compress,onChange:z=>H({compress:z}),label:"Compress rotated logs"}),g.jsx(Qu,{checked:l.log.stdout,onChange:z=>H({stdout:z}),label:"Also write to stdout"})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"logging"}),g.jsx(Wu,{saving:v==="logging"})]})]})}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-slate-800 bg-slate-900/60 px-4 py-3 text-xs text-slate-400",children:[g.jsx(V4,{"aria-hidden":"true",size:15,className:"text-emerald-400"})," All saves are validated server-side and use atomic file replacement."]})]})}function qG({status:e,metrics:t,models:n,dataIssues:a,loading:l}){if(l&&!e&&!t&&!n)return g.jsxs("div",{role:"status",className:"mb-4 flex items-center gap-3 rounded-xl border border-slate-800 bg-slate-900 px-4 py-3",children:[g.jsx("span",{"aria-hidden":"true",className:"h-5 w-5 animate-pulse rounded-full bg-slate-700"}),g.jsxs("div",{children:[g.jsx("p",{className:"font-medium text-slate-200",children:"Checking operational status…"}),g.jsx("p",{className:"mt-0.5 text-sm text-slate-400",children:"Loading connection, model, and capacity signals."})]})]});const o=[];let c="healthy";const f=a.filter(p=>p.error).map(p=>p.label);f.length>0&&(c="warning",o.push(`Stale or unavailable: ${f.join(", ")}`)),e&&!e.connected&&(c="critical",o.push("Disconnected from Swan Inference")),n?.summary.unhealthy&&(c="critical",o.push(`${n.summary.unhealthy} unhealthy model${n.summary.unhealthy===1?"":"s"}`)),n&&n.summary.total===0&&(c="critical",o.push("No models configured"));const d=t?.gpu_metrics.filter(p=>p.temperature_c>=85).length??0;if(d>0&&(c==="healthy"&&(c="warning"),o.push(`${d} GPU${d===1?"":"s"} at or above 85°C`)),t&&t.total_requests>=10){const p=t.failed_requests/t.total_requests;p>=.05&&(c==="healthy"&&(c="warning"),o.push(`${(p*100).toFixed(1)}% session failure rate`))}const h={healthy:{Icon:rD,title:"All operational signals look healthy",copy:n?`${n.summary.ready} of ${n.summary.total} models ready`:"Waiting for model status",className:"border-emerald-800/70 bg-emerald-950/30",iconClass:"text-emerald-300",titleClass:"text-emerald-100"},warning:{Icon:Ep,title:"Provider status needs a closer look",copy:o.join(" · "),className:"border-amber-800/70 bg-amber-950/30",iconClass:"text-amber-300",titleClass:"text-amber-100"},critical:{Icon:ka,title:"Provider needs attention",copy:o.join(" · "),className:"border-red-800/70 bg-red-950/30",iconClass:"text-red-300",titleClass:"text-red-100"}}[c],v=h.Icon;return g.jsxs("div",{role:c==="critical"?"alert":"status",className:`mb-4 flex flex-col gap-3 rounded-xl border px-4 py-3 sm:flex-row sm:items-center sm:justify-between ${h.className}`,children:[g.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[g.jsx(v,{"aria-hidden":"true",size:20,className:`mt-0.5 shrink-0 ${h.iconClass}`}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("p",{className:`font-medium ${h.titleClass}`,children:h.title}),g.jsx("p",{className:"mt-0.5 text-sm text-slate-300",children:h.copy})]})]}),c!=="healthy"&&g.jsxs("button",{type:"button",onClick:()=>document.getElementById("operations-heading")?.scrollIntoView({behavior:"smooth"}),className:"inline-flex min-h-10 shrink-0 items-center justify-center gap-2 self-start rounded-lg border border-current/30 px-3 text-sm font-medium text-slate-200 hover:bg-white/5 focus:outline-none focus:ring-2 focus:ring-blue-400 sm:self-auto",children:["Review operations ",g.jsx(Dc,{"aria-hidden":"true",size:15})]})]})}const yl=5e3,e3=[{id:"overview",label:"Overview",icon:yD},{id:"transactions",label:"Requests",icon:AD},{id:"settings",label:"Settings",icon:X_}];function H_(){const e=window.location.hash.replace("#","");return e3.some(t=>t.id===e)?e:"overview"}function BG(){const[e,t]=S.useState(null),[n,a]=S.useState(H_),[l,o]=S.useState(!1),[c,f]=S.useState(!1),[d,h]=S.useState(!1),{data:v,error:p,loading:b,refreshing:x,refetch:O}=Da(S.useCallback(()=>Ze.getMetrics(),[]),yl),{data:w,error:_,loading:E,refreshing:N,lastUpdated:T,refetch:k}=Da(S.useCallback(()=>Ze.getStatus(),[]),yl),{data:M,error:P,loading:L,refreshing:W,refetch:re}=Da(S.useCallback(()=>Ze.getEarnings(),[]),yl),{data:H,error:$,loading:K,refreshing:ce,refetch:ue}=Da(S.useCallback(()=>Ze.getModels(),[]),yl),{data:ve,error:I,loading:ee,refreshing:z,refetch:G}=Da(S.useCallback(()=>Ze.getRequestManagement(),[]),yl);S.useEffect(()=>{Ze.hasAccessToken()&&Ze.getSettings().then(()=>o(!0)).catch(()=>{Ze.clearAccessToken(),o(!1)})},[]),S.useEffect(()=>{const he=()=>{a(H_()),window.scrollTo({top:0})};return window.addEventListener("hashchange",he),()=>window.removeEventListener("hashchange",he)},[]);const ne=()=>{O(),k(),ue(),G(),re()},D=()=>{Ze.clearAccessToken(),o(!1)},F=S.useCallback(()=>f(!1),[]),ie=S.useCallback(()=>t(null),[]),le=S.useCallback(()=>{o(!0),f(!1)},[]),ye=he=>{n==="settings"&&he!=="settings"&&d&&!window.confirm("Leave settings and discard unsaved changes?")||(a(he),window.history.replaceState(null,"",`#${he}`),window.scrollTo({top:0}),he==="settings"&&!l&&f(!0))},be=x||N||W||ce||z;return g.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100",children:[g.jsxs("header",{className:"border-b border-slate-800 bg-slate-900/95",children:[g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-stretch gap-3 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(kD,{"aria-hidden":"true",size:24})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-white sm:text-xl",children:"Provider Console"}),g.jsxs("p",{className:"text-xs text-slate-400",children:["Inference operations",w?.version&&g.jsxs(g.Fragment,{children:[" · ",g.jsxs("span",{title:w.build??void 0,className:"font-mono text-slate-400",children:["v",w.version]})]})]})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2 sm:justify-end sm:gap-3",children:[g.jsx(DG,{status:w,loading:E,error:_,lastUpdated:T}),g.jsxs("button",{type:"button",onClick:ne,disabled:be,className:"inline-flex min-h-10 min-w-10 items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-800 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh dashboard data",children:[g.jsx(kl,{"aria-hidden":"true",size:16,className:be?"animate-spin":""}),g.jsx("span",{className:"hidden sm:inline",children:be?"Refreshing…":"Refresh"})]}),l?g.jsxs("button",{type:"button",onClick:D,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 px-3 text-sm text-slate-300 transition hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[g.jsx(xD,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Lock"})]}):g.jsxs("button",{type:"button",onClick:()=>f(!0),className:"inline-flex min-h-10 items-center gap-2 rounded-lg bg-blue-600 px-3 text-sm font-medium text-white transition hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[g.jsx(M0,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Unlock controls"}),g.jsx("span",{className:"sm:hidden",children:"Unlock"})]})]})]}),g.jsx("nav",{"aria-label":"Dashboard sections",className:"mx-auto max-w-7xl px-4 sm:px-6",children:g.jsx("div",{className:"flex gap-1 overflow-hidden",children:e3.map(he=>{const ut=he.icon,Q=n===he.id;return g.jsxs("button",{type:"button",onClick:()=>ye(he.id),"aria-current":Q?"page":void 0,className:`inline-flex min-h-11 min-w-0 flex-1 items-center justify-center gap-1.5 whitespace-nowrap border-b-2 px-2 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:flex-none sm:gap-2 sm:px-5 sm:text-sm ${Q?"border-blue-500 text-white":"border-transparent text-slate-400 hover:border-slate-700 hover:text-slate-200"}`,children:[g.jsx(ut,{"aria-hidden":"true",size:16}),he.label]},he.id)})})})]}),g.jsxs("main",{className:"mx-auto max-w-7xl px-4 py-5 sm:px-6 sm:py-6",children:[n==="overview"&&g.jsxs("div",{className:"space-y-6",children:[g.jsxs("section",{"aria-labelledby":"provider-health-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"provider-health-heading",className:"text-xl font-semibold text-white",children:"Provider overview"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Current service health, traffic, and earnings."})]}),g.jsx(qG,{status:w,metrics:v,models:H,loading:E||b||K,dataIssues:[{label:"connection",error:_},{label:"metrics",error:p},{label:"models",error:$},{label:"request controls",error:I},{label:"earnings",error:P}]}),g.jsx(AG,{metrics:v,loading:b,error:p,earnings:M,earningsError:P,earningsLoading:L})]}),g.jsxs("section",{"aria-labelledby":"operations-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"operations-heading",className:"text-xl font-semibold text-white",children:"Operations"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Model readiness and local resource pressure."})]}),g.jsxs("div",{className:"grid items-start gap-6 lg:grid-cols-2",children:[g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsx(TG,{models:H?.models??[],healthLog:H?.health_log,prices:H?.prices??{},summary:H?.summary,loading:K,error:$,onRefresh:ue,onModelClick:t,authenticated:l,onUnlock:()=>f(!0)}),g.jsx(MG,{data:ve,loading:ee,error:I,onOpenSettings:()=>ye("settings")})]}),g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsx(EG,{gpus:v?.gpu_metrics??[],loading:b,error:p}),g.jsxs("section",{"aria-labelledby":"earnings-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"earnings-heading",className:"text-xl font-semibold text-white",children:"Earnings and traffic mix"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Estimated local history and the models contributing to it."})]}),g.jsxs("div",{className:"min-w-0 space-y-4",children:[g.jsx(WD,{models:M?.models}),g.jsx(jG,{earnings:M,loading:L&&!M,error:P})]})]})]})]})]}),g.jsxs("section",{"aria-labelledby":"performance-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"performance-heading",className:"text-xl font-semibold text-white",children:"Performance"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Persistent trends that remain available after navigation or restart."})]}),g.jsx(kG,{})]})]}),n==="transactions"&&g.jsx(PG,{models:H?.models??[]}),n==="settings"&&g.jsx($G,{authenticated:l,onUnlock:()=>f(!0),onModelsSaved:ue,onDirtyChange:h})]}),g.jsx("footer",{className:"mt-8 border-t border-slate-800 bg-slate-900 px-4 py-4 sm:px-6",children:g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-2 text-xs text-slate-400",children:[g.jsx("span",{children:"Swan Chain Computing Provider"}),g.jsxs("span",{children:["Core monitoring refreshes every ",yl/1e3,"s"]})]})}),e&&g.jsx(zG,{modelId:e,onClose:ie}),g.jsx(RG,{open:c,onClose:F,onAuthenticated:le})]})}k4.createRoot(document.getElementById("root")).render(g.jsx(S.StrictMode,{children:g.jsx(BG,{})})); +`)}),placeholder:"One address per line",className:`${Le} py-2`})]}),g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:Ue,htmlFor:"smtp-password",children:"SMTP password"}),g.jsx("input",{id:"smtp-password",type:"password",autoComplete:"new-password",value:l.alerts.email.password??"",onChange:z=>K({password:z.target.value,clear_password:!1}),placeholder:l.alerts.email.password_set?"Configured •••• — leave blank to keep":"Write-only password",className:Le}),l.alerts.email.password_set&&g.jsxs("label",{className:"mt-2 inline-flex items-center gap-2 text-xs text-slate-400",children:[g.jsx("input",{type:"checkbox",checked:!!l.alerts.email.clear_password,onChange:z=>K({clear_password:z.target.checked,password:""})})," Clear password stored in config.toml"]})]})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"alerts"}),g.jsx(Wu,{saving:v==="alerts"})]})]})}),g.jsx(Fu,{id:"self-check",title:"Self-check behavior",description:"Control periodic inference audits and automatic routing recovery.",icon:g.jsx(F_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("self-check"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),P("self-check",()=>Ze.updateSelfCheck(l.self_check))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.self_check.enable,onChange:z=>re({enable:z}),label:"Periodic self-check",description:"Audit configured models on a schedule."}),g.jsx(Qu,{checked:l.self_check.auto_disable,onChange:z=>re({auto_disable:z}),label:"Auto-disable failing models",description:"Remove repeatedly failing backends from routing."}),g.jsx(Qu,{checked:l.self_check.auto_recover,onChange:z=>re({auto_recover:z}),label:"Auto-recover healthy models",description:"Return recovered backends to routing."})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"self-check-interval",children:"Interval (minutes)"}),g.jsx("input",{id:"self-check-interval",type:"number",min:"1",max:"10080",required:!0,value:l.self_check.interval_minutes,onChange:z=>re({interval_minutes:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"failures-before-disable",children:"Failures before disable"}),g.jsx("input",{id:"failures-before-disable",type:"number",min:"1",max:"100",required:!0,value:l.self_check.failures_before_disable,onChange:z=>re({failures_before_disable:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"self-check"}),g.jsx(Wu,{saving:v==="self-check"})]})]})}),g.jsx(Fu,{id:"logging",title:"Logging and retention",description:"Choose log verbosity, destination, rotation, and retention.",icon:g.jsx(X_,{"aria-hidden":"true",size:19}),restartRequired:!0,dirty:_.has("logging"),children:g.jsxs("form",{onSubmit:z=>{z.preventDefault(),P("logging",()=>Ze.updateLogging(l.log))},className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[g.jsxs("div",{className:"sm:col-span-2 lg:col-span-3",children:[g.jsx("label",{className:Ue,htmlFor:"log-dir",children:"Log directory"}),g.jsx("input",{id:"log-dir",required:!0,value:l.log.dir,onChange:z=>H({dir:z.target.value}),className:`${Le} font-mono`})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-level",children:"Level"}),g.jsx("select",{id:"log-level",value:l.log.level,onChange:z=>H({level:z.target.value}),className:Le,children:["trace","debug","info","warn","error"].map(z=>g.jsx("option",{value:z,children:z},z))})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-max-size",children:"Rotate at (MB)"}),g.jsx("input",{id:"log-max-size",type:"number",min:"1",max:"102400",required:!0,value:l.log.max_size_mb,onChange:z=>H({max_size_mb:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-backups",children:"Backups to keep"}),g.jsx("input",{id:"log-backups",type:"number",min:"1",max:"1000",required:!0,value:l.log.max_backups,onChange:z=>H({max_backups:Number(z.target.value)}),className:Le})]}),g.jsxs("div",{children:[g.jsx("label",{className:Ue,htmlFor:"log-age",children:"Retention days (-1 = forever)"}),g.jsx("input",{id:"log-age",type:"number",min:"-1",max:"36500",required:!0,value:l.log.max_age_days,onChange:z=>H({max_age_days:Number(z.target.value)}),className:Le})]})]}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsx(Qu,{checked:l.log.compress,onChange:z=>H({compress:z}),label:"Compress rotated logs"}),g.jsx(Qu,{checked:l.log.stdout,onChange:z=>H({stdout:z}),label:"Also write to stdout"})]}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsx(Zu,{state:b,section:"logging"}),g.jsx(Wu,{saving:v==="logging"})]})]})}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-slate-800 bg-slate-900/60 px-4 py-3 text-xs text-slate-400",children:[g.jsx(V4,{"aria-hidden":"true",size:15,className:"text-emerald-400"})," All saves are validated server-side and use atomic file replacement."]})]})}function qG({status:e,metrics:t,models:n,dataIssues:a,loading:l}){if(l&&!e&&!t&&!n)return g.jsxs("div",{role:"status",className:"mb-4 flex items-center gap-3 rounded-xl border border-slate-800 bg-slate-900 px-4 py-3",children:[g.jsx("span",{"aria-hidden":"true",className:"h-5 w-5 animate-pulse rounded-full bg-slate-700"}),g.jsxs("div",{children:[g.jsx("p",{className:"font-medium text-slate-200",children:"Checking operational status…"}),g.jsx("p",{className:"mt-0.5 text-sm text-slate-400",children:"Loading connection, model, and capacity signals."})]})]});const o=[];let c="healthy";const f=a.filter(b=>b.error).map(b=>b.label);f.length>0&&(c="warning",o.push(`Stale or unavailable: ${f.join(", ")}`)),e&&!e.connected&&(c="critical",o.push("Disconnected from Swan Inference")),n?.summary.unhealthy&&(c="critical",o.push(`${n.summary.unhealthy} unhealthy model${n.summary.unhealthy===1?"":"s"}`)),n&&n.summary.total===0&&(c="critical",o.push("No models configured"));const d=t?.gpu_metrics.filter(b=>b.temperature_c>=85).length??0;if(d>0&&(c==="healthy"&&(c="warning"),o.push(`${d} GPU${d===1?"":"s"} at or above 85°C`)),t&&t.total_requests>=10){const b=t.failed_requests/t.total_requests;b>=.05&&(c==="healthy"&&(c="warning"),o.push(`${(b*100).toFixed(1)}% session failure rate`))}const h={healthy:{Icon:rD,title:"All operational signals look healthy",copy:n?`${n.summary.ready} of ${n.summary.total} models ready`:"Waiting for model status",className:"border-emerald-800/70 bg-emerald-950/30",iconClass:"text-emerald-300",titleClass:"text-emerald-100"},warning:{Icon:Ep,title:"Provider status needs a closer look",copy:o.join(" · "),className:"border-amber-800/70 bg-amber-950/30",iconClass:"text-amber-300",titleClass:"text-amber-100"},critical:{Icon:ka,title:"Provider needs attention",copy:o.join(" · "),className:"border-red-800/70 bg-red-950/30",iconClass:"text-red-300",titleClass:"text-red-100"}}[c],v=h.Icon,p=`${h.title}. ${h.copy}`;return g.jsxs("div",{role:c==="critical"?"alert":"status",title:p,className:`flex min-w-0 max-w-full items-center gap-2 rounded-lg border px-3 py-1.5 ${h.className}`,children:[g.jsx(v,{"aria-hidden":"true",size:16,className:`shrink-0 ${h.iconClass}`}),g.jsxs("p",{className:`min-w-0 truncate text-sm font-medium ${h.titleClass}`,children:[h.title,h.copy&&g.jsx("span",{className:"ml-2 font-normal text-slate-300",children:h.copy})]}),c!=="healthy"&&g.jsxs("button",{type:"button",onClick:()=>document.getElementById("operations-heading")?.scrollIntoView({behavior:"smooth"}),className:"ml-1 inline-flex shrink-0 items-center gap-1 rounded-md border border-current/30 px-2 py-1 text-xs font-medium text-slate-200 hover:bg-white/5 focus:outline-none focus:ring-2 focus:ring-blue-400",children:["Review ",g.jsx(Dc,{"aria-hidden":"true",size:13})]})]})}const yl=5e3,e3=[{id:"overview",label:"Overview",icon:yD},{id:"transactions",label:"Requests",icon:AD},{id:"settings",label:"Settings",icon:X_}];function H_(){const e=window.location.hash.replace("#","");return e3.some(t=>t.id===e)?e:"overview"}function BG(){const[e,t]=S.useState(null),[n,a]=S.useState(H_),[l,o]=S.useState(!1),[c,f]=S.useState(!1),[d,h]=S.useState(!1),{data:v,error:p,loading:b,refreshing:x,refetch:O}=Da(S.useCallback(()=>Ze.getMetrics(),[]),yl),{data:w,error:_,loading:E,refreshing:N,lastUpdated:T,refetch:k}=Da(S.useCallback(()=>Ze.getStatus(),[]),yl),{data:M,error:P,loading:L,refreshing:W,refetch:re}=Da(S.useCallback(()=>Ze.getEarnings(),[]),yl),{data:H,error:$,loading:K,refreshing:ce,refetch:ue}=Da(S.useCallback(()=>Ze.getModels(),[]),yl),{data:ve,error:I,loading:ee,refreshing:z,refetch:G}=Da(S.useCallback(()=>Ze.getRequestManagement(),[]),yl);S.useEffect(()=>{Ze.hasAccessToken()&&Ze.getSettings().then(()=>o(!0)).catch(()=>{Ze.clearAccessToken(),o(!1)})},[]),S.useEffect(()=>{const he=()=>{a(H_()),window.scrollTo({top:0})};return window.addEventListener("hashchange",he),()=>window.removeEventListener("hashchange",he)},[]);const ne=()=>{O(),k(),ue(),G(),re()},D=()=>{Ze.clearAccessToken(),o(!1)},F=S.useCallback(()=>f(!1),[]),ie=S.useCallback(()=>t(null),[]),le=S.useCallback(()=>{o(!0),f(!1)},[]),ye=he=>{n==="settings"&&he!=="settings"&&d&&!window.confirm("Leave settings and discard unsaved changes?")||(a(he),window.history.replaceState(null,"",`#${he}`),window.scrollTo({top:0}),he==="settings"&&!l&&f(!0))},be=x||N||W||ce||z;return g.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100",children:[g.jsxs("header",{className:"border-b border-slate-800 bg-slate-900/95",children:[g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-stretch gap-3 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[g.jsx("div",{className:"rounded-xl bg-blue-500/10 p-2 text-blue-400",children:g.jsx(kD,{"aria-hidden":"true",size:24})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-white sm:text-xl",children:"Provider Console"}),g.jsxs("p",{className:"text-xs text-slate-400",children:["Inference operations",w?.version&&g.jsxs(g.Fragment,{children:[" · ",g.jsxs("span",{title:w.build??void 0,className:"font-mono text-slate-400",children:["v",w.version]})]})]})]})]}),g.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2 sm:justify-end sm:gap-3",children:[g.jsx(DG,{status:w,loading:E,error:_,lastUpdated:T}),g.jsxs("button",{type:"button",onClick:ne,disabled:be,className:"inline-flex min-h-10 min-w-10 items-center justify-center gap-2 rounded-lg border border-slate-700 bg-slate-800 px-3 text-sm text-slate-200 transition hover:border-slate-600 hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-500","aria-label":"Refresh dashboard data",children:[g.jsx(kl,{"aria-hidden":"true",size:16,className:be?"animate-spin":""}),g.jsx("span",{className:"hidden sm:inline",children:be?"Refreshing…":"Refresh"})]}),l?g.jsxs("button",{type:"button",onClick:D,className:"inline-flex min-h-10 items-center gap-2 rounded-lg border border-slate-700 px-3 text-sm text-slate-300 transition hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[g.jsx(xD,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Lock"})]}):g.jsxs("button",{type:"button",onClick:()=>f(!0),className:"inline-flex min-h-10 items-center gap-2 rounded-lg bg-blue-600 px-3 text-sm font-medium text-white transition hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[g.jsx(M0,{"aria-hidden":"true",size:16}),g.jsx("span",{className:"hidden sm:inline",children:"Unlock controls"}),g.jsx("span",{className:"sm:hidden",children:"Unlock"})]})]})]}),g.jsx("nav",{"aria-label":"Dashboard sections",className:"mx-auto max-w-7xl px-4 sm:px-6",children:g.jsx("div",{className:"flex gap-1 overflow-hidden",children:e3.map(he=>{const ut=he.icon,Q=n===he.id;return g.jsxs("button",{type:"button",onClick:()=>ye(he.id),"aria-current":Q?"page":void 0,className:`inline-flex min-h-11 min-w-0 flex-1 items-center justify-center gap-1.5 whitespace-nowrap border-b-2 px-2 text-xs font-medium transition focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:flex-none sm:gap-2 sm:px-5 sm:text-sm ${Q?"border-blue-500 text-white":"border-transparent text-slate-400 hover:border-slate-700 hover:text-slate-200"}`,children:[g.jsx(ut,{"aria-hidden":"true",size:16}),he.label]},he.id)})})})]}),g.jsxs("main",{className:"mx-auto max-w-7xl px-4 py-5 sm:px-6 sm:py-6",children:[n==="overview"&&g.jsxs("div",{className:"space-y-6",children:[g.jsxs("section",{"aria-labelledby":"provider-health-heading",children:[g.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("h2",{id:"provider-health-heading",className:"text-xl font-semibold text-white",children:"Provider overview"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Current service health, traffic, and earnings."})]}),g.jsx(qG,{status:w,metrics:v,models:H,loading:E||b||K,dataIssues:[{label:"connection",error:_},{label:"metrics",error:p},{label:"models",error:$},{label:"request controls",error:I},{label:"earnings",error:P}]})]}),g.jsx(AG,{metrics:v,loading:b,error:p,earnings:M,earningsError:P,earningsLoading:L})]}),g.jsxs("section",{"aria-labelledby":"operations-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"operations-heading",className:"text-xl font-semibold text-white",children:"Operations"}),g.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Model readiness and local resource pressure."})]}),g.jsxs("div",{className:"grid items-start gap-6 lg:grid-cols-2",children:[g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsx(TG,{models:H?.models??[],healthLog:H?.health_log,prices:H?.prices??{},summary:H?.summary,loading:K,error:$,onRefresh:ue,onModelClick:t,authenticated:l,onUnlock:()=>f(!0)}),g.jsx(MG,{data:ve,loading:ee,error:I,onOpenSettings:()=>ye("settings")})]}),g.jsxs("div",{className:"min-w-0 space-y-6",children:[g.jsxs("section",{"aria-labelledby":"earnings-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"earnings-heading",className:"text-xl font-semibold text-white",children:"Earnings and traffic mix"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Estimated local history and the models contributing to it."})]}),g.jsxs("div",{className:"min-w-0 space-y-4",children:[g.jsx(WD,{models:M?.models}),g.jsx(jG,{earnings:M,loading:L&&!M,error:P})]})]}),g.jsx(EG,{gpus:v?.gpu_metrics??[],loading:b,error:p})]})]})]}),g.jsxs("section",{"aria-labelledby":"performance-heading",children:[g.jsxs("div",{className:"mb-3",children:[g.jsx("h2",{id:"performance-heading",className:"text-xl font-semibold text-white",children:"Performance"}),g.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Persistent trends that remain available after navigation or restart."})]}),g.jsx(kG,{})]})]}),n==="transactions"&&g.jsx(PG,{models:H?.models??[]}),n==="settings"&&g.jsx($G,{authenticated:l,onUnlock:()=>f(!0),onModelsSaved:ue,onDirtyChange:h})]}),g.jsx("footer",{className:"mt-8 border-t border-slate-800 bg-slate-900 px-4 py-4 sm:px-6",children:g.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-2 text-xs text-slate-400",children:[g.jsx("span",{children:"Swan Chain Computing Provider"}),g.jsxs("span",{children:["Core monitoring refreshes every ",yl/1e3,"s"]})]})}),e&&g.jsx(zG,{modelId:e,onClose:ie}),g.jsx(RG,{open:c,onClose:F,onAuthenticated:le})]})}k4.createRoot(document.getElementById("root")).render(g.jsx(S.StrictMode,{children:g.jsx(BG,{})})); diff --git a/internal/dashboard/ui/dist/assets/index-Ci1VGgVu.css b/internal/dashboard/ui/dist/assets/index-Ci1VGgVu.css deleted file mode 100644 index fdc0a84e..00000000 --- a/internal/dashboard/ui/dist/assets/index-Ci1VGgVu.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.visible{visibility:visible}.fixed{position:fixed}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.float-right{float:right}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-64{height:16rem}.h-8{height:2rem}.h-full{height:100%}.max-h-\[94vh\]{max-height:94vh}.min-h-10{min-height:2.5rem}.min-h-11{min-height:2.75rem}.min-h-64{min-height:16rem}.min-h-9{min-height:2.25rem}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-28{width:7rem}.w-3{width:.75rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-10{min-width:2.5rem}.min-w-9{min-width:2.25rem}.min-w-\[840px\]{min-width:840px}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-2xl{max-width:42rem}.max-w-36{max-width:9rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.scroll-mt-14{scroll-margin-top:3.5rem}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-px{gap:1px}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-slate-800>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(30 41 59 / var(--tw-divide-opacity, 1))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-700\/70{border-color:#b45309b3}.border-amber-800{--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.border-amber-800\/70{border-color:#92400eb3}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-800\/70{border-color:#1e40afb3}.border-blue-900\/70{border-color:#1e3a8ab3}.border-emerald-800\/50{border-color:#065f4680}.border-emerald-800\/70{border-color:#065f46b3}.border-emerald-900\/60{border-color:#064e3b99}.border-green-800{--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.border-red-800{--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.border-red-800\/50{border-color:#991b1b80}.border-red-800\/60{border-color:#991b1b99}.border-red-800\/70{border-color:#991b1bb3}.border-red-900\/70{border-color:#7f1d1db3}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-600\/50{border-color:#47556980}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-800{--tw-border-opacity: 1;border-color:rgb(30 41 59 / var(--tw-border-opacity, 1))}.border-slate-800\/80{border-color:#1e293bcc}.border-transparent{border-color:transparent}.border-violet-900\/70{border-color:#4c1d95b3}.border-t-transparent{border-top-color:transparent}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-900\/20{background-color:#78350f33}.bg-amber-950\/30{background-color:#451a034d}.bg-amber-950\/40{background-color:#451a0366}.bg-black\/60{background-color:#0009}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-950\/20{background-color:#17255433}.bg-blue-950\/30{background-color:#1725544d}.bg-blue-950\/40{background-color:#17255466}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-950\/20{background-color:#022c2233}.bg-emerald-950\/30{background-color:#022c224d}.bg-emerald-950\/40{background-color:#022c2266}.bg-green-900\/20{background-color:#14532d33}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-950\/10{background-color:#450a0a1a}.bg-red-950\/20{background-color:#450a0a33}.bg-red-950\/30{background-color:#450a0a4d}.bg-red-950\/40{background-color:#450a0a66}.bg-slate-500\/10{background-color:#64748b1a}.bg-slate-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-700\/50{background-color:#33415580}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/60{background-color:#0f172a99}.bg-slate-900\/95{background-color:#0f172af2}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-slate-950\/40{background-color:#02061766}.bg-slate-950\/50{background-color:#02061780}.bg-slate-950\/60{background-color:#02061799}.bg-slate-950\/80{background-color:#020617cc}.bg-slate-950\/95{background-color:#020617f2}.bg-violet-950\/20{background-color:#2e106533}.bg-violet-950\/30{background-color:#2e10654d}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-blue-100{--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.text-blue-200{--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-emerald-100{--tw-text-opacity: 1;color:rgb(209 250 229 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-100{--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-violet-100{--tw-text-opacity: 1;color:rgb(237 233 254 / var(--tw-text-opacity, 1))}.text-violet-200{--tw-text-opacity: 1;color:rgb(221 214 254 / var(--tw-text-opacity, 1))}.text-violet-300{--tw-text-opacity: 1;color:rgb(196 181 253 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-black\/40{--tw-shadow-color: rgb(0 0 0 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-slate-950\/30{--tw-shadow-color: rgb(2 6 23 / .3);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/30{--tw-ring-color: rgb(59 130 246 / .3)}.ring-slate-500\/30{--tw-ring-color: rgb(100 116 139 / .3)}.ring-white\/40{--tw-ring-color: rgb(255 255 255 / .4)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}body{margin:0;min-height:100vh;background-color:#0f172a}.placeholder\:text-slate-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-400::placeholder{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:border-slate-500:hover{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.hover\:border-slate-600:hover{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.hover\:border-slate-700:hover{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.hover\:bg-amber-900\/30:hover{background-color:#78350f4d}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-900\/30:hover{background-color:#14532d4d}.hover\:bg-red-950\/20:hover{background-color:#450a0a33}.hover\:bg-red-950\/40:hover{background-color:#450a0a66}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-800\/35:hover{background-color:#1e293b59}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-green-300:hover{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-inset:focus{--tw-ring-inset: inset}.focus\:ring-blue-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(96 165 250 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500\/20:focus{--tw-ring-color: rgb(59 130 246 / .2)}.focus\:ring-blue-500\/30:focus{--tw-ring-color: rgb(59 130 246 / .3)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@media(min-width:640px){.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:hidden{display:none}.sm\:w-auto{width:auto}.sm\:min-w-56{min-width:14rem}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:self-auto{align-self:auto}.sm\:p-10{padding:2.5rem}.sm\:p-4{padding:1rem}.sm\:p-5{padding:1.25rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:block{display:block}.md\:hidden{display:none}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:gap-4{gap:1rem}}@media(min-width:1024px){.lg\:col-span-3{grid-column:span 3 / span 3}.lg\:col-span-4{grid-column:span 4 / span 4}.lg\:hidden{display:none}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(180px\,0\.8fr\)_minmax\(240px\,1\.2fr\)_auto\]{grid-template-columns:minmax(180px,.8fr) minmax(240px,1.2fr) auto}}@media(min-width:1280px){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}} diff --git a/internal/dashboard/ui/dist/assets/index-MZFUSUjx.css b/internal/dashboard/ui/dist/assets/index-MZFUSUjx.css new file mode 100644 index 00000000..2c8c650b --- /dev/null +++ b/internal/dashboard/ui/dist/assets/index-MZFUSUjx.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.visible{visibility:visible}.fixed{position:fixed}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.float-right{float:right}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-64{height:16rem}.h-8{height:2rem}.h-full{height:100%}.max-h-\[94vh\]{max-height:94vh}.min-h-10{min-height:2.5rem}.min-h-11{min-height:2.75rem}.min-h-64{min-height:16rem}.min-h-9{min-height:2.25rem}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-28{width:7rem}.w-3{width:.75rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-10{min-width:2.5rem}.min-w-9{min-width:2.25rem}.min-w-\[840px\]{min-width:840px}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-2xl{max-width:42rem}.max-w-36{max-width:9rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.scroll-mt-14{scroll-margin-top:3.5rem}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-px{gap:1px}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-slate-800>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(30 41 59 / var(--tw-divide-opacity, 1))}.self-start{align-self:flex-start}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-700\/70{border-color:#b45309b3}.border-amber-800{--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.border-amber-800\/70{border-color:#92400eb3}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-800\/70{border-color:#1e40afb3}.border-blue-900\/70{border-color:#1e3a8ab3}.border-emerald-800\/50{border-color:#065f4680}.border-emerald-800\/70{border-color:#065f46b3}.border-emerald-900\/60{border-color:#064e3b99}.border-green-800{--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.border-red-800{--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.border-red-800\/50{border-color:#991b1b80}.border-red-800\/60{border-color:#991b1b99}.border-red-800\/70{border-color:#991b1bb3}.border-red-900\/70{border-color:#7f1d1db3}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-600\/50{border-color:#47556980}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-slate-800{--tw-border-opacity: 1;border-color:rgb(30 41 59 / var(--tw-border-opacity, 1))}.border-slate-800\/80{border-color:#1e293bcc}.border-transparent{border-color:transparent}.border-violet-900\/70{border-color:#4c1d95b3}.border-t-transparent{border-top-color:transparent}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-900\/20{background-color:#78350f33}.bg-amber-950\/30{background-color:#451a034d}.bg-amber-950\/40{background-color:#451a0366}.bg-black\/60{background-color:#0009}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-950\/20{background-color:#17255433}.bg-blue-950\/30{background-color:#1725544d}.bg-blue-950\/40{background-color:#17255466}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-950\/20{background-color:#022c2233}.bg-emerald-950\/30{background-color:#022c224d}.bg-emerald-950\/40{background-color:#022c2266}.bg-green-900\/20{background-color:#14532d33}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-950\/10{background-color:#450a0a1a}.bg-red-950\/20{background-color:#450a0a33}.bg-red-950\/30{background-color:#450a0a4d}.bg-red-950\/40{background-color:#450a0a66}.bg-slate-500\/10{background-color:#64748b1a}.bg-slate-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-700\/50{background-color:#33415580}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/60{background-color:#0f172a99}.bg-slate-900\/95{background-color:#0f172af2}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.bg-slate-950\/40{background-color:#02061766}.bg-slate-950\/50{background-color:#02061780}.bg-slate-950\/60{background-color:#02061799}.bg-slate-950\/80{background-color:#020617cc}.bg-slate-950\/95{background-color:#020617f2}.bg-violet-950\/20{background-color:#2e106533}.bg-violet-950\/30{background-color:#2e10654d}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-blue-100{--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.text-blue-200{--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-emerald-100{--tw-text-opacity: 1;color:rgb(209 250 229 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-100{--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-violet-100{--tw-text-opacity: 1;color:rgb(237 233 254 / var(--tw-text-opacity, 1))}.text-violet-200{--tw-text-opacity: 1;color:rgb(221 214 254 / var(--tw-text-opacity, 1))}.text-violet-300{--tw-text-opacity: 1;color:rgb(196 181 253 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-black\/40{--tw-shadow-color: rgb(0 0 0 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-slate-950\/30{--tw-shadow-color: rgb(2 6 23 / .3);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-blue-500\/30{--tw-ring-color: rgb(59 130 246 / .3)}.ring-slate-500\/30{--tw-ring-color: rgb(100 116 139 / .3)}.ring-white\/40{--tw-ring-color: rgb(255 255 255 / .4)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}body{margin:0;min-height:100vh;background-color:#0f172a}.placeholder\:text-slate-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-400::placeholder{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:border-slate-500:hover{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.hover\:border-slate-600:hover{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.hover\:border-slate-700:hover{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.hover\:bg-amber-900\/30:hover{background-color:#78350f4d}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-900\/30:hover{background-color:#14532d4d}.hover\:bg-red-950\/20:hover{background-color:#450a0a33}.hover\:bg-red-950\/40:hover{background-color:#450a0a66}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-800\/35:hover{background-color:#1e293b59}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:text-green-300:hover{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.hover\:text-slate-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-inset:focus{--tw-ring-inset: inset}.focus\:ring-blue-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(96 165 250 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500\/20:focus{--tw-ring-color: rgb(59 130 246 / .2)}.focus\:ring-blue-500\/30:focus{--tw-ring-color: rgb(59 130 246 / .3)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@media(min-width:640px){.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:hidden{display:none}.sm\:w-auto{width:auto}.sm\:min-w-56{min-width:14rem}.sm\:flex-none{flex:none}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:self-auto{align-self:auto}.sm\:p-10{padding:2.5rem}.sm\:p-4{padding:1rem}.sm\:p-5{padding:1.25rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media(min-width:768px){.md\:block{display:block}.md\:hidden{display:none}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:gap-4{gap:1rem}}@media(min-width:1024px){.lg\:col-span-3{grid-column:span 3 / span 3}.lg\:col-span-4{grid-column:span 4 / span 4}.lg\:hidden{display:none}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(180px\,0\.8fr\)_minmax\(240px\,1\.2fr\)_auto\]{grid-template-columns:minmax(180px,.8fr) minmax(240px,1.2fr) auto}}@media(min-width:1280px){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}} diff --git a/internal/dashboard/ui/dist/index.html b/internal/dashboard/ui/dist/index.html index 16cc4517..fc342b79 100644 --- a/internal/dashboard/ui/dist/index.html +++ b/internal/dashboard/ui/dist/index.html @@ -6,8 +6,8 @@ Swan Provider Console - - + +
diff --git a/internal/dashboard/ui/src/App.tsx b/internal/dashboard/ui/src/App.tsx index 00761809..9c151e18 100644 --- a/internal/dashboard/ui/src/App.tsx +++ b/internal/dashboard/ui/src/App.tsx @@ -229,23 +229,25 @@ function App() { {activeView === 'overview' && (
-
-

Provider overview

-

Current service health, traffic, and earnings.

+
+
+

Provider overview

+

Current service health, traffic, and earnings.

+
+
-
-

Earnings and traffic mix

@@ -294,6 +295,7 @@ function App() {
+
diff --git a/internal/dashboard/ui/src/components/OperationalSummary.tsx b/internal/dashboard/ui/src/components/OperationalSummary.tsx index 7e4f45f1..cfeb3a38 100644 --- a/internal/dashboard/ui/src/components/OperationalSummary.tsx +++ b/internal/dashboard/ui/src/components/OperationalSummary.tsx @@ -92,25 +92,31 @@ export function OperationalSummary({ status, metrics, models, dataIssues, loadin }[severity]; const Icon = visual.Icon; + // A single row beside the page title rather than a full-width card below it. + // The banner earns its space when something is wrong; when every signal is + // healthy it was a paragraph saying so, pushing the actual figures down the + // page. Severity still carries its own colour and icon, the detail is kept in + // the title attribute rather than dropped, and anything non-healthy keeps the + // jump-to-operations action. + const detail = `${visual.title}. ${visual.copy}`; return (
-
-
+