import{j as e,m as t,L as u,u as m,r,A as p,R as y,a as h}from"./globals-f2ywyffr.js";import"./auth-DdS_72oQ.js";function l({user:a}){const n=async()=>{var s;try{typeof chrome<"u"&&((s=chrome.runtime)!=null&&s.sendMessage)&&chrome.runtime.sendMessage({action:"openSidePanel"},i=>{i!=null&&i.success&&setTimeout(()=>window.close(),100)})}catch(i){console.error("Failed to open sidebar:",i)}};return e.jsxs("div",{className:"relative w-full h-full overflow-hidden bg-kol-bg",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#050508] via-[#0a0f1a] to-[#050508]"}),e.jsx(t.div,{className:"absolute w-[300px] h-[300px] rounded-full",style:{background:"radial-gradient(circle, rgba(0, 123, 255, 0.15) 0%, transparent 70%)",top:"-100px",right:"-100px"},animate:{scale:[1,1.2,1],opacity:[.3,.5,.3]},transition:{duration:8,repeat:1/0,ease:"easeInOut"}}),e.jsx(t.div,{className:"absolute w-[250px] h-[250px] rounded-full",style:{background:"radial-gradient(circle, rgba(0, 196, 107, 0.1) 0%, transparent 70%)",bottom:"-80px",left:"-80px"},animate:{scale:[1.2,1,1.2],opacity:[.2,.4,.2]},transition:{duration:10,repeat:1/0,ease:"easeInOut"}})]}),e.jsx("div",{className:"relative z-10 flex flex-col h-full px-6 py-8 items-center justify-center",children:e.jsxs(t.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"text-center",children:[e.jsx(t.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.5,delay:.1},className:"mb-6 flex justify-center",children:e.jsx(u,{size:"lg",showText:!0,animated:!1})}),e.jsx(t.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4,delay:.2,type:"spring"},className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-kol-green/10 border border-kol-green/20 mb-5",children:e.jsx("i",{className:"ri-checkbox-circle-fill text-3xl text-kol-green"})}),e.jsx(t.h1,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.3},className:"font-body text-xl font-semibold text-white mb-2",children:"Welcome!"}),e.jsxs(t.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.4},className:"font-body text-sm text-kol-text-tertiary mb-2",children:["Signed in as"," ",e.jsxs("span",{className:"text-white font-medium font-mono text-xs",children:[a.walletAddress.slice(0,4),"...",a.walletAddress.slice(-4)]})]}),e.jsx(t.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.5},className:"font-body text-xs text-kol-text-muted mb-8 max-w-[260px] mx-auto leading-relaxed",children:"Open the FeeShield sidebar to access your dashboard, trading tools, and more."}),e.jsxs(t.button,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.6},onClick:n,className:"relative w-full h-12 rounded-xl font-body font-semibold text-sm overflow-hidden group",whileHover:{scale:1.02},whileTap:{scale:.98},children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-kol-blue to-kol-blue-hover transition-all duration-300 group-hover:brightness-110"}),e.jsxs("span",{className:"relative z-10 flex items-center justify-center gap-2 text-white",children:[e.jsx("i",{className:"ri-layout-right-line text-lg"}),"Open Dashboard"]})]}),e.jsx(t.p,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.4,delay:.8},className:"mt-4 text-[10px] text-kol-text-muted",children:"Or click the sidebar icon in your browser"})]})})]})}function f(){const{user:a,isLoading:n,isAuthenticated:s,setUser:i}=m(),[c,o]=r.useState("auth");if(r.useEffect(()=>{s&&a&&o("open-sidebar")},[s,a]),n)return e.jsx(b,{});if(s&&a)return e.jsx(l,{user:a});if(c==="open-sidebar"&&a)return e.jsx(l,{user:a});const d=x=>{i(x),o("open-sidebar")};return e.jsx(p,{onAuthSuccess:d})}function b(){return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-kol-bg",children:e.jsx("div",{className:"animate-spin",children:e.jsx("i",{className:"ri-loader-4-line text-2xl text-kol-blue"})})})}y.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(f,{})}));
