import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Tu as t,av as s}from"./shared-0-C4kdVF7Y.js";import{Mi as n,ki as i}from"./vendor-frame-CwiylG4Y.js";import{$t as a,rn as o}from"./vendor-all-2-BJdkbLSj.js";import{Ii as r,mr as d,pr as l}from"./shared-4-6CEyRAHb.js";var c=e(n()),m=i(),g=a({heading:{defaultMessage:"Sign in to continue",id:"szo7RqsEnz"},hint:{defaultMessage:"Use this code in your browser to finish signing in.",id:"zEHo4e5uFx"},open:{defaultMessage:"Reopen sign-in page",id:"k3yGzWwd/G"},waiting:{defaultMessage:"Waiting for sign-in\u2026",id:"aufbiHNTwC"}});function x(){const e=o(),n=t(),i=s(),a=d()?.pendingUserCode,x=i&&"app:"===window.location.protocol;return(0,c.useEffect)(()=>{i&&!x&&n.replace("/new")},[i,x,n]),x?(0,m.jsxs)("div",{className:"flex h-screen w-screen flex-col items-center justify-center gap-3 bg-bg-100 p-6 text-center",children:[(0,m.jsx)(r,{state:"thinking",className:"!w-8"}),(0,m.jsx)("h1",{className:"text-sm font-medium text-text-200",children:e.formatMessage(a?g.heading:g.waiting)}),a?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{"aria-describedby":"device-code-hint",className:"rounded-lg border-0.5 border-border-300 bg-bg-000 px-4 py-2 font-mono text-2xl tracking-[0.3em] text-text-100",children:a}),(0,m.jsx)("p",{id:"device-code-hint",className:"max-w-xs text-balance text-xs leading-normal text-text-400",children:e.formatMessage(g.hint)}),(0,m.jsx)("button",{type:"button",onClick:()=>{l()},className:"mt-2 rounded-lg bg-text-000 px-5 py-2 text-sm font-medium text-bg-000 hover:opacity-90",children:e.formatMessage(g.open)})]}):null]}):null}export{x as default};