var Sh=Object.defineProperty;var Th=(r,E,z)=>E in r?Sh(r,E,{enumerable:!0,configurable:!0,writable:!0,value:z}):r[E]=z;var Li=(r,E,z)=>Th(r,typeof E!="symbol"?E+"":E,z);(function(){const E=document.createElement("link").relList;if(E&&E.supports&&E.supports("modulepreload"))return;for(const C of document.querySelectorAll('link[rel="modulepreload"]'))d(C);new MutationObserver(C=>{for(const B of C)if(B.type==="childList")for(const M of B.addedNodes)M.tagName==="LINK"&&M.rel==="modulepreload"&&d(M)}).observe(document,{childList:!0,subtree:!0});function z(C){const B={};return C.integrity&&(B.integrity=C.integrity),C.referrerPolicy&&(B.referrerPolicy=C.referrerPolicy),C.crossOrigin==="use-credentials"?B.credentials="include":C.crossOrigin==="anonymous"?B.credentials="omit":B.credentials="same-origin",B}function d(C){if(C.ep)return;C.ep=!0;const B=z(C);fetch(C.href,B)}})();var As={exports:{}},dn={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var sm;function Nh(){if(sm)return dn;sm=1;var r=Symbol.for("react.transitional.element"),E=Symbol.for("react.fragment");function z(d,C,B){var M=null;if(B!==void 0&&(M=""+B),C.key!==void 0&&(M=""+C.key),"key"in C){B={};for(var ut in C)ut!=="key"&&(B[ut]=C[ut])}else B=C;return C=B.ref,{$$typeof:r,type:d,key:M,ref:C!==void 0?C:null,props:B}}return dn.Fragment=E,dn.jsx=z,dn.jsxs=z,dn}var rm;function Eh(){return rm||(rm=1,As.exports=Nh()),As.exports}var f=Eh(),js={exports:{}},nt={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var om;function zh(){if(om)return nt;om=1;var r=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),M=Symbol.for("react.context"),ut=Symbol.for("react.forward_ref"),tt=Symbol.for("react.suspense"),V=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),Z=Symbol.for("react.view_transition"),$=Symbol.iterator;function it(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var Ut={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,vt={};function pt(o,N,w){this.props=o,this.context=N,this.refs=vt,this.updater=w||Ut}pt.prototype.isReactComponent={},pt.prototype.setState=function(o,N){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,N,"setState")},pt.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function Ct(){}Ct.prototype=pt.prototype;function Ft(o,N,w){this.props=o,this.context=N,this.refs=vt,this.updater=w||Ut}var St=Ft.prototype=new Ct;St.constructor=Ft,Y(St,pt.prototype),St.isPureReactComponent=!0;var J=Array.isArray;function K(){}var k={H:null,A:null,T:null,S:null},_t=Object.prototype.hasOwnProperty;function qt(o,N,w){var G=w.ref;return{$$typeof:r,type:o,key:N,ref:G!==void 0?G:null,props:w}}function Zt(o,N){return qt(o.type,N,o.props)}function Tt(o){return typeof o=="object"&&o!==null&&o.$$typeof===r}function Jt(o){var N={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(w){return N[w]})}var al=/\/+/g;function Qt(o,N){return typeof o=="object"&&o!==null&&o.key!=null?Jt(""+o.key):N.toString(36)}function U(o){switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:switch(typeof o.status=="string"?o.then(K,K):(o.status="pending",o.then(function(N){o.status==="pending"&&(o.status="fulfilled",o.value=N)},function(N){o.status==="pending"&&(o.status="rejected",o.reason=N)})),o.status){case"fulfilled":return o.value;case"rejected":throw o.reason}}throw o}function F(o,N,w,G,ot){var x=typeof o;(x==="undefined"||x==="boolean")&&(o=null);var j=!1;if(o===null)j=!0;else switch(x){case"bigint":case"string":case"number":j=!0;break;case"object":switch(o.$$typeof){case r:case E:j=!0;break;case R:return j=o._init,F(j(o._payload),N,w,G,ot)}}if(j)return ot=ot(o),j=G===""?"."+Qt(o,0):G,J(ot)?(w="",j!=null&&(w=j.replace(al,"$&/")+"/"),F(ot,N,w,"",function(lt){return lt})):ot!=null&&(Tt(ot)&&(ot=Zt(ot,w+(ot.key==null||o&&o.key===ot.key?"":(""+ot.key).replace(al,"$&/")+"/")+j)),N.push(ot)),1;j=0;var p=G===""?".":G+":";if(J(o))for(var A=0;A>>1,H=U[gt];if(0>>1;gtC(Bt,I))oC(N,Bt)?(U[gt]=N,U[o]=I,gt=o):(U[gt]=Bt,U[st]=I,gt=st);else if(oC(N,I))U[gt]=N,U[o]=I,gt=o;else break t}}return F}function C(U,F){var I=U.sortIndex-F.sortIndex;return I!==0?I:U.id-F.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var B=performance;r.unstable_now=function(){return B.now()}}else{var M=Date,ut=M.now();r.unstable_now=function(){return M.now()-ut}}var tt=[],V=[],R=1,T=null,Z=3,$=!1,it=!1,Ut=!1,Y=!1,vt=typeof setTimeout=="function"?setTimeout:null,pt=typeof clearTimeout=="function"?clearTimeout:null,Ct=typeof setImmediate<"u"?setImmediate:null;function Ft(U){for(var F=z(V);F!==null;){if(F.callback===null)d(V);else if(F.startTime<=U)d(V),F.sortIndex=F.expirationTime,E(tt,F);else break;F=z(V)}}function St(U){if(Ut=!1,Ft(U),!it)if(z(tt)!==null)it=!0,J||(J=!0,Tt());else{var F=z(V);F!==null&&Qt(St,F.startTime-U)}}var J=!1,K=-1,k=5,_t=-1;function qt(){return Y?!0:!(r.unstable_now()-_tU&&qt());){var gt=T.callback;if(typeof gt=="function"){T.callback=null,Z=T.priorityLevel;var H=gt(T.expirationTime<=U);if(U=r.unstable_now(),typeof H=="function"){T.callback=H,Ft(U),F=!0;break l}T===z(tt)&&d(tt),Ft(U)}else d(tt);T=z(tt)}if(T!==null)F=!0;else{var at=z(V);at!==null&&Qt(St,at.startTime-U),F=!1}}break t}finally{T=null,Z=I,$=!1}F=void 0}}finally{F?Tt():J=!1}}}var Tt;if(typeof Ct=="function")Tt=function(){Ct(Zt)};else if(typeof MessageChannel<"u"){var Jt=new MessageChannel,al=Jt.port2;Jt.port1.onmessage=Zt,Tt=function(){al.postMessage(null)}}else Tt=function(){vt(Zt,0)};function Qt(U,F){K=vt(function(){U(r.unstable_now())},F)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(U){U.callback=null},r.unstable_forceFrameRate=function(U){0>U||125gt?(U.sortIndex=I,E(V,U),z(tt)===null&&U===z(V)&&(Ut?(pt(K),K=-1):Ut=!0,Qt(St,I-gt))):(U.sortIndex=H,E(tt,U),it||$||(it=!0,J||(J=!0,Tt()))),U},r.unstable_shouldYield=qt,r.unstable_wrapCallback=function(U){var F=Z;return function(){var I=Z;Z=F;try{return U.apply(this,arguments)}finally{Z=I}}}})(Ds)),Ds}var ym;function Oh(){return ym||(ym=1,Cs.exports=_h()),Cs.exports}var Us={exports:{}},yl={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hm;function Ah(){if(hm)return yl;hm=1;var r=qs();function E(R){var T="https://react.dev/errors/"+R;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(E){console.error(E)}}return r(),Us.exports=Ah(),Us.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var gm;function Mh(){if(gm)return mn;gm=1;var r=Oh(),E=qs(),z=jh();function d(t){var l="https://react.dev/errors/"+t;if(1q||(t.current=P[q],P[q]=null,q--)}function Nt(t,l){q++,P[q]=t.current,t.current=l}var te=Yt(null),gu=Yt(null),je=Yt(null),hn=Yt(null);function vn(t,l){switch(Nt(je,l),Nt(gu,t),Nt(te,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?b0(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=b0(l),t=x0(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Rt(te),Nt(te,t)}function Oa(){Rt(te),Rt(gu),Rt(je)}function Ji(t){var l=t.memoizedState;l!==null&&(yu._currentValue=l.memoizedState,Nt(hn,t)),l=te.current;var e=x0(l,t.type);l!==e&&(Nt(gu,t),Nt(te,e))}function gn(t){gu.current===t&&(Rt(te),Rt(gu)),hn.current===t&&(Rt(hn),yu._currentValue=lt)}var ki,Ys;function Me(t){if(ki===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);ki=l&&l[1]||"",Ys=-1)":-1u||s[a]!==v[u]){var S=` `+s[a].replace(" at new "," at ");return t.displayName&&S.includes("")&&(S=S.replace("",t.displayName)),S}while(1<=a&&0<=u);break}}}finally{$i=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?Me(e):""}function zm(t,l){switch(t.tag){case 26:case 27:case 5:return Me(t.type);case 16:return Me("Lazy");case 13:return t.child!==l&&l!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return Fi(t.type,!1);case 11:return Fi(t.type.render,!1);case 1:return Fi(t.type,!0);case 31:return Me("Activity");case 30:return Me("ViewTransition");default:return""}}function ws(t){try{var l="",e=null;do l+=zm(t,e),e=t,t=t.return;while(t);return l}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var Wi=Object.prototype.hasOwnProperty,Ii=r.unstable_scheduleCallback,Pi=r.unstable_cancelCallback,_m=r.unstable_shouldYield,Om=r.unstable_requestPaint,Ol=r.unstable_now,Am=r.unstable_getCurrentPriorityLevel,Gs=r.unstable_ImmediatePriority,Qs=r.unstable_UserBlockingPriority,bn=r.unstable_NormalPriority,jm=r.unstable_LowPriority,Xs=r.unstable_IdlePriority,Mm=r.log,Cm=r.unstable_setDisableYieldValue,bu=null,Al=null;function Ce(t){if(typeof Mm=="function"&&Cm(t),Al&&typeof Al.setStrictMode=="function")try{Al.setStrictMode(bu,t)}catch{}}var jl=Math.clz32?Math.clz32:Rm,Dm=Math.log,Um=Math.LN2;function Rm(t){return t>>>=0,t===0?32:31-(Dm(t)/Um|0)|0}var xn=256,pn=262144,Sn=4194304;function ua(t){var l=t&42;if(l!==0)return l;switch(t&-t){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:return t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Tn(t,l,e){var a=t.pendingLanes;if(a===0)return 0;var u=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=a&134217727;return c!==0?(a=c&~n,a!==0?u=ua(a):(i&=c,i!==0?u=ua(i):e||(e=c&~t,e!==0&&(u=ua(e))))):(c=a&~n,c!==0?u=ua(c):i!==0?u=ua(i):e||(e=a&~t,e!==0&&(u=ua(e)))),u===0?0:l!==0&&l!==u&&(l&n)===0&&(n=u&-u,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:u}function xu(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function Vs(t,l){(l&8)!==0&&(l|=l&32);var e=t.entangledLanes;if(e!==0)for(t=t.entanglements,e&=l;0e;e++)l.push(t);return l}function pu(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function qm(t,l,e,a,u,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,s=t.expirationTimes,v=t.hiddenUpdates;for(e=i&~e;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(he)try{var Eu={};Object.defineProperty(Eu,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Eu,Eu),window.removeEventListener("test",Eu,Eu)}catch{rc=!1}var De=null,oc=null,An=null;function mr(){if(An)return An;var t,l=oc,e=l.length,a,u="value"in De?De.value:De.textContent,n=u.length;for(t=0;t=Ou),xr=" ",pr=!1;function Sr(t,l){switch(t){case"keyup":return b1.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tr(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qa=!1;function p1(t,l){switch(t){case"compositionend":return Tr(l);case"keypress":return l.which!==32?null:(pr=!0,xr);case"textInput":return t=l.data,t===xr&&pr?null:t;default:return null}}function S1(t,l){if(qa)return t==="compositionend"||!vc&&Sr(t,l)?(t=mr(),An=oc=De=null,qa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Mr(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Cr(t,l){var e=Mr(t);t=0;for(var a;e;){if(e.nodeType===3){if(a=t+e.textContent.length,t<=l&&a>=l)return{node:e,offset:l-t};t=a}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Mr(e)}}function Dr(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?Dr(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function Ur(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=xc(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=xc(t.document)}return l}function pc(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var j1=he&&"documentMode"in document&&11>=document.documentMode,Ba=null,Sc=null,Cu=null,Tc=!1;function Rr(t,l,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Tc||Ba==null||Ba!==xc(a)||(a=Ba,"selectionStart"in a&&pc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Cu&&Mu(Cu,a)||(Cu=a,a=Ui(Sc,"onSelect"),0>=i,u-=i,ee=1<<32-jl(l)+u|e<et?(ll=W,W=null):ll=W.sibling;var bt=y(h,W,g[et],_);if(bt===null){W===null&&(W=ll);break}t&&W&&bt.alternate===null&&l(h,W),m=n(bt,m,et),ht===null?Q=bt:ht.sibling=bt,ht=bt,W=ll}if(et===g.length)return e(h,W),rt&&xe(h,et),Q;if(W===null){for(;etet?(ll=W,W=null):ll=W.sibling;var aa=y(h,W,bt.value,_);if(aa===null){W===null&&(W=ll);break}t&&W&&aa.alternate===null&&l(h,W),m=n(aa,m,et),ht===null?Q=aa:ht.sibling=aa,ht=aa,W=ll}if(bt.done)return e(h,W),rt&&xe(h,et),Q;if(W===null){for(;!bt.done;et++,bt=g.next())bt=O(h,bt.value,_),bt!==null&&(m=n(bt,m,et),ht===null?Q=bt:ht.sibling=bt,ht=bt);return rt&&xe(h,et),Q}for(W=a(W);!bt.done;et++,bt=g.next())bt=b(W,h,et,bt.value,_),bt!==null&&(t&&(ll=bt.alternate,ll!==null&&W.delete(ll.key===null?et:ll.key)),m=n(bt,m,et),ht===null?Q=bt:ht.sibling=bt,ht=bt);return t&&W.forEach(function(ph){return l(h,ph)}),rt&&xe(h,et),Q}function ft(h,m,g,_){if(typeof g=="object"&&g!==null&&g.type===Zt&&g.key===null&&g.props.ref===void 0&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case _t:t:{for(var Q=g.key;m!==null;){if(m.key===Q){if(Q=g.type,Q===Zt){if(m.tag===7){e(h,m.sibling),_=u(m,g.props.children),Ye(_,g),_.return=h,h=_;break t}}else if(m.elementType===Q||typeof Q=="object"&&Q!==null&&Q.$$typeof===H&&ga(Q)===m.type){e(h,m.sibling),_=u(m,g.props),Ye(_,g),_.return=h,h=_;break t}e(h,m);break}else l(h,m);m=m.sibling}g.type===Zt?(_=ra(g.props.children,h.mode,_,g.key),Ye(_,g),_.return=h,h=_):(_=Yn(g.type,g.key,g.props,null,h.mode,_),Ye(_,g),_.return=h,h=_)}return i(h);case qt:t:{for(Q=g.key;m!==null;){if(m.key===Q)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){e(h,m.sibling),_=u(m,g.children||[]),_.return=h,h=_;break t}else{e(h,m);break}else l(h,m);m=m.sibling}_=jc(g,h.mode,_),_.return=h,h=_}return i(h);case H:return g=ga(g),ft(h,m,g,_)}if(j(g))return D(h,m,g,_);if(G(g)){if(Q=G(g),typeof Q!="function")throw Error(d(150));return g=Q.call(g),L(h,m,g,_)}if(typeof g.then=="function")return ft(h,m,kn(g),_);if(g.$$typeof===Qt)return ft(h,m,Zn(h,g),_);$n(h,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,m!==null&&m.tag===6?(e(h,m.sibling),_=u(m,g),_.return=h,h=_):(e(h,m),_=Ac(g,h.mode,_),_.return=h,h=_),i(h)):e(h,m)}return function(h,m,g,_){try{Bu=0;var Q=ft(h,m,g,_);return Ka=null,Q}catch(W){if(W===La||W===Kn)throw W;var ht=Tl(29,W,null,h.mode);return ht.lanes=_,ht.return=h,ht}finally{}}}var xa=uo(!0),no=uo(!1),we=!1;function wc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gc(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ge(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qe(t,l,e){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Et&2)!==0){var u=a.pending;return u===null?l.next=l:(l.next=u.next,u.next=l),a.pending=l,l=Bn(t),Xr(t,null,e),l}return qn(t,a,l,e),Bn(t)}function Yu(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,Ks(t,e)}}function Qc(t,l){var e=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var u=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?u=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?u=n=l:n=n.next=l}else u=n=l;e={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:a.shared,callbacks:a.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var Xc=!1;function wu(){if(Xc){var t=Za;if(t!==null)throw t}}function Gu(t,l,e,a){Xc=!1;var u=t.updateQueue;we=!1;var n=u.firstBaseUpdate,i=u.lastBaseUpdate,c=u.shared.pending;if(c!==null){u.shared.pending=null;var s=c,v=s.next;s.next=null,i===null?n=v:i.next=v,i=s;var S=t.alternate;S!==null&&(S=S.updateQueue,c=S.lastBaseUpdate,c!==i&&(c===null?S.firstBaseUpdate=v:c.next=v,S.lastBaseUpdate=s))}if(n!==null){var O=u.baseState;i=0,S=v=s=null,c=n;do{var y=c.lane&-536870913,b=y!==c.lane;if(b?(yt&y)===y:(a&y)===y){y!==0&&y===ha&&(Xc=!0),S!==null&&(S=S.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});t:{var D=t,L=c;y=l;var ft=e;switch(L.tag){case 1:if(D=L.payload,typeof D=="function"){O=D.call(ft,O,y);break t}O=D;break t;case 3:D.flags=D.flags&-65537|128;case 0:if(D=L.payload,y=typeof D=="function"?D.call(ft,O,y):D,y==null)break t;O=K({},O,y);break t;case 2:we=!0}}y=c.callback,y!==null&&(t.flags|=64,b&&(t.flags|=8192),b=u.callbacks,b===null?u.callbacks=[y]:b.push(y))}else b={lane:y,tag:c.tag,payload:c.payload,callback:c.callback,next:null},S===null?(v=S=b,s=O):S=S.next=b,i|=y;if(c=c.next,c===null){if(c=u.shared.pending,c===null)break;b=c,c=b.next,b.next=null,u.lastBaseUpdate=b,u.shared.pending=null}}while(!0);S===null&&(s=O),u.baseState=s,u.firstBaseUpdate=v,u.lastBaseUpdate=S,n===null&&(u.shared.lanes=0),ke|=i,t.lanes=i,t.memoizedState=O}}function io(t,l){if(typeof t!="function")throw Error(d(191,t));t.call(l)}function co(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=p.T,c={};c.types=i!==null?i.types:null,p.T=c,sf(t,!1,l,e);try{var s=u(),v=p.S;if(v!==null&&v(c,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var S=G1(s,a);Zu(t,l,S,ql(t))}else Zu(t,l,a,ql(t))}catch(O){Zu(t,l,{then:function(){},status:"rejected",reason:O},ql())}finally{A.p=n,i!==null&&c.types!==null&&(i.types=c.types),p.T=i}}function K1(){}function cf(t,l,e,a){if(t.tag!==5)throw Error(d(476));var u=Go(t).queue;wo(t,u,l,lt,e===null?K1:function(){return Qo(t),e(a)})}function Go(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:lt,baseState:lt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ne,lastRenderedState:lt},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ne,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function Qo(t){var l=Go(t);l.next===null&&(l=t.alternate.memoizedState),Zu(t,l.next.queue,{},ql())}function ff(){return sl(yu)}function Xo(){return Wt().memoizedState}function Vo(){return Wt().memoizedState}function J1(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=ql();t=Ge(e);var a=Qe(l,t,e);a!==null&&(_l(a,l,e),Yu(a,l,e)),l={cache:Hc()},t.payload=l;return}l=l.return}}function k1(t,l,e){var a=ql();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},ni(t)?Lo(l,e):(e=_c(t,l,e,a),e!==null&&(_l(e,t,a),Ko(e,l,a)))}function Zo(t,l,e){var a=ql();Zu(t,l,e,a)}function Zu(t,l,e,a){var u={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(ni(t))Lo(l,u);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,c=n(i,e);if(u.hasEagerState=!0,u.eagerState=c,Cl(c,i))return qn(t,l,u,0),Ht===null&&Hn(),!1}catch{}finally{}if(e=_c(t,l,u,a),e!==null)return _l(e,t,a),Ko(e,l,a),!0}return!1}function sf(t,l,e,a){if(a={lane:2,revertLane:Pf(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ni(t)){if(l)throw Error(d(479))}else l=_c(t,e,a,2),l!==null&&_l(l,t,2)}function ni(t){var l=t.alternate;return t===ct||l!==null&&l===ct}function Lo(t,l){Ja=In=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function Ko(t,l,e){if((e&4194048)!==0){var a=l.lanes;a&=t.pendingLanes,e|=a,l.lanes=e,Ks(t,e)}}var ii={readContext:sl,use:li,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt,useEffectEvent:kt},Jo={readContext:sl,use:li,useCallback:function(t,l){return bl().memoizedState=[t,l===void 0?null:l],t},useContext:sl,useEffect:Mo,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,ai(4194308,4,Ro.bind(null,l,t),e)},useLayoutEffect:function(t,l){return ai(4194308,4,t,l)},useInsertionEffect:function(t,l){ai(4,2,t,l)},useMemo:function(t,l){var e=bl();l=l===void 0?null:l;var a=t();if(pa){Ce(!0);try{t()}finally{Ce(!1)}}return e.memoizedState=[a,l],a},useReducer:function(t,l,e){var a=bl();if(e!==void 0){var u=e(l);if(pa){Ce(!0);try{e(l)}finally{Ce(!1)}}}else u=l;return a.memoizedState=a.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},a.queue=t,t=t.dispatch=k1.bind(null,ct,t),[a.memoizedState,t]},useRef:function(t){var l=bl();return t={current:t},l.memoizedState=t},useState:function(t){t=lf(t);var l=t.queue,e=Zo.bind(null,ct,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:uf,useDeferredValue:function(t,l){var e=bl();return nf(e,t,l)},useTransition:function(){var t=lf(!1);return t=wo.bind(null,ct,t.queue,!0,!1),bl().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var a=ct,u=bl();if(rt){if(e===void 0)throw Error(d(407));e=e()}else{if(e=l(),Ht===null)throw Error(d(349));(yt&127)!==0||yo(a,l,e)}u.memoizedState=e;var n={value:e,getSnapshot:l};return u.queue=n,Mo(vo.bind(null,a,n,t),[t]),a.flags|=2048,$a(9,{destroy:void 0},ho.bind(null,a,n,e,l),null),e},useId:function(){var t=bl(),l=Ht.identifierPrefix;if(rt){var e=ae,a=ee;e=(a&~(1<<32-jl(a)-1)).toString(32)+e,l="_"+l+"R_"+e,e=Pn++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?n.multiple=!0:a.size&&(n.size=a.size);break;default:n=typeof a.is=="string"?i.createElement(u,{is:a.is}):i.createElement(u)}}n[fl]=l,n[Sl]=a;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(ml(n,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&ze(l)}}return Gt(l),l.subtreeFlags&=-33554433,Tf(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==a&&ze(l);else{if(typeof a!="string"&&l.stateNode===null)throw Error(d(166));if(t=je.current,Va(l)){if(t=l.stateNode,e=l.memoizedProps,a=null,u=nl,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}t[fl]=l,t=!!(t.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||v0(t.nodeValue,e)),t||qe(l,!0)}else t=an(t).createTextNode(a),t[fl]=l,l.stateNode=t}return Gt(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(a=Va(l),e!==null){if(t===null){if(!a)throw Error(d(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(d(557));t[fl]=l}else oa(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gt(l),t=!1}else e=Dc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(Dl(l),l):(Dl(l),null);if((l.flags&128)!==0)throw Error(d(558))}return Gt(l),null;case 13:if(a=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=Va(l),a!==null&&a.dehydrated!==null){if(t===null){if(!u)throw Error(d(318));if(u=l.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(d(317));u[fl]=l}else oa(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gt(l),u=!1}else u=Dc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return l.flags&256?(Dl(l),l):(Dl(l),null)}return Dl(l),(l.flags&128)!==0?(l.lanes=e,l):(e=a!==null,t=t!==null&&t.memoizedState!==null,e&&(a=l.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==u&&(a.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),di(l,l.updateQueue),Gt(l),null);case 4:return Oa(),t===null&&as(l.stateNode.containerInfo),l.flags|=67108864,Gt(l),null;case 10:return Se(l.type),Gt(l),null;case 19:if(Kc(l),a=l.memoizedState,a===null)return Gt(l),null;if(u=(l.flags&128)!==0,n=a.rendering,n===null)if(u)Ku(a,!1);else{if($t!==0||t!==null&&(t.flags&128)!==0)for(t=l.child;t!==null;){if(n=Wn(t),n!==null){for(l.flags|=128,Ku(a,!1),t=n.updateQueue,l.updateQueue=t,di(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)Vr(e,t),e=e.sibling;return Qu(l,ol.current&1|2),rt&&xe(l,a.treeForkCount),l.child}t=t.sibling}a.tail!==null&&Ol()>Ei&&(l.flags|=128,u=!0,Ku(a,!1),l.lanes=4194304)}else{if(!u)if(t=Wn(n),t!==null){if(l.flags|=128,u=!0,t=t.updateQueue,l.updateQueue=t,di(l,t),Ku(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!n.alternate&&!rt)return Gt(l),null}else 2*Ol()-a.renderingStartTime>Ei&&e!==536870912&&(l.flags|=128,u=!0,Ku(a,!1),l.lanes=4194304);a.isBackwards?(n.sibling=l.child,l.child=n):(t=a.last,t!==null?t.sibling=n:l.child=n,a.last=n)}if(a.tail!==null){t=a.tail;t:{for(e=t;e!==null;){if(e.alternate!==null){e=!1;break t}e=e.sibling}e=!0}return a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ol(),t.sibling=null,n=ol.current,n=u?n&1|2:n&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!e||rt?Qu(l,n):(e=n,Nt(rl,l),Nt(ol,e),hl===null&&(hl=l)),rt&&xe(l,a.treeForkCount),t}return Gt(l),null;case 22:case 23:return Dl(l),Zc(),a=l.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(l.flags|=8192):a&&(l.flags|=8192),a?(e&536870912)!==0&&(l.flags&128)===0&&(Gt(l),l.subtreeFlags&6&&(l.flags|=8192)):Gt(l),e=l.updateQueue,e!==null&&di(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==e&&(l.flags|=2048),t!==null&&Rt(va),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),Se(It),Gt(l),null;case 25:return null;case 30:return l.flags|=33554432,Gt(l),null}throw Error(d(156,l.tag))}function ly(t,l){switch(Mc(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return Se(It),Oa(),t=l.flags,(t&65536)!==0&&(t&128)===0?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return gn(l),null;case 31:if(l.memoizedState!==null){if(Dl(l),l.alternate===null)throw Error(d(340));oa()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(Dl(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(d(340));oa()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return Kc(l),t=l.flags,t&65536?(l.flags=t&-65537|128,t=l.memoizedState,t!==null&&(t.rendering=null,t.tail=null),l.flags|=4,l):null;case 4:return Oa(),null;case 10:return Se(l.type),null;case 22:case 23:return Dl(l),Zc(),t!==null&&Rt(va),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return Se(It),null;case 25:return null;default:return null}}function bd(t,l){switch(Mc(l),l.tag){case 3:Se(It),Oa();break;case 26:case 27:case 5:gn(l);break;case 4:Oa();break;case 31:l.memoizedState!==null&&Dl(l);break;case 13:Dl(l);break;case 19:Kc(l);break;case 10:Se(l.type);break;case 22:case 23:Dl(l),Zc(),t!==null&&Rt(va);break;case 24:Se(It)}}function Ju(t,l){try{var e=l.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var u=a.next;e=u;do{if((e.tag&t)===t){a=void 0;var n=e.create,i=e.inst;a=n(),i.destroy=a}e=e.next}while(e!==u)}}catch(c){jt(l,l.return,c)}}function Le(t,l,e){try{var a=l.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var n=u.next;a=n;do{if((a.tag&t)===t){var i=a.inst,c=i.destroy;if(c!==void 0){i.destroy=void 0,u=l;var s=e,v=c;try{v()}catch(S){jt(u,s,S)}}}a=a.next}while(a!==n)}}catch(S){jt(l,l.return,S)}}function xd(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{co(l,e)}catch(a){jt(t,t.return,a)}}}function pd(t,l,e){e.props=Sa(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(a){jt(t,l,a)}}function ue(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:var u=t.stateNode,n=ve(t.memoizedProps,u);(u.ref===null||u.ref.name!==n)&&(u.ref=O0(n)),a=u.ref;break;case 7:if(t.stateNode===null){var i=new Bl(t);T(t.child,!1,Ly,i,void 0,void 0),t.stateNode=i}a=t.stateNode;break;default:a=t.stateNode}typeof e=="function"?t.refCleanup=e(a):e.current=a}}catch(c){jt(t,l,c)}}function dl(t,l){var e=t.ref,a=t.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(u){jt(t,l,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(u){jt(t,l,u)}else e.current=null}function mi(t,l){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&l!==null)for(var e=0;e title"))),ml(a,l,e),a[fl]=t,ul(a),l=a;break t;case"link":if(n=Z0("link","href",u).get(l+(e.href||""))){for(i=0;ift&&(i=ft,ft=L,L=i);var h=Cr(c,L),m=Cr(c,ft);if(h&&m&&(b.rangeCount!==1||b.anchorNode!==h.node||b.anchorOffset!==h.offset||b.focusNode!==m.node||b.focusOffset!==m.offset)){var g=O.createRange();g.setStart(h.node,h.offset),b.removeAllRanges(),L>ft?(b.addRange(g),b.extend(m.node,m.offset)):(g.setEnd(m.node,m.offset),b.addRange(g))}}}}for(O=[],b=c;b=b.parentNode;)b.nodeType===1&&O.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;ce?32:e,p.T=null,e=Vf,Vf=null;var n=Wl,i=re;if(Lt=0,za=Wl=null,re=0,(Et&6)!==0)throw Error(d(331));var c=Et;if(Et|=4,Vd(n.current),Gd(n,n.current,i,e),Et=c,tn(0,!1),Al&&typeof Al.onPostCommitFiberRoot=="function")try{Al.onPostCommitFiberRoot(bu,n)}catch{}return!0}finally{A.p=u,p.T=a,u0(t,l)}}function n0(t,l,e){l=Gl(e,l),l=df(t.stateNode,l,2),t=Qe(t,l,2),t!==null&&(pu(t,2),oe(t))}function jt(t,l,e){if(t.tag===3)n0(t,t,e);else for(;l!==null;){if(l.tag===3){n0(l,t,e);break}else if(l.tag===1){var a=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&($e===null||!$e.has(a))){t=Gl(e,t),e=ld(2),a=Qe(l,e,2),a!==null&&(ed(e,a,l,t),pu(a,2),oe(a));break}}l=l.return}}function Ff(t,l,e){var a=t.pingCache;if(a===null){a=t.pingCache=new ny;var u=new Set;a.set(l,u)}else u=a.get(l),u===void 0&&(u=new Set,a.set(l,u));u.has(e)||(Gf=!0,u.add(e),t=my.bind(null,t,l,e),l.then(t,t))}function my(t,l,e){var a=t.pingCache;a!==null&&a.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,Ht===t&&(yt&e)===e&&(($t===4||$t===3&&(yt&62914560)===yt&&300>Ol()-Ni)&&(Et&2)===0?iu(t,0):Ti|=e,lu===yt&&(lu=0)),oe(t)}function i0(t,l){l===0&&(l=Zs()),t=sa(t,l),t!==null&&(pu(t,l),oe(t))}function yy(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),i0(t,e)}function hy(t,l){var e=0;switch(t.tag){case 31:case 13:var a=t.stateNode,u=t.memoizedState;u!==null&&(e=u.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(d(314))}a!==null&&a.delete(l),i0(t,e)}function vy(t,l){return Ii(t,l)}var fu=null,su=null,Wf=!1,Ci=!1,If=!1,We=0;function oe(t){t!==su&&t.next===null&&(su===null?fu=su=t:su=su.next=t),Ci=!0,Wf||(Wf=!0,by())}function tn(t,l){if(!If&&Ci){If=!0;do for(var e=!1,a=fu;a!==null;){if(t!==0){var u=a.pendingLanes;if(u===0)var n=0;else{var i=a.suspendedLanes,c=a.pingedLanes;n=(1<<31-jl(42|t)+1)-1,n&=u&~(i&~c),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,r0(a,n))}else n=yt,n=Tn(a,a===Ht?n:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(n&3)===0||xu(a,n)||(e=!0,r0(a,n));a=a.next}while(e);If=!1}}function gy(){c0()}function c0(){Ci=Wf=!1;var t=0;We!==0&&jy()&&(t=We);for(var l=Ol(),e=null,a=fu;a!==null;){var u=a.next,n=f0(a,l);n===0?(a.next=null,e===null?fu=u:e.next=u,u===null&&(su=e)):(e=a,(t!==0||(n&3)!==0)&&(Ci=!0)),a=u}Lt!==0&&Lt!==5||tn(t),We!==0&&(We=0)}function f0(t,l){for(var e=t.suspendedLanes,a=t.pingedLanes,u=t.expirationTimes,n=t.pendingLanes&-62914561;0c)break;var S=s.transferSize,O=s.initiatorType;S&&g0(O)&&(s=s.responseEnd,i+=S*(sqi){L.length=D;break}g=new Promise(Hy.bind(g)),L.push(g)}}}if(0"u"?null:document;function G0(t,l,e){var a=ou;if(a&&typeof l=="string"&&l){var u=Yl(l);u='link[rel="'+t+'"][href="'+u+'"]',typeof e=="string"&&(u+='[crossorigin="'+e+'"]'),w0.has(u)||(w0.add(u),t={rel:t,crossOrigin:e,href:l},a.querySelector(u)===null&&(l=a.createElement("link"),ml(l,"link",t),ul(l),a.head.appendChild(l)))}}function th(t){Oe.D(t),G0("dns-prefetch",t,null)}function lh(t,l){Oe.C(t,l),G0("preconnect",t,l)}function eh(t,l,e){Oe.L(t,l,e);var a=ou;if(a&&t&&l){var u='link[rel="preload"][as="'+Yl(l)+'"]';l==="image"&&e&&e.imageSrcSet?(u+='[imagesrcset="'+Yl(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(u+='[imagesizes="'+Yl(e.imageSizes)+'"]')):u+='[href="'+Yl(t)+'"]';var n=u;switch(l){case"style":n=du(t);break;case"script":n=mu(t)}if(!(Kl.has(n)||(t=K({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),Kl.set(n,t),a.querySelector(u)!==null||l==="style"&&a.querySelector(nn(n))||l==="script"&&a.querySelector(cn(n))))){var i=a.createElement("link");ml(i,"link",t),l==="style"&&(i[Nn]=!0,i.onload=i.onerror=function(){Is(i)}),ul(i),a.head.appendChild(i)}}}function ah(t,l){Oe.m(t,l);var e=ou;if(e&&t){var a=l&&typeof l.as=="string"?l.as:"script",u='link[rel="modulepreload"][as="'+Yl(a)+'"][href="'+Yl(t)+'"]',n=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=mu(t)}if(!Kl.has(n)&&(t=K({rel:"modulepreload",href:t},l),Kl.set(n,t),e.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(cn(n)))return}a=e.createElement("link"),ml(a,"link",t),ul(a),e.head.appendChild(a)}}}function uh(t,l,e){Oe.S(t,l,e);var a=ou;if(a&&t){var u=Ma(a).hoistableStyles,n=du(t);l=l||"default";var i=u.get(n);if(!i){var c={loading:0,preload:null};if(i=a.querySelector(nn(n)))c.loading=5;else{t=K({rel:"stylesheet",href:t,"data-precedence":l},e),(e=Kl.get(n))&&xs(t,e);var s=i=a.createElement("link");ul(s),ml(s,"link",t),s._p=new Promise(function(v,S){s.onload=v,s.onerror=S}),s.addEventListener("load",function(){c.loading|=1}),s.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Ri(i,l,a)}i={type:"stylesheet",instance:i,count:1,state:c},u.set(n,i)}}}function nh(t,l){Oe.X(t,l);var e=ou;if(e&&t){var a=Ma(e).hoistableScripts,u=mu(t),n=a.get(u);n||(n=e.querySelector(cn(u)),n||(t=K({src:t,async:!0},l),(l=Kl.get(u))&&ps(t,l),n=e.createElement("script"),ul(n),ml(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},a.set(u,n))}}function ih(t,l){Oe.M(t,l);var e=ou;if(e&&t){var a=Ma(e).hoistableScripts,u=mu(t),n=a.get(u);n||(n=e.querySelector(cn(u)),n||(t=K({src:t,async:!0,type:"module"},l),(l=Kl.get(u))&&ps(t,l),n=e.createElement("script"),ul(n),ml(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},a.set(u,n))}}function Q0(t,l,e,a){var u=(u=je.current)?un(u):null;if(!u)throw Error(d(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(e=du(e.href),l=Ma(u).hoistableStyles,a=l.get(e),a||(a={type:"style",instance:null,count:0,state:null},l.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=du(e.href);var n=Ma(u).hoistableStyles,i=n.get(t);if(i||(u=u.ownerDocument||u,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=u.querySelector(nn(t)))?n._p||(i.instance=n,i.state.loading=5):(n=Kl.get(t),n||(n={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},Kl.set(t,n)),ch(u,t,n,i.state))),l&&a===null)throw Error(d(528,""));return i}if(l&&a!==null)throw Error(d(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(e=mu(e),l=Ma(u).hoistableScripts,a=l.get(e),a||(a={type:"script",instance:null,count:0,state:null},l.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,t))}}function du(t){return'href="'+Yl(t)+'"'}function nn(t){return'link[rel="stylesheet"]['+t+"]"}function X0(t){return K({},t,{"data-precedence":t.precedence,precedence:null})}function ch(t,l,e,a){if(l=t.querySelector('link[rel="preload"][as="style"]['+l+"]")){if(l[Nn]!==!0){a.loading=1;return}}else l=t.createElement("link"),l[Nn]=!0,l.onload=l.onerror=Is.bind(null,l),ml(l,"link",e),ul(l),t.head.appendChild(l);a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2})}function mu(t){return'[src="'+Yl(t)+'"]'}function cn(t){return"script[async]"+t}function V0(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var a=t.querySelector('style[data-href~="'+Yl(e.href)+'"]');if(a)return l.instance=a,ul(a),a;var u=K({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),ul(a),ml(a,"style",u),Ri(a,e.precedence,t),l.instance=a;case"stylesheet":u=du(e.href);var n=t.querySelector(nn(u));if(n)return l.state.loading|=4,l.instance=n,ul(n),n;a=X0(e),(u=Kl.get(u))&&xs(a,u),n=(t.ownerDocument||t).createElement("link"),ul(n);var i=n;return i._p=new Promise(function(c,s){i.onload=c,i.onerror=s}),ml(n,"link",a),l.state.loading|=4,Ri(n,e.precedence,t),l.instance=n;case"script":return n=mu(e.src),(u=t.querySelector(cn(n)))?(l.instance=u,ul(u),u):(a=e,(u=Kl.get(n))&&(a=K({},e),ps(a,u)),t=t.ownerDocument||t,u=t.createElement("script"),ul(u),ml(u,"link",a),t.head.appendChild(u),l.instance=u);case"void":return null;default:throw Error(d(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,Ri(a,e.precedence,t));return l.instance}function Ri(t,l,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,n=u,i=0;i title"):null)}function fh(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function L0(t,l){return t==="img"&&l.src!=null&&l.src!==""&&l.onLoad==null&&l.loading!=="lazy"}function K0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function J0(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function k0(t,l){typeof l.decode=="function"&&(t.imgCount++,l.complete||(t.imgBytes+=J0(l),t.suspenseyImages.push(l)),t=oh.bind(t),l.decode().then(t,t))}function sh(t,l,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var u=du(a.href),n=l.querySelector(nn(u));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=fn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,ul(n);return}n=l.ownerDocument||l,a=X0(a),(u=Kl.get(u))&&xs(a,u),n=n.createElement("link"),ul(n);var i=n;i._p=new Promise(function(c,s){i.onload=c,i.onerror=s}),ml(n,"link",a),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&(e.state.loading&3)===0&&(t.count++,e=fn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var qi=0;function rh(t,l){return t.stylesheets&&t.count===0&&Yi(t,t.stylesheets),0qi?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function $0(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)Yi(t,t.stylesheets);else if(t.unsuspend){var l=t.unsuspend;t.unsuspend=null,l()}}}function fn(){this.count--,$0(this)}function oh(){this.imgCount--,$0(this)}var Bi=null;function Yi(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bi=new Map,l.forEach(dh,t),Bi=null,fn.call(t))}function dh(t,l){if(!(l.state.loading&4)){var e=Bi.get(t);if(e)var a=e.get(null);else{e=new Map,Bi.set(t,e);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(E){console.error(E)}}return r(),Ms.exports=Mh(),Ms.exports}var Dh=Ch();/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Uh=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pm=(...r)=>r.filter((E,z,d)=>!!E&&E.trim()!==""&&d.indexOf(E)===z).join(" ").trim();/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Rh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hh=X.forwardRef(({color:r="currentColor",size:E=24,strokeWidth:z=2,absoluteStrokeWidth:d,className:C="",children:B,iconNode:M,...ut},tt)=>X.createElement("svg",{ref:tt,...Rh,width:E,height:E,stroke:r,strokeWidth:d?Number(z)*24/Number(E):z,className:pm("lucide",C),...ut},[...M.map(([V,R])=>X.createElement(V,R)),...Array.isArray(B)?B:[B]]));/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zt=(r,E)=>{const z=X.forwardRef(({className:d,...C},B)=>X.createElement(Hh,{ref:B,iconNode:E,className:pm(`lucide-${Uh(r)}`,d),...C}));return z.displayName=`${r}`,z};/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qh=zt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bh=zt("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yh=zt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wh=zt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gh=zt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qh=zt("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xh=zt("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vh=zt("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zh=zt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lh=zt("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kh=zt("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jh=zt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kh=zt("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $h=zt("ListVideo",[["path",{d:"M12 12H3",key:"18klou"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M12 18H3",key:"11ftsu"}],["path",{d:"m16 12 5 3-5 3v-6Z",key:"zpskkp"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fh=zt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wh=zt("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ih=zt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sm=zt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bs=zt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ph=zt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tv=zt("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lv=zt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ev=zt("ServerCog",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m15.7 13.4-.9-.3",key:"1jwmzr"}],["path",{d:"m9.2 10.9-.9-.3",key:"qapnim"}],["path",{d:"m10.6 15.7.3-.9",key:"quwk0k"}],["path",{d:"m13.6 15.7-.4-1",key:"cb9xp7"}],["path",{d:"m10.8 9.3-.4-1",key:"1uaiz5"}],["path",{d:"m8.3 13.6 1-.4",key:"s6srou"}],["path",{d:"m14.7 10.8 1-.4",key:"4d31cq"}],["path",{d:"m13.4 8.3-.3.9",key:"1bm987"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const av=zt("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uv=zt("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nv=zt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iv=zt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tm=zt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cv=zt("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fv=zt("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sv=zt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Nm(r){var E,z,d="";if(typeof r=="string"||typeof r=="number")d+=r;else if(typeof r=="object")if(Array.isArray(r)){var C=r.length;for(E=0;Erv(r),Pl="w-full rounded-lg border border-line bg-white px-3 py-2 text-[13px] text-slate-900 placeholder:text-slate-400 transition focus:border-brand-500 focus:outline-none focus:ring-3 focus:ring-brand-500/15 disabled:cursor-not-allowed disabled:bg-slate-50";function xm(r){if(!r)return"—";const E=Math.floor((Date.now()-r)/6e4);return E<1?"刚刚":E<60?`${E} 分钟前`:`${Math.floor(E/60)} 小时前`}function Rs(r=[]){return{total:r.length,studyable:r.filter(E=>E.in_study!==!1).length}}function yn(r){return String(r||"").split("#").filter(Boolean)}const ov={"01":"单选","02":"多选","03":"判断","04":"问答"};function de(r){return r instanceof Error?r.message:String(r)}const dv={neutral:"bg-slate-100 text-slate-600 ring-slate-200",brand:"bg-brand-50 text-brand-700 ring-brand-100",success:"bg-emerald-50 text-emerald-700 ring-emerald-100",warning:"bg-amber-50 text-amber-700 ring-amber-100",danger:"bg-red-50 text-red-700 ring-red-100",running:"bg-sky-50 text-sky-700 ring-sky-100"};function Hs({tone:r="neutral",children:E,dot:z=!1,className:d}){return f.jsxs("span",{className:vl("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium ring-1 ring-inset",dv[r],d),children:[z&&f.jsx("span",{className:"size-1.5 rounded-full bg-current opacity-70"}),E]})}const mv={primary:"border-brand-500 bg-brand-500 text-white shadow-sm shadow-brand-500/25 hover:border-brand-600 hover:bg-brand-600",secondary:"border-line bg-white text-slate-700 hover:border-slate-300 hover:bg-slate-50",ghost:"border-transparent bg-transparent text-slate-600 hover:bg-slate-100",danger:"border-transparent bg-transparent text-red-600 hover:bg-red-50",soft:"border-brand-100 bg-brand-50 text-brand-700 hover:border-brand-200 hover:bg-brand-100"},yv={sm:"h-8 gap-1.5 rounded-lg px-2.5 text-xs",md:"h-9 gap-1.5 rounded-lg px-3.5 text-[13px]",icon:"h-9 w-9 rounded-lg"};function Kt({variant:r="secondary",size:E="md",loading:z=!1,icon:d,className:C,children:B,disabled:M,type:ut="button",...tt}){return f.jsxs("button",{type:ut,disabled:M||z,className:vl("inline-flex shrink-0 items-center justify-center border font-medium transition","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-brand-500/20","disabled:cursor-not-allowed disabled:opacity-50",mv[r],yv[E],C),...tt,children:[z?f.jsx(Fh,{className:"size-3.5 animate-spin"}):d,B]})}function hv(r,E){var B,M;const z=E==="login"||r.status==="logging"||((B=r.run)==null?void 0:B.status)==="logging"?"logging":((M=r.run)==null?void 0:M.status)||r.status||"idle",C={discovering:{label:"发现课程中",tone:"running",pulse:!0},studying:{label:"学习中",tone:"running",pulse:!0},finished:{label:"已完成",tone:"success"},stopped:{label:"已停止",tone:"warning"},error:{label:"出错",tone:"danger"},interrupted:{label:"已中断",tone:"warning"},logging:{label:"登录中",tone:"running",pulse:!0},logged_in:{label:"已登录",tone:"success"},login_failed:{label:"登录失败",tone:"danger"},idle:{label:"未登录",tone:"neutral"}}[z]||{label:z,tone:"neutral"};return{label:C.label,tone:C.tone,pulse:!!C.pulse}}function vv({account:r,course:E,disabled:z,onToggle:d}){var B;const C=(B=r.selected)==null?void 0:B.includes(E.plan_id);return f.jsxs("label",{className:vl("flex cursor-pointer items-start gap-2.5 rounded-lg border border-transparent px-2 py-1.5 transition","hover:border-line hover:bg-slate-50",z&&"pointer-events-none opacity-60"),children:[f.jsx("input",{type:"checkbox",className:"mt-0.5 size-3.5 shrink-0 accent-brand-500",checked:!!C,disabled:z,onChange:M=>d(E.plan_id,M.target.checked)}),f.jsxs("span",{className:"min-w-0 flex-1",children:[f.jsx("span",{className:"block truncate text-[12.5px] font-medium text-slate-700",children:E.name||E.plan_id}),f.jsx("span",{className:"mt-0.5 block truncate text-[11px] text-slate-400",children:[E.section,E.status_label,E.info].filter(Boolean).join(" · ")||"—"})]}),f.jsx("span",{className:"shrink-0 pt-0.5 text-[11px] tabular-nums text-slate-500",children:E.progress||""})]})}function gv({account:r,platformLabel:E,pending:z,openLog:d,logLines:C,onToggleLog:B,onLogin:M,onRefresh:ut,onStudy:tt,onStop:V,onCapture:R,onStopCapture:T,onQuiz:Z,onDelete:$,onToggleCourse:it,onSelectAll:Ut,onClearSelection:Y,onToggleOption:vt}){var gt,H,at,st,Bt,o,N,w,G,ot,x,j,p,A,lt,P;const[pt,Ct]=X.useState(!1),Ft=X.useRef(null),St=X.useRef(null),J=X.useRef(!0);X.useEffect(()=>{if(!pt)return;const q=Yt=>{var Rt;(Rt=Ft.current)!=null&&Rt.contains(Yt.target)||Ct(!1)};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[pt]),X.useEffect(()=>{const q=St.current;q&&J.current&&(q.scrollTop=q.scrollHeight)},[C,d]);const K=hv(r,z),k=!!z||r.status==="logging"||((gt=r.run)==null?void 0:gt.status)==="logging",_t=r.courses||[],qt=_t.filter(q=>q.in_study!==!1),Zt=_t.filter(q=>q.in_study===!1),Tt=Rs(_t),Jt=((H=r.run)==null?void 0:H.done)||0,al=((at=r.run)==null?void 0:at.total)||0,Qt=al?Math.round(Jt/al*100):0,U=["discovering","studying"].includes(((st=r.run)==null?void 0:st.status)||""),F=((Bt=r.selected)==null?void 0:Bt.length)||0,I=F>0&&(((o=r.cookies)==null?void 0:o.length)||0)>0;return f.jsxs("article",{"data-id":r.id,className:"card-shadow flex min-w-0 flex-col rounded-2xl border border-line bg-white transition-colors hover:border-slate-300/80",children:[f.jsxs("header",{className:"flex items-start gap-3 px-4 pt-4",children:[f.jsxs("div",{className:"relative mt-0.5 grid size-10 shrink-0 place-items-center rounded-xl bg-gradient-to-br from-brand-50 to-sky-50 text-[13px] font-semibold text-brand-700 ring-1 ring-brand-100",children:[(r.user||r.username||"?").slice(0,1).toUpperCase(),f.jsx("span",{className:vl("absolute -bottom-0.5 -right-0.5 size-3 rounded-full border-2 border-white",K.tone==="success"?"bg-emerald-500":K.tone==="danger"?"bg-red-500":K.tone==="running"?"bg-sky-500":K.tone==="warning"?"bg-amber-500":"bg-slate-300",K.pulse&&"animate-pulse")})]}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h2",{className:"truncate text-[13.5px] font-semibold text-slate-900",children:r.user||r.username}),f.jsx(Hs,{tone:K.tone,dot:!0,children:K.label})]}),f.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] text-slate-400",children:[f.jsx("span",{className:"truncate",children:r.username}),r.note&&f.jsxs("span",{className:"truncate",children:["· ",r.note]}),f.jsxs("span",{children:["· ",xm(r.updated||r.loginAt)]})]})]}),f.jsx(Hs,{tone:"brand",className:"mt-0.5 shrink-0",children:E})]}),f.jsxs("div",{className:"px-4 pt-3",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"text-[11.5px] text-slate-500",children:["共 ",f.jsx("b",{className:"font-semibold text-slate-700",children:Tt.total})," 门 · 可学"," ",f.jsx("b",{className:"font-semibold text-slate-700",children:Tt.studyable}),Zt.length>0&&f.jsxs("span",{className:"text-slate-400",children:[" · 已完成 ",Zt.length]})]}),qt.length>0&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",disabled:k,className:"rounded px-1.5 py-0.5 text-[11px] text-brand-600 transition hover:bg-brand-50 disabled:opacity-40",onClick:Ut,children:"全选"}),f.jsx("button",{type:"button",disabled:k||F===0,className:"rounded px-1.5 py-0.5 text-[11px] text-slate-500 transition hover:bg-slate-100 disabled:opacity-40",onClick:Y,children:"清空"})]})]}),f.jsx("div",{className:"scrollbar-thin mt-1.5 max-h-[196px] min-h-[70px] overflow-y-auto pr-0.5",children:_t.length===0?f.jsx("div",{className:"grid min-h-[70px] place-items-center rounded-lg border border-dashed border-line text-[12px] text-slate-400",children:"还没有课程,先登录或刷新课程"}):f.jsxs(f.Fragment,{children:[qt.map(q=>f.jsx(vv,{account:r,course:q,disabled:k,onToggle:it},q.plan_id)),Zt.length>0&&f.jsx("div",{className:"mt-1 border-t border-dashed border-line pt-1",children:Zt.map(q=>f.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg px-2 py-1.5 text-slate-400",children:[f.jsx("span",{className:"mt-0.5 grid size-3.5 shrink-0 place-items-center rounded-full bg-emerald-50 text-[9px] text-emerald-600",children:"✓"}),f.jsxs("span",{className:"min-w-0 flex-1",children:[f.jsx("span",{className:"block truncate text-[12px]",children:q.name||q.plan_id}),f.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] opacity-80",children:[q.section,q.info].filter(Boolean).join(" · ")})]}),f.jsx("span",{className:"shrink-0 text-[10.5px]",children:q.status_label||"已结束"})]},q.plan_id))})]})})]}),f.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5 border-t border-line/70 px-4 py-2.5",children:[f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-[11.5px] text-slate-600",children:[f.jsx("input",{type:"checkbox",className:"size-3.5 accent-brand-500",checked:r.optQuiz===!0,disabled:k,onChange:q=>vt("quiz",q.target.checked)}),"自动交测验"]}),f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-[11.5px] text-slate-600",children:[f.jsx("input",{type:"checkbox",className:"size-3.5 accent-brand-500",checked:r.optFeedback!==!1,disabled:k,onChange:q=>vt("feedback",q.target.checked)}),"自动交反馈表"]}),f.jsx("div",{className:"flex-1"}),f.jsx("span",{className:"text-[11px] tabular-nums text-slate-400",children:F>0?`已选 ${F} 门`:"未选择课程"})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-line/70 px-4 py-2.5",children:[f.jsx(Kt,{size:"sm",variant:"soft",loading:z==="login"||r.status==="logging"||((N=r.run)==null?void 0:N.status)==="logging",disabled:k,icon:f.jsx(Wh,{className:"size-3.5"}),onClick:M,children:(w=r.cookies)!=null&&w.length?"重新登录":"登录"}),f.jsx(Kt,{size:"sm",loading:z==="refresh",disabled:k||!((G=r.cookies)!=null&&G.length),icon:f.jsx(Bs,{className:"size-3.5"}),onClick:ut,children:"刷新课程"}),f.jsx(Kt,{size:"sm",variant:"primary",loading:z==="study",disabled:k||!I,icon:f.jsx(Ih,{className:"size-3.5"}),onClick:tt,children:"开始学习"}),f.jsx("div",{className:"flex-1"}),U&&f.jsx(Kt,{size:"icon",variant:"danger",loading:z==="stop",onClick:V,title:"停止学习","aria-label":"停止学习",children:f.jsx(Qh,{className:"size-4"})}),f.jsxs("div",{className:"relative",ref:Ft,children:[f.jsx(Kt,{size:"icon",variant:"ghost",onClick:()=>Ct(q=>!q),"aria-label":"更多操作",title:"更多操作",children:f.jsx(Zh,{className:"size-4"})}),pt&&f.jsx("div",{className:"absolute bottom-10 right-0 z-20 w-40 overflow-hidden rounded-xl border border-line bg-white py-1 shadow-xl shadow-slate-900/10",children:[{label:"课程日志",icon:$h,action:B},{label:"打开测验",icon:Xh,action:Z},(ot=r.run)!=null&&ot.capturing?{label:"停止抓包",icon:nv,action:T}:{label:"抓包 10 分钟",icon:cv,action:R},{label:"删除账号",icon:iv,action:$,danger:!0}].map(q=>f.jsxs("button",{type:"button",className:vl("flex w-full items-center gap-2 px-3 py-2 text-left text-[12px] transition hover:bg-slate-50",q.danger?"text-red-600":"text-slate-700"),onClick:()=>{Ct(!1),q.action()},children:[f.jsx(q.icon,{className:"size-3.5 opacity-70"}),q.label]},q.label))})]})]}),(al>0||((x=r.run)==null?void 0:x.error))&&f.jsxs("div",{className:"border-t border-line/70 px-4 py-3",children:[f.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2 text-[11px] text-slate-500",children:[f.jsx("span",{className:"truncate",children:((j=r.run)==null?void 0:j.course)||((p=r.run)==null?void 0:p.status)||"学习进度"}),f.jsxs("span",{className:"shrink-0 tabular-nums",children:[Jt," / ",al,al>0&&f.jsxs("span",{className:"ml-1 text-slate-400",children:["(",Qt,"%)"]})]})]}),f.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-slate-100",children:f.jsx("div",{className:vl("h-full rounded-full transition-all duration-500",((A=r.run)==null?void 0:A.status)==="error"?"bg-red-500":((lt=r.run)==null?void 0:lt.status)==="finished"?"bg-emerald-500":"bg-gradient-to-r from-brand-500 to-sky-400"),style:{width:`${Math.min(100,Qt)}%`}})}),((P=r.run)==null?void 0:P.error)&&f.jsx("p",{className:"mt-2 rounded-lg bg-red-50 px-2.5 py-1.5 text-[11px] leading-relaxed text-red-700",children:r.run.error})]}),r.lastError&&f.jsx("div",{className:"border-t border-line/70 px-4 py-2.5",children:f.jsxs("p",{className:"rounded-lg bg-red-50/80 px-2.5 py-1.5 text-[11px] leading-relaxed text-red-700",children:[r.lastError,r.lastErrorAt?f.jsxs("span",{className:"ml-1 text-red-400",children:["· ",xm(r.lastErrorAt)]}):null]})}),f.jsxs("div",{className:vl("border-t border-line/70",d?"block":"hidden"),children:[f.jsxs("div",{className:"flex items-center gap-2 px-4 pt-2.5 text-[11px] text-slate-400",children:[f.jsx("span",{className:"font-medium text-slate-500",children:"课程日志"}),f.jsxs("span",{className:"tabular-nums",children:["(",C.length,")"]}),f.jsx("div",{className:"flex-1"}),f.jsx("button",{type:"button",onClick:B,className:"rounded px-1.5 py-0.5 text-[11px] text-slate-500 transition hover:bg-slate-100",children:"收起"})]}),f.jsx("pre",{ref:St,onScroll:q=>{const Yt=q.currentTarget;J.current=Yt.scrollHeight-Yt.scrollTop-Yt.clientHeight<24},className:vl("scrollbar-thin mx-4 mb-3 mt-2 max-h-56 overflow-auto rounded-lg bg-slate-950/95 p-3","font-mono text-[11px] leading-relaxed text-slate-300",C.length===0&&"text-slate-500"),children:C.length?C.join(` `):"暂无日志 · 开始学习后这里会实时显示"})]}),f.jsxs("button",{type:"button",onClick:B,className:"flex items-center justify-center gap-1 border-t border-line/70 py-1.5 text-[10.5px] text-slate-400 transition hover:bg-slate-50 hover:text-slate-600","aria-expanded":d,children:[f.jsx(Yh,{className:vl("size-3 transition-transform",d&&"rotate-180")}),d?"收起课程日志":"展开课程日志"]})]})}const bv={md:"max-w-xl",lg:"max-w-3xl",xl:"max-w-6xl"};function Ki({open:r,onClose:E,title:z,subtitle:d,size:C="md",footer:B,children:M,bodyClassName:ut}){return X.useEffect(()=>{if(!r)return;const tt=R=>{R.key==="Escape"&&E()};window.addEventListener("keydown",tt);const V=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",tt),document.body.style.overflow=V}},[r,E]),r?f.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[f.jsx("div",{className:"absolute inset-0 bg-slate-900/40 backdrop-blur-[2px]",onClick:E}),f.jsxs("div",{role:"dialog","aria-modal":"true",className:vl("relative flex max-h-[calc(100vh-2rem)] w-full flex-col overflow-hidden rounded-2xl","border border-line bg-white shadow-2xl shadow-slate-900/20",bv[C]),children:[f.jsxs("header",{className:"flex items-start gap-3 border-b border-line px-5 py-4",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h2",{className:"truncate text-[15px] font-semibold text-slate-900",children:z}),d&&f.jsx("p",{className:"mt-0.5 truncate text-xs text-slate-500",children:d})]}),f.jsx("button",{type:"button",onClick:E,className:"-mr-1 rounded-lg p-1.5 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600","aria-label":"关闭",children:f.jsx(sv,{className:"size-4"})})]}),f.jsx("div",{className:vl("min-h-0 flex-1 overflow-auto px-5 py-4",ut),children:M}),B&&f.jsx("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line bg-slate-50/70 px-5 py-3",children:B})]})]}):null}function xv({open:r,onClose:E,onSubmit:z}){const[d,C]=X.useState(""),[B,M]=X.useState(""),[ut,tt]=X.useState(""),[V,R]=X.useState(!1),[T,Z]=X.useState("");X.useEffect(()=>{r&&(C(""),M(""),tt(""),Z(""),R(!1))},[r]);async function $(){if(!d.trim()||!B){Z("请填写账号和密码");return}R(!0),Z("");try{await z({username:d.trim(),password:B,note:ut.trim()}),E()}catch(it){Z(it instanceof Error?it.message:String(it))}finally{R(!1)}}return f.jsx(Ki,{open:r,onClose:E,title:"添加账号",subtitle:"账号密码保存在本机 SQLite,用于会话失效时自动重新登录",footer:f.jsxs(f.Fragment,{children:[f.jsx(Kt,{onClick:E,disabled:V,children:"取消"}),f.jsx(Kt,{variant:"primary",loading:V,onClick:$,children:"保存并登录"})]}),children:f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"mb-1.5 block text-[12px] font-medium text-slate-600",children:"登录账号"}),f.jsx("input",{className:Pl,value:d,autoFocus:!0,placeholder:"手机号 / 身份证号 / 教师账号",onChange:it=>C(it.target.value),onKeyDown:it=>it.key==="Enter"&&$()})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1.5 block text-[12px] font-medium text-slate-600",children:"密码"}),f.jsx("input",{className:Pl,type:"password",value:B,autoComplete:"off",placeholder:"平台登录密码",onChange:it=>M(it.target.value),onKeyDown:it=>it.key==="Enter"&&$()})]}),f.jsxs("div",{children:[f.jsxs("label",{className:"mb-1.5 block text-[12px] font-medium text-slate-600",children:["备注 ",f.jsx("span",{className:"font-normal text-slate-400",children:"(可选)"})]}),f.jsx("input",{className:Pl,value:ut,placeholder:"例如:张三 · 语文",onChange:it=>tt(it.target.value)})]}),f.jsx("p",{className:"rounded-lg border border-line bg-slate-50 px-3 py-2 text-[11.5px] leading-relaxed text-slate-500",children:"保存后会自动尝试登录一次。若密码错误或需要验证码,卡片上会保留「登录」按钮,可手动重试。"}),T&&f.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-[12px] text-red-700",children:T})]})})}class Ae extends Error{constructor(z,d={}){super(z);Li(this,"offline",!1);Li(this,"status");Li(this,"code");this.name="ApiError",Object.assign(this,d)}}async function Vt(r,E={}){let z;try{z=await fetch(r,{...E,headers:{"Content-Type":"application/json",...E.headers||{}}})}catch{throw new Ae("后端未连接",{offline:!0})}if(z.status===401)throw new Ae("需要访问令牌:请用 /?token= 打开一次",{status:401});if(!z.ok)throw new Ae(`HTTP ${z.status}`,{status:z.status});return await z.json()}async function pv(r,E,z){let d;try{d=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)})}catch{throw new Ae("后端未连接",{offline:!0})}if(d.status===401)throw new Ae("需要访问令牌:请用 /?token= 打开一次");if(!d.ok)throw new Ae(`HTTP ${d.status}`);if(!d.body)throw new Ae("浏览器不支持流式响应");const C=d.body.getReader(),B=new TextDecoder;let M="";for(;;){const{value:ut,done:tt}=await C.read();if(tt)break;M+=B.decode(ut,{stream:!0});const V=M.split(` `);M=V.pop()||"";for(const R of V){const T=R.trim();if(T.startsWith("data:"))try{z(JSON.parse(T.slice(5).trim()))}catch{}}}}function Sv(r){const E=String((r==null?void 0:r.text)||"").replace(/\s+/g," ").trim();return E.length>24?`${E.slice(0,24)}…`:E}function Tv({open:r,account:E,course:z,onClose:d,notify:C,onSubmitted:B}){const[M,ut]=X.useState(null),[tt,V]=X.useState({}),[R,T]=X.useState(!1),[Z,$]=X.useState(!1),[it,Ut]=X.useState(!1),[Y,vt]=X.useState(!1),[pt,Ct]=X.useState(""),[Ft,St]=X.useState("info"),J=X.useRef(0);async function K(H=!1){if(!E||!z)return!1;T(!0),Ct(H?"正在生成新答卷…":"取题中…"),St("info");try{const at={cookies:E.cookies,plan_id:z.plan_id,project_id:z.project_id,name:z.name||""};H&&(at.retake=!0,at.period_id=(M==null?void 0:M.period_id)||"");const st=await Vt("/api/quiz",{method:"POST",body:JSON.stringify(at)});if(!st.ok)return ut(null),Ct(st.error||"取题失败"),St("error"),!1;ut(st),V(Object.fromEntries((st.questions||[]).map(o=>[o.no,o.picked||""])));const Bt=[];if(st.done){const o=st.surplus_exam_count;o!=null?Bt.push(`剩 ${o} 次`):st.allow_exam_count&&Bt.push(`共 ${st.allow_exam_count} 次`),st.show_answers?Bt.push("已显示标准答案"):st.exam_after_watch_answer==="0"&&Bt.push("本测验不开放答案"),Ct(`已交卷${Bt.length?` · ${Bt.join(" · ")}`:""}`),St("success")}else Ct(st.started?"已自动创建答卷(限时考试已开始计时)":""),St("info");return!0}catch(at){return Ct(at instanceof Error?at.message:"取题失败"),St("error"),!1}finally{T(!1)}}if(X.useEffect(()=>{!r||!E||!z||(ut(null),V({}),vt(!1),K(!1))},[r,E==null?void 0:E.id,z==null?void 0:z.plan_id]),!E||!z)return null;const k=(M==null?void 0:M.questions)||[],_t=!!(M!=null&&M.done),qt=!!(M!=null&&M.show_answers),Zt=!!(M!=null&&M.can_retake),Tt=M==null?void 0:M.surplus_exam_count,Jt=_t||R||Z||Y;function al(H,at){V(st=>({...st,[H]:at}))}function Qt(H,at,st){V(Bt=>{const o=yn(Bt[H]),N=st?[...o,at]:o.filter(w=>w!==at);return N.sort(),{...Bt,[H]:N.join("#")}})}async function U(){if(!M||!E)return;const H=k.filter(at=>!tt[at.no]).length;if(!(H&&!window.confirm(`还有 ${H} 题没作答,确定提交?`))){$(!0),Ct("提交中…"),St("info");try{const at=await Vt("/api/quiz/submit",{method:"POST",body:JSON.stringify({cookies:E.cookies,plan_id:M.plan_id,object_id:M.object_id,generation:M.generation||"legacy",result_id:M.result_id||"",answers:tt})});if(!at.ok){at.code==="already_finished"&&await K(),Ct(at.error||"提交失败"),St("error");return}C({message:`测验已提交${at.score?`,得分 ${at.score}`:""}`,tone:"success"}),await K(),B()}catch(at){Ct(at instanceof Error?at.message:"提交失败"),St("error")}finally{$(!1)}}}async function F(){if(!M)return;if(!M.can_retake){C({message:"没有剩余考试机会",tone:"error"});return}const H=Tt!=null?`(剩余 ${Tt} 次)`:"";if(window.confirm(`再考一次会消耗 1 次机会${H};限时考试会立即开始计时,确定?`)){Ut(!0);try{await K(!0)&&C({message:"已生成新答卷,可以重新答题了",tone:"success"})}finally{Ut(!1)}}}async function I(){if(!M||!E)return;if(M.done){C({message:"已交卷,点「再考一次」生成新答卷后再 AI 答题",tone:"error"});return}vt(!0),J.current=0;const H=Date.now();let at=0,st="";const Bt=window.setInterval(()=>{Ct(`AI 答题中… ${Math.round((Date.now()-H)/1e3)}s · 已填 ${J.current}/${k.length} 题`),St("info")},1e3);Ct(`AI 答题中… 已填 0/${k.length} 题`);try{await pv("/api/quiz/answer",{questions:M.questions,account_id:E.id},o=>{const N=o.answers;if(N&&typeof N=="object"){const w=Object.keys(N).length;w&&(J.current+=w,V(G=>({...G,...N})))}o.error&&(st=String(o.error)),o.done&&typeof o.failed=="number"&&(at=o.failed)}),J.current?at?(Ct(`AI 已填 ${J.current} 题,${at} 题失败${st?`:${st}`:""}`),St("error")):(Ct(`AI 已填 ${J.current} 题`),St("success")):(Ct(st?`AI 答题失败:${st}`:"AI 没有返回答案"),St("error"))}catch(o){Ct(o instanceof Error?o.message:"AI 答题失败"),St("error")}finally{window.clearInterval(Bt),vt(!1)}}const gt=Zt?`再考一次${Tt!=null?`(剩 ${Tt} 次)`:""}`:Tt===0?"考试机会已用完":"再考一次";return f.jsx(Ki,{open:r,onClose:d,title:`测验 · ${z.name||z.plan_id}`,subtitle:pt||"取题后可手动作答,或让大模型逐批填写",size:"xl",footer:f.jsxs(f.Fragment,{children:[f.jsx("span",{className:vl("mr-auto max-w-[50%] truncate text-[11.5px]",Ft==="error"?"text-red-600":Ft==="success"?"text-emerald-600":"text-slate-500"),children:pt}),_t&&f.jsx(Kt,{size:"sm",loading:it,disabled:R||!Zt,icon:f.jsx(Ph,{className:"size-3.5"}),onClick:F,children:gt}),f.jsx(Kt,{size:"sm",onClick:d,children:"关闭"}),f.jsx(Kt,{size:"sm",variant:"soft",loading:Y,disabled:Jt||!k.length,icon:f.jsx(Bh,{className:"size-3.5"}),onClick:I,children:"AI 答题"}),f.jsx(Kt,{size:"sm",variant:"primary",loading:Z,disabled:Jt||!k.length,icon:f.jsx(lv,{className:"size-3.5"}),onClick:U,children:"提交"})]}),children:R&&!k.length?f.jsx("div",{className:"py-16 text-center text-[13px] text-slate-400",children:"正在打开课程页取题…"}):k.length?f.jsx("div",{className:"space-y-2.5",children:k.map(H=>{const at=H.options||[],st=tt[H.no]||"",Bt=H.type==="02",o=at.length>0;return f.jsxs("div",{className:"rounded-xl border border-line px-3.5 py-3",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"mt-0.5 grid size-5 shrink-0 place-items-center rounded-md bg-slate-100 text-[10.5px] font-semibold tabular-nums text-slate-500",children:H.no}),f.jsx(Hs,{tone:"neutral",className:"mt-0.5 shrink-0",children:ov[H.type||""]||"题目"}),f.jsx("p",{className:"min-w-0 flex-1 text-[13px] leading-relaxed text-slate-800",children:H.title||`第 ${H.no} 题`}),qt&&H.is_correct!==void 0&&f.jsx("span",{className:vl("shrink-0 text-[12px] font-semibold",H.is_correct?"text-emerald-600":"text-red-500"),children:H.is_correct?"✓":"✗"})]}),o&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5 pl-7",children:at.map(N=>{const w=qt&&yn(H.correct).includes(N.key),G=qt&&yn(H.picked).includes(N.key)&&!yn(H.correct).includes(N.key);return f.jsxs("span",{className:vl("max-w-full rounded-lg border px-2 py-1 text-[11.5px] leading-snug",w?"border-emerald-200 bg-emerald-50 text-emerald-800":G?"border-red-200 bg-red-50 text-red-700":"border-line bg-slate-50/70 text-slate-600"),children:[f.jsx("b",{className:"mr-1 font-semibold",children:N.key}),Sv(N)]},N.key)})}),f.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-2 pl-7",children:[Bt?f.jsx("div",{className:"flex flex-wrap gap-1.5",children:at.map(N=>{const w=yn(st);return f.jsxs("label",{title:`${N.key}. ${N.text||""}`,className:vl("flex cursor-pointer items-center gap-1 rounded-lg border px-2 py-1 text-[11.5px] transition",w.includes(N.key)?"border-brand-300 bg-brand-50 text-brand-700":"border-line text-slate-600 hover:border-slate-300",Jt&&"pointer-events-none opacity-60"),children:[f.jsx("input",{type:"checkbox",className:"size-3 accent-brand-500",checked:w.includes(N.key),disabled:Jt,onChange:G=>Qt(H.no,N.key,G.target.checked)}),N.key]},N.key)})}):o?f.jsxs("select",{className:"h-8 w-full max-w-[320px] rounded-lg border border-line bg-white px-2 text-[12px] text-slate-700 focus:border-brand-500 focus:outline-none disabled:bg-slate-50 disabled:text-slate-400",value:st,disabled:Jt,onChange:N=>al(H.no,N.target.value),children:[f.jsx("option",{value:"",children:"未选"}),at.map(N=>f.jsxs("option",{value:N.key,children:[N.key,". ",N.text||""]},N.key))]}):f.jsx("input",{className:"h-8 w-full max-w-[320px] rounded-lg border border-line bg-white px-2 text-[12px] text-slate-700 focus:border-brand-500 focus:outline-none disabled:bg-slate-50 disabled:text-slate-400",value:st,placeholder:"填写答案",disabled:Jt,onChange:N=>al(H.no,N.target.value)}),qt&&H.correct&&f.jsxs("span",{className:"text-[11.5px] text-slate-500",children:["标准答案:",f.jsx("b",{className:"font-semibold text-slate-700",children:H.correct})]})]}),qt&&H.analysis&&f.jsxs("p",{className:"mt-2 rounded-lg bg-slate-50 px-2.5 py-1.5 text-[11.5px] leading-relaxed text-slate-500",children:["解析:",H.analysis]})]},H.no)})}):f.jsx("div",{className:"py-16 text-center text-[13px] text-red-600",children:pt||"没有题目"})})}function Nv({open:r,onClose:E,notify:z}){const[d,C]=X.useState(!1),[B,M]=X.useState(!1),[ut,tt]=X.useState(!1),[V,R]=X.useState({base_url:"",api_key:"",model:"",temperature:"0.2",timeout:"120",prompt:"",study_mode:"fast",study_parallel:"2"}),[T,Z]=X.useState("sk-...");X.useEffect(()=>{r&&(C(!0),Vt("/api/settings").then(Y=>{const vt=Y.llm||{},pt=Y.study||{};R({base_url:vt.base_url||"",api_key:"",model:vt.model||"",temperature:String(vt.temperature??.2),timeout:String(vt.timeout??120),prompt:vt.prompt||"",study_mode:pt.mode||"fast",study_parallel:String(pt.parallel||2)}),Z(vt.has_key?`已保存 ${vt.key_hint||""},留空不修改`:"sk-...")}).catch(Y=>z({message:`读取设置失败:${Y.message}`,tone:"error"})).finally(()=>C(!1)))},[r,z]);function $(Y,vt){R(pt=>({...pt,[Y]:vt}))}async function it(){M(!0);try{await Vt("/api/settings",{method:"POST",body:JSON.stringify({base_url:V.base_url.trim(),api_key:V.api_key.trim(),model:V.model.trim(),temperature:Number.parseFloat(V.temperature)||.2,timeout:Number.parseInt(V.timeout,10)||120,prompt:V.prompt,study_mode:V.study_mode,study_parallel:Number.parseInt(V.study_parallel,10)||0})}),z({message:"设置已保存",tone:"success"}),E()}catch(Y){z({message:`保存失败:${Y instanceof Error?Y.message:Y}`,tone:"error"})}finally{M(!1)}}async function Ut(){tt(!0);try{const Y=await Vt("/api/llm/test",{method:"POST",body:JSON.stringify({base_url:V.base_url.trim(),api_key:V.api_key.trim(),model:V.model.trim()})});z({message:Y.ok?`连接正常(${Y.ms} ms):${Y.reply||""}`:`连接失败:${Y.error||"未知错误"}`,tone:Y.ok?"success":"error"})}catch(Y){z({message:`连接失败:${Y instanceof Error?Y.message:Y}`,tone:"error"})}finally{tt(!1)}}return f.jsx(Ki,{open:r,onClose:E,title:"系统设置",subtitle:"大模型接口、答题提示词与学习模式",size:"lg",footer:f.jsxs(f.Fragment,{children:[f.jsx(Kt,{loading:ut,onClick:Ut,icon:f.jsx(Vh,{className:"size-3.5"}),children:"测试连接"}),f.jsx(Kt,{onClick:E,disabled:B,children:"取消"}),f.jsx(Kt,{variant:"primary",loading:B,onClick:it,disabled:d,children:"保存"})]}),children:d?f.jsx("div",{className:"py-10 text-center text-[12.5px] text-slate-400",children:"读取设置…"}):f.jsxs("div",{className:"space-y-6",children:[f.jsxs("section",{children:[f.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[12.5px] font-semibold text-slate-700",children:[f.jsx(ev,{className:"size-4 text-brand-500"}),"大模型(OpenAI 兼容)"]}),f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{children:[f.jsxs("label",{className:"mb-1.5 block text-[12px] text-slate-600",children:["接口地址 ",f.jsx("span",{className:"text-slate-400",children:"(写到 /v1 为止)"})]}),f.jsx("input",{className:Pl,value:V.base_url,placeholder:"https://api.openai.com/v1",onChange:Y=>$("base_url",Y.target.value)})]}),f.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[f.jsxs("div",{children:[f.jsx("label",{className:"mb-1.5 block text-[12px] text-slate-600",children:"API Key"}),f.jsxs("div",{className:"relative",children:[f.jsx(kh,{className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-slate-400"}),f.jsx("input",{className:`${Pl} pl-8`,type:"password",autoComplete:"off",value:V.api_key,placeholder:T,onChange:Y=>$("api_key",Y.target.value)})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1.5 block text-[12px] text-slate-600",children:"模型"}),f.jsx("input",{className:Pl,value:V.model,placeholder:"gpt-4o-mini / deepseek-chat / qwen-plus",onChange:Y=>$("model",Y.target.value)})]})]}),f.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[f.jsxs("div",{children:[f.jsx("label",{className:"mb-1.5 block text-[12px] text-slate-600",children:"温度"}),f.jsx("input",{className:Pl,type:"number",min:0,max:2,step:.1,value:V.temperature,onChange:Y=>$("temperature",Y.target.value)})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1.5 block text-[12px] text-slate-600",children:"超时(秒)"}),f.jsx("input",{className:Pl,type:"number",min:10,max:600,value:V.timeout,onChange:Y=>$("timeout",Y.target.value)})]})]}),f.jsxs("div",{children:[f.jsxs("label",{className:"mb-1.5 block text-[12px] text-slate-600",children:["答题提示词 ",f.jsx("span",{className:"text-slate-400",children:"(留空使用内置)"})]}),f.jsx("textarea",{className:`${Pl} min-h-24 resize-y`,value:V.prompt,placeholder:'只输出 JSON {"answers":{"题号":"答案"}}',onChange:Y=>$("prompt",Y.target.value)})]})]})]}),f.jsxs("section",{className:"border-t border-line pt-5",children:[f.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[12.5px] font-semibold text-slate-700",children:[f.jsx(Lh,{className:"size-4 text-brand-500"}),"学习模式"]}),f.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[f.jsxs("div",{children:[f.jsx("label",{className:"mb-1.5 block text-[12px] text-slate-600",children:"模式"}),f.jsxs("select",{className:Pl,value:V.study_mode,onChange:Y=>$("study_mode",Y.target.value),children:[f.jsx("option",{value:"fast",children:"快速学习(只调接口上报)"}),f.jsx("option",{value:"normal",children:"常规学习(真实播放视频)"})]})]}),f.jsxs("div",{children:[f.jsx("label",{className:"mb-1.5 block text-[12px] text-slate-600",children:"常规模式并发数"}),f.jsx("input",{className:Pl,type:"number",min:1,max:5,value:V.study_parallel,onChange:Y=>$("study_parallel",Y.target.value)})]})]}),f.jsxs("p",{className:"mt-3 rounded-lg bg-slate-50 px-3 py-2 text-[11.5px] leading-relaxed text-slate-500",children:["常规学习会开多个无头浏览器同时播视频;平台若按课节顺序放行,会被弹回并自动降为 1 路。快速学习只调用 ",f.jsx("code",{className:"rounded bg-white px-1 ring-1 ring-line",children:"period/study/log"}),",不启动浏览器。"]})]})]})})}function Ev({accounts:r}){const E=r.filter(M=>{var ut;return((ut=M.cookies)==null?void 0:ut.length)>0||["logged_in","studying"].includes(M.status||"")}).length,z=r.filter(M=>{var ut;return["discovering","studying"].includes(((ut=M.run)==null?void 0:ut.status)||"")}).length,d=r.reduce((M,ut)=>{var tt;return M+(((tt=ut.run)==null?void 0:tt.done)||0)},0),C=r.reduce((M,ut)=>{var tt;return M+(((tt=ut.run)==null?void 0:tt.total)||0)},0),B=[{label:"账号",value:r.length,hint:"已添加",icon:Tm,tone:"text-brand-600 bg-brand-50"},{label:"已登录",value:E,hint:r.length?`共 ${r.length} 个`:"等待添加",icon:uv,tone:"text-emerald-600 bg-emerald-50"},{label:"学习中",value:z,hint:z?"正在跑课":"空闲",icon:qh,tone:"text-sky-600 bg-sky-50"},{label:"课程进度",value:C?`${d}/${C}`:"—",hint:C?`${Math.round(d/C*100)}%`:"暂无任务",icon:Kh,tone:"text-amber-600 bg-amber-50"}];return f.jsx("section",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:B.map(M=>f.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-line bg-white px-4 py-3",children:[f.jsx("span",{className:`grid size-9 shrink-0 place-items-center rounded-lg ${M.tone}`,children:f.jsx(M.icon,{className:"size-4"})}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-[11px] text-slate-400",children:M.label}),f.jsxs("div",{className:"flex items-baseline gap-1.5",children:[f.jsx("span",{className:"text-[17px] font-semibold tabular-nums leading-tight text-slate-900",children:M.value}),f.jsx("span",{className:"truncate text-[10.5px] text-slate-400",children:M.hint})]})]})]},M.label))})}function zv({open:r,onClose:E}){const[z,d]=X.useState([]),[C,B]=X.useState(!1),M=X.useRef(null),ut=X.useRef(!0);X.useEffect(()=>{if(!r)return;let V=!0;const R=async()=>{try{const Z=await Vt("/api/log/history?key=system&tail=500");V&&d(Z.lines||[])}catch{}};d([]),R();const T=window.setInterval(()=>{document.hidden||R()},2500);return()=>{V=!1,window.clearInterval(T)}},[r]),X.useEffect(()=>{const V=M.current;V&&ut.current&&(V.scrollTop=V.scrollHeight)},[z,r]);async function tt(){B(!0);try{await Vt("/api/log/history?key=system",{method:"DELETE"}),d([])}finally{B(!1)}}return f.jsx(Ki,{open:r,onClose:E,title:"系统日志",subtitle:"全局事件与系统级错误,实时刷新",size:"xl",footer:f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:"mr-auto text-[11px] text-slate-400",children:["共 ",z.length," 行 · 保留最近 500 行"]}),f.jsx(Kt,{variant:"danger",size:"sm",loading:C,onClick:tt,children:"清空"}),f.jsx(Kt,{size:"sm",onClick:E,children:"关闭"})]}),bodyClassName:"bg-slate-950 p-0",children:f.jsx("pre",{ref:M,onScroll:V=>{const R=V.currentTarget;ut.current=R.scrollHeight-R.scrollTop-R.clientHeight<24},className:"scrollbar-thin h-[60vh] overflow-auto whitespace-pre-wrap break-words p-4 font-mono text-[11.5px] leading-relaxed text-slate-300",children:z.length?z.join(` `):"暂无系统日志"})})}function _v({toast:r}){if(!r)return null;const E=r.tone||"info",z=E==="error"?wh:E==="success"?Gh:Jh;return f.jsxs("div",{role:"status",className:vl("animate-toast-in fixed bottom-7 left-1/2 z-[60] flex max-w-[85vw] -translate-x-1/2 items-center gap-2","rounded-xl px-4 py-2.5 text-[12.5px] font-medium shadow-xl shadow-slate-900/20",E==="error"?"bg-red-600 text-white":E==="success"?"bg-emerald-600 text-white":"bg-slate-900 text-white"),children:[f.jsx(z,{className:"size-4 shrink-0 opacity-90"}),f.jsx("span",{className:"break-words",children:r.message})]})}function Ov({refreshing:r,onRefresh:E,onSettings:z,onSystemLog:d,onAdd:C}){return f.jsx("header",{className:"sticky top-0 z-30 border-b border-line/80 bg-white/85 backdrop-blur-xl",children:f.jsxs("div",{className:"mx-auto flex h-16 max-w-[1320px] items-center gap-3 px-4 sm:px-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("div",{className:"grid size-9 shrink-0 place-items-center rounded-xl bg-gradient-to-br from-brand-500 to-sky-400 text-[15px] font-bold text-white shadow-md shadow-brand-500/30",children:"学"}),f.jsxs("div",{className:"min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("h1",{className:"truncate text-[15px] font-semibold tracking-tight text-slate-900",children:"莞易学"}),f.jsx("span",{className:"hidden rounded-md bg-slate-100 px-1.5 py-0.5 text-[10px] font-medium text-slate-500 sm:inline",children:"多账号学习控制台"})]}),f.jsx("p",{className:"truncate text-[11.5px] text-slate-500",children:"东莞市教师培训平台 · 新旧版课程自动识别"})]})]}),f.jsx("div",{className:"flex-1"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(Kt,{variant:"ghost",size:"icon",onClick:E,loading:r,title:"刷新列表","aria-label":"刷新列表",children:f.jsx(Bs,{className:"size-4"})}),f.jsx(Kt,{variant:"ghost",size:"icon",onClick:d,title:"系统日志","aria-label":"系统日志",children:f.jsx(tv,{className:"size-4"})}),f.jsx(Kt,{variant:"ghost",size:"icon",onClick:z,title:"系统设置","aria-label":"系统设置",children:f.jsx(av,{className:"size-4"})}),f.jsx(Kt,{variant:"primary",className:"ml-1",icon:f.jsx(Sm,{className:"size-4"}),onClick:C,children:f.jsx("span",{className:"hidden sm:inline",children:"添加账号"})})]})]})})}const Em="guanyixue.inlineLogsOpen";function Av(){try{const r=JSON.parse(localStorage.getItem(Em)||"[]");return new Set(Array.isArray(r)?r.filter(E=>typeof E=="string"):[])}catch{return new Set}}function jv(r){try{localStorage.setItem(Em,JSON.stringify([...r]))}catch{}}function Mv(r){return{id:r.id,username:r.username,note:r.note||"",user:r.user||"",cookies:r.cookies||[],courses:r.courses||[],selected:r.selected||[],status:r.status||"idle",lastError:r.lastError||"",lastErrorAt:r.lastErrorAt||0,optQuiz:r.optQuiz===!0,optFeedback:r.optFeedback!==!1,loginAt:r.loginAt||0}}function Cv(){const[r,E]=X.useState([]),z=X.useRef(r),[d,C]=X.useState({guanyixue:"莞易学"}),[B,M]=X.useState(!1),[ut,tt]=X.useState(null),[V,R]=X.useState({}),[T,Z]=X.useState(!1),[$,it]=X.useState(null),[Ut,Y]=X.useState(()=>Av()),vt=X.useRef(Ut),[pt,Ct]=X.useState({}),Ft=X.useRef(pt),St=X.useRef(void 0);X.useEffect(()=>{z.current=r},[r]),X.useEffect(()=>{Ft.current=pt},[pt]),X.useEffect(()=>{vt.current=Ut,jv(Ut)},[Ut]),X.useEffect(()=>()=>window.clearTimeout(St.current),[]);const J=X.useCallback(x=>{tt(x),window.clearTimeout(St.current),St.current=window.setTimeout(()=>tt(null),3800)},[]),K=X.useCallback(async x=>{const j=await Vt("/api/accounts",{method:"POST",body:JSON.stringify(Mv(x))});if(j.ok===!1)throw new Error(j.error||"保存失败");return j},[]),k=X.useCallback(x=>{E(j=>{const A=j.some(lt=>lt.id===x.id)?j.map(lt=>lt.id===x.id?x:lt):[...j,x];return z.current=A,A})},[]),_t=X.useCallback(async(x=!0)=>{var j;try{const[p,A]=await Promise.all([Vt("/api/runs"),Vt("/api/accounts")]),lt=(A.accounts||[]).map(P=>({...P,run:p[P.id]||null})).sort((P,q)=>(P.created||0)-(q.created||0));E(lt),z.current=lt,M(!1);for(const P of lt){const q=(j=P.run)==null?void 0:j.cookies;if(q&&q.length&&JSON.stringify(q)!==JSON.stringify(P.cookies||[])){const Yt={...P,cookies:q};P.cookies=q,K(Yt).catch(()=>{})}}}catch(p){p instanceof Ae&&p.offline?M(!0):x||J({message:`读取账号失败:${de(p)}`,tone:"error"})}},[J,K]);X.useEffect(()=>{_t();const x=window.setInterval(()=>{document.hidden||_t()},5e3);return()=>window.clearInterval(x)},[_t]),X.useEffect(()=>{Vt("/api/platforms").then(x=>{const j={};for(const p of x.platforms||[])j[p.id]=p.label;Object.keys(j).length&&C(j)}).catch(()=>{})},[]);const qt=X.useCallback(async x=>{var lt;const j=Ft.current[x]||{lines:[],since:0,busy:!1,historyTried:!1};if(j.busy)return;const p={...j,busy:!0},A=P=>{Ft.current={...Ft.current,[x]:P},Ct(q=>({...q,[x]:P}))};A(p);try{let P=await Vt(`/api/log?key=${encodeURIComponent(x)}&since=${p.since}`);typeof P.next=="number"&&P.nextNt.id===x);if(Rt&&JSON.stringify(Rt.cookies||[])!==JSON.stringify(Yt)){const Nt={...Rt,cookies:Yt};k(Nt),K(Nt).catch(()=>{})}}}catch{}finally{p.busy=!1,A(p)}},[k,K]);X.useEffect(()=>{const x=window.setInterval(()=>{document.hidden||vt.current.forEach(j=>void qt(j))},1500);return()=>window.clearInterval(x)},[qt]);const Zt=X.useCallback((x,j)=>{const p=j===void 0?!vt.current.has(x):j,A=new Set(vt.current);p?A.add(x):A.delete(x),vt.current=A,Y(A),p&&qt(x)},[qt]);async function Tt(x,j,p){R(A=>({...A,[x]:j}));try{return await p()}finally{R(A=>{const lt={...A};return delete lt[x],lt})}}async function Jt(x,j=!1){return Tt(x.id,"login",async()=>{k({...x,status:"logging",lastError:""});try{await K({...x,status:"logging",lastError:""});const p=await Vt("/api/login",{method:"POST",body:JSON.stringify({account_id:x.id})});if(!p.ok){const P={...x,status:"login_failed",lastError:p.error||`HTTP ${p.code||"失败"}`,lastErrorAt:Date.now(),run:null};return k(P),await K(P).catch(()=>{}),j||J({message:`登录失败:${P.lastError}`,tone:"error"}),!1}const A=p.courses||[],lt={...x,status:"logged_in",cookies:p.cookies||[],user:p.user||x.user||"",courses:A,selected:(x.selected||[]).filter(P=>A.some(q=>q.plan_id===P)),loginAt:Date.now(),updated:Date.now(),lastError:"",lastErrorAt:0,run:null};return k(lt),await K(lt).catch(()=>{}),j||J({message:p.warn?`登录成功,但课程读取异常:${p.warn}`:`登录成功:${lt.user||lt.username},读到 ${Rs(A).total} 门`,tone:p.warn?"info":"success"}),_t(),!0}catch(p){const A={...x,status:"login_failed",lastError:de(p),lastErrorAt:Date.now()};return k(A),await K(A).catch(()=>{}),j||J({message:`登录失败:${A.lastError}`,tone:"error"}),p instanceof Ae&&p.offline&&M(!0),!1}})}async function al(x){return Tt(x.id,"refresh",async()=>{var j;try{let p=await Vt("/api/courses",{method:"POST",body:JSON.stringify({cookies:x.cookies})});if(!p.ok&&p.code==="session_expired"){if(J({message:"会话已失效,正在自动重新登录…"}),!await Jt(x,!0))return;const P=z.current.find(q=>q.id===x.id);if(!P)return;p=await Vt("/api/courses",{method:"POST",body:JSON.stringify({cookies:P.cookies})})}if(!p.ok){J({message:`读取失败:${p.error||p.code||"未知错误"}`,tone:"error"});return}const A=z.current.find(P=>P.id===x.id)||x,lt={...A,courses:p.courses||[],user:p.user||A.user,cookies:(j=p.cookies)!=null&&j.length?p.cookies:A.cookies,status:"logged_in",updated:Date.now(),lastError:"",lastErrorAt:0};k(lt),await K(lt).catch(()=>{}),J({message:`已刷新,读到 ${Rs(lt.courses).total} 门`,tone:"success"})}catch(p){J({message:`读取失败:${de(p)}`,tone:"error"})}})}async function Qt(x){var A;const j=x.selected||[],p=(x.courses||[]).filter(lt=>j.includes(lt.plan_id)&<.in_study!==!1);if(!p.length){J({message:"请先勾选要学习的课程",tone:"error"});return}if(!((A=x.cookies)!=null&&A.length)){J({message:"请先登录",tone:"error"});return}return Tt(x.id,"study",async()=>{var lt,P;try{const q=await Vt("/api/study",{method:"POST",body:JSON.stringify({key:x.id,username:x.user||x.username,cookies:x.cookies,courses:p,workers:40,cap_minutes:90,enable_quiz:x.optQuiz===!0,enable_feedback:x.optFeedback!==!1})});if(!q.ok){J({message:`启动失败:${q.error||"未知错误"}`,tone:"error"});return}const Yt=((lt=q.study)==null?void 0:lt.mode)==="normal"?`常规真播 ${((P=q.study)==null?void 0:P.parallel)||1} 路并发`:"快速模式(只调接口)";J({message:`已开始 ${p.length} 门课程 · ${Yt}${x.optQuiz?" · 含自动答题":" · 测验需手动作答"}`,tone:"success"}),Zt(x.id,!0),_t()}catch(q){J({message:`启动失败:${de(q)}`,tone:"error"})}})}async function U(x){return Tt(x.id,"stop",async()=>{try{await Vt("/api/stop",{method:"POST",body:JSON.stringify({key:x.id})}),J({message:"已请求停止"}),_t()}catch(j){J({message:`停止失败:${de(j)}`,tone:"error"})}})}async function F(x){var j;if(!((j=x.cookies)!=null&&j.length)){J({message:"请先登录",tone:"error"});return}return Tt(x.id,"capture",async()=>{try{const p=await Vt("/api/capture",{method:"POST",body:JSON.stringify({key:x.id,cookies:x.cookies,minutes:10})});if(!p.ok){J({message:`抓包失败:${p.error||"未知错误"}`,tone:"error"});return}J({message:"已打开浏览器,请手动走一遍课程页;最多记录 10 分钟",tone:"success"})}catch(p){J({message:`抓包失败:${de(p)}`,tone:"error"})}})}async function I(x){return Tt(x.id,"capture",async()=>{try{await Vt("/api/capture/stop",{method:"POST",body:JSON.stringify({key:x.id})}),J({message:"已请求停止抓包"}),_t()}catch(j){J({message:`停止抓包失败:${de(j)}`,tone:"error"})}})}async function gt(x){if(window.confirm(`删除账号「${x.user||x.username}」?课程缓存和日志不会自动清理。`))try{await Vt(`/api/accounts/${encodeURIComponent(x.id)}`,{method:"DELETE"}),E(j=>{const p=j.filter(A=>A.id!==x.id);return z.current=p,p}),J({message:"账号已删除"})}catch(j){J({message:`删除失败:${de(j)}`,tone:"error"})}}async function H(x,j){const p={...x,selected:j};k(p);try{await K(p)}catch(A){J({message:`保存勾选失败:${de(A)}`,tone:"error"})}}function at(x,j,p){const A=x.selected||[];H(x,p?[...new Set([...A,j])]:A.filter(lt=>lt!==j))}function st(x){const j=(x.courses||[]).filter(p=>p.in_study!==!1).map(p=>p.plan_id);H(x,[...new Set([...x.selected||[],...j])])}async function Bt(x,j,p){const A=j==="quiz"?{...x,optQuiz:p}:{...x,optFeedback:p};k(A);try{await K(A),J({message:j==="quiz"?p?"已开启自动交测验(注意正确率)":"已关闭自动交测验":p?"已开启自动交反馈表":"已关闭自动交反馈表"})}catch(lt){J({message:`保存失败:${de(lt)}`,tone:"error"})}}async function o(x){const j=await Vt("/api/accounts",{method:"POST",body:JSON.stringify({username:x.username,password:x.password,note:x.note,cookies:[],courses:[],selected:[],status:"idle",created:Date.now()})});if(j.ok===!1)throw new Error(j.error||"保存失败");const p=await Vt("/api/accounts"),A=j.account||(p.accounts||[]).find(q=>q.username===x.username);if(!A){J({message:"已保存,但列表里没有找到新账号,请刷新页面",tone:"error"}),await _t();return}J({message:"已保存,正在尝试首次登录…"});const lt=await Jt(A,!0),P=z.current.find(q=>q.id===A.id);J(lt?{message:`登录成功:${(P==null?void 0:P.user)||x.username}`,tone:"success"}:{message:`登录失败:${(P==null?void 0:P.lastError)||"未知原因"}(请手动点击「登录」重试)`,tone:"error"}),await _t()}async function N(){Z(!0);try{await _t(!1)}finally{Z(!1)}}function w(x){var p;const j=(p=(x.courses||[]).find(A=>A.platform))==null?void 0:p.platform;return j&&d[j]||"莞易学"}const G=($==null?void 0:$.type)==="quiz"&&r.find(x=>x.id===$.accountId)||null,ot=($==null?void 0:$.type)==="quiz"?(G==null?void 0:G.courses.find(x=>x.plan_id===$.course.plan_id))||$.course:null;return f.jsxs("div",{className:"min-h-screen",children:[f.jsx(Ov,{refreshing:T,onRefresh:()=>void N(),onSettings:()=>it({type:"settings"}),onSystemLog:()=>it({type:"system"}),onAdd:()=>it({type:"add"})}),f.jsxs("main",{className:"mx-auto max-w-[1320px] px-4 pb-16 pt-5 sm:px-6",children:[B&&f.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2.5 rounded-xl border border-red-200 bg-red-50 px-4 py-2.5 text-[12.5px] text-red-700",children:[f.jsx(fv,{className:"size-4 shrink-0"}),f.jsx("span",{className:"font-medium",children:"后端未连接"}),f.jsx("span",{className:"text-red-500",children:"页面显示的是上一次数据,请确认服务已启动、端口没有变化。"}),f.jsx("div",{className:"flex-1"}),f.jsx(Kt,{size:"sm",variant:"secondary",loading:T,onClick:()=>void N(),children:"重试"})]}),f.jsx(Ev,{accounts:r}),f.jsxs("div",{className:"mb-3 mt-6 flex items-end justify-between gap-3",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-[14px] font-semibold text-slate-900",children:"账号列表"}),f.jsx("p",{className:"mt-0.5 text-[11.5px] text-slate-400",children:"新旧版课程自动识别为「莞易学」,每 5 秒自动刷新状态"})]}),r.length>0&&f.jsx(Kt,{size:"sm",variant:"secondary",icon:f.jsx(Bs,{className:"size-3.5"}),loading:T,onClick:()=>void N(),children:"刷新"})]}),r.length===0?f.jsxs("div",{className:"card-shadow grid place-items-center rounded-2xl border border-dashed border-slate-300 bg-white px-6 py-16 text-center",children:[f.jsx("div",{className:"grid size-12 place-items-center rounded-2xl bg-brand-50 text-brand-600",children:f.jsx(Tm,{className:"size-6"})}),f.jsx("h3",{className:"mt-4 text-[14px] font-semibold text-slate-800",children:"还没有账号"}),f.jsx("p",{className:"mt-1.5 max-w-md text-[12.5px] leading-relaxed text-slate-500",children:"添加东莞市教师培训平台账号后,可自动读取课程、勾选学习、提交反馈表与测验。 新旧版课程页会统一识别为「莞易学」。"}),f.jsx(Kt,{variant:"primary",className:"mt-5",icon:f.jsx(Sm,{className:"size-4"}),onClick:()=>it({type:"add"}),children:"添加第一个账号"})]}):f.jsx("div",{className:"grid items-start gap-4 md:grid-cols-2 xl:grid-cols-3",children:r.map(x=>{var j;return f.jsx(gv,{account:x,platformLabel:w(x),pending:V[x.id],openLog:Ut.has(x.id),logLines:((j=pt[x.id])==null?void 0:j.lines)||[],onToggleLog:()=>Zt(x.id),onLogin:()=>void Jt(x),onRefresh:()=>void al(x),onStudy:()=>void Qt(x),onStop:()=>void U(x),onCapture:()=>void F(x),onStopCapture:()=>void I(x),onDelete:()=>void gt(x),onQuiz:()=>{var lt;const p=(x.courses||[]).filter(P=>P.in_study!==!1),A=p.find(P=>{var q;return(q=x.selected)==null?void 0:q.includes(P.plan_id)})||p[0];if(!A){J({message:"这门课还没有课程数据,先点「刷新课程」",tone:"error"});return}if(!((lt=x.cookies)!=null&<.length)){J({message:"请先登录",tone:"error"});return}it({type:"quiz",accountId:x.id,course:A})},onToggleCourse:(p,A)=>at(x,p,A),onSelectAll:()=>st(x),onClearSelection:()=>void H(x,[]),onToggleOption:(p,A)=>void Bt(x,p,A)},x.id)})})]}),f.jsx("footer",{className:"border-t border-line/70 py-5 text-center text-[11px] text-slate-400",children:"莞易学 · 多账号学习控制台 · 数据保存在本机"}),f.jsx(xv,{open:($==null?void 0:$.type)==="add",onClose:()=>it(null),onSubmit:o}),f.jsx(Nv,{open:($==null?void 0:$.type)==="settings",onClose:()=>it(null),notify:J}),f.jsx(zv,{open:($==null?void 0:$.type)==="system",onClose:()=>it(null)}),f.jsx(Tv,{open:($==null?void 0:$.type)==="quiz"&&!!G,account:G,course:ot,onClose:()=>it(null),notify:J,onSubmitted:()=>void _t()}),f.jsx(_v,{toast:ut})]})}Dh.createRoot(document.getElementById("root")).render(f.jsx(X.StrictMode,{children:f.jsx(Cv,{})}));