From 8e24b36b0ac3f8b90e637ed913fa2a1d90af4679 Mon Sep 17 00:00:00 2001 From: Xiaodong Date: Sat, 6 Dec 2025 05:07:18 +0800 Subject: [PATCH] fix(frontend): unexpected model switching when open new tab --- .../{App-BlsOxMPe.js => App-CJQOseEJ.js} | 66 +++++++++---------- .../{chat-OiBmCmmc.js => chat-C6vxWDd9.js} | 2 +- src/frontend/dist/assets/chat-CLr2c_Zd.js | 1 - src/frontend/dist/assets/chat-CvDniff9.js | 1 + .../{join-DcQSNXBs.js => join-CSfaJ46_.js} | 2 +- src/frontend/dist/assets/main-C3viVoAI.js | 1 - src/frontend/dist/assets/main-GbPZunE4.js | 1 + ...ut-BciTM2Vs.js => main-layout---1BZV4A.js} | 6 +- .../{setup-CfR0Ohts.js => setup-D9T6Fak2.js} | 2 +- src/frontend/dist/chat.html | 4 +- src/frontend/dist/index.html | 4 +- .../src/components/common/drawer-layout.tsx | 2 +- .../src/components/inputs/model-select.tsx | 9 ++- .../src/components/inputs/node-list.tsx | 1 + src/frontend/src/services/cluster.tsx | 65 +++++++++++------- 15 files changed, 91 insertions(+), 76 deletions(-) rename src/frontend/dist/assets/{App-BlsOxMPe.js => App-CJQOseEJ.js} (81%) rename src/frontend/dist/assets/{chat-OiBmCmmc.js => chat-C6vxWDd9.js} (99%) delete mode 100644 src/frontend/dist/assets/chat-CLr2c_Zd.js create mode 100644 src/frontend/dist/assets/chat-CvDniff9.js rename src/frontend/dist/assets/{join-DcQSNXBs.js => join-CSfaJ46_.js} (95%) delete mode 100644 src/frontend/dist/assets/main-C3viVoAI.js create mode 100644 src/frontend/dist/assets/main-GbPZunE4.js rename src/frontend/dist/assets/{main-layout-BciTM2Vs.js => main-layout---1BZV4A.js} (96%) rename src/frontend/dist/assets/{setup-CfR0Ohts.js => setup-D9T6Fak2.js} (98%) diff --git a/src/frontend/dist/assets/App-BlsOxMPe.js b/src/frontend/dist/assets/App-CJQOseEJ.js similarity index 81% rename from src/frontend/dist/assets/App-BlsOxMPe.js rename to src/frontend/dist/assets/App-CJQOseEJ.js index 333a7e03..a7d0b016 100644 --- a/src/frontend/dist/assets/App-BlsOxMPe.js +++ b/src/frontend/dist/assets/App-CJQOseEJ.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/setup-CfR0Ohts.js","assets/main-layout-BciTM2Vs.js","assets/main-layout-DVneG3Rq.css","assets/join-DcQSNXBs.js","assets/chat-OiBmCmmc.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/setup-D9T6Fak2.js","assets/main-layout---1BZV4A.js","assets/main-layout-DVneG3Rq.css","assets/join-CSfaJ46_.js","assets/chat-C6vxWDd9.js"])))=>i.map(i=>d[i]); function N2(n,r){for(var l=0;lo[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function l(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(u){if(u.ep)return;u.ep=!0;const c=l(u);fetch(u.href,c)}})();function Ba(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Of={exports:{}},vl={};/** * @license React * react-jsx-runtime.production.js @@ -7,7 +7,7 @@ function N2(n,r){for(var l=0;l>>1,w=O[le];if(0>>1;leu(ie,V))oeu(fe,ie)?(O[le]=fe,O[oe]=V,le=oe):(O[le]=ie,O[re]=V,le=re);else if(oeu(fe,V))O[le]=fe,O[oe]=V,le=oe;else break e}}return U}function u(O,U){var V=O.sortIndex-U.sortIndex;return V!==0?V:O.id-U.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var m=[],p=[],y=1,b=null,E=3,A=!1,C=!1,T=!1,M=!1,D=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function B(O){for(var U=l(p);U!==null;){if(U.callback===null)o(p);else if(U.startTime<=O)o(p),U.sortIndex=U.expirationTime,r(m,U);else break;U=l(p)}}function _(O){if(T=!1,B(O),!C)if(l(m)!==null)C=!0,N||(N=!0,S());else{var U=l(p);U!==null&&Z(_,U.startTime-O)}}var N=!1,P=-1,W=5,I=-1;function Q(){return M?!0:!(n.unstable_now()-IO&&Q());){var le=b.callback;if(typeof le=="function"){b.callback=null,E=b.priorityLevel;var w=le(b.expirationTime<=O);if(O=n.unstable_now(),typeof w=="function"){b.callback=w,B(O),U=!0;break t}b===l(m)&&o(m),B(O)}else o(m);b=l(m)}if(b!==null)U=!0;else{var q=l(p);q!==null&&Z(_,q.startTime-O),U=!1}}break e}finally{b=null,E=V,A=!1}U=void 0}}finally{U?S():N=!1}}}var S;if(typeof $=="function")S=function(){$(K)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,H=ee.port2;ee.port1.onmessage=K,S=function(){H.postMessage(null)}}else S=function(){D(K,0)};function Z(O,U){P=D(function(){O(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125le?(O.sortIndex=V,r(p,O),l(m)===null&&O===l(p)&&(T?(k(P),P=-1):T=!0,Z(_,V-le))):(O.sortIndex=w,r(m,O),C||A||(C=!0,N||(N=!0,S()))),O},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(O){var U=E;return function(){var V=E;E=U;try{return O.apply(this,arguments)}finally{E=V}}}})(_f)),_f}var ig;function U2(){return ig||(ig=1,Df.exports=j2()),Df.exports}var kf={exports:{}},ye={};/** + */var rg;function j2(){return rg||(rg=1,(function(n){function r(O,U){var V=O.length;O.push(U);e:for(;0>>1,w=O[le];if(0>>1;leu(ie,V))oeu(fe,ie)?(O[le]=fe,O[oe]=V,le=oe):(O[le]=ie,O[re]=V,le=re);else if(oeu(fe,V))O[le]=fe,O[oe]=V,le=oe;else break e}}return U}function u(O,U){var V=O.sortIndex-U.sortIndex;return V!==0?V:O.id-U.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var m=[],p=[],y=1,v=null,E=3,A=!1,C=!1,T=!1,M=!1,D=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function L(O){for(var U=l(p);U!==null;){if(U.callback===null)o(p);else if(U.startTime<=O)o(p),U.sortIndex=U.expirationTime,r(m,U);else break;U=l(p)}}function _(O){if(T=!1,L(O),!C)if(l(m)!==null)C=!0,N||(N=!0,S());else{var U=l(p);U!==null&&Z(_,U.startTime-O)}}var N=!1,P=-1,F=5,Q=-1;function I(){return M?!0:!(n.unstable_now()-QO&&I());){var le=v.callback;if(typeof le=="function"){v.callback=null,E=v.priorityLevel;var w=le(v.expirationTime<=O);if(O=n.unstable_now(),typeof w=="function"){v.callback=w,L(O),U=!0;break t}v===l(m)&&o(m),L(O)}else o(m);v=l(m)}if(v!==null)U=!0;else{var q=l(p);q!==null&&Z(_,q.startTime-O),U=!1}}break e}finally{v=null,E=V,A=!1}U=void 0}}finally{U?S():N=!1}}}var S;if(typeof $=="function")S=function(){$(K)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,H=ee.port2;ee.port1.onmessage=K,S=function(){H.postMessage(null)}}else S=function(){D(K,0)};function Z(O,U){P=D(function(){O(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125le?(O.sortIndex=V,r(p,O),l(m)===null&&O===l(p)&&(T?(k(P),P=-1):T=!0,Z(_,V-le))):(O.sortIndex=w,r(m,O),C||A||(C=!0,N||(N=!0,S()))),O},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(O){var U=E;return function(){var V=E;E=U;try{return O.apply(this,arguments)}finally{E=V}}}})(_f)),_f}var ig;function U2(){return ig||(ig=1,Df.exports=j2()),Df.exports}var kf={exports:{}},ye={};/** * @license React * react.production.js * @@ -23,7 +23,7 @@ function N2(n,r){for(var l=0;l"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),zf.exports=Y2(),zf.exports}/** + */var sg;function Y2(){if(sg)return zt;sg=1;var n=_d();function r(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),zf.exports=Y2(),zf.exports}/** * @license React * react-dom-client.production.js * @@ -39,15 +39,15 @@ function N2(n,r){for(var l=0;lw||(e.current=le[w],le[w]=null,w--)}function ie(e,t){w++,le[w]=e.current,e.current=t}var oe=q(null),fe=q(null),ue=q(null),Oe=q(null);function Se(e,t){switch(ie(ue,t),ie(fe,e),ie(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?D0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=D0(t),e=_0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}re(oe),ie(oe,e)}function Ie(){re(oe),re(fe),re(ue)}function Xe(e){e.memoizedState!==null&&ie(Oe,e);var t=oe.current,a=_0(t,e.type);t!==a&&(ie(fe,e),ie(oe,a))}function lt(e){fe.current===e&&(re(oe),re(fe)),Oe.current===e&&(re(Oe),hl._currentValue=V)}var bt=Object.prototype.hasOwnProperty,wt=n.unstable_scheduleCallback,Nt=n.unstable_cancelCallback,yn=n.unstable_shouldYield,Un=n.unstable_requestPaint,Je=n.unstable_now,Lt=n.unstable_getCurrentPriorityLevel,ft=n.unstable_ImmediatePriority,vn=n.unstable_UserBlockingPriority,wn=n.unstable_NormalPriority,pe=n.unstable_LowPriority,Wl=n.unstable_IdlePriority,Fl=n.log,Jl=n.unstable_setDisableYieldValue,St=null,Ee=null;function ot(e){if(typeof Fl=="function"&&Jl(e),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(St,e)}catch{}}var Qe=Math.clz32?Math.clz32:x1,xi=Math.log,pu=Math.LN2;function x1(e){return e>>>=0,e===0?32:31-(xi(e)/pu|0)|0}var eo=256,to=4194304;function Ua(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function no(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var s=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=i&134217727;return v!==0?(i=v&~f,i!==0?s=Ua(i):(g&=v,g!==0?s=Ua(g):a||(a=v&~e,a!==0&&(s=Ua(a))))):(v=i&~f,v!==0?s=Ua(v):g!==0?s=Ua(g):a||(a=i&~e,a!==0&&(s=Ua(a)))),s===0?0:t!==0&&t!==s&&(t&f)===0&&(f=s&-s,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:s}function Ci(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function C1(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hh(){var e=eo;return eo<<=1,(eo&4194048)===0&&(eo=256),e}function mh(){var e=to;return to<<=1,(to&62914560)===0&&(to=4194304),e}function gu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ei(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function E1(e,t,a,i,s,f){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,R=e.expirationTimes,Y=e.hiddenUpdates;for(a=g&~a;0w||(e.current=le[w],le[w]=null,w--)}function ie(e,t){w++,le[w]=e.current,e.current=t}var oe=q(null),fe=q(null),ue=q(null),Oe=q(null);function Se(e,t){switch(ie(ue,t),ie(fe,e),ie(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?D0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=D0(t),e=_0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}re(oe),ie(oe,e)}function Ie(){re(oe),re(fe),re(ue)}function Xe(e){e.memoizedState!==null&&ie(Oe,e);var t=oe.current,a=_0(t,e.type);t!==a&&(ie(fe,e),ie(oe,a))}function lt(e){fe.current===e&&(re(oe),re(fe)),Oe.current===e&&(re(Oe),hl._currentValue=V)}var bt=Object.prototype.hasOwnProperty,wt=n.unstable_scheduleCallback,Nt=n.unstable_cancelCallback,yn=n.unstable_shouldYield,Un=n.unstable_requestPaint,Je=n.unstable_now,Lt=n.unstable_getCurrentPriorityLevel,ft=n.unstable_ImmediatePriority,vn=n.unstable_UserBlockingPriority,wn=n.unstable_NormalPriority,pe=n.unstable_LowPriority,Kl=n.unstable_IdlePriority,Wl=n.log,Fl=n.unstable_setDisableYieldValue,St=null,Ee=null;function ot(e){if(typeof Wl=="function"&&Fl(e),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(St,e)}catch{}}var Qe=Math.clz32?Math.clz32:x1,xi=Math.log,pu=Math.LN2;function x1(e){return e>>>=0,e===0?32:31-(xi(e)/pu|0)|0}var Jl=256,eo=4194304;function Ua(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function to(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var s=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var b=i&134217727;return b!==0?(i=b&~f,i!==0?s=Ua(i):(g&=b,g!==0?s=Ua(g):a||(a=b&~e,a!==0&&(s=Ua(a))))):(b=i&~f,b!==0?s=Ua(b):g!==0?s=Ua(g):a||(a=i&~e,a!==0&&(s=Ua(a)))),s===0?0:t!==0&&t!==s&&(t&f)===0&&(f=s&-s,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:s}function Ci(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function C1(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hh(){var e=Jl;return Jl<<=1,(Jl&4194048)===0&&(Jl=256),e}function mh(){var e=eo;return eo<<=1,(eo&62914560)===0&&(eo=4194304),e}function gu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ei(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function E1(e,t,a,i,s,f){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,R=e.expirationTimes,Y=e.hiddenUpdates;for(a=g&~a;0)":-1s||R[i]!==Y[s]){var te=` `+R[i].replace(" at new "," at ");return e.displayName&&te.includes("")&&(te=te.replace("",e.displayName)),te}while(1<=i&&0<=s);break}}}finally{Cu=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Cr(a):""}function R1(e){switch(e.tag){case 26:case 27:case 5:return Cr(e.type);case 16:return Cr("Lazy");case 13:return Cr("Suspense");case 19:return Cr("SuspenseList");case 0:case 15:return Eu(e.type,!1);case 11:return Eu(e.type.render,!1);case 1:return Eu(e.type,!0);case 31:return Cr("Activity");default:return""}}function Th(e){try{var t="";do t+=R1(e),e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` -`+a.stack}}function an(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Mh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function D1(e){var t=Mh(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(g){i=""+g,f.call(this,g)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(g){i=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function io(e){e._valueTracker||(e._valueTracker=D1(e))}function wh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=Mh(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function lo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var _1=/[\n"\\]/g;function rn(e){return e.replace(_1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Tu(e,t,a,i,s,f,g,v){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+an(t)):e.value!==""+an(t)&&(e.value=""+an(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Mu(e,g,an(t)):a!=null?Mu(e,g,an(a)):i!=null&&e.removeAttribute("value"),s==null&&f!=null&&(e.defaultChecked=!!f),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+an(v):e.removeAttribute("name")}function Ah(e,t,a,i,s,f,g,v){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null))return;a=a!=null?""+an(a):"",t=t!=null?""+an(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=v?e.checked:!!i,e.defaultChecked=!!i,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g)}function Mu(e,t,a){t==="number"&&lo(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Er(e,t,a,i){if(e=e.options,t){t={};for(var s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Du=!1;if(Yn)try{var Ai={};Object.defineProperty(Ai,"passive",{get:function(){Du=!0}}),window.addEventListener("test",Ai,Ai),window.removeEventListener("test",Ai,Ai)}catch{Du=!1}var fa=null,_u=null,so=null;function $h(){if(so)return so;var e,t=_u,a=t.length,i,s="value"in fa?fa.value:fa.textContent,f=s.length;for(e=0;e=Di),Hh=" ",Yh=!1;function qh(e,t){switch(e){case"keyup":return ib.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function ob(e,t){switch(e){case"compositionend":return Gh(t);case"keypress":return t.which!==32?null:(Yh=!0,Hh);case"textInput":return e=t.data,e===Hh&&Yh?null:e;default:return null}}function sb(e,t){if(Ar)return e==="compositionend"||!Lu&&qh(e,t)?(e=$h(),so=_u=fa=null,Ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Wh(a)}}function Jh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function em(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=lo(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=lo(e.document)}return t}function Uu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var gb=Yn&&"documentMode"in document&&11>=document.documentMode,Or=null,Hu=null,$i=null,Yu=!1;function tm(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Yu||Or==null||Or!==lo(i)||(i=Or,"selectionStart"in i&&Uu(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),$i&&zi($i,i)||($i=i,i=Jo(Hu,"onSelect"),0>=g,s-=g,Gn=1<<32-Qe(t)+s|a<f?f:8;var g=O.T,v={};O.T=v,wc(e,!1,t,a);try{var R=s(),Y=O.S;if(Y!==null&&Y(v,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var te=Mb(R,i);Qi(e,t,te,Wt(e))}else Qi(e,t,i,Wt(e))}catch(ae){Qi(e,t,{then:function(){},status:"rejected",reason:ae},Wt())}finally{U.p=f,O.T=g}}function Db(){}function Tc(e,t,a,i){if(e.tag!==5)throw Error(o(476));var s=np(e).queue;tp(e,s,t,V,a===null?Db:function(){return ap(e),a(i)})}function np(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:V},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ap(e){var t=np(e).next.queue;Qi(e,t,{},Wt())}function Mc(){return kt(hl)}function rp(){return ht().memoizedState}function ip(){return ht().memoizedState}function _b(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Wt();e=ma(a);var i=pa(t,e,a);i!==null&&(Ft(i,t,a),Gi(i,t,a)),t={cache:tc()},e.payload=t;return}t=t.return}}function kb(e,t,a){var i=Wt();a={lane:i,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},zo(e)?op(t,a):(a=Pu(e,t,a,i),a!==null&&(Ft(a,e,i),sp(a,t,i)))}function lp(e,t,a){var i=Wt();Qi(e,t,a,i)}function Qi(e,t,a,i){var s={lane:i,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(zo(e))op(t,s);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var g=t.lastRenderedState,v=f(g,a);if(s.hasEagerState=!0,s.eagerState=v,Xt(v,g))return go(e,t,s,0),Pe===null&&po(),!1}catch{}finally{}if(a=Pu(e,t,s,i),a!==null)return Ft(a,e,i),sp(a,t,i),!0}return!1}function wc(e,t,a,i){if(i={lane:2,revertLane:rf(),action:i,hasEagerState:!1,eagerState:null,next:null},zo(e)){if(t)throw Error(o(479))}else t=Pu(e,a,i,2),t!==null&&Ft(t,e,2)}function zo(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function op(e,t){jr=Ao=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function sp(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,gh(e,a)}}var $o={readContext:kt,use:Ro,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st},up={readContext:kt,use:Ro,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Xm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ko(4194308,4,Km.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ko(4194308,4,e,t)},useInsertionEffect:function(e,t){ko(4,2,e,t)},useMemo:function(e,t){var a=Yt();t=t===void 0?null:t;var i=e();if(Fa){ot(!0);try{e()}finally{ot(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=Yt();if(a!==void 0){var s=a(t);if(Fa){ot(!0);try{a(t)}finally{ot(!1)}}}else s=t;return i.memoizedState=i.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},i.queue=e,e=e.dispatch=kb.bind(null,ve,e),[i.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=Sc(e);var t=e.queue,a=lp.bind(null,ve,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Cc,useDeferredValue:function(e,t){var a=Yt();return Ec(a,e,t)},useTransition:function(){var e=Sc(!1);return e=tp.bind(null,ve,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=ve,s=Yt();if(De){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),Pe===null)throw Error(o(349));(Te&124)!==0||Dm(i,t,a)}s.memoizedState=a;var f={value:a,getSnapshot:t};return s.queue=f,Xm(km.bind(null,i,f,e),[e]),i.flags|=2048,Hr(9,_o(),_m.bind(null,i,f,a,t),null),a},useId:function(){var e=Yt(),t=Pe.identifierPrefix;if(De){var a=Vn,i=Gn;a=(i&~(1<<32-Qe(i)-1)).toString(32)+a,t="«"+t+"R"+a,a=Oo++,0he?(Tt=ce,ce=null):Tt=ce.sibling;var Re=G(L,ce,j[he],ne);if(Re===null){ce===null&&(ce=Tt);break}e&&ce&&Re.alternate===null&&t(L,ce),z=f(Re,z,he),be===null?se=Re:be.sibling=Re,be=Re,ce=Tt}if(he===j.length)return a(L,ce),De&&Xa(L,he),se;if(ce===null){for(;hehe?(Tt=ce,ce=null):Tt=ce.sibling;var ka=G(L,ce,Re.value,ne);if(ka===null){ce===null&&(ce=Tt);break}e&&ce&&ka.alternate===null&&t(L,ce),z=f(ka,z,he),be===null?se=ka:be.sibling=ka,be=ka,ce=Tt}if(Re.done)return a(L,ce),De&&Xa(L,he),se;if(ce===null){for(;!Re.done;he++,Re=j.next())Re=ae(L,Re.value,ne),Re!==null&&(z=f(Re,z,he),be===null?se=Re:be.sibling=Re,be=Re);return De&&Xa(L,he),se}for(ce=i(ce);!Re.done;he++,Re=j.next())Re=X(ce,L,he,Re.value,ne),Re!==null&&(e&&Re.alternate!==null&&ce.delete(Re.key===null?he:Re.key),z=f(Re,z,he),be===null?se=Re:be.sibling=Re,be=Re);return e&&ce.forEach(function($2){return t(L,$2)}),De&&Xa(L,he),se}function Ye(L,z,j,ne){if(typeof j=="object"&&j!==null&&j.type===C&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case E:e:{for(var se=j.key;z!==null;){if(z.key===se){if(se=j.type,se===C){if(z.tag===7){a(L,z.sibling),ne=s(z,j.props.children),ne.return=L,L=ne;break e}}else if(z.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===W&&fp(se)===z.type){a(L,z.sibling),ne=s(z,j.props),Wi(ne,j),ne.return=L,L=ne;break e}a(L,z);break}else t(L,z);z=z.sibling}j.type===C?(ne=Va(j.props.children,L.mode,ne,j.key),ne.return=L,L=ne):(ne=vo(j.type,j.key,j.props,null,L.mode,ne),Wi(ne,j),ne.return=L,L=ne)}return g(L);case A:e:{for(se=j.key;z!==null;){if(z.key===se)if(z.tag===4&&z.stateNode.containerInfo===j.containerInfo&&z.stateNode.implementation===j.implementation){a(L,z.sibling),ne=s(z,j.children||[]),ne.return=L,L=ne;break e}else{a(L,z);break}else t(L,z);z=z.sibling}ne=Iu(j,L.mode,ne),ne.return=L,L=ne}return g(L);case W:return se=j._init,j=se(j._payload),Ye(L,z,j,ne)}if(Z(j))return me(L,z,j,ne);if(S(j)){if(se=S(j),typeof se!="function")throw Error(o(150));return j=se.call(j),de(L,z,j,ne)}if(typeof j.then=="function")return Ye(L,z,No(j),ne);if(j.$$typeof===$)return Ye(L,z,Co(L,j),ne);Lo(L,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,z!==null&&z.tag===6?(a(L,z.sibling),ne=s(z,j),ne.return=L,L=ne):(a(L,z),ne=Zu(j,L.mode,ne),ne.return=L,L=ne),g(L)):a(L,z)}return function(L,z,j,ne){try{Ki=0;var se=Ye(L,z,j,ne);return Yr=null,se}catch(ce){if(ce===Yi||ce===To)throw ce;var be=Zt(29,ce,null,L.mode);return be.lanes=ne,be.return=L,be}finally{}}}var qr=dp(!0),hp=dp(!1),cn=q(null),On=null;function ya(e){var t=e.alternate;ie(gt,gt.current&1),ie(cn,e),On===null&&(t===null||Br.current!==null||t.memoizedState!==null)&&(On=e)}function mp(e){if(e.tag===22){if(ie(gt,gt.current),ie(cn,e),On===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(On=e)}}else va()}function va(){ie(gt,gt.current),ie(cn,cn.current)}function In(e){re(cn),On===e&&(On=null),re(gt)}var gt=q(0);function Bo(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||yf(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Ac(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Oc={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=Wt(),s=ma(i);s.payload=t,a!=null&&(s.callback=a),t=pa(e,s,i),t!==null&&(Ft(t,e,i),Gi(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=Wt(),s=ma(i);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=pa(e,s,i),t!==null&&(Ft(t,e,i),Gi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Wt(),i=ma(a);i.tag=2,t!=null&&(i.callback=t),t=pa(e,i,a),t!==null&&(Ft(t,e,a),Gi(t,e,a))}};function pp(e,t,a,i,s,f,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,g):t.prototype&&t.prototype.isPureReactComponent?!zi(a,i)||!zi(s,f):!0}function gp(e,t,a,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,i),t.state!==e&&Oc.enqueueReplaceState(t,t.state,null)}function Ja(e,t){var a=t;if("ref"in t){a={};for(var i in t)i!=="ref"&&(a[i]=t[i])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}var jo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function yp(e){jo(e)}function vp(e){console.error(e)}function bp(e){jo(e)}function Uo(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Sp(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Rc(e,t,a){return a=ma(a),a.tag=3,a.payload={element:null},a.callback=function(){Uo(e,t)},a}function xp(e){return e=ma(e),e.tag=3,e}function Cp(e,t,a,i){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var f=i.value;e.payload=function(){return s(f)},e.callback=function(){Sp(t,a,i)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){Sp(t,a,i),typeof s!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var v=i.stack;this.componentDidCatch(i.value,{componentStack:v!==null?v:""})})}function $b(e,t,a,i,s){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&ji(t,a,s,!0),a=cn.current,a!==null){switch(a.tag){case 13:return On===null?Jc():a.alternate===null&&tt===0&&(tt=3),a.flags&=-257,a.flags|=65536,a.lanes=s,i===rc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),tf(e,i,s)),!1;case 22:return a.flags|=65536,i===rc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([i]):a.add(i)),tf(e,i,s)),!1}throw Error(o(435,a.tag))}return tf(e,i,s),Jc(),!1}if(De)return t=cn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,i!==Wu&&(e=Error(o(422),{cause:i}),Bi(ln(e,a)))):(i!==Wu&&(t=Error(o(423),{cause:i}),Bi(ln(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,i=ln(i,a),s=Rc(e.stateNode,i,s),oc(e,s),tt!==4&&(tt=2)),!1;var f=Error(o(520),{cause:i});if(f=ln(f,a),rl===null?rl=[f]:rl.push(f),tt!==4&&(tt=2),t===null)return!0;i=ln(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=Rc(a.stateNode,i,e),oc(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ta===null||!Ta.has(f))))return a.flags|=65536,s&=-s,a.lanes|=s,s=xp(s),Cp(s,e,a,i),oc(a,s),!1}a=a.return}while(a!==null);return!1}var Ep=Error(o(461)),Ct=!1;function At(e,t,a,i){t.child=e===null?hp(t,null,a,i):qr(t,e.child,a,i)}function Tp(e,t,a,i,s){a=a.render;var f=t.ref;if("ref"in i){var g={};for(var v in i)v!=="ref"&&(g[v]=i[v])}else g=i;return Ka(t),i=dc(e,t,a,g,f,s),v=hc(),e!==null&&!Ct?(mc(e,t,s),Qn(e,t,s)):(De&&v&&Qu(t),t.flags|=1,At(e,t,i,s),t.child)}function Mp(e,t,a,i,s){if(e===null){var f=a.type;return typeof f=="function"&&!Xu(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,wp(e,t,f,i,s)):(e=vo(a.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Bc(e,s)){var g=f.memoizedProps;if(a=a.compare,a=a!==null?a:zi,a(g,i)&&e.ref===t.ref)return Qn(e,t,s)}return t.flags|=1,e=qn(f,i),e.ref=t.ref,e.return=t,t.child=e}function wp(e,t,a,i,s){if(e!==null){var f=e.memoizedProps;if(zi(f,i)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=i=f,Bc(e,s))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,Qn(e,t,s)}return Dc(e,t,a,i,s)}function Ap(e,t,a){var i=t.pendingProps,s=i.children,f=e!==null?e.memoizedState:null;if(i.mode==="hidden"){if((t.flags&128)!==0){if(i=f!==null?f.baseLanes|a:a,e!==null){for(s=t.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;t.childLanes=f&~i}else t.childLanes=0,t.child=null;return Op(e,t,i,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Eo(t,f!==null?f.cachePool:null),f!==null?wm(t,f):uc(),mp(t);else return t.lanes=t.childLanes=536870912,Op(e,t,f!==null?f.baseLanes|a:a,a)}else f!==null?(Eo(t,f.cachePool),wm(t,f),va(),t.memoizedState=null):(e!==null&&Eo(t,null),uc(),va());return At(e,t,s,a),t.child}function Op(e,t,a,i){var s=ac();return s=s===null?null:{parent:pt._currentValue,pool:s},t.memoizedState={baseLanes:a,cachePool:s},e!==null&&Eo(t,null),uc(),mp(t),e!==null&&ji(e,t,i,!0),null}function Ho(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Dc(e,t,a,i,s){return Ka(t),a=dc(e,t,a,i,void 0,s),i=hc(),e!==null&&!Ct?(mc(e,t,s),Qn(e,t,s)):(De&&i&&Qu(t),t.flags|=1,At(e,t,a,s),t.child)}function Rp(e,t,a,i,s,f){return Ka(t),t.updateQueue=null,a=Om(t,i,a,s),Am(e),i=hc(),e!==null&&!Ct?(mc(e,t,f),Qn(e,t,f)):(De&&i&&Qu(t),t.flags|=1,At(e,t,a,f),t.child)}function Dp(e,t,a,i,s){if(Ka(t),t.stateNode===null){var f=kr,g=a.contextType;typeof g=="object"&&g!==null&&(f=kt(g)),f=new a(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Oc,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},ic(t),g=a.contextType,f.context=typeof g=="object"&&g!==null?kt(g):kr,f.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(Ac(t,a,g,i),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(g=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),g!==f.state&&Oc.enqueueReplaceState(f,f.state,null),Pi(t,i,f,s),Vi(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var v=t.memoizedProps,R=Ja(a,v);f.props=R;var Y=f.context,te=a.contextType;g=kr,typeof te=="object"&&te!==null&&(g=kt(te));var ae=a.getDerivedStateFromProps;te=typeof ae=="function"||typeof f.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,te||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v||Y!==g)&&gp(t,f,i,g),ha=!1;var G=t.memoizedState;f.state=G,Pi(t,i,f,s),Vi(),Y=t.memoizedState,v||G!==Y||ha?(typeof ae=="function"&&(Ac(t,a,ae,i),Y=t.memoizedState),(R=ha||pp(t,a,R,i,G,Y,g))?(te||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=Y),f.props=i,f.state=Y,f.context=g,i=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,lc(e,t),g=t.memoizedProps,te=Ja(a,g),f.props=te,ae=t.pendingProps,G=f.context,Y=a.contextType,R=kr,typeof Y=="object"&&Y!==null&&(R=kt(Y)),v=a.getDerivedStateFromProps,(Y=typeof v=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==ae||G!==R)&&gp(t,f,i,R),ha=!1,G=t.memoizedState,f.state=G,Pi(t,i,f,s),Vi();var X=t.memoizedState;g!==ae||G!==X||ha||e!==null&&e.dependencies!==null&&xo(e.dependencies)?(typeof v=="function"&&(Ac(t,a,v,i),X=t.memoizedState),(te=ha||pp(t,a,te,i,G,X,R)||e!==null&&e.dependencies!==null&&xo(e.dependencies))?(Y||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,X,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,X,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=X),f.props=i,f.state=X,f.context=R,i=te):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,Ho(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=qr(t,e.child,null,s),t.child=qr(t,null,a,s)):At(e,t,a,s),t.memoizedState=f.state,e=t.child):e=Qn(e,t,s),e}function _p(e,t,a,i){return Li(),t.flags|=256,At(e,t,a,i),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kc(e){return{baseLanes:e,cachePool:vm()}}function zc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=fn),e}function kp(e,t,a){var i=t.pendingProps,s=!1,f=(t.flags&128)!==0,g;if((g=f)||(g=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),g&&(s=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(s?ya(t):va(),De){var v=et,R;if(R=v){e:{for(R=v,v=An;R.nodeType!==8;){if(!v){v=null;break e}if(R=xn(R.nextSibling),R===null){v=null;break e}}v=R}v!==null?(t.memoizedState={dehydrated:v,treeContext:Pa!==null?{id:Gn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},R=Zt(18,null,null,0),R.stateNode=v,R.return=t,t.child=R,Bt=t,et=null,R=!0):R=!1}R||Ia(t)}if(v=t.memoizedState,v!==null&&(v=v.dehydrated,v!==null))return yf(v)?t.lanes=32:t.lanes=536870912,null;In(t)}return v=i.children,i=i.fallback,s?(va(),s=t.mode,v=Yo({mode:"hidden",children:v},s),i=Va(i,s,a,null),v.return=t,i.return=t,v.sibling=i,t.child=v,s=t.child,s.memoizedState=kc(a),s.childLanes=zc(e,g,a),t.memoizedState=_c,i):(ya(t),$c(t,v))}if(R=e.memoizedState,R!==null&&(v=R.dehydrated,v!==null)){if(f)t.flags&256?(ya(t),t.flags&=-257,t=Nc(e,t,a)):t.memoizedState!==null?(va(),t.child=e.child,t.flags|=128,t=null):(va(),s=i.fallback,v=t.mode,i=Yo({mode:"visible",children:i.children},v),s=Va(s,v,a,null),s.flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,qr(t,e.child,null,a),i=t.child,i.memoizedState=kc(a),i.childLanes=zc(e,g,a),t.memoizedState=_c,t=s);else if(ya(t),yf(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var Y=g.dgst;g=Y,i=Error(o(419)),i.stack="",i.digest=g,Bi({value:i,source:null,stack:null}),t=Nc(e,t,a)}else if(Ct||ji(e,t,a,!1),g=(a&e.childLanes)!==0,Ct||g){if(g=Pe,g!==null&&(i=a&-a,i=(i&42)!==0?1:yu(i),i=(i&(g.suspendedLanes|a))!==0?0:i,i!==0&&i!==R.retryLane))throw R.retryLane=i,_r(e,i),Ft(g,e,i),Ep;v.data==="$?"||Jc(),t=Nc(e,t,a)}else v.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,et=xn(v.nextSibling),Bt=t,De=!0,Za=null,An=!1,e!==null&&(sn[un++]=Gn,sn[un++]=Vn,sn[un++]=Pa,Gn=e.id,Vn=e.overflow,Pa=t),t=$c(t,i.children),t.flags|=4096);return t}return s?(va(),s=i.fallback,v=t.mode,R=e.child,Y=R.sibling,i=qn(R,{mode:"hidden",children:i.children}),i.subtreeFlags=R.subtreeFlags&65011712,Y!==null?s=qn(Y,s):(s=Va(s,v,a,null),s.flags|=2),s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,v=e.child.memoizedState,v===null?v=kc(a):(R=v.cachePool,R!==null?(Y=pt._currentValue,R=R.parent!==Y?{parent:Y,pool:Y}:R):R=vm(),v={baseLanes:v.baseLanes|a,cachePool:R}),s.memoizedState=v,s.childLanes=zc(e,g,a),t.memoizedState=_c,i):(ya(t),a=e.child,e=a.sibling,a=qn(a,{mode:"visible",children:i.children}),a.return=t,a.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=a,t.memoizedState=null,a)}function $c(e,t){return t=Yo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Yo(e,t){return e=Zt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Nc(e,t,a){return qr(t,e.child,null,a),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zp(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ju(e.return,t,a)}function Lc(e,t,a,i,s){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:s}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=a,f.tailMode=s)}function $p(e,t,a){var i=t.pendingProps,s=i.revealOrder,f=i.tail;if(At(e,t,i.children,a),i=gt.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zp(e,a,t);else if(e.tag===19)zp(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(ie(gt,i),s){case"forwards":for(a=t.child,s=null;a!==null;)e=a.alternate,e!==null&&Bo(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),Lc(t,!1,s,a,f);break;case"backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Bo(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}Lc(t,!0,a,null,f);break;case"together":Lc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ea|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ji(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=qn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=qn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Bc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&xo(e)))}function Nb(e,t,a){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),da(t,pt,e.memoizedState.cache),Li();break;case 27:case 5:Xe(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:da(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ya(t),t.flags|=128,null):(a&t.child.childLanes)!==0?kp(e,t,a):(ya(t),e=Qn(e,t,a),e!==null?e.sibling:null);ya(t);break;case 19:var s=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(ji(e,t,a,!1),i=(a&t.childLanes)!==0),s){if(i)return $p(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ie(gt,gt.current),i)break;return null;case 22:case 23:return t.lanes=0,Ap(e,t,a);case 24:da(t,pt,e.memoizedState.cache)}return Qn(e,t,a)}function Np(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!Bc(e,a)&&(t.flags&128)===0)return Ct=!1,Nb(e,t,a);Ct=(e.flags&131072)!==0}else Ct=!1,De&&(t.flags&1048576)!==0&&fm(t,So,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,s=i._init;if(i=s(i._payload),t.type=i,typeof i=="function")Xu(i)?(e=Ja(i,e),t.tag=1,t=Dp(null,t,i,e,a)):(t.tag=0,t=Dc(null,t,i,e,a));else{if(i!=null){if(s=i.$$typeof,s===B){t.tag=11,t=Tp(null,t,i,e,a);break e}else if(s===P){t.tag=14,t=Mp(null,t,i,e,a);break e}}throw t=H(i)||i,Error(o(306,t,""))}}return t;case 0:return Dc(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,s=Ja(i,t.pendingProps),Dp(e,t,i,s,a);case 3:e:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var f=t.memoizedState;s=f.element,lc(e,t),Pi(t,i,null,a);var g=t.memoizedState;if(i=g.cache,da(t,pt,i),i!==f.cache&&ec(t,[pt],a,!0),Vi(),i=g.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=_p(e,t,i,a);break e}else if(i!==s){s=ln(Error(o(424)),t),Bi(s),t=_p(e,t,i,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=xn(e.firstChild),Bt=t,De=!0,Za=null,An=!0,a=hp(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Li(),i===s){t=Qn(e,t,a);break e}At(e,t,i,a)}t=t.child}return t;case 26:return Ho(e,t),e===null?(a=U0(t.type,null,t.pendingProps,null))?t.memoizedState=a:De||(a=t.type,e=t.pendingProps,i=ts(ue.current).createElement(a),i[_t]=t,i[Ut]=e,Rt(i,a,e),xt(i),t.stateNode=i):t.memoizedState=U0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Xe(t),e===null&&De&&(i=t.stateNode=L0(t.type,t.pendingProps,ue.current),Bt=t,An=!0,s=et,Aa(t.type)?(vf=s,et=xn(i.firstChild)):et=s),At(e,t,t.pendingProps.children,a),Ho(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((s=i=et)&&(i=u2(i,t.type,t.pendingProps,An),i!==null?(t.stateNode=i,Bt=t,et=xn(i.firstChild),An=!1,s=!0):s=!1),s||Ia(t)),Xe(t),s=t.type,f=t.pendingProps,g=e!==null?e.memoizedProps:null,i=f.children,mf(s,f)?i=null:g!==null&&mf(s,g)&&(t.flags|=32),t.memoizedState!==null&&(s=dc(e,t,Ab,null,null,a),hl._currentValue=s),Ho(e,t),At(e,t,i,a),t.child;case 6:return e===null&&De&&((e=a=et)&&(a=c2(a,t.pendingProps,An),a!==null?(t.stateNode=a,Bt=t,et=null,e=!0):e=!1),e||Ia(t)),null;case 13:return kp(e,t,a);case 4:return Se(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=qr(t,null,i,a):At(e,t,i,a),t.child;case 11:return Tp(e,t,t.type,t.pendingProps,a);case 7:return At(e,t,t.pendingProps,a),t.child;case 8:return At(e,t,t.pendingProps.children,a),t.child;case 12:return At(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,da(t,t.type,i.value),At(e,t,i.children,a),t.child;case 9:return s=t.type._context,i=t.pendingProps.children,Ka(t),s=kt(s),i=i(s),t.flags|=1,At(e,t,i,a),t.child;case 14:return Mp(e,t,t.type,t.pendingProps,a);case 15:return wp(e,t,t.type,t.pendingProps,a);case 19:return $p(e,t,a);case 31:return i=t.pendingProps,a=t.mode,i={mode:i.mode,children:i.children},e===null?(a=Yo(i,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=qn(e.child,i),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Ap(e,t,a);case 24:return Ka(t),i=kt(pt),e===null?(s=ac(),s===null&&(s=Pe,f=tc(),s.pooledCache=f,f.refCount++,f!==null&&(s.pooledCacheLanes|=a),s=f),t.memoizedState={parent:i,cache:s},ic(t),da(t,pt,s)):((e.lanes&a)!==0&&(lc(e,t),Pi(t,null,null,a),Vi()),s=e.memoizedState,f=t.memoizedState,s.parent!==i?(s={parent:i,cache:i},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),da(t,pt,i)):(i=f.cache,da(t,pt,i),i!==s.cache&&ec(t,[pt],a,!0))),At(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Kn(e){e.flags|=4}function Lp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!V0(t)){if(t=cn.current,t!==null&&((Te&4194048)===Te?On!==null:(Te&62914560)!==Te&&(Te&536870912)===0||t!==On))throw qi=rc,bm;e.flags|=8192}}function qo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?mh():536870912,e.lanes|=t,Xr|=t)}function Fi(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function Lb(e,t,a){var i=t.pendingProps;switch(Ku(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Xn(pt),Ie(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?Kn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,mm())),Fe(t),null;case 26:return a=t.memoizedState,e===null?(Kn(t),a!==null?(Fe(t),Lp(t,a)):(Fe(t),t.flags&=-16777217)):a?a!==e.memoizedState?(Kn(t),Fe(t),Lp(t,a)):(Fe(t),t.flags&=-16777217):(e.memoizedProps!==i&&Kn(t),Fe(t),t.flags&=-16777217),null;case 27:lt(t),a=ue.current;var s=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Kn(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Fe(t),null}e=oe.current,Ni(t)?dm(t):(e=L0(s,i,a),t.stateNode=e,Kn(t))}return Fe(t),null;case 5:if(lt(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Kn(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Fe(t),null}if(e=oe.current,Ni(t))dm(t);else{switch(s=ts(ue.current),e){case 1:e=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=s.createElement("div"),e.innerHTML=" - + + diff --git a/src/frontend/dist/index.html b/src/frontend/dist/index.html index cfb510f7..d1950996 100644 --- a/src/frontend/dist/index.html +++ b/src/frontend/dist/index.html @@ -5,8 +5,8 @@ Parallax by Gradient - - + + diff --git a/src/frontend/src/components/common/drawer-layout.tsx b/src/frontend/src/components/common/drawer-layout.tsx index 3f73b17d..95ebc8ad 100644 --- a/src/frontend/src/components/common/drawer-layout.tsx +++ b/src/frontend/src/components/common/drawer-layout.tsx @@ -153,7 +153,7 @@ export const DrawerLayout: FC = ({ children }) => { Your selected model requires more nodes. {(!!modelInfo && modelInfo.vram > 0 && [ - `You’ll need a `, + ` You’ll need a `, {`minimum of ${modelInfo.vram} GB of total VRAM`}, ` to host this model.`, ]) diff --git a/src/frontend/src/components/inputs/model-select.tsx b/src/frontend/src/components/inputs/model-select.tsx index a66e3352..47ae98c1 100644 --- a/src/frontend/src/components/inputs/model-select.tsx +++ b/src/frontend/src/components/inputs/model-select.tsx @@ -157,17 +157,16 @@ export const ModelSelect: FC = ({ variant = 'outlined', autoCo // openDialog(); // return; // } + if (autoCommit) { + setCanAutoCommit(true); + } setModelName(String(e.target.value)); }); const [canAutoCommit, setCanAutoCommit] = useState(false); - useEffect(() => { - if (autoCommit) { - setCanAutoCommit(autoCommit); - } - }, [autoCommit]); useEffect(() => { if (canAutoCommit && configModelName !== clusterModelName) { + setCanAutoCommit(false); init(); } }, [canAutoCommit, configModelName]); diff --git a/src/frontend/src/components/inputs/node-list.tsx b/src/frontend/src/components/inputs/node-list.tsx index fe8dcd19..c9a50bed 100644 --- a/src/frontend/src/components/inputs/node-list.tsx +++ b/src/frontend/src/components/inputs/node-list.tsx @@ -218,6 +218,7 @@ const Node: FC<{ variant: NodeListVariant; node?: NodeInfo }> = ({ variant, node }, })} variant={variant} + data-debug-status={status} > {variant === 'list' && } {variant === 'menu' && } diff --git a/src/frontend/src/services/cluster.tsx b/src/frontend/src/services/cluster.tsx index de45d8e9..5077c936 100644 --- a/src/frontend/src/services/cluster.tsx +++ b/src/frontend/src/services/cluster.tsx @@ -44,7 +44,7 @@ export interface ModelInfo { readonly vram: number; } -export type ClusterStatus = 'idle' | 'waiting' | 'available' | 'rebalancing' | 'failed'; +export type ClusterStatus = 'offline' | 'idle' | 'waiting' | 'available' | 'rebalancing' | 'failed'; export interface ClusterInfo { readonly id: string; @@ -58,7 +58,7 @@ export interface ClusterInfo { const INITIAL_CLUSTER_INFO: ClusterInfo = { id: '', - status: 'idle', + status: 'offline', modelName: '', modelInfo: undefined, nodeJoinCommand: {}, @@ -116,12 +116,15 @@ const { Provider } = context; export const ClusterProvider: FC = ({ children }) => { const [{ type: hostType }] = useHost(); + // ================================ // Configs const [networkType, setNetworkType] = useState('local'); const [initNodesNumber, setInitNodesNumber] = useState(1); const [modelName, setModelName] = useState(''); + // ================================ // Model List + const [modelInfoList, setModelInfoList] = useState([]); const updateModelList = useRefCallback(async () => { @@ -132,23 +135,17 @@ export const ClusterProvider: FC = ({ children }) => { while (!succeed) { try { const rawList = await getModelList(); - setModelInfoList((prev) => { - const next = rawList.map(({ name, vram_gb }) => { - name = name || ''; - vram_gb = vram_gb || 0; - return { - name, - displayName: name, - logoUrl: getLogoUrl(name), - vram: vram_gb, - }; - }); - if (JSON.stringify(next) !== JSON.stringify(prev)) { - debugLog('setModelInfoList', next); - return next; - } - return prev; + const next: readonly ModelInfo[] = rawList.map(({ name, vram_gb }) => { + name = name || ''; + vram_gb = vram_gb || 0; + return { + name, + displayName: name, + logoUrl: getLogoUrl(name), + vram: vram_gb, + }; }); + setModelInfoList(next); succeed = true; } catch (error) { console.error('getModelList error', error); @@ -161,13 +158,9 @@ export const ClusterProvider: FC = ({ children }) => { updateModelList(); }, []); - useEffect(() => { - if (modelInfoList.length) { - setModelName(modelInfoList[0].name); - } - }, [modelInfoList]); - + // ================================ // Cluster and Nodes + const [clusterInfo, setClusterInfo] = useState(INITIAL_CLUSTER_INFO); const [nodeInfoList, setNodeInfoList] = useState([]); @@ -191,7 +184,7 @@ export const ClusterProvider: FC = ({ children }) => { }, } = message; setClusterInfo((prev) => { - const next = { + const next: ClusterInfo = { ...prev, status: (model_name && status) || 'idle', initNodesNumber: init_nodes_num || 0, @@ -253,8 +246,29 @@ export const ClusterProvider: FC = ({ children }) => { streamClusterStatus.send(); }, []); + // ================================ // Init + useEffect(() => { + const firstModelName = modelInfoList.length ? modelInfoList[0].name : ''; + // must wait for cluster to be connected + // set config model name initial value + // detect by the cluster is running or not. + if (clusterInfo.status === 'waiting') { + setModelName((prev) => clusterInfo.modelName || prev || firstModelName); + } else if (clusterInfo.status !== 'offline') { + setModelName( + (prev) => + // if prev is assigned, means the model has been set by user, do not change it + // if prev is not assigned and clusterInfo.modelName is assigned, + // means the cluster is running, set it to clusterInfo.modelName + // if prev and clusterInfo.modelName are both not assigned, + // means the model has not been set by user, set it to the first model in the list + prev || clusterInfo.modelName || firstModelName, + ); + } + }, [modelInfoList, clusterInfo]); + const init = useRefCallback(async () => { if (initNodesNumber < 1) { throw new Error('initNodesNumber must be greater than 0'); @@ -277,6 +291,7 @@ export const ClusterProvider: FC = ({ children }) => { // })); }); + // ================================ // Forwards const actions: ClusterActions = useMemo(() => {