import{r,j as e}from"./react-vendor-jWT2yUdV.js";import{s as P,b,M as me,C as M}from"./index-DiaaLdUu.js";import{c as fe}from"./chunk-5PILOUBS-KHYNqMZE.js";import{c as ge}from"./chunk-D5XJWRAV-DVN21qSw.js";import{i as V}from"./chunk-MLPFQTYO-DSnBqIsb.js";import{t as xe,a as D}from"./chunk-ML27DD5T-ZFWrMOn-.js";import{n as p}from"./react-hot-toast-cGcFZPSt.js";import{g as pe}from"./index-DE7yoXMZ.js";import{l as he}from"./logo-kBMoCJob.js";import{Q as Z,G as je}from"./index-D6HfLP9Q.js";import{P as we,H as ye,T as ve}from"./pure-XNiwTrk_.js";import{a as T}from"./chunk-SXMLSBOY-NckgDZ9w.js";import{d as be,a as Ne,b as Qe,m as Ce}from"./chunk-KQ5CH2X7-DgF-_fDD.js";import{i as K}from"./chunk-2QAN2V2R-B2qCPZrG.js";import{b as ke,c as _e,d as X}from"./index-FvTxWQTZ.js";import{Q as C}from"./qq_manager-BfRTEAby.js";import{s as Se,l as Re}from"./chunk-KVDW62ZT-CGYYmJoP.js";import{a as qe}from"./index-DvErMbt6.js";import{u as Le}from"./use-dialog-CRIMuzeE.js";import{u as Ue}from"./react-router-dom-C6k78GT4.js";import{m as ze}from"./proxy-BsRmjYPH.js";import"./qface-BZLvZXJ8.js";import"./index-BsnVex0g.js";import"./index-BV9-YCKp.js";import"./chunk-UX7UMZL5-CMHjUaC_.js";import"./SelectionManager-Dl9uHsLK.js";import"./usePress-BrNwsdVw.js";import"./layout-Buao20KT.js";import"./gestures-BHfQC-M8.js";import"./features-animation-BkV7kg8P.js";import"./Item-D8Sud-UP.js";import"./iconBase-B7bT1FlI.js";import"./chunk-IHO36JMK-DJPUeGG0.js";import"./chunk-RJKRL3AU-CjtrMR1U.js";import"./chunk-AXSF7SRE-Cr4elNVq.js";import"./chunk-NAV3ZXLI-ChbUTMf0.js";import"./chunk-M3MASYO7-B4fjH-eW.js";import"./chunk-EN4B57RQ-Ief8qCCd.js";import"./useToggle-B3ZYBe5S.js";import"./useFocusable-DA5Croun.js";import"./icons-C0t6aNgu.js";import"./chunk-OPTZHMJX-CY9g90YL.js";import"./chunk-6LIX6LVT-B246pOuK.js";import"./chunk-WQVQ7P2I-BJd1EiqP.js";import"./useHover-DC1o5-bm.js";import"./chunk-2QQAR2RD-YG5LNmAk.js";import"./chunk-FGM523TA-CgSvUh2a.js";import"./chunk-SLABUSGS-Cmz8sGrU.js";import"./DOMLayoutDelegate-DOgfSALU.js";const L=a=>!!a&&"nickName"in a&&"faceUrl"in a;function Pe(a){const l={};try{new URL(a).searchParams.forEach((o,m)=>{l[m]=o})}catch{const n=a.match(/[?&]([^#]+)/);n&&n[1].split("&").forEach(o=>{const[m,i]=o.split("=");m&&(l[m]=decodeURIComponent(i||""))})}return l}function Y(a){return new Promise((l,n)=>{if(window.TencentCaptcha){l();return}const o=document.createElement("script");o.src=a,o.onload=()=>l(),o.onerror=()=>n(new Error(`Failed to load ${a}`)),document.head.appendChild(o)})}const Ee=({proofWaterUrl:a,onSuccess:l,onCancel:n})=>{const o=r.useRef(null),m=r.useRef(!0),i=r.useCallback((d,t)=>{m.current&&(d.ret===0&&d.ticket&&d.randstr?l({ticket:d.ticket,randstr:d.randstr,appid:d.appid||"",sid:t}):n==null||n())},[l,n]);return r.useEffect(()=>{m.current=!0;const d=Pe(a),t=d.aid||"2081081773",g=d.sid||"";return(async()=>{try{await Y("https://captcha.gtimg.com/TCaptcha.js")}catch{try{await Y("https://ssl.captcha.qq.com/TCaptcha.js")}catch{m.current&&i({ret:0,ticket:`terror_1001_${t}_${Math.floor(Date.now()/1e3)}`,randstr:"@"+Math.random().toString(36).substring(2),errorCode:1001,errorMessage:"jsload_error"},g);return}}if(m.current)try{const f=new window.TencentCaptcha(t,h=>i(h,g),{type:"popup",showHeader:!1,login_appid:d.login_appid,uin:d.uin,sid:d.sid,enableAged:!0});o.current=f,f.show()}catch{m.current&&i({ret:0,ticket:`terror_1001_${t}_${Math.floor(Date.now()/1e3)}`,randstr:"@"+Math.random().toString(36).substring(2),errorCode:1001,errorMessage:"init_error"},g)}})(),()=>{var f;m.current=!1,(f=o.current)==null||f.destroy(),o.current=null}},[a,i]),e.jsxs("div",{className:"flex items-center justify-center py-8 gap-3",children:[e.jsx(P,{size:"lg"}),e.jsx("span",{className:"text-default-500",children:"正在加载验证码..."})]})},Ie=({jumpUrl:a,uin:l,onVerified:n,onCancel:o})=>{const[m,i]=r.useState(""),[d,t]=r.useState("loading"),[g,y]=r.useState(""),f=r.useRef(null),h=r.useRef(!0),w=r.useCallback(()=>{f.current&&(clearInterval(f.current),f.current=null)},[]),k=r.useCallback(v=>{w(),f.current=setInterval(async()=>{if(h.current)try{const _=await C.pollNewDeviceQR(l,v);if(!h.current)return;const U=_==null?void 0:_.uint32_guarantee_status;if(U===3)t("scanned");else if(U===1){w(),t("confirmed");const E=(_==null?void 0:_.str_nt_succ_token)||"";n(E)}}catch{}},2500)},[l,n,w]),N=r.useCallback(async()=>{t("loading"),y("");try{const v=await C.getNewDeviceQRCode(l,a);if(!h.current)return;v!=null&&v.str_url?(i(v.str_url),t("waiting"),k(v.bytes_token||"")):(t("error"),y("获取二维码失败,请重试"))}catch(v){if(!h.current)return;t("error"),y(v.message||"获取二维码失败")}},[l,a,k]);r.useEffect(()=>(h.current=!0,N(),()=>{h.current=!1,w()}),[N,w]);const j={loading:"正在获取二维码...",waiting:"请使用手机QQ扫描二维码完成验证",scanned:"已扫描,请在手机上确认",confirmed:"验证成功,正在登录...",error:g||"获取二维码失败"},R={loading:"text-default-500",waiting:"text-warning",scanned:"text-primary",confirmed:"text-success",error:"text-danger"};return e.jsxs("div",{className:"flex flex-col gap-4 items-center",children:[e.jsx("p",{className:"text-warning text-sm",children:"检测到新设备登录,请使用手机QQ扫描下方二维码完成验证"}),e.jsxs("div",{className:"flex flex-col items-center gap-3",style:{minHeight:280},children:[d==="loading"?e.jsx("div",{className:"flex items-center justify-center",style:{height:240},children:e.jsx(P,{size:"lg"})}):d==="error"?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3",style:{height:240},children:[e.jsx("p",{className:"text-danger text-sm",children:g}),e.jsx(b,{color:"primary",variant:"flat",onPress:N,children:"重新获取"})]}):e.jsx("div",{className:"p-3 bg-white rounded-lg",children:e.jsx(Z,{value:m,size:220})}),e.jsx("p",{className:`text-sm ${R[d]}`,children:j[d]})]}),e.jsxs("div",{className:"flex gap-3",children:[d==="waiting"&&e.jsx(b,{color:"default",variant:"flat",size:"sm",onPress:N,children:"刷新二维码"}),e.jsx(b,{variant:"light",color:"danger",size:"sm",onPress:o,children:"取消验证"})]})]})},$e=({onSubmit:a,onCaptchaSubmit:l,onNewDeviceVerified:n,isLoading:o,qqList:m,captchaState:i,captchaVerifying:d,newDeviceState:t,onCaptchaCancel:g,onNewDeviceCancel:y})=>{const[f,h]=r.useState(""),[w,k]=r.useState(""),N=()=>{if(!f){p.error("请输入QQ号");return}if(!w){p.error("请输入密码");return}a(f,w)};return e.jsx("div",{className:"flex flex-col gap-8",children:i!=null&&i.needCaptcha&&i.proofWaterUrl?e.jsxs("div",{className:"flex flex-col gap-4 items-center",children:[d?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-primary text-sm",children:"验证码已提交,正在等待服务器验证结果..."}),e.jsx("div",{className:"flex items-center justify-center py-8 gap-3",children:e.jsx(P,{size:"lg"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-warning text-sm",children:"登录需要安全验证,请完成验证码"}),e.jsx(Ee,{proofWaterUrl:i.proofWaterUrl,onSuccess:j=>{l==null||l(i.uin,i.password,j)},onCancel:g})]}),e.jsx(b,{variant:"light",color:"danger",size:"sm",onPress:g,children:"取消验证"})]}):t!=null&&t.needNewDevice&&t.jumpUrl?e.jsx(Ie,{jumpUrl:t.jumpUrl,uin:t.uin,onVerified:j=>n==null?void 0:n(j),onCancel:y}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(V,{className:"shadow-lg",height:100,radius:"full",src:`https://q1.qlogo.cn/g?b=qq&nk=${f||"0"}&s=100`,width:100,alt:"QQ Avatar"})}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(K,{type:"text",label:"QQ账号",placeholder:"请输入QQ号",value:f,onValueChange:h,variant:"bordered",size:"lg",autoComplete:"off",endContent:e.jsxs(be,{children:[e.jsx(Ne,{children:e.jsx(b,{isIconOnly:!0,variant:"light",size:"sm",radius:"full",children:e.jsx(ke,{size:16})})}),e.jsx(Qe,{"aria-label":"QQ Login History",items:m,onAction:j=>h(j.toString()),children:j=>e.jsx(Ce,{textValue:j.uin,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{alt:j.uin,className:"flex-shrink-0",size:"sm",src:L(j)?j.faceUrl:`https://q1.qlogo.cn/g?b=qq&nk=${j.uin}&s=1`}),e.jsx("div",{className:"flex flex-col",children:L(j)?`${j.nickName}(${j.uin})`:j.uin})]})},j.uin)})]})}),e.jsx(K,{type:"password",label:"密码",placeholder:"请输入密码",value:w,onValueChange:k,variant:"bordered",size:"lg",autoComplete:"new-password"})]}),e.jsx("div",{className:"flex justify-center mt-4",children:e.jsx(b,{className:"w-64 max-w-full font-semibold bg-gradient-to-r from-primary-400 to-primary-600 shadow-lg shadow-primary-500/30",color:"primary",isLoading:o,radius:"full",size:"lg",variant:"shadow",onPress:N,children:"登录"})})]})})},Me=({qrcode:a,loginError:l,onRefresh:n,isRefreshing:o=!1,loginPhase:m,isRecoveringLoginService:i=!1})=>{const d=m==="qrcode_scanned"?"二维码已扫描,等待手机确认…":m==="initializing"?"QQ 登录成功,正在启动 SnowCat…":m==="reconnecting"||i?"正在重新连接 QQ 登录服务…":void 0;return e.jsxs("div",{className:"flex flex-col items-center",children:[(o||d)&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-md",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-3xl bg-white/90 dark:bg-zinc-900/90 backdrop-blur-2xl border border-white/70 dark:border-white/10 px-10 py-8 shadow-2xl shadow-primary-900/20",children:[e.jsx(P,{color:"primary",size:"lg"}),e.jsx("div",{className:"text-base font-semibold",children:d||"正在刷新二维码…"}),e.jsx("div",{className:"text-xs text-default-500",children:d?"请不要关闭此页面,最长可能需要 3 分钟":"正在等待新的二维码,最长 10 秒"})]})}),l&&!a&&!i?e.jsxs("div",{className:"flex flex-col items-center py-4",children:[e.jsx("div",{className:"w-full flex justify-center mb-6",children:e.jsx("div",{className:"p-4 bg-danger-50 dark:bg-danger-900/20 rounded-2xl",children:e.jsx(_e,{className:"text-danger",size:56})})}),e.jsxs("div",{className:"text-center space-y-2 px-4",children:[e.jsx("div",{className:"text-xl font-bold text-danger",children:"登录失败"}),e.jsx("div",{className:"text-default-600 text-sm leading-relaxed max-w-[300px]",children:l})]}),n&&e.jsx(b,{className:"mt-8 min-w-[160px]",variant:"solid",color:"primary",size:"lg",startContent:e.jsx(X,{}),onPress:n,isLoading:o,isDisabled:o,children:"重新获取二维码"})]}):e.jsxs(e.Fragment,{children:[l&&e.jsx("div",{className:"mb-4 w-full max-w-[360px] rounded-lg bg-warning-50 px-4 py-3 text-center text-sm text-warning-700 dark:bg-warning-50/20 dark:text-warning-300",children:l}),e.jsxs("div",{className:"relative mx-auto w-fit rounded-2xl bg-white p-3 shadow-lg shadow-primary-900/10 ring-1 ring-black/5 overflow-hidden",children:[!a&&e.jsx("div",{className:"absolute inset-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm flex items-center justify-center z-10",children:e.jsx(P,{color:"primary"})}),e.jsx(Z,{size:176,value:a||" "},a)]}),e.jsx("div",{className:"mt-5 text-center text-default-500 text-xs",children:"请使用 QQ 或 TIM 扫描上方二维码"}),n&&a&&e.jsx(b,{className:"mt-4",variant:"flat",color:"primary",size:"sm",startContent:e.jsx(X,{}),onPress:n,isLoading:o,isDisabled:o,children:"刷新二维码"})]})]})},De=({qqList:a,refresh:l,isLoading:n,selectedQQ:o,onUpdateQQList:m,handleSelectionChange:i,onSubmit:d})=>e.jsxs("div",{className:"flex flex-col gap-8",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(V,{className:"shadow-lg",height:100,radius:"full",src:`https://q1.qlogo.cn/g?b=qq&nk=${o||"0"}&s=100`,width:100})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{classNames:{popoverContent:"bg-opacity-50 backdrop-blur"},"aria-label":"QQ Login",isDisabled:l,items:a,placeholder:"请选择QQ",renderValue:t=>t.map(g=>{var y,f,h,w;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{alt:(y=g.key)==null?void 0:y.toString(),className:"flex-shrink-0",size:"sm",src:L(g.data)?(f=g.data)==null?void 0:f.faceUrl:`https://q1.qlogo.cn/g?b=qq&nk=${g.key}&s=1`}),e.jsx("div",{className:"flex flex-col",children:L(g.data)?`${g.data.nickName}(${(h=g.key)==null?void 0:h.toString()})`:(w=g.key)==null?void 0:w.toString()})]},g.key)}),selectedKeys:[o],size:"lg",onChange:i,children:t=>e.jsx(Re,{textValue:t.uin,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{alt:t.uin,className:"flex-shrink-0",size:"sm",src:L(t)?t.faceUrl:`https://q1.qlogo.cn/g?b=qq&nk=${t.uin}&s=1`}),e.jsx("div",{className:"flex flex-col",children:L(t)?`${t.nickName}(${t.uin})`:t.uin})]})},t.uin)}),e.jsx(b,{isIconOnly:!0,className:"flex-grow-0 flex-shrink-0",color:"secondary",isLoading:l,radius:"full",size:"lg",variant:"light",onPress:m,children:e.jsx(qe,{size:24})})]}),e.jsx("div",{className:"flex justify-center mt-4",children:e.jsx(b,{className:"w-64 max-w-full font-semibold bg-gradient-to-r from-primary-400 to-primary-600 shadow-lg shadow-primary-500/30",color:"primary",isLoading:n,radius:"full",size:"lg",variant:"shadow",onPress:d,children:"登录"})})]}),B=a=>{if(a.startsWith("登录失败: ")){const l=a.substring(6);try{const n=JSON.parse(l);if(Array.isArray(n)&&n[1]){const o=n[1],m=o.serverErrorCode?` (错误码: ${o.serverErrorCode})`:"";return`${o.message||a}${m}`}}catch{}}return a};function Es(){const a=Ue(),l=Le(),[n,o]=r.useState(""),[m,i]=r.useState(!1),[d,t]=r.useState(""),[g,y]=r.useState("waiting_qrcode"),[f,h]=r.useState(!1),w=r.useRef(""),k=r.useRef(0),N=r.useRef(!1),[j,R]=r.useState(""),v=r.useRef(""),[_,U]=r.useState([]),[E,W]=r.useState(!1),[A,ee]=r.useState("shortcut"),I=r.useRef(!0),[se,z]=r.useState(null),[re,G]=r.useState(!1),[S,q]=r.useState(null),te=async()=>{if(!n){p.error("请选择快捷登录的QQ");return}i(!0);try{await C.setQuickLogin(n)}catch(c){const s=c.message;p.error(`快速登录QQ失败: ${s}`)}finally{setTimeout(()=>{i(!1)},1e3)}},ae=async(c,s)=>{i(!0);try{const x=M.MD5(s).toString(),u=await C.passwordLogin(c,x);u!=null&&u.needCaptcha&&u.proofWaterUrl?(z({needCaptcha:!0,proofWaterUrl:u.proofWaterUrl,uin:c,password:s}),p("需要安全验证,请完成验证码",{icon:"🔒"})):u!=null&&u.needNewDevice&&u.jumpUrl?(q({needNewDevice:!0,jumpUrl:u.jumpUrl,newDevicePullQrCodeSig:u.newDevicePullQrCodeSig||"",uin:c,password:s}),p("检测到新设备,请扫码验证",{icon:"📱"})):p.success("密码登录请求已发送")}catch(x){const u=x.message;p.error(`密码登录失败: ${u}`)}finally{i(!1)}},ne=async(c,s,x)=>{i(!0),G(!0);try{const u=M.MD5(s).toString(),Q=await C.captchaLogin(c,u,x.ticket,x.randstr,x.sid);Q!=null&&Q.needNewDevice&&Q.jumpUrl?(z(null),q({needNewDevice:!0,jumpUrl:Q.jumpUrl,newDevicePullQrCodeSig:Q.newDevicePullQrCodeSig||"",uin:c,password:s}),p("检测到异常设备,请扫码验证",{icon:"📱"})):(p.success("验证码登录请求已发送"),z(null))}catch(u){const Q=u.message;p.error(`验证码登录失败: ${Q}`),z(null)}finally{i(!1),G(!1)}},ie=()=>{z(null)},oe=async c=>{if(S){i(!0);try{const s=M.MD5(S.password).toString(),x=c||S.newDevicePullQrCodeSig,u=await C.newDeviceLogin(S.uin,s,x);u!=null&&u.needNewDevice&&u.jumpUrl?(q({needNewDevice:!0,jumpUrl:u.jumpUrl,newDevicePullQrCodeSig:u.newDevicePullQrCodeSig||"",uin:S.uin,password:S.password}),p("检测到异常设备,请继续扫码验证",{icon:"📱"})):(p.success("新设备验证登录请求已发送"),q(null))}catch(s){const x=s.message;p.error(`新设备验证登录失败: ${x}`),q(null)}finally{i(!1)}}},le=()=>{q(null)},F=async()=>{const c=k.current;I.current&&i(!0);try{const s=await C.checkQQLoginStatusWithQrcode();if(y(s.loginPhase||(s.isLogin?"ready":"waiting_qrcode")),s.loginPhase==="reconnecting"&&h(!0),I.current&&(i(!1),I.current=!1),s.isLogin)p.success("QQ登录成功"),a("/",{replace:!0});else if(c===k.current&&!N.current&&(w.current=s.qrcodeurl,t(s.qrcodeurl),s.qrcodeurl&&h(!1)),s.loginError&&s.loginError!==v.current){v.current=s.loginError,R(s.loginError);const x=B(s.loginError),u=s.loginPhase==="reconnecting"||f,Q=x.includes("二维码")&&(x.includes("过期")||x.includes("失效"));!u&&(!Q||A==="qrcode")&&l.alert({title:"登录失败",content:x,confirmText:"确定"})}else s.loginError||(v.current="",R(""))}catch(s){const x=s.message;f||p.error(`获取二维码失败: ${x}`)}},H=async()=>{W(!0);try{const c=await C.getQQQuickLoginListNew();U(c)}catch{try{const x=(await C.getQQQuickLoginList()).map(u=>({uin:u}));U(x)}catch(s){const x=s.message;p.error(`获取QQ列表失败: ${x}`)}}finally{W(!1)}},ce=c=>{o(c.target.value)},de=async()=>{if(f||g==="reconnecting"){p("QQ 登录服务正在恢复,请等待新的二维码…",{icon:"⏳"});return}if(!N.current){k.current+=1,N.current=!0,J(!0);try{v.current="",R("");const{qrcodeurl:c,restarting:s}=await C.refreshQRCode();if(s){h(!0),y("reconnecting");return}if(!c||c===w.current)throw new Error("未获取到新的二维码");w.current=c,t(c),p.success("二维码已刷新")}catch(c){const s=c.message;s.includes("QQ_LOGIN_SERVICE_RESTARTING")?(h(!0),y("reconnecting"),p("QQ 登录服务正在重启,正在生成新的二维码…",{icon:"⏳"})):s.includes("二维码刷新超时")?p.error("未能取得新的二维码,请稍后重试"):p.error(`刷新二维码失败: ${s}`)}finally{k.current+=1,N.current=!1,J(!1)}}},[ue,O]=r.useState(!1),[$,J]=r.useState(!1);return r.useEffect(()=>{const x=setInterval(()=>{F()},$||(g==="qrcode_scanned"||g==="initializing"||g==="reconnecting"||f)?500:3e3);return F(),H(),()=>clearInterval(x)},[$,g,f]),r.useEffect(()=>{if(!f)return;const c=setTimeout(()=>{h(!1),y("offline"),R("QQ 登录服务恢复超时,请稍后重试")},18e4);return()=>clearTimeout(c)},[f]),e.jsxs(e.Fragment,{children:[e.jsx("title",{children:"QQ登录 - SnowCat WebUI"}),e.jsx(we,{children:e.jsx(ze.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,type:"spring",stiffness:120,damping:20},className:"w-[608px] max-w-full py-8 px-2 md:px-8 overflow-hidden",children:e.jsxs(ye,{className:"items-center gap-4 pt-0 pb-6 rounded-3xl border border-white/70 dark:border-white/10 bg-white/70 dark:bg-white/[0.05] shadow-2xl shadow-primary-900/10",maxXRotation:3,maxYRotation:3,children:[e.jsxs(ge,{className:"inline-block max-w-lg text-center justify-center",children:[e.jsxs("div",{className:"flex items-center justify-center w-full gap-3 pt-9",children:[e.jsx(V,{alt:"logo",height:"5.5em",src:he,className:"drop-shadow-md"}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"text-2xl font-bold tracking-tight bg-gradient-to-r from-primary-500 to-secondary-400 bg-clip-text text-transparent",children:"SnowCat"}),e.jsx("div",{className:"text-tiny tracking-[0.28em] text-default-400 uppercase",children:"雪猫登录"})]})]}),e.jsxs("div",{className:"absolute right-4 top-4 flex items-center gap-2",children:[e.jsx(b,{isIconOnly:!0,variant:"light","aria-label":"Settings",onPress:()=>O(!0),children:e.jsx(pe,{size:22})}),e.jsx(ve,{})]})]}),e.jsxs(fe,{className:"flex gap-5 p-6 md:p-10 pt-0",children:[e.jsxs(xe,{fullWidth:!0,classNames:{tabList:"sc-tablist",cursor:"sc-tab-cursor"},isDisabled:m,size:"lg",selectedKey:A,onSelectionChange:c=>c!==null&&ee(c.toString()),children:[e.jsx(D,{title:"快速登录",children:e.jsx(De,{handleSelectionChange:ce,isLoading:m,qqList:_,refresh:E,selectedQQ:n,onSubmit:te,onUpdateQQList:H})},"shortcut"),e.jsx(D,{title:"密码登录",children:e.jsx($e,{isLoading:m,onSubmit:ae,onCaptchaSubmit:ne,onNewDeviceVerified:oe,qqList:_,captchaState:se,captchaVerifying:re,newDeviceState:S,onCaptchaCancel:ie,onNewDeviceCancel:le})},"password"),e.jsx(D,{title:"扫码登录",children:e.jsx(Me,{loginError:B(j),qrcode:d,onRefresh:de,isRefreshing:$,loginPhase:g,isRecoveringLoginService:f})},"qrcode")]}),e.jsx(b,{className:"w-fit mx-auto",variant:"light",color:"primary",onPress:()=>{a("/web_login",{replace:!0})},children:"返回 Web Login"})]})]})})}),ue&&e.jsx(me,{title:"设备 GUID 管理",content:e.jsx(je,{compact:!0,showRestart:!0}),size:"lg",hideFooter:!0,onClose:()=>O(!1)})]})}export{Es as default};