(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,649646,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(618566);function a(){let e=(0,l.useSearchParams)(),[a,i]=(0,s.useState)("processing");return(0,s.useEffect)(()=>{let t=e.get("code"),s=e.get("state"),l=e.get("error"),a={code:t,state:s,error:l,errorDescription:e.get("error_description"),fullUrl:window.location.href},c=[window.location.origin,"http://localhost:1455"];if(window.opener)for(let e of c)try{window.opener.postMessage({type:"oauth_callback",data:a},e)}catch(e){console.log("postMessage failed:",e)}try{let e=new BroadcastChannel("oauth_callback");e.postMessage(a),e.close()}catch(e){console.log("BroadcastChannel failed:",e)}try{localStorage.setItem("oauth_callback",JSON.stringify({...a,timestamp:Date.now()}))}catch(e){console.log("localStorage failed:",e)}t||l?(i("success"),setTimeout(()=>{window.close(),setTimeout(()=>i("done"),500)},1500)):setTimeout(()=>i("manual"),0)},[e]),(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,t.jsxs)("div",{className:"text-center p-8 max-w-md",children:["processing"===a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,t.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Processing..."}),(0,t.jsx)("p",{className:"text-text-muted",children:"Please wait while we complete the authorization."})]}),("success"===a||"done"===a)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,t.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Authorization Successful!"}),(0,t.jsx)("p",{className:"text-text-muted",children:"success"===a?"This window will close automatically...":"You can close this tab now."})]}),"manual"===a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-yellow-100 dark:bg-yellow-900/30 flex items-center justify-center",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-3xl text-yellow-600",children:"info"})}),(0,t.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Copy This URL"}),(0,t.jsx)("p",{className:"text-text-muted mb-4",children:"Please copy the URL from the address bar and paste it in the application."}),(0,t.jsx)("div",{className:"bg-surface border border-border rounded-lg p-3 text-left",children:(0,t.jsx)("code",{className:"text-xs break-all",children:window.location.href})})]})]})})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,t.jsxs)("div",{className:"text-center p-8",children:[(0,t.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,t.jsx)("p",{className:"text-text-muted",children:"Loading..."})]})}),children:(0,t.jsx)(a,{})})}])}]);