import{c as x,u as b,a as T,L as k,C as A}from"./index.js";import{d as E,o as I,a as z,b as r,c as l,k as o,F as _,j as p,u as t,A as c,r as N}from"./graphExplorationMessages.js";/**
 * @license lucide-vue-next v0.486.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const B=x("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-vue-next v0.486.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const R=x("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),V={class:"flex min-h-screen items-center justify-center bg-background px-6 text-center"},q={class:"max-w-md"},F={class:"text-2xl font-semibold text-foreground"},L={class:"mt-3 text-muted-foreground"},M={class:"text-2xl font-semibold text-foreground"},O={class:"mt-3 text-muted-foreground"},S={class:"text-2xl font-semibold text-foreground"},j={class:"mt-3 text-muted-foreground"},P=15,w=1e3,Y=E({__name:"OAuthCompletionPage",setup(D){const f=b(),{t:n}=T(),g=n("sidebar.title.agent_hub"),d=e=>typeof f.query[e]=="string"?f.query[e]:"",s={connection:d("connection"),connectionType:d("connectionType"),type:d("credentialType")},v=Object.values(s).every(Boolean),i=N("verifying");let y=0,u=null;function C(e){return e.connection===s.connection&&e.connectionType===s.connectionType&&e.type===s.type}async function h(){var e;try{const{data:a}=await A.getUserConnections(),m=(e=a==null?void 0:a.credentials)==null?void 0:e.find(C);if(m!=null&&m.credentialEntered){i.value="success";return}}catch{}if(y+=1,y>=P){i.value="failed";return}u=globalThis.setTimeout(()=>void h(),w)}return I(()=>{if(!v){i.value="failed";return}h()}),z(()=>{u&&globalThis.clearTimeout(u)}),(e,a)=>(r(),l("main",V,[o("section",q,[i.value==="success"?(r(),l(_,{key:0},[p(t(B),{class:"mx-auto mb-5 size-12 text-green-600","aria-hidden":"true"}),o("h1",F,c(t(n)("connection_credentials.oauth_completion.title")),1),o("p",L,c(t(n)("connection_credentials.oauth_completion.close_tab")),1)],64)):i.value==="verifying"?(r(),l(_,{key:1},[p(t(k),{class:"mx-auto mb-5 size-12 animate-spin text-primary","aria-hidden":"true"}),o("h1",M,c(t(n)("connection_credentials.oauth_completion.verifying_title")),1),o("p",O,c(t(n)("connection_credentials.oauth_completion.verifying_description")),1)],64)):(r(),l(_,{key:2},[p(t(R),{class:"mx-auto mb-5 size-12 text-destructive","aria-hidden":"true"}),o("h1",S,c(t(n)("connection_credentials.oauth_completion.failed_title")),1),o("p",j,c(t(n)("connection_credentials.oauth_completion.failed_description",{AppName:t(g)})),1)],64))])]))}});export{Y as default};
