@nexus-cross/dapp-ui 1.1.1-beta.1 → 1.1.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";var ha=Object.create;var zt=Object.defineProperty;var ba=Object.getOwnPropertyDescriptor;var xa=Object.getOwnPropertyNames;var va=Object.getPrototypeOf,ya=Object.prototype.hasOwnProperty;var ka=(e,t)=>{for(var n in t)zt(e,n,{get:t[n],enumerable:!0})},mn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xa(t))!ya.call(e,o)&&o!==n&&zt(e,o,{get:()=>t[o],enumerable:!(r=ba(t,o))||r.enumerable});return e};var j=(e,t,n)=>(n=e!=null?ha(va(e)):{},mn(t||!e||!e.__esModule?zt(n,"default",{value:e,enumerable:!0}):n,e)),Ca=e=>mn(zt({},"__esModule",{value:!0}),e);var Ii={};ka(Ii,{APPLE_ICON:()=>Ut,AppLauncher:()=>yo,AppLauncherContent:()=>Co,AppLauncherTrigger:()=>ko,BINANCE_ICON:()=>Ht,CONNECTOR_REGISTRY:()=>Tt,CROSSX_ICON:()=>Bt,ConnectButton:()=>tn,ConnectorId:()=>Qt,GOOGLE_ICON:()=>$t,METAMASK_ICON:()=>Vt,SendPage:()=>St,TOKEN_STATS_QUERY_KEY:()=>eo,USER_BALANCE_QUERY_KEY:()=>Xt,WALLET_REGISTRY:()=>go,WalletConnectModal:()=>en,WalletInfo:()=>dt,WalletPortfolio:()=>Qo,WalletPortfolioBody:()=>st,resolveEnvironment:()=>me,useGlobalMenu:()=>Rt,useTokenBalance:()=>rt,useTokenStats:()=>it,useWalletDetect:()=>Dt});module.exports=Ca(Ii);function me(e){if(e)return fn(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return fn(t)}function fn(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var ht=j(require("react"),1),un=j(require("@radix-ui/react-popover"),1),gn=require("vaul");var jt=require("react"),vo=(0,jt.createContext)(null);function qt(){let e=(0,jt.useContext)(vo);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var Gt=require("react");function wt(e){let[t,n]=(0,Gt.useState)(!1);return(0,Gt.useEffect)(()=>{let r=window.matchMedia(e);n(r.matches);let o=d=>n(d.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),t}function _(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}_(`[data-theme=dark]{--al-bg: var(--cck-surface-bg, #1e232e);--al-bg-hover: var(--cck-surface-default, #252b39);--al-text: var(--cck-texticon-primary, hsla(200, 19%, 94%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(200, 10%, 70%, 1));--al-border: var(--cck-border-subtle, #3b4153);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #123f3c;--al-badge-text: hsla(168, 85%, 47%, 1);--al-badge-new-text: #000;--al-drawer-overlay: rgba(0, 0, 0, .6)}[data-theme=light]{--al-bg: var(--cck-surface-bg, #fff);--al-bg-hover: var(--cck-surface-default, #f3f6f8);--al-text: var(--cck-texticon-primary, hsla(221, 21%, 15%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(220, 10%, 40%, 1));--al-border: var(--cck-border-subtle, #ecf0f2);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #cdf4ed;--al-badge-text: hsla(170, 82%, 32%, 1);--al-badge-new-text: #fff;--al-drawer-overlay: rgba(0, 0, 0, .4)}
2
- `);_(`.al-trigger-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border:none;background:transparent;border-radius:8px;cursor:pointer;transition:background-color .15s ease}.al-trigger-btn[data-theme=dark]{color:#edf1f3}.al-trigger-btn[data-theme=light]{color:#1e232e}
3
- `);_(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
- `);_(`.al-popover-content{z-index:100001;border-radius:16px;background:var(--al-bg);border:1px solid var(--al-popover-border, var(--al-border));box-shadow:var(--al-popover-shadow, var(--al-shadow));animation:al-fade-in .15s ease-out;max-height:80vh;overflow-x:hidden;overflow-y:auto;padding:24px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:24px;column-gap:0;padding:0;justify-content:center}.al-popover-content .al-grid-item{flex-direction:column;justify-content:flex-start;align-items:center;gap:8px;padding:8px 0;width:100px;min-width:0;border-radius:10px}.al-popover-content .al-grid-item-left{flex-direction:column;align-items:center;gap:8px;width:100%;overflow:visible}.al-popover-content .al-grid-item-icon{width:54px;height:54px;border-radius:10.125px;overflow:hidden}.al-popover-content .al-grid-item-icon img{object-fit:cover}.al-popover-content .al-grid-item-label{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:1;letter-spacing:0;text-align:center;color:var(--al-text);max-width:100%;white-space:normal;overflow-wrap:anywhere}.al-popover-content .al-grid-item-right,.al-popover-content .al-badge-new{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;background:var(--al-bg);overflow-x:hidden;overflow-y:hidden;display:flex;flex-direction:column;box-sizing:border-box}.al-drawer-body{flex:1;overflow-y:auto;overscroll-behavior-y:contain;min-height:0}.al-drawer-content .al-grid{display:flex;flex-direction:column;grid-template-columns:none;max-width:100%;overflow:hidden;flex-shrink:0;gap:0;row-gap:0;column-gap:0;padding:16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding:16px 12px;border-radius:8px;overflow:hidden;background:transparent}.al-drawer-content .al-grid-item:hover,.al-drawer-content .al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-drawer-content .al-grid-item-left{gap:8px;flex:1 1 auto;min-width:0}.al-drawer-content .al-grid-item-icon{width:36px;height:36px;border-radius:6.75px;overflow:hidden}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.5;letter-spacing:-.16px;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.16px;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--al-text);transition:opacity .15s ease}.al-drawer-close:hover{opacity:.7}.al-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px;padding:8px}.al-grid-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 12px;border:none;background:transparent;border-radius:8px;cursor:pointer;transition:background-color .15s ease;color:var(--al-text);text-align:left;font-family:Inter,sans-serif;flex-shrink:0}.al-grid-item:hover,.al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}.al-grid-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:-.16px;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-badge{display:flex;padding:1px 4px 2px;justify-content:center;align-items:center;gap:2px;border-radius:3px;background:var(--al-badge-bg);color:var(--al-badge-text);font-family:Pretendard,Inter,sans-serif;font-size:10px;font-weight:600;line-height:150%;letter-spacing:-.1px;white-space:nowrap;flex-shrink:0}.al-badge-new{display:flex;width:16px;height:16px;justify-content:center;align-items:center;aspect-ratio:1/1;border-radius:12px;background:#7346f3;color:var(--al-badge-new-text);font-family:Pretendard,Inter,sans-serif;font-size:9px;font-weight:700;flex-shrink:0}
5
- `);_("");var Zt=require("react/jsx-runtime");function yo({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:r,children:o}){let d=wt(`(max-width: ${n}px)`),[i,c]=ht.useState(!1),p=ht.useCallback(()=>c(!1),[]),s=me(e),l=ht.useMemo(()=>({env:s,theme:t,isMobile:d,open:i,domain:r,close:p}),[s,t,d,i,r,p]);return(0,Zt.jsx)(vo.Provider,{value:l,children:d?(0,Zt.jsx)(gn.Drawer.Root,{direction:"right",open:i,onOpenChange:c,noBodyStyles:!0,children:o},"drawer"):(0,Zt.jsx)(un.Root,{open:i,onOpenChange:c,children:o},"popover")})}var xn=j(require("@radix-ui/react-popover"),1),vn=require("vaul");var ie=require("react/jsx-runtime");function wn({size:e=18}){return(0,ie.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ie.jsx)("rect",{width:"4",height:"4",fill:"currentColor"}),(0,ie.jsx)("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),(0,ie.jsx)("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),(0,ie.jsx)("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ie.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ie.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ie.jsx)("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ie.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ie.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function hn(){return(0,ie.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ie.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function bn(){return(0,ie.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ie.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Lt=require("react/jsx-runtime");function ko({asChild:e,children:t}){let{isMobile:n,theme:r}=qt(),o=t!=null,d=e??!0,i=o?t:(0,Lt.jsx)("button",{type:"button",className:"al-trigger-btn","data-theme":r,children:(0,Lt.jsx)(wn,{size:n?12:18})});return n?(0,Lt.jsx)(vn.Drawer.Trigger,{asChild:d,children:i}):(0,Lt.jsx)(xn.Trigger,{asChild:d,children:i})}var et=j(require("react"),1),Kt=j(require("@radix-ui/react-popover"),1),Je=require("vaul");var Cn=require("@tanstack/react-query");var yn={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var Na="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",La="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Ne(e,t){return`${e==="production"?La:Na}/${t}.png`}function kn(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:Ne(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:Ne(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:Ne(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:Ne(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:Ne(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:Ne(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:Ne(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:Ne(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:Ne(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:Ne(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function Rt(e){let t=me(e);return(0,Cn.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let r=await fetch(yn[t],{cache:"no-store",signal:n});if(!r.ok)throw new Error(`Failed to fetch global menu: ${r.status}`);return r.json()}catch(r){if(n.aborted)throw r;return kn(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function Y(...e){return e.filter(Boolean).join(" ")}var G=require("react/jsx-runtime");function Co({align:e="end",sideOffset:t=12,className:n}){let{env:r,theme:o,isMobile:d,domain:i,close:c}=qt(),{data:p}=Rt(r),s=et.useMemo(()=>(p?.items??[]).sort((b,E)=>b.order-E.order),[p]),l=8,f=et.useRef(null),v=et.useCallback(b=>{f.current={x:b.clientX,y:b.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",g=et.useCallback((b,E)=>{if(f.current){let k=b.clientX-f.current.x,U=b.clientY-f.current.y;if(f.current=null,Math.abs(k)>l||Math.abs(U)>l)return}let R=E.url[r]??E.url.production,B=Nn(R,i);if(!B)try{let k=new URL(R).pathname;if(h===k||h.startsWith(k+"/")){c();return}}catch{}B?window.open(R,"_blank","noopener,noreferrer"):window.location.href=R,c()},[r,i,c,h]),w=(0,G.jsx)("div",{className:"al-grid","data-theme":o,children:s.map(b=>{let E=b.url[r]??b.url.production,R=Nn(E,i),B=!1;if(!R)try{let k=new URL(E).pathname;B=h===k||h.startsWith(k+"/")}catch{B=!1}return(0,G.jsxs)("button",{type:"button",className:"al-grid-item","data-active":B||void 0,onPointerDown:v,onClick:k=>g(k,b),children:[(0,G.jsxs)("div",{className:"al-grid-item-left",children:[(0,G.jsx)("div",{className:"al-grid-item-icon",children:(0,G.jsx)("img",{src:b.iconUrl,alt:b.label,width:24,height:24,loading:"lazy"})}),(0,G.jsx)("span",{className:"al-grid-item-label",children:b.label}),b.isNew&&(0,G.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,G.jsx)("div",{className:"al-grid-item-right",children:b.badge&&(0,G.jsx)("span",{className:"al-badge",children:b.badge})})]},b.id)})});return d?(0,G.jsxs)(Je.Drawer.Portal,{children:[(0,G.jsx)(Je.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,G.jsxs)(Je.Drawer.Content,{className:Y("al-drawer-content",n),"data-theme":o,children:[(0,G.jsxs)("div",{className:"al-drawer-header",children:[(0,G.jsx)(Je.Drawer.Close,{className:"al-drawer-close",children:(0,G.jsx)(hn,{})}),(0,G.jsx)(Je.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,G.jsx)(Je.Drawer.Close,{className:"al-drawer-close",children:(0,G.jsx)(bn,{})})]}),(0,G.jsx)("div",{className:"al-drawer-body",children:w})]})]}):(0,G.jsx)(Kt.Portal,{children:(0,G.jsx)(Kt.Content,{align:e,sideOffset:t,className:Y("al-popover-content",n),"data-theme":o,children:w})})}function Nn(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var le=j(require("react"),1),zr=j(require("@radix-ui/react-popover"),1),jr=require("vaul");var Yt=require("react"),No=(0,Yt.createContext)(null);function $e(){let e=(0,Yt.useContext)(No);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Qt=(r=>(r.CROSSx="crossx",r.MetaMask="io.metamask",r.Binance="com.binance.wallet",r))(Qt||{}),Tt={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};var I=j(require("react"),1);var Ue=j(require("bignumber.js"),1);function Ra(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function tt(e,t){if(!e||e==="0")return"0.00";let n=new Ue.default(e).shiftedBy(-t),r=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(r,Ue.default.ROUND_DOWN)}function he(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Lo(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,r=Math.pow(10,n);return`$${(Math.floor(t*r)/r).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function Ln(e,t,n){let o=new Ue.default(e).shiftedBy(-t).multipliedBy(new Ue.default(n));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(Ue.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,Ue.default.ROUND_DOWN):o.decimalPlaces(4,Ue.default.ROUND_DOWN)).toFormat()}`}function Rn(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let n=t;if(n.includes("e")||n.includes("E")){let i=Number(n);if(!Number.isFinite(i)||i===0)return{displayValue:"0",isLowerBound:!1};n=Ra(i.toFixed(18))}let[r="0",o=""]=n.split(".");if(Number(r)>=1){let i=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(r).toLocaleString("en-US")}.${i}`,isLowerBound:!1}}return o.length<4?{displayValue:`${r}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}var be={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},fe={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var Ro={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Tn={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function To(e,t){let n=fe[e];if(t===n.cross)return Tn.cross;if(t===n.bsc)return Tn.bsc}var Ta={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function ot(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:r=120,bg:o,format:d="png"}=n,i=Ta[e],c=o?`&bg=${o}`:"";return`${i}/portrait/evm/${t}.${d}?size=${r}${c}`}var O=require("react/jsx-runtime");function En({size:e=16,className:t}){return(0,O.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,O.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,O.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Eo({size:e=16,className:t}){return(0,O.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,O.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function Et({size:e=16,className:t}){return(0,O.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,O.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Io({size:e=24,className:t}){return(0,O.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,O.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function In({size:e=20,className:t}){return(0,O.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,O.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,O.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Pn({size:e=20,className:t}){return(0,O.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,O.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function Sn({size:e=20,className:t}){return(0,O.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,O.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Mn({size:e=20,className:t}){return(0,O.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,O.jsx)("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function _n({size:e=20,className:t}){return(0,O.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,O.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function An({size:e=16,className:t}){return(0,O.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,O.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,O.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function On({size:e=16,className:t}){return(0,O.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,O.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,O.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Dn({size:e=42,className:t}){return(0,O.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,O.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}var Wn=require("react"),Fn=require("@tanstack/react-query");var Ea="send:chain-info";function Ia(e){return"data"in e&&e.data?e.data:e}function Po(e,...t){let n=e.replace(/\/+$/,""),r=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...r].join("/")}function Pa(e,t,n,r){if(r)return t===fe[e].cross?Bn(t,r):n?.explorer_url?Po(n.explorer_url,n.explorer_postfix?.transaction??"tx",r):Sa(e,t,r)}function Bn(e,t){return Po("https://explorer.crosstoken.io",String(e),"tx",t)}function Sa(e,t,n){let r=fe[e];if(t===r.cross)return Bn(t,n);if(t===r.bsc)return Po(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function Vn(e,t,n,r=!0){let o=be[e],{data:d,...i}=(0,Fn.useQuery)({queryKey:[Ea,e,t],queryFn:async({signal:p})=>{let s=await fetch(`${o}/v1/public/chain/info/${t}`,{cache:"no-store",signal:p});if(!s.ok)throw new Error(`Failed to fetch chain info: ${s.status}`);let l=await s.json();if("code"in l&&l.code!==void 0&&l.code!==200)throw new Error(`Chain info API error: ${l.code}`);return Ia(l)},enabled:r,staleTime:300*1e3});return{transactionUrl:(0,Wn.useMemo)(()=>Pa(e,t,d,n),[t,d,e,n]),...i}}var Hn="0x0000000000000000000000000000000000000001";var Ma="0xa9059cbb",_a=/^0x[a-fA-F0-9]{40}$/,Aa="nexus-cross:dapp-ui:send:recent:",$n=10;function Oa(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function It(e){return e.toLowerCase()}function Pt(e){return _a.test(e)}function So(e){return It(e.address)===Hn}function Mo(e){return`${Aa}${e.toLowerCase()}`}function bt(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Mo(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>r!==null&&typeof r=="object"&&Pt(r.address)&&typeof r.updatedAt=="number").slice(0,$n):[]}catch{return[]}}function _o(e,t){if(typeof window>"u")return[];let n=It(t),r=[{address:n,updatedAt:Date.now()},...bt(e).filter(o=>o.address!==n)].slice(0,$n);try{window.localStorage.setItem(Mo(e),JSON.stringify(r))}catch{return bt(e)}return r}function Ao(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Mo(e))}catch{}}function Oo(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[r="0",o=""]=n.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let d=BigInt(r||"0"),i=o.padEnd(t,"0"),c=i?BigInt(i):0n,p=10n**BigInt(t),s=d*p+c;return s<=0n?{error:"Amount must be greater than 0."}:{value:s}}function Do(e,t){let n=BigInt(e||"0"),r=10n**BigInt(t),o=n/r,d=n%r;if(d===0n)return o.toString();let i=Oa(d.toString().padStart(t,"0"));return`${o.toString()}.${i}`}function Wo(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),r=t.toString(16).padStart(64,"0");return`${Ma}${n}${r}`}_(`.wi-token-item--button{position:relative;width:100%;border:none;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:12px;padding:6px 8px;margin:-2px -8px;transition:background-color .15s ease,transform .15s ease}.wi-token-item--button:before{content:"";position:absolute;inset:-6px -16px;border-radius:16px}.wi-token-item--button:active{transform:scale(.99)}.wi-token-item--button:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.wi-view-send{animation:wi-slide-in-right .25s ease-out}.wi-send-body{flex:1;min-height:0;overflow:hidden}.wi-drawer-content[data-direction=bottom][data-view=send]{max-height:100dvh}.send-page{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.send-scroll{flex:1;min-height:0;display:flex;flex-direction:column;gap:16px;overflow-y:auto;overflow-x:hidden;padding:16px 24px 18px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .send-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.send-scroll::-webkit-scrollbar{width:4px}.send-scroll::-webkit-scrollbar-track{background:transparent}.send-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}[data-theme=light] .send-scroll::-webkit-scrollbar-thumb{background:#0000001f}.send-section{display:flex;flex-direction:column;gap:8px}.send-asset-card{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.send-asset-card:disabled{cursor:default}.send-asset-card:not(:disabled):hover,.send-asset-card[aria-expanded=true]{border-color:var(--wi-primary);background:var(--wi-surface-subtle)}.send-token-list{display:flex;flex-direction:column;gap:6px;max-height:180px;overflow-y:auto;padding:6px;border:1px solid var(--wi-border-subtle);border-radius:16px;background:var(--wi-surface-default)}.send-token-option{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:48px;border:none;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer}.send-token-option:hover,.send-token-option[data-selected]{background:var(--wi-surface-subtle)}.send-token-option:focus-visible,.send-asset-card:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-token-option-icon{flex-shrink:0;width:28px;height:28px;border-radius:8px;object-fit:contain;background:transparent}.send-token-option-symbol{color:var(--wi-texticon-primary);font-size:13px;font-weight:700;line-height:1.3}.send-token-option-balance{color:var(--wi-texticon-secondary);font-size:12px;font-weight:600;line-height:1.3;white-space:nowrap}.send-asset-left{display:flex;align-items:center;gap:12px;min-width:0}.send-asset-icon{flex-shrink:0;width:40px;height:40px;border-radius:12px;object-fit:contain;background:transparent}.send-asset-info,.send-asset-balance{min-width:0;display:flex;flex-direction:column}.send-asset-symbol{color:var(--wi-texticon-primary);font-size:15px;font-weight:700;line-height:1.3}.send-asset-name,.send-balance-label{color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.send-asset-balance{align-items:flex-end;text-align:right}.send-balance-value{color:var(--wi-texticon-primary);font-size:13px;font-weight:600;line-height:1.35;white-space:nowrap}.send-form{display:flex;flex-direction:column;gap:14px}.send-field{display:flex;flex-direction:column;gap:8px}.send-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.send-label{color:var(--wi-texticon-secondary);font-size:13px;font-weight:600;line-height:1.3}.send-input,.send-amount-wrap{width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);color:var(--wi-texticon-primary);font:inherit}.send-input{min-height:46px;padding:0 14px;font-size:16px;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.send-input:focus{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-address-wrap[data-invalid],.send-amount-wrap[data-invalid]{border-color:#ff6b6b}.send-address-wrap[data-invalid]:focus-within,.send-amount-wrap[data-invalid]:focus-within{border-color:#ff6b6b;box-shadow:0 0 0 3px #ff6b6b29}.send-input::placeholder{color:var(--wi-texticon-tertiary)}.send-address-wrap{display:flex;align-items:center;width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);transition:border-color .15s ease,box-shadow .15s ease}.send-address-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--address{flex:1;min-width:0;border:none;background:transparent;box-shadow:none}.send-input--address:focus{box-shadow:none}.send-address-book-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;margin-right:2px;border:none;border-radius:12px;background:transparent;color:var(--wi-texticon-tertiary);cursor:pointer;transition:background-color .15s ease,color .15s ease}.send-address-book-btn:hover,.send-address-book-btn[aria-expanded=true]{background:var(--wi-surface-subtle);color:var(--wi-primary)}.send-address-book-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-picker{display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default)}.send-address-tabs{display:flex;align-items:center;gap:22px;border-bottom:1px solid var(--wi-border-subtle)}.send-address-tab{position:relative;border:none;background:transparent;color:var(--wi-texticon-tertiary);font:inherit;font-size:14px;font-weight:800;line-height:1.3;padding:0 0 12px;cursor:pointer}.send-address-tab[data-active]{color:var(--wi-primary)}.send-address-tab[data-active]:after{content:"";position:absolute;left:50%;bottom:-1px;width:34px;height:4px;border-radius:999px;background:var(--wi-primary);transform:translate(-50%)}.send-address-list{display:flex;flex-direction:column;gap:10px;max-height:224px;overflow-y:auto;padding-right:10px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}[data-theme=light] .send-address-list{scrollbar-color:rgba(0,0,0,.14) transparent}.send-address-list::-webkit-scrollbar{width:3px}.send-address-list::-webkit-scrollbar-track{background:transparent}.send-address-list::-webkit-scrollbar-thumb{background:#ffffff2e;border-radius:999px}[data-theme=light] .send-address-list::-webkit-scrollbar-thumb{background:#00000024}.send-address-option{display:flex;align-items:center;gap:12px;width:100%;min-height:54px;border:none;border-radius:14px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer;transition:background-color .15s ease}.send-address-option:hover{background:var(--wi-surface-subtle)}.send-address-option:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--wi-surface-subtle);color:var(--wi-primary);font-size:12px;font-weight:800;overflow:hidden}.send-address-avatar-img{position:relative;z-index:1;width:36px;height:36px;border-radius:50%;object-fit:cover}.send-address-avatar-fallback{position:absolute;inset:0;display:inline-flex;align-items:center;justify-content:center}.send-address-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.send-address-name{color:var(--wi-texticon-primary);font-size:14px;font-weight:800;line-height:1.3}.send-address-value{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:600;line-height:1.3}.send-address-empty{display:flex;align-items:center;justify-content:center;min-height:120px;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:700}.send-amount-wrap{display:flex;align-items:center;padding-right:12px}.send-amount-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--amount{border:none;background:transparent;box-shadow:none;flex:1;min-width:0}.send-input--amount:focus{box-shadow:none}.send-amount-symbol{color:var(--wi-texticon-secondary);font-size:13px;font-weight:700}.send-field-error{margin:-2px 0 0;color:#ff6b6b;font-size:12px;font-weight:600;line-height:1.35}.send-max-btn{border:none;border-radius:999px;background:var(--wi-surface-subtle);color:var(--wi-primary);font:inherit;font-size:12px;font-weight:700;padding:4px 10px;cursor:pointer}.send-max-btn:disabled{cursor:not-allowed;opacity:.45}.send-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.4}.send-meta span:last-child{color:var(--wi-texticon-secondary);font-weight:600}.send-message{border-radius:14px;padding:10px 12px;font-size:12px;line-height:1.45}.send-message--error{background:#ff50501f;color:#ff6b6b}.send-message--success{background:color-mix(in srgb,var(--wi-primary) 12%,transparent);color:var(--wi-primary)}.send-message span{font-weight:700}.send-submit-btn{width:100%;min-height:48px;border:none;border-radius:999px;background:var(--wi-primary);color:var(--wi-primary-contrast, #001410);font:inherit;font-size:15px;font-weight:800;cursor:pointer;transition:opacity .15s ease,transform .15s ease}.send-submit-btn:hover:not(:disabled):not([data-disabled]){transform:translateY(-1px)}.send-submit-btn:disabled,.send-submit-btn[data-disabled]{cursor:not-allowed;opacity:.45}.send-footer{flex-shrink:0;padding:14px 24px 24px;border-top:1px solid var(--wi-border-subtle);background:var(--wi-surface-bg)}.send-page--success{background:var(--wi-surface-bg)}.send-success-body{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:32px 24px;text-align:center}.send-success-icon{display:inline-flex;align-items:center;justify-content:center}.send-success-icon[data-pending]{width:56px;height:56px;border-radius:50%;background:color-mix(in srgb,var(--wi-primary) 14%,transparent)}.send-success-spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--wi-primary) 22%,transparent);border-top-color:var(--wi-primary);border-radius:50%;animation:cross-send-spin .8s linear infinite}.send-success-copy{display:flex;flex-direction:column;gap:8px}.send-success-title{margin:0;color:var(--wi-texticon-primary);font-size:22px;font-weight:800;line-height:1.25}.send-success-desc{margin:0;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:600;line-height:1.45}.send-success-hash-card{width:100%;display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);box-sizing:border-box}.send-success-hash-label{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:700;line-height:1.3;text-align:left}.send-success-hash-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:none;border-radius:12px;background:var(--wi-surface-subtle);color:var(--wi-texticon-primary);font:inherit;font-size:14px;font-weight:800;padding:12px}.send-success-hash-link{flex:1;display:inline-flex;align-items:center;align-self:stretch;min-width:0;border:none;background:transparent;color:inherit;font:inherit;font-weight:inherit;padding:0;text-align:left;text-decoration:none;cursor:pointer;user-select:none}.send-success-hash-link:hover{color:var(--wi-primary)}.send-success-hash-link:focus-visible,.send-success-copy-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-success-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:32px;border:none;background:transparent;color:var(--wi-primary);font:inherit;font-size:12px;font-weight:800;padding:0;cursor:pointer}@keyframes cross-send-spin{to{transform:rotate(360deg)}}
6
- `);var m=require("react/jsx-runtime"),Da=1500,Wa=120;function Fo(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Un(e,t){return e.name||`Account ${(e.index??t)+1}`}function zn(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Fa(e){return new Promise(t=>setTimeout(t,e))}function Ba(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}function Va(e){return!!(e.token||e.recipient||e.amount)}function Ha(){return(0,m.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[(0,m.jsx)("path",{d:"M4.5 4.5C4.5 3.67 5.17 3 6 3h8.25c.69 0 1.25.56 1.25 1.25V16.5H6A1.5 1.5 0 0 1 4.5 15V4.5Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M4.5 14.5C4.5 13.67 5.17 13 6 13h9.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),(0,m.jsx)("path",{d:"M8 6.5h4M8 9h3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function $a(){return(0,m.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none","aria-hidden":"true",children:[(0,m.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--wi-primary)"}),(0,m.jsx)("path",{d:"M17 28.5L24.2 35.5L39 20.5",stroke:"var(--wi-primary-contrast, #001410)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function St({env:e,theme:t="dark",walletAddress:n,accounts:r=[],token:o,tokens:d=[],onTokenChange:i,sendTransaction:c,getTransactionReceipt:p,onSuccess:s,onConfirmSuccess:l,onOutlink:f}){let[v,h]=I.useState(""),[g,w]=I.useState(""),[b,E]=I.useState(""),[R,B]=I.useState({}),[k,U]=I.useState(""),[C,N]=I.useState(!1),[z,L]=I.useState(!1),[M,q]=I.useState(!1),[ne,Ae]=I.useState("account"),xe=I.useRef(void 0),Ie=I.useRef(void 0),ke=I.useRef(null),te=I.useRef(null),[Oe,De]=I.useState(()=>bt(n)),[X,re]=I.useState("idle"),We=So(o),Pe=I.useMemo(()=>BigInt(o.quantity.numeric||"0"),[o.quantity.numeric]),mt=I.useMemo(()=>tt(o.quantity.numeric,o.quantity.decimals),[o.quantity.numeric,o.quantity.decimals]),ve=I.useMemo(()=>r.filter(u=>u.address.toLowerCase()!==n.toLowerCase()),[r,n]),Fe=I.useMemo(()=>{let u=new Map;return ve.forEach((T,D)=>{u.set(T.address.toLowerCase(),{account:T,index:D})}),u},[ve]),ge=ve.length>0,we=I.useMemo(()=>me(e),[e]),Be=t==="dark"?"1A1A2E":"F3F6F8",Se=d.length>0?d:[o],ce=Se.length>1&&!!i,{transactionUrl:de}=Vn(we,o.chainId,k||void 0,!!k);I.useEffect(()=>{E(""),B({}),U(""),re("idle")},[o.address,o.chainId,v,g]),I.useEffect(()=>{w(""),N(!1)},[o.address,o.chainId]),I.useEffect(()=>{De(bt(n))},[n]),I.useEffect(()=>()=>{clearTimeout(xe.current),clearTimeout(Ie.current)},[]),I.useEffect(()=>{!ge&&ne==="account"&&Ae("recent")},[ne,ge]),I.useEffect(()=>{let u=window.visualViewport,T=ke.current;if(!u||!T)return;let D=()=>{let ae=document.activeElement;return T.contains(ae)&&(ae instanceof HTMLInputElement||ae instanceof HTMLTextAreaElement)},V=()=>{T.style.paddingBottom=""},Z=()=>{if(!D()){V();return}let ae=Math.max(0,window.innerHeight-u.height-u.offsetTop);ae>0?T.style.paddingBottom=`${ae}px`:V();let pe=document.activeElement;pe instanceof HTMLElement&&requestAnimationFrame(()=>{pe.scrollIntoView({behavior:"smooth",block:"nearest"})})},K=()=>{setTimeout(()=>{D()||V()},0)};return u.addEventListener("resize",Z),window.addEventListener("resize",Z),T.addEventListener("focusout",K),()=>{u.removeEventListener("resize",Z),window.removeEventListener("resize",Z),T.removeEventListener("focusout",K),V()}},[]);let Ke=I.useCallback(()=>{clearTimeout(Ie.current),Ie.current=setTimeout(()=>{te.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},10)},[]),ft=I.useCallback(()=>{w(Do(o.quantity.numeric,o.quantity.decimals))},[o.quantity.numeric,o.quantity.decimals]),ut=I.useCallback(u=>{h(u),L(!1)},[]),Ce=I.useCallback(()=>{let u={},T=v.trim(),D=Oo(g,o.quantity.decimals),V;return T?Pt(T)||(u.recipient="Enter a valid EVM recipient address."):u.recipient="Enter a recipient address.","error"in D?u.amount=D.error:(V=D.value,V>Pe&&(u.amount="Amount exceeds available balance.")),!We&&!Pt(o.address)&&(u.token="Token contract address is invalid."),{errors:u,rawAmount:V,trimmedRecipient:T}},[g,Pe,We,v,o.address,o.quantity.decimals]),gt=I.useCallback(async()=>{if(k)try{await navigator.clipboard.writeText(k),q(!0),clearTimeout(xe.current),xe.current=setTimeout(()=>q(!1),2e3)}catch{}},[k]),Ye=I.useCallback(()=>{if(!de||!k)return;let u=V=>{typeof window>"u"||window.open(V,"_blank","noopener,noreferrer")};if(!f){u(de);return}let T=f(de,{category:"send",origin:"send-transaction",payload:{chainId:o.chainId,txHash:k}});if(T&&(typeof T=="object"||typeof T=="function")&&typeof T.then=="function"){let V=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;T.then(Z=>{if(Z===null){V?.close();return}let K=Z??de;if(V)try{V.location.href=K}catch{V.close(),u(K)}else u(K)});return}let D=T;D!==null&&u(D??de)},[f,o.chainId,de,k]),Ve=I.useCallback(async u=>{if(u.preventDefault(),E(""),U(""),!c){re("error"),E("Sending is not available for this wallet.");return}let{errors:T,rawAmount:D,trimmedRecipient:V}=Ce();if(B(T),Va(T)||D===void 0){re("error");return}let Z=V;try{re("submitting");let K=We?await c({to:Z,value:D,chainId:o.chainId}):await c({to:It(o.address),data:Wo(Z,D),value:0n,chainId:o.chainId});if(U(K),re("confirming"),De(_o(n,Z)),s?.(K),!p){re("success");return}for(let ae=0;ae<Wa;ae+=1){let pe=await p({hash:K,chainId:o.chainId}).catch(()=>null);if(pe){if(Ba(pe)){re("error"),E("Transaction reverted on-chain.");return}re("success");return}await Fa(Da)}re("error"),E("Transaction receipt was not found. Please check again later.")}catch(K){re("error"),E(K instanceof Error?K.message:"Failed to send transaction.")}},[g,p,We,s,c,o.address,o.chainId,Ce,n]),He=X==="submitting"||Pe<=0n||!v.trim()||!g.trim();if((X==="confirming"||X==="success")&&k){let u=X==="success";return(0,m.jsxs)("div",{className:"send-page send-page--success",children:[(0,m.jsxs)("div",{className:"send-success-body","data-vaul-no-drag":!0,children:[(0,m.jsx)("div",{className:"send-success-icon","data-pending":!u||void 0,children:u?(0,m.jsx)($a,{}):(0,m.jsx)("span",{className:"send-success-spinner"})}),(0,m.jsxs)("div",{className:"send-success-copy",children:[(0,m.jsx)("h3",{className:"send-success-title",children:u?"Transfer Complete":"Transfer in Progress"}),(0,m.jsx)("p",{className:"send-success-desc",children:u?"Transfer complete.":"Transfer in progress. Waiting for confirmation."})]}),(0,m.jsxs)("div",{className:"send-success-hash-card",children:[(0,m.jsx)("span",{className:"send-success-hash-label",children:"Transaction Hash"}),(0,m.jsxs)("div",{className:"send-success-hash-row","data-vaul-no-drag":!0,children:[(0,m.jsx)("button",{type:"button",className:"send-success-hash-link",onClick:Ye,"aria-label":"Open transaction in explorer",children:he(k)}),(0,m.jsx)("button",{type:"button",className:"send-success-copy-btn",onClick:gt,"aria-label":"Copy transaction hash",children:M?(0,m.jsx)(Et,{size:16}):"Copy"})]})]})]}),(0,m.jsx)("div",{className:"send-footer",children:(0,m.jsx)("button",{type:"button",className:"send-submit-btn",onClick:l,disabled:!u,children:u?"Completed":"Sending..."})})]})}return(0,m.jsxs)("form",{className:"send-page",onSubmit:Ve,children:[(0,m.jsxs)("div",{className:"send-scroll","data-vaul-no-drag":!0,ref:ke,children:[(0,m.jsxs)("section",{className:"send-section","aria-label":"Select token to send",children:[(0,m.jsx)("span",{className:"send-label",children:"Token"}),(0,m.jsxs)("button",{type:"button",className:"send-asset-card",onClick:()=>{ce&&N(u=>!u)},disabled:!ce,"aria-expanded":ce?C:void 0,children:[(0,m.jsxs)("span",{className:"send-asset-left",children:[(0,m.jsx)("img",{className:"send-asset-icon",src:o.icon_url,alt:o.symbol,width:40,height:40,draggable:!1,onError:u=>{u.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,m.jsxs)("span",{className:"send-asset-info",children:[(0,m.jsx)("span",{className:"send-asset-symbol",children:o.symbol}),(0,m.jsx)("span",{className:"send-asset-name",children:o.name})]})]}),(0,m.jsxs)("span",{className:"send-asset-balance",children:[(0,m.jsx)("span",{className:"send-balance-label",children:"Available"}),(0,m.jsxs)("span",{className:"send-balance-value",children:[mt," ",o.symbol]})]})]}),ce&&C&&(0,m.jsx)("div",{className:"send-token-list",role:"listbox",children:Se.map(u=>{let T=Fo(u)===Fo(o);return(0,m.jsxs)("button",{type:"button",role:"option","aria-selected":T,className:"send-token-option","data-selected":T||void 0,onClick:()=>i?.(u),children:[(0,m.jsxs)("span",{className:"send-asset-left",children:[(0,m.jsx)("img",{className:"send-token-option-icon",src:u.icon_url,alt:u.symbol,width:28,height:28,draggable:!1,onError:D=>{D.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,m.jsxs)("span",{className:"send-asset-info",children:[(0,m.jsx)("span",{className:"send-token-option-symbol",children:u.symbol}),(0,m.jsx)("span",{className:"send-asset-name",children:u.name})]})]}),(0,m.jsx)("span",{className:"send-token-option-balance",children:tt(u.quantity.numeric,u.quantity.decimals)})]},Fo(u))})}),R.token&&(0,m.jsx)("p",{className:"send-field-error",role:"alert",children:R.token})]}),(0,m.jsxs)("section",{className:"send-field","aria-label":"Recipient address",children:[(0,m.jsx)("span",{className:"send-label",children:"To"}),(0,m.jsxs)("div",{className:"send-address-wrap","data-invalid":R.recipient||void 0,children:[(0,m.jsx)("input",{className:"send-input send-input--address",value:v,onChange:u=>h(u.target.value),placeholder:"0x...",autoComplete:"off",spellCheck:!1,"aria-invalid":!!R.recipient,"aria-describedby":R.recipient?"send-recipient-error":void 0}),(0,m.jsx)("button",{type:"button",className:"send-address-book-btn",onClick:()=>L(u=>!u),"aria-label":"Open address book","aria-expanded":z,children:(0,m.jsx)(Ha,{})})]}),R.recipient&&(0,m.jsx)("p",{id:"send-recipient-error",className:"send-field-error",role:"alert",children:R.recipient}),z&&(0,m.jsxs)("div",{className:"send-address-picker",children:[(0,m.jsxs)("div",{className:"send-address-tabs",role:"tablist",children:[ge&&(0,m.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":ne==="account"||void 0,"aria-selected":ne==="account",onClick:()=>Ae("account"),children:"My Account"}),(0,m.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":ne==="recent"||void 0,"aria-selected":ne==="recent",onClick:()=>Ae("recent"),children:"Recent"})]}),ge&&ne==="account"?(0,m.jsx)("div",{className:"send-address-list",children:ve.map((u,T)=>{let D=Un(u,T),V=ot(we,u.address,{size:56,bg:Be});return(0,m.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>ut(u.address),children:[(0,m.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[V&&(0,m.jsx)("img",{className:"send-address-avatar-img",src:V,alt:"",width:36,height:36,draggable:!1,onError:Z=>{Z.currentTarget.style.display="none"}}),(0,m.jsx)("span",{className:"send-address-avatar-fallback",children:zn(D)})]}),(0,m.jsxs)("span",{className:"send-address-copy",children:[(0,m.jsx)("span",{className:"send-address-name",children:D}),(0,m.jsx)("span",{className:"send-address-value",children:he(u.address)})]})]},u.address)})}):Oe.length>0?(0,m.jsx)("div",{className:"send-address-list",children:Oe.map(u=>{let T=Fe.get(u.address.toLowerCase()),D=T?Un(T.account,T.index):void 0,V=ot(we,u.address,{size:56,bg:Be});return(0,m.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>ut(u.address),children:[(0,m.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[V&&(0,m.jsx)("img",{className:"send-address-avatar-img",src:V,alt:"",width:36,height:36,draggable:!1,onError:Z=>{Z.currentTarget.style.display="none"}}),(0,m.jsx)("span",{className:"send-address-avatar-fallback",children:D?zn(D):u.address.slice(2,4).toUpperCase()})]}),(0,m.jsxs)("span",{className:"send-address-copy",children:[(0,m.jsx)("span",{className:"send-address-name",children:D??he(u.address)}),(0,m.jsx)("span",{className:"send-address-value",children:T?he(T.account.address):"Recently sent"})]})]},u.address)})}):(0,m.jsx)("div",{className:"send-address-empty",children:"No Send History"})]})]}),(0,m.jsxs)("section",{className:"send-field","aria-labelledby":"send-amount-label",children:[(0,m.jsxs)("span",{className:"send-label-row",children:[(0,m.jsx)("span",{id:"send-amount-label",className:"send-label",children:"Amount"}),(0,m.jsx)("button",{type:"button",className:"send-max-btn",onClick:ft,disabled:Pe<=0n||X==="submitting",children:"Max"})]}),(0,m.jsxs)("div",{className:"send-amount-wrap","data-invalid":R.amount||void 0,children:[(0,m.jsx)("input",{ref:te,className:"send-input send-input--amount",value:g,onChange:u=>w(u.target.value),onFocus:Ke,placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-labelledby":"send-amount-label","aria-invalid":!!R.amount,"aria-describedby":R.amount?"send-amount-error":void 0}),(0,m.jsx)("span",{className:"send-amount-symbol",children:o.symbol})]}),R.amount&&(0,m.jsx)("p",{id:"send-amount-error",className:"send-field-error",role:"alert",children:R.amount})]}),(0,m.jsxs)("div",{className:"send-meta",children:[(0,m.jsx)("span",{children:"From"}),(0,m.jsx)("span",{children:he(n)})]}),(0,m.jsxs)("div",{className:"send-meta",children:[(0,m.jsx)("span",{children:"Network"}),(0,m.jsxs)("span",{children:["Chain ID ",o.chainId]})]}),b&&(0,m.jsx)("div",{className:"send-message send-message--error",role:"alert",children:b})]}),(0,m.jsx)("div",{className:"send-footer",children:(0,m.jsx)("button",{type:"submit",className:"send-submit-btn",disabled:X==="submitting","data-disabled":He||void 0,"aria-disabled":He,children:X==="submitting"?"Sending...":"Send"})})]})}var jn=j(require("@radix-ui/react-popover"),1),qn=require("vaul");var nt=require("react/jsx-runtime");function Gn({asChild:e,className:t,children:n}){let{isMobile:r,theme:o,walletAddress:d}=$e(),i=n!=null,c=e??!0,p=i?n:(0,nt.jsxs)("button",{type:"button",className:Y("wi-trigger-btn",t),"data-theme":o,"data-mobile":r||void 0,children:[(0,nt.jsx)(En,{size:r?14:16}),(0,nt.jsx)("span",{className:"wi-trigger-address",children:he(d)})]});return r?(0,nt.jsx)(qn.Drawer.Trigger,{asChild:c,children:p}):(0,nt.jsx)(jn.Trigger,{asChild:c,children:p})}var $=j(require("react"),1),co=j(require("@radix-ui/react-popover"),1),At=require("vaul");var yt=j(require("bignumber.js"),1);var Zn=require("@tanstack/react-query"),Kn=require("react");var Xt="user-balance";async function Ua(e,t,n,r){let o=new URLSearchParams({networkId:`eip155:${t}`,account:n}),d=await fetch(`${e}/v1/public/token/balance?${o}`,{cache:"no-store",signal:r});if(!d.ok)throw new Error(`Failed to fetch token balance: ${d.status}`);let i=await d.json();if(i.code!==200)throw new Error(`Token balance API error: ${i.code}`);return i.data}function rt(e,t,n=!0){let r=be[e],o=fe[e],d=[o.cross,o.bsc],i=(0,Zn.useQueries)({queries:d.map(l=>({queryKey:[Xt,e,t,l],queryFn:({signal:f})=>Ua(r,l,t,f),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),c=i.some(l=>l.isLoading),p=i.some(l=>l.isError);return{tokens:(0,Kn.useMemo)(()=>{let l=[];for(let f of i)f.data&&l.push(...f.data);return l},[i]),isLoading:c,isError:p}}var Jt=require("@tanstack/react-query"),Yn=require("react");var za="forge-holdings",ja="forge-token-image";async function qa(e,t,n){let r=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!r.ok)throw new Error(`Failed to fetch forge holdings: ${r.status}`);let o=await r.json();if(!o.success)throw new Error("Forge holdings API error");return o.data.items}async function Ga(e,t,n){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!r.ok)return{address:t,image_url:""};let o=await r.json();return o.success?{address:t,image_url:o.data.token.image_url}:{address:t,image_url:""}}function Qn(e,t,n=!0){let r=Ro[e],{data:o,...d}=(0,Jt.useQuery)({queryKey:[za,e,t],queryFn:({signal:i})=>qa(r,t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:o??[],...d}}function Xn(e,t,n=!0){let r=Ro[e],o=(0,Jt.useQueries)({queries:t.map(i=>({queryKey:[ja,e,i],queryFn:({signal:c})=>Ga(r,i,c),enabled:n,staleTime:1/0}))});return{imageMap:(0,Yn.useMemo)(()=>{let i=new Map;for(let c of o)c.data&&i.set(c.data.address,c.data.image_url);return i},[o])}}var Jn=require("@tanstack/react-query"),er=require("react");var eo="token-stats";function at(e,t){return`${e}:${t.toLowerCase()}`}function it(e,t=!0){let n=be[e],{data:r,...o}=(0,Jn.useQuery)({queryKey:[eo,e],queryFn:async({signal:i})=>{let c=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!c.ok)throw new Error(`Failed to fetch token stats: ${c.status}`);let p=await c.json();if(p.code!==200)throw new Error(`Token stats API error: ${p.code}`);return p},enabled:t,staleTime:3e4});return{statsMap:(0,er.useMemo)(()=>{let i=new Map;if(!r?.data)return i;for(let c of r.data){let p=at(c.chain_id,c.address);i.set(p,c)}return i},[r]),...o}}var tr=require("@tanstack/react-query"),or=require("react");var Za="token-info";function Bo(e,t){return`${t.toLowerCase()}_${e}`}function nr(e,t=!0){let n=be[e],{data:r,...o}=(0,tr.useQuery)({queryKey:[Za,e],queryFn:async({signal:i})=>{let c=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:i});if(!c.ok)throw new Error(`Failed to fetch token info: ${c.status}`);let p=await c.json();if(p.code!==200)throw new Error(`Token info API error: ${p.code}`);return p},enabled:t,staleTime:1/0});return{categoryMap:(0,or.useMemo)(()=>{let i=new Map;if(!r?.data)return i;for(let c of r.data){let p=Bo(c.chain_id,c.address);i.set(p,c.category)}return i},[r]),...o}}var rr=require("react"),to=j(require("bignumber.js"),1);function ar(e,t,n){let{tokens:r,isLoading:o}=rt(e,t,n),{statsMap:d}=it(e,n);return(0,rr.useMemo)(()=>{let i=new to.default(0);for(let l of r){let f=d.get(at(l.chainId,l.address));if(!f)continue;let h=new to.default(l.quantity.numeric).shiftedBy(-l.quantity.decimals).multipliedBy(new to.default(f.price));h.isNaN()||(i=i.plus(h))}let c=i.toFixed(),{displayValue:p,isLowerBound:s}=Rn(c);return{totalUsd:c,displayValue:p,isLowerBound:s,isLoading:o}},[r,d,o])}var Fr=require("qrcode.react");function Le(e,t,n,r){if(!r||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let o;try{o=r(t,n)}catch(s){console.error("[dapp-ui] onOutlink threw:",s);return}let d=s=>{typeof window>"u"||window.open(s,"_blank","noopener,noreferrer")};if((s=>!!s&&(typeof s=="object"||typeof s=="function")&&typeof s.then=="function")(o)){let s=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,l=f=>{if(f===null){s?.close();return}let v=f??t;if(s)try{s.location.href=v}catch{s.close(),d(v)}else d(v)};o.then(l,f=>{console.error("[dapp-ui] onOutlink rejected:",f),s?.close()});return}let c=o;if(c===null)return;d(c??t)}var ct=j(require("react"),1),Wr=require("vaul");var oo=require("react"),Mt=(0,oo.createContext)(null);function se(){let e=(0,oo.useContext)(Mt);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var ir=require("vaul");var Vo=require("react/jsx-runtime");function sr({asChild:e,children:t}){let{walletAddress:n}=se(),r=t!=null,o=e??!0,d=r?t:(0,Vo.jsx)("button",{type:"button",children:he(n)});return(0,Vo.jsx)(ir.Drawer.Trigger,{asChild:o,children:d})}var _t=require("vaul");var ye=j(require("react"),1),Or=require("@tanstack/react-query");var gr=require("react"),so=j(require("bignumber.js"),1);var dr=require("@tanstack/react-query"),Ho=require("react");var no={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},lr={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},ro={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},ze={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Re={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"},cr={dev:{cross:"https://stg-dex-api.crosstoken.io/dex",crossd:"https://stg-crossd-dex-api.crosstoken.io/dex",forge:"https://stg-forge-dex-api.crosstoken.io/dex"},stage:{cross:"https://stg-dex-api.crosstoken.io/dex",crossd:"https://stg-crossd-dex-api.crosstoken.io/dex",forge:"https://stg-forge-dex-api.crosstoken.io/dex"},production:{cross:"https://dex-api.crosstoken.io/dex",crossd:"https://crossd-dex-api.crosstoken.io/dex",forge:"https://forge-dex-api.crosstoken.io/dex"}};var Ka="wp:reward-pools";function ao(e,t=!0){let n=no[e],{data:r,...o}=(0,dr.useQuery)({queryKey:[Ka,e],queryFn:async({signal:c})=>{let p=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:c});if(!p.ok)throw new Error(`Failed to fetch pools: ${p.status}`);let s=await p.json();if(s.code!==200)throw new Error(`Pools API error: ${s.code}`);return s},enabled:t,staleTime:0}),d=(0,Ho.useMemo)(()=>r?.data.pools.filter(c=>c.pool_type==="CrossPool")??[],[r]),i=(0,Ho.useMemo)(()=>r?.data.pools.filter(c=>c.pool_type==="GamePool")??[],[r]);return{crossPools:d,gamePools:i,allPools:r?.data.pools??[],...o}}var pr=require("@tanstack/react-query"),mr=require("react");var Ya="wp:user-deposits";function io(e,t,n=!0){let r=no[e],o=n&&!!t,{data:d,...i}=(0,pr.useQuery)({queryKey:[Ya,e,t],queryFn:async({signal:p})=>{let s=await fetch(`${r}/v1/users/${t}/deposits`,{cache:"no-store",signal:p});if(!s.ok)throw new Error(`Deposits fetch failed: ${s.status}`);let l=await s.json();if(l.code!==200)throw new Error(`Deposits API error: ${l.code}`);return l},enabled:o,staleTime:0});return{depositMap:(0,mr.useMemo)(()=>{let p=new Map;if(!d?.data.user_deposits)return p;for(let s of d.data.user_deposits)p.set(s.pool_address.toLowerCase(),s);return p},[d]),deposits:d?.data.user_deposits??[],...i}}var $o=require("@tanstack/react-query"),Uo=require("react");function Te(e,t,n,r=!0){let o=cr[e][t],d=r&&!!n,{data:i,...c}=(0,$o.useQuery)({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:g})=>{let w=await fetch(`${o}/pair-info`,{cache:"no-store",signal:g});if(!w.ok)throw new Error(`pair-info fetch failed: ${w.status}`);let b=await w.json();if(b.code!==200)throw new Error(`pair-info API error: ${b.code}`);return b},enabled:r,staleTime:0}),p=i?.data??[],s=(0,Uo.useMemo)(()=>{let g=new Map;for(let w of p)g.set(w.pair_address.toLowerCase(),w);return g},[p]),{data:l,...f}=(0,$o.useQuery)({queryKey:["wp:dex-orders",e,t,n],queryFn:async({signal:g})=>{let w=Math.floor(Date.now()/1e3),b=new URLSearchParams({owner:n,size:"200",start_date:"0",end_date:String(w)}),E=await fetch(`${o}/open-order?${b}`,{cache:"no-store",signal:g});if(!E.ok)throw new Error(`open-order fetch failed: ${E.status}`);let R=await E.json();if(R.code!==200)throw new Error(`open-order API error: ${R.code}`);return R.data?.data??[]},enabled:d,staleTime:0}),v=l??[],h=(0,Uo.useMemo)(()=>{let g=new Map;for(let w of v){let b=w.pair.toLowerCase();g.has(b)||g.set(b,{buys:[],sells:[]});let E=g.get(b);w.order_side===1?E.buys.push(w):E.sells.push(w)}return g},[v]);return{allPairs:p,pairMap:s,orders:v,ordersByPair:h,isEmpty:v.length===0,isLoading:c.isLoading||f.isLoading}}var Qa=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],fr="var(--wp-green)",ur=4;function wr(e,t,n=!0){let r=n&&!!t,{allPools:o}=ao(e,r),{depositMap:d}=io(e,t,r),{allPairs:i,pairMap:c,ordersByPair:p}=Te(e,"cross",t,r),{allPairs:s,pairMap:l,ordersByPair:f}=Te(e,"crossd",t,r),{allPairs:v,pairMap:h,ordersByPair:g}=Te(e,"forge",t,r);return(0,gr.useMemo)(()=>{let w=new Map,b=new Map,E=(C,N)=>{!Number.isFinite(N)||N<=0||b.set(C,(b.get(C)??0)+N)};for(let C of o){let N=Number(C.deposit_token.price);N>0&&w.set(C.deposit_token.symbol,N);for(let z of C.reward_tokens){let L=Number(z.price);L>0&&w.set(z.symbol,L)}}for(let C of[...i,...s,...v]){let N=w.get(C.quote_symbol),z=Number(C.billboard?.price);N&&z>0&&!w.has(C.base_symbol)&&w.set(C.base_symbol,z*N)}for(let C of o){let N=d.get(C.pool_address.toLowerCase());if(!N)continue;let z=new so.default(N.deposited_amount).shiftedBy(-C.deposit_token.decimals).toNumber();if(E(C.deposit_token.symbol,z),C.reward_tokens.length>0){let L=C.reward_tokens[0],M=new so.default(N.claimable_reward).shiftedBy(-L.decimals).toNumber();E(L.symbol,M)}}let R=[{pairMap:c,ordersByPair:p},{pairMap:l,ordersByPair:f},{pairMap:h,ordersByPair:g}];for(let{pairMap:C,ordersByPair:N}of R)for(let[z,L]of N){let M=C.get(z);if(M){for(let q of L.buys){let ne=Number(q.amount)-Number(q.filled);E(M.quote_symbol,ne*Number(q.price))}for(let q of L.sells){let ne=Number(q.amount)-Number(q.filled);E(M.base_symbol,ne)}}}let B=[],k=0;for(let[C,N]of b){let z=w.get(C)??0,L=N*z;L>0&&(B.push({symbol:C,usdValue:L}),k+=L)}B.sort((C,N)=>N.usdValue-C.usdValue);let U=[];if(k>0){let C=B.slice(0,ur),N=B.slice(ur);for(let L=0;L<C.length;L++)U.push({symbol:C[L].symbol,usdValue:C[L].usdValue,percentage:Math.round(C[L].usdValue/k*100),color:Qa[L]??fr});if(N.length>0){let L=N.reduce((M,q)=>M+q.usdValue,0);U.push({symbol:"Others",usdValue:L,percentage:Math.round(L/k*100),color:fr})}let z=U.reduce((L,M)=>L+M.percentage,0);z!==100&&U.length>0&&(U[0].percentage+=100-z)}return{totalUsd:k,formattedTotal:k>0?`$${new so.default(k).toFormat(2)}`:"$0.00",segments:U}},[o,d,i,c,p,s,l,f,v,h,g])}var Me=require("react/jsx-runtime");function hr({size:e=22,className:t}){return(0,Me.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Me.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function br({size:e=22,className:t}){return(0,Me.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,Me.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,Me.jsx)("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function xr({size:e=12,className:t}){return(0,Me.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Me.jsx)("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}var vr=require("@tanstack/react-query"),yr=require("react");var Xa="wp:token-info";function je(e,t=!0){let n=be[e],r=fe[e].cross,{data:o,...d}=(0,vr.useQuery)({queryKey:[Xa,e],queryFn:async({signal:s})=>{let l=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let f=await l.json();if(f.code!==200)throw new Error(`Token info API error: ${f.code}`);return f},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:c}=(0,yr.useMemo)(()=>{let s=new Map,l=new Map;if(!o?.data)return{byChainAddr:s,byChainSym:l};for(let f of o.data){let v=f.address.toLowerCase();s.set(`${f.chain_id}:${v}`,f),s.set(v,f);let h=f.symbol.replace(/^t/,"").toUpperCase(),g=`${f.chain_id}:${h}`;l.has(g)||l.set(g,f),l.has(h)||l.set(h,f)}return{byChainAddr:s,byChainSym:l}},[o]);return{getTokenImage:(s,l)=>{let f=s.toLowerCase(),v=i.get(`${r}:${f}`);if(v?.image)return v.image;let h=i.get(f);if(h?.image)return h.image;if(l){let g=l.replace(/^t/,"").toUpperCase(),w=c.get(`${r}:${g}`);if(w?.image)return w.image;let b=c.get(g);if(b?.image)return b.image}return""},...d}}var qe=require("react/jsx-runtime");function Ee({title:e,icon:t,iconFit:n="cover",isEmpty:r,children:o}){return(0,qe.jsxs)("div",{className:"wp-svc-card",children:[(0,qe.jsxs)("div",{className:"wp-svc-card-head",children:[(0,qe.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),(0,qe.jsx)("span",{className:"wp-svc-card-title",children:e})]}),r?(0,qe.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,qe.jsx)("div",{className:"wp-svc-items",children:o})]})}var xt=j(require("bignumber.js"),1),ee=require("react/jsx-runtime"),Ja="CROSS Rewards";function kr(e,t){let n=new xt.default(e).shiftedBy(-t);return n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,xt.default.ROUND_DOWN):n.toFormat(4,xt.default.ROUND_DOWN)}function Cr(){let{env:e,walletAddress:t,onOutlink:n}=se(),r=!!t,{allPools:o}=ao(e,r),{depositMap:d}=io(e,t,r),{getTokenImage:i}=je(e,r),c=l=>`${lr[e]}/rewards/${l.pool_address}?action=withdraw`,p=`${Re[e]}/reward.png`,s=o.filter(l=>{let f=d.get(l.pool_address.toLowerCase()),v=f?.deposited_amount??"0",h=f?.claimable_reward??"0";return!(new xt.default(v).isZero()&&new xt.default(h).isZero())});return(0,ee.jsx)(Ee,{title:Ja,icon:p,isEmpty:s.length===0,children:s.map(l=>{let f=d.get(l.pool_address.toLowerCase()),v=f?.deposited_amount??"0",h=c(l);return(0,ee.jsxs)("a",{className:"wp-item","data-side":"reward",href:h,target:"_blank",rel:"noopener noreferrer",onClick:g=>Le(g,h,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:l,userDeposit:f}},n),children:[(0,ee.jsxs)("div",{className:"wp-item-body",children:[(0,ee.jsxs)("div",{className:"wp-item-field",children:[(0,ee.jsxs)("span",{className:"wp-item-label",children:["Deposited (",l.deposit_token.symbol,")"]}),(0,ee.jsxs)("div",{className:"wp-svc-token",children:[i(l.deposit_token.address,l.deposit_token.symbol)&&(0,ee.jsx)("img",{className:"wp-svc-token-icon",src:i(l.deposit_token.address,l.deposit_token.symbol),alt:""}),(0,ee.jsx)("span",{children:kr(v,l.deposit_token.decimals)})]})]}),(0,ee.jsxs)("div",{className:"wp-item-field",children:[(0,ee.jsxs)("span",{className:"wp-item-label",children:["Rewards (",l.reward_tokens.map(g=>g.symbol).join(", "),")"]}),l.reward_tokens.map(g=>{let w=i(g.address,g.symbol);return(0,ee.jsxs)("div",{className:"wp-svc-token",children:[w&&(0,ee.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),(0,ee.jsx)("span",{children:f?kr(f.claimable_reward,g.decimals):"0"})]},g.address)})]})]}),(0,ee.jsxs)("div",{className:"wp-item-badges",children:[(0,ee.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),(0,ee.jsx)("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},l.pool_address)})})}var jo=j(require("bignumber.js"),1);var S=require("react/jsx-runtime");function zo(e){let t=new jo.default(e);if(t.isNaN())return e;let n=t.decimalPlaces()??0;return t.toFormat(n)}function Nr(e){let t=new jo.default(e.amount).minus(e.filled);return zo(t.toString())}function vt({market:e,pairMap:t,ordersByPair:n,getDexUrl:r,getTokenImage:o}){let{onOutlink:d}=se(),i=[];for(let[c,p]of n){let s=t.get(c),l=s?o(s.base_address,s.base_symbol):"",f=s?o(s.quote_address,s.quote_symbol):"",v=r(c);for(let h of p.buys)i.push((0,S.jsxs)("a",{className:"wp-item","data-side":"buy",href:v,target:"_blank",rel:"noopener noreferrer",onClick:g=>Le(g,v,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"buy",order:h,pair:s}},d),children:[(0,S.jsxs)("div",{className:"wp-item-body",children:[(0,S.jsxs)("div",{className:"wp-item-field",children:[(0,S.jsxs)("span",{className:"wp-item-label wp-item-label--buy",children:["Buy",s?.base_symbol?` (${s.base_symbol})`:""]}),(0,S.jsxs)("div",{className:"wp-svc-token",children:[l&&(0,S.jsx)("img",{className:"wp-svc-token-icon",src:l,alt:""}),(0,S.jsx)("span",{children:Nr(h)})]})]}),(0,S.jsxs)("div",{className:"wp-item-field",children:[(0,S.jsxs)("span",{className:"wp-item-label",children:["Price",s?.quote_symbol?` (${s.quote_symbol})`:""]}),(0,S.jsxs)("div",{className:"wp-svc-token",children:[f&&(0,S.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""}),(0,S.jsx)("span",{children:zo(h.price)})]})]})]}),(0,S.jsx)("div",{className:"wp-item-badges",children:(0,S.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`buy-${h.order_id}`));for(let h of p.sells)i.push((0,S.jsxs)("a",{className:"wp-item","data-side":"sell",href:v,target:"_blank",rel:"noopener noreferrer",onClick:g=>Le(g,v,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"sell",order:h,pair:s}},d),children:[(0,S.jsxs)("div",{className:"wp-item-body",children:[(0,S.jsxs)("div",{className:"wp-item-field",children:[(0,S.jsxs)("span",{className:"wp-item-label wp-item-label--sell",children:["Sell",s?.base_symbol?` (${s.base_symbol})`:""]}),(0,S.jsxs)("div",{className:"wp-svc-token",children:[l&&(0,S.jsx)("img",{className:"wp-svc-token-icon",src:l,alt:""}),(0,S.jsx)("span",{children:Nr(h)})]})]}),(0,S.jsxs)("div",{className:"wp-item-field",children:[(0,S.jsxs)("span",{className:"wp-item-label",children:["Price",s?.quote_symbol?` (${s.quote_symbol})`:""]}),(0,S.jsxs)("div",{className:"wp-svc-token",children:[f&&(0,S.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""}),(0,S.jsx)("span",{children:zo(h.price)})]})]})]}),(0,S.jsx)("div",{className:"wp-item-badges",children:(0,S.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${h.order_id}`))}return(0,S.jsx)(S.Fragment,{children:i})}var qo=require("react/jsx-runtime"),ei="Gametoken - CROSS";function Lr(){let{env:e,walletAddress:t}=se(),n=!!t,{pairMap:r,ordersByPair:o,isEmpty:d}=Te(e,"cross",t,n),{getTokenImage:i}=je(e,n),c=s=>{let l=r.get(s.toLowerCase());return`${ze[e]}/gametoken/cross/${l?.base_symbol??""}`},p=`${Re[e]}/dex.png`;return(0,qo.jsx)(Ee,{title:ei,icon:p,isEmpty:d,children:(0,qo.jsx)(vt,{market:"cross",pairMap:r,ordersByPair:o,getDexUrl:c,getTokenImage:i})})}var Go=require("react/jsx-runtime"),ti="Gametoken - CROSSD";function Rr(){let{env:e,walletAddress:t}=se(),n=!!t,{pairMap:r,ordersByPair:o,isEmpty:d}=Te(e,"crossd",t,n),{getTokenImage:i}=je(e,n),c=s=>{let l=r.get(s.toLowerCase());return`${ze[e]}/gametoken/crossd/${l?.base_symbol??""}`},p=`${Re[e]}/dex.png`;return(0,Go.jsx)(Ee,{title:ti,icon:p,isEmpty:d,children:(0,Go.jsx)(vt,{market:"crossd",pairMap:r,ordersByPair:o,getDexUrl:c,getTokenImage:i})})}var Zo=require("react/jsx-runtime"),oi="Gametoken - Forge";function Tr(){let{env:e,walletAddress:t}=se(),n=!!t,{pairMap:r,ordersByPair:o,isEmpty:d}=Te(e,"forge",t,n),{getTokenImage:i}=je(e,n);if(d)return null;let c=s=>{let l=r.get(s.toLowerCase());return`${ze[e]}/gametoken/forge/${l?.base_symbol??""}`},p=`${Re[e]}/dex.png`;return(0,Zo.jsx)(Ee,{title:oi,icon:p,isEmpty:d,children:(0,Zo.jsx)(vt,{market:"forge",pairMap:r,ordersByPair:o,getDexUrl:c,getTokenImage:i})})}var lo=j(require("bignumber.js"),1),_r=require("react");var Er=require("@tanstack/react-query");var ni="wp:forge-pools";function Ir(e,t,n=!0){let r=ro[e],o=n&&!!t,{data:d,...i}=(0,Er.useQuery)({queryKey:[ni,e,t],queryFn:async()=>{let p=await fetch(`${r}/v1/users/${t}/pools`,{cache:"no-store"});if(!p.ok)throw new Error(`forge pools fetch failed: ${p.status}`);return(await p.json()).data?.items??[]},enabled:o,staleTime:0}),c=d??[];return{pools:c,isEmpty:c.length===0,...i}}var Pr=require("@tanstack/react-query"),Sr=require("react");var ri="wp:forge-token-detail";async function ai(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Mr(e,t,n=!0){let r=ro[e],o=(0,Pr.useQueries)({queries:t.map(c=>({queryKey:[ri,e,c],queryFn:()=>ai(r,c),enabled:n&&!!c,staleTime:3e4}))}),d=(0,Sr.useMemo)(()=>{let c=new Map;for(let p=0;p<o.length;p++){let s=o[p]?.data,l=t[p];s&&l&&c.set(l.toLowerCase(),s)}return c},[o,t]),i=o.some(c=>c.isLoading);return{detailMap:d,isLoading:i}}var Q=require("react/jsx-runtime"),ii="Forge",si=18,li="https://contents.crosstoken.io/wallet/token/images/FT.png";function ci(e){if(!e||e==="0")return"0";let t=new lo.default(e).shiftedBy(-si);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,lo.default.ROUND_DOWN):t.toFormat(4,lo.default.ROUND_DOWN)}function di(e){let t=Number(e);return!Number.isFinite(t)||t<=0?"0%":t>=1?`${(Math.floor(t*100)/100).toFixed(2)}%`:`${(Math.floor(t*1e4)/1e4).toFixed(4)}%`}function Ar(){let{env:e,walletAddress:t,onOutlink:n}=se(),r=!!t,{pools:o,isEmpty:d}=Ir(e,t,r),i=(0,_r.useMemo)(()=>o.map(l=>l.token.address),[o]),{detailMap:c}=Mr(e,i,r&&i.length>0),p=l=>`${ze[e]}/forge/token/${l.token.address}`,s=`${Re[e]}/forge.png`;return(0,Q.jsx)(Ee,{title:ii,icon:s,iconFit:"contain",isEmpty:d,children:o.map(l=>{let f=c.get(l.token.address.toLowerCase()),v=f?.image_url||f?.image||l.token.image||li,h=f?.symbol||l.token.symbol,g=p(l);return(0,Q.jsxs)("a",{className:"wp-item","data-side":"lp",href:g,target:"_blank",rel:"noopener noreferrer",onClick:w=>Le(w,g,{category:"portfolio",origin:"portfolio-forge",payload:{pool:l,tokenDetail:f}},n),children:[(0,Q.jsxs)("div",{className:"wp-item-body",children:[(0,Q.jsxs)("div",{className:"wp-item-field",children:[(0,Q.jsxs)("span",{className:"wp-item-label",children:["Pair (",h,")"]}),(0,Q.jsx)("div",{className:"wp-svc-token",children:(0,Q.jsx)("img",{className:"wp-svc-token-icon",src:v,alt:""})})]}),(0,Q.jsxs)("div",{className:"wp-item-field",children:[(0,Q.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,Q.jsx)("div",{className:"wp-svc-token",children:(0,Q.jsx)("span",{children:ci(l.lp_balance)})})]}),(0,Q.jsxs)("div",{className:"wp-item-field",children:[(0,Q.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,Q.jsx)("div",{className:"wp-svc-token",children:(0,Q.jsx)("span",{children:di(l.pool_ownership)})})]})]}),(0,Q.jsx)("div",{className:"wp-item-badges",children:(0,Q.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},l.pair_address)})})}_(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--cck-surface-bg, #202530);--wp-card: var(--cck-surface-default, #292f40);--wp-border: var(--cck-border-default, #313b51);--wp-text: var(--cck-texticon-primary, #ffffff);--wp-text-60: var(--cck-texticon-secondary, #d3d7df);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #717d97);--wp-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--cck-surface-bg, #f5f6f8);--wp-card: var(--cck-surface-default, #ffffff);--wp-border: var(--cck-border-default, #e2e5ea);--wp-text: var(--cck-texticon-primary, #202530);--wp-text-60: var(--cck-texticon-secondary, #49556e);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #a0a9b8);--wp-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;gap:20px;height:60px;padding:0 20px;flex-shrink:0}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text);flex-shrink:0}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: rgba(255, 255, 255, .1)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.15px;text-align:center;color:var(--wp-text);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-wallet-name{flex:1;min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:160%;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.08) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:#ffffff14;border-radius:4px}.wp-body-inner{padding:16px 16px 128px;display:flex;flex-direction:column;gap:20px}.wp-svc-card{display:flex;flex-direction:column;gap:8px}.wp-svc-card-head{display:flex;align-items:center;gap:8px}.wp-svc-card-icon{width:20px;height:20px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:14px;font-weight:600;line-height:1.3;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:10px}.wp-item{position:relative;background:var(--wp-card);border-radius:12px;padding:14px 40px 14px 16px;display:flex;flex-direction:column;gap:6px;box-shadow:0 1px 3px #00000014,0 2px 8px #0000000a;overflow:hidden;text-decoration:none;cursor:pointer;transition:box-shadow .2s ease,transform .15s ease}.wp-item:hover{box-shadow:0 2px 6px #0000001f,0 4px 14px #0000000f;transform:translateY(-1px)}.wp-item:active{transform:translateY(0);box-shadow:0 1px 3px #00000014}.wp-item:before{content:"";position:absolute;top:0;left:0;width:3px;height:100%;border-radius:3px 0 0 3px;background:var(--wp-border)}.wp-item:after{content:"";position:absolute;right:14px;top:50%;transform:translateY(-50%);width:12px;height:12px;background:currentColor;opacity:.25;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 1.5h7v7M10.5 1.5L1.5 10.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 1.5h7v7M10.5 1.5L1.5 10.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;transition:opacity .15s}.wp-item:hover:after{opacity:.5}.wp-item[data-side=buy]:before{background:var(--wp-green)}.wp-item[data-side=sell]:before{background:var(--wp-red)}.wp-item[data-side=reward]:before{background:var(--wp-mint)}.wp-item[data-side=lp]:before{background:var(--wp-purple)}.wp-item-body{display:flex;gap:12px}.wp-item-field{flex:1;display:flex;flex-direction:column;gap:4px;min-width:0}.wp-item-label{font-size:11px;font-weight:500;line-height:1.3;color:var(--wp-text-40);letter-spacing:.03em;text-transform:uppercase}.wp-item-label--buy{color:var(--wp-green)}.wp-item-label--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-svc-token>span{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:22px;height:22px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-svc-buy{color:var(--wp-green)}.wp-svc-sell{color:var(--wp-red)}.wp-badge{display:inline-flex;align-items:center;font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:2px 7px;border-radius:4px;border:1px solid transparent;pointer-events:none}.wp-badge--mint{color:var(--wp-mint);background:#00d4aa1a;border-color:#00d4aa40}.wp-badge--muted{color:var(--wp-text-40);background:#8c97ad14;border-color:#8c97ad2e}.wp-badge--red{color:var(--wp-red);background:#e7007714;border-color:#e7007733}.wp-item-badges{display:flex;align-items:center;gap:6px}.wp-svc-empty{display:flex;align-items:center;justify-content:center;height:56px;background:var(--wp-card);border-radius:12px;font-size:13px;font-weight:400;color:var(--wp-text-30);box-shadow:0 1px 3px #00000014}@media(max-width:375px){.wp-header{gap:12px;padding:0 12px}.wp-top{padding:0 12px 12px;gap:12px}.wp-total{font-size:22px}.wp-legend{gap:10px}.wp-legend-label{font-size:11px}.wp-body-inner{padding:12px 12px 128px;gap:14px}.wp-svc-items{gap:8px}.wp-item{padding:12px 36px 12px 14px;gap:6px;border-radius:10px}.wp-item:after{right:10px;width:11px;height:11px}.wp-item-body{gap:10px}.wp-svc-token{gap:6px}.wp-svc-token>span{font-size:13px}.wp-svc-token-icon{width:20px;height:20px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
7
- `);var P=require("react/jsx-runtime"),Ko=5,pi="wp:";function st({env:e,theme:t="dark",walletAddress:n,walletName:r,onBack:o,showHeader:d=!0,variant:i="embed",className:c,sendTransaction:p,getTransactionReceipt:s,onOutlink:l}){let f=me(e),v=!!n,h=(0,Or.useQueryClient)(),{segments:g}=wr(f,n,v),[w,b]=ye.useState(Ko),[E,R]=ye.useState(!1),B=ye.useCallback(()=>{h.invalidateQueries({predicate:M=>typeof M.queryKey[0]=="string"&&M.queryKey[0].startsWith(pi)})},[h]),k=ye.useCallback(()=>{B(),R(!0),setTimeout(()=>R(!1),600),b(Ko)},[B]);ye.useEffect(()=>{if(!v)return;let M=setInterval(()=>{b(q=>q<=1?(k(),Ko):q-1)},1e3);return()=>clearInterval(M)},[v,k]);let U=ye.useCallback(()=>{o?.()},[o]),N=v?ot(f,n,{size:64,bg:t==="dark"?"121212":"FFFFFF"}):void 0,z=ye.useMemo(()=>({env:f,theme:t,open:!0,walletAddress:n,close:U,sendTransaction:p,getTransactionReceipt:s,onOutlink:l}),[f,t,n,U,p,s,l]),L=(0,P.jsxs)(P.Fragment,{children:[d&&(0,P.jsxs)("div",{className:"wp-header",children:[(0,P.jsxs)("div",{className:"wp-header-account",children:[o?(0,P.jsx)("button",{type:"button",className:"wp-header-btn",onClick:o,children:(0,P.jsx)(hr,{})}):(0,P.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:N&&(0,P.jsx)("img",{src:N,alt:"",className:"wp-header-avatar-img",draggable:!1})}),r&&(0,P.jsx)("span",{className:"wp-header-wallet-name",title:r,children:r})]}),(0,P.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:k,children:[(0,P.jsx)(br,{className:E?"wp-spin-once":void 0}),v&&(0,P.jsx)("span",{className:"wp-refresh-badge",children:w})]})]}),(0,P.jsx)("div",{className:"wp-top",children:g.length>0&&(0,P.jsxs)("div",{className:"wp-asset",children:[(0,P.jsxs)("div",{className:"wp-asset-head",children:[(0,P.jsx)("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),(0,P.jsx)("span",{className:"wp-asset-head-icon",children:(0,P.jsx)(xr,{})})]}),(0,P.jsx)("div",{className:"wp-bar",children:g.map(M=>(0,P.jsx)("div",{className:"wp-bar-seg",style:{flex:`${M.percentage} 0 0`,background:M.color},children:M.percentage>=5&&(0,P.jsxs)("span",{className:"wp-bar-seg-pct",children:[M.percentage,"%"]})},M.symbol))}),(0,P.jsx)("div",{className:"wp-legend",children:g.map(M=>(0,P.jsxs)("div",{className:"wp-legend-item",children:[(0,P.jsx)("span",{className:"wp-legend-dot",style:{background:M.color}}),(0,P.jsx)("span",{className:"wp-legend-label",children:M.symbol})]},M.symbol))})]})}),(0,P.jsx)("div",{className:"wp-body",children:(0,P.jsxs)("div",{className:"wp-body-inner",children:[(0,P.jsx)(Cr,{}),(0,P.jsx)(Lr,{}),(0,P.jsx)(Rr,{}),(0,P.jsx)(Tr,{}),(0,P.jsx)(Ar,{})]})})]});return(0,P.jsx)(Mt.Provider,{value:z,children:i==="none"?L:(0,P.jsx)("div",{className:Y(i==="fullscreen"?"wp-fullscreen":"wp-embed",c),"data-theme":t,children:L})})}var lt=require("react/jsx-runtime");function Dr({className:e}){let{env:t,theme:n,walletAddress:r,close:o,sendTransaction:d}=se();return(0,lt.jsxs)(_t.Drawer.Portal,{children:[(0,lt.jsx)(_t.Drawer.Overlay,{className:"wp-overlay"}),(0,lt.jsxs)(_t.Drawer.Content,{className:Y("wp-fullscreen",e),"data-theme":n,children:[(0,lt.jsx)(_t.Drawer.Title,{className:"wp-sr-only",children:"My Portfolio"}),(0,lt.jsx)(st,{env:t,theme:n,walletAddress:r,onBack:o,variant:"none",sendTransaction:d})]})]})}var Yo=require("react/jsx-runtime");function mi({env:e,theme:t="dark",walletAddress:n,open:r,onOpenChange:o,sendTransaction:d,onOutlink:i,children:c}){let p=me(e),s=r!==void 0,[l,f]=ct.useState(!1),v=s?r:l,h=ct.useCallback(b=>{s||f(b),o?.(b)},[s,o]),g=ct.useCallback(()=>h(!1),[h]),w=ct.useMemo(()=>({env:p,theme:t,open:v,walletAddress:n,close:g,sendTransaction:d,onOutlink:i}),[p,t,v,n,g,d,i]);return(0,Yo.jsx)(Mt.Provider,{value:w,children:(0,Yo.jsx)(Wr.Drawer.Root,{direction:"bottom",open:v,onOpenChange:h,noBodyStyles:!0,children:c})})}var Qo=Object.assign(mi,{Trigger:sr,Content:Dr});var a=require("react/jsx-runtime");function Xo(e,t,n){let r=fe[e],o=n.toUpperCase();if(t===r.cross&&o.includes("CROSSD"))return 0;if(t===r.cross&&o==="CROSS")return 1;if(t===r.bsc&&o==="CROSS")return 2}function fi(e){return parseInt(e.split(":")[1],10)}function ui(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function gi(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),r=parseInt(n.slice(0,4),16)%360,o=(r+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${r} 85% 65%), hsl(${o} 80% 55%))`}function Br({align:e="end",sideOffset:t=12,className:n,children:r}){let{env:o,theme:d,isMobile:i,open:c,drawerDirection:p,modal:s,showBalance:l,showForgeToken:f,showGameToken:v,showQR:h,qrLogoSrc:g,walletAddress:w,accountName:b,sendAccounts:E,profileImageUrl:R,preferredTokens:B,close:k,onSelectWallet:U,onCopyAddress:C,onDisconnect:N,disconnectLabel:z,termsUrl:L,termsLabel:M,privacyUrl:q,privacyLabel:ne,portalStyle:Ae,navContent:xe,navPosition:Ie,footerContent:ke,view:te,setView:Oe,selectedSendToken:De,setSelectedSendToken:X,showPortfolio:re,portfolioTitle:We,showTotalAssets:Pe,totalAssetsLabel:mt,sendTransaction:ve,getTransactionReceipt:Fe,onOutlink:ge}=$e(),{tokens:we,isLoading:Be}=rt(o,w,c&&l),{statsMap:Se}=it(o,l),{categoryMap:ce}=nr(o,l),de=l&&Pe,{displayValue:Ke,isLowerBound:ft,isLoading:ut}=ar(o,w,c&&de),[Ce,gt]=$.useState(!1),Ye=$.useRef(null),[Ve,He]=$.useState(0),{holdings:u,isLoading:T}=Qn(o,w,c&&l&&f),D=$.useMemo(()=>u.map(x=>x.token),[u]),{imageMap:V}=Xn(o,D,f&&u.length>0),Z=$.useMemo(()=>{let x=[],W=[],H=[],oe=new Map((B??[]).map((F,J)=>[`${fi(F.chainId)}:${F.address.toLowerCase()}`,J]));for(let F of we){let J=Xo(o,F.chainId,F.symbol)!==void 0,Qe=`${F.chainId}:${F.address.toLowerCase()}`,Xe=oe.get(Qe),xo=new yt.default(F.quantity.numeric).shiftedBy(-F.quantity.decimals);if(J)x.push(F);else if(Xe!==void 0)W.push(F);else if(xo.isGreaterThan(0)){if(!v&&ce.get(Bo(F.chainId,F.address))==="game")continue;H.push(F)}}return x.sort((F,J)=>{let Qe=Xo(o,F.chainId,F.symbol)??99,Xe=Xo(o,J.chainId,J.symbol)??99;return Qe-Xe}),W.sort((F,J)=>{let Qe=oe.get(`${F.chainId}:${F.address.toLowerCase()}`)??99,Xe=oe.get(`${J.chainId}:${J.address.toLowerCase()}`)??99;return Qe-Xe}),H.sort((F,J)=>{let Qe=Se.get(at(F.chainId,F.address)),Xe=Se.get(at(J.chainId,J.address)),xo=new yt.default(F.quantity.numeric).shiftedBy(-F.quantity.decimals).multipliedBy(Qe?.price??0);return new yt.default(J.quantity.numeric).shiftedBy(-J.quantity.decimals).multipliedBy(Xe?.price??0).minus(xo).toNumber()}),[...x,...W,...H]},[we,o,Se,v,ce,B]),K=$.useMemo(()=>{if(!f)return[];let x=new Set(we.map(W=>W.address.toLowerCase()));return[...u].filter(W=>!x.has(W.token.toLowerCase())).sort((W,H)=>{let oe=new yt.default(W.value);return new yt.default(H.value).minus(oe).toNumber()})},[u,f,we]),ae=$.useRef(!1),pe=$.useCallback(x=>{ae.current=!0,Oe(x)},[Oe]),aa=$.useCallback(()=>{X(null),pe("wallet")},[X,pe]),ia=$.useCallback(x=>{X(x),pe("send")},[X,pe]),sa=$.useCallback(()=>{X(null),pe("wallet")},[X,pe]);$.useEffect(()=>{c||(ae.current=!1)},[c]);let on=$.useRef(null);$.useEffect(()=>{let x=on.current;if(!x||!i)return;let W=H=>{H.pointerType==="touch"&&H.stopPropagation()};return x.addEventListener("pointerdown",W),()=>x.removeEventListener("pointerdown",W)},[i]);let[Nt,nn]=$.useState(!1),wo=$.useRef(void 0);$.useEffect(()=>()=>clearTimeout(wo.current),[]),$.useEffect(()=>{let x=Ye.current;if(!x||ke===null){He(0);return}let W=()=>{He(x.offsetHeight)};if(W(),typeof ResizeObserver>"u")return;let H=new ResizeObserver(W);return H.observe(x),()=>H.disconnect()},[ke]);let rn=$.useCallback(async()=>{if(!Nt)try{await navigator.clipboard.writeText(w),nn(!0),clearTimeout(wo.current),wo.current=setTimeout(()=>nn(!1),2e3),C?.(w,!0)}catch{C?.(w,!1)}},[w,C,Nt]),ho=$.useCallback(x=>{x.currentTarget.setAttribute("data-loaded","true")},[]),la=$.useMemo(()=>({background:gi(w)}),[w]),an=$.useMemo(()=>R||ot(o,w,{size:120,bg:d==="dark"?"1A1A2E":"F3F6F8"}),[R,o,w,d]),bo=$.useMemo(()=>ui(Ke),[Ke]),ca=L||q?(0,a.jsxs)("div",{className:"wi-legal-links",children:[L&&(0,a.jsx)("a",{className:"wi-legal-link",href:L,target:"_blank",rel:"noopener noreferrer",onClick:x=>Le(x,L,{category:"terms",origin:"terms"},ge),children:M}),L&&q&&(0,a.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),q&&(0,a.jsx)("a",{className:"wi-legal-link",href:q,target:"_blank",rel:"noopener noreferrer",onClick:x=>Le(x,q,{category:"privacy",origin:"privacy"},ge),children:ne})]}):null,sn=N?(0,a.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{N(),k()},children:[(0,a.jsx)(In,{size:12}),(0,a.jsx)("span",{className:"wi-disconnect-label",children:z})]}):null,da=(0,a.jsxs)("div",{className:Y("wi-view-inner",ae.current&&"wi-view-wallet"),children:[de&&(()=>{let x=re;return(0,a.jsxs)(x?"button":"div",{...x?{type:"button",onClick:()=>pe("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":x||void 0,children:[(0,a.jsxs)("div",{className:"wi-total-head",children:[(0,a.jsx)("span",{className:"wi-total-label",children:mt}),(0,a.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:H=>{H.stopPropagation(),gt(oe=>!oe)},onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),H.stopPropagation(),gt(oe=>!oe))},"aria-label":Ce?"Show balance":"Hide balance",children:Ce?(0,a.jsx)(On,{}):(0,a.jsx)(An,{})})]}),(0,a.jsxs)("div",{className:"wi-total-body",children:[ut?(0,a.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):(0,a.jsx)("div",{className:"wi-total-value","data-hidden":Ce||void 0,children:Ce?(0,a.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,a.jsxs)(a.Fragment,{children:[ft&&(0,a.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,a.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,a.jsx)("span",{className:"wi-total-amount",children:bo.main}),bo.decimal&&(0,a.jsx)("span",{className:"wi-total-decimal",children:bo.decimal})]})}),x&&(0,a.jsx)("span",{className:"wi-total-chevron","aria-hidden":!0,children:(0,a.jsx)(Mn,{size:18})})]})]})})(),Ie==="top"&&xe&&(0,a.jsx)("div",{className:"wi-nav-fixed",children:xe}),l&&(0,a.jsx)("div",{ref:on,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,a.jsxs)("div",{className:"wi-token-list",children:[Be&&Array.from({length:5},(x,W)=>(0,a.jsxs)("div",{className:"wi-skeleton-item",children:[(0,a.jsxs)("div",{className:"wi-skeleton-left",children:[(0,a.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,a.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,a.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,a.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,a.jsxs)("div",{className:"wi-skeleton-right",children:[(0,a.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,a.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},W)),!Be&&Z.length===0&&!f&&(0,a.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),Z.map(x=>{let W=Se.get(at(x.chainId,x.address)),H=W?parseFloat(W.percent_change_24h):null,oe=H!==null&&H>=0,F=To(o,x.chainId);return(0,a.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>ia(x),"aria-label":`Send ${x.symbol}`,children:[(0,a.jsxs)("div",{className:"wi-token-left",children:[(0,a.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,a.jsx)("img",{src:x.icon_url,alt:x.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:ho,onError:J=>{J.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),F&&(0,a.jsx)("img",{src:F,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:J=>{J.currentTarget.style.display="none"}})]}),(0,a.jsxs)("div",{className:"wi-token-info",children:[(0,a.jsx)("span",{className:"wi-token-name",children:x.symbol}),W&&(0,a.jsxs)("div",{className:"wi-token-price-row",children:[(0,a.jsx)("span",{className:"wi-token-price",children:Lo(W.price)}),(0,a.jsx)("span",{className:"wi-token-change","data-positive":oe,"data-zero":H===0||void 0,children:H!==null&&(H===0?"0%":`${oe?"+":"-"}${(oe?Math.floor:Math.ceil)(Math.abs(H)*100)/100}%`)})]})]})]}),(0,a.jsxs)("div",{className:"wi-token-right",children:[(0,a.jsx)("span",{className:"wi-token-balance",children:tt(x.quantity.numeric,x.quantity.decimals)}),W&&(0,a.jsx)("span",{className:"wi-token-value",children:Ln(x.quantity.numeric,x.quantity.decimals,W.price)})]})]},`${x.address}-${x.chainId}`)}),f&&T&&Array.from({length:3},(x,W)=>(0,a.jsxs)("div",{className:"wi-skeleton-item",children:[(0,a.jsxs)("div",{className:"wi-skeleton-left",children:[(0,a.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,a.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,a.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,a.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,a.jsxs)("div",{className:"wi-skeleton-right",children:[(0,a.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,a.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${W}`)),f&&!T&&!Be&&Z.length===0&&K.length===0&&(0,a.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),f&&K.map(x=>{let W=V.get(x.token)||"",H=To(o,fe[o].cross);return(0,a.jsxs)("div",{className:"wi-token-item",children:[(0,a.jsxs)("div",{className:"wi-token-left",children:[(0,a.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,a.jsx)("img",{src:W||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:x.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:ho,onError:oe=>{oe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),H&&(0,a.jsx)("img",{src:H,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:oe=>{oe.currentTarget.style.display="none"}})]}),(0,a.jsxs)("div",{className:"wi-token-info",children:[(0,a.jsx)("span",{className:"wi-token-name",children:x.token_name}),(0,a.jsx)("div",{className:"wi-token-price-row",children:(0,a.jsxs)("span",{className:"wi-token-price",children:[tt(x.current_price,18)," CROSS"]})})]})]}),(0,a.jsxs)("div",{className:"wi-token-right",children:[(0,a.jsx)("span",{className:"wi-token-balance",children:tt(x.balance,18)}),(0,a.jsx)("span",{className:"wi-token-value",children:Lo(x.current_value_usd)})]})]},`forge-${x.token}`)})]})}),Ie==="bottom"&&xe&&(0,a.jsx)("div",{className:"wi-nav-fixed",children:xe}),sn&&(0,a.jsx)("div",{className:"wi-wallet-disconnect-row",children:sn})]},"wallet"),pa=re?(0,a.jsx)("div",{className:Y("wi-view-inner wi-portfolio-body",ae.current&&"wi-view-portfolio"),children:(0,a.jsx)(st,{env:o,theme:d,walletAddress:w,showHeader:!1,sendTransaction:ve,getTransactionReceipt:Fe,onOutlink:ge})},"portfolio"):null,ma=De?(0,a.jsx)("div",{className:Y("wi-view-inner wi-send-body",ae.current&&"wi-view-send"),children:(0,a.jsx)(St,{env:o,theme:d,walletAddress:w,accountName:b,accounts:E,token:De,tokens:Z,onTokenChange:X,sendTransaction:ve,getTransactionReceipt:Fe,onConfirmSuccess:sa,onOutlink:ge})},"send"):null,fa=(0,a.jsx)("div",{className:Y("wi-view-inner wi-qr-body",ae.current&&"wi-view-qr"),children:(0,a.jsxs)("div",{className:"wi-qr-section",children:[(0,a.jsxs)("div",{className:"wi-qr-card",children:[(0,a.jsxs)("div",{className:"wi-qr-code",children:[(0,a.jsx)(Fr.QRCodeSVG,{value:w,size:180,level:"H",marginSize:2,...g&&{imageSettings:{src:g,height:33,width:33,excavate:!0}}}),!g&&(0,a.jsx)("div",{className:"wi-qr-logo",children:(0,a.jsx)(Dn,{size:33})})]}),(0,a.jsx)("p",{className:"wi-qr-address",children:w}),(0,a.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:rn,children:[(0,a.jsx)("span",{className:"wi-qr-copy-icon",children:Nt?(0,a.jsx)(Et,{size:16}):(0,a.jsx)(Eo,{size:16})}),(0,a.jsx)("span",{className:"wi-qr-copy-text",children:Nt?"Copied!":"Copy address"})]})]}),ca]})},"qr"),ua=te==="qr"||te==="portfolio"||te==="send",ln=ke!==null?(0,a.jsx)("div",{className:"wi-builtin-footer",children:ke}):null,ga=!!U&&b?.trim().toLowerCase()!=="my wallet",cn=(0,a.jsxs)("div",{className:"wi-account-text",children:[ga?(0,a.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:U,"aria-label":"Switch account",children:[(0,a.jsx)("span",{className:"wi-account-name",children:b??"Account 1"}),(0,a.jsx)("span",{className:"wi-account-switch","aria-hidden":"true",children:(0,a.jsx)(_n,{size:12})})]}):(0,a.jsx)("div",{className:"wi-account-row",children:(0,a.jsx)("span",{className:"wi-account-name",children:b??"Account 1"})}),(0,a.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:rn,"aria-label":"Copy address",children:[(0,a.jsx)("span",{className:"wi-account-address",children:he(w)}),(0,a.jsx)("span",{className:"wi-account-copy",children:Nt?(0,a.jsx)(Et,{size:14}):(0,a.jsx)(Eo,{size:14})})]})]}),dn=(0,a.jsxs)(a.Fragment,{children:[r,ua?(0,a.jsxs)("div",{className:"wi-sticky-header",children:[(0,a.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,a.jsx)("button",{type:"button",className:"wi-header-back",onClick:aa,"aria-label":"Back",children:(0,a.jsx)(Sn,{})}),(0,a.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:cn}),(0,a.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,a.jsx)(Io,{size:24})})]}),(0,a.jsx)("hr",{className:"wi-divider"})]}):(0,a.jsxs)("div",{className:"wi-sticky-header",children:[(0,a.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,a.jsxs)("div",{className:"wi-account-block",children:[(0,a.jsxs)("div",{className:"wi-avatar",children:[(0,a.jsx)("div",{className:"wi-avatar-fallback",style:la}),an&&(0,a.jsx)("img",{src:an,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:ho,onError:x=>{x.currentTarget.style.display="none"}})]}),cn]}),(0,a.jsxs)("div",{className:"wi-header-actions",children:[h&&(0,a.jsx)("button",{type:"button",className:"wi-header-action",onClick:()=>pe("qr"),"aria-label":"Show QR code",children:(0,a.jsx)(Pn,{size:20})}),(0,a.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,a.jsx)(Io,{size:24})})]})]}),(0,a.jsx)("hr",{className:"wi-divider"})]}),(0,a.jsxs)("div",{className:"wi-view-container",children:[te==="wallet"&&da,te==="qr"&&fa,te==="portfolio"&&pa,te==="send"&&ma]}),ln&&te!=="portfolio"&&te!=="send"&&(0,a.jsx)("div",{className:"wi-sticky-footer",children:(0,a.jsx)("div",{className:"wi-footer",ref:Ye,children:ln})})]}),pn={...Ae,...Ve>0?{"--wi-footer-height":`${Ve}px`}:null};return i?(0,a.jsxs)(At.Drawer.Portal,{children:[s&&(0,a.jsx)(At.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,a.jsxs)(At.Drawer.Content,{className:Y("wi-drawer-content",n),"data-theme":d,style:pn,"data-direction":p,"data-no-balance":!l||void 0,"data-has-footer":Ve>0||void 0,"data-view":te,children:[(0,a.jsx)(At.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),dn]})]}):(0,a.jsxs)(a.Fragment,{children:[s&&c&&(0,a.jsx)("div",{className:"wi-drawer-overlay",onClick:k}),(0,a.jsx)(co.Portal,{children:(0,a.jsx)(co.Content,{align:e,sideOffset:t,className:Y("wi-popover-content",n),"data-theme":d,style:pn,"data-no-balance":!l||void 0,"data-has-footer":Ve>0||void 0,"data-view":te,children:dn})})]})}var Vr=j(require("react"),1);function Hr({position:e="top",children:t}){let{setNavContent:n,setNavPosition:r}=$e();return Vr.useEffect(()=>(n(t),r(e),()=>n(null)),[t,e,n,r]),null}var $r=j(require("react"),1);function Ur({children:e}){let{setFooterContent:t}=$e();return $r.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}_(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--cck-primary, #019d92);--wi-secondary: var(--cck-secondary, #e70077);--wi-surface-bg: var(--cck-surface-bg, #121212);--wi-surface-default: var(--cck-surface-default, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--cck-surface-subtle, rgba(255, 255, 255, .1));--wi-border-default: var(--cck-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--cck-border-subtle, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--cck-texticon-primary, #ffffff);--wi-texticon-secondary: var(--cck-texticon-secondary, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--cck-texticon-tertiary, rgba(255, 255, 255, .5));--wi-on-primary: var(--cck-on-primary, #ffffff);--wi-error: var(--cck-error, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--cck-primary, #019d92);--wi-secondary: var(--cck-secondary, #e70077);--wi-surface-bg: var(--cck-surface-bg, #ffffff);--wi-surface-default: var(--cck-surface-default, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--cck-surface-subtle, rgba(18, 18, 18, .1));--wi-border-default: var(--cck-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--cck-border-subtle, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--cck-texticon-primary, #121212);--wi-texticon-secondary: var(--cck-texticon-secondary, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--cck-texticon-tertiary, rgba(18, 18, 18, .5));--wi-on-primary: var(--cck-on-primary, #ffffff);--wi-error: var(--cck-error, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
8
- `);_(`.wi-trigger-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid rgba(255,255,255,.2);background:#1a2332;border-radius:9999px;cursor:pointer;color:#fff;font-family:inherit;font-size:16px;font-weight:500;line-height:24px;letter-spacing:-.3125px;transition:opacity .15s ease}.wi-trigger-btn:hover{opacity:.85}.wi-trigger-btn[data-theme=light]{background:#f3f6f8;border-color:#1212121a;color:#121212}.wi-trigger-btn[data-mobile]{font-size:14px;padding:6px 12px;gap:6px;line-height:20px}.wi-trigger-address{white-space:nowrap}.wi-divider{height:1px;background:var(--wi-border-default);margin:0;border:none;flex-shrink:0}[data-theme=light] .wi-divider{background:#1212121a}[data-theme=dark] .wi-divider{background:#ffffff1a}
9
- `);_(`@keyframes wi-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes wi-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes wi-slide-in-right{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes wi-slide-in-left{0%{transform:translate(-40px);opacity:0}to{transform:translate(0);opacity:1}}
10
- `);_(`.wi-popover-content{z-index:100001;width:343px;border-radius:24px;border:1px solid var(--wi-border-default);background:var(--wi-surface-bg);box-shadow:var(--wi-shadow);animation:wi-fade-in .15s ease-out;height:552px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(552px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{height:auto;max-height:calc(100dvh - 32px);overflow-y:auto}.wi-drawer-content[data-view=qr]{overflow-y:auto}.wi-sticky-header{flex-shrink:0}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:20px 24px}.wi-header--wallet{align-items:flex-start}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;padding:4px;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:4px;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:30px;height:30px;border-radius:50%;object-fit:cover;background:transparent}.wi-account-text{display:flex;flex-direction:column;gap:2px;min-width:0}.wi-account-row{display:flex;align-items:center;gap:8px;min-width:0}.wi-account-row--btn{padding:2px 4px;margin:-2px -4px;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;border-radius:6px;transition:background-color .15s ease,opacity .15s ease}.wi-account-row--btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .06))}.wi-account-row--btn:focus-visible{outline:2px solid var(--wi-primary, #00d5aa);outline-offset:2px}.wi-account-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.4;color:var(--wi-texticon-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px;border:none;background:transparent;color:var(--wi-texticon-tertiary);border-radius:4px;flex-shrink:0}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;text-align:left;min-width:0;transition:opacity .15s ease}.wi-address-row-btn:hover{opacity:.7}.wi-account-address{font-family:inherit;font-size:12px;font-weight:400;line-height:1.4;color:var(--wi-texticon-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-copy{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:var(--wi-texticon-tertiary);flex-shrink:0}.wi-header-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--wi-texticon-primary);flex-shrink:0;transition:opacity .15s ease,background .15s ease}.wi-header-action:hover{opacity:.75}.wi-header-info{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}.wi-header-title{font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);margin:0}.wi-header-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--wi-texticon-primary);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:16px 24px 0;padding:0;flex-shrink:0;display:flex;flex-direction:column;gap:8px;border:none;background:transparent;border-radius:12px;color:inherit;font:inherit;text-align:left;width:auto}button.wi-total-section{cursor:pointer;transition:opacity .15s ease}button.wi-total-section:hover,button.wi-total-section:focus-visible{outline:none;opacity:.85}.wi-total-head{display:flex;align-items:center;gap:4px}.wi-total-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.wi-total-chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--wi-texticon-tertiary);flex-shrink:0;transition:transform .15s ease,color .15s ease}button.wi-total-section:hover .wi-total-chevron,button.wi-total-section:focus-visible .wi-total-chevron{color:var(--wi-texticon-primary);transform:translate(2px)}.wi-total-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.4;color:var(--wi-texticon-tertiary)}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--wi-texticon-tertiary);cursor:pointer;transition:opacity .15s ease;border-radius:4px}.wi-total-eye:hover{opacity:.7}.wi-total-eye:focus-visible{outline:1px solid var(--wi-texticon-secondary);outline-offset:2px}.wi-total-value{display:flex;align-items:baseline;gap:0;font-family:inherit;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);font-variant-numeric:tabular-nums;min-height:36px;white-space:nowrap}.wi-total-currency,.wi-total-amount{font-size:28px}.wi-total-decimal{font-size:20px;color:var(--wi-texticon-primary)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:20px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:28px;color:var(--wi-texticon-secondary)}.wi-total-skeleton{border-radius:6px}.wi-scrollable-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:16px 24px 0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}.wi-drawer-content .wi-scrollable-body{touch-action:pan-y}[data-theme=light] .wi-scrollable-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-scrollable-body::-webkit-scrollbar{width:4px}.wi-scrollable-body::-webkit-scrollbar-track{background:transparent}.wi-scrollable-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#0003}.wi-nav-fixed{flex-shrink:0;padding:0 24px}.wi-token-list{display:flex;flex-direction:column;gap:12px}.wi-token-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-token-left{display:flex;align-items:center;gap:12px;min-width:0}.wi-token-icon-wrap{position:relative;width:32px;height:32px;flex-shrink:0}.wi-token-icon{width:28px;height:28px;border-radius:8px;object-fit:contain;opacity:0;transition:opacity .2s ease;background:var(--wi-surface-default)}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:4px}.wi-token-price{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}.wi-token-change{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--wi-primary)}.wi-token-change[data-positive=false]{color:var(--wi-secondary)}.wi-token-change[data-zero]{opacity:.8}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-token-balance{font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);white-space:nowrap}.wi-token-value{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:8px 24px 16px}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:16px;padding:0;border:none;background:transparent;color:var(--wi-texticon-tertiary);font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;cursor:pointer;transition:opacity .15s ease}.wi-disconnect-btn:hover{opacity:.75}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;margin-top:16px;font-family:inherit;font-size:10px;font-weight:400;line-height:1.3;color:var(--wi-texticon-tertiary)}.wi-legal-link{color:inherit;text-decoration:underline;text-underline-offset:2px;transition:opacity .15s ease}.wi-legal-link:hover{opacity:.75}.wi-legal-sep{color:inherit}.wi-empty{display:flex;align-items:center;justify-content:center;padding:32px 0;font-family:inherit;font-size:16px;color:var(--wi-texticon-secondary)}.wi-skeleton-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-skeleton-left{display:flex;align-items:center;gap:12px}.wi-skeleton-block{border-radius:6px;background:var(--wi-border-default);position:relative;overflow:hidden}.wi-skeleton-block:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:wi-shimmer 1.5s ease-in-out infinite}[data-theme=light] .wi-skeleton-block:after{background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 50%,transparent 100%)}.wi-skeleton-icon{width:32px;height:32px;border-radius:50%;flex-shrink:0}.wi-skeleton-lines{display:flex;flex-direction:column;gap:6px}.wi-skeleton-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.wi-header-back{display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wi-texticon-primary);flex-shrink:0;transition:opacity .15s ease}.wi-header-back:hover{opacity:.7}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:0 0 auto;min-height:424px;overflow:visible}.wi-view-inner{display:flex;flex-direction:column;flex:1;min-height:0}.wi-view-wallet{animation:wi-slide-in-left .25s ease-out}.wi-view-qr,.wi-view-portfolio{animation:wi-slide-in-right .25s ease-out}.wi-qr-body{flex:1;min-height:0;display:flex;flex-direction:column}.wi-portfolio-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-portfolio-body>.wp-embed{flex:1;min-height:0}.wi-portfolio-body .wp-top{padding:16px 20px;gap:14px}.wi-portfolio-body .wp-body-inner{padding:4px 20px 24px;gap:16px}.wi-qr-section{flex:0 0 auto;min-height:424px;display:flex;flex-direction:column;overflow:visible;padding:16px 24px}.wi-qr-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;flex:0 0 auto;min-height:356px;padding:32px 24px;background:var(--wi-border-default);border:1px solid var(--wi-border-default);border-radius:12px}.wi-qr-code{position:relative;display:flex;align-items:center;justify-content:center}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:inherit;font-size:14px;font-weight:400;line-height:1.3;color:var(--wi-texticon-primary);text-align:center;word-break:break-all;max-width:247px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px;border:1px solid var(--wi-border-subtle);background:var(--wi-surface-default);border-radius:8px;cursor:pointer;transition:opacity .15s ease}.wi-qr-copy-btn:hover{opacity:.7}.wi-qr-copy-icon{display:inline-flex;color:var(--wi-texticon-secondary)}.wi-qr-copy-text{font-family:inherit;font-size:12px;font-weight:600;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}
11
- `);_(`.wi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
12
- `);var po=require("react/jsx-runtime"),wi="https://terms.crosstoken.io/docs/cross-terms-of-use",hi="https://terms.crosstoken.io/docs/nexus-privacy-policy";function bi({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:r,modal:o,showBalance:d=!1,showForgeToken:i=!1,showGameToken:c=!0,showQR:p=!0,qrLogoSrc:s,walletAddress:l,accountName:f,sendAccounts:v,profileImageUrl:h,connectorId:g,connectorName:w,connectorIconUrl:b,preferredTokens:E=[],onSelectWallet:R,onCopyAddress:B,onDisconnect:k,disconnectLabel:U="Disconnect",termsUrl:C=wi,termsLabel:N="Terms of Service",privacyUrl:z=hi,privacyLabel:L="Privacy Policy",open:M,onOpenChange:q,showPortfolio:ne=!1,portfolioTitle:Ae="My Portfolio",showTotalAssets:xe=!0,totalAssetsLabel:Ie="Total Assets USD",sendTransaction:ke,getTransactionReceipt:te,onOutlink:Oe,style:De,children:X}){let re=me(e),We=g?Tt[g]:void 0,Pe=w??We?.name,mt=b??We?.iconUrl,ve=wt(`(max-width: ${n}px)`),Fe=r??(d?"right":"bottom"),ge=o??!1,we=M!==void 0,[Be,Se]=le.useState(!1),ce=we?M:Be,de=le.useCallback(K=>{we||Se(K),q?.(K)},[we,q]),Ke=le.useCallback(()=>de(!1),[de]),[ft,ut]=le.useState(null),[Ce,gt]=le.useState("top"),[Ye,Ve]=le.useState(null),[He,u]=le.useState("wallet"),[T,D]=le.useState(null);le.useEffect(()=>{ce||(u("wallet"),D(null))},[ce]);let V=le.useCallback(()=>{Ao(l),k?.()},[k,l]),Z=le.useMemo(()=>({env:re,theme:t,isMobile:ve,open:ce,drawerDirection:Fe,modal:ge,showBalance:d,showForgeToken:i,showGameToken:c,showQR:p,qrLogoSrc:s,walletAddress:l,accountName:f,sendAccounts:v,profileImageUrl:h,connectorName:Pe,connectorIconUrl:mt,preferredTokens:E,close:Ke,onSelectWallet:R,onCopyAddress:B,onDisconnect:k?V:void 0,disconnectLabel:U,termsUrl:C,termsLabel:N,privacyUrl:z,privacyLabel:L,portalStyle:De,navContent:ft,navPosition:Ce,setNavContent:ut,setNavPosition:gt,footerContent:Ye,setFooterContent:Ve,view:He,setView:u,selectedSendToken:T,setSelectedSendToken:D,showPortfolio:ne,portfolioTitle:Ae,showTotalAssets:xe,totalAssetsLabel:Ie,sendTransaction:ke,getTransactionReceipt:te,onOutlink:Oe}),[re,t,ve,ce,Fe,ge,d,i,c,p,s,l,f,v,h,Pe,mt,E,Ke,R,B,k,V,U,C,N,z,L,De,ft,Ce,Ye,He,T,ne,Ae,xe,Ie,ke,te,Oe]);return(0,po.jsx)(No.Provider,{value:Z,children:ve?(0,po.jsx)(jr.Drawer.Root,{direction:Fe,open:ce,onOpenChange:de,noBodyStyles:!0,repositionInputs:!1,children:X},"drawer"):(0,po.jsx)(zr.Root,{open:ce,onOpenChange:de,children:X},"popover")})}var dt=Object.assign(bi,{Trigger:Gn,Content:Br,Nav:Hr,Footer:Ur});var _e=j(require("react"),1),oa=j(require("@radix-ui/react-dialog"),1),na=require("vaul");var mo=require("react"),fo=(0,mo.createContext)(null);function Ot(){let e=(0,mo.useContext)(fo);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var pt=require("react");function Dt(){let[e,t]=(0,pt.useState)([]),[n,r]=(0,pt.useState)(!0);(0,pt.useEffect)(()=>{if(typeof window>"u"){r(!1);return}let d=[],i=p=>{let{info:s}=p.detail;s?.rdns&&!d.some(l=>l.rdns===s.rdns)&&(d.push({rdns:s.rdns,name:s.name,icon:s.icon}),t([...d]))};window.addEventListener("eip6963:announceProvider",i),window.addEventListener("eip6963:crossAnnounceProvider",i),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let c=setTimeout(()=>r(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",i),window.removeEventListener("eip6963:crossAnnounceProvider",i),clearTimeout(c)}},[]);let o=(0,pt.useCallback)(d=>e.some(i=>i.rdns===d),[e]);return{wallets:e,isDetected:o,isLoading:n}}var qr=j(require("@radix-ui/react-dialog"),1),Gr=require("vaul");var Jo=require("react/jsx-runtime");function Zr({asChild:e,children:t}){let{isMobile:n}=Ot(),r=n?Gr.Drawer.Trigger:qr.Trigger;return(0,Jo.jsx)(r,{asChild:e??t!=null,children:t??(0,Jo.jsx)("button",{type:"button",children:"Connect Wallet"})})}var Ge=j(require("@radix-ui/react-dialog"),1),Wt=require("vaul");var A=require("react/jsx-runtime");function uo(){return(0,A.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,A.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,A.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function Kr(){return(0,A.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,A.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,A.jsx)("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),(0,A.jsx)("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),(0,A.jsx)("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),(0,A.jsx)("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),(0,A.jsx)("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),(0,A.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,A.jsx)("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),(0,A.jsx)("defs",{children:(0,A.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,A.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function Yr(){return(0,A.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,A.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,A.jsx)("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),(0,A.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,A.jsx)("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function Qr(){return(0,A.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,A.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,A.jsx)("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),(0,A.jsx)("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),(0,A.jsx)("defs",{children:(0,A.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,A.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function Xr(){return(0,A.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var go={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:uo,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:uo},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:uo,rdns:"nexus.to.crosswallet.desktop",installUrl:"https://chromewebstore.google.com/detail/crossx/nninbdadmocnokibpaaohnoepbnpdgcg",visibility:"desktop-only"},metamask:{id:"metamask",name:"MetaMask",description:"Browser extension approval is required",icon:Kr,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Yr,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Qr,badge:"For SHOP"}};function kt(e){return go[e]}var y=require("react/jsx-runtime");function Jr({wallet:e,detected:t,onConnect:n}){let r=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},o=e.icon;return(0,y.jsxs)("button",{type:"button",className:"wcm-wallet-item",onClick:r,children:[(0,y.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,y.jsx)("div",{className:"wcm-wallet-icon",children:(0,y.jsx)(o,{})}),(0,y.jsxs)("div",{className:"wcm-wallet-info",children:[(0,y.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,y.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,y.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]}),(0,y.jsx)("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?(0,y.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,y.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function ea(){let{wallets:e,activeWalletIds:t,isDetected:n,close:r,isMobile:o}=Ot(),d=t.filter(p=>{let s=kt(p).visibility;return!s||s==="always"?!0:s==="desktop-only"?!o:s==="mobile-only"?o:!0}),i=d.filter(p=>kt(p).featured),c=d.filter(p=>!kt(p).featured);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"wcm-header",children:[(0,y.jsxs)("div",{className:"wcm-header-text",children:[(0,y.jsx)("h2",{className:"wcm-title",children:"Connect Wallet"}),(0,y.jsx)("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),(0,y.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:r,children:(0,y.jsx)(Xr,{})})]}),(0,y.jsx)("div",{className:"wcm-divider"}),(0,y.jsxs)("div",{className:"wcm-body",children:[i.map(p=>{let s=kt(p),l=s.rdns?n(s.rdns):!1;return(0,y.jsx)(Jr,{wallet:s,detected:l,onConnect:()=>{e[p]?.(),r()}},p)}),i.length>0&&c.length>0&&(0,y.jsxs)("div",{className:"wcm-separator",children:[(0,y.jsx)("div",{className:"wcm-separator-line"}),(0,y.jsx)("span",{className:"wcm-separator-text",children:"or"}),(0,y.jsx)("div",{className:"wcm-separator-line"})]}),(0,y.jsx)("div",{className:"wcm-wallet-list",children:c.map(p=>{let s=kt(p),l=s.rdns?n(s.rdns):!1;return(0,y.jsx)(Jr,{wallet:s,detected:l,onConnect:()=>{e[p]?.(),r()}},p)})}),(0,y.jsxs)("div",{className:"wcm-help",children:[(0,y.jsx)("p",{className:"wcm-help-title",children:"Wallet not detected?"}),(0,y.jsxs)("ul",{className:"wcm-help-list",children:[(0,y.jsx)("li",{children:"Ensure your wallet extension is installed and unlocked"}),(0,y.jsx)("li",{children:"Try refreshing the page"}),(0,y.jsx)("li",{children:"Some wallets may require you to first open the extension"}),(0,y.jsx)("li",{children:"You can try clicking the wallet anyway"})]})]}),(0,y.jsx)("div",{className:"wcm-divider"}),(0,y.jsx)("p",{className:"wcm-terms",children:"By connecting your wallet and accessing this service, you acknowledge and agree to be bound by the applicable terms and conditions."})]})]})}function ta({className:e}){let{isMobile:t,theme:n,portalStyle:r}=Ot();return t?(0,y.jsxs)(Wt.Drawer.Portal,{children:[(0,y.jsx)(Wt.Drawer.Overlay,{className:"wcm-overlay"}),(0,y.jsxs)(Wt.Drawer.Content,{className:Y("wcm-drawer-content",e),"data-theme":n,style:r,children:[(0,y.jsx)(Wt.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,y.jsx)("div",{className:"wcm-drawer-handle"}),(0,y.jsx)("div",{className:"wcm-drawer-body",children:(0,y.jsx)(ea,{})})]})]}):(0,y.jsxs)(Ge.Portal,{children:[(0,y.jsx)(Ge.Overlay,{className:"wcm-overlay"}),(0,y.jsxs)(Ge.Content,{className:Y("wcm-dialog-content",e),"data-theme":n,style:r,children:[(0,y.jsx)(Ge.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,y.jsx)("div",{className:"wcm-dialog-body",children:(0,y.jsx)(ea,{})})]})]})}_(`[data-theme=dark]{--wcm-primary: var(--cck-primary, #9b8cef);--wcm-secondary: var(--cck-secondary, #ff3aa3);--wcm-surface-bg: var(--cck-surface-bg, #202530);--wcm-surface-default: var(--cck-surface-default, #292f40);--wcm-surface-subtle: var(--cck-surface-subtle, #313b51);--wcm-border-default: var(--cck-border-default, #313b51);--wcm-border-subtle: var(--cck-border-subtle, #49556e);--wcm-texticon-primary: var(--cck-texticon-primary, #ffffff);--wcm-texticon-secondary: var(--cck-texticon-secondary, #eff0f4);--wcm-texticon-tertiary: var(--cck-texticon-tertiary, #717d97)}[data-theme=light]{--wcm-primary: var(--cck-primary, #019d92);--wcm-secondary: var(--cck-secondary, #e70077);--wcm-surface-bg: var(--cck-surface-bg, #ffffff);--wcm-surface-default: var(--cck-surface-default, rgba(18, 18, 18, .05));--wcm-surface-subtle: var(--cck-surface-subtle, rgba(18, 18, 18, .1));--wcm-border-default: var(--cck-border-default, rgba(18, 18, 18, .05));--wcm-border-subtle: var(--cck-border-subtle, rgba(18, 18, 18, .1));--wcm-texticon-primary: var(--cck-texticon-primary, #121212);--wcm-texticon-secondary: var(--cck-texticon-secondary, rgba(18, 18, 18, .7));--wcm-texticon-tertiary: var(--cck-texticon-tertiary, rgba(18, 18, 18, .5))}
13
- `);_(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wcm-dialog-content{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--wcm-surface-bg);border:4px solid var(--wcm-border-default);border-radius:24px;outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wcm-dialog-body,[data-theme=light] .wcm-drawer-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wcm-dialog-body::-webkit-scrollbar-thumb:hover,.wcm-drawer-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wcm-dialog-body::-webkit-scrollbar-thumb,[data-theme=light] .wcm-drawer-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wcm-dialog-body::-webkit-scrollbar-thumb:hover,[data-theme=light] .wcm-drawer-body::-webkit-scrollbar-thumb:hover{background:#0003}.wcm-drawer-content{position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--wcm-surface-bg);border-top-left-radius:24px;border-top-right-radius:24px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:24px 0 0 24px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 24px 24px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 24px 24px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--wcm-border-subtle);margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{position:relative;display:flex;flex-direction:column;align-items:center;padding:24px 24px 20px}.wcm-header-text{display:flex;flex-direction:column;gap:4px;width:100%;padding-right:48px}.wcm-title{font-family:inherit;font-weight:600;font-size:22px;line-height:1.3;color:var(--wcm-texticon-primary);margin:0}.wcm-subtitle{font-family:inherit;font-weight:400;font-size:14px;line-height:1.3;color:var(--wcm-texticon-secondary);margin:0}.wcm-close-btn{position:absolute;top:12px;right:12px;display:flex;align-items:center;justify-content:center;width:48px;height:48px;border:none;border-radius:999px;background:transparent;color:var(--wcm-texticon-primary);cursor:pointer;padding:0}.wcm-close-btn:hover{color:var(--wcm-texticon-secondary)}.wcm-divider{width:100%;height:1px;background:var(--wcm-border-default);border:none;margin:0}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:20px 24px 24px}.wcm-wallet-item{display:flex;align-items:center;gap:8px;width:100%;padding:16px;background:var(--wcm-surface-default);border:1px solid transparent;border-radius:20px;cursor:pointer;text-align:left;transition:border-color .15s;font-family:inherit}.wcm-wallet-item:hover{border-color:var(--wcm-primary)}.wcm-wallet-item-left{display:flex;align-items:center;gap:16px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg{width:40px;height:40px}.wcm-wallet-info{display:flex;flex-direction:column;justify-content:center;min-width:0}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px}.wcm-wallet-name{font-family:inherit;font-weight:700;font-size:18px;line-height:1.3;color:var(--wcm-texticon-primary);white-space:nowrap}.wcm-wallet-desc{font-family:inherit;font-weight:400;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary)}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;height:20px;padding:0 8px;border:1px solid var(--wcm-secondary);border-radius:999px;font-family:inherit;font-weight:700;font-size:12px;line-height:1.3;color:var(--wcm-secondary);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;background:var(--wcm-primary);border-radius:12px;font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-surface-bg);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;background:var(--wcm-surface-subtle);border-radius:12px;font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary);white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:16px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--wcm-border-default)}.wcm-separator-text{font-family:inherit;font-weight:400;font-size:16px;line-height:1.3;color:var(--wcm-texticon-tertiary);white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-help{display:flex;flex-direction:column;gap:4px}.wcm-help-title{font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-texticon-primary);margin:0}.wcm-help-list{list-style:none;padding:0;margin:0}.wcm-help-list li{display:flex;align-items:center;gap:8px;font-family:inherit;font-weight:400;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary)}.wcm-help-list li:before{content:"";display:block;flex-shrink:0;width:4px;height:4px;min-width:4px;min-height:4px;background:var(--wcm-texticon-secondary)}.wcm-terms{font-family:inherit;font-weight:400;font-size:12px;line-height:1.3;color:var(--wcm-texticon-secondary);text-align:center;margin:0}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
14
- `);_(`@keyframes wcm-overlay-show{0%{opacity:0}to{opacity:1}}@keyframes wcm-overlay-hide{0%{opacity:1}to{opacity:0}}@keyframes wcm-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes wcm-dialog-hide{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
15
- `);var Ct=require("react/jsx-runtime");function xi({wallets:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:r="bottom",dialogWidth:o,drawerMaxWidth:d,drawerMinWidth:i,style:c,open:p,onOpenChange:s,children:l}){let f=wt(`(max-width: ${n}px)`),[v,h]=_e.useState(!1),g=p!==void 0,w=g?p:v,b=_e.useCallback(N=>{g||h(N),s?.(N)},[g,s]),E=_e.useCallback(()=>b(!1),[b]),{isDetected:R}=Dt(),B=_e.useMemo(()=>Object.keys(e),[e]),k=_e.useMemo(()=>{let N={};return o&&(N["--wcm-dialog-width"]=o),d&&(N["--wcm-drawer-max-width"]=d),i&&(N["--wcm-drawer-min-width"]=i),{...N,...c}},[o,d,i,c]),U=_e.useMemo(()=>({theme:t,isMobile:f,open:w,setOpen:b,close:E,wallets:e,activeWalletIds:B,isDetected:R,portalStyle:k}),[t,f,w,b,E,e,B,R,k]),C=(0,Ct.jsx)("div",{"data-theme":t,style:k,children:l});return f?(0,Ct.jsx)(fo.Provider,{value:U,children:(0,Ct.jsx)(na.Drawer.Root,{direction:r,open:w,onOpenChange:b,noBodyStyles:!0,children:C},"drawer")}):(0,Ct.jsx)(fo.Provider,{value:U,children:(0,Ct.jsx)(oa.Root,{open:w,onOpenChange:b,children:C})})}var en=Object.assign(xi,{Trigger:Zr,Content:ta});var vi='<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#c0)"><path d="M18 36C27.9411 36 36 27.9411 36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36Z" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.2903 2.57169L21.3525 5.63385V10.6471L25.3058 6.69381L29.6364 11.0244L25.7226 14.9381H18.2903C16.5992 14.9381 15.2283 16.309 15.2283 18.0003C15.2283 19.6915 16.5992 21.0624 18.2903 21.0624H25.6836L29.6365 25.0154L25.3059 29.3459L21.3525 25.3925V30.3666L18.2903 33.4288L15.2283 30.3666V25.4326L11.3148 29.3459L6.98426 25.0154L10.9372 21.0624H5.92394L2.86178 18.0003L5.92394 14.9381H10.8981L6.98437 11.0244L11.3149 6.69383L15.2283 10.6071V5.63385L18.2903 2.57169Z" fill="#000"/></g><defs><clipPath id="c0"><rect width="36" height="36" fill="#fff"/></clipPath></defs></svg>',yi='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 28 28" fill="none"><g clip-path="url(#m0)"><path d="M26.07 26.93L20.06 25.07L15.53 27.88L12.37 27.88L7.83 25.07L1.83 26.93L0 20.53L1.83 13.44L0 7.44L1.83 0L11.21 5.81H16.69L26.07 0L27.9 7.44L26.07 13.44L27.9 20.53Z" fill="#FF5C16"/><path d="M7.83 20.54L11.96 23.8L7.83 25.07V20.54Z" fill="#FF5C16"/><path d="M20.06 20.54L15.93 23.8L20.06 25.07L20.06 20.54Z" fill="#FF5C16"/><path d="M11.63 15.14L12.78 22.85L11.19 18.56L5.77 17.17L7.83 15.14H11.63Z" fill="#E34807"/><path d="M16.27 15.14L15.12 22.85L16.71 18.56L22.13 17.17L20.07 15.14H16.27Z" fill="#E34807"/><path d="M0 20.53L1.83 13.44H5.76L5.77 17.17L11.19 18.56L12.78 22.85L11.96 23.79L7.83 20.53H0Z" fill="#FF8D5D"/><path d="M27.9 20.53L26.07 13.44H22.14L22.13 17.17L16.71 18.56L15.12 22.85L15.94 23.79L20.07 20.53H27.9Z" fill="#FF8D5D"/><path d="M16.69 5.81H11.21L10.84 9.81L12.78 22.85H15.12L17.06 9.81L16.69 5.81Z" fill="#FF8D5D"/><path d="M15.53 25.34V27.88H12.37V25.34H15.53Z" fill="#C0C4CD"/><path d="M7.83 25.07L12.37 27.88V25.34L11.96 23.79L7.83 25.07Z" fill="#E7EBF6"/><path d="M20.07 25.07L15.53 27.88V25.34L15.94 23.79L20.07 25.07Z" fill="#E7EBF6"/></g><defs><clipPath id="m0"><rect width="28" height="28" fill="#fff"/></clipPath></defs></svg>',ki='<svg width="100%" height="100%" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z" fill="#F3BA2F"/><path d="M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z" fill="#F3BA2F"/><path d="M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z" fill="#F3BA2F"/><path d="M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z" fill="#F3BA2F"/><path d="M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z" fill="#F3BA2F"/></svg>',Ci='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"/><path fill="#FF3D00" d="M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"/><path fill="#4CAF50" d="M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"/><path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"/></svg>',Ni='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>';function Ft(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Bt=Ft(vi),Vt=Ft(yi),Ht=Ft(ki),$t=Ft(Ci),Ut=Ft(Ni);var ue=require("react/jsx-runtime");function tn({isConnecting:e,address:t,provider:n,providerName:r,accountName:o,sendAccounts:d,onConnect:i,onDisconnect:c,onCopy:p,onSelectWallet:s,label:l="Connect Wallet",connectingLabel:f="Connecting...",disconnectLabel:v,className:h,theme:g="dark",env:w,showBalance:b=!0,showPortfolio:E,drawerDirection:R,modal:B,connectorId:k,style:U,sendTransaction:C,getTransactionReceipt:N}){if(e)return(0,ue.jsxs)("button",{type:"button",disabled:!0,className:h,style:h?void 0:{...Ze.button,...Ze.buttonLoading},"aria-busy":"true",children:[(0,ue.jsx)("style",{children:Ei}),(0,ue.jsx)("span",{style:Ze.spinner,"aria-hidden":"true"}),f]});if(t){let z=r??Ti(n),L=n?Li[n]:void 0;return(0,ue.jsxs)(dt,{env:w,theme:g,drawerDirection:R,modal:B,showBalance:b,showPortfolio:E,walletAddress:t,accountName:o,sendAccounts:d,connectorId:k,onSelectWallet:s,onCopyAddress:p?(M,q)=>{q&&p()}:void 0,onDisconnect:c,disconnectLabel:v,style:U,sendTransaction:C,getTransactionReceipt:N,children:[(0,ue.jsx)(dt.Trigger,{asChild:!0,children:(0,ue.jsxs)("button",{type:"button",className:h,style:h?void 0:Ze.connectedBtn,"aria-label":`Connected with ${z}: ${ra(t)}`,children:[L?(0,ue.jsx)("img",{src:L,alt:"",width:20,height:20,style:Ze.connectedIcon}):(0,ue.jsx)("span",{style:Ze.connectedIconPlaceholder,"aria-hidden":"true"}),(0,ue.jsx)("span",{style:Ze.connectedAddress,children:ra(t)})]})}),(0,ue.jsx)(dt.Content,{align:"end",sideOffset:8})]})}return(0,ue.jsx)("button",{type:"button",onClick:i,className:h,style:h?void 0:Ze.button,children:l})}var Li={google:$t,apple:Ut,cross:Bt,metamask:Vt,binance:Ht},Ri={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Ti(e){return e?Ri[e]:"Wallet"}function ra(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Ei="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",Ze={button:{padding:"10px 24px",borderRadius:"12px",border:"none",background:"#00D5AA",color:"#000",fontWeight:700,fontSize:"14px",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.15s",fontFamily:"inherit"},buttonLoading:{opacity:.7,cursor:"default"},spinner:{display:"inline-block",width:"14px",height:"14px",border:"2px solid #00000030",borderTopColor:"#000",borderRadius:"50%",animation:"cross-cb-spin 0.6s linear infinite"},connectedBtn:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"8px 14px",borderRadius:"999px",border:"1px solid var(--wi-border-default, #2a2d3a)",background:"var(--wi-surface-default, #1e232e)",color:"var(--wi-texticon-primary, #ffffff)",fontWeight:600,fontSize:"14px",cursor:"pointer",fontFamily:"inherit"},connectedIcon:{width:"20px",height:"20px",borderRadius:"50%",objectFit:"contain",flexShrink:0,background:"transparent"},connectedIconPlaceholder:{display:"inline-block",width:"20px",height:"20px",borderRadius:"50%",background:"var(--wi-surface-subtle, #2a2d3a)",flexShrink:0},connectedAddress:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"13px",letterSpacing:"0.02em"}};0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,GOOGLE_ICON,METAMASK_ICON,SendPage,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
1
+ "use strict";var Na=Object.create;var po=Object.defineProperty;var La=Object.getOwnPropertyDescriptor;var Ra=Object.getOwnPropertyNames;var Ea=Object.getPrototypeOf,Ta=Object.prototype.hasOwnProperty;var Ia=(e,t)=>{for(var o in t)po(e,o,{get:t[o],enumerable:!0})},Pn=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ra(t))!Ta.call(e,r)&&r!==o&&po(e,r,{get:()=>t[r],enumerable:!(n=La(t,r))||n.enumerable});return e};var G=(e,t,o)=>(o=e!=null?Na(Ea(e)):{},Pn(t||!e||!e.__esModule?po(o,"default",{value:e,enumerable:!0}):o,e)),Pa=e=>Pn(po({},"__esModule",{value:!0}),e);var Bi={};Ia(Bi,{APPLE_ICON:()=>no,AppLauncher:()=>Ho,AppLauncherContent:()=>zo,AppLauncherTrigger:()=>Uo,BINANCE_ICON:()=>to,CONNECTOR_REGISTRY:()=>$t,CROSSX_ICON:()=>Jt,ConnectButton:()=>Rn,ConnectorId:()=>xo,GOOGLE_ICON:()=>oo,METAMASK_ICON:()=>eo,SendPage:()=>Gt,TOKEN_STATS_QUERY_KEY:()=>yo,USER_BALANCE_QUERY_KEY:()=>bo,WALLET_REGISTRY:()=>Oo,WalletConnectModal:()=>Ln,WalletInfo:()=>Nt,WalletPortfolio:()=>kn,WalletPortfolioBody:()=>yt,resolveEnvironment:()=>ce,useGlobalMenu:()=>Vt,useTokenBalance:()=>xt,useTokenStats:()=>vt,useWalletDetect:()=>Yt});module.exports=Pa(Bi);function ce(e){if(e)return Sn(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return Sn(t)}function Sn(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var It=G(require("react"),1),Mn=G(require("@radix-ui/react-popover"),1),_n=require("vaul");var mo=require("react"),$o=(0,mo.createContext)(null);function uo(){let e=(0,mo.useContext)($o);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var fo=require("react");function Tt(e){let[t,o]=(0,fo.useState)(!1);return(0,fo.useEffect)(()=>{let n=window.matchMedia(e);o(n.matches);let r=a=>o(a.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[e]),t}function D(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}D(`[data-theme=dark]{--al-bg: var(--cck-surface-bg, #1e232e);--al-bg-hover: var(--cck-surface-default, #252b39);--al-text: var(--cck-texticon-primary, hsla(200, 19%, 94%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(200, 10%, 70%, 1));--al-border: var(--cck-border-subtle, #3b4153);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #123f3c;--al-badge-text: hsla(168, 85%, 47%, 1);--al-badge-new-text: #000;--al-drawer-overlay: rgba(0, 0, 0, .6)}[data-theme=light]{--al-bg: var(--cck-surface-bg, #fff);--al-bg-hover: var(--cck-surface-default, #f3f6f8);--al-text: var(--cck-texticon-primary, hsla(221, 21%, 15%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(220, 10%, 40%, 1));--al-border: var(--cck-border-subtle, #ecf0f2);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #cdf4ed;--al-badge-text: hsla(170, 82%, 32%, 1);--al-badge-new-text: #fff;--al-drawer-overlay: rgba(0, 0, 0, .4)}
2
+ `);D(`.al-trigger-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border:none;background:transparent;border-radius:8px;cursor:pointer;transition:background-color .15s ease}.al-trigger-btn[data-theme=dark]{color:#edf1f3}.al-trigger-btn[data-theme=light]{color:#1e232e}
3
+ `);D(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
+ `);D(`.al-popover-content{z-index:100001;border-radius:16px;background:var(--al-bg);border:1px solid var(--al-popover-border, var(--al-border));box-shadow:var(--al-popover-shadow, var(--al-shadow));animation:al-fade-in .15s ease-out;max-height:80vh;overflow-x:hidden;overflow-y:auto;padding:24px 4px;box-sizing:border-box}.al-popover-content .al-grid{grid-template-columns:repeat(4,100px);row-gap:24px;column-gap:0;padding:0;justify-content:center}.al-popover-content .al-grid-item{flex-direction:column;justify-content:flex-start;align-items:center;gap:8px;padding:8px 0;width:100px;min-width:0;border-radius:10px}.al-popover-content .al-grid-item-left{flex-direction:column;align-items:center;gap:8px;width:100%;overflow:visible}.al-popover-content .al-grid-item-icon{width:54px;height:54px;border-radius:10.125px;overflow:hidden}.al-popover-content .al-grid-item-icon img{object-fit:cover}.al-popover-content .al-grid-item-label{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:1;letter-spacing:0;text-align:center;color:var(--al-text);max-width:100%;white-space:normal;overflow-wrap:anywhere}.al-popover-content .al-grid-item-right,.al-popover-content .al-badge-new{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;background:var(--al-bg);overflow-x:hidden;overflow-y:hidden;display:flex;flex-direction:column;box-sizing:border-box}.al-drawer-body{flex:1;overflow-y:auto;overscroll-behavior-y:contain;min-height:0}.al-drawer-content .al-grid{display:flex;flex-direction:column;grid-template-columns:none;max-width:100%;overflow:hidden;flex-shrink:0;gap:0;row-gap:0;column-gap:0;padding:16px}.al-drawer-content .al-grid-item{width:100%;max-width:100%;gap:8px;padding:16px 12px;border-radius:8px;overflow:hidden;background:transparent}.al-drawer-content .al-grid-item:hover,.al-drawer-content .al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-drawer-content .al-grid-item-left{gap:8px;flex:1 1 auto;min-width:0}.al-drawer-content .al-grid-item-icon{width:36px;height:36px;border-radius:6.75px;overflow:hidden}.al-drawer-content .al-grid-item-icon img{width:100%;height:100%;object-fit:cover;border-radius:6.75px}.al-drawer-content .al-grid-item-label{font-size:16px;line-height:1.5;letter-spacing:-.16px;font-weight:400}.al-drawer-content .al-grid-item[data-active=true] .al-grid-item-label{font-weight:500}.al-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px;flex-shrink:0}.al-drawer-title{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.16px;color:var(--al-text);margin:0}.al-drawer-close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;background:transparent;border-radius:4px;cursor:pointer;color:var(--al-text);transition:opacity .15s ease}.al-drawer-close:hover{opacity:.7}.al-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px;padding:8px}.al-grid-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 12px;border:none;background:transparent;border-radius:8px;cursor:pointer;transition:background-color .15s ease;color:var(--al-text);text-align:left;font-family:Inter,sans-serif;flex-shrink:0}.al-grid-item:hover,.al-grid-item[data-active=true]{background:var(--al-bg-hover)}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}.al-grid-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:-.16px;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-badge{display:flex;padding:1px 4px 2px;justify-content:center;align-items:center;gap:2px;border-radius:3px;background:var(--al-badge-bg);color:var(--al-badge-text);font-family:Pretendard,Inter,sans-serif;font-size:10px;font-weight:600;line-height:150%;letter-spacing:-.1px;white-space:nowrap;flex-shrink:0}.al-badge-new{display:flex;width:16px;height:16px;justify-content:center;align-items:center;aspect-ratio:1/1;border-radius:12px;background:#7346f3;color:var(--al-badge-new-text);font-family:Pretendard,Inter,sans-serif;font-size:9px;font-weight:700;flex-shrink:0}
5
+ `);D("");var go=require("react/jsx-runtime");function Ho({env:e,theme:t="dark",mobileBreakpoint:o=768,domain:n,children:r}){let a=Tt(`(max-width: ${o}px)`),[l,p]=It.useState(!1),m=It.useCallback(()=>p(!1),[]),c=ce(e),d=It.useMemo(()=>({env:c,theme:t,isMobile:a,open:l,domain:n,close:m}),[c,t,a,l,n,m]);return(0,go.jsx)($o.Provider,{value:d,children:a?(0,go.jsx)(_n.Drawer.Root,{direction:"right",open:l,onOpenChange:p,noBodyStyles:!0,children:r},"drawer"):(0,go.jsx)(Mn.Root,{open:l,onOpenChange:p,children:r},"popover")})}var Fn=G(require("@radix-ui/react-popover"),1),Wn=require("vaul");var ne=require("react/jsx-runtime");function An({size:e=18}){return(0,ne.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ne.jsx)("rect",{width:"4",height:"4",fill:"currentColor"}),(0,ne.jsx)("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),(0,ne.jsx)("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),(0,ne.jsx)("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ne.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ne.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ne.jsx)("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ne.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ne.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function On(){return(0,ne.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ne.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dn(){return(0,ne.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ne.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Bt=require("react/jsx-runtime");function Uo({asChild:e,children:t}){let{isMobile:o,theme:n}=uo(),r=t!=null,a=e??!0,l=r?t:(0,Bt.jsx)("button",{type:"button",className:"al-trigger-btn","data-theme":n,children:(0,Bt.jsx)(An,{size:o?12:18})});return o?(0,Bt.jsx)(Wn.Drawer.Trigger,{asChild:a,children:l}):(0,Bt.jsx)(Fn.Trigger,{asChild:a,children:l})}var ft=G(require("react"),1),wo=G(require("@radix-ui/react-popover"),1),ut=require("vaul");var $n=require("@tanstack/react-query");var Bn={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher.json"};var Sa="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Ma="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Ae(e,t){return`${e==="production"?Ma:Sa}/${t}.png`}function Vn(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://dev-x.crosstoken.io/gametoken/CROSS",stage:"https://stg-x.crosstoken.io/gametoken/CROSS",production:"https://x.crosstoken.io/gametoken/CROSS"},iconUrl:Ae(t,"dex"),order:1e3,type:"gametoken",badge:null,isNew:!1},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg-x.crosstoken.io/forge",stage:"https://stg-x.crosstoken.io/forge",production:"https://x.crosstoken.io/forge"},iconUrl:Ae(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0},{id:"crossd",label:"Bridge (CROSSD)",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:Ae(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:Ae(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg-x.crosstoken.io/rewards",stage:"https://stg-x.crosstoken.io/rewards",production:"https://x.crosstoken.io/rewards"},iconUrl:Ae(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:Ae(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://www.dev.cross.shop/",stage:"https://www.stage.cross.shop/",production:"https://www.cross.shop/"},iconUrl:Ae(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg-x.crosstoken.io/points",stage:"https://stg-x.crosstoken.io/points",production:"https://x.crosstoken.io/points"},iconUrl:Ae(t,"point"),order:1e4,type:"points",badge:null,isNew:!1},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg-wave.crosstoken.io/en",stage:"https://stg-wave.crosstoken.io/en",production:"https://wave.crosstoken.io/en"},iconUrl:Ae(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.crosstoken.io/612055",stage:"https://stg-explorer.crosstoken.io/612055",production:"https://explorer.crosstoken.io/612055"},iconUrl:Ae(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1}]}}function Vt(e){let t=ce(e);return(0,$n.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:o})=>{try{let n=await fetch(Bn[t],{cache:"no-store",signal:o});if(!n.ok)throw new Error(`Failed to fetch global menu: ${n.status}`);return n.json()}catch(n){if(o.aborted)throw n;return Vn(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function K(...e){return e.filter(Boolean).join(" ")}var q=require("react/jsx-runtime");function zo({align:e="end",sideOffset:t=12,className:o}){let{env:n,theme:r,isMobile:a,domain:l,close:p}=uo(),{data:m}=Vt(n),c=ft.useMemo(()=>(m?.items??[]).sort((h,P)=>h.order-P.order),[m]),d=8,u=ft.useRef(null),v=ft.useCallback(h=>{u.current={x:h.clientX,y:h.clientY}},[]),x=typeof window<"u"?window.location.pathname:"",g=ft.useCallback((h,P)=>{if(u.current){let C=h.clientX-u.current.x,U=h.clientY-u.current.y;if(u.current=null,Math.abs(C)>d||Math.abs(U)>d)return}let O=P.url[n]??P.url.production,M=Hn(O,l);if(!M)try{let C=new URL(O).pathname;if(x===C||x.startsWith(C+"/")){p();return}}catch{}M?window.open(O,"_blank","noopener,noreferrer"):window.location.href=O,p()},[n,l,p,x]),w=(0,q.jsx)("div",{className:"al-grid","data-theme":r,children:c.map(h=>{let P=h.url[n]??h.url.production,O=Hn(P,l),M=!1;if(!O)try{let C=new URL(P).pathname;M=x===C||x.startsWith(C+"/")}catch{M=!1}return(0,q.jsxs)("button",{type:"button",className:"al-grid-item","data-active":M||void 0,onPointerDown:v,onClick:C=>g(C,h),children:[(0,q.jsxs)("div",{className:"al-grid-item-left",children:[(0,q.jsx)("div",{className:"al-grid-item-icon",children:(0,q.jsx)("img",{src:h.iconUrl,alt:h.label,width:24,height:24,loading:"lazy"})}),(0,q.jsx)("span",{className:"al-grid-item-label",children:h.label}),h.isNew&&(0,q.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,q.jsx)("div",{className:"al-grid-item-right",children:h.badge&&(0,q.jsx)("span",{className:"al-badge",children:h.badge})})]},h.id)})});return a?(0,q.jsxs)(ut.Drawer.Portal,{children:[(0,q.jsx)(ut.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,q.jsxs)(ut.Drawer.Content,{className:K("al-drawer-content",o),"data-theme":r,children:[(0,q.jsxs)("div",{className:"al-drawer-header",children:[(0,q.jsx)(ut.Drawer.Close,{className:"al-drawer-close",children:(0,q.jsx)(On,{})}),(0,q.jsx)(ut.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,q.jsx)(ut.Drawer.Close,{className:"al-drawer-close",children:(0,q.jsx)(Dn,{})})]}),(0,q.jsx)("div",{className:"al-drawer-body",children:w})]})]}):(0,q.jsx)(wo.Portal,{children:(0,q.jsx)(wo.Content,{align:e,sideOffset:t,className:K("al-popover-content",o),"data-theme":r,children:w})})}function Hn(e,t){try{let o=new URL(e).hostname;return typeof window>"u"?!0:o!==(t??window.location.hostname)}catch{return!1}}var ie=G(require("react"),1),la=G(require("@radix-ui/react-popover"),1),ca=require("vaul");var ho=require("react"),Go=(0,ho.createContext)(null);function et(){let e=(0,ho.useContext)(Go);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var xo=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(xo||{}),$t={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};var L=G(require("react"),1);var tt=G(require("bignumber.js"),1);function _a(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function gt(e,t){if(!e||e==="0")return"0.00";let o=new tt.default(e).shiftedBy(-t),n=o.isGreaterThanOrEqualTo(1)?2:4;return o.toFormat(n,tt.default.ROUND_DOWN)}function ve(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function jo(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let o=t>=1?2:4,n=Math.pow(10,o);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:o,maximumFractionDigits:o})}`}function Un(e,t,o){let r=new tt.default(e).shiftedBy(-t).multipliedBy(new tt.default(o));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(tt.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,tt.default.ROUND_DOWN):r.decimalPlaces(4,tt.default.ROUND_DOWN)).toFormat()}`}function zn(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let o=t;if(o.includes("e")||o.includes("E")){let l=Number(o);if(!Number.isFinite(l)||l===0)return{displayValue:"0",isLowerBound:!1};o=_a(l.toFixed(18))}let[n="0",r=""]=o.split(".");if(Number(n)>=1){let l=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${l}`,isLowerBound:!1}}return r.length<4?{displayValue:`${n}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}var ye={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},de={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var qo={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Gn={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Zo(e,t){let o=de[e];if(t===o.cross)return Gn.cross;if(t===o.bsc)return Gn.bsc}var Aa={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function wt(e,t,o={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:r,format:a="png"}=o,l=Aa[e],p=r?`&bg=${r}`:"";return`${l}/portrait/evm/${t}.${a}?size=${n}${p}`}var W=require("react/jsx-runtime");function jn({size:e=16,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,W.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ko({size:e=16,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function Ht({size:e=16,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yo({size:e=24,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function qn({size:e=20,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,W.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Zn({size:e=20,className:t}){return(0,W.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,W.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function Kn({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Yn({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Qn({size:e=20,className:t}){return(0,W.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,W.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xn({size:e=16,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,W.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Jn({size:e=16,className:t}){return(0,W.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,W.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,W.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function er({size:e=42,className:t}){return(0,W.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,W.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}var tr=require("react"),or=require("@tanstack/react-query");var Oa="send:chain-info";function Da(e){return"data"in e&&e.data?e.data:e}function Qo(e,...t){let o=e.replace(/\/+$/,""),n=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[o,...n].join("/")}function Fa(e,t,o,n){if(n)return t===de[e].cross?nr(t,n):o?.explorer_url?Qo(o.explorer_url,o.explorer_postfix?.transaction??"tx",n):Wa(e,t,n)}function nr(e,t){return Qo("https://explorer.crosstoken.io",String(e),"tx",t)}function Wa(e,t,o){let n=de[e];if(t===n.cross)return nr(t,o);if(t===n.bsc)return Qo(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",o)}function rr(e,t,o,n=!0){let r=ye[e],a=(0,or.useQuery)({queryKey:[Oa,e,t],queryFn:async({signal:m})=>{let c=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:m});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let d=await c.json();if("code"in d&&d.code!==void 0&&d.code!==200)throw new Error(`Chain info API error: ${d.code}`);return Da(d)},enabled:n,staleTime:300*1e3}),l=a.data;return{transactionUrl:(0,tr.useMemo)(()=>Fa(e,t,l,o),[t,l,e,o]),chainInfo:l,...a}}var ar="0x0000000000000000000000000000000000000001";var Ba="0xa9059cbb",Va=/^0x[a-fA-F0-9]{40}$/,$a="nexus-cross:dapp-ui:send:recent:",ir=10;function Ha(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Ut(e){return e.toLowerCase()}function zt(e){return Va.test(e)}function Xo(e){return Ut(e.address)===ar}function Jo(e){return`${$a}${e.toLowerCase()}`}function Pt(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Jo(e));if(!t)return[];let o=JSON.parse(t);return Array.isArray(o)?o.filter(n=>n!==null&&typeof n=="object"&&zt(n.address)&&typeof n.updatedAt=="number").slice(0,ir):[]}catch{return[]}}function en(e,t){if(typeof window>"u")return[];let o=Ut(t),n=[{address:o,updatedAt:Date.now()},...Pt(e).filter(r=>r.address!==o)].slice(0,ir);try{window.localStorage.setItem(Jo(e),JSON.stringify(n))}catch{return Pt(e)}return n}function tn(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Jo(e))}catch{}}function on(e,t){let o=e.trim();if(!o)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(o))return{error:"Enter a valid amount."};let[n="0",r=""]=o.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let a=BigInt(n||"0"),l=r.padEnd(t,"0"),p=l?BigInt(l):0n,m=10n**BigInt(t),c=a*m+p;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function nn(e,t){let o=BigInt(e||"0"),n=10n**BigInt(t),r=o/n,a=o%n;if(a===0n)return r.toString();let l=Ha(a.toString().padStart(t,"0"));return`${r.toString()}.${l}`}function rn(e,t){let o=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${Ba}${o}${n}`}D(`.wi-token-item--button{position:relative;width:100%;border:none;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:12px;padding:6px 8px;margin:-2px -8px;transition:background-color .15s ease,transform .15s ease}.wi-token-item--button:before{content:"";position:absolute;inset:-6px -16px;border-radius:16px}.wi-token-item--button:active{transform:scale(.99)}.wi-token-item--button:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.wi-view-send{animation:wi-slide-in-right .25s ease-out}.wi-send-body{flex:1;min-height:0;overflow:hidden}.wi-drawer-content[data-direction=bottom][data-view=send]{max-height:100dvh}.send-page{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.send-scroll{flex:1;min-height:0;display:flex;flex-direction:column;gap:16px;overflow-y:auto;overflow-x:hidden;padding:16px 24px 18px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .send-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.send-scroll::-webkit-scrollbar{width:4px}.send-scroll::-webkit-scrollbar-track{background:transparent}.send-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}[data-theme=light] .send-scroll::-webkit-scrollbar-thumb{background:#0000001f}.send-section{display:flex;flex-direction:column;gap:8px}.send-asset-card{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.send-asset-card:disabled{cursor:default}.send-asset-card:not(:disabled):hover,.send-asset-card[aria-expanded=true]{border-color:var(--wi-primary);background:var(--wi-surface-subtle)}.send-token-list{display:flex;flex-direction:column;gap:6px;max-height:180px;overflow-y:auto;padding:6px;border:1px solid var(--wi-border-subtle);border-radius:16px;background:var(--wi-surface-default)}.send-token-option{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:48px;border:none;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer}.send-token-option:hover,.send-token-option[data-selected]{background:var(--wi-surface-subtle)}.send-token-option:focus-visible,.send-asset-card:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-token-option-icon{flex-shrink:0;width:28px;height:28px;border-radius:8px;object-fit:contain;background:transparent}.send-token-option-symbol{color:var(--wi-texticon-primary);font-size:13px;font-weight:700;line-height:1.3}.send-token-option-balance{color:var(--wi-texticon-secondary);font-size:12px;font-weight:600;line-height:1.3;white-space:nowrap}.send-asset-left{display:flex;align-items:center;gap:12px;min-width:0}.send-asset-icon{flex-shrink:0;width:40px;height:40px;border-radius:12px;object-fit:contain;background:transparent}.send-asset-info,.send-asset-balance{min-width:0;display:flex;flex-direction:column}.send-asset-symbol{color:var(--wi-texticon-primary);font-size:15px;font-weight:700;line-height:1.3}.send-asset-name,.send-balance-label{color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.send-asset-balance{align-items:flex-end;text-align:right}.send-balance-value{color:var(--wi-texticon-primary);font-size:13px;font-weight:600;line-height:1.35;white-space:nowrap}.send-form{display:flex;flex-direction:column;gap:14px}.send-field{display:flex;flex-direction:column;gap:8px}.send-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.send-label{color:var(--wi-texticon-secondary);font-size:13px;font-weight:600;line-height:1.3}.send-input,.send-amount-wrap{width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);color:var(--wi-texticon-primary);font:inherit}.send-input{min-height:46px;padding:0 14px;font-size:16px;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.send-input:focus{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-address-wrap[data-invalid],.send-amount-wrap[data-invalid]{border-color:#ff6b6b}.send-address-wrap[data-invalid]:focus-within,.send-amount-wrap[data-invalid]:focus-within{border-color:#ff6b6b;box-shadow:0 0 0 3px #ff6b6b29}.send-input::placeholder{color:var(--wi-texticon-tertiary)}.send-address-wrap{display:flex;align-items:center;width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);transition:border-color .15s ease,box-shadow .15s ease}.send-address-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--address{flex:1;min-width:0;border:none;background:transparent;box-shadow:none}.send-input--address:focus{box-shadow:none}.send-address-book-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;margin-right:2px;border:none;border-radius:12px;background:transparent;color:var(--wi-texticon-tertiary);cursor:pointer;transition:background-color .15s ease,color .15s ease}.send-address-book-btn:hover,.send-address-book-btn[aria-expanded=true]{background:var(--wi-surface-subtle);color:var(--wi-primary)}.send-address-book-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-picker{display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default)}.send-address-tabs{display:flex;align-items:center;gap:22px;border-bottom:1px solid var(--wi-border-subtle)}.send-address-tab{position:relative;border:none;background:transparent;color:var(--wi-texticon-tertiary);font:inherit;font-size:14px;font-weight:800;line-height:1.3;padding:0 0 12px;cursor:pointer}.send-address-tab[data-active]{color:var(--wi-primary)}.send-address-tab[data-active]:after{content:"";position:absolute;left:50%;bottom:-1px;width:34px;height:4px;border-radius:999px;background:var(--wi-primary);transform:translate(-50%)}.send-address-list{display:flex;flex-direction:column;gap:10px;max-height:224px;overflow-y:auto;padding-right:10px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}[data-theme=light] .send-address-list{scrollbar-color:rgba(0,0,0,.14) transparent}.send-address-list::-webkit-scrollbar{width:3px}.send-address-list::-webkit-scrollbar-track{background:transparent}.send-address-list::-webkit-scrollbar-thumb{background:#ffffff2e;border-radius:999px}[data-theme=light] .send-address-list::-webkit-scrollbar-thumb{background:#00000024}.send-address-option{display:flex;align-items:center;gap:12px;width:100%;min-height:54px;border:none;border-radius:14px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer;transition:background-color .15s ease}.send-address-option:hover{background:var(--wi-surface-subtle)}.send-address-option:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--wi-surface-subtle);color:var(--wi-primary);font-size:12px;font-weight:800;overflow:hidden}.send-address-avatar-img{position:relative;z-index:1;width:36px;height:36px;border-radius:50%;object-fit:cover}.send-address-avatar-fallback{position:absolute;inset:0;display:inline-flex;align-items:center;justify-content:center}.send-address-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.send-address-name{color:var(--wi-texticon-primary);font-size:14px;font-weight:800;line-height:1.3}.send-address-value{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:600;line-height:1.3}.send-address-empty{display:flex;align-items:center;justify-content:center;min-height:120px;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:700}.send-amount-wrap{display:flex;align-items:center;padding-right:12px}.send-amount-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--amount{border:none;background:transparent;box-shadow:none;flex:1;min-width:0}.send-input--amount:focus{box-shadow:none}.send-amount-symbol{color:var(--wi-texticon-secondary);font-size:13px;font-weight:700}.send-field-error{margin:-2px 0 0;color:#ff6b6b;font-size:12px;font-weight:600;line-height:1.35}.send-max-btn{border:none;border-radius:999px;background:var(--wi-surface-subtle);color:var(--wi-primary);font:inherit;font-size:12px;font-weight:700;padding:4px 10px;cursor:pointer}.send-max-btn:disabled{cursor:not-allowed;opacity:.45}.send-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.4}.send-meta span:last-child{color:var(--wi-texticon-secondary);font-weight:600}.send-message{border-radius:14px;padding:10px 12px;font-size:12px;line-height:1.45}.send-message--error{background:#ff50501f;color:#ff6b6b}.send-message--success{background:color-mix(in srgb,var(--wi-primary) 12%,transparent);color:var(--wi-primary)}.send-message span{font-weight:700}.send-submit-btn{width:100%;min-height:48px;border:none;border-radius:999px;background:var(--wi-primary);color:var(--wi-primary-contrast, #001410);font:inherit;font-size:15px;font-weight:800;cursor:pointer;transition:opacity .15s ease,transform .15s ease}.send-submit-btn:hover:not(:disabled):not([data-disabled]){transform:translateY(-1px)}.send-submit-btn:disabled,.send-submit-btn[data-disabled]{cursor:not-allowed;opacity:.45}.send-footer{flex-shrink:0;padding:14px 24px 24px;border-top:1px solid var(--wi-border-subtle);background:var(--wi-surface-bg)}.send-page--success{background:var(--wi-surface-bg)}.send-success-body{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:32px 24px;text-align:center}.send-success-icon{display:inline-flex;align-items:center;justify-content:center}.send-success-icon[data-pending]{width:56px;height:56px;border-radius:50%;background:color-mix(in srgb,var(--wi-primary) 14%,transparent)}.send-success-spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--wi-primary) 22%,transparent);border-top-color:var(--wi-primary);border-radius:50%;animation:cross-send-spin .8s linear infinite}.send-success-copy{display:flex;flex-direction:column;gap:8px}.send-success-title{margin:0;color:var(--wi-texticon-primary);font-size:22px;font-weight:800;line-height:1.25}.send-success-desc{margin:0;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:600;line-height:1.45}.send-success-hash-card{width:100%;display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);box-sizing:border-box}.send-success-hash-label{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:700;line-height:1.3;text-align:left}.send-success-hash-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:none;border-radius:12px;background:var(--wi-surface-subtle);color:var(--wi-texticon-primary);font:inherit;font-size:14px;font-weight:800;padding:12px}.send-success-hash-link{flex:1;display:inline-flex;align-items:center;align-self:stretch;min-width:0;border:none;background:transparent;color:inherit;font:inherit;font-weight:inherit;padding:0;text-align:left;text-decoration:none;cursor:pointer;user-select:none}.send-success-hash-link:hover{color:var(--wi-primary)}.send-success-hash-link:focus-visible,.send-success-copy-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-success-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:32px;border:none;background:transparent;color:var(--wi-primary);font:inherit;font-size:12px;font-weight:800;padding:0;cursor:pointer}@keyframes cross-send-spin{to{transform:rotate(360deg)}}.send-page--review{background:var(--wi-surface-bg)}.send-review-scroll{gap:16px;padding-top:12px}.send-review-amount{display:flex;align-items:center;justify-content:center;gap:4px;padding:12px 0}.send-review-amount-icon{width:32px;height:32px;border-radius:50%;object-fit:contain;flex-shrink:0}.send-review-amount-value{color:var(--wi-texticon-primary);font-size:26px;font-weight:800;line-height:1.3;letter-spacing:-.01em}.send-review-parties{display:flex;flex-direction:column;gap:4px;width:100%}.send-review-party{display:flex;align-items:flex-start;gap:8px;padding:16px;border-radius:8px;background:var(--wi-surface-subtle)}.send-review-party-label{flex-shrink:0;width:80px;color:var(--wi-texticon-tertiary);font-size:14px;line-height:1.4}.send-review-party-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;align-items:flex-end;text-align:right}.send-review-party-name{color:var(--wi-texticon-primary);font-size:14px;font-weight:700;line-height:1.3}.send-review-party-addr{width:100%;color:var(--wi-texticon-primary);font-size:12px;line-height:1.4;word-break:break-all}.send-review-section{display:flex;flex-direction:column;gap:8px;width:100%}.send-review-section-title{margin:0;color:var(--wi-texticon-primary);font-size:15px;font-weight:700;line-height:1.6}.send-review-row{display:flex;align-items:flex-start;gap:20px;padding:2px 0}.send-review-row-label{flex-shrink:0;width:100px;color:var(--wi-texticon-tertiary);font-size:13px;line-height:1.3}.send-review-row-value{flex:1;min-width:0;color:var(--wi-texticon-primary);font-size:13px;line-height:1.3;text-align:right;word-break:break-all}.send-review-row-value--accent{color:var(--wi-primary)}.send-review-network{display:inline-flex;align-items:center;gap:4px;justify-content:flex-end}.send-review-network-dot{width:6px;height:6px;border-radius:999px;background:var(--wi-primary);flex-shrink:0}.send-footer--review{display:flex;gap:8px}.send-review-btn{flex:1;min-width:0;min-height:48px;padding:12px 16px;border-radius:12px;font:inherit;font-size:16px;font-weight:700;line-height:1.3;cursor:pointer;transition:opacity .15s ease,transform .15s ease}.send-review-btn:disabled{cursor:not-allowed;opacity:.55}.send-review-btn--cancel{background:transparent;border:1px solid var(--wi-primary);color:var(--wi-primary)}.send-review-btn--confirm{background:var(--wi-primary);border:1px solid var(--wi-primary);color:var(--wi-primary-contrast, #001410)}.send-review-btn:not(:disabled):hover{transform:translateY(-1px)}
6
+ `);var i=require("react/jsx-runtime"),Ua=1500,za=120;function an(e){return`${e.chainId}:${e.address.toLowerCase()}`}function sr(e,t){return e.name||`Account ${(e.index??t)+1}`}function lr(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Ga(e){return new Promise(t=>setTimeout(t,e))}function ja(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}function qa(e){return!!(e.token||e.recipient||e.amount)}function cn(e,t,o=10){if(t<=0)return e.toString();let n=10n**BigInt(t),r=e/n,a=e%n;if(a===0n)return r.toString();let p=a.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(o,t)));return p=p.replace(/0+$/,""),p?`${r.toString()}.${p}`:r.toString()}function sn(e,t){return cn(e,t,6)}function ln(e){return cn(e,9,2)}function Za(e){return e.toLocaleString("en-US")}function Ka(e){return e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Ya(e){return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function Qa(){return(0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[(0,i.jsx)("path",{d:"M4.5 4.5C4.5 3.67 5.17 3 6 3h8.25c.69 0 1.25.56 1.25 1.25V16.5H6A1.5 1.5 0 0 1 4.5 15V4.5Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M4.5 14.5C4.5 13.67 5.17 13 6 13h9.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M8 6.5h4M8 9h3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Xa(){return(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none","aria-hidden":"true",children:[(0,i.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--wi-primary)"}),(0,i.jsx)("path",{d:"M17 28.5L24.2 35.5L39 20.5",stroke:"var(--wi-primary-contrast, #001410)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Gt({env:e,theme:t="dark",walletAddress:o,accountName:n,accounts:r=[],token:a,tokens:l=[],onTokenChange:p,sendTransaction:m,getTransactionReceipt:c,estimateGas:d,onSuccess:u,onConfirmSuccess:v,onOutlink:x}){let[g,w]=L.useState(""),[h,P]=L.useState(""),[O,M]=L.useState(""),[C,U]=L.useState({}),[y,R]=L.useState(""),[z,E]=L.useState(!1),[_,j]=L.useState(!1),[Ie,st]=L.useState(!1),[ae,Be]=L.useState("account"),ke=L.useRef(void 0),Q=L.useRef(void 0),qe=L.useRef(null),Ze=L.useRef(null),[pe,Ke]=L.useState(()=>Pt(o)),[me,te]=L.useState("idle"),[X,Pe]=L.useState(null),[ue,Se]=L.useState(!1),[Me,se]=L.useState(""),he=L.useRef(0),[le,Ce]=L.useState(null),[fe,lt]=L.useState(""),xe=Xo(a),Ye=L.useMemo(()=>BigInt(a.quantity.numeric||"0"),[a.quantity.numeric]),Ve=L.useMemo(()=>gt(a.quantity.numeric,a.quantity.decimals),[a.quantity.numeric,a.quantity.decimals]),$e=L.useMemo(()=>r.filter(f=>f.address.toLowerCase()!==o.toLowerCase()),[r,o]),ct=L.useMemo(()=>{let f=new Map;return $e.forEach((N,S)=>{f.set(N.address.toLowerCase(),{account:N,index:S})}),f},[$e]),Ne=$e.length>0,He=L.useMemo(()=>ce(e),[e]),Le=t==="dark"?"1A1A2E":"F3F6F8",Qe=l.length>0?l:[a],Ue=Qe.length>1&&!!p,Rt=!!y||me==="review"||me==="submitting"||me==="confirming",{transactionUrl:ge,chainInfo:ze}=rr(He,a.chainId,y||void 0,Rt),Xe=ze?.currency_symbol??"",_e=ze?.name??`Chain ID ${a.chainId}`;L.useEffect(()=>{M(""),U({}),R(""),te("idle"),Pe(null),se(""),Se(!1),he.current+=1},[a.address,a.chainId,g,h]),L.useEffect(()=>{P(""),E(!1)},[a.address,a.chainId]),L.useEffect(()=>{Ke(Pt(o))},[o]),L.useEffect(()=>()=>{clearTimeout(ke.current),clearTimeout(Q.current)},[]),L.useEffect(()=>{!Ne&&ae==="account"&&Be("recent")},[ae,Ne]),L.useEffect(()=>{let f=window.visualViewport,N=qe.current;if(!f||!N)return;let S=()=>{let Re=document.activeElement;return N.contains(Re)&&(Re instanceof HTMLInputElement||Re instanceof HTMLTextAreaElement)},T=()=>{N.style.paddingBottom=""},Z=()=>{if(!S()){T();return}let Re=Math.max(0,window.innerHeight-f.height-f.offsetTop);Re>0?N.style.paddingBottom=`${Re}px`:T();let Ee=document.activeElement;Ee instanceof HTMLElement&&requestAnimationFrame(()=>{Ee.scrollIntoView({behavior:"smooth",block:"nearest"})})},be=()=>{setTimeout(()=>{S()||T()},0)};return f.addEventListener("resize",Z),window.addEventListener("resize",Z),N.addEventListener("focusout",be),()=>{f.removeEventListener("resize",Z),window.removeEventListener("resize",Z),N.removeEventListener("focusout",be),T()}},[]);let Do=L.useCallback(()=>{clearTimeout(Q.current),Q.current=setTimeout(()=>{Ze.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},10)},[]),Fo=L.useCallback(()=>{P(nn(a.quantity.numeric,a.quantity.decimals))},[a.quantity.numeric,a.quantity.decimals]),ro=L.useCallback(f=>{w(f),j(!1)},[]),Dt=L.useCallback(()=>{let f={},N=g.trim(),S=on(h,a.quantity.decimals),T;return N?zt(N)||(f.recipient="Enter a valid EVM recipient address."):f.recipient="Enter a recipient address.","error"in S?f.amount=S.error:(T=S.value,T>Ye&&(f.amount="Amount exceeds available balance.")),!xe&&!zt(a.address)&&(f.token="Token contract address is invalid."),{errors:f,rawAmount:T,trimmedRecipient:N}},[h,Ye,xe,g,a.address,a.quantity.decimals]),dt=L.useCallback(async()=>{if(y)try{await navigator.clipboard.writeText(y),st(!0),clearTimeout(ke.current),ke.current=setTimeout(()=>st(!1),2e3)}catch{}},[y]),ao=L.useCallback(()=>{if(!ge||!y)return;let f=T=>{typeof window>"u"||window.open(T,"_blank","noopener,noreferrer")};if(!x){f(ge);return}let N=x(ge,{category:"send",origin:"send-transaction",payload:{chainId:a.chainId,txHash:y}});if(N&&(typeof N=="object"||typeof N=="function")&&typeof N.then=="function"){let T=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;N.then(Z=>{if(Z===null){T?.close();return}let be=Z??ge;if(T)try{T.location.href=be}catch{T.close(),f(be)}else f(be)});return}let S=N;S!==null&&f(S??ge)},[x,a.chainId,ge,y]),Je=L.useCallback((f,N)=>xe?{to:f,value:N,chainId:a.chainId,from:o}:{to:Ut(a.address),data:rn(f,N),value:0n,chainId:a.chainId,from:o},[xe,a.address,a.chainId,o]),Ft=L.useCallback(async(f,N)=>{if(!d)return;let S=++he.current;Se(!0),se("");try{let T=await d(Je(f,N));if(he.current!==S)return;Pe(T)}catch(T){if(he.current!==S)return;se(T instanceof Error?T.message:"Failed to estimate gas.")}finally{he.current===S&&Se(!1)}},[Je,d]),Wt=L.useCallback(f=>{if(f.preventDefault(),M(""),R(""),!m){te("error"),M("Sending is not available for this wallet.");return}let{errors:N,rawAmount:S,trimmedRecipient:T}=Dt();if(U(N),qa(N)||S===void 0){te("error");return}let Z=T;Ce(S),lt(Z),Pe(null),se(""),te("review"),Ft(Z,S)},[Ft,m,Dt]),Wo=L.useCallback(async()=>{if(!(!m||!fe||le===null)){M(""),R("");try{te("submitting");let f=await m(Je(fe,le));if(R(f),te("confirming"),Ke(en(o,fe)),u?.(f),!c){te("success");return}for(let N=0;N<za;N+=1){let S=await c({hash:f,chainId:a.chainId}).catch(()=>null);if(S){if(ja(S)){te("error"),M("Transaction reverted on-chain.");return}te("success");return}await Ga(Ua)}te("error"),M("Transaction receipt was not found. Please check again later.")}catch(f){te("error"),M(f instanceof Error?f.message:"Failed to send transaction.")}}},[Je,c,u,le,fe,m,a.chainId,o]),io=L.useCallback(()=>{he.current+=1,Pe(null),se(""),Se(!1),M(""),te("idle")},[]),Et=Ye<=0n||!g.trim()||!h.trim();if(me==="review"||me==="submitting"){let f=me==="submitting",N=le!==null?cn(le,a.quantity.decimals):h.trim(),S=n?.trim()||`Account ${(r[0]?.index??0)+1}`,T="\u2014",Z=Xe||(xe?a.symbol:""),be=ze?.currency_decimals??(xe?a.quantity.decimals:18),Re=X?Ka(X):null,Ee=X?Ya(X):null,Bo=Ee!==null&&Z?`${sn(Ee,be)} ${Z}`:T,so=X?Za(X.gasLimit):T,En=X?.maxPriorityFeePerGas!==void 0?`${ln(X.maxPriorityFeePerGas)} Gwei`:T,Tn=X?.maxFeePerGas!==void 0?`${ln(X.maxFeePerGas)} Gwei`:T,In=X?.gasPrice!==void 0?`${ln(X.gasPrice)} Gwei`:T,lo=`${N} ${a.symbol}`,co=(()=>{if(!X||Ee===null)return T;if(xe&&le!==null){let b=le+Ee;return`${sn(b,be)} ${Z||a.symbol}`}return Z?`${sn(Ee,be)} ${Z}`:T})();return(0,i.jsxs)("div",{className:"send-page send-page--review",children:[(0,i.jsxs)("div",{className:"send-scroll send-review-scroll","data-vaul-no-drag":!0,children:[(0,i.jsxs)("div",{className:"send-review-amount",children:[(0,i.jsx)("img",{className:"send-review-amount-icon",src:a.icon_url,alt:"",width:32,height:32,draggable:!1,onError:b=>{b.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,i.jsxs)("span",{className:"send-review-amount-value",children:[N," ",a.symbol]})]}),(0,i.jsxs)("div",{className:"send-review-parties",children:[(0,i.jsxs)("div",{className:"send-review-party",children:[(0,i.jsx)("span",{className:"send-review-party-label",children:"From"}),(0,i.jsxs)("div",{className:"send-review-party-info",children:[(0,i.jsx)("span",{className:"send-review-party-name",children:S}),(0,i.jsx)("span",{className:"send-review-party-addr",children:o})]})]}),(0,i.jsxs)("div",{className:"send-review-party",children:[(0,i.jsx)("span",{className:"send-review-party-label",children:"To"}),(0,i.jsx)("div",{className:"send-review-party-info",children:(0,i.jsx)("span",{className:"send-review-party-addr",children:fe})})]})]}),(0,i.jsxs)("section",{className:"send-review-section",children:[(0,i.jsx)("h3",{className:"send-review-section-title",children:"Summary"}),(0,i.jsxs)("div",{className:"send-review-row",children:[(0,i.jsx)("span",{className:"send-review-row-label",children:"Network"}),(0,i.jsxs)("span",{className:"send-review-row-value send-review-network",children:[(0,i.jsx)("span",{className:"send-review-network-dot","aria-hidden":!0}),_e]})]}),(0,i.jsxs)("div",{className:"send-review-row",children:[(0,i.jsx)("span",{className:"send-review-row-label",children:"Est. Tx Fee"}),(0,i.jsx)("span",{className:"send-review-row-value",children:ue?"\u2026":Bo})]}),Re==="dynamic"?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"send-review-row",children:[(0,i.jsx)("span",{className:"send-review-row-label",children:"Max Priority Fee"}),(0,i.jsx)("span",{className:"send-review-row-value",children:ue?"\u2026":En})]}),(0,i.jsxs)("div",{className:"send-review-row",children:[(0,i.jsx)("span",{className:"send-review-row-label",children:"Max Gas Fee"}),(0,i.jsx)("span",{className:"send-review-row-value",children:ue?"\u2026":Tn})]})]}):Re==="legacy"?(0,i.jsxs)("div",{className:"send-review-row",children:[(0,i.jsx)("span",{className:"send-review-row-label",children:"Gas Price"}),(0,i.jsx)("span",{className:"send-review-row-value",children:ue?"\u2026":In})]}):null,(0,i.jsxs)("div",{className:"send-review-row",children:[(0,i.jsx)("span",{className:"send-review-row-label",children:"Gas Limit"}),(0,i.jsx)("span",{className:"send-review-row-value",children:ue?"\u2026":so})]})]}),(0,i.jsxs)("section",{className:"send-review-section",children:[(0,i.jsx)("h3",{className:"send-review-section-title",children:"Total"}),(0,i.jsxs)("div",{className:"send-review-row",children:[(0,i.jsx)("span",{className:"send-review-row-label",children:"Total Amount"}),(0,i.jsx)("span",{className:"send-review-row-value",children:lo})]}),(0,i.jsxs)("div",{className:"send-review-row",children:[(0,i.jsx)("span",{className:"send-review-row-label",children:"Max. Total Amount"}),(0,i.jsx)("span",{className:"send-review-row-value",children:ue?"\u2026":co})]})]}),Me&&(0,i.jsx)("div",{className:"send-message send-message--error",role:"alert",children:Me}),O&&(0,i.jsx)("div",{className:"send-message send-message--error",role:"alert",children:O})]}),(0,i.jsxs)("div",{className:"send-footer send-footer--review",children:[(0,i.jsx)("button",{type:"button",className:"send-review-btn send-review-btn--cancel",onClick:io,disabled:f,children:"Cancel"}),(0,i.jsx)("button",{type:"button",className:"send-review-btn send-review-btn--confirm",onClick:Wo,disabled:f,children:f?"Sending...":"Send"})]})]})}if((me==="confirming"||me==="success")&&y){let f=me==="success";return(0,i.jsxs)("div",{className:"send-page send-page--success",children:[(0,i.jsxs)("div",{className:"send-success-body","data-vaul-no-drag":!0,children:[(0,i.jsx)("div",{className:"send-success-icon","data-pending":!f||void 0,children:f?(0,i.jsx)(Xa,{}):(0,i.jsx)("span",{className:"send-success-spinner"})}),(0,i.jsxs)("div",{className:"send-success-copy",children:[(0,i.jsx)("h3",{className:"send-success-title",children:f?"Transaction Complete":"Transaction in Progress"}),(0,i.jsx)("p",{className:"send-success-desc",children:f?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),(0,i.jsxs)("div",{className:"send-success-hash-card",children:[(0,i.jsx)("span",{className:"send-success-hash-label",children:"Transaction Hash"}),(0,i.jsxs)("div",{className:"send-success-hash-row","data-vaul-no-drag":!0,children:[(0,i.jsx)("button",{type:"button",className:"send-success-hash-link",onClick:ao,"aria-label":"Open transaction in explorer",children:ve(y)}),(0,i.jsx)("button",{type:"button",className:"send-success-copy-btn",onClick:dt,"aria-label":"Copy transaction hash",children:Ie?(0,i.jsx)(Ht,{size:16}):"Copy"})]})]})]}),(0,i.jsx)("div",{className:"send-footer",children:(0,i.jsx)("button",{type:"button",className:"send-submit-btn",onClick:v,disabled:!f,children:f?"All done":"Sending..."})})]})}return(0,i.jsxs)("form",{className:"send-page",onSubmit:Wt,children:[(0,i.jsxs)("div",{className:"send-scroll","data-vaul-no-drag":!0,ref:qe,children:[(0,i.jsxs)("section",{className:"send-section","aria-label":"Select token to send",children:[(0,i.jsx)("span",{className:"send-label",children:"Token"}),(0,i.jsxs)("button",{type:"button",className:"send-asset-card",onClick:()=>{Ue&&E(f=>!f)},disabled:!Ue,"aria-expanded":Ue?z:void 0,children:[(0,i.jsxs)("span",{className:"send-asset-left",children:[(0,i.jsx)("img",{className:"send-asset-icon",src:a.icon_url,alt:a.symbol,width:40,height:40,draggable:!1,onError:f=>{f.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,i.jsxs)("span",{className:"send-asset-info",children:[(0,i.jsx)("span",{className:"send-asset-symbol",children:a.symbol}),(0,i.jsx)("span",{className:"send-asset-name",children:a.name})]})]}),(0,i.jsxs)("span",{className:"send-asset-balance",children:[(0,i.jsx)("span",{className:"send-balance-label",children:"Available"}),(0,i.jsxs)("span",{className:"send-balance-value",children:[Ve," ",a.symbol]})]})]}),Ue&&z&&(0,i.jsx)("div",{className:"send-token-list",role:"listbox",children:Qe.map(f=>{let N=an(f)===an(a);return(0,i.jsxs)("button",{type:"button",role:"option","aria-selected":N,className:"send-token-option","data-selected":N||void 0,onClick:()=>p?.(f),children:[(0,i.jsxs)("span",{className:"send-asset-left",children:[(0,i.jsx)("img",{className:"send-token-option-icon",src:f.icon_url,alt:f.symbol,width:28,height:28,draggable:!1,onError:S=>{S.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,i.jsxs)("span",{className:"send-asset-info",children:[(0,i.jsx)("span",{className:"send-token-option-symbol",children:f.symbol}),(0,i.jsx)("span",{className:"send-asset-name",children:f.name})]})]}),(0,i.jsx)("span",{className:"send-token-option-balance",children:gt(f.quantity.numeric,f.quantity.decimals)})]},an(f))})}),C.token&&(0,i.jsx)("p",{className:"send-field-error",role:"alert",children:C.token})]}),(0,i.jsxs)("section",{className:"send-field","aria-label":"Recipient address",children:[(0,i.jsx)("span",{className:"send-label",children:"To"}),(0,i.jsxs)("div",{className:"send-address-wrap","data-invalid":C.recipient||void 0,children:[(0,i.jsx)("input",{className:"send-input send-input--address",value:g,onChange:f=>w(f.target.value),placeholder:"0x...",autoComplete:"off",spellCheck:!1,"aria-invalid":!!C.recipient,"aria-describedby":C.recipient?"send-recipient-error":void 0}),(0,i.jsx)("button",{type:"button",className:"send-address-book-btn",onClick:()=>j(f=>!f),"aria-label":"Open address book","aria-expanded":_,children:(0,i.jsx)(Qa,{})})]}),C.recipient&&(0,i.jsx)("p",{id:"send-recipient-error",className:"send-field-error",role:"alert",children:C.recipient}),_&&(0,i.jsxs)("div",{className:"send-address-picker",children:[(0,i.jsxs)("div",{className:"send-address-tabs",role:"tablist",children:[Ne&&(0,i.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":ae==="account"||void 0,"aria-selected":ae==="account",onClick:()=>Be("account"),children:"My Account"}),(0,i.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":ae==="recent"||void 0,"aria-selected":ae==="recent",onClick:()=>Be("recent"),children:"Recent"})]}),Ne&&ae==="account"?(0,i.jsx)("div",{className:"send-address-list",children:$e.map((f,N)=>{let S=sr(f,N),T=wt(He,f.address,{size:56,bg:Le});return(0,i.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>ro(f.address),children:[(0,i.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[T&&(0,i.jsx)("img",{className:"send-address-avatar-img",src:T,alt:"",width:36,height:36,draggable:!1,onError:Z=>{Z.currentTarget.style.display="none"}}),(0,i.jsx)("span",{className:"send-address-avatar-fallback",children:lr(S)})]}),(0,i.jsxs)("span",{className:"send-address-copy",children:[(0,i.jsx)("span",{className:"send-address-name",children:S}),(0,i.jsx)("span",{className:"send-address-value",children:ve(f.address)})]})]},f.address)})}):pe.length>0?(0,i.jsx)("div",{className:"send-address-list",children:pe.map(f=>{let N=ct.get(f.address.toLowerCase()),S=N?sr(N.account,N.index):void 0,T=wt(He,f.address,{size:56,bg:Le});return(0,i.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>ro(f.address),children:[(0,i.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[T&&(0,i.jsx)("img",{className:"send-address-avatar-img",src:T,alt:"",width:36,height:36,draggable:!1,onError:Z=>{Z.currentTarget.style.display="none"}}),(0,i.jsx)("span",{className:"send-address-avatar-fallback",children:S?lr(S):f.address.slice(2,4).toUpperCase()})]}),(0,i.jsxs)("span",{className:"send-address-copy",children:[(0,i.jsx)("span",{className:"send-address-name",children:S??ve(f.address)}),(0,i.jsx)("span",{className:"send-address-value",children:N?ve(N.account.address):"Recently sent"})]})]},f.address)})}):(0,i.jsx)("div",{className:"send-address-empty",children:"No Send History"})]})]}),(0,i.jsxs)("section",{className:"send-field","aria-labelledby":"send-amount-label",children:[(0,i.jsxs)("span",{className:"send-label-row",children:[(0,i.jsx)("span",{id:"send-amount-label",className:"send-label",children:"Amount"}),(0,i.jsx)("button",{type:"button",className:"send-max-btn",onClick:Fo,disabled:Ye<=0n,children:"Max"})]}),(0,i.jsxs)("div",{className:"send-amount-wrap","data-invalid":C.amount||void 0,children:[(0,i.jsx)("input",{ref:Ze,className:"send-input send-input--amount",value:h,onChange:f=>P(f.target.value),onFocus:Do,placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-labelledby":"send-amount-label","aria-invalid":!!C.amount,"aria-describedby":C.amount?"send-amount-error":void 0}),(0,i.jsx)("span",{className:"send-amount-symbol",children:a.symbol})]}),C.amount&&(0,i.jsx)("p",{id:"send-amount-error",className:"send-field-error",role:"alert",children:C.amount})]}),(0,i.jsxs)("div",{className:"send-meta",children:[(0,i.jsx)("span",{children:"From"}),(0,i.jsx)("span",{children:ve(o)})]}),(0,i.jsxs)("div",{className:"send-meta",children:[(0,i.jsx)("span",{children:"Network"}),(0,i.jsxs)("span",{children:["Chain ID ",a.chainId]})]}),O&&(0,i.jsx)("div",{className:"send-message send-message--error",role:"alert",children:O})]}),(0,i.jsx)("div",{className:"send-footer",children:(0,i.jsx)("button",{type:"submit",className:"send-submit-btn","data-disabled":Et||void 0,"aria-disabled":Et,children:"Send"})})]})}var cr=G(require("@radix-ui/react-popover"),1),dr=require("vaul");var ht=require("react/jsx-runtime");function pr({asChild:e,className:t,children:o}){let{isMobile:n,theme:r,walletAddress:a}=et(),l=o!=null,p=e??!0,m=l?o:(0,ht.jsxs)("button",{type:"button",className:K("wi-trigger-btn",t),"data-theme":r,"data-mobile":n||void 0,children:[(0,ht.jsx)(jn,{size:n?14:16}),(0,ht.jsx)("span",{className:"wi-trigger-address",children:ve(a)})]});return n?(0,ht.jsx)(dr.Drawer.Trigger,{asChild:p,children:m}):(0,ht.jsx)(cr.Trigger,{asChild:p,children:m})}var H=G(require("react"),1),Po=G(require("@radix-ui/react-popover"),1),Zt=require("vaul");var _t=G(require("bignumber.js"),1);var mr=require("@tanstack/react-query"),ur=require("react");var bo="user-balance";async function Ja(e,t,o,n){let r=new URLSearchParams({networkId:`eip155:${t}`,account:o}),a=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:n});if(!a.ok)throw new Error(`Failed to fetch token balance: ${a.status}`);let l=await a.json();if(l.code!==200)throw new Error(`Token balance API error: ${l.code}`);return l.data}function xt(e,t,o=!0){let n=ye[e],r=de[e],a=[r.cross,r.bsc],l=(0,mr.useQueries)({queries:a.map(d=>({queryKey:[bo,e,t,d],queryFn:({signal:u})=>Ja(n,d,t,u),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1}))}),p=l.some(d=>d.isLoading),m=l.some(d=>d.isError);return{tokens:(0,ur.useMemo)(()=>{let d=[];for(let u of l)u.data&&d.push(...u.data);return d},[l]),isLoading:p,isError:m}}var vo=require("@tanstack/react-query"),fr=require("react");var ei="forge-holdings",ti="forge-token-image";async function oi(e,t,o){let n=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:o});if(!n.ok)throw new Error(`Failed to fetch forge holdings: ${n.status}`);let r=await n.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function ni(e,t,o){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:o});if(!n.ok)return{address:t,image_url:""};let r=await n.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function gr(e,t,o=!0){let n=qo[e],{data:r,...a}=(0,vo.useQuery)({queryKey:[ei,e,t],queryFn:({signal:l})=>oi(n,t,l),enabled:!!t&&o,staleTime:0,refetchInterval:o?5e3:!1});return{holdings:r??[],...a}}function wr(e,t,o=!0){let n=qo[e],r=(0,vo.useQueries)({queries:t.map(l=>({queryKey:[ti,e,l],queryFn:({signal:p})=>ni(n,l,p),enabled:o,staleTime:1/0}))});return{imageMap:(0,fr.useMemo)(()=>{let l=new Map;for(let p of r)p.data&&l.set(p.data.address,p.data.image_url);return l},[r])}}var hr=require("@tanstack/react-query"),xr=require("react");var yo="token-stats";function bt(e,t){return`${e}:${t.toLowerCase()}`}function vt(e,t=!0){let o=ye[e],{data:n,...r}=(0,hr.useQuery)({queryKey:[yo,e],queryFn:async({signal:l})=>{let p=await fetch(`${o}/v1/public/token/stats`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Failed to fetch token stats: ${p.status}`);let m=await p.json();if(m.code!==200)throw new Error(`Token stats API error: ${m.code}`);return m},enabled:t,staleTime:3e4});return{statsMap:(0,xr.useMemo)(()=>{let l=new Map;if(!n?.data)return l;for(let p of n.data){let m=bt(p.chain_id,p.address);l.set(m,p)}return l},[n]),...r}}var br=require("@tanstack/react-query"),vr=require("react");var ri="token-info";function dn(e,t){return`${t.toLowerCase()}_${e}`}function yr(e,t=!0){let o=ye[e],{data:n,...r}=(0,br.useQuery)({queryKey:[ri,e],queryFn:async({signal:l})=>{let p=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:l});if(!p.ok)throw new Error(`Failed to fetch token info: ${p.status}`);let m=await p.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:1/0});return{categoryMap:(0,vr.useMemo)(()=>{let l=new Map;if(!n?.data)return l;for(let p of n.data){let m=dn(p.chain_id,p.address);l.set(m,p.category)}return l},[n]),...r}}var kr=require("react"),ko=G(require("bignumber.js"),1);function Cr(e,t,o){let{tokens:n,isLoading:r}=xt(e,t,o),{statsMap:a}=vt(e,o);return(0,kr.useMemo)(()=>{let l=new ko.default(0);for(let d of n){let u=a.get(bt(d.chainId,d.address));if(!u)continue;let x=new ko.default(d.quantity.numeric).shiftedBy(-d.quantity.decimals).multipliedBy(new ko.default(u.price));x.isNaN()||(l=l.plus(x))}let p=l.toFixed(),{displayValue:m,isLowerBound:c}=zn(p);return{totalUsd:p,displayValue:m,isLowerBound:c,isLoading:r}},[n,a,r])}var oa=require("qrcode.react");function Oe(e,t,o,n){if(!n||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=n(t,o)}catch(c){console.error("[dapp-ui] onOutlink threw:",c);return}let a=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(r)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,d=u=>{if(u===null){c?.close();return}let v=u??t;if(c)try{c.location.href=v}catch{c.close(),a(v)}else a(v)};r.then(d,u=>{console.error("[dapp-ui] onOutlink rejected:",u),c?.close()});return}let p=r;if(p===null)return;a(p??t)}var Ct=G(require("react"),1),ta=require("vaul");var Co=require("react"),jt=(0,Co.createContext)(null);function re(){let e=(0,Co.useContext)(jt);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var Nr=require("vaul");var pn=require("react/jsx-runtime");function Lr({asChild:e,children:t}){let{walletAddress:o}=re(),n=t!=null,r=e??!0,a=n?t:(0,pn.jsx)("button",{type:"button",children:ve(o)});return(0,pn.jsx)(Nr.Drawer.Trigger,{asChild:r,children:a})}var qt=require("vaul");var Te=G(require("react"),1),Jr=require("@tanstack/react-query");var _r=require("react"),To=G(require("bignumber.js"),1);var Tr=require("@tanstack/react-query"),mn=require("react");var No={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},Rr={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Lo={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},ot={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},De={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"},Er={dev:{cross:"https://stg-dex-api.crosstoken.io/dex",crossd:"https://stg-crossd-dex-api.crosstoken.io/dex",forge:"https://stg-forge-dex-api.crosstoken.io/dex"},stage:{cross:"https://stg-dex-api.crosstoken.io/dex",crossd:"https://stg-crossd-dex-api.crosstoken.io/dex",forge:"https://stg-forge-dex-api.crosstoken.io/dex"},production:{cross:"https://dex-api.crosstoken.io/dex",crossd:"https://crossd-dex-api.crosstoken.io/dex",forge:"https://forge-dex-api.crosstoken.io/dex"}};var ai="wp:reward-pools";function Ro(e,t=!0){let o=No[e],{data:n,...r}=(0,Tr.useQuery)({queryKey:[ai,e],queryFn:async({signal:p})=>{let m=await fetch(`${o}/v1/pools`,{cache:"no-store",signal:p});if(!m.ok)throw new Error(`Failed to fetch pools: ${m.status}`);let c=await m.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),a=(0,mn.useMemo)(()=>n?.data.pools.filter(p=>p.pool_type==="CrossPool")??[],[n]),l=(0,mn.useMemo)(()=>n?.data.pools.filter(p=>p.pool_type==="GamePool")??[],[n]);return{crossPools:a,gamePools:l,allPools:n?.data.pools??[],...r}}var Ir=require("@tanstack/react-query"),Pr=require("react");var ii="wp:user-deposits";function Eo(e,t,o=!0){let n=No[e],r=o&&!!t,{data:a,...l}=(0,Ir.useQuery)({queryKey:[ii,e,t],queryFn:async({signal:m})=>{let c=await fetch(`${n}/v1/users/${t}/deposits`,{cache:"no-store",signal:m});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let d=await c.json();if(d.code!==200)throw new Error(`Deposits API error: ${d.code}`);return d},enabled:r,staleTime:0});return{depositMap:(0,Pr.useMemo)(()=>{let m=new Map;if(!a?.data.user_deposits)return m;for(let c of a.data.user_deposits)m.set(c.pool_address.toLowerCase(),c);return m},[a]),deposits:a?.data.user_deposits??[],...l}}var un=require("@tanstack/react-query"),fn=require("react");function Fe(e,t,o,n=!0){let r=Er[e][t],a=n&&!!o,{data:l,...p}=(0,un.useQuery)({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:g})=>{let w=await fetch(`${r}/pair-info`,{cache:"no-store",signal:g});if(!w.ok)throw new Error(`pair-info fetch failed: ${w.status}`);let h=await w.json();if(h.code!==200)throw new Error(`pair-info API error: ${h.code}`);return h},enabled:n,staleTime:0}),m=l?.data??[],c=(0,fn.useMemo)(()=>{let g=new Map;for(let w of m)g.set(w.pair_address.toLowerCase(),w);return g},[m]),{data:d,...u}=(0,un.useQuery)({queryKey:["wp:dex-orders",e,t,o],queryFn:async({signal:g})=>{let w=Math.floor(Date.now()/1e3),h=new URLSearchParams({owner:o,size:"200",start_date:"0",end_date:String(w)}),P=await fetch(`${r}/open-order?${h}`,{cache:"no-store",signal:g});if(!P.ok)throw new Error(`open-order fetch failed: ${P.status}`);let O=await P.json();if(O.code!==200)throw new Error(`open-order API error: ${O.code}`);return O.data?.data??[]},enabled:a,staleTime:0}),v=d??[],x=(0,fn.useMemo)(()=>{let g=new Map;for(let w of v){let h=w.pair.toLowerCase();g.has(h)||g.set(h,{buys:[],sells:[]});let P=g.get(h);w.order_side===1?P.buys.push(w):P.sells.push(w)}return g},[v]);return{allPairs:m,pairMap:c,orders:v,ordersByPair:x,isEmpty:v.length===0,isLoading:p.isLoading||u.isLoading}}var si=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],Sr="var(--wp-green)",Mr=4;function Ar(e,t,o=!0){let n=o&&!!t,{allPools:r}=Ro(e,n),{depositMap:a}=Eo(e,t,n),{allPairs:l,pairMap:p,ordersByPair:m}=Fe(e,"cross",t,n),{allPairs:c,pairMap:d,ordersByPair:u}=Fe(e,"crossd",t,n),{allPairs:v,pairMap:x,ordersByPair:g}=Fe(e,"forge",t,n);return(0,_r.useMemo)(()=>{let w=new Map,h=new Map,P=(y,R)=>{!Number.isFinite(R)||R<=0||h.set(y,(h.get(y)??0)+R)};for(let y of r){let R=Number(y.deposit_token.price);R>0&&w.set(y.deposit_token.symbol,R);for(let z of y.reward_tokens){let E=Number(z.price);E>0&&w.set(z.symbol,E)}}for(let y of[...l,...c,...v]){let R=w.get(y.quote_symbol),z=Number(y.billboard?.price);R&&z>0&&!w.has(y.base_symbol)&&w.set(y.base_symbol,z*R)}for(let y of r){let R=a.get(y.pool_address.toLowerCase());if(!R)continue;let z=new To.default(R.deposited_amount).shiftedBy(-y.deposit_token.decimals).toNumber();if(P(y.deposit_token.symbol,z),y.reward_tokens.length>0){let E=y.reward_tokens[0],_=new To.default(R.claimable_reward).shiftedBy(-E.decimals).toNumber();P(E.symbol,_)}}let O=[{pairMap:p,ordersByPair:m},{pairMap:d,ordersByPair:u},{pairMap:x,ordersByPair:g}];for(let{pairMap:y,ordersByPair:R}of O)for(let[z,E]of R){let _=y.get(z);if(_){for(let j of E.buys){let Ie=Number(j.amount)-Number(j.filled);P(_.quote_symbol,Ie*Number(j.price))}for(let j of E.sells){let Ie=Number(j.amount)-Number(j.filled);P(_.base_symbol,Ie)}}}let M=[],C=0;for(let[y,R]of h){let z=w.get(y)??0,E=R*z;E>0&&(M.push({symbol:y,usdValue:E}),C+=E)}M.sort((y,R)=>R.usdValue-y.usdValue);let U=[];if(C>0){let y=M.slice(0,Mr),R=M.slice(Mr);for(let E=0;E<y.length;E++)U.push({symbol:y[E].symbol,usdValue:y[E].usdValue,percentage:Math.round(y[E].usdValue/C*100),color:si[E]??Sr});if(R.length>0){let E=R.reduce((_,j)=>_+j.usdValue,0);U.push({symbol:"Others",usdValue:E,percentage:Math.round(E/C*100),color:Sr})}let z=U.reduce((E,_)=>E+_.percentage,0);z!==100&&U.length>0&&(U[0].percentage+=100-z)}return{totalUsd:C,formattedTotal:C>0?`$${new To.default(C).toFormat(2)}`:"$0.00",segments:U}},[r,a,l,p,m,c,d,u,v,x,g])}var Ge=require("react/jsx-runtime");function Or({size:e=22,className:t}){return(0,Ge.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Ge.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Dr({size:e=22,className:t}){return(0,Ge.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,Ge.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,Ge.jsx)("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Fr({size:e=12,className:t}){return(0,Ge.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Ge.jsx)("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}var Wr=require("@tanstack/react-query"),Br=require("react");var li="wp:token-info";function nt(e,t=!0){let o=ye[e],n=de[e].cross,{data:r,...a}=(0,Wr.useQuery)({queryKey:[li,e],queryFn:async({signal:c})=>{let d=await fetch(`${o}/v1/public/token/info`,{cache:"no-store",signal:c});if(!d.ok)throw new Error(`Failed to fetch token info: ${d.status}`);let u=await d.json();if(u.code!==200)throw new Error(`Token info API error: ${u.code}`);return u},enabled:t,staleTime:300*1e3}),{byChainAddr:l,byChainSym:p}=(0,Br.useMemo)(()=>{let c=new Map,d=new Map;if(!r?.data)return{byChainAddr:c,byChainSym:d};for(let u of r.data){let v=u.address.toLowerCase();c.set(`${u.chain_id}:${v}`,u),c.set(v,u);let x=u.symbol.replace(/^t/,"").toUpperCase(),g=`${u.chain_id}:${x}`;d.has(g)||d.set(g,u),d.has(x)||d.set(x,u)}return{byChainAddr:c,byChainSym:d}},[r]);return{getTokenImage:(c,d)=>{let u=c.toLowerCase(),v=l.get(`${n}:${u}`);if(v?.image)return v.image;let x=l.get(u);if(x?.image)return x.image;if(d){let g=d.replace(/^t/,"").toUpperCase(),w=p.get(`${n}:${g}`);if(w?.image)return w.image;let h=p.get(g);if(h?.image)return h.image}return""},...a}}var rt=require("react/jsx-runtime");function We({title:e,icon:t,iconFit:o="cover",isEmpty:n,children:r}){return(0,rt.jsxs)("div",{className:"wp-svc-card",children:[(0,rt.jsxs)("div",{className:"wp-svc-card-head",children:[(0,rt.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:o}}),(0,rt.jsx)("span",{className:"wp-svc-card-title",children:e})]}),n?(0,rt.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,rt.jsx)("div",{className:"wp-svc-items",children:r})]})}var St=G(require("bignumber.js"),1),ee=require("react/jsx-runtime"),ci="CROSS Rewards";function Vr(e,t){let o=new St.default(e).shiftedBy(-t);return o.isZero()?"0":o.isGreaterThanOrEqualTo(1)?o.toFormat(2,St.default.ROUND_DOWN):o.toFormat(4,St.default.ROUND_DOWN)}function $r(){let{env:e,walletAddress:t,onOutlink:o}=re(),n=!!t,{allPools:r}=Ro(e,n),{depositMap:a}=Eo(e,t,n),{getTokenImage:l}=nt(e,n),p=d=>`${Rr[e]}/rewards/${d.pool_address}?action=withdraw`,m=`${De[e]}/reward.png`,c=r.filter(d=>{let u=a.get(d.pool_address.toLowerCase()),v=u?.deposited_amount??"0",x=u?.claimable_reward??"0";return!(new St.default(v).isZero()&&new St.default(x).isZero())});return(0,ee.jsx)(We,{title:ci,icon:m,isEmpty:c.length===0,children:c.map(d=>{let u=a.get(d.pool_address.toLowerCase()),v=u?.deposited_amount??"0",x=p(d);return(0,ee.jsxs)("a",{className:"wp-item","data-side":"reward",href:x,target:"_blank",rel:"noopener noreferrer",onClick:g=>Oe(g,x,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:u}},o),children:[(0,ee.jsxs)("div",{className:"wp-item-body",children:[(0,ee.jsxs)("div",{className:"wp-item-field",children:[(0,ee.jsxs)("span",{className:"wp-item-label",children:["Deposited (",d.deposit_token.symbol,")"]}),(0,ee.jsxs)("div",{className:"wp-svc-token",children:[l(d.deposit_token.address,d.deposit_token.symbol)&&(0,ee.jsx)("img",{className:"wp-svc-token-icon",src:l(d.deposit_token.address,d.deposit_token.symbol),alt:""}),(0,ee.jsx)("span",{children:Vr(v,d.deposit_token.decimals)})]})]}),(0,ee.jsxs)("div",{className:"wp-item-field",children:[(0,ee.jsxs)("span",{className:"wp-item-label",children:["Rewards (",d.reward_tokens.map(g=>g.symbol).join(", "),")"]}),d.reward_tokens.map(g=>{let w=l(g.address,g.symbol);return(0,ee.jsxs)("div",{className:"wp-svc-token",children:[w&&(0,ee.jsx)("img",{className:"wp-svc-token-icon",src:w,alt:""}),(0,ee.jsx)("span",{children:u?Vr(u.claimable_reward,g.decimals):"0"})]},g.address)})]})]}),(0,ee.jsxs)("div",{className:"wp-item-badges",children:[(0,ee.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),(0,ee.jsx)("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},d.pool_address)})})}var wn=G(require("bignumber.js"),1);var A=require("react/jsx-runtime");function gn(e){let t=new wn.default(e);if(t.isNaN())return e;let o=t.decimalPlaces()??0;return t.toFormat(o)}function Hr(e){let t=new wn.default(e.amount).minus(e.filled);return gn(t.toString())}function Mt({market:e,pairMap:t,ordersByPair:o,getDexUrl:n,getTokenImage:r}){let{onOutlink:a}=re(),l=[];for(let[p,m]of o){let c=t.get(p),d=c?r(c.base_address,c.base_symbol):"",u=c?r(c.quote_address,c.quote_symbol):"",v=n(p);for(let x of m.buys)l.push((0,A.jsxs)("a",{className:"wp-item","data-side":"buy",href:v,target:"_blank",rel:"noopener noreferrer",onClick:g=>Oe(g,v,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"buy",order:x,pair:c}},a),children:[(0,A.jsxs)("div",{className:"wp-item-body",children:[(0,A.jsxs)("div",{className:"wp-item-field",children:[(0,A.jsxs)("span",{className:"wp-item-label wp-item-label--buy",children:["Buy",c?.base_symbol?` (${c.base_symbol})`:""]}),(0,A.jsxs)("div",{className:"wp-svc-token",children:[d&&(0,A.jsx)("img",{className:"wp-svc-token-icon",src:d,alt:""}),(0,A.jsx)("span",{children:Hr(x)})]})]}),(0,A.jsxs)("div",{className:"wp-item-field",children:[(0,A.jsxs)("span",{className:"wp-item-label",children:["Price",c?.quote_symbol?` (${c.quote_symbol})`:""]}),(0,A.jsxs)("div",{className:"wp-svc-token",children:[u&&(0,A.jsx)("img",{className:"wp-svc-token-icon",src:u,alt:""}),(0,A.jsx)("span",{children:gn(x.price)})]})]})]}),(0,A.jsx)("div",{className:"wp-item-badges",children:(0,A.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`buy-${x.order_id}`));for(let x of m.sells)l.push((0,A.jsxs)("a",{className:"wp-item","data-side":"sell",href:v,target:"_blank",rel:"noopener noreferrer",onClick:g=>Oe(g,v,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"sell",order:x,pair:c}},a),children:[(0,A.jsxs)("div",{className:"wp-item-body",children:[(0,A.jsxs)("div",{className:"wp-item-field",children:[(0,A.jsxs)("span",{className:"wp-item-label wp-item-label--sell",children:["Sell",c?.base_symbol?` (${c.base_symbol})`:""]}),(0,A.jsxs)("div",{className:"wp-svc-token",children:[d&&(0,A.jsx)("img",{className:"wp-svc-token-icon",src:d,alt:""}),(0,A.jsx)("span",{children:Hr(x)})]})]}),(0,A.jsxs)("div",{className:"wp-item-field",children:[(0,A.jsxs)("span",{className:"wp-item-label",children:["Price",c?.quote_symbol?` (${c.quote_symbol})`:""]}),(0,A.jsxs)("div",{className:"wp-svc-token",children:[u&&(0,A.jsx)("img",{className:"wp-svc-token-icon",src:u,alt:""}),(0,A.jsx)("span",{children:gn(x.price)})]})]})]}),(0,A.jsx)("div",{className:"wp-item-badges",children:(0,A.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${x.order_id}`))}return(0,A.jsx)(A.Fragment,{children:l})}var hn=require("react/jsx-runtime"),di="Gametoken - CROSS";function Ur(){let{env:e,walletAddress:t}=re(),o=!!t,{pairMap:n,ordersByPair:r,isEmpty:a}=Fe(e,"cross",t,o),{getTokenImage:l}=nt(e,o),p=c=>{let d=n.get(c.toLowerCase());return`${ot[e]}/gametoken/cross/${d?.base_symbol??""}`},m=`${De[e]}/dex.png`;return(0,hn.jsx)(We,{title:di,icon:m,isEmpty:a,children:(0,hn.jsx)(Mt,{market:"cross",pairMap:n,ordersByPair:r,getDexUrl:p,getTokenImage:l})})}var xn=require("react/jsx-runtime"),pi="Gametoken - CROSSD";function zr(){let{env:e,walletAddress:t}=re(),o=!!t,{pairMap:n,ordersByPair:r,isEmpty:a}=Fe(e,"crossd",t,o),{getTokenImage:l}=nt(e,o),p=c=>{let d=n.get(c.toLowerCase());return`${ot[e]}/gametoken/crossd/${d?.base_symbol??""}`},m=`${De[e]}/dex.png`;return(0,xn.jsx)(We,{title:pi,icon:m,isEmpty:a,children:(0,xn.jsx)(Mt,{market:"crossd",pairMap:n,ordersByPair:r,getDexUrl:p,getTokenImage:l})})}var bn=require("react/jsx-runtime"),mi="Gametoken - Forge";function Gr(){let{env:e,walletAddress:t}=re(),o=!!t,{pairMap:n,ordersByPair:r,isEmpty:a}=Fe(e,"forge",t,o),{getTokenImage:l}=nt(e,o);if(a)return null;let p=c=>{let d=n.get(c.toLowerCase());return`${ot[e]}/gametoken/forge/${d?.base_symbol??""}`},m=`${De[e]}/dex.png`;return(0,bn.jsx)(We,{title:mi,icon:m,isEmpty:a,children:(0,bn.jsx)(Mt,{market:"forge",pairMap:n,ordersByPair:r,getDexUrl:p,getTokenImage:l})})}var Io=G(require("bignumber.js"),1),Qr=require("react");var jr=require("@tanstack/react-query");var ui="wp:forge-pools";function qr(e,t,o=!0){let n=Lo[e],r=o&&!!t,{data:a,...l}=(0,jr.useQuery)({queryKey:[ui,e,t],queryFn:async()=>{let m=await fetch(`${n}/v1/users/${t}/pools`,{cache:"no-store"});if(!m.ok)throw new Error(`forge pools fetch failed: ${m.status}`);return(await m.json()).data?.items??[]},enabled:r,staleTime:0}),p=a??[];return{pools:p,isEmpty:p.length===0,...l}}var Zr=require("@tanstack/react-query"),Kr=require("react");var fi="wp:forge-token-detail";async function gi(e,t){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return o.ok?(await o.json())?.data?.token??null:null}function Yr(e,t,o=!0){let n=Lo[e],r=(0,Zr.useQueries)({queries:t.map(p=>({queryKey:[fi,e,p],queryFn:()=>gi(n,p),enabled:o&&!!p,staleTime:3e4}))}),a=(0,Kr.useMemo)(()=>{let p=new Map;for(let m=0;m<r.length;m++){let c=r[m]?.data,d=t[m];c&&d&&p.set(d.toLowerCase(),c)}return p},[r,t]),l=r.some(p=>p.isLoading);return{detailMap:a,isLoading:l}}var Y=require("react/jsx-runtime"),wi="Forge",hi=18,xi="https://contents.crosstoken.io/wallet/token/images/FT.png";function bi(e){if(!e||e==="0")return"0";let t=new Io.default(e).shiftedBy(-hi);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Io.default.ROUND_DOWN):t.toFormat(4,Io.default.ROUND_DOWN)}function vi(e){let t=Number(e);return!Number.isFinite(t)||t<=0?"0%":t>=1?`${(Math.floor(t*100)/100).toFixed(2)}%`:`${(Math.floor(t*1e4)/1e4).toFixed(4)}%`}function Xr(){let{env:e,walletAddress:t,onOutlink:o}=re(),n=!!t,{pools:r,isEmpty:a}=qr(e,t,n),l=(0,Qr.useMemo)(()=>r.map(d=>d.token.address),[r]),{detailMap:p}=Yr(e,l,n&&l.length>0),m=d=>`${ot[e]}/forge/token/${d.token.address}`,c=`${De[e]}/forge.png`;return(0,Y.jsx)(We,{title:wi,icon:c,iconFit:"contain",isEmpty:a,children:r.map(d=>{let u=p.get(d.token.address.toLowerCase()),v=u?.image_url||u?.image||d.token.image||xi,x=u?.symbol||d.token.symbol,g=m(d);return(0,Y.jsxs)("a",{className:"wp-item","data-side":"lp",href:g,target:"_blank",rel:"noopener noreferrer",onClick:w=>Oe(w,g,{category:"portfolio",origin:"portfolio-forge",payload:{pool:d,tokenDetail:u}},o),children:[(0,Y.jsxs)("div",{className:"wp-item-body",children:[(0,Y.jsxs)("div",{className:"wp-item-field",children:[(0,Y.jsxs)("span",{className:"wp-item-label",children:["Pair (",x,")"]}),(0,Y.jsx)("div",{className:"wp-svc-token",children:(0,Y.jsx)("img",{className:"wp-svc-token-icon",src:v,alt:""})})]}),(0,Y.jsxs)("div",{className:"wp-item-field",children:[(0,Y.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,Y.jsx)("div",{className:"wp-svc-token",children:(0,Y.jsx)("span",{children:bi(d.lp_balance)})})]}),(0,Y.jsxs)("div",{className:"wp-item-field",children:[(0,Y.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,Y.jsx)("div",{className:"wp-svc-token",children:(0,Y.jsx)("span",{children:vi(d.pool_ownership)})})]})]}),(0,Y.jsx)("div",{className:"wp-item-badges",children:(0,Y.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},d.pair_address)})})}D(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--cck-surface-bg, #202530);--wp-card: var(--cck-surface-default, #292f40);--wp-border: var(--cck-border-default, #313b51);--wp-text: var(--cck-texticon-primary, #ffffff);--wp-text-60: var(--cck-texticon-secondary, #d3d7df);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #717d97);--wp-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--cck-surface-bg, #f5f6f8);--wp-card: var(--cck-surface-default, #ffffff);--wp-border: var(--cck-border-default, #e2e5ea);--wp-text: var(--cck-texticon-primary, #202530);--wp-text-60: var(--cck-texticon-secondary, #49556e);--wp-text-40: #8c97ad;--wp-text-30: var(--cck-texticon-tertiary, #a0a9b8);--wp-mint: #00d4aa;--wp-green: var(--cck-primary, #019d92);--wp-red: var(--cck-error, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;gap:20px;height:60px;padding:0 20px;flex-shrink:0}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text);flex-shrink:0}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: rgba(255, 255, 255, .1)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.15px;text-align:center;color:var(--wp-text);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-wallet-name{flex:1;min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:160%;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-top{flex-shrink:0;padding:0 16px 16px;display:flex;flex-direction:column;gap:16px}.wp-identity{display:flex;flex-direction:column;gap:8px}.wp-address{display:inline-flex;align-items:center;gap:8px}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40)}.wp-total{font-size:28px;font-weight:600;line-height:1.3;color:var(--wp-text);margin:0}.wp-asset{display:flex;flex-direction:column;gap:8px}.wp-asset-head{display:flex;align-items:center;gap:4px}.wp-asset-head-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-asset-head-icon{display:inline-flex;color:var(--wp-text-40)}.wp-bar{display:flex;height:20px;border-radius:4px;overflow:hidden}.wp-bar-seg{display:flex;align-items:center;justify-content:center;min-width:8px}.wp-bar-seg-pct{font-size:10px;font-weight:400;line-height:1.3;color:#fff;white-space:nowrap}.wp-legend{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap}.wp-legend-item{display:flex;align-items:center;gap:4px}.wp-legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.wp-legend-label{font-size:12px;font-weight:400;line-height:1.4;color:var(--wp-text-40)}.wp-tabs{flex-shrink:0;padding:8px 16px}.wp-tabs-inner{display:flex;align-items:center;padding:0 2px}.wp-tabs-list{display:flex;gap:20px;flex:1}.wp-tab{display:flex;flex-direction:column;align-items:center;justify-content:space-between;height:44px;padding-top:12px;background:transparent;border:none;cursor:pointer}.wp-tab-text{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text-30);white-space:nowrap}.wp-tab[data-active=true] .wp-tab-text{color:var(--wp-mint)}.wp-tab-bar{width:20px;height:4px;border-radius:2px;background:var(--wp-mint);opacity:0}.wp-tab[data-active=true] .wp-tab-bar{opacity:1}.wp-tabs-filter-wrap{position:relative;display:flex;align-items:center;width:44px;height:44px;flex-shrink:0}.wp-tabs-filter-grad{position:absolute;inset:0;background:linear-gradient(to left,var(--wp-bg) 74%,transparent);pointer-events:none}.wp-tabs-filter{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wp-text-40)}.wp-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.08) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:#ffffff14;border-radius:4px}.wp-body-inner{padding:16px 16px 128px;display:flex;flex-direction:column;gap:20px}.wp-svc-card{display:flex;flex-direction:column;gap:8px}.wp-svc-card-head{display:flex;align-items:center;gap:8px}.wp-svc-card-icon{width:20px;height:20px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:14px;font-weight:600;line-height:1.3;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:10px}.wp-item{position:relative;background:var(--wp-card);border-radius:12px;padding:14px 40px 14px 16px;display:flex;flex-direction:column;gap:6px;box-shadow:0 1px 3px #00000014,0 2px 8px #0000000a;overflow:hidden;text-decoration:none;cursor:pointer;transition:box-shadow .2s ease,transform .15s ease}.wp-item:hover{box-shadow:0 2px 6px #0000001f,0 4px 14px #0000000f;transform:translateY(-1px)}.wp-item:active{transform:translateY(0);box-shadow:0 1px 3px #00000014}.wp-item:before{content:"";position:absolute;top:0;left:0;width:3px;height:100%;border-radius:3px 0 0 3px;background:var(--wp-border)}.wp-item:after{content:"";position:absolute;right:14px;top:50%;transform:translateY(-50%);width:12px;height:12px;background:currentColor;opacity:.25;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 1.5h7v7M10.5 1.5L1.5 10.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 1.5h7v7M10.5 1.5L1.5 10.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;transition:opacity .15s}.wp-item:hover:after{opacity:.5}.wp-item[data-side=buy]:before{background:var(--wp-green)}.wp-item[data-side=sell]:before{background:var(--wp-red)}.wp-item[data-side=reward]:before{background:var(--wp-mint)}.wp-item[data-side=lp]:before{background:var(--wp-purple)}.wp-item-body{display:flex;gap:12px}.wp-item-field{flex:1;display:flex;flex-direction:column;gap:4px;min-width:0}.wp-item-label{font-size:11px;font-weight:500;line-height:1.3;color:var(--wp-text-40);letter-spacing:.03em;text-transform:uppercase}.wp-item-label--buy{color:var(--wp-green)}.wp-item-label--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-svc-token>span{font-size:14px;font-weight:600;line-height:1.4;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:22px;height:22px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-svc-buy{color:var(--wp-green)}.wp-svc-sell{color:var(--wp-red)}.wp-badge{display:inline-flex;align-items:center;font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:2px 7px;border-radius:4px;border:1px solid transparent;pointer-events:none}.wp-badge--mint{color:var(--wp-mint);background:#00d4aa1a;border-color:#00d4aa40}.wp-badge--muted{color:var(--wp-text-40);background:#8c97ad14;border-color:#8c97ad2e}.wp-badge--red{color:var(--wp-red);background:#e7007714;border-color:#e7007733}.wp-item-badges{display:flex;align-items:center;gap:6px}.wp-svc-empty{display:flex;align-items:center;justify-content:center;height:56px;background:var(--wp-card);border-radius:12px;font-size:13px;font-weight:400;color:var(--wp-text-30);box-shadow:0 1px 3px #00000014}@media(max-width:375px){.wp-header{gap:12px;padding:0 12px}.wp-top{padding:0 12px 12px;gap:12px}.wp-total{font-size:22px}.wp-legend{gap:10px}.wp-legend-label{font-size:11px}.wp-body-inner{padding:12px 12px 128px;gap:14px}.wp-svc-items{gap:8px}.wp-item{padding:12px 36px 12px 14px;gap:6px;border-radius:10px}.wp-item:after{right:10px;width:11px;height:11px}.wp-item-body{gap:10px}.wp-svc-token{gap:6px}.wp-svc-token>span{font-size:13px}.wp-svc-token-icon{width:20px;height:20px}}.wp-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
7
+ `);var I=require("react/jsx-runtime"),vn=5,yi="wp:";function yt({env:e,theme:t="dark",walletAddress:o,walletName:n,onBack:r,showHeader:a=!0,variant:l="embed",className:p,sendTransaction:m,getTransactionReceipt:c,onOutlink:d}){let u=ce(e),v=!!o,x=(0,Jr.useQueryClient)(),{segments:g}=Ar(u,o,v),[w,h]=Te.useState(vn),[P,O]=Te.useState(!1),M=Te.useCallback(()=>{x.invalidateQueries({predicate:_=>typeof _.queryKey[0]=="string"&&_.queryKey[0].startsWith(yi)})},[x]),C=Te.useCallback(()=>{M(),O(!0),setTimeout(()=>O(!1),600),h(vn)},[M]);Te.useEffect(()=>{if(!v)return;let _=setInterval(()=>{h(j=>j<=1?(C(),vn):j-1)},1e3);return()=>clearInterval(_)},[v,C]);let U=Te.useCallback(()=>{r?.()},[r]),R=v?wt(u,o,{size:64,bg:t==="dark"?"121212":"FFFFFF"}):void 0,z=Te.useMemo(()=>({env:u,theme:t,open:!0,walletAddress:o,close:U,sendTransaction:m,getTransactionReceipt:c,onOutlink:d}),[u,t,o,U,m,c,d]),E=(0,I.jsxs)(I.Fragment,{children:[a&&(0,I.jsxs)("div",{className:"wp-header",children:[(0,I.jsxs)("div",{className:"wp-header-account",children:[r?(0,I.jsx)("button",{type:"button",className:"wp-header-btn",onClick:r,children:(0,I.jsx)(Or,{})}):(0,I.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:R&&(0,I.jsx)("img",{src:R,alt:"",className:"wp-header-avatar-img",draggable:!1})}),n&&(0,I.jsx)("span",{className:"wp-header-wallet-name",title:n,children:n})]}),(0,I.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:C,children:[(0,I.jsx)(Dr,{className:P?"wp-spin-once":void 0}),v&&(0,I.jsx)("span",{className:"wp-refresh-badge",children:w})]})]}),(0,I.jsx)("div",{className:"wp-top",children:g.length>0&&(0,I.jsxs)("div",{className:"wp-asset",children:[(0,I.jsxs)("div",{className:"wp-asset-head",children:[(0,I.jsx)("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),(0,I.jsx)("span",{className:"wp-asset-head-icon",children:(0,I.jsx)(Fr,{})})]}),(0,I.jsx)("div",{className:"wp-bar",children:g.map(_=>(0,I.jsx)("div",{className:"wp-bar-seg",style:{flex:`${_.percentage} 0 0`,background:_.color},children:_.percentage>=5&&(0,I.jsxs)("span",{className:"wp-bar-seg-pct",children:[_.percentage,"%"]})},_.symbol))}),(0,I.jsx)("div",{className:"wp-legend",children:g.map(_=>(0,I.jsxs)("div",{className:"wp-legend-item",children:[(0,I.jsx)("span",{className:"wp-legend-dot",style:{background:_.color}}),(0,I.jsx)("span",{className:"wp-legend-label",children:_.symbol})]},_.symbol))})]})}),(0,I.jsx)("div",{className:"wp-body",children:(0,I.jsxs)("div",{className:"wp-body-inner",children:[(0,I.jsx)($r,{}),(0,I.jsx)(Ur,{}),(0,I.jsx)(zr,{}),(0,I.jsx)(Gr,{}),(0,I.jsx)(Xr,{})]})})]});return(0,I.jsx)(jt.Provider,{value:z,children:l==="none"?E:(0,I.jsx)("div",{className:K(l==="fullscreen"?"wp-fullscreen":"wp-embed",p),"data-theme":t,children:E})})}var kt=require("react/jsx-runtime");function ea({className:e}){let{env:t,theme:o,walletAddress:n,close:r,sendTransaction:a}=re();return(0,kt.jsxs)(qt.Drawer.Portal,{children:[(0,kt.jsx)(qt.Drawer.Overlay,{className:"wp-overlay"}),(0,kt.jsxs)(qt.Drawer.Content,{className:K("wp-fullscreen",e),"data-theme":o,children:[(0,kt.jsx)(qt.Drawer.Title,{className:"wp-sr-only",children:"My Portfolio"}),(0,kt.jsx)(yt,{env:t,theme:o,walletAddress:n,onBack:r,variant:"none",sendTransaction:a})]})]})}var yn=require("react/jsx-runtime");function ki({env:e,theme:t="dark",walletAddress:o,open:n,onOpenChange:r,sendTransaction:a,onOutlink:l,children:p}){let m=ce(e),c=n!==void 0,[d,u]=Ct.useState(!1),v=c?n:d,x=Ct.useCallback(h=>{c||u(h),r?.(h)},[c,r]),g=Ct.useCallback(()=>x(!1),[x]),w=Ct.useMemo(()=>({env:m,theme:t,open:v,walletAddress:o,close:g,sendTransaction:a,onOutlink:l}),[m,t,v,o,g,a,l]);return(0,yn.jsx)(jt.Provider,{value:w,children:(0,yn.jsx)(ta.Drawer.Root,{direction:"bottom",open:v,onOpenChange:x,noBodyStyles:!0,children:p})})}var kn=Object.assign(ki,{Trigger:Lr,Content:ea});var s=require("react/jsx-runtime");function Cn(e,t,o){let n=de[e],r=o.toUpperCase();if(t===n.cross&&r.includes("CROSSD"))return 0;if(t===n.cross&&r==="CROSS")return 1;if(t===n.bsc&&r==="CROSS")return 2}function Ci(e){return parseInt(e.split(":")[1],10)}function Ni(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Li(e){let t=e.toLowerCase().replace(/^0x/,""),o=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),n=parseInt(o.slice(0,4),16)%360,r=(n+60+parseInt(o.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${n} 85% 65%), hsl(${r} 80% 55%))`}function na({align:e="end",sideOffset:t=12,className:o,children:n}){let{env:r,theme:a,isMobile:l,open:p,drawerDirection:m,modal:c,showBalance:d,showForgeToken:u,showGameToken:v,showQR:x,qrLogoSrc:g,walletAddress:w,accountName:h,sendAccounts:P,profileImageUrl:O,preferredTokens:M,close:C,onSelectWallet:U,onCopyAddress:y,onDisconnect:R,disconnectLabel:z,termsUrl:E,termsLabel:_,privacyUrl:j,privacyLabel:Ie,portalStyle:st,navContent:ae,navPosition:Be,footerContent:ke,view:Q,setView:qe,selectedSendToken:Ze,setSelectedSendToken:pe,showPortfolio:Ke,portfolioTitle:me,showTotalAssets:te,totalAssetsLabel:X,sendTransaction:Pe,getTransactionReceipt:ue,estimateGas:Se,onOutlink:Me}=et(),{tokens:se,isLoading:he}=xt(r,w,p&&d),{statsMap:le}=vt(r,d),{categoryMap:Ce}=yr(r,d),fe=d&&te,{displayValue:lt,isLowerBound:xe,isLoading:Ye}=Cr(r,w,p&&fe),[Ve,$e]=H.useState(!1),ct=H.useRef(null),[Ne,He]=H.useState(0),{holdings:Le,isLoading:Qe}=gr(r,w,p&&d&&u),Ue=H.useMemo(()=>Le.map(b=>b.token),[Le]),{imageMap:Rt}=wr(r,Ue,u&&Le.length>0),ge=H.useMemo(()=>{let b=[],B=[],$=[],oe=new Map((M??[]).map((V,J)=>[`${Ci(V.chainId)}:${V.address.toLowerCase()}`,J]));for(let V of se){let J=Cn(r,V.chainId,V.symbol)!==void 0,pt=`${V.chainId}:${V.address.toLowerCase()}`,mt=oe.get(pt),Vo=new _t.default(V.quantity.numeric).shiftedBy(-V.quantity.decimals);if(J)b.push(V);else if(mt!==void 0)B.push(V);else if(Vo.isGreaterThan(0)){if(!v&&Ce.get(dn(V.chainId,V.address))==="game")continue;$.push(V)}}return b.sort((V,J)=>{let pt=Cn(r,V.chainId,V.symbol)??99,mt=Cn(r,J.chainId,J.symbol)??99;return pt-mt}),B.sort((V,J)=>{let pt=oe.get(`${V.chainId}:${V.address.toLowerCase()}`)??99,mt=oe.get(`${J.chainId}:${J.address.toLowerCase()}`)??99;return pt-mt}),$.sort((V,J)=>{let pt=le.get(bt(V.chainId,V.address)),mt=le.get(bt(J.chainId,J.address)),Vo=new _t.default(V.quantity.numeric).shiftedBy(-V.quantity.decimals).multipliedBy(pt?.price??0);return new _t.default(J.quantity.numeric).shiftedBy(-J.quantity.decimals).multipliedBy(mt?.price??0).minus(Vo).toNumber()}),[...b,...B,...$]},[se,r,le,v,Ce,M]),ze=H.useMemo(()=>{if(!u)return[];let b=new Set(se.map(B=>B.address.toLowerCase()));return[...Le].filter(B=>!b.has(B.token.toLowerCase())).sort((B,$)=>{let oe=new _t.default(B.value);return new _t.default($.value).minus(oe).toNumber()})},[Le,u,se]),Xe=H.useRef(!1),_e=H.useCallback(b=>{Xe.current=!0,qe(b)},[qe]),Do=H.useCallback(()=>{pe(null),_e("wallet")},[pe,_e]),Fo=H.useCallback(b=>{pe(b),_e("send")},[pe,_e]),ro=H.useCallback(()=>{pe(null),_e("wallet")},[pe,_e]);H.useEffect(()=>{p||(Xe.current=!1)},[p]);let Dt=H.useRef(null);H.useEffect(()=>{let b=Dt.current;if(!b||!l)return;let B=$=>{$.pointerType==="touch"&&$.stopPropagation()};return b.addEventListener("pointerdown",B),()=>b.removeEventListener("pointerdown",B)},[l]);let[dt,ao]=H.useState(!1),Je=H.useRef(void 0);H.useEffect(()=>()=>clearTimeout(Je.current),[]),H.useEffect(()=>{let b=ct.current;if(!b||ke===null){He(0);return}let B=()=>{He(b.offsetHeight)};if(B(),typeof ResizeObserver>"u")return;let $=new ResizeObserver(B);return $.observe(b),()=>$.disconnect()},[ke]);let Ft=H.useCallback(async()=>{if(!dt)try{await navigator.clipboard.writeText(w),ao(!0),clearTimeout(Je.current),Je.current=setTimeout(()=>ao(!1),2e3),y?.(w,!0)}catch{y?.(w,!1)}},[w,y,dt]),Wt=H.useCallback(b=>{b.currentTarget.setAttribute("data-loaded","true")},[]),Wo=H.useMemo(()=>({background:Li(w)}),[w]),io=H.useMemo(()=>O||wt(r,w,{size:120,bg:a==="dark"?"1A1A2E":"F3F6F8"}),[O,r,w,a]),Et=H.useMemo(()=>Ni(lt),[lt]),f=E||j?(0,s.jsxs)("div",{className:"wi-legal-links",children:[E&&(0,s.jsx)("a",{className:"wi-legal-link",href:E,target:"_blank",rel:"noopener noreferrer",onClick:b=>Oe(b,E,{category:"terms",origin:"terms"},Me),children:_}),E&&j&&(0,s.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),j&&(0,s.jsx)("a",{className:"wi-legal-link",href:j,target:"_blank",rel:"noopener noreferrer",onClick:b=>Oe(b,j,{category:"privacy",origin:"privacy"},Me),children:Ie})]}):null,N=R?(0,s.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{R(),C()},children:[(0,s.jsx)(qn,{size:12}),(0,s.jsx)("span",{className:"wi-disconnect-label",children:z})]}):null,S=(0,s.jsxs)("div",{className:K("wi-view-inner",Xe.current&&"wi-view-wallet"),children:[fe&&(()=>{let b=Ke;return(0,s.jsxs)(b?"button":"div",{...b?{type:"button",onClick:()=>_e("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":b||void 0,children:[(0,s.jsxs)("div",{className:"wi-total-head",children:[(0,s.jsx)("span",{className:"wi-total-label",children:X}),(0,s.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:$=>{$.stopPropagation(),$e(oe=>!oe)},onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),$.stopPropagation(),$e(oe=>!oe))},"aria-label":Ve?"Show balance":"Hide balance",children:Ve?(0,s.jsx)(Jn,{}):(0,s.jsx)(Xn,{})})]}),(0,s.jsxs)("div",{className:"wi-total-body",children:[Ye?(0,s.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):(0,s.jsx)("div",{className:"wi-total-value","data-hidden":Ve||void 0,children:Ve?(0,s.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,s.jsxs)(s.Fragment,{children:[xe&&(0,s.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,s.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,s.jsx)("span",{className:"wi-total-amount",children:Et.main}),Et.decimal&&(0,s.jsx)("span",{className:"wi-total-decimal",children:Et.decimal})]})}),b&&(0,s.jsx)("span",{className:"wi-total-chevron","aria-hidden":!0,children:(0,s.jsx)(Yn,{size:18})})]})]})})(),Be==="top"&&ae&&(0,s.jsx)("div",{className:"wi-nav-fixed",children:ae}),d&&(0,s.jsx)("div",{ref:Dt,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,s.jsxs)("div",{className:"wi-token-list",children:[he&&Array.from({length:5},(b,B)=>(0,s.jsxs)("div",{className:"wi-skeleton-item",children:[(0,s.jsxs)("div",{className:"wi-skeleton-left",children:[(0,s.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,s.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,s.jsxs)("div",{className:"wi-skeleton-right",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},B)),!he&&ge.length===0&&!u&&(0,s.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),ge.map(b=>{let B=le.get(bt(b.chainId,b.address)),$=B?parseFloat(B.percent_change_24h):null,oe=$!==null&&$>=0,V=Zo(r,b.chainId);return(0,s.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Fo(b),"aria-label":`Send ${b.symbol}`,children:[(0,s.jsxs)("div",{className:"wi-token-left",children:[(0,s.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,s.jsx)("img",{src:b.icon_url,alt:b.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Wt,onError:J=>{J.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),V&&(0,s.jsx)("img",{src:V,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:J=>{J.currentTarget.style.display="none"}})]}),(0,s.jsxs)("div",{className:"wi-token-info",children:[(0,s.jsx)("span",{className:"wi-token-name",children:b.symbol}),B&&(0,s.jsxs)("div",{className:"wi-token-price-row",children:[(0,s.jsx)("span",{className:"wi-token-price",children:jo(B.price)}),(0,s.jsx)("span",{className:"wi-token-change","data-positive":oe,"data-zero":$===0||void 0,children:$!==null&&($===0?"0%":`${oe?"+":"-"}${(oe?Math.floor:Math.ceil)(Math.abs($)*100)/100}%`)})]})]})]}),(0,s.jsxs)("div",{className:"wi-token-right",children:[(0,s.jsx)("span",{className:"wi-token-balance",children:gt(b.quantity.numeric,b.quantity.decimals)}),B&&(0,s.jsx)("span",{className:"wi-token-value",children:Un(b.quantity.numeric,b.quantity.decimals,B.price)})]})]},`${b.address}-${b.chainId}`)}),u&&Qe&&Array.from({length:3},(b,B)=>(0,s.jsxs)("div",{className:"wi-skeleton-item",children:[(0,s.jsxs)("div",{className:"wi-skeleton-left",children:[(0,s.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,s.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,s.jsxs)("div",{className:"wi-skeleton-right",children:[(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,s.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${B}`)),u&&!Qe&&!he&&ge.length===0&&ze.length===0&&(0,s.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),u&&ze.map(b=>{let B=Rt.get(b.token)||"",$=Zo(r,de[r].cross);return(0,s.jsxs)("div",{className:"wi-token-item",children:[(0,s.jsxs)("div",{className:"wi-token-left",children:[(0,s.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,s.jsx)("img",{src:B||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:b.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Wt,onError:oe=>{oe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),$&&(0,s.jsx)("img",{src:$,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:oe=>{oe.currentTarget.style.display="none"}})]}),(0,s.jsxs)("div",{className:"wi-token-info",children:[(0,s.jsx)("span",{className:"wi-token-name",children:b.token_name}),(0,s.jsx)("div",{className:"wi-token-price-row",children:(0,s.jsxs)("span",{className:"wi-token-price",children:[gt(b.current_price,18)," CROSS"]})})]})]}),(0,s.jsxs)("div",{className:"wi-token-right",children:[(0,s.jsx)("span",{className:"wi-token-balance",children:gt(b.balance,18)}),(0,s.jsx)("span",{className:"wi-token-value",children:jo(b.current_value_usd)})]})]},`forge-${b.token}`)})]})}),Be==="bottom"&&ae&&(0,s.jsx)("div",{className:"wi-nav-fixed",children:ae}),N&&(0,s.jsx)("div",{className:"wi-wallet-disconnect-row",children:N})]},"wallet"),T=Ke?(0,s.jsx)("div",{className:K("wi-view-inner wi-portfolio-body",Xe.current&&"wi-view-portfolio"),children:(0,s.jsx)(yt,{env:r,theme:a,walletAddress:w,showHeader:!1,sendTransaction:Pe,getTransactionReceipt:ue,onOutlink:Me})},"portfolio"):null,Z=Ze?(0,s.jsx)("div",{className:K("wi-view-inner wi-send-body",Xe.current&&"wi-view-send"),children:(0,s.jsx)(Gt,{env:r,theme:a,walletAddress:w,accountName:h,accounts:P,token:Ze,tokens:ge,onTokenChange:pe,sendTransaction:Pe,getTransactionReceipt:ue,estimateGas:Se,onConfirmSuccess:ro,onOutlink:Me})},"send"):null,be=(0,s.jsx)("div",{className:K("wi-view-inner wi-qr-body",Xe.current&&"wi-view-qr"),children:(0,s.jsxs)("div",{className:"wi-qr-section",children:[(0,s.jsxs)("div",{className:"wi-qr-card",children:[(0,s.jsxs)("div",{className:"wi-qr-code",children:[(0,s.jsx)(oa.QRCodeSVG,{value:w,size:180,level:"H",marginSize:2,...g&&{imageSettings:{src:g,height:33,width:33,excavate:!0}}}),!g&&(0,s.jsx)("div",{className:"wi-qr-logo",children:(0,s.jsx)(er,{size:33})})]}),(0,s.jsx)("p",{className:"wi-qr-address",children:w}),(0,s.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:Ft,children:[(0,s.jsx)("span",{className:"wi-qr-copy-icon",children:dt?(0,s.jsx)(Ht,{size:16}):(0,s.jsx)(Ko,{size:16})}),(0,s.jsx)("span",{className:"wi-qr-copy-text",children:dt?"Copied!":"Copy address"})]})]}),f]})},"qr"),Re=Q==="qr"||Q==="portfolio"||Q==="send",Ee=ke!==null?(0,s.jsx)("div",{className:"wi-builtin-footer",children:ke}):null,Bo=!!U&&h?.trim().toLowerCase()!=="my wallet",so=(0,s.jsxs)("div",{className:"wi-account-text",children:[Bo?(0,s.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:U,"aria-label":"Switch account",children:[(0,s.jsx)("span",{className:"wi-account-name",children:h??"Account 1"}),(0,s.jsx)("span",{className:"wi-account-switch","aria-hidden":"true",children:(0,s.jsx)(Qn,{size:12})})]}):(0,s.jsx)("div",{className:"wi-account-row",children:(0,s.jsx)("span",{className:"wi-account-name",children:h??"Account 1"})}),(0,s.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:Ft,"aria-label":"Copy address",children:[(0,s.jsx)("span",{className:"wi-account-address",children:ve(w)}),(0,s.jsx)("span",{className:"wi-account-copy",children:dt?(0,s.jsx)(Ht,{size:14}):(0,s.jsx)(Ko,{size:14})})]})]}),lo=(0,s.jsxs)(s.Fragment,{children:[n,Re?(0,s.jsxs)("div",{className:"wi-sticky-header",children:[(0,s.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,s.jsx)("button",{type:"button",className:"wi-header-back",onClick:Do,"aria-label":"Back",children:(0,s.jsx)(Kn,{})}),(0,s.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:so}),(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:C,"aria-label":"Close",children:(0,s.jsx)(Yo,{size:24})})]}),(0,s.jsx)("hr",{className:"wi-divider"})]}):(0,s.jsxs)("div",{className:"wi-sticky-header",children:[(0,s.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,s.jsxs)("div",{className:"wi-account-block",children:[(0,s.jsxs)("div",{className:"wi-avatar",children:[(0,s.jsx)("div",{className:"wi-avatar-fallback",style:Wo}),io&&(0,s.jsx)("img",{src:io,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:Wt,onError:b=>{b.currentTarget.style.display="none"}})]}),so]}),(0,s.jsxs)("div",{className:"wi-header-actions",children:[x&&(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:()=>_e("qr"),"aria-label":"Show QR code",children:(0,s.jsx)(Zn,{size:20})}),(0,s.jsx)("button",{type:"button",className:"wi-header-action",onClick:C,"aria-label":"Close",children:(0,s.jsx)(Yo,{size:24})})]})]}),(0,s.jsx)("hr",{className:"wi-divider"})]}),(0,s.jsxs)("div",{className:"wi-view-container",children:[Q==="wallet"&&S,Q==="qr"&&be,Q==="portfolio"&&T,Q==="send"&&Z]}),Ee&&Q!=="portfolio"&&Q!=="send"&&(0,s.jsx)("div",{className:"wi-sticky-footer",children:(0,s.jsx)("div",{className:"wi-footer",ref:ct,children:Ee})})]}),co={...st,...Ne>0?{"--wi-footer-height":`${Ne}px`}:null};return l?(0,s.jsxs)(Zt.Drawer.Portal,{children:[c&&(0,s.jsx)(Zt.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,s.jsxs)(Zt.Drawer.Content,{className:K("wi-drawer-content",o),"data-theme":a,style:co,"data-direction":m,"data-no-balance":!d||void 0,"data-has-footer":Ne>0||void 0,"data-view":Q,children:[(0,s.jsx)(Zt.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),lo]})]}):(0,s.jsxs)(s.Fragment,{children:[c&&p&&(0,s.jsx)("div",{className:"wi-drawer-overlay",onClick:C}),(0,s.jsx)(Po.Portal,{children:(0,s.jsx)(Po.Content,{align:e,sideOffset:t,className:K("wi-popover-content",o),"data-theme":a,style:co,"data-no-balance":!d||void 0,"data-has-footer":Ne>0||void 0,"data-view":Q,children:lo})})]})}var ra=G(require("react"),1);function aa({position:e="top",children:t}){let{setNavContent:o,setNavPosition:n}=et();return ra.useEffect(()=>(o(t),n(e),()=>o(null)),[t,e,o,n]),null}var ia=G(require("react"),1);function sa({children:e}){let{setFooterContent:t}=et();return ia.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}D(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--cck-primary, #019d92);--wi-secondary: var(--cck-secondary, #e70077);--wi-surface-bg: var(--cck-surface-bg, #121212);--wi-surface-default: var(--cck-surface-default, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--cck-surface-subtle, rgba(255, 255, 255, .1));--wi-border-default: var(--cck-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--cck-border-subtle, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--cck-texticon-primary, #ffffff);--wi-texticon-secondary: var(--cck-texticon-secondary, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--cck-texticon-tertiary, rgba(255, 255, 255, .5));--wi-on-primary: var(--cck-on-primary, #ffffff);--wi-error: var(--cck-error, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--cck-primary, #019d92);--wi-secondary: var(--cck-secondary, #e70077);--wi-surface-bg: var(--cck-surface-bg, #ffffff);--wi-surface-default: var(--cck-surface-default, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--cck-surface-subtle, rgba(18, 18, 18, .1));--wi-border-default: var(--cck-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--cck-border-subtle, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--cck-texticon-primary, #121212);--wi-texticon-secondary: var(--cck-texticon-secondary, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--cck-texticon-tertiary, rgba(18, 18, 18, .5));--wi-on-primary: var(--cck-on-primary, #ffffff);--wi-error: var(--cck-error, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
8
+ `);D(`.wi-trigger-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid rgba(255,255,255,.2);background:#1a2332;border-radius:9999px;cursor:pointer;color:#fff;font-family:inherit;font-size:16px;font-weight:500;line-height:24px;letter-spacing:-.3125px;transition:opacity .15s ease}.wi-trigger-btn:hover{opacity:.85}.wi-trigger-btn[data-theme=light]{background:#f3f6f8;border-color:#1212121a;color:#121212}.wi-trigger-btn[data-mobile]{font-size:14px;padding:6px 12px;gap:6px;line-height:20px}.wi-trigger-address{white-space:nowrap}.wi-divider{height:1px;background:var(--wi-border-default);margin:0;border:none;flex-shrink:0}[data-theme=light] .wi-divider{background:#1212121a}[data-theme=dark] .wi-divider{background:#ffffff1a}
9
+ `);D(`@keyframes wi-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes wi-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes wi-slide-in-right{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes wi-slide-in-left{0%{transform:translate(-40px);opacity:0}to{transform:translate(0);opacity:1}}
10
+ `);D(`.wi-popover-content{z-index:100001;width:343px;border-radius:24px;border:1px solid var(--wi-border-default);background:var(--wi-surface-bg);box-shadow:var(--wi-shadow);animation:wi-fade-in .15s ease-out;height:552px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(552px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{height:auto;max-height:calc(100dvh - 32px);overflow-y:auto}.wi-drawer-content[data-view=qr]{overflow-y:auto}.wi-sticky-header{flex-shrink:0}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:20px 24px}.wi-header--wallet{align-items:flex-start}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;padding:4px;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:4px;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:30px;height:30px;border-radius:50%;object-fit:cover;background:transparent}.wi-account-text{display:flex;flex-direction:column;gap:2px;min-width:0}.wi-account-row{display:flex;align-items:center;gap:8px;min-width:0}.wi-account-row--btn{padding:2px 4px;margin:-2px -4px;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;border-radius:6px;transition:background-color .15s ease,opacity .15s ease}.wi-account-row--btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .06))}.wi-account-row--btn:focus-visible{outline:2px solid var(--wi-primary, #00d5aa);outline-offset:2px}.wi-account-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.4;color:var(--wi-texticon-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px;border:none;background:transparent;color:var(--wi-texticon-tertiary);border-radius:4px;flex-shrink:0}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;text-align:left;min-width:0;transition:opacity .15s ease}.wi-address-row-btn:hover{opacity:.7}.wi-account-address{font-family:inherit;font-size:12px;font-weight:400;line-height:1.4;color:var(--wi-texticon-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-copy{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:var(--wi-texticon-tertiary);flex-shrink:0}.wi-header-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--wi-texticon-primary);flex-shrink:0;transition:opacity .15s ease,background .15s ease}.wi-header-action:hover{opacity:.75}.wi-header-info{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}.wi-header-title{font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);margin:0}.wi-header-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--wi-texticon-primary);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:16px 24px 0;padding:0;flex-shrink:0;display:flex;flex-direction:column;gap:8px;border:none;background:transparent;border-radius:12px;color:inherit;font:inherit;text-align:left;width:auto}button.wi-total-section{cursor:pointer;transition:opacity .15s ease}button.wi-total-section:hover,button.wi-total-section:focus-visible{outline:none;opacity:.85}.wi-total-head{display:flex;align-items:center;gap:4px}.wi-total-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.wi-total-chevron{display:inline-flex;align-items:center;justify-content:center;color:var(--wi-texticon-tertiary);flex-shrink:0;transition:transform .15s ease,color .15s ease}button.wi-total-section:hover .wi-total-chevron,button.wi-total-section:focus-visible .wi-total-chevron{color:var(--wi-texticon-primary);transform:translate(2px)}.wi-total-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.4;color:var(--wi-texticon-tertiary)}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--wi-texticon-tertiary);cursor:pointer;transition:opacity .15s ease;border-radius:4px}.wi-total-eye:hover{opacity:.7}.wi-total-eye:focus-visible{outline:1px solid var(--wi-texticon-secondary);outline-offset:2px}.wi-total-value{display:flex;align-items:baseline;gap:0;font-family:inherit;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);font-variant-numeric:tabular-nums;min-height:36px;white-space:nowrap}.wi-total-currency,.wi-total-amount{font-size:28px}.wi-total-decimal{font-size:20px;color:var(--wi-texticon-primary)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:20px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:28px;color:var(--wi-texticon-secondary)}.wi-total-skeleton{border-radius:6px}.wi-scrollable-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:16px 24px 0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}.wi-drawer-content .wi-scrollable-body{touch-action:pan-y}[data-theme=light] .wi-scrollable-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-scrollable-body::-webkit-scrollbar{width:4px}.wi-scrollable-body::-webkit-scrollbar-track{background:transparent}.wi-scrollable-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#0003}.wi-nav-fixed{flex-shrink:0;padding:0 24px}.wi-token-list{display:flex;flex-direction:column;gap:12px}.wi-token-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-token-left{display:flex;align-items:center;gap:12px;min-width:0}.wi-token-icon-wrap{position:relative;width:32px;height:32px;flex-shrink:0}.wi-token-icon{width:28px;height:28px;border-radius:8px;object-fit:contain;opacity:0;transition:opacity .2s ease;background:var(--wi-surface-default)}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:4px}.wi-token-price{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}.wi-token-change{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--wi-primary)}.wi-token-change[data-positive=false]{color:var(--wi-secondary)}.wi-token-change[data-zero]{opacity:.8}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-token-balance{font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);white-space:nowrap}.wi-token-value{font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:8px 24px 16px}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:16px;padding:0;border:none;background:transparent;color:var(--wi-texticon-tertiary);font-family:inherit;font-size:12px;font-weight:400;line-height:1.3;cursor:pointer;transition:opacity .15s ease}.wi-disconnect-btn:hover{opacity:.75}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;margin-top:16px;font-family:inherit;font-size:10px;font-weight:400;line-height:1.3;color:var(--wi-texticon-tertiary)}.wi-legal-link{color:inherit;text-decoration:underline;text-underline-offset:2px;transition:opacity .15s ease}.wi-legal-link:hover{opacity:.75}.wi-legal-sep{color:inherit}.wi-empty{display:flex;align-items:center;justify-content:center;padding:32px 0;font-family:inherit;font-size:16px;color:var(--wi-texticon-secondary)}.wi-skeleton-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-skeleton-left{display:flex;align-items:center;gap:12px}.wi-skeleton-block{border-radius:6px;background:var(--wi-border-default);position:relative;overflow:hidden}.wi-skeleton-block:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:wi-shimmer 1.5s ease-in-out infinite}[data-theme=light] .wi-skeleton-block:after{background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 50%,transparent 100%)}.wi-skeleton-icon{width:32px;height:32px;border-radius:50%;flex-shrink:0}.wi-skeleton-lines{display:flex;flex-direction:column;gap:6px}.wi-skeleton-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.wi-header-back{display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;color:var(--wi-texticon-primary);flex-shrink:0;transition:opacity .15s ease}.wi-header-back:hover{opacity:.7}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:0 0 auto;min-height:424px;overflow:visible}.wi-view-inner{display:flex;flex-direction:column;flex:1;min-height:0}.wi-view-wallet{animation:wi-slide-in-left .25s ease-out}.wi-view-qr,.wi-view-portfolio{animation:wi-slide-in-right .25s ease-out}.wi-qr-body{flex:1;min-height:0;display:flex;flex-direction:column}.wi-portfolio-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-portfolio-body>.wp-embed{flex:1;min-height:0}.wi-portfolio-body .wp-top{padding:16px 20px;gap:14px}.wi-portfolio-body .wp-body-inner{padding:4px 20px 24px;gap:16px}.wi-qr-section{flex:0 0 auto;min-height:424px;display:flex;flex-direction:column;overflow:visible;padding:16px 24px}.wi-qr-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;flex:0 0 auto;min-height:356px;padding:32px 24px;background:var(--wi-border-default);border:1px solid var(--wi-border-default);border-radius:12px}.wi-qr-code{position:relative;display:flex;align-items:center;justify-content:center}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:inherit;font-size:14px;font-weight:400;line-height:1.3;color:var(--wi-texticon-primary);text-align:center;word-break:break-all;max-width:247px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px;border:1px solid var(--wi-border-subtle);background:var(--wi-surface-default);border-radius:8px;cursor:pointer;transition:opacity .15s ease}.wi-qr-copy-btn:hover{opacity:.7}.wi-qr-copy-icon{display:inline-flex;color:var(--wi-texticon-secondary)}.wi-qr-copy-text{font-family:inherit;font-size:12px;font-weight:600;line-height:1.3;color:var(--wi-texticon-secondary);white-space:nowrap}
11
+ `);D(`.wi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
12
+ `);var So=require("react/jsx-runtime"),Ri="https://terms.crosstoken.io/docs/cross-terms-of-use",Ei="https://terms.crosstoken.io/docs/nexus-privacy-policy";function Ti({env:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:n,modal:r,showBalance:a=!1,showForgeToken:l=!1,showGameToken:p=!0,showQR:m=!0,qrLogoSrc:c,walletAddress:d,accountName:u,sendAccounts:v,profileImageUrl:x,connectorId:g,connectorName:w,connectorIconUrl:h,preferredTokens:P=[],onSelectWallet:O,onCopyAddress:M,onDisconnect:C,disconnectLabel:U="Disconnect",termsUrl:y=Ri,termsLabel:R="Terms of Service",privacyUrl:z=Ei,privacyLabel:E="Privacy Policy",open:_,onOpenChange:j,showPortfolio:Ie=!1,portfolioTitle:st="My Portfolio",showTotalAssets:ae=!0,totalAssetsLabel:Be="Total Assets USD",sendTransaction:ke,getTransactionReceipt:Q,estimateGas:qe,onOutlink:Ze,style:pe,children:Ke}){let me=ce(e),te=g?$t[g]:void 0,X=w??te?.name,Pe=h??te?.iconUrl,ue=Tt(`(max-width: ${o}px)`),Se=n??(a?"right":"bottom"),Me=r??!1,se=_!==void 0,[he,le]=ie.useState(!1),Ce=se?_:he,fe=ie.useCallback(ze=>{se||le(ze),j?.(ze)},[se,j]),lt=ie.useCallback(()=>fe(!1),[fe]),[xe,Ye]=ie.useState(null),[Ve,$e]=ie.useState("top"),[ct,Ne]=ie.useState(null),[He,Le]=ie.useState("wallet"),[Qe,Ue]=ie.useState(null);ie.useEffect(()=>{Ce||(Le("wallet"),Ue(null))},[Ce]);let Rt=ie.useCallback(()=>{tn(d),C?.()},[C,d]),ge=ie.useMemo(()=>({env:me,theme:t,isMobile:ue,open:Ce,drawerDirection:Se,modal:Me,showBalance:a,showForgeToken:l,showGameToken:p,showQR:m,qrLogoSrc:c,walletAddress:d,accountName:u,sendAccounts:v,profileImageUrl:x,connectorName:X,connectorIconUrl:Pe,preferredTokens:P,close:lt,onSelectWallet:O,onCopyAddress:M,onDisconnect:C?Rt:void 0,disconnectLabel:U,termsUrl:y,termsLabel:R,privacyUrl:z,privacyLabel:E,portalStyle:pe,navContent:xe,navPosition:Ve,setNavContent:Ye,setNavPosition:$e,footerContent:ct,setFooterContent:Ne,view:He,setView:Le,selectedSendToken:Qe,setSelectedSendToken:Ue,showPortfolio:Ie,portfolioTitle:st,showTotalAssets:ae,totalAssetsLabel:Be,sendTransaction:ke,getTransactionReceipt:Q,estimateGas:qe,onOutlink:Ze}),[me,t,ue,Ce,Se,Me,a,l,p,m,c,d,u,v,x,X,Pe,P,lt,O,M,C,Rt,U,y,R,z,E,pe,xe,Ve,ct,He,Qe,Ie,st,ae,Be,ke,Q,qe,Ze]);return(0,So.jsx)(Go.Provider,{value:ge,children:ue?(0,So.jsx)(ca.Drawer.Root,{direction:Se,open:Ce,onOpenChange:fe,noBodyStyles:!0,repositionInputs:!1,children:Ke},"drawer"):(0,So.jsx)(la.Root,{open:Ce,onOpenChange:fe,children:Ke},"popover")})}var Nt=Object.assign(Ti,{Trigger:pr,Content:na,Nav:aa,Footer:sa});var je=G(require("react"),1),va=G(require("@radix-ui/react-dialog"),1),ya=require("vaul");var Mo=require("react"),_o=(0,Mo.createContext)(null);function Kt(){let e=(0,Mo.useContext)(_o);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var Lt=require("react");function Yt(){let[e,t]=(0,Lt.useState)([]),[o,n]=(0,Lt.useState)(!0);(0,Lt.useEffect)(()=>{if(typeof window>"u"){n(!1);return}let a=[],l=m=>{let{info:c}=m.detail;c?.rdns&&!a.some(d=>d.rdns===c.rdns)&&(a.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...a]))};window.addEventListener("eip6963:announceProvider",l),window.addEventListener("eip6963:crossAnnounceProvider",l),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let p=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",l),window.removeEventListener("eip6963:crossAnnounceProvider",l),clearTimeout(p)}},[]);let r=(0,Lt.useCallback)(a=>e.some(l=>l.rdns===a),[e]);return{wallets:e,isDetected:r,isLoading:o}}var da=G(require("@radix-ui/react-dialog"),1),pa=require("vaul");var Nn=require("react/jsx-runtime");function ma({asChild:e,children:t}){let{isMobile:o}=Kt(),n=o?pa.Drawer.Trigger:da.Trigger;return(0,Nn.jsx)(n,{asChild:e??t!=null,children:t??(0,Nn.jsx)("button",{type:"button",children:"Connect Wallet"})})}var at=G(require("@radix-ui/react-dialog"),1),Qt=require("vaul");var F=require("react/jsx-runtime");function Ao(){return(0,F.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,F.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function ua(){return(0,F.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,F.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,F.jsx)("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),(0,F.jsx)("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),(0,F.jsx)("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),(0,F.jsx)("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),(0,F.jsx)("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),(0,F.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,F.jsx)("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),(0,F.jsx)("defs",{children:(0,F.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,F.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function fa(){return(0,F.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,F.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,F.jsx)("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),(0,F.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,F.jsx)("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function ga(){return(0,F.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,F.jsx)("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),(0,F.jsx)("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),(0,F.jsx)("defs",{children:(0,F.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,F.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function wa(){return(0,F.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,F.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Oo={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:Ao,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:Ao},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:Ao,rdns:"nexus.to.crosswallet.desktop",installUrl:"https://chromewebstore.google.com/detail/crossx/nninbdadmocnokibpaaohnoepbnpdgcg",visibility:"desktop-only"},metamask:{id:"metamask",name:"MetaMask",description:"Browser extension approval is required",icon:ua,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:fa,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:ga,badge:"For SHOP"}};function At(e){return Oo[e]}var k=require("react/jsx-runtime");function ha({wallet:e,detected:t,onConnect:o}){let n=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}o()},r=e.icon;return(0,k.jsxs)("button",{type:"button",className:"wcm-wallet-item",onClick:n,children:[(0,k.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,k.jsx)("div",{className:"wcm-wallet-icon",children:(0,k.jsx)(r,{})}),(0,k.jsxs)("div",{className:"wcm-wallet-info",children:[(0,k.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,k.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,k.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]}),(0,k.jsx)("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?(0,k.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,k.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function xa(){let{wallets:e,activeWalletIds:t,isDetected:o,close:n,isMobile:r}=Kt(),a=t.filter(m=>{let c=At(m).visibility;return!c||c==="always"?!0:c==="desktop-only"?!r:c==="mobile-only"?r:!0}),l=a.filter(m=>At(m).featured),p=a.filter(m=>!At(m).featured);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{className:"wcm-header",children:[(0,k.jsxs)("div",{className:"wcm-header-text",children:[(0,k.jsx)("h2",{className:"wcm-title",children:"Connect Wallet"}),(0,k.jsx)("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),(0,k.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:n,children:(0,k.jsx)(wa,{})})]}),(0,k.jsx)("div",{className:"wcm-divider"}),(0,k.jsxs)("div",{className:"wcm-body",children:[l.map(m=>{let c=At(m),d=c.rdns?o(c.rdns):!1;return(0,k.jsx)(ha,{wallet:c,detected:d,onConnect:()=>{e[m]?.(),n()}},m)}),l.length>0&&p.length>0&&(0,k.jsxs)("div",{className:"wcm-separator",children:[(0,k.jsx)("div",{className:"wcm-separator-line"}),(0,k.jsx)("span",{className:"wcm-separator-text",children:"or"}),(0,k.jsx)("div",{className:"wcm-separator-line"})]}),(0,k.jsx)("div",{className:"wcm-wallet-list",children:p.map(m=>{let c=At(m),d=c.rdns?o(c.rdns):!1;return(0,k.jsx)(ha,{wallet:c,detected:d,onConnect:()=>{e[m]?.(),n()}},m)})}),(0,k.jsxs)("div",{className:"wcm-help",children:[(0,k.jsx)("p",{className:"wcm-help-title",children:"Wallet not detected?"}),(0,k.jsxs)("ul",{className:"wcm-help-list",children:[(0,k.jsx)("li",{children:"Ensure your wallet extension is installed and unlocked"}),(0,k.jsx)("li",{children:"Try refreshing the page"}),(0,k.jsx)("li",{children:"Some wallets may require you to first open the extension"}),(0,k.jsx)("li",{children:"You can try clicking the wallet anyway"})]})]}),(0,k.jsx)("div",{className:"wcm-divider"}),(0,k.jsx)("p",{className:"wcm-terms",children:"By connecting your wallet and accessing this service, you acknowledge and agree to be bound by the applicable terms and conditions."})]})]})}function ba({className:e}){let{isMobile:t,theme:o,portalStyle:n}=Kt();return t?(0,k.jsxs)(Qt.Drawer.Portal,{children:[(0,k.jsx)(Qt.Drawer.Overlay,{className:"wcm-overlay"}),(0,k.jsxs)(Qt.Drawer.Content,{className:K("wcm-drawer-content",e),"data-theme":o,style:n,children:[(0,k.jsx)(Qt.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,k.jsx)("div",{className:"wcm-drawer-handle"}),(0,k.jsx)("div",{className:"wcm-drawer-body",children:(0,k.jsx)(xa,{})})]})]}):(0,k.jsxs)(at.Portal,{children:[(0,k.jsx)(at.Overlay,{className:"wcm-overlay"}),(0,k.jsxs)(at.Content,{className:K("wcm-dialog-content",e),"data-theme":o,style:n,children:[(0,k.jsx)(at.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,k.jsx)("div",{className:"wcm-dialog-body",children:(0,k.jsx)(xa,{})})]})]})}D(`[data-theme=dark]{--wcm-primary: var(--cck-primary, #9b8cef);--wcm-secondary: var(--cck-secondary, #ff3aa3);--wcm-surface-bg: var(--cck-surface-bg, #202530);--wcm-surface-default: var(--cck-surface-default, #292f40);--wcm-surface-subtle: var(--cck-surface-subtle, #313b51);--wcm-border-default: var(--cck-border-default, #313b51);--wcm-border-subtle: var(--cck-border-subtle, #49556e);--wcm-texticon-primary: var(--cck-texticon-primary, #ffffff);--wcm-texticon-secondary: var(--cck-texticon-secondary, #eff0f4);--wcm-texticon-tertiary: var(--cck-texticon-tertiary, #717d97)}[data-theme=light]{--wcm-primary: var(--cck-primary, #019d92);--wcm-secondary: var(--cck-secondary, #e70077);--wcm-surface-bg: var(--cck-surface-bg, #ffffff);--wcm-surface-default: var(--cck-surface-default, rgba(18, 18, 18, .05));--wcm-surface-subtle: var(--cck-surface-subtle, rgba(18, 18, 18, .1));--wcm-border-default: var(--cck-border-default, rgba(18, 18, 18, .05));--wcm-border-subtle: var(--cck-border-subtle, rgba(18, 18, 18, .1));--wcm-texticon-primary: var(--cck-texticon-primary, #121212);--wcm-texticon-secondary: var(--cck-texticon-secondary, rgba(18, 18, 18, .7));--wcm-texticon-tertiary: var(--cck-texticon-tertiary, rgba(18, 18, 18, .5))}
13
+ `);D(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wcm-dialog-content{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--wcm-surface-bg);border:4px solid var(--wcm-border-default);border-radius:24px;outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wcm-dialog-body,[data-theme=light] .wcm-drawer-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wcm-dialog-body::-webkit-scrollbar-thumb:hover,.wcm-drawer-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wcm-dialog-body::-webkit-scrollbar-thumb,[data-theme=light] .wcm-drawer-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wcm-dialog-body::-webkit-scrollbar-thumb:hover,[data-theme=light] .wcm-drawer-body::-webkit-scrollbar-thumb:hover{background:#0003}.wcm-drawer-content{position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--wcm-surface-bg);border-top-left-radius:24px;border-top-right-radius:24px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:24px 0 0 24px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 24px 24px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 24px 24px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--wcm-border-subtle);margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{position:relative;display:flex;flex-direction:column;align-items:center;padding:24px 24px 20px}.wcm-header-text{display:flex;flex-direction:column;gap:4px;width:100%;padding-right:48px}.wcm-title{font-family:inherit;font-weight:600;font-size:22px;line-height:1.3;color:var(--wcm-texticon-primary);margin:0}.wcm-subtitle{font-family:inherit;font-weight:400;font-size:14px;line-height:1.3;color:var(--wcm-texticon-secondary);margin:0}.wcm-close-btn{position:absolute;top:12px;right:12px;display:flex;align-items:center;justify-content:center;width:48px;height:48px;border:none;border-radius:999px;background:transparent;color:var(--wcm-texticon-primary);cursor:pointer;padding:0}.wcm-close-btn:hover{color:var(--wcm-texticon-secondary)}.wcm-divider{width:100%;height:1px;background:var(--wcm-border-default);border:none;margin:0}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:20px 24px 24px}.wcm-wallet-item{display:flex;align-items:center;gap:8px;width:100%;padding:16px;background:var(--wcm-surface-default);border:1px solid transparent;border-radius:20px;cursor:pointer;text-align:left;transition:border-color .15s;font-family:inherit}.wcm-wallet-item:hover{border-color:var(--wcm-primary)}.wcm-wallet-item-left{display:flex;align-items:center;gap:16px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg{width:40px;height:40px}.wcm-wallet-info{display:flex;flex-direction:column;justify-content:center;min-width:0}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px}.wcm-wallet-name{font-family:inherit;font-weight:700;font-size:18px;line-height:1.3;color:var(--wcm-texticon-primary);white-space:nowrap}.wcm-wallet-desc{font-family:inherit;font-weight:400;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary)}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;height:20px;padding:0 8px;border:1px solid var(--wcm-secondary);border-radius:999px;font-family:inherit;font-weight:700;font-size:12px;line-height:1.3;color:var(--wcm-secondary);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;background:var(--wcm-primary);border-radius:12px;font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-surface-bg);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;background:var(--wcm-surface-subtle);border-radius:12px;font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary);white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:16px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--wcm-border-default)}.wcm-separator-text{font-family:inherit;font-weight:400;font-size:16px;line-height:1.3;color:var(--wcm-texticon-tertiary);white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-help{display:flex;flex-direction:column;gap:4px}.wcm-help-title{font-family:inherit;font-weight:600;font-size:14px;line-height:1.4;color:var(--wcm-texticon-primary);margin:0}.wcm-help-list{list-style:none;padding:0;margin:0}.wcm-help-list li{display:flex;align-items:center;gap:8px;font-family:inherit;font-weight:400;font-size:14px;line-height:1.4;color:var(--wcm-texticon-secondary)}.wcm-help-list li:before{content:"";display:block;flex-shrink:0;width:4px;height:4px;min-width:4px;min-height:4px;background:var(--wcm-texticon-secondary)}.wcm-terms{font-family:inherit;font-weight:400;font-size:12px;line-height:1.3;color:var(--wcm-texticon-secondary);text-align:center;margin:0}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
14
+ `);D(`@keyframes wcm-overlay-show{0%{opacity:0}to{opacity:1}}@keyframes wcm-overlay-hide{0%{opacity:1}to{opacity:0}}@keyframes wcm-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes wcm-dialog-hide{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
15
+ `);var Ot=require("react/jsx-runtime");function Ii({wallets:e,theme:t="dark",mobileBreakpoint:o=768,drawerDirection:n="bottom",dialogWidth:r,drawerMaxWidth:a,drawerMinWidth:l,style:p,open:m,onOpenChange:c,children:d}){let u=Tt(`(max-width: ${o}px)`),[v,x]=je.useState(!1),g=m!==void 0,w=g?m:v,h=je.useCallback(R=>{g||x(R),c?.(R)},[g,c]),P=je.useCallback(()=>h(!1),[h]),{isDetected:O}=Yt(),M=je.useMemo(()=>Object.keys(e),[e]),C=je.useMemo(()=>{let R={};return r&&(R["--wcm-dialog-width"]=r),a&&(R["--wcm-drawer-max-width"]=a),l&&(R["--wcm-drawer-min-width"]=l),{...R,...p}},[r,a,l,p]),U=je.useMemo(()=>({theme:t,isMobile:u,open:w,setOpen:h,close:P,wallets:e,activeWalletIds:M,isDetected:O,portalStyle:C}),[t,u,w,h,P,e,M,O,C]),y=(0,Ot.jsx)("div",{"data-theme":t,style:C,children:d});return u?(0,Ot.jsx)(_o.Provider,{value:U,children:(0,Ot.jsx)(ya.Drawer.Root,{direction:n,open:w,onOpenChange:h,noBodyStyles:!0,children:y},"drawer")}):(0,Ot.jsx)(_o.Provider,{value:U,children:(0,Ot.jsx)(va.Root,{open:w,onOpenChange:h,children:y})})}var Ln=Object.assign(Ii,{Trigger:ma,Content:ba});var Pi='<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#c0)"><path d="M18 36C27.9411 36 36 27.9411 36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36Z" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.2903 2.57169L21.3525 5.63385V10.6471L25.3058 6.69381L29.6364 11.0244L25.7226 14.9381H18.2903C16.5992 14.9381 15.2283 16.309 15.2283 18.0003C15.2283 19.6915 16.5992 21.0624 18.2903 21.0624H25.6836L29.6365 25.0154L25.3059 29.3459L21.3525 25.3925V30.3666L18.2903 33.4288L15.2283 30.3666V25.4326L11.3148 29.3459L6.98426 25.0154L10.9372 21.0624H5.92394L2.86178 18.0003L5.92394 14.9381H10.8981L6.98437 11.0244L11.3149 6.69383L15.2283 10.6071V5.63385L18.2903 2.57169Z" fill="#000"/></g><defs><clipPath id="c0"><rect width="36" height="36" fill="#fff"/></clipPath></defs></svg>',Si='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 28 28" fill="none"><g clip-path="url(#m0)"><path d="M26.07 26.93L20.06 25.07L15.53 27.88L12.37 27.88L7.83 25.07L1.83 26.93L0 20.53L1.83 13.44L0 7.44L1.83 0L11.21 5.81H16.69L26.07 0L27.9 7.44L26.07 13.44L27.9 20.53Z" fill="#FF5C16"/><path d="M7.83 20.54L11.96 23.8L7.83 25.07V20.54Z" fill="#FF5C16"/><path d="M20.06 20.54L15.93 23.8L20.06 25.07L20.06 20.54Z" fill="#FF5C16"/><path d="M11.63 15.14L12.78 22.85L11.19 18.56L5.77 17.17L7.83 15.14H11.63Z" fill="#E34807"/><path d="M16.27 15.14L15.12 22.85L16.71 18.56L22.13 17.17L20.07 15.14H16.27Z" fill="#E34807"/><path d="M0 20.53L1.83 13.44H5.76L5.77 17.17L11.19 18.56L12.78 22.85L11.96 23.79L7.83 20.53H0Z" fill="#FF8D5D"/><path d="M27.9 20.53L26.07 13.44H22.14L22.13 17.17L16.71 18.56L15.12 22.85L15.94 23.79L20.07 20.53H27.9Z" fill="#FF8D5D"/><path d="M16.69 5.81H11.21L10.84 9.81L12.78 22.85H15.12L17.06 9.81L16.69 5.81Z" fill="#FF8D5D"/><path d="M15.53 25.34V27.88H12.37V25.34H15.53Z" fill="#C0C4CD"/><path d="M7.83 25.07L12.37 27.88V25.34L11.96 23.79L7.83 25.07Z" fill="#E7EBF6"/><path d="M20.07 25.07L15.53 27.88V25.34L15.94 23.79L20.07 25.07Z" fill="#E7EBF6"/></g><defs><clipPath id="m0"><rect width="28" height="28" fill="#fff"/></clipPath></defs></svg>',Mi='<svg width="100%" height="100%" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z" fill="#F3BA2F"/><path d="M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z" fill="#F3BA2F"/><path d="M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z" fill="#F3BA2F"/><path d="M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z" fill="#F3BA2F"/><path d="M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z" fill="#F3BA2F"/></svg>',_i='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"/><path fill="#FF3D00" d="M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"/><path fill="#4CAF50" d="M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"/><path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"/></svg>',Ai='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>';function Xt(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Jt=Xt(Pi),eo=Xt(Si),to=Xt(Mi),oo=Xt(_i),no=Xt(Ai);var we=require("react/jsx-runtime");function Rn({isConnecting:e,address:t,provider:o,providerName:n,accountName:r,sendAccounts:a,onConnect:l,onDisconnect:p,onCopy:m,onSelectWallet:c,label:d="Connect Wallet",connectingLabel:u="Connecting...",disconnectLabel:v,className:x,theme:g="dark",env:w,showBalance:h=!0,showPortfolio:P,drawerDirection:O,modal:M,connectorId:C,style:U,sendTransaction:y,getTransactionReceipt:R}){if(e)return(0,we.jsxs)("button",{type:"button",disabled:!0,className:x,style:x?void 0:{...it.button,...it.buttonLoading},"aria-busy":"true",children:[(0,we.jsx)("style",{children:Wi}),(0,we.jsx)("span",{style:it.spinner,"aria-hidden":"true"}),u]});if(t){let z=n??Fi(o),E=o?Oi[o]:void 0;return(0,we.jsxs)(Nt,{env:w,theme:g,drawerDirection:O,modal:M,showBalance:h,showPortfolio:P,walletAddress:t,accountName:r,sendAccounts:a,connectorId:C,onSelectWallet:c,onCopyAddress:m?(_,j)=>{j&&m()}:void 0,onDisconnect:p,disconnectLabel:v,style:U,sendTransaction:y,getTransactionReceipt:R,children:[(0,we.jsx)(Nt.Trigger,{asChild:!0,children:(0,we.jsxs)("button",{type:"button",className:x,style:x?void 0:it.connectedBtn,"aria-label":`Connected with ${z}: ${ka(t)}`,children:[E?(0,we.jsx)("img",{src:E,alt:"",width:20,height:20,style:it.connectedIcon}):(0,we.jsx)("span",{style:it.connectedIconPlaceholder,"aria-hidden":"true"}),(0,we.jsx)("span",{style:it.connectedAddress,children:ka(t)})]})}),(0,we.jsx)(Nt.Content,{align:"end",sideOffset:8})]})}return(0,we.jsx)("button",{type:"button",onClick:l,className:x,style:x?void 0:it.button,children:d})}var Oi={google:oo,apple:no,cross:Jt,metamask:eo,binance:to},Di={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Fi(e){return e?Di[e]:"Wallet"}function ka(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Wi="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",it={button:{padding:"10px 24px",borderRadius:"12px",border:"none",background:"#00D5AA",color:"#000",fontWeight:700,fontSize:"14px",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.15s",fontFamily:"inherit"},buttonLoading:{opacity:.7,cursor:"default"},spinner:{display:"inline-block",width:"14px",height:"14px",border:"2px solid #00000030",borderTopColor:"#000",borderRadius:"50%",animation:"cross-cb-spin 0.6s linear infinite"},connectedBtn:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"8px 14px",borderRadius:"999px",border:"1px solid var(--wi-border-default, #2a2d3a)",background:"var(--wi-surface-default, #1e232e)",color:"var(--wi-texticon-primary, #ffffff)",fontWeight:600,fontSize:"14px",cursor:"pointer",fontFamily:"inherit"},connectedIcon:{width:"20px",height:"20px",borderRadius:"50%",objectFit:"contain",flexShrink:0,background:"transparent"},connectedIconPlaceholder:{display:"inline-block",width:"20px",height:"20px",borderRadius:"50%",background:"var(--wi-surface-subtle, #2a2d3a)",flexShrink:0},connectedAddress:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"13px",letterSpacing:"0.02em"}};0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,GOOGLE_ICON,METAMASK_ICON,SendPage,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});