import{e as N,u as D,c as T,A as L,i as t,a as s,L as E,S as y,m as q,b as R,n as z,t as m,r as O,I as M,T as j,__tla as __tla_0}from"./TeamThemeProvider-BMMWqJEv.js";import{__tla as __tla_1}from"./_virtual_wxt-plugins-D2Qy6pl9.js";Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{var B=m('<div style=flex:1;display:flex;flex-direction:column;justify-content:center;padding:24px><div style="background:var(--bg-primary);border-radius:12px;border:1px solid var(--border-secondary);overflow:hidden"><div style=padding:24px;text-align:center><div style="width:56px;height:56px;border-radius:12px;background:var(--bg-primary-solid);display:flex;align-items:center;justify-content:center;margin:0 auto 16px"></div><p style="font-family:var(--font-display);font-size:16px;font-weight:600;color:var(--text-primary);margin:0 0 4px"></p><p style=font-size:13px;color:var(--text-placeholder);margin:0></p></div><div style="padding:0 24px 24px"><div style=padding:12px;border-radius:8px;font-size:12px;line-height:1.5></div></div><div style="display:flex;gap:12px;padding:0 24px 24px"><button style="flex:1;height:44px;border-radius:8px;border:1px solid var(--border-secondary);background:var(--bg-primary);font-size:14px;font-weight:500;color:var(--text-tertiary);cursor:pointer"></button><button style=flex:1;height:44px;border-radius:8px;border:none;background:var(--text-primary);font-size:14px;font-weight:500;color:var(--fg-white);cursor:pointer>'),U=m('<div style=min-height:100vh;background:var(--bg-tertiary);font-family:var(--font-body);display:flex;flex-direction:column><div style="background:var(--bg-primary-solid);padding:16px 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border-secondary)"><span style=font-family:var(--font-display);font-size:12px;color:var(--color-grey-dark-400);text-transform:uppercase;letter-spacing:0.05em>'),G=m("<div style=flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-placeholder);font-size:14px>");const V=()=>{const{t:e}=D(),[d,p]=T(null),[c,$]=T(!1);L(()=>{(async()=>{const r=new URLSearchParams(window.location.hash.slice(1)),n=r.get("requestId"),i=r.get("responseToken")||r.get("nonce"),l=r.get("networkId")||void 0;if(!n||!i){p(null);return}try{const u=await chrome.runtime.sendMessage({type:"GET_PENDING_APPROVAL",requestId:n,responseToken:i}),a=u?.approval;if(!u?.success||!a?.requestId||!a.responseToken){p(null);return}p({requestId:a.requestId,responseToken:a.responseToken,type:a.type||"Approval Request",origin:a.origin||"Unknown",networkId:l})}catch{p(null)}})().catch(r=>{console.error("[Approval] failed to load pending approval:",r),p(null)})});const _=r=>{const n=d();!n||c()||($(!0),chrome.runtime.sendMessage({type:"WALLET_RESPONSE",requestId:n.requestId,responseToken:n.responseToken,data:{success:r}}).catch(i=>{console.error("[Approval] failed to send response:",i)}),setTimeout(()=>window.close(),300))},g=()=>d()?.type==="DAPP_CONNECT_APPROVAL",h=()=>{switch(d()?.type){case"DAPP_CONNECT_APPROVAL":return e("approval.connection_request");case"DAPP_SIGN_DATA":return e("approval.sign_data");case"DAPP_MAKE_TRANSFER":return e("approval.send_tokens");case"DAPP_MAKE_INTENT":return e("approval.create_transaction");case"DAPP_BALANCE_UNSEALED_TX":case"DAPP_BALANCE_SEALED_TX":return e("approval.balance_transaction");case"DAPP_SUBMIT_TRANSACTION":return e("approval.submit_transaction");case void 0:return e("approval.approval_request")}};return(()=>{var r=U(),n=r.firstChild,i=n.firstChild;return t(n,s(E,{class:"h-5 w-auto",animated:!0}),i),t(i,h),t(r,s(y,{get when(){return d()},get fallback(){return(()=>{var l=G();return t(l,()=>e("approval.no_request_found")),l})()},get children(){var l=B(),u=l.firstChild,a=u.firstChild,b=a.firstChild,A=b.nextSibling,I=A.nextSibling,P=a.nextSibling,x=P.firstChild,S=P.nextSibling,v=S.firstChild,f=v.nextSibling;return t(b,s(E,{class:"h-6 w-auto"})),t(A,h),t(I,()=>d().origin),t(x,s(y,{get when(){return g()},get children(){return e("approval.connect_desc")}}),null),t(x,s(y,{get when(){return!g()},get children(){return e("approval.spend_warning")}}),null),v.$$click=()=>_(!1),t(v,()=>e("approval.reject")),f.$$click=()=>_(!0),t(f,(()=>{var o=q(()=>!!c());return()=>o()?e("common.done"):e("approval.approve")})()),R(o=>{var C={...g()?{background:"var(--bg-tertiary)",color:"var(--text-tertiary)"}:{background:"var(--bg-warning-primary)",color:"var(--text-warning-primary)",border:"1px solid color-mix(in srgb, var(--warning-foreground) 30%, transparent)"}},w=c(),k=c();return o.e=z(x,C,o.e),w!==o.t&&(v.disabled=o.t=w),k!==o.a&&(f.disabled=o.a=k),o},{e:void 0,t:void 0,a:void 0}),l}}),null),r})()};N(["click"]);const K=document.getElementById("root");O(()=>s(j,{get children(){return s(M,{get children(){return s(V,{})}})}}),K)});