@nexus-cross/dapp-ui 1.0.1-beta.6 → 1.0.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.js CHANGED
@@ -1,14 +1,14 @@
1
- function Q(e){if(e)return No(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return No(t)}function No(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as We from"react";import*as Io from"@radix-ui/react-popover";import{Drawer as mn}from"vaul";import{createContext as ln,useContext as cn}from"react";var zt=ln(null);function gt(){let e=cn(zt);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import{useState as pn,useEffect as dn}from"react";function Oe(e){let[t,r]=pn(!1);return dn(()=>{let o=window.matchMedia(e);r(o.matches);let n=c=>r(c.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[e]),t}function P(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}P(`[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)}
1
+ function Q(e){if(e)return No(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return No(t)}function No(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as We from"react";import*as Io from"@radix-ui/react-popover";import{Drawer as dn}from"vaul";import{createContext as sn,useContext as ln}from"react";var jt=sn(null);function gt(){let e=ln(jt);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import{useState as cn,useEffect as pn}from"react";function Oe(e){let[t,r]=cn(!1);return pn(()=>{let o=window.matchMedia(e);r(o.matches);let n=l=>r(l.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[e]),t}function P(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}P(`[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
2
  `);P(`.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
3
  `);P(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
4
  `);P(`.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
- `);P("");import{jsx as jt}from"react/jsx-runtime";function Po({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:o,children:n}){let c=Oe(`(max-width: ${r}px)`),[a,l]=We.useState(!1),s=We.useCallback(()=>l(!1),[]),i=Q(e),p=We.useMemo(()=>({env:i,theme:t,isMobile:c,open:a,domain:o,close:s}),[i,t,c,a,o,s]);return jt(zt.Provider,{value:p,children:c?jt(mn.Root,{direction:"right",open:a,onOpenChange:l,noBodyStyles:!0,children:n},"drawer"):jt(Io.Root,{open:a,onOpenChange:l,children:n},"popover")})}import*as Mo from"@radix-ui/react-popover";import{Drawer as un}from"vaul";import{jsx as Z,jsxs as fn}from"react/jsx-runtime";function Ro({size:e=18}){return fn("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Z("rect",{width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),Z("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),Z("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function To(){return Z("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Z("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Eo(){return Z("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Z("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as wt}from"react/jsx-runtime";function _o({asChild:e,children:t}){let{isMobile:r,theme:o}=gt(),n=t!=null,c=e??!0,a=n?t:wt("button",{type:"button",className:"al-trigger-btn","data-theme":o,children:wt(Ro,{size:r?12:18})});return r?wt(un.Trigger,{asChild:c,children:a}):wt(Mo.Trigger,{asChild:c,children:a})}import*as Ne from"react";import*as xt from"@radix-ui/react-popover";import{Drawer as De}from"vaul";import{useQuery as gn}from"@tanstack/react-query";var So={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"};function ht(e){let t=Q(e);return gn({queryKey:["global-menu",t],queryFn:async({signal:r})=>{let o=await fetch(So[t],{cache:"no-store",signal:r});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()},staleTime:0,gcTime:0,refetchOnMount:!0})}function V(...e){return e.filter(Boolean).join(" ")}import{jsx as U,jsxs as Xe}from"react/jsx-runtime";function Wo({align:e="end",sideOffset:t=12,className:r}){let{env:o,theme:n,isMobile:c,domain:a,close:l}=gt(),{data:s}=ht(o),i=Ne.useMemo(()=>(s?.items??[]).sort((u,k)=>u.order-k.order),[s]),p=8,m=Ne.useRef(null),f=Ne.useCallback(u=>{m.current={x:u.clientX,y:u.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",v=Ne.useCallback((u,k)=>{if(m.current){let L=u.clientX-m.current.x,_=u.clientY-m.current.y;if(m.current=null,Math.abs(L)>p||Math.abs(_)>p)return}let R=k.url[o]??k.url.production,T=Oo(R,a);if(!T)try{let L=new URL(R).pathname;if(h===L||h.startsWith(L+"/")){l();return}}catch{}T?window.open(R,"_blank","noopener,noreferrer"):window.location.href=R,l()},[o,a,l,h]),g=U("div",{className:"al-grid","data-theme":n,children:i.map(u=>{let k=u.url[o]??u.url.production,R=Oo(k,a),T=!1;if(!R)try{let L=new URL(k).pathname;T=h===L||h.startsWith(L+"/")}catch{T=!1}return Xe("button",{type:"button",className:"al-grid-item","data-active":T||void 0,onPointerDown:f,onClick:L=>v(L,u),children:[Xe("div",{className:"al-grid-item-left",children:[U("div",{className:"al-grid-item-icon",children:U("img",{src:u.iconUrl,alt:u.label,width:24,height:24,loading:"lazy"})}),U("span",{className:"al-grid-item-label",children:u.label}),u.isNew&&U("span",{className:"al-badge-new",children:"N"})]}),U("div",{className:"al-grid-item-right",children:u.badge&&U("span",{className:"al-badge",children:u.badge})})]},u.id)})});return c?Xe(De.Portal,{children:[U(De.Overlay,{className:"al-drawer-overlay"}),Xe(De.Content,{className:V("al-drawer-content",r),"data-theme":n,children:[Xe("div",{className:"al-drawer-header",children:[U(De.Close,{className:"al-drawer-close",children:U(To,{})}),U(De.Title,{className:"al-drawer-title",children:"CROSS Services"}),U(De.Close,{className:"al-drawer-close",children:U(Eo,{})})]}),U("div",{className:"al-drawer-body",children:g})]})]}):U(xt.Portal,{children:U(xt.Content,{align:e,sideOffset:t,className:V("al-popover-content",r),"data-theme":n,children:g})})}function Oo(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}import*as Y from"react";import*as Ar from"@radix-ui/react-popover";import{Drawer as Ti}from"vaul";import{createContext as wn,useContext as hn}from"react";var Gt=wn(null);function me(){let e=hn(Gt);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Zt=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Zt||{}),bt={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"}};import*as Go from"@radix-ui/react-popover";import{Drawer as bn}from"vaul";import{jsx as O,jsxs as vt}from"react/jsx-runtime";function Do({size:e=16,className:t}){return vt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[O("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"}),O("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 Kt({size:e=16,className:t}){return O("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("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 Yt({size:e=16,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Qt({size:e=24,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ao({size:e=20,className:t}){return vt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[O("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"}),O("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 Fo({size:e=20,className:t}){return O("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:O("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 Bo({size:e=20,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vo({size:e=20,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ho({size:e=20,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Uo({size:e=16,className:t}){return vt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[O("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"}),O("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 $o({size:e=16,className:t}){return vt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[O("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"}),O("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function qo({size:e=42,className:t}){return O("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:O("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})})}import Ie from"bignumber.js";function xn(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 yt(e,t){if(!e||e==="0")return"0.00";let r=new Ie(e).shiftedBy(-t),o=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(o,Ie.ROUND_DOWN)}function Ae(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Xt(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,o=Math.pow(10,r);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function zo(e,t,r){let n=new Ie(e).shiftedBy(-t).multipliedBy(new Ie(r));return n.isZero()||n.isNaN()?"$0.00":`$${(n.integerValue(Ie.ROUND_DOWN).isGreaterThanOrEqualTo(1)?n.decimalPlaces(2,Ie.ROUND_DOWN):n.decimalPlaces(4,Ie.ROUND_DOWN)).toFormat()}`}function jo(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 r=t;if(r.includes("e")||r.includes("E")){let a=Number(r);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};r=xn(a.toFixed(18))}let[o="0",n=""]=r.split(".");if(Number(o)>=1){let a=n.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return n.length<4?{displayValue:`${o}.${n}`,isLowerBound:!1}:n.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${n.slice(0,4)}`,isLowerBound:!1}}import{jsx as kt,jsxs as vn}from"react/jsx-runtime";function Zo({asChild:e,className:t,children:r}){let{isMobile:o,theme:n,walletAddress:c}=me(),a=r!=null,l=e??!0,s=a?r:vn("button",{type:"button",className:V("wi-trigger-btn",t),"data-theme":n,"data-mobile":o||void 0,children:[kt(Do,{size:o?14:16}),kt("span",{className:"wi-trigger-address",children:Ae(c)})]});return o?kt(bn.Trigger,{asChild:l,children:s}):kt(Go.Trigger,{asChild:l,children:s})}import*as A from"react";import*as Et from"@radix-ui/react-popover";import{Drawer as Tt}from"vaul";import et from"bignumber.js";import{useQueries as kn}from"@tanstack/react-query";import{useMemo as Cn}from"react";var te={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},X={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var Jt={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"},Ko={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function eo(e,t){let r=X[e];if(t===r.cross)return Ko.cross;if(t===r.bsc)return Ko.bsc}var yn={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Yo(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:n,format:c="png"}=r,a=yn[e],l=n?`&bg=${n}`:"";return`${a}/portrait/evm/${t}.${c}?size=${o}${l}`}var to="user-balance";async function Ln(e,t,r,o){let n=new URLSearchParams({networkId:`eip155:${t}`,account:r}),c=await fetch(`${e}/v1/public/token/balance?${n}`,{cache:"no-store",signal:o});if(!c.ok)throw new Error(`Failed to fetch token balance: ${c.status}`);let a=await c.json();if(a.code!==200)throw new Error(`Token balance API error: ${a.code}`);return a.data}function Fe(e,t,r=!0){let o=te[e],n=X[e],c=[n.cross,n.bsc],a=kn({queries:c.map(p=>({queryKey:[to,e,t,p],queryFn:({signal:m})=>Ln(o,p,t,m),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1}))}),l=a.some(p=>p.isLoading),s=a.some(p=>p.isError);return{tokens:Cn(()=>{let p=[];for(let m of a)m.data&&p.push(...m.data);return p},[a]),isLoading:l,isError:s}}import{useQuery as Nn,useQueries as In}from"@tanstack/react-query";import{useMemo as Pn}from"react";var Rn="forge-holdings",Tn="forge-token-image";async function En(e,t,r){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:r});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let n=await o.json();if(!n.success)throw new Error("Forge holdings API error");return n.data.items}async function Mn(e,t,r){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:r});if(!o.ok)return{address:t,image_url:""};let n=await o.json();return n.success?{address:t,image_url:n.data.token.image_url}:{address:t,image_url:""}}function Qo(e,t,r=!0){let o=Jt[e],{data:n,...c}=Nn({queryKey:[Rn,e,t],queryFn:({signal:a})=>En(o,t,a),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1});return{holdings:n??[],...c}}function Xo(e,t,r=!0){let o=Jt[e],n=In({queries:t.map(a=>({queryKey:[Tn,e,a],queryFn:({signal:l})=>Mn(o,a,l),enabled:r,staleTime:1/0}))});return{imageMap:Pn(()=>{let a=new Map;for(let l of n)l.data&&a.set(l.data.address,l.data.image_url);return a},[n])}}import{useQuery as _n}from"@tanstack/react-query";import{useMemo as Sn}from"react";var oo="token-stats";function Pe(e,t){return`${e}:${t.toLowerCase()}`}function Be(e,t=!0){let r=te[e],{data:o,...n}=_n({queryKey:[oo,e],queryFn:async({signal:a})=>{let l=await fetch(`${r}/v1/public/token/stats`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let s=await l.json();if(s.code!==200)throw new Error(`Token stats API error: ${s.code}`);return s},enabled:t,staleTime:3e4});return{statsMap:Sn(()=>{let a=new Map;if(!o?.data)return a;for(let l of o.data){let s=Pe(l.chain_id,l.address);a.set(s,l)}return a},[o]),...n}}import{useQuery as On}from"@tanstack/react-query";import{useMemo as Wn}from"react";var Dn="token-info";function ro(e,t){return`${t.toLowerCase()}_${e}`}function Jo(e,t=!0){let r=te[e],{data:o,...n}=On({queryKey:[Dn,e],queryFn:async({signal:a})=>{let l=await fetch(`${r}/v1/public/token/info`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let s=await l.json();if(s.code!==200)throw new Error(`Token info API error: ${s.code}`);return s},enabled:t,staleTime:1/0});return{categoryMap:Wn(()=>{let a=new Map;if(!o?.data)return a;for(let l of o.data){let s=ro(l.chain_id,l.address);a.set(s,l.category)}return a},[o]),...n}}import{useMemo as An}from"react";import no from"bignumber.js";function er(e,t,r){let{tokens:o,isLoading:n}=Fe(e,t,r),{statsMap:c}=Be(e,r);return An(()=>{let a=new no(0);for(let p of o){let m=c.get(Pe(p.chainId,p.address));if(!m)continue;let h=new no(p.quantity.numeric).shiftedBy(-p.quantity.decimals).multipliedBy(new no(m.price));h.isNaN()||(a=a.plus(h))}let l=a.toFixed(),{displayValue:s,isLowerBound:i}=jo(l);return{totalUsd:l,displayValue:s,isLowerBound:i,isLoading:n}},[o,c,n])}import{QRCodeSVG as Ni}from"qrcode.react";function oe(e,t,r,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let n;try{n=o(t,r)}catch(i){console.error("[dapp-ui] onOutlink threw:",i);return}let c=i=>{typeof window>"u"||window.open(i,"_blank","noopener,noreferrer")};if((i=>!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function")(n)){let i=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,p=m=>{if(m===null){i?.close();return}let f=m??t;if(i)try{i.location.href=f}catch{i.close(),c(f)}else c(f)};n.then(p,m=>{console.error("[dapp-ui] onOutlink rejected:",m),i?.close()});return}let l=n;if(l===null)return;c(l??t)}import*as Te from"react";import{Drawer as Ci}from"vaul";import{createContext as Fn,useContext as Bn}from"react";var Je=Fn(null);function $(){let e=Bn(Je);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}import{Drawer as Vn}from"vaul";import{jsx as tr}from"react/jsx-runtime";function or({asChild:e,children:t}){let{walletAddress:r}=$(),o=t!=null,n=e??!0,c=o?t:tr("button",{type:"button",children:Ae(r)});return tr(Vn.Trigger,{asChild:n,children:c})}import{Drawer as Rt}from"vaul";import*as ee from"react";import{useQueryClient as vi}from"@tanstack/react-query";import{useMemo as jn}from"react";import io from"bignumber.js";import{useQuery as Hn}from"@tanstack/react-query";import{useMemo as ir}from"react";var Ct={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"},Lt={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"},fe={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},nr={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 Un="wp:reward-pools";function Nt(e,t=!0){let r=Ct[e],{data:o,...n}=Hn({queryKey:[Un,e],queryFn:async({signal:l})=>{let s=await fetch(`${r}/v1/pools`,{cache:"no-store",signal:l});if(!s.ok)throw new Error(`Failed to fetch pools: ${s.status}`);let i=await s.json();if(i.code!==200)throw new Error(`Pools API error: ${i.code}`);return i},enabled:t,staleTime:0}),c=ir(()=>o?.data.pools.filter(l=>l.pool_type==="CrossPool")??[],[o]),a=ir(()=>o?.data.pools.filter(l=>l.pool_type==="GamePool")??[],[o]);return{crossPools:c,gamePools:a,allPools:o?.data.pools??[],...n}}import{useQuery as $n}from"@tanstack/react-query";import{useMemo as qn}from"react";var zn="wp:user-deposits";function It(e,t,r=!0){let o=Ct[e],n=r&&!!t,{data:c,...a}=$n({queryKey:[zn,e,t],queryFn:async({signal:s})=>{let i=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!i.ok)throw new Error(`Deposits fetch failed: ${i.status}`);let p=await i.json();if(p.code!==200)throw new Error(`Deposits API error: ${p.code}`);return p},enabled:n,staleTime:0});return{depositMap:qn(()=>{let s=new Map;if(!c?.data.user_deposits)return s;for(let i of c.data.user_deposits)s.set(i.pool_address.toLowerCase(),i);return s},[c]),deposits:c?.data.user_deposits??[],...a}}import{useQuery as ar}from"@tanstack/react-query";import{useMemo as sr}from"react";function re(e,t,r,o=!0){let n=nr[e][t],c=o&&!!r,{data:a,...l}=ar({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:v})=>{let g=await fetch(`${n}/pair-info`,{cache:"no-store",signal:v});if(!g.ok)throw new Error(`pair-info fetch failed: ${g.status}`);let u=await g.json();if(u.code!==200)throw new Error(`pair-info API error: ${u.code}`);return u},enabled:o,staleTime:0}),s=a?.data??[],i=sr(()=>{let v=new Map;for(let g of s)v.set(g.pair_address.toLowerCase(),g);return v},[s]),{data:p,...m}=ar({queryKey:["wp:dex-orders",e,t,r],queryFn:async({signal:v})=>{let g=Math.floor(Date.now()/1e3),u=new URLSearchParams({owner:r,size:"200",start_date:"0",end_date:String(g)}),k=await fetch(`${n}/open-order?${u}`,{cache:"no-store",signal:v});if(!k.ok)throw new Error(`open-order fetch failed: ${k.status}`);let R=await k.json();if(R.code!==200)throw new Error(`open-order API error: ${R.code}`);return R.data?.data??[]},enabled:c,staleTime:0}),f=p??[],h=sr(()=>{let v=new Map;for(let g of f){let u=g.pair.toLowerCase();v.has(u)||v.set(u,{buys:[],sells:[]});let k=v.get(u);g.order_side===1?k.buys.push(g):k.sells.push(g)}return v},[f]);return{allPairs:s,pairMap:i,orders:f,ordersByPair:h,isEmpty:f.length===0,isLoading:l.isLoading||m.isLoading}}var Gn=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],lr="var(--wp-green)",cr=4;function pr(e,t,r=!0){let o=r&&!!t,{allPools:n}=Nt(e,o),{depositMap:c}=It(e,t,o),{allPairs:a,pairMap:l,ordersByPair:s}=re(e,"cross",t,o),{allPairs:i,pairMap:p,ordersByPair:m}=re(e,"crossd",t,o),{allPairs:f,pairMap:h,ordersByPair:v}=re(e,"forge",t,o);return jn(()=>{let g=new Map,u=new Map,k=(w,y)=>{!Number.isFinite(y)||y<=0||u.set(w,(u.get(w)??0)+y)};for(let w of n){let y=Number(w.deposit_token.price);y>0&&g.set(w.deposit_token.symbol,y);for(let S of w.reward_tokens){let N=Number(S.price);N>0&&g.set(S.symbol,N)}}for(let w of[...a,...i,...f]){let y=g.get(w.quote_symbol),S=Number(w.billboard?.price);y&&S>0&&!g.has(w.base_symbol)&&g.set(w.base_symbol,S*y)}for(let w of n){let y=c.get(w.pool_address.toLowerCase());if(!y)continue;let S=new io(y.deposited_amount).shiftedBy(-w.deposit_token.decimals).toNumber();if(k(w.deposit_token.symbol,S),w.reward_tokens.length>0){let N=w.reward_tokens[0],F=new io(y.claimable_reward).shiftedBy(-N.decimals).toNumber();k(N.symbol,F)}}let R=[{pairMap:l,ordersByPair:s},{pairMap:p,ordersByPair:m},{pairMap:h,ordersByPair:v}];for(let{pairMap:w,ordersByPair:y}of R)for(let[S,N]of y){let F=w.get(S);if(F){for(let j of N.buys){let ie=Number(j.amount)-Number(j.filled);k(F.quote_symbol,ie*Number(j.price))}for(let j of N.sells){let ie=Number(j.amount)-Number(j.filled);k(F.base_symbol,ie)}}}let T=[],L=0;for(let[w,y]of u){let S=g.get(w)??0,N=y*S;N>0&&(T.push({symbol:w,usdValue:N}),L+=N)}T.sort((w,y)=>y.usdValue-w.usdValue);let _=[];if(L>0){let w=T.slice(0,cr),y=T.slice(cr);for(let N=0;N<w.length;N++)_.push({symbol:w[N].symbol,usdValue:w[N].usdValue,percentage:Math.round(w[N].usdValue/L*100),color:Gn[N]??lr});if(y.length>0){let N=y.reduce((F,j)=>F+j.usdValue,0);_.push({symbol:"Others",usdValue:N,percentage:Math.round(N/L*100),color:lr})}let S=_.reduce((N,F)=>N+F.percentage,0);S!==100&&_.length>0&&(_[0].percentage+=100-S)}return{totalUsd:L,formattedTotal:L>0?`$${new io(L).toFormat(2)}`:"$0.00",segments:_}},[n,c,a,l,s,i,p,m,f,h,v])}import{jsx as Ve,jsxs as Zn}from"react/jsx-runtime";function dr({size:e=22,className:t}){return Ve("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ve("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function mr({size:e=22,className:t}){return Zn("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Ve("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),Ve("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 Ve("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ve("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}import{useQuery as Kn}from"@tanstack/react-query";import{useMemo as Yn}from"react";var Qn="wp:token-info";function ue(e,t=!0){let r=te[e],o=X[e].cross,{data:n,...c}=Kn({queryKey:[Qn,e],queryFn:async({signal:i})=>{let p=await fetch(`${r}/v1/public/token/info`,{cache:"no-store",signal:i});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:300*1e3}),{byChainAddr:a,byChainSym:l}=Yn(()=>{let i=new Map,p=new Map;if(!n?.data)return{byChainAddr:i,byChainSym:p};for(let m of n.data){let f=m.address.toLowerCase();i.set(`${m.chain_id}:${f}`,m),i.set(f,m);let h=m.symbol.replace(/^t/,"").toUpperCase(),v=`${m.chain_id}:${h}`;p.has(v)||p.set(v,m),p.has(h)||p.set(h,m)}return{byChainAddr:i,byChainSym:p}},[n]);return{getTokenImage:(i,p)=>{let m=i.toLowerCase(),f=a.get(`${o}:${m}`);if(f?.image)return f.image;let h=a.get(m);if(h?.image)return h.image;if(p){let v=p.replace(/^t/,"").toUpperCase(),g=l.get(`${o}:${v}`);if(g?.image)return g.image;let u=l.get(v);if(u?.image)return u.image}return""},...c}}import{jsx as Pt,jsxs as ur}from"react/jsx-runtime";function ne({title:e,icon:t,iconFit:r="cover",isEmpty:o,children:n}){return ur("div",{className:"wp-svc-card",children:[ur("div",{className:"wp-svc-card-head",children:[Pt("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:r}}),Pt("span",{className:"wp-svc-card-title",children:e})]}),o?Pt("div",{className:"wp-svc-empty",children:"No assets yet"}):Pt("div",{className:"wp-svc-items",children:n})]})}import ao from"bignumber.js";import{jsx as Re,jsxs as se}from"react/jsx-runtime";var Xn="CROSS Rewards",Jn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/award.svg";function gr(e,t){let r=new ao(e).shiftedBy(-t);return r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,ao.ROUND_DOWN):r.toFormat(4,ao.ROUND_DOWN)}function wr(){let{env:e,walletAddress:t,onOutlink:r}=$(),o=!!t,{allPools:n}=Nt(e,o),{depositMap:c}=It(e,t,o),{getTokenImage:a}=ue(e,o),l=s=>`${rr[e]}/rewards/${s.pool_address}?action=withdraw`;return Re(ne,{title:Xn,icon:Jn,isEmpty:n.length===0,children:n.map(s=>{let i=c.get(s.pool_address.toLowerCase()),p=i?.deposited_amount??"0",m=l(s);return se("a",{className:"wp-item","data-side":"reward",href:m,target:"_blank",rel:"noopener noreferrer",onClick:f=>oe(f,m,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:s,userDeposit:i}},r),children:[se("div",{className:"wp-item-body",children:[se("div",{className:"wp-item-field",children:[se("span",{className:"wp-item-label",children:["Deposited (",s.deposit_token.symbol,")"]}),se("div",{className:"wp-svc-token",children:[a(s.deposit_token.address,s.deposit_token.symbol)&&Re("img",{className:"wp-svc-token-icon",src:a(s.deposit_token.address,s.deposit_token.symbol),alt:""}),Re("span",{children:gr(p,s.deposit_token.decimals)})]})]}),se("div",{className:"wp-item-field",children:[se("span",{className:"wp-item-label",children:["Rewards (",s.reward_tokens.map(f=>f.symbol).join(", "),")"]}),s.reward_tokens.map(f=>{let h=a(f.address,f.symbol);return se("div",{className:"wp-svc-token",children:[h&&Re("img",{className:"wp-svc-token-icon",src:h,alt:""}),Re("span",{children:i?gr(i.claimable_reward,f.decimals):"0"})]},f.address)})]})]}),se("div",{className:"wp-item-badges",children:[Re("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),Re("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},s.pool_address)})})}import xr from"bignumber.js";import{Fragment as ei,jsx as K,jsxs as q}from"react/jsx-runtime";function so(e){let t=new xr(e);if(t.isNaN())return e;let r=t.decimalPlaces()??0;return t.toFormat(r)}function hr(e){let t=new xr(e.amount).minus(e.filled);return so(t.toString())}function He({market:e,pairMap:t,ordersByPair:r,getDexUrl:o,getTokenImage:n}){let{onOutlink:c}=$(),a=[];for(let[l,s]of r){let i=t.get(l),p=i?n(i.base_address,i.base_symbol):"",m=i?n(i.quote_address,i.quote_symbol):"",f=o(l);for(let h of s.buys)a.push(q("a",{className:"wp-item","data-side":"buy",href:f,target:"_blank",rel:"noopener noreferrer",onClick:v=>oe(v,f,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"buy",order:h,pair:i}},c),children:[q("div",{className:"wp-item-body",children:[q("div",{className:"wp-item-field",children:[q("span",{className:"wp-item-label wp-item-label--buy",children:["Buy",i?.base_symbol?` (${i.base_symbol})`:""]}),q("div",{className:"wp-svc-token",children:[p&&K("img",{className:"wp-svc-token-icon",src:p,alt:""}),K("span",{children:hr(h)})]})]}),q("div",{className:"wp-item-field",children:[q("span",{className:"wp-item-label",children:["Price",i?.quote_symbol?` (${i.quote_symbol})`:""]}),q("div",{className:"wp-svc-token",children:[m&&K("img",{className:"wp-svc-token-icon",src:m,alt:""}),K("span",{children:so(h.price)})]})]})]}),K("div",{className:"wp-item-badges",children:K("span",{className:"wp-badge wp-badge--mint",children:"Claim"})})]},`buy-${h.order_id}`));for(let h of s.sells)a.push(q("a",{className:"wp-item","data-side":"sell",href:f,target:"_blank",rel:"noopener noreferrer",onClick:v=>oe(v,f,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"sell",order:h,pair:i}},c),children:[q("div",{className:"wp-item-body",children:[q("div",{className:"wp-item-field",children:[q("span",{className:"wp-item-label wp-item-label--sell",children:["Sell",i?.base_symbol?` (${i.base_symbol})`:""]}),q("div",{className:"wp-svc-token",children:[p&&K("img",{className:"wp-svc-token-icon",src:p,alt:""}),K("span",{children:hr(h)})]})]}),q("div",{className:"wp-item-field",children:[q("span",{className:"wp-item-label",children:["Price",i?.quote_symbol?` (${i.quote_symbol})`:""]}),q("div",{className:"wp-svc-token",children:[m&&K("img",{className:"wp-svc-token-icon",src:m,alt:""}),K("span",{children:so(h.price)})]})]})]}),K("div",{className:"wp-item-badges",children:K("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${h.order_id}`))}return K(ei,{children:a})}import{jsx as br}from"react/jsx-runtime";var ti="Gametoken - CROSS",oi="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function vr(){let{env:e,walletAddress:t}=$(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:c}=re(e,"cross",t,r),{getTokenImage:a}=ue(e,r);return br(ne,{title:ti,icon:oi,isEmpty:c,children:br(He,{market:"cross",pairMap:o,ordersByPair:n,getDexUrl:s=>{let i=o.get(s.toLowerCase());return`${fe[e]}/gametoken/cross/${i?.base_symbol??""}`},getTokenImage:a})})}import{jsx as yr}from"react/jsx-runtime";var ri="Gametoken - CROSSD",ni="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function kr(){let{env:e,walletAddress:t}=$(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:c}=re(e,"crossd",t,r),{getTokenImage:a}=ue(e,r);return yr(ne,{title:ri,icon:ni,isEmpty:c,children:yr(He,{market:"crossd",pairMap:o,ordersByPair:n,getDexUrl:s=>{let i=o.get(s.toLowerCase());return`${fe[e]}/gametoken/crossd/${i?.base_symbol??""}`},getTokenImage:a})})}import{jsx as Cr}from"react/jsx-runtime";var ii="Gametoken - Forge",ai="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function Lr(){let{env:e,walletAddress:t}=$(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:c}=re(e,"forge",t,r),{getTokenImage:a}=ue(e,r);return Cr(ne,{title:ii,icon:ai,isEmpty:c,children:Cr(He,{market:"forge",pairMap:o,ordersByPair:n,getDexUrl:s=>{let i=o.get(s.toLowerCase());return`${fe[e]}/gametoken/forge/${i?.base_symbol??""}`},getTokenImage:a})})}import lo from"bignumber.js";import{useMemo as fi}from"react";import{useQuery as si}from"@tanstack/react-query";var li="wp:forge-pools";function Nr(e,t,r=!0){let o=Lt[e],n=r&&!!t,{data:c,...a}=si({queryKey:[li,e,t],queryFn:async()=>{let s=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!s.ok)throw new Error(`forge pools fetch failed: ${s.status}`);return(await s.json()).data?.items??[]},enabled:n,staleTime:0}),l=c??[];return{pools:l,isEmpty:l.length===0,...a}}import{useQueries as ci}from"@tanstack/react-query";import{useMemo as pi}from"react";var di="wp:forge-token-detail";async function mi(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function Ir(e,t,r=!0){let o=Lt[e],n=ci({queries:t.map(l=>({queryKey:[di,e,l],queryFn:()=>mi(o,l),enabled:r&&!!l,staleTime:3e4}))}),c=pi(()=>{let l=new Map;for(let s=0;s<n.length;s++){let i=n[s]?.data,p=t[s];i&&p&&l.set(p.toLowerCase(),i)}return l},[n,t]),a=n.some(l=>l.isLoading);return{detailMap:c,isLoading:a}}import{jsx as J,jsxs as Ue}from"react/jsx-runtime";var ui="Forge",gi="https://x.crosstoken.io/forge/favicon-96x96.png",wi=18,hi="https://contents.crosstoken.io/wallet/token/images/FT.png";function xi(e){if(!e||e==="0")return"0";let t=new lo(e).shiftedBy(-wi);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,lo.ROUND_DOWN):t.toFormat(4,lo.ROUND_DOWN)}function bi(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 Pr(){let{env:e,walletAddress:t,onOutlink:r}=$(),o=!!t,{pools:n,isEmpty:c}=Nr(e,t,o),a=fi(()=>n.map(i=>i.token.address),[n]),{detailMap:l}=Ir(e,a,o&&a.length>0),s=i=>`${fe[e]}/forge/token/${i.token.address}`;return J(ne,{title:ui,icon:gi,iconFit:"contain",isEmpty:c,children:n.map(i=>{let p=l.get(i.token.address.toLowerCase()),m=p?.image_url||p?.image||i.token.image||hi,f=p?.symbol||i.token.symbol,h=s(i);return Ue("a",{className:"wp-item","data-side":"lp",href:h,target:"_blank",rel:"noopener noreferrer",onClick:v=>oe(v,h,{category:"portfolio",origin:"portfolio-forge",payload:{pool:i,tokenDetail:p}},r),children:[Ue("div",{className:"wp-item-body",children:[Ue("div",{className:"wp-item-field",children:[Ue("span",{className:"wp-item-label",children:["Pair (",f,")"]}),J("div",{className:"wp-svc-token",children:J("img",{className:"wp-svc-token-icon",src:m,alt:""})})]}),Ue("div",{className:"wp-item-field",children:[J("span",{className:"wp-item-label",children:"LP Balance"}),J("div",{className:"wp-svc-token",children:J("span",{children:xi(i.lp_balance)})})]}),Ue("div",{className:"wp-item-field",children:[J("span",{className:"wp-item-label",children:"Ownership"}),J("div",{className:"wp-svc-token",children:J("span",{children:bi(i.pool_ownership)})})]})]}),J("div",{className:"wp-item-badges",children:J("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},i.pair_address)})})}P(`.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:Sora,sans-serif;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:Sora,sans-serif;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-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:Roboto,Sora,sans-serif;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.15px;text-align:center;color:var(--wp-text);margin:0}.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}
6
- `);import{Fragment as ki,jsx as W,jsxs as ge}from"react/jsx-runtime";var co=5,yi="wp:";function $e({env:e,theme:t="dark",walletAddress:r,onBack:o,showHeader:n=!0,variant:c="embed",className:a,sendTransaction:l,onOutlink:s}){let i=Q(e),p=!!r,m=vi(),{segments:f}=pr(i,r,p),[h,v]=ee.useState(co),[g,u]=ee.useState(!1),k=ee.useCallback(()=>{m.invalidateQueries({predicate:w=>typeof w.queryKey[0]=="string"&&w.queryKey[0].startsWith(yi)})},[m]),R=ee.useCallback(()=>{k(),u(!0),setTimeout(()=>u(!1),600),v(co)},[k]);ee.useEffect(()=>{if(!p)return;let w=setInterval(()=>{v(y=>y<=1?(R(),co):y-1)},1e3);return()=>clearInterval(w)},[p,R]);let T=ee.useCallback(()=>{o?.()},[o]),L=ee.useMemo(()=>({env:i,theme:t,open:!0,walletAddress:r,close:T,sendTransaction:l,onOutlink:s}),[i,t,r,T,l,s]),_=ge(ki,{children:[n&&ge("div",{className:"wp-header",children:[o?W("button",{type:"button",className:"wp-header-btn",onClick:o,children:W(dr,{})}):W("span",{className:"wp-header-btn","aria-hidden":!0}),W("h2",{className:"wp-header-title",children:"My Portfolio"}),ge("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:R,children:[W(mr,{className:g?"wp-spin-once":void 0}),p&&W("span",{className:"wp-refresh-badge",children:h})]})]}),W("div",{className:"wp-top",children:f.length>0&&ge("div",{className:"wp-asset",children:[ge("div",{className:"wp-asset-head",children:[W("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),W("span",{className:"wp-asset-head-icon",children:W(fr,{})})]}),W("div",{className:"wp-bar",children:f.map(w=>W("div",{className:"wp-bar-seg",style:{flex:`${w.percentage} 0 0`,background:w.color},children:w.percentage>=5&&ge("span",{className:"wp-bar-seg-pct",children:[w.percentage,"%"]})},w.symbol))}),W("div",{className:"wp-legend",children:f.map(w=>ge("div",{className:"wp-legend-item",children:[W("span",{className:"wp-legend-dot",style:{background:w.color}}),W("span",{className:"wp-legend-label",children:w.symbol})]},w.symbol))})]})}),W("div",{className:"wp-body",children:ge("div",{className:"wp-body-inner",children:[W(wr,{}),W(vr,{}),W(kr,{}),W(Lr,{}),W(Pr,{})]})})]});return W(Je.Provider,{value:L,children:c==="none"?_:W("div",{className:V(c==="fullscreen"?"wp-fullscreen":"wp-embed",a),"data-theme":t,children:_})})}import{jsx as po,jsxs as Rr}from"react/jsx-runtime";function Tr({className:e}){let{env:t,theme:r,walletAddress:o,close:n,sendTransaction:c}=$();return Rr(Rt.Portal,{children:[po(Rt.Overlay,{className:"wp-overlay"}),Rr(Rt.Content,{className:V("wp-fullscreen",e),"data-theme":r,children:[po(Rt.Title,{className:"wp-sr-only",children:"My Portfolio"}),po($e,{env:t,theme:r,walletAddress:o,onBack:n,variant:"none",sendTransaction:c})]})]})}import{jsx as Er}from"react/jsx-runtime";function Li({env:e,theme:t="dark",walletAddress:r,open:o,onOpenChange:n,sendTransaction:c,onOutlink:a,children:l}){let s=Q(e),i=o!==void 0,[p,m]=Te.useState(!1),f=i?o:p,h=Te.useCallback(u=>{i||m(u),n?.(u)},[i,n]),v=Te.useCallback(()=>h(!1),[h]),g=Te.useMemo(()=>({env:s,theme:t,open:f,walletAddress:r,close:v,sendTransaction:c,onOutlink:a}),[s,t,f,r,v,c,a]);return Er(Je.Provider,{value:g,children:Er(Ci.Root,{direction:"bottom",open:f,onOpenChange:h,noBodyStyles:!0,children:l})})}var Mr=Object.assign(Li,{Trigger:or,Content:Tr});import{Fragment as fo,jsx as d,jsxs as b}from"react/jsx-runtime";function mo(e,t,r){let o=X[e],n=r.toUpperCase();if(t===o.cross&&n.includes("CROSSD"))return 0;if(t===o.cross&&n==="CROSS")return 1;if(t===o.bsc&&n==="CROSS")return 2}function Ii(e){return parseInt(e.split(":")[1],10)}function Pi(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Ri(e){let t=e.toLowerCase().replace(/^0x/,""),r=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(r.slice(0,4),16)%360,n=(o+60+parseInt(r.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${n} 80% 55%))`}function _r({align:e="end",sideOffset:t=12,className:r,children:o}){let{env:n,theme:c,isMobile:a,open:l,drawerDirection:s,modal:i,showBalance:p,showForgeToken:m,showGameToken:f,showQR:h,qrLogoSrc:v,walletAddress:g,accountName:u,profileImageUrl:k,preferredTokens:R,close:T,onSelectWallet:L,onCopyAddress:_,onDisconnect:w,disconnectLabel:y,termsUrl:S,termsLabel:N,privacyUrl:F,privacyLabel:j,portalStyle:ie,navContent:be,navPosition:Ge,footerContent:nt,view:G,setView:Ze,showPortfolio:Ke,portfolioTitle:it,showTotalAssets:at,totalAssetsLabel:st,sendTransaction:lt,onOutlink:ve}=me(),{tokens:ce,isLoading:Ee}=Fe(n,g,l&&p),{statsMap:pe}=Be(n,p),{categoryMap:ct}=Jo(n,p),pt=p&&at,{displayValue:ae,isLowerBound:Me,isLoading:dt}=er(n,g,l&&pt),[ye,mt]=A.useState(!1),{holdings:de,isLoading:ft}=Qo(n,g,l&&p&&m),ut=A.useMemo(()=>de.map(x=>x.token),[de]),{imageMap:Vt}=Xo(n,ut,m&&de.length>0),_e=A.useMemo(()=>{let x=[],E=[],M=[],H=new Map((R??[]).map((I,B)=>[`${Ii(I.chainId)}:${I.address.toLowerCase()}`,B]));for(let I of ce){let B=mo(n,I.chainId,I.symbol)!==void 0,Ce=`${I.chainId}:${I.address.toLowerCase()}`,Le=H.get(Ce),qt=new et(I.quantity.numeric).shiftedBy(-I.quantity.decimals);if(B)x.push(I);else if(Le!==void 0)E.push(I);else if(qt.isGreaterThan(0)){if(!f&&ct.get(ro(I.chainId,I.address))==="game")continue;M.push(I)}}return x.sort((I,B)=>{let Ce=mo(n,I.chainId,I.symbol)??99,Le=mo(n,B.chainId,B.symbol)??99;return Ce-Le}),E.sort((I,B)=>{let Ce=H.get(`${I.chainId}:${I.address.toLowerCase()}`)??99,Le=H.get(`${B.chainId}:${B.address.toLowerCase()}`)??99;return Ce-Le}),M.sort((I,B)=>{let Ce=pe.get(Pe(I.chainId,I.address)),Le=pe.get(Pe(B.chainId,B.address)),qt=new et(I.quantity.numeric).shiftedBy(-I.quantity.decimals).multipliedBy(Ce?.price??0);return new et(B.quantity.numeric).shiftedBy(-B.quantity.decimals).multipliedBy(Le?.price??0).minus(qt).toNumber()}),[...x,...E,...M]},[ce,n,pe,f,ct,R]),Ye=A.useMemo(()=>{if(!m)return[];let x=new Set(ce.map(E=>E.address.toLowerCase()));return[...de].filter(E=>!x.has(E.token.toLowerCase())).sort((E,M)=>{let H=new et(E.value);return new et(M.value).minus(H).toNumber()})},[de,m,ce]),ke=A.useRef(!1),Se=A.useCallback(x=>{ke.current=!0,Ze(x)},[Ze]);A.useEffect(()=>{l||(ke.current=!1)},[l]);let ho=A.useRef(null);A.useEffect(()=>{let x=ho.current;if(!x||!a)return;let E=M=>{M.pointerType==="touch"&&M.stopPropagation()};return x.addEventListener("pointerdown",E),()=>x.removeEventListener("pointerdown",E)},[a]);let[Qe,xo]=A.useState(!1),Ht=A.useRef(void 0);A.useEffect(()=>()=>clearTimeout(Ht.current),[]);let bo=A.useCallback(async()=>{if(!Qe)try{await navigator.clipboard.writeText(g),xo(!0),clearTimeout(Ht.current),Ht.current=setTimeout(()=>xo(!1),2e3),_?.(g,!0)}catch{_?.(g,!1)}},[g,_,Qe]),Ut=A.useCallback(x=>{x.currentTarget.setAttribute("data-loaded","true")},[]),Jr=A.useMemo(()=>({background:Ri(g)}),[g]),vo=A.useMemo(()=>k||Yo(n,g,{size:120,bg:c==="dark"?"1A1A2E":"F3F6F8"}),[k,n,g,c]),$t=A.useMemo(()=>Pi(ae),[ae]),en=b("div",{className:V("wi-view-inner",ke.current&&"wi-view-wallet"),children:[pt&&(()=>{let x=Ke;return b(x?"button":"div",{...x?{type:"button",onClick:()=>Se("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":x||void 0,children:[b("div",{className:"wi-total-head",children:[d("span",{className:"wi-total-label",children:st}),d("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:M=>{M.stopPropagation(),mt(H=>!H)},onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),M.stopPropagation(),mt(H=>!H))},"aria-label":ye?"Show balance":"Hide balance",children:ye?d($o,{}):d(Uo,{})})]}),b("div",{className:"wi-total-body",children:[dt?d("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):d("div",{className:"wi-total-value","data-hidden":ye||void 0,children:ye?d("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):b(fo,{children:[Me&&d("span",{className:"wi-total-lte",children:"\u2264"}),d("span",{className:"wi-total-currency",children:"$"}),d("span",{className:"wi-total-amount",children:$t.main}),$t.decimal&&d("span",{className:"wi-total-decimal",children:$t.decimal})]})}),x&&d("span",{className:"wi-total-chevron","aria-hidden":!0,children:d(Vo,{size:18})})]})]})})(),Ge==="top"&&be&&d("div",{className:"wi-nav-fixed",children:be}),p&&d("div",{ref:ho,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:b("div",{className:"wi-token-list",children:[Ee&&Array.from({length:5},(x,E)=>b("div",{className:"wi-skeleton-item",children:[b("div",{className:"wi-skeleton-left",children:[d("div",{className:"wi-skeleton-block wi-skeleton-icon"}),b("div",{className:"wi-skeleton-lines",children:[d("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),d("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),b("div",{className:"wi-skeleton-right",children:[d("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),d("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},E)),!Ee&&_e.length===0&&!m&&d("div",{className:"wi-empty",children:"No Tokens Found"}),_e.map(x=>{let E=pe.get(Pe(x.chainId,x.address)),M=E?parseFloat(E.percent_change_24h):null,H=M!==null&&M>=0,I=eo(n,x.chainId);return b("div",{className:"wi-token-item",children:[b("div",{className:"wi-token-left",children:[b("div",{className:"wi-token-icon-wrap",children:[d("img",{src:x.icon_url,alt:x.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Ut,onError:B=>{B.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),I&&d("img",{src:I,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:B=>{B.currentTarget.style.display="none"}})]}),b("div",{className:"wi-token-info",children:[d("span",{className:"wi-token-name",children:x.symbol}),E&&b("div",{className:"wi-token-price-row",children:[d("span",{className:"wi-token-price",children:Xt(E.price)}),d("span",{className:"wi-token-change","data-positive":H,"data-zero":M===0||void 0,children:M!==null&&(M===0?"0%":`${H?"+":"-"}${(H?Math.floor:Math.ceil)(Math.abs(M)*100)/100}%`)})]})]})]}),b("div",{className:"wi-token-right",children:[d("span",{className:"wi-token-balance",children:yt(x.quantity.numeric,x.quantity.decimals)}),E&&d("span",{className:"wi-token-value",children:zo(x.quantity.numeric,x.quantity.decimals,E.price)})]})]},`${x.address}-${x.chainId}`)}),m&&ft&&Array.from({length:3},(x,E)=>b("div",{className:"wi-skeleton-item",children:[b("div",{className:"wi-skeleton-left",children:[d("div",{className:"wi-skeleton-block wi-skeleton-icon"}),b("div",{className:"wi-skeleton-lines",children:[d("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),d("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),b("div",{className:"wi-skeleton-right",children:[d("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),d("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${E}`)),m&&!ft&&!Ee&&_e.length===0&&Ye.length===0&&d("div",{className:"wi-empty",children:"No Tokens Found"}),m&&Ye.map(x=>{let E=Vt.get(x.token)||"",M=eo(n,X[n].cross);return b("div",{className:"wi-token-item",children:[b("div",{className:"wi-token-left",children:[b("div",{className:"wi-token-icon-wrap",children:[d("img",{src:E||"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:Ut,onError:H=>{H.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),M&&d("img",{src:M,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:H=>{H.currentTarget.style.display="none"}})]}),b("div",{className:"wi-token-info",children:[d("span",{className:"wi-token-name",children:x.token_name}),d("div",{className:"wi-token-price-row",children:b("span",{className:"wi-token-price",children:[yt(x.current_price,18)," CROSS"]})})]})]}),b("div",{className:"wi-token-right",children:[d("span",{className:"wi-token-balance",children:yt(x.balance,18)}),d("span",{className:"wi-token-value",children:Xt(x.current_value_usd)})]})]},`forge-${x.token}`)})]})}),Ge==="bottom"&&be&&d("div",{className:"wi-nav-fixed",children:be})]},"wallet"),tn=Ke?d("div",{className:V("wi-view-inner wi-portfolio-body",ke.current&&"wi-view-portfolio"),children:d($e,{env:n,theme:c,walletAddress:g,showHeader:!1,sendTransaction:lt,onOutlink:ve})},"portfolio"):null,on=d("div",{className:V("wi-view-inner wi-qr-body",ke.current&&"wi-view-qr"),children:d("div",{className:"wi-qr-section",children:b("div",{className:"wi-qr-card",children:[b("div",{className:"wi-qr-code",children:[d(Ni,{value:g,size:180,level:"H",marginSize:2,...v&&{imageSettings:{src:v,height:33,width:33,excavate:!0}}}),!v&&d("div",{className:"wi-qr-logo",children:d(qo,{size:33})})]}),d("p",{className:"wi-qr-address",children:g}),b("button",{type:"button",className:"wi-qr-copy-btn",onClick:bo,children:[d("span",{className:"wi-qr-copy-icon",children:Qe?d(Yt,{size:16}):d(Kt,{size:16})}),d("span",{className:"wi-qr-copy-text",children:Qe?"Copied!":"Copy address"})]})]})})},"qr"),rn=G==="qr"||G==="portfolio",nn=G==="qr"?"My Address":G==="portfolio"?it:"",yo=S||F?b("div",{className:"wi-legal-links",children:[S&&d("a",{className:"wi-legal-link",href:S,target:"_blank",rel:"noopener noreferrer",onClick:x=>oe(x,S,{category:"terms",origin:"terms"},ve),children:N}),S&&F&&d("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),F&&d("a",{className:"wi-legal-link",href:F,target:"_blank",rel:"noopener noreferrer",onClick:x=>oe(x,F,{category:"privacy",origin:"privacy"},ve),children:j})]}):null,ko=nt??(w?b("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{w(),T()},children:[d(Ao,{size:20}),d("span",{className:"wi-disconnect-label",children:y})]}):null),Co=ko!==null||yo!==null?b("div",{className:"wi-builtin-footer",children:[ko,yo]}):null,an=b("div",{className:"wi-sticky-header",children:[b("div",{className:"wi-header wi-header--wallet",children:[b("div",{className:"wi-account-block",children:[b("div",{className:"wi-avatar",children:[d("div",{className:"wi-avatar-fallback",style:Jr}),vo&&d("img",{src:vo,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:Ut,onError:x=>{x.currentTarget.style.display="none"}})]}),b("div",{className:"wi-account-text",children:[L?b("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:L,"aria-label":"Switch account",children:[d("span",{className:"wi-account-name",children:u??"Account 1"}),d("span",{className:"wi-account-switch","aria-hidden":"true",children:d(Ho,{size:12})})]}):d("div",{className:"wi-account-row",children:d("span",{className:"wi-account-name",children:u??"Account 1"})}),b("button",{type:"button",className:"wi-address-row-btn",onClick:bo,"aria-label":"Copy address",children:[d("span",{className:"wi-account-address",children:Ae(g)}),d("span",{className:"wi-account-copy",children:Qe?d(Yt,{size:14}):d(Kt,{size:14})})]})]})]}),b("div",{className:"wi-header-actions",children:[h&&d("button",{type:"button",className:"wi-header-action",onClick:()=>Se("qr"),"aria-label":"Show QR code",children:d(Fo,{size:20})}),d("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:d(Qt,{size:24})})]})]}),d("hr",{className:"wi-divider"})]}),Lo=b(fo,{children:[o,rn?b("div",{className:"wi-sticky-header",children:[b("div",{className:"wi-header",children:[d("button",{type:"button",className:"wi-header-back",onClick:()=>Se("wallet"),"aria-label":"Back",children:d(Bo,{})}),d("div",{className:"wi-header-info",children:d("h2",{className:"wi-header-title",children:nn})}),d("button",{type:"button",className:"wi-header-close",onClick:T,"aria-label":"Close",children:d(Qt,{})})]}),d("hr",{className:"wi-divider"})]}):an,b("div",{className:"wi-view-container",children:[G==="wallet"&&en,G==="qr"&&on,G==="portfolio"&&tn]}),Co&&G!=="portfolio"&&d("div",{className:"wi-sticky-footer",children:d("div",{className:"wi-footer",children:Co})})]});return a?b(Tt.Portal,{children:[i&&d(Tt.Overlay,{className:"wi-drawer-overlay"}),b(Tt.Content,{className:V("wi-drawer-content",r),"data-theme":c,style:ie,"data-direction":s,"data-no-balance":!p||void 0,"data-view":G,children:[d(Tt.Title,{className:"wi-sr-only",children:"My Wallet"}),Lo]})]}):b(fo,{children:[i&&l&&d("div",{className:"wi-drawer-overlay",onClick:T}),d(Et.Portal,{children:d(Et.Content,{align:e,sideOffset:t,className:V("wi-popover-content",r),"data-theme":c,style:ie,"data-no-balance":!p||void 0,"data-view":G,children:Lo})})]})}import*as Sr from"react";function Or({position:e="top",children:t}){let{setNavContent:r,setNavPosition:o}=me();return Sr.useEffect(()=>(r(t),o(e),()=>r(null)),[t,e,r,o]),null}import*as Wr from"react";function Dr({children:e}){let{setFooterContent:t}=me();return Wr.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}P(`[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)}
5
+ `);P("");import{jsx as Zt}from"react/jsx-runtime";function Po({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:o,children:n}){let l=Oe(`(max-width: ${r}px)`),[a,s]=We.useState(!1),c=We.useCallback(()=>s(!1),[]),i=Q(e),p=We.useMemo(()=>({env:i,theme:t,isMobile:l,open:a,domain:o,close:c}),[i,t,l,a,o,c]);return Zt(jt.Provider,{value:p,children:l?Zt(dn.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:n},"drawer"):Zt(Io.Root,{open:a,onOpenChange:s,children:n},"popover")})}import*as Mo from"@radix-ui/react-popover";import{Drawer as fn}from"vaul";import{jsx as Z,jsxs as mn}from"react/jsx-runtime";function Ro({size:e=18}){return mn("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Z("rect",{width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),Z("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),Z("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),Z("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function To(){return Z("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Z("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Eo(){return Z("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Z("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as wt}from"react/jsx-runtime";function _o({asChild:e,children:t}){let{isMobile:r,theme:o}=gt(),n=t!=null,l=e??!0,a=n?t:wt("button",{type:"button",className:"al-trigger-btn","data-theme":o,children:wt(Ro,{size:r?12:18})});return r?wt(fn.Trigger,{asChild:l,children:a}):wt(Mo.Trigger,{asChild:l,children:a})}import*as Ne from"react";import*as xt from"@radix-ui/react-popover";import{Drawer as De}from"vaul";import{useQuery as un}from"@tanstack/react-query";var So={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"};function ht(e){let t=Q(e);return un({queryKey:["global-menu",t],queryFn:async({signal:r})=>{let o=await fetch(So[t],{cache:"no-store",signal:r});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()},staleTime:0,gcTime:0,refetchOnMount:!0})}function V(...e){return e.filter(Boolean).join(" ")}import{jsx as U,jsxs as Je}from"react/jsx-runtime";function Wo({align:e="end",sideOffset:t=12,className:r}){let{env:o,theme:n,isMobile:l,domain:a,close:s}=gt(),{data:c}=ht(o),i=Ne.useMemo(()=>(c?.items??[]).sort((u,k)=>u.order-k.order),[c]),p=8,m=Ne.useRef(null),g=Ne.useCallback(u=>{m.current={x:u.clientX,y:u.clientY}},[]),f=typeof window<"u"?window.location.pathname:"",b=Ne.useCallback((u,k)=>{if(m.current){let L=u.clientX-m.current.x,_=u.clientY-m.current.y;if(m.current=null,Math.abs(L)>p||Math.abs(_)>p)return}let R=k.url[o]??k.url.production,T=Oo(R,a);if(!T)try{let L=new URL(R).pathname;if(f===L||f.startsWith(L+"/")){s();return}}catch{}T?window.open(R,"_blank","noopener,noreferrer"):window.location.href=R,s()},[o,a,s,f]),w=U("div",{className:"al-grid","data-theme":n,children:i.map(u=>{let k=u.url[o]??u.url.production,R=Oo(k,a),T=!1;if(!R)try{let L=new URL(k).pathname;T=f===L||f.startsWith(L+"/")}catch{T=!1}return Je("button",{type:"button",className:"al-grid-item","data-active":T||void 0,onPointerDown:g,onClick:L=>b(L,u),children:[Je("div",{className:"al-grid-item-left",children:[U("div",{className:"al-grid-item-icon",children:U("img",{src:u.iconUrl,alt:u.label,width:24,height:24,loading:"lazy"})}),U("span",{className:"al-grid-item-label",children:u.label}),u.isNew&&U("span",{className:"al-badge-new",children:"N"})]}),U("div",{className:"al-grid-item-right",children:u.badge&&U("span",{className:"al-badge",children:u.badge})})]},u.id)})});return l?Je(De.Portal,{children:[U(De.Overlay,{className:"al-drawer-overlay"}),Je(De.Content,{className:V("al-drawer-content",r),"data-theme":n,children:[Je("div",{className:"al-drawer-header",children:[U(De.Close,{className:"al-drawer-close",children:U(To,{})}),U(De.Title,{className:"al-drawer-title",children:"CROSS Services"}),U(De.Close,{className:"al-drawer-close",children:U(Eo,{})})]}),U("div",{className:"al-drawer-body",children:w})]})]}):U(xt.Portal,{children:U(xt.Content,{align:e,sideOffset:t,className:V("al-popover-content",r),"data-theme":n,children:w})})}function Oo(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}import*as K from"react";import*as Ar from"@radix-ui/react-popover";import{Drawer as Ri}from"vaul";import{createContext as gn,useContext as wn}from"react";var Gt=gn(null);function me(){let e=wn(Gt);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Kt=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Kt||{}),bt={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"}};import*as Zo from"@radix-ui/react-popover";import{Drawer as xn}from"vaul";import{jsx as O,jsxs as vt}from"react/jsx-runtime";function Do({size:e=16,className:t}){return vt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[O("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"}),O("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 Yt({size:e=16,className:t}){return O("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("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 Qt({size:e=16,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xt({size:e=24,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ao({size:e=20,className:t}){return vt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[O("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"}),O("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 Fo({size:e=20,className:t}){return O("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:O("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 Bo({size:e=20,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vo({size:e=20,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ho({size:e=20,className:t}){return O("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:O("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Uo({size:e=16,className:t}){return vt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[O("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"}),O("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 $o({size:e=16,className:t}){return vt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[O("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"}),O("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function qo({size:e=42,className:t}){return O("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:O("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})})}import Ie from"bignumber.js";function hn(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 yt(e,t){if(!e||e==="0")return"0.00";let r=new Ie(e).shiftedBy(-t),o=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(o,Ie.ROUND_DOWN)}function Ae(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Jt(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,o=Math.pow(10,r);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function zo(e,t,r){let n=new Ie(e).shiftedBy(-t).multipliedBy(new Ie(r));return n.isZero()||n.isNaN()?"$0.00":`$${(n.integerValue(Ie.ROUND_DOWN).isGreaterThanOrEqualTo(1)?n.decimalPlaces(2,Ie.ROUND_DOWN):n.decimalPlaces(4,Ie.ROUND_DOWN)).toFormat()}`}function jo(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 r=t;if(r.includes("e")||r.includes("E")){let a=Number(r);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};r=hn(a.toFixed(18))}let[o="0",n=""]=r.split(".");if(Number(o)>=1){let a=n.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return n.length<4?{displayValue:`${o}.${n}`,isLowerBound:!1}:n.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${n.slice(0,4)}`,isLowerBound:!1}}import{jsx as kt,jsxs as bn}from"react/jsx-runtime";function Go({asChild:e,className:t,children:r}){let{isMobile:o,theme:n,walletAddress:l}=me(),a=r!=null,s=e??!0,c=a?r:bn("button",{type:"button",className:V("wi-trigger-btn",t),"data-theme":n,"data-mobile":o||void 0,children:[kt(Do,{size:o?14:16}),kt("span",{className:"wi-trigger-address",children:Ae(l)})]});return o?kt(xn.Trigger,{asChild:s,children:c}):kt(Zo.Trigger,{asChild:s,children:c})}import*as A from"react";import*as Et from"@radix-ui/react-popover";import{Drawer as Tt}from"vaul";import ot from"bignumber.js";import{useQueries as yn}from"@tanstack/react-query";import{useMemo as kn}from"react";var te={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},X={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var eo={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"},Ko={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 r=X[e];if(t===r.cross)return Ko.cross;if(t===r.bsc)return Ko.bsc}var vn={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Yo(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:n,format:l="png"}=r,a=vn[e],s=n?`&bg=${n}`:"";return`${a}/portrait/evm/${t}.${l}?size=${o}${s}`}var oo="user-balance";async function Cn(e,t,r,o){let n=new URLSearchParams({networkId:`eip155:${t}`,account:r}),l=await fetch(`${e}/v1/public/token/balance?${n}`,{cache:"no-store",signal:o});if(!l.ok)throw new Error(`Failed to fetch token balance: ${l.status}`);let a=await l.json();if(a.code!==200)throw new Error(`Token balance API error: ${a.code}`);return a.data}function Fe(e,t,r=!0){let o=te[e],n=X[e],l=[n.cross,n.bsc],a=yn({queries:l.map(p=>({queryKey:[oo,e,t,p],queryFn:({signal:m})=>Cn(o,p,t,m),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1}))}),s=a.some(p=>p.isLoading),c=a.some(p=>p.isError);return{tokens:kn(()=>{let p=[];for(let m of a)m.data&&p.push(...m.data);return p},[a]),isLoading:s,isError:c}}import{useQuery as Ln,useQueries as Nn}from"@tanstack/react-query";import{useMemo as In}from"react";var Pn="forge-holdings",Rn="forge-token-image";async function Tn(e,t,r){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:r});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let n=await o.json();if(!n.success)throw new Error("Forge holdings API error");return n.data.items}async function En(e,t,r){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:r});if(!o.ok)return{address:t,image_url:""};let n=await o.json();return n.success?{address:t,image_url:n.data.token.image_url}:{address:t,image_url:""}}function Qo(e,t,r=!0){let o=eo[e],{data:n,...l}=Ln({queryKey:[Pn,e,t],queryFn:({signal:a})=>Tn(o,t,a),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1});return{holdings:n??[],...l}}function Xo(e,t,r=!0){let o=eo[e],n=Nn({queries:t.map(a=>({queryKey:[Rn,e,a],queryFn:({signal:s})=>En(o,a,s),enabled:r,staleTime:1/0}))});return{imageMap:In(()=>{let a=new Map;for(let s of n)s.data&&a.set(s.data.address,s.data.image_url);return a},[n])}}import{useQuery as Mn}from"@tanstack/react-query";import{useMemo as _n}from"react";var ro="token-stats";function Pe(e,t){return`${e}:${t.toLowerCase()}`}function Be(e,t=!0){let r=te[e],{data:o,...n}=Mn({queryKey:[ro,e],queryFn:async({signal:a})=>{let s=await fetch(`${r}/v1/public/token/stats`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token stats API error: ${c.code}`);return c},enabled:t,staleTime:3e4});return{statsMap:_n(()=>{let a=new Map;if(!o?.data)return a;for(let s of o.data){let c=Pe(s.chain_id,s.address);a.set(c,s)}return a},[o]),...n}}import{useQuery as Sn}from"@tanstack/react-query";import{useMemo as On}from"react";var Wn="token-info";function no(e,t){return`${t.toLowerCase()}_${e}`}function Jo(e,t=!0){let r=te[e],{data:o,...n}=Sn({queryKey:[Wn,e],queryFn:async({signal:a})=>{let s=await fetch(`${r}/v1/public/token/info`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Failed to fetch token info: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token info API error: ${c.code}`);return c},enabled:t,staleTime:1/0});return{categoryMap:On(()=>{let a=new Map;if(!o?.data)return a;for(let s of o.data){let c=no(s.chain_id,s.address);a.set(c,s.category)}return a},[o]),...n}}import{useMemo as Dn}from"react";import io from"bignumber.js";function er(e,t,r){let{tokens:o,isLoading:n}=Fe(e,t,r),{statsMap:l}=Be(e,r);return Dn(()=>{let a=new io(0);for(let p of o){let m=l.get(Pe(p.chainId,p.address));if(!m)continue;let f=new io(p.quantity.numeric).shiftedBy(-p.quantity.decimals).multipliedBy(new io(m.price));f.isNaN()||(a=a.plus(f))}let s=a.toFixed(),{displayValue:c,isLowerBound:i}=jo(s);return{totalUsd:s,displayValue:c,isLowerBound:i,isLoading:n}},[o,l,n])}import{QRCodeSVG as Li}from"qrcode.react";function oe(e,t,r,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let n;try{n=o(t,r)}catch(i){console.error("[dapp-ui] onOutlink threw:",i);return}let l=i=>{typeof window>"u"||window.open(i,"_blank","noopener,noreferrer")};if((i=>!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function")(n)){let i=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,p=m=>{if(m===null){i?.close();return}let g=m??t;if(i)try{i.location.href=g}catch{i.close(),l(g)}else l(g)};n.then(p,m=>{console.error("[dapp-ui] onOutlink rejected:",m),i?.close()});return}let s=n;if(s===null)return;l(s??t)}import*as Te from"react";import{Drawer as ki}from"vaul";import{createContext as An,useContext as Fn}from"react";var et=An(null);function $(){let e=Fn(et);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}import{Drawer as Bn}from"vaul";import{jsx as tr}from"react/jsx-runtime";function or({asChild:e,children:t}){let{walletAddress:r}=$(),o=t!=null,n=e??!0,l=o?t:tr("button",{type:"button",children:Ae(r)});return tr(Bn.Trigger,{asChild:n,children:l})}import{Drawer as Rt}from"vaul";import*as ee from"react";import{useQueryClient as bi}from"@tanstack/react-query";import{useMemo as zn}from"react";import ao from"bignumber.js";import{useQuery as Vn}from"@tanstack/react-query";import{useMemo as ir}from"react";var Ct={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"},Lt={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"},fe={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},nr={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 Hn="wp:reward-pools";function Nt(e,t=!0){let r=Ct[e],{data:o,...n}=Vn({queryKey:[Hn,e],queryFn:async({signal:s})=>{let c=await fetch(`${r}/v1/pools`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch pools: ${c.status}`);let i=await c.json();if(i.code!==200)throw new Error(`Pools API error: ${i.code}`);return i},enabled:t,staleTime:0}),l=ir(()=>o?.data.pools.filter(s=>s.pool_type==="CrossPool")??[],[o]),a=ir(()=>o?.data.pools.filter(s=>s.pool_type==="GamePool")??[],[o]);return{crossPools:l,gamePools:a,allPools:o?.data.pools??[],...n}}import{useQuery as Un}from"@tanstack/react-query";import{useMemo as $n}from"react";var qn="wp:user-deposits";function It(e,t,r=!0){let o=Ct[e],n=r&&!!t,{data:l,...a}=Un({queryKey:[qn,e,t],queryFn:async({signal:c})=>{let i=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:c});if(!i.ok)throw new Error(`Deposits fetch failed: ${i.status}`);let p=await i.json();if(p.code!==200)throw new Error(`Deposits API error: ${p.code}`);return p},enabled:n,staleTime:0});return{depositMap:$n(()=>{let c=new Map;if(!l?.data.user_deposits)return c;for(let i of l.data.user_deposits)c.set(i.pool_address.toLowerCase(),i);return c},[l]),deposits:l?.data.user_deposits??[],...a}}import{useQuery as ar}from"@tanstack/react-query";import{useMemo as sr}from"react";function re(e,t,r,o=!0){let n=nr[e][t],l=o&&!!r,{data:a,...s}=ar({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:b})=>{let w=await fetch(`${n}/pair-info`,{cache:"no-store",signal:b});if(!w.ok)throw new Error(`pair-info fetch failed: ${w.status}`);let u=await w.json();if(u.code!==200)throw new Error(`pair-info API error: ${u.code}`);return u},enabled:o,staleTime:0}),c=a?.data??[],i=sr(()=>{let b=new Map;for(let w of c)b.set(w.pair_address.toLowerCase(),w);return b},[c]),{data:p,...m}=ar({queryKey:["wp:dex-orders",e,t,r],queryFn:async({signal:b})=>{let w=Math.floor(Date.now()/1e3),u=new URLSearchParams({owner:r,size:"200",start_date:"0",end_date:String(w)}),k=await fetch(`${n}/open-order?${u}`,{cache:"no-store",signal:b});if(!k.ok)throw new Error(`open-order fetch failed: ${k.status}`);let R=await k.json();if(R.code!==200)throw new Error(`open-order API error: ${R.code}`);return R.data?.data??[]},enabled:l,staleTime:0}),g=p??[],f=sr(()=>{let b=new Map;for(let w of g){let u=w.pair.toLowerCase();b.has(u)||b.set(u,{buys:[],sells:[]});let k=b.get(u);w.order_side===1?k.buys.push(w):k.sells.push(w)}return b},[g]);return{allPairs:c,pairMap:i,orders:g,ordersByPair:f,isEmpty:g.length===0,isLoading:s.isLoading||m.isLoading}}var jn=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],lr="var(--wp-green)",cr=4;function pr(e,t,r=!0){let o=r&&!!t,{allPools:n}=Nt(e,o),{depositMap:l}=It(e,t,o),{allPairs:a,pairMap:s,ordersByPair:c}=re(e,"cross",t,o),{allPairs:i,pairMap:p,ordersByPair:m}=re(e,"crossd",t,o),{allPairs:g,pairMap:f,ordersByPair:b}=re(e,"forge",t,o);return zn(()=>{let w=new Map,u=new Map,k=(h,y)=>{!Number.isFinite(y)||y<=0||u.set(h,(u.get(h)??0)+y)};for(let h of n){let y=Number(h.deposit_token.price);y>0&&w.set(h.deposit_token.symbol,y);for(let S of h.reward_tokens){let N=Number(S.price);N>0&&w.set(S.symbol,N)}}for(let h of[...a,...i,...g]){let y=w.get(h.quote_symbol),S=Number(h.billboard?.price);y&&S>0&&!w.has(h.base_symbol)&&w.set(h.base_symbol,S*y)}for(let h of n){let y=l.get(h.pool_address.toLowerCase());if(!y)continue;let S=new ao(y.deposited_amount).shiftedBy(-h.deposit_token.decimals).toNumber();if(k(h.deposit_token.symbol,S),h.reward_tokens.length>0){let N=h.reward_tokens[0],F=new ao(y.claimable_reward).shiftedBy(-N.decimals).toNumber();k(N.symbol,F)}}let R=[{pairMap:s,ordersByPair:c},{pairMap:p,ordersByPair:m},{pairMap:f,ordersByPair:b}];for(let{pairMap:h,ordersByPair:y}of R)for(let[S,N]of y){let F=h.get(S);if(F){for(let j of N.buys){let ie=Number(j.amount)-Number(j.filled);k(F.quote_symbol,ie*Number(j.price))}for(let j of N.sells){let ie=Number(j.amount)-Number(j.filled);k(F.base_symbol,ie)}}}let T=[],L=0;for(let[h,y]of u){let S=w.get(h)??0,N=y*S;N>0&&(T.push({symbol:h,usdValue:N}),L+=N)}T.sort((h,y)=>y.usdValue-h.usdValue);let _=[];if(L>0){let h=T.slice(0,cr),y=T.slice(cr);for(let N=0;N<h.length;N++)_.push({symbol:h[N].symbol,usdValue:h[N].usdValue,percentage:Math.round(h[N].usdValue/L*100),color:jn[N]??lr});if(y.length>0){let N=y.reduce((F,j)=>F+j.usdValue,0);_.push({symbol:"Others",usdValue:N,percentage:Math.round(N/L*100),color:lr})}let S=_.reduce((N,F)=>N+F.percentage,0);S!==100&&_.length>0&&(_[0].percentage+=100-S)}return{totalUsd:L,formattedTotal:L>0?`$${new ao(L).toFormat(2)}`:"$0.00",segments:_}},[n,l,a,s,c,i,p,m,g,f,b])}import{jsx as Ve,jsxs as Zn}from"react/jsx-runtime";function dr({size:e=22,className:t}){return Ve("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ve("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function mr({size:e=22,className:t}){return Zn("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Ve("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),Ve("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 Ve("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ve("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}import{useQuery as Gn}from"@tanstack/react-query";import{useMemo as Kn}from"react";var Yn="wp:token-info";function ue(e,t=!0){let r=te[e],o=X[e].cross,{data:n,...l}=Gn({queryKey:[Yn,e],queryFn:async({signal:i})=>{let p=await fetch(`${r}/v1/public/token/info`,{cache:"no-store",signal:i});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:300*1e3}),{byChainAddr:a,byChainSym:s}=Kn(()=>{let i=new Map,p=new Map;if(!n?.data)return{byChainAddr:i,byChainSym:p};for(let m of n.data){let g=m.address.toLowerCase();i.set(`${m.chain_id}:${g}`,m),i.set(g,m);let f=m.symbol.replace(/^t/,"").toUpperCase(),b=`${m.chain_id}:${f}`;p.has(b)||p.set(b,m),p.has(f)||p.set(f,m)}return{byChainAddr:i,byChainSym:p}},[n]);return{getTokenImage:(i,p)=>{let m=i.toLowerCase(),g=a.get(`${o}:${m}`);if(g?.image)return g.image;let f=a.get(m);if(f?.image)return f.image;if(p){let b=p.replace(/^t/,"").toUpperCase(),w=s.get(`${o}:${b}`);if(w?.image)return w.image;let u=s.get(b);if(u?.image)return u.image}return""},...l}}import{jsx as Pt,jsxs as ur}from"react/jsx-runtime";function ne({title:e,icon:t,iconFit:r="cover",isEmpty:o,children:n}){return ur("div",{className:"wp-svc-card",children:[ur("div",{className:"wp-svc-card-head",children:[Pt("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:r}}),Pt("span",{className:"wp-svc-card-title",children:e})]}),o?Pt("div",{className:"wp-svc-empty",children:"No assets yet"}):Pt("div",{className:"wp-svc-items",children:n})]})}import tt from"bignumber.js";import{jsx as Re,jsxs as se}from"react/jsx-runtime";var Qn="CROSS Rewards",Xn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/award.svg";function gr(e,t){let r=new tt(e).shiftedBy(-t);return r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,tt.ROUND_DOWN):r.toFormat(4,tt.ROUND_DOWN)}function wr(){let{env:e,walletAddress:t,onOutlink:r}=$(),o=!!t,{allPools:n}=Nt(e,o),{depositMap:l}=It(e,t,o),{getTokenImage:a}=ue(e,o),s=i=>`${rr[e]}/rewards/${i.pool_address}?action=withdraw`,c=n.filter(i=>{let p=l.get(i.pool_address.toLowerCase()),m=p?.deposited_amount??"0",g=p?.claimable_reward??"0";return!(new tt(m).isZero()&&new tt(g).isZero())});return Re(ne,{title:Qn,icon:Xn,isEmpty:c.length===0,children:c.map(i=>{let p=l.get(i.pool_address.toLowerCase()),m=p?.deposited_amount??"0",g=s(i);return se("a",{className:"wp-item","data-side":"reward",href:g,target:"_blank",rel:"noopener noreferrer",onClick:f=>oe(f,g,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:i,userDeposit:p}},r),children:[se("div",{className:"wp-item-body",children:[se("div",{className:"wp-item-field",children:[se("span",{className:"wp-item-label",children:["Deposited (",i.deposit_token.symbol,")"]}),se("div",{className:"wp-svc-token",children:[a(i.deposit_token.address,i.deposit_token.symbol)&&Re("img",{className:"wp-svc-token-icon",src:a(i.deposit_token.address,i.deposit_token.symbol),alt:""}),Re("span",{children:gr(m,i.deposit_token.decimals)})]})]}),se("div",{className:"wp-item-field",children:[se("span",{className:"wp-item-label",children:["Rewards (",i.reward_tokens.map(f=>f.symbol).join(", "),")"]}),i.reward_tokens.map(f=>{let b=a(f.address,f.symbol);return se("div",{className:"wp-svc-token",children:[b&&Re("img",{className:"wp-svc-token-icon",src:b,alt:""}),Re("span",{children:p?gr(p.claimable_reward,f.decimals):"0"})]},f.address)})]})]}),se("div",{className:"wp-item-badges",children:[Re("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),Re("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},i.pool_address)})})}import xr from"bignumber.js";import{Fragment as Jn,jsx as G,jsxs as q}from"react/jsx-runtime";function so(e){let t=new xr(e);if(t.isNaN())return e;let r=t.decimalPlaces()??0;return t.toFormat(r)}function hr(e){let t=new xr(e.amount).minus(e.filled);return so(t.toString())}function He({market:e,pairMap:t,ordersByPair:r,getDexUrl:o,getTokenImage:n}){let{onOutlink:l}=$(),a=[];for(let[s,c]of r){let i=t.get(s),p=i?n(i.base_address,i.base_symbol):"",m=i?n(i.quote_address,i.quote_symbol):"",g=o(s);for(let f of c.buys)a.push(q("a",{className:"wp-item","data-side":"buy",href:g,target:"_blank",rel:"noopener noreferrer",onClick:b=>oe(b,g,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"buy",order:f,pair:i}},l),children:[q("div",{className:"wp-item-body",children:[q("div",{className:"wp-item-field",children:[q("span",{className:"wp-item-label wp-item-label--buy",children:["Buy",i?.base_symbol?` (${i.base_symbol})`:""]}),q("div",{className:"wp-svc-token",children:[p&&G("img",{className:"wp-svc-token-icon",src:p,alt:""}),G("span",{children:hr(f)})]})]}),q("div",{className:"wp-item-field",children:[q("span",{className:"wp-item-label",children:["Price",i?.quote_symbol?` (${i.quote_symbol})`:""]}),q("div",{className:"wp-svc-token",children:[m&&G("img",{className:"wp-svc-token-icon",src:m,alt:""}),G("span",{children:so(f.price)})]})]})]}),G("div",{className:"wp-item-badges",children:G("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`buy-${f.order_id}`));for(let f of c.sells)a.push(q("a",{className:"wp-item","data-side":"sell",href:g,target:"_blank",rel:"noopener noreferrer",onClick:b=>oe(b,g,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"sell",order:f,pair:i}},l),children:[q("div",{className:"wp-item-body",children:[q("div",{className:"wp-item-field",children:[q("span",{className:"wp-item-label wp-item-label--sell",children:["Sell",i?.base_symbol?` (${i.base_symbol})`:""]}),q("div",{className:"wp-svc-token",children:[p&&G("img",{className:"wp-svc-token-icon",src:p,alt:""}),G("span",{children:hr(f)})]})]}),q("div",{className:"wp-item-field",children:[q("span",{className:"wp-item-label",children:["Price",i?.quote_symbol?` (${i.quote_symbol})`:""]}),q("div",{className:"wp-svc-token",children:[m&&G("img",{className:"wp-svc-token-icon",src:m,alt:""}),G("span",{children:so(f.price)})]})]})]}),G("div",{className:"wp-item-badges",children:G("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${f.order_id}`))}return G(Jn,{children:a})}import{jsx as br}from"react/jsx-runtime";var ei="Gametoken - CROSS",ti="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function vr(){let{env:e,walletAddress:t}=$(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:l}=re(e,"cross",t,r),{getTokenImage:a}=ue(e,r);return br(ne,{title:ei,icon:ti,isEmpty:l,children:br(He,{market:"cross",pairMap:o,ordersByPair:n,getDexUrl:c=>{let i=o.get(c.toLowerCase());return`${fe[e]}/gametoken/cross/${i?.base_symbol??""}`},getTokenImage:a})})}import{jsx as yr}from"react/jsx-runtime";var oi="Gametoken - CROSSD",ri="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function kr(){let{env:e,walletAddress:t}=$(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:l}=re(e,"crossd",t,r),{getTokenImage:a}=ue(e,r);return yr(ne,{title:oi,icon:ri,isEmpty:l,children:yr(He,{market:"crossd",pairMap:o,ordersByPair:n,getDexUrl:c=>{let i=o.get(c.toLowerCase());return`${fe[e]}/gametoken/crossd/${i?.base_symbol??""}`},getTokenImage:a})})}import{jsx as Cr}from"react/jsx-runtime";var ni="Gametoken - Forge",ii="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function Lr(){let{env:e,walletAddress:t}=$(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:l}=re(e,"forge",t,r),{getTokenImage:a}=ue(e,r);return l?null:Cr(ne,{title:ni,icon:ii,isEmpty:l,children:Cr(He,{market:"forge",pairMap:o,ordersByPair:n,getDexUrl:c=>{let i=o.get(c.toLowerCase());return`${fe[e]}/gametoken/forge/${i?.base_symbol??""}`},getTokenImage:a})})}import lo from"bignumber.js";import{useMemo as mi}from"react";import{useQuery as ai}from"@tanstack/react-query";var si="wp:forge-pools";function Nr(e,t,r=!0){let o=Lt[e],n=r&&!!t,{data:l,...a}=ai({queryKey:[si,e,t],queryFn:async()=>{let c=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!c.ok)throw new Error(`forge pools fetch failed: ${c.status}`);return(await c.json()).data?.items??[]},enabled:n,staleTime:0}),s=l??[];return{pools:s,isEmpty:s.length===0,...a}}import{useQueries as li}from"@tanstack/react-query";import{useMemo as ci}from"react";var pi="wp:forge-token-detail";async function di(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function Ir(e,t,r=!0){let o=Lt[e],n=li({queries:t.map(s=>({queryKey:[pi,e,s],queryFn:()=>di(o,s),enabled:r&&!!s,staleTime:3e4}))}),l=ci(()=>{let s=new Map;for(let c=0;c<n.length;c++){let i=n[c]?.data,p=t[c];i&&p&&s.set(p.toLowerCase(),i)}return s},[n,t]),a=n.some(s=>s.isLoading);return{detailMap:l,isLoading:a}}import{jsx as J,jsxs as Ue}from"react/jsx-runtime";var fi="Forge",ui="https://x.crosstoken.io/forge/favicon-96x96.png",gi=18,wi="https://contents.crosstoken.io/wallet/token/images/FT.png";function hi(e){if(!e||e==="0")return"0";let t=new lo(e).shiftedBy(-gi);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,lo.ROUND_DOWN):t.toFormat(4,lo.ROUND_DOWN)}function xi(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 Pr(){let{env:e,walletAddress:t,onOutlink:r}=$(),o=!!t,{pools:n,isEmpty:l}=Nr(e,t,o),a=mi(()=>n.map(i=>i.token.address),[n]),{detailMap:s}=Ir(e,a,o&&a.length>0),c=i=>`${fe[e]}/forge/token/${i.token.address}`;return J(ne,{title:fi,icon:ui,iconFit:"contain",isEmpty:l,children:n.map(i=>{let p=s.get(i.token.address.toLowerCase()),m=p?.image_url||p?.image||i.token.image||wi,g=p?.symbol||i.token.symbol,f=c(i);return Ue("a",{className:"wp-item","data-side":"lp",href:f,target:"_blank",rel:"noopener noreferrer",onClick:b=>oe(b,f,{category:"portfolio",origin:"portfolio-forge",payload:{pool:i,tokenDetail:p}},r),children:[Ue("div",{className:"wp-item-body",children:[Ue("div",{className:"wp-item-field",children:[Ue("span",{className:"wp-item-label",children:["Pair (",g,")"]}),J("div",{className:"wp-svc-token",children:J("img",{className:"wp-svc-token-icon",src:m,alt:""})})]}),Ue("div",{className:"wp-item-field",children:[J("span",{className:"wp-item-label",children:"LP Balance"}),J("div",{className:"wp-svc-token",children:J("span",{children:hi(i.lp_balance)})})]}),Ue("div",{className:"wp-item-field",children:[J("span",{className:"wp-item-label",children:"Ownership"}),J("div",{className:"wp-svc-token",children:J("span",{children:xi(i.pool_ownership)})})]})]}),J("div",{className:"wp-item-badges",children:J("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},i.pair_address)})})}P(`.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:Sora,sans-serif;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:Sora,sans-serif;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-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:Roboto,Sora,sans-serif;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.15px;text-align:center;color:var(--wp-text);margin:0}.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}
6
+ `);import{Fragment as yi,jsx as W,jsxs as ge}from"react/jsx-runtime";var co=5,vi="wp:";function $e({env:e,theme:t="dark",walletAddress:r,onBack:o,showHeader:n=!0,variant:l="embed",className:a,sendTransaction:s,onOutlink:c}){let i=Q(e),p=!!r,m=bi(),{segments:g}=pr(i,r,p),[f,b]=ee.useState(co),[w,u]=ee.useState(!1),k=ee.useCallback(()=>{m.invalidateQueries({predicate:h=>typeof h.queryKey[0]=="string"&&h.queryKey[0].startsWith(vi)})},[m]),R=ee.useCallback(()=>{k(),u(!0),setTimeout(()=>u(!1),600),b(co)},[k]);ee.useEffect(()=>{if(!p)return;let h=setInterval(()=>{b(y=>y<=1?(R(),co):y-1)},1e3);return()=>clearInterval(h)},[p,R]);let T=ee.useCallback(()=>{o?.()},[o]),L=ee.useMemo(()=>({env:i,theme:t,open:!0,walletAddress:r,close:T,sendTransaction:s,onOutlink:c}),[i,t,r,T,s,c]),_=ge(yi,{children:[n&&ge("div",{className:"wp-header",children:[o?W("button",{type:"button",className:"wp-header-btn",onClick:o,children:W(dr,{})}):W("span",{className:"wp-header-btn","aria-hidden":!0}),W("h2",{className:"wp-header-title",children:"My Portfolio"}),ge("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:R,children:[W(mr,{className:w?"wp-spin-once":void 0}),p&&W("span",{className:"wp-refresh-badge",children:f})]})]}),W("div",{className:"wp-top",children:g.length>0&&ge("div",{className:"wp-asset",children:[ge("div",{className:"wp-asset-head",children:[W("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),W("span",{className:"wp-asset-head-icon",children:W(fr,{})})]}),W("div",{className:"wp-bar",children:g.map(h=>W("div",{className:"wp-bar-seg",style:{flex:`${h.percentage} 0 0`,background:h.color},children:h.percentage>=5&&ge("span",{className:"wp-bar-seg-pct",children:[h.percentage,"%"]})},h.symbol))}),W("div",{className:"wp-legend",children:g.map(h=>ge("div",{className:"wp-legend-item",children:[W("span",{className:"wp-legend-dot",style:{background:h.color}}),W("span",{className:"wp-legend-label",children:h.symbol})]},h.symbol))})]})}),W("div",{className:"wp-body",children:ge("div",{className:"wp-body-inner",children:[W(wr,{}),W(vr,{}),W(kr,{}),W(Lr,{}),W(Pr,{})]})})]});return W(et.Provider,{value:L,children:l==="none"?_:W("div",{className:V(l==="fullscreen"?"wp-fullscreen":"wp-embed",a),"data-theme":t,children:_})})}import{jsx as po,jsxs as Rr}from"react/jsx-runtime";function Tr({className:e}){let{env:t,theme:r,walletAddress:o,close:n,sendTransaction:l}=$();return Rr(Rt.Portal,{children:[po(Rt.Overlay,{className:"wp-overlay"}),Rr(Rt.Content,{className:V("wp-fullscreen",e),"data-theme":r,children:[po(Rt.Title,{className:"wp-sr-only",children:"My Portfolio"}),po($e,{env:t,theme:r,walletAddress:o,onBack:n,variant:"none",sendTransaction:l})]})]})}import{jsx as Er}from"react/jsx-runtime";function Ci({env:e,theme:t="dark",walletAddress:r,open:o,onOpenChange:n,sendTransaction:l,onOutlink:a,children:s}){let c=Q(e),i=o!==void 0,[p,m]=Te.useState(!1),g=i?o:p,f=Te.useCallback(u=>{i||m(u),n?.(u)},[i,n]),b=Te.useCallback(()=>f(!1),[f]),w=Te.useMemo(()=>({env:c,theme:t,open:g,walletAddress:r,close:b,sendTransaction:l,onOutlink:a}),[c,t,g,r,b,l,a]);return Er(et.Provider,{value:w,children:Er(ki.Root,{direction:"bottom",open:g,onOpenChange:f,noBodyStyles:!0,children:s})})}var Mr=Object.assign(Ci,{Trigger:or,Content:Tr});import{Fragment as fo,jsx as d,jsxs as v}from"react/jsx-runtime";function mo(e,t,r){let o=X[e],n=r.toUpperCase();if(t===o.cross&&n.includes("CROSSD"))return 0;if(t===o.cross&&n==="CROSS")return 1;if(t===o.bsc&&n==="CROSS")return 2}function Ni(e){return parseInt(e.split(":")[1],10)}function Ii(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Pi(e){let t=e.toLowerCase().replace(/^0x/,""),r=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(r.slice(0,4),16)%360,n=(o+60+parseInt(r.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${n} 80% 55%))`}function _r({align:e="end",sideOffset:t=12,className:r,children:o}){let{env:n,theme:l,isMobile:a,open:s,drawerDirection:c,modal:i,showBalance:p,showForgeToken:m,showGameToken:g,showQR:f,qrLogoSrc:b,walletAddress:w,accountName:u,profileImageUrl:k,preferredTokens:R,close:T,onSelectWallet:L,onCopyAddress:_,onDisconnect:h,disconnectLabel:y,termsUrl:S,termsLabel:N,privacyUrl:F,privacyLabel:j,portalStyle:ie,navContent:be,navPosition:Ze,footerContent:Ge,view:Y,setView:Ke,showPortfolio:Ye,portfolioTitle:Vt,showTotalAssets:at,totalAssetsLabel:st,sendTransaction:lt,onOutlink:ve}=me(),{tokens:ce,isLoading:Ee}=Fe(n,w,s&&p),{statsMap:pe}=Be(n,p),{categoryMap:ct}=Jo(n,p),pt=p&&at,{displayValue:ae,isLowerBound:Me,isLoading:dt}=er(n,w,s&&pt),[ye,mt]=A.useState(!1),{holdings:de,isLoading:ft}=Qo(n,w,s&&p&&m),ut=A.useMemo(()=>de.map(x=>x.token),[de]),{imageMap:Ht}=Xo(n,ut,m&&de.length>0),_e=A.useMemo(()=>{let x=[],E=[],M=[],H=new Map((R??[]).map((I,B)=>[`${Ni(I.chainId)}:${I.address.toLowerCase()}`,B]));for(let I of ce){let B=mo(n,I.chainId,I.symbol)!==void 0,Ce=`${I.chainId}:${I.address.toLowerCase()}`,Le=H.get(Ce),zt=new ot(I.quantity.numeric).shiftedBy(-I.quantity.decimals);if(B)x.push(I);else if(Le!==void 0)E.push(I);else if(zt.isGreaterThan(0)){if(!g&&ct.get(no(I.chainId,I.address))==="game")continue;M.push(I)}}return x.sort((I,B)=>{let Ce=mo(n,I.chainId,I.symbol)??99,Le=mo(n,B.chainId,B.symbol)??99;return Ce-Le}),E.sort((I,B)=>{let Ce=H.get(`${I.chainId}:${I.address.toLowerCase()}`)??99,Le=H.get(`${B.chainId}:${B.address.toLowerCase()}`)??99;return Ce-Le}),M.sort((I,B)=>{let Ce=pe.get(Pe(I.chainId,I.address)),Le=pe.get(Pe(B.chainId,B.address)),zt=new ot(I.quantity.numeric).shiftedBy(-I.quantity.decimals).multipliedBy(Ce?.price??0);return new ot(B.quantity.numeric).shiftedBy(-B.quantity.decimals).multipliedBy(Le?.price??0).minus(zt).toNumber()}),[...x,...E,...M]},[ce,n,pe,g,ct,R]),Qe=A.useMemo(()=>{if(!m)return[];let x=new Set(ce.map(E=>E.address.toLowerCase()));return[...de].filter(E=>!x.has(E.token.toLowerCase())).sort((E,M)=>{let H=new ot(E.value);return new ot(M.value).minus(H).toNumber()})},[de,m,ce]),ke=A.useRef(!1),Se=A.useCallback(x=>{ke.current=!0,Ke(x)},[Ke]);A.useEffect(()=>{s||(ke.current=!1)},[s]);let ho=A.useRef(null);A.useEffect(()=>{let x=ho.current;if(!x||!a)return;let E=M=>{M.pointerType==="touch"&&M.stopPropagation()};return x.addEventListener("pointerdown",E),()=>x.removeEventListener("pointerdown",E)},[a]);let[Xe,xo]=A.useState(!1),Ut=A.useRef(void 0);A.useEffect(()=>()=>clearTimeout(Ut.current),[]);let bo=A.useCallback(async()=>{if(!Xe)try{await navigator.clipboard.writeText(w),xo(!0),clearTimeout(Ut.current),Ut.current=setTimeout(()=>xo(!1),2e3),_?.(w,!0)}catch{_?.(w,!1)}},[w,_,Xe]),$t=A.useCallback(x=>{x.currentTarget.setAttribute("data-loaded","true")},[]),Jr=A.useMemo(()=>({background:Pi(w)}),[w]),vo=A.useMemo(()=>k||Yo(n,w,{size:120,bg:l==="dark"?"1A1A2E":"F3F6F8"}),[k,n,w,l]),qt=A.useMemo(()=>Ii(ae),[ae]),en=S||F?v("div",{className:"wi-legal-links",children:[S&&d("a",{className:"wi-legal-link",href:S,target:"_blank",rel:"noopener noreferrer",onClick:x=>oe(x,S,{category:"terms",origin:"terms"},ve),children:N}),S&&F&&d("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),F&&d("a",{className:"wi-legal-link",href:F,target:"_blank",rel:"noopener noreferrer",onClick:x=>oe(x,F,{category:"privacy",origin:"privacy"},ve),children:j})]}):null,yo=h?v("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{h(),T()},children:[d(Ao,{size:12}),d("span",{className:"wi-disconnect-label",children:y})]}):null,tn=v("div",{className:V("wi-view-inner",ke.current&&"wi-view-wallet"),children:[pt&&(()=>{let x=Ye;return v(x?"button":"div",{...x?{type:"button",onClick:()=>Se("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":x||void 0,children:[v("div",{className:"wi-total-head",children:[d("span",{className:"wi-total-label",children:st}),d("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:M=>{M.stopPropagation(),mt(H=>!H)},onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),M.stopPropagation(),mt(H=>!H))},"aria-label":ye?"Show balance":"Hide balance",children:ye?d($o,{}):d(Uo,{})})]}),v("div",{className:"wi-total-body",children:[dt?d("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):d("div",{className:"wi-total-value","data-hidden":ye||void 0,children:ye?d("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):v(fo,{children:[Me&&d("span",{className:"wi-total-lte",children:"\u2264"}),d("span",{className:"wi-total-currency",children:"$"}),d("span",{className:"wi-total-amount",children:qt.main}),qt.decimal&&d("span",{className:"wi-total-decimal",children:qt.decimal})]})}),x&&d("span",{className:"wi-total-chevron","aria-hidden":!0,children:d(Vo,{size:18})})]})]})})(),Ze==="top"&&be&&d("div",{className:"wi-nav-fixed",children:be}),p&&d("div",{ref:ho,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:v("div",{className:"wi-token-list",children:[Ee&&Array.from({length:5},(x,E)=>v("div",{className:"wi-skeleton-item",children:[v("div",{className:"wi-skeleton-left",children:[d("div",{className:"wi-skeleton-block wi-skeleton-icon"}),v("div",{className:"wi-skeleton-lines",children:[d("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),d("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),v("div",{className:"wi-skeleton-right",children:[d("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),d("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},E)),!Ee&&_e.length===0&&!m&&d("div",{className:"wi-empty",children:"No Tokens Found"}),_e.map(x=>{let E=pe.get(Pe(x.chainId,x.address)),M=E?parseFloat(E.percent_change_24h):null,H=M!==null&&M>=0,I=to(n,x.chainId);return v("div",{className:"wi-token-item",children:[v("div",{className:"wi-token-left",children:[v("div",{className:"wi-token-icon-wrap",children:[d("img",{src:x.icon_url,alt:x.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:$t,onError:B=>{B.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),I&&d("img",{src:I,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:B=>{B.currentTarget.style.display="none"}})]}),v("div",{className:"wi-token-info",children:[d("span",{className:"wi-token-name",children:x.symbol}),E&&v("div",{className:"wi-token-price-row",children:[d("span",{className:"wi-token-price",children:Jt(E.price)}),d("span",{className:"wi-token-change","data-positive":H,"data-zero":M===0||void 0,children:M!==null&&(M===0?"0%":`${H?"+":"-"}${(H?Math.floor:Math.ceil)(Math.abs(M)*100)/100}%`)})]})]})]}),v("div",{className:"wi-token-right",children:[d("span",{className:"wi-token-balance",children:yt(x.quantity.numeric,x.quantity.decimals)}),E&&d("span",{className:"wi-token-value",children:zo(x.quantity.numeric,x.quantity.decimals,E.price)})]})]},`${x.address}-${x.chainId}`)}),m&&ft&&Array.from({length:3},(x,E)=>v("div",{className:"wi-skeleton-item",children:[v("div",{className:"wi-skeleton-left",children:[d("div",{className:"wi-skeleton-block wi-skeleton-icon"}),v("div",{className:"wi-skeleton-lines",children:[d("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),d("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),v("div",{className:"wi-skeleton-right",children:[d("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),d("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${E}`)),m&&!ft&&!Ee&&_e.length===0&&Qe.length===0&&d("div",{className:"wi-empty",children:"No Tokens Found"}),m&&Qe.map(x=>{let E=Ht.get(x.token)||"",M=to(n,X[n].cross);return v("div",{className:"wi-token-item",children:[v("div",{className:"wi-token-left",children:[v("div",{className:"wi-token-icon-wrap",children:[d("img",{src:E||"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:$t,onError:H=>{H.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),M&&d("img",{src:M,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:H=>{H.currentTarget.style.display="none"}})]}),v("div",{className:"wi-token-info",children:[d("span",{className:"wi-token-name",children:x.token_name}),d("div",{className:"wi-token-price-row",children:v("span",{className:"wi-token-price",children:[yt(x.current_price,18)," CROSS"]})})]})]}),v("div",{className:"wi-token-right",children:[d("span",{className:"wi-token-balance",children:yt(x.balance,18)}),d("span",{className:"wi-token-value",children:Jt(x.current_value_usd)})]})]},`forge-${x.token}`)})]})}),Ze==="bottom"&&be&&d("div",{className:"wi-nav-fixed",children:be}),yo&&d("div",{className:"wi-wallet-disconnect-row",children:yo})]},"wallet"),on=Ye?d("div",{className:V("wi-view-inner wi-portfolio-body",ke.current&&"wi-view-portfolio"),children:d($e,{env:n,theme:l,walletAddress:w,showHeader:!1,sendTransaction:lt,onOutlink:ve})},"portfolio"):null,rn=d("div",{className:V("wi-view-inner wi-qr-body",ke.current&&"wi-view-qr"),children:v("div",{className:"wi-qr-section",children:[v("div",{className:"wi-qr-card",children:[v("div",{className:"wi-qr-code",children:[d(Li,{value:w,size:180,level:"H",marginSize:2,...b&&{imageSettings:{src:b,height:33,width:33,excavate:!0}}}),!b&&d("div",{className:"wi-qr-logo",children:d(qo,{size:33})})]}),d("p",{className:"wi-qr-address",children:w}),v("button",{type:"button",className:"wi-qr-copy-btn",onClick:bo,children:[d("span",{className:"wi-qr-copy-icon",children:Xe?d(Qt,{size:16}):d(Yt,{size:16})}),d("span",{className:"wi-qr-copy-text",children:Xe?"Copied!":"Copy address"})]})]}),en]})},"qr"),nn=Y==="qr"||Y==="portfolio",ko=Ge!==null?d("div",{className:"wi-builtin-footer",children:Ge}):null,Co=v("div",{className:"wi-account-text",children:[L?v("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:L,"aria-label":"Switch account",children:[d("span",{className:"wi-account-name",children:u??"Account 1"}),d("span",{className:"wi-account-switch","aria-hidden":"true",children:d(Ho,{size:12})})]}):d("div",{className:"wi-account-row",children:d("span",{className:"wi-account-name",children:u??"Account 1"})}),v("button",{type:"button",className:"wi-address-row-btn",onClick:bo,"aria-label":"Copy address",children:[d("span",{className:"wi-account-address",children:Ae(w)}),d("span",{className:"wi-account-copy",children:Xe?d(Qt,{size:14}):d(Yt,{size:14})})]})]}),Lo=v(fo,{children:[o,nn?v("div",{className:"wi-sticky-header",children:[v("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[d("button",{type:"button",className:"wi-header-back",onClick:()=>Se("wallet"),"aria-label":"Back",children:d(Bo,{})}),d("div",{className:"wi-account-block wi-account-block--sub-account",children:Co}),d("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:d(Xt,{size:24})})]}),d("hr",{className:"wi-divider"})]}):v("div",{className:"wi-sticky-header",children:[v("div",{className:"wi-header wi-header--wallet",children:[v("div",{className:"wi-account-block",children:[v("div",{className:"wi-avatar",children:[d("div",{className:"wi-avatar-fallback",style:Jr}),vo&&d("img",{src:vo,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:$t,onError:x=>{x.currentTarget.style.display="none"}})]}),Co]}),v("div",{className:"wi-header-actions",children:[f&&d("button",{type:"button",className:"wi-header-action",onClick:()=>Se("qr"),"aria-label":"Show QR code",children:d(Fo,{size:20})}),d("button",{type:"button",className:"wi-header-action",onClick:T,"aria-label":"Close",children:d(Xt,{size:24})})]})]}),d("hr",{className:"wi-divider"})]}),v("div",{className:"wi-view-container",children:[Y==="wallet"&&tn,Y==="qr"&&rn,Y==="portfolio"&&on]}),ko&&Y!=="portfolio"&&d("div",{className:"wi-sticky-footer",children:d("div",{className:"wi-footer",children:ko})})]});return a?v(Tt.Portal,{children:[i&&d(Tt.Overlay,{className:"wi-drawer-overlay"}),v(Tt.Content,{className:V("wi-drawer-content",r),"data-theme":l,style:ie,"data-direction":c,"data-no-balance":!p||void 0,"data-view":Y,children:[d(Tt.Title,{className:"wi-sr-only",children:"My Wallet"}),Lo]})]}):v(fo,{children:[i&&s&&d("div",{className:"wi-drawer-overlay",onClick:T}),d(Et.Portal,{children:d(Et.Content,{align:e,sideOffset:t,className:V("wi-popover-content",r),"data-theme":l,style:ie,"data-no-balance":!p||void 0,"data-view":Y,children:Lo})})]})}import*as Sr from"react";function Or({position:e="top",children:t}){let{setNavContent:r,setNavPosition:o}=me();return Sr.useEffect(()=>(r(t),o(e),()=>r(null)),[t,e,r,o]),null}import*as Wr from"react";function Dr({children:e}){let{setFooterContent:t}=me();return Wr.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}P(`[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)}
7
7
  `);P(`.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}
8
8
  `);P(`@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}}
9
- `);P(`.wi-popover-content{z-index:100001;width:343px;border-radius:24px;border:4px 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-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:auto;left:0;right:0;width:100%;max-height:60vh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:85dvh}.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-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.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-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;height:48px;padding:0 16px;border:none;border-radius:12px;background:var(--wi-surface-default);color:var(--wi-texticon-primary);font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;cursor:pointer;transition:opacity .15s ease,background .15s ease}.wi-disconnect-btn:hover{opacity:.85}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;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-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:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:16px 24px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .wi-qr-section{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-qr-section::-webkit-scrollbar{width:4px}.wi-qr-section::-webkit-scrollbar-track{background:transparent}.wi-qr-section::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-qr-section::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-qr-section::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-qr-section::-webkit-scrollbar-thumb:hover{background:#0003}.wi-qr-card{display:flex;flex-direction:column;align-items:center;gap:20px;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:16px;font-weight:600;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}
9
+ `);P(`.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-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:auto;left:0;right:0;width:100%;max-height:60vh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:85dvh}.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-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:1;min-height:0;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding:16px 24px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .wi-qr-section{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-qr-section::-webkit-scrollbar{width:4px}.wi-qr-section::-webkit-scrollbar-track{background:transparent}.wi-qr-section::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-qr-section::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-qr-section::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-qr-section::-webkit-scrollbar-thumb:hover{background:#0003}.wi-qr-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;flex:1;min-height:0;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}
10
10
  `);P(`.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}
11
- `);import{jsx as uo}from"react/jsx-runtime";var Ei="https://terms.crosstoken.io/docs/cross-terms-of-use",Mi="https://terms.crosstoken.io/docs/nexus-privacy-policy";function _i({env:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:o,modal:n,showBalance:c=!1,showForgeToken:a=!1,showGameToken:l=!0,showQR:s=!0,qrLogoSrc:i,walletAddress:p,accountName:m,profileImageUrl:f,connectorId:h,connectorName:v,connectorIconUrl:g,preferredTokens:u=[],onSelectWallet:k,onCopyAddress:R,onDisconnect:T,disconnectLabel:L="Disconnect",termsUrl:_=Ei,termsLabel:w="Terms of Service",privacyUrl:y=Mi,privacyLabel:S="Privacy Policy",open:N,onOpenChange:F,showPortfolio:j=!1,portfolioTitle:ie="My Portfolio",showTotalAssets:be=!0,totalAssetsLabel:Ge="Total Assets USD",sendTransaction:nt,onOutlink:G,style:Ze,children:Ke}){let it=Q(e),at=h?bt[h]:void 0,st=v??at?.name,lt=g??at?.iconUrl,ve=Oe(`(max-width: ${r}px)`),ce=o??(c?"right":"bottom"),Ee=n??!1,pe=N!==void 0,[ct,pt]=Y.useState(!1),ae=pe?N:ct,Me=Y.useCallback(Se=>{pe||pt(Se),F?.(Se)},[pe,F]),dt=Y.useCallback(()=>Me(!1),[Me]),[ye,mt]=Y.useState(null),[de,ft]=Y.useState("top"),[ut,Vt]=Y.useState(null),[_e,Ye]=Y.useState("wallet");Y.useEffect(()=>{ae||Ye("wallet")},[ae]);let ke=Y.useMemo(()=>({env:it,theme:t,isMobile:ve,open:ae,drawerDirection:ce,modal:Ee,showBalance:c,showForgeToken:a,showGameToken:l,showQR:s,qrLogoSrc:i,walletAddress:p,accountName:m,profileImageUrl:f,connectorName:st,connectorIconUrl:lt,preferredTokens:u,close:dt,onSelectWallet:k,onCopyAddress:R,onDisconnect:T,disconnectLabel:L,termsUrl:_,termsLabel:w,privacyUrl:y,privacyLabel:S,portalStyle:Ze,navContent:ye,navPosition:de,setNavContent:mt,setNavPosition:ft,footerContent:ut,setFooterContent:Vt,view:_e,setView:Ye,showPortfolio:j,portfolioTitle:ie,showTotalAssets:be,totalAssetsLabel:Ge,sendTransaction:nt,onOutlink:G}),[it,t,ve,ae,ce,Ee,c,a,l,s,i,p,m,f,st,lt,u,dt,k,R,T,L,_,w,y,S,Ze,ye,de,ut,_e,j,ie,be,Ge,nt,G]);return uo(Gt.Provider,{value:ke,children:ve?uo(Ti.Root,{direction:ce,open:ae,onOpenChange:Me,noBodyStyles:!0,children:Ke},"drawer"):uo(Ar.Root,{open:ae,onOpenChange:Me,children:Ke},"popover")})}var qe=Object.assign(_i,{Trigger:Zo,Content:_r,Nav:Or,Footer:Dr});import*as le from"react";import*as Kr from"@radix-ui/react-dialog";import{Drawer as Bi}from"vaul";import{createContext as Si,useContext as Oi}from"react";var Mt=Si(null);function tt(){let e=Oi(Mt);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as Fr,useEffect as Wi,useCallback as Di}from"react";function _t(){let[e,t]=Fr([]),[r,o]=Fr(!0);Wi(()=>{if(typeof window>"u"){o(!1);return}let c=[],a=s=>{let{info:i}=s.detail;i?.rdns&&!c.some(p=>p.rdns===i.rdns)&&(c.push({rdns:i.rdns,name:i.name,icon:i.icon}),t([...c]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(l)}},[]);let n=Di(c=>e.some(a=>a.rdns===c),[e]);return{wallets:e,isDetected:n,isLoading:r}}import*as Vr from"@radix-ui/react-dialog";import{Drawer as Ai}from"vaul";import{jsx as Br}from"react/jsx-runtime";function Hr({asChild:e,children:t}){let{isMobile:r}=tt(),o=r?Ai.Trigger:Vr.Trigger;return Br(o,{asChild:e??t!=null,children:t??Br("button",{type:"button",children:"Connect Wallet"})})}import*as we from"@radix-ui/react-dialog";import{Drawer as Ot}from"vaul";import{jsx as D,jsxs as ze}from"react/jsx-runtime";function St(){return ze("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),D("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 Ur(){return ze("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[ze("g",{clipPath:"url(#clip0_1331_27065)",children:[D("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"}),D("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"}),D("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"}),D("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"}),D("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"}),D("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),D("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"})]}),D("defs",{children:D("clipPath",{id:"clip0_1331_27065",children:D("rect",{width:"40",height:"40",fill:"white"})})})]})}function $r(){return ze("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[D("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),D("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"}),D("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),D("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 ze("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ze("g",{clipPath:"url(#clip0_1185_7785)",children:[D("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"}),D("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"})]}),D("defs",{children:D("clipPath",{id:"clip0_1185_7785",children:D("rect",{width:"28",height:"28",fill:"white"})})})]})}function zr(){return D("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:D("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:St,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:St},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:St,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:Ur,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:$r,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:qr,badge:"For SHOP"}};function je(e){return go[e]}import{Fragment as Fi,jsx as C,jsxs as z}from"react/jsx-runtime";function jr({wallet:e,detected:t,onConnect:r}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}r()},n=e.icon;return z("button",{type:"button",className:"wcm-wallet-item",onClick:o,children:[z("div",{className:"wcm-wallet-item-left",children:[C("div",{className:"wcm-wallet-icon",children:C(n,{})}),z("div",{className:"wcm-wallet-info",children:[z("div",{className:"wcm-wallet-name-row",children:[C("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&C("span",{className:"wcm-wallet-badge",children:e.badge})]}),C("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?C("span",{className:"wcm-installed-label",children:"Installed"}):C("span",{className:"wcm-install-btn",children:"Install"}))]})}function Gr(){let{wallets:e,activeWalletIds:t,isDetected:r,close:o,isMobile:n}=tt(),c=t.filter(s=>{let i=je(s).visibility;return!i||i==="always"?!0:i==="desktop-only"?!n:i==="mobile-only"?n:!0}),a=c.filter(s=>je(s).featured),l=c.filter(s=>!je(s).featured);return z(Fi,{children:[z("div",{className:"wcm-header",children:[z("div",{className:"wcm-header-text",children:[C("h2",{className:"wcm-title",children:"Connect Wallet"}),C("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),C("button",{type:"button",className:"wcm-close-btn",onClick:o,children:C(zr,{})})]}),C("div",{className:"wcm-divider"}),z("div",{className:"wcm-body",children:[a.map(s=>{let i=je(s),p=i.rdns?r(i.rdns):!1;return C(jr,{wallet:i,detected:p,onConnect:()=>{e[s]?.(),o()}},s)}),a.length>0&&l.length>0&&z("div",{className:"wcm-separator",children:[C("div",{className:"wcm-separator-line"}),C("span",{className:"wcm-separator-text",children:"or"}),C("div",{className:"wcm-separator-line"})]}),C("div",{className:"wcm-wallet-list",children:l.map(s=>{let i=je(s),p=i.rdns?r(i.rdns):!1;return C(jr,{wallet:i,detected:p,onConnect:()=>{e[s]?.(),o()}},s)})}),z("div",{className:"wcm-help",children:[C("p",{className:"wcm-help-title",children:"Wallet not detected?"}),z("ul",{className:"wcm-help-list",children:[C("li",{children:"Ensure your wallet extension is installed and unlocked"}),C("li",{children:"Try refreshing the page"}),C("li",{children:"Some wallets may require you to first open the extension"}),C("li",{children:"You can try clicking the wallet anyway"})]})]}),C("div",{className:"wcm-divider"}),C("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 Zr({className:e}){let{isMobile:t,theme:r,portalStyle:o}=tt();return t?z(Ot.Portal,{children:[C(Ot.Overlay,{className:"wcm-overlay"}),z(Ot.Content,{className:V("wcm-drawer-content",e),"data-theme":r,style:o,children:[C(Ot.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),C("div",{className:"wcm-drawer-handle"}),C("div",{className:"wcm-drawer-body",children:C(Gr,{})})]})]}):z(we.Portal,{children:[C(we.Overlay,{className:"wcm-overlay"}),z(we.Content,{className:V("wcm-dialog-content",e),"data-theme":r,style:o,children:[C(we.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),C("div",{className:"wcm-dialog-body",children:C(Gr,{})})]})]})}P(`[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))}
11
+ `);import{jsx as uo}from"react/jsx-runtime";var Ti="https://terms.crosstoken.io/docs/cross-terms-of-use",Ei="https://terms.crosstoken.io/docs/nexus-privacy-policy";function Mi({env:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:o,modal:n,showBalance:l=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:c=!0,qrLogoSrc:i,walletAddress:p,accountName:m,profileImageUrl:g,connectorId:f,connectorName:b,connectorIconUrl:w,preferredTokens:u=[],onSelectWallet:k,onCopyAddress:R,onDisconnect:T,disconnectLabel:L="Disconnect",termsUrl:_=Ti,termsLabel:h="Terms of Service",privacyUrl:y=Ei,privacyLabel:S="Privacy Policy",open:N,onOpenChange:F,showPortfolio:j=!1,portfolioTitle:ie="My Portfolio",showTotalAssets:be=!0,totalAssetsLabel:Ze="Total Assets USD",sendTransaction:Ge,onOutlink:Y,style:Ke,children:Ye}){let Vt=Q(e),at=f?bt[f]:void 0,st=b??at?.name,lt=w??at?.iconUrl,ve=Oe(`(max-width: ${r}px)`),ce=o??(l?"right":"bottom"),Ee=n??!1,pe=N!==void 0,[ct,pt]=K.useState(!1),ae=pe?N:ct,Me=K.useCallback(Se=>{pe||pt(Se),F?.(Se)},[pe,F]),dt=K.useCallback(()=>Me(!1),[Me]),[ye,mt]=K.useState(null),[de,ft]=K.useState("top"),[ut,Ht]=K.useState(null),[_e,Qe]=K.useState("wallet");K.useEffect(()=>{ae||Qe("wallet")},[ae]);let ke=K.useMemo(()=>({env:Vt,theme:t,isMobile:ve,open:ae,drawerDirection:ce,modal:Ee,showBalance:l,showForgeToken:a,showGameToken:s,showQR:c,qrLogoSrc:i,walletAddress:p,accountName:m,profileImageUrl:g,connectorName:st,connectorIconUrl:lt,preferredTokens:u,close:dt,onSelectWallet:k,onCopyAddress:R,onDisconnect:T,disconnectLabel:L,termsUrl:_,termsLabel:h,privacyUrl:y,privacyLabel:S,portalStyle:Ke,navContent:ye,navPosition:de,setNavContent:mt,setNavPosition:ft,footerContent:ut,setFooterContent:Ht,view:_e,setView:Qe,showPortfolio:j,portfolioTitle:ie,showTotalAssets:be,totalAssetsLabel:Ze,sendTransaction:Ge,onOutlink:Y}),[Vt,t,ve,ae,ce,Ee,l,a,s,c,i,p,m,g,st,lt,u,dt,k,R,T,L,_,h,y,S,Ke,ye,de,ut,_e,j,ie,be,Ze,Ge,Y]);return uo(Gt.Provider,{value:ke,children:ve?uo(Ri.Root,{direction:ce,open:ae,onOpenChange:Me,noBodyStyles:!0,children:Ye},"drawer"):uo(Ar.Root,{open:ae,onOpenChange:Me,children:Ye},"popover")})}var qe=Object.assign(Mi,{Trigger:Go,Content:_r,Nav:Or,Footer:Dr});import*as le from"react";import*as Kr from"@radix-ui/react-dialog";import{Drawer as Fi}from"vaul";import{createContext as _i,useContext as Si}from"react";var Mt=_i(null);function rt(){let e=Si(Mt);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as Fr,useEffect as Oi,useCallback as Wi}from"react";function _t(){let[e,t]=Fr([]),[r,o]=Fr(!0);Oi(()=>{if(typeof window>"u"){o(!1);return}let l=[],a=c=>{let{info:i}=c.detail;i?.rdns&&!l.some(p=>p.rdns===i.rdns)&&(l.push({rdns:i.rdns,name:i.name,icon:i.icon}),t([...l]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let n=Wi(l=>e.some(a=>a.rdns===l),[e]);return{wallets:e,isDetected:n,isLoading:r}}import*as Vr from"@radix-ui/react-dialog";import{Drawer as Di}from"vaul";import{jsx as Br}from"react/jsx-runtime";function Hr({asChild:e,children:t}){let{isMobile:r}=rt(),o=r?Di.Trigger:Vr.Trigger;return Br(o,{asChild:e??t!=null,children:t??Br("button",{type:"button",children:"Connect Wallet"})})}import*as we from"@radix-ui/react-dialog";import{Drawer as Ot}from"vaul";import{jsx as D,jsxs as ze}from"react/jsx-runtime";function St(){return ze("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),D("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 Ur(){return ze("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[ze("g",{clipPath:"url(#clip0_1331_27065)",children:[D("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"}),D("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"}),D("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"}),D("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"}),D("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"}),D("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),D("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"})]}),D("defs",{children:D("clipPath",{id:"clip0_1331_27065",children:D("rect",{width:"40",height:"40",fill:"white"})})})]})}function $r(){return ze("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[D("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),D("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"}),D("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),D("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 ze("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ze("g",{clipPath:"url(#clip0_1185_7785)",children:[D("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"}),D("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"})]}),D("defs",{children:D("clipPath",{id:"clip0_1185_7785",children:D("rect",{width:"28",height:"28",fill:"white"})})})]})}function zr(){return D("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:D("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:St,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:St},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:St,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:Ur,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:$r,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:qr,badge:"For SHOP"}};function je(e){return go[e]}import{Fragment as Ai,jsx as C,jsxs as z}from"react/jsx-runtime";function jr({wallet:e,detected:t,onConnect:r}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}r()},n=e.icon;return z("button",{type:"button",className:"wcm-wallet-item",onClick:o,children:[z("div",{className:"wcm-wallet-item-left",children:[C("div",{className:"wcm-wallet-icon",children:C(n,{})}),z("div",{className:"wcm-wallet-info",children:[z("div",{className:"wcm-wallet-name-row",children:[C("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&C("span",{className:"wcm-wallet-badge",children:e.badge})]}),C("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?C("span",{className:"wcm-installed-label",children:"Installed"}):C("span",{className:"wcm-install-btn",children:"Install"}))]})}function Zr(){let{wallets:e,activeWalletIds:t,isDetected:r,close:o,isMobile:n}=rt(),l=t.filter(c=>{let i=je(c).visibility;return!i||i==="always"?!0:i==="desktop-only"?!n:i==="mobile-only"?n:!0}),a=l.filter(c=>je(c).featured),s=l.filter(c=>!je(c).featured);return z(Ai,{children:[z("div",{className:"wcm-header",children:[z("div",{className:"wcm-header-text",children:[C("h2",{className:"wcm-title",children:"Connect Wallet"}),C("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),C("button",{type:"button",className:"wcm-close-btn",onClick:o,children:C(zr,{})})]}),C("div",{className:"wcm-divider"}),z("div",{className:"wcm-body",children:[a.map(c=>{let i=je(c),p=i.rdns?r(i.rdns):!1;return C(jr,{wallet:i,detected:p,onConnect:()=>{e[c]?.(),o()}},c)}),a.length>0&&s.length>0&&z("div",{className:"wcm-separator",children:[C("div",{className:"wcm-separator-line"}),C("span",{className:"wcm-separator-text",children:"or"}),C("div",{className:"wcm-separator-line"})]}),C("div",{className:"wcm-wallet-list",children:s.map(c=>{let i=je(c),p=i.rdns?r(i.rdns):!1;return C(jr,{wallet:i,detected:p,onConnect:()=>{e[c]?.(),o()}},c)})}),z("div",{className:"wcm-help",children:[C("p",{className:"wcm-help-title",children:"Wallet not detected?"}),z("ul",{className:"wcm-help-list",children:[C("li",{children:"Ensure your wallet extension is installed and unlocked"}),C("li",{children:"Try refreshing the page"}),C("li",{children:"Some wallets may require you to first open the extension"}),C("li",{children:"You can try clicking the wallet anyway"})]})]}),C("div",{className:"wcm-divider"}),C("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 Gr({className:e}){let{isMobile:t,theme:r,portalStyle:o}=rt();return t?z(Ot.Portal,{children:[C(Ot.Overlay,{className:"wcm-overlay"}),z(Ot.Content,{className:V("wcm-drawer-content",e),"data-theme":r,style:o,children:[C(Ot.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),C("div",{className:"wcm-drawer-handle"}),C("div",{className:"wcm-drawer-body",children:C(Zr,{})})]})]}):z(we.Portal,{children:[C(we.Overlay,{className:"wcm-overlay"}),z(we.Content,{className:V("wcm-dialog-content",e),"data-theme":r,style:o,children:[C(we.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),C("div",{className:"wcm-dialog-body",children:C(Zr,{})})]})]})}P(`[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))}
12
12
  `);P(`.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}
13
13
  `);P(`@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)}}
14
- `);import{jsx as ot}from"react/jsx-runtime";function Vi({wallets:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:o="bottom",dialogWidth:n,drawerMaxWidth:c,drawerMinWidth:a,style:l,open:s,onOpenChange:i,children:p}){let m=Oe(`(max-width: ${r}px)`),[f,h]=le.useState(!1),v=s!==void 0,g=v?s:f,u=le.useCallback(y=>{v||h(y),i?.(y)},[v,i]),k=le.useCallback(()=>u(!1),[u]),{isDetected:R}=_t(),T=le.useMemo(()=>Object.keys(e),[e]),L=le.useMemo(()=>{let y={};return n&&(y["--wcm-dialog-width"]=n),c&&(y["--wcm-drawer-max-width"]=c),a&&(y["--wcm-drawer-min-width"]=a),{...y,...l}},[n,c,a,l]),_=le.useMemo(()=>({theme:t,isMobile:m,open:g,setOpen:u,close:k,wallets:e,activeWalletIds:T,isDetected:R,portalStyle:L}),[t,m,g,u,k,e,T,R,L]),w=ot("div",{"data-theme":t,style:L,children:p});return m?ot(Mt.Provider,{value:_,children:ot(Bi.Root,{direction:o,open:g,onOpenChange:u,noBodyStyles:!0,children:w},"drawer")}):ot(Mt.Provider,{value:_,children:ot(Kr.Root,{open:g,onOpenChange:u,children:w})})}var Yr=Object.assign(Vi,{Trigger:Hr,Content:Zr});var Hi='<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>',Ui='<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>',$i='<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>',qi='<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>',zi='<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 rt(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Wt=rt(Hi),Dt=rt(Ui),At=rt($i),Ft=rt(qi),Bt=rt(zi);import{jsx as xe,jsxs as wo}from"react/jsx-runtime";function Xr({isConnecting:e,address:t,provider:r,providerName:o,accountName:n,onConnect:c,onDisconnect:a,onCopy:l,onSelectWallet:s,label:i="Connect Wallet",connectingLabel:p="Connecting...",disconnectLabel:m,className:f,theme:h="dark",env:v,showBalance:g=!0,showPortfolio:u,drawerDirection:k,modal:R,connectorId:T,style:L,sendTransaction:_}){if(e)return wo("button",{type:"button",disabled:!0,className:f,style:f?void 0:{...he.button,...he.buttonLoading},"aria-busy":"true",children:[xe("style",{children:Ki}),xe("span",{style:he.spinner,"aria-hidden":"true"}),p]});if(t){let w=o??Zi(r),y=r?ji[r]:void 0;return wo(qe,{env:v,theme:h,drawerDirection:k,modal:R,showBalance:g,showPortfolio:u,walletAddress:t,accountName:n,connectorId:T,onSelectWallet:s,onCopyAddress:l?(S,N)=>{N&&l()}:void 0,onDisconnect:a,disconnectLabel:m,style:L,sendTransaction:_,children:[xe(qe.Trigger,{asChild:!0,children:wo("button",{type:"button",className:f,style:f?void 0:he.connectedBtn,"aria-label":`Connected with ${w}: ${Qr(t)}`,children:[y?xe("img",{src:y,alt:"",width:20,height:20,style:he.connectedIcon}):xe("span",{style:he.connectedIconPlaceholder,"aria-hidden":"true"}),xe("span",{style:he.connectedAddress,children:Qr(t)})]})}),xe(qe.Content,{align:"end",sideOffset:8})]})}return xe("button",{type:"button",onClick:c,className:f,style:f?void 0:he.button,children:i})}var ji={google:Ft,apple:Bt,cross:Wt,metamask:Dt,binance:At},Gi={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Zi(e){return e?Gi[e]:"Wallet"}function Qr(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Ki="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",he={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"}};export{Bt as APPLE_ICON,Po as AppLauncher,Wo as AppLauncherContent,_o as AppLauncherTrigger,At as BINANCE_ICON,bt as CONNECTOR_REGISTRY,Wt as CROSSX_ICON,Xr as ConnectButton,Zt as ConnectorId,Ft as GOOGLE_ICON,Dt as METAMASK_ICON,oo as TOKEN_STATS_QUERY_KEY,to as USER_BALANCE_QUERY_KEY,go as WALLET_REGISTRY,Yr as WalletConnectModal,qe as WalletInfo,Mr as WalletPortfolio,$e as WalletPortfolioBody,Q as resolveEnvironment,ht as useGlobalMenu,Fe as useTokenBalance,Be as useTokenStats,_t as useWalletDetect};
14
+ `);import{jsx as nt}from"react/jsx-runtime";function Bi({wallets:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:o="bottom",dialogWidth:n,drawerMaxWidth:l,drawerMinWidth:a,style:s,open:c,onOpenChange:i,children:p}){let m=Oe(`(max-width: ${r}px)`),[g,f]=le.useState(!1),b=c!==void 0,w=b?c:g,u=le.useCallback(y=>{b||f(y),i?.(y)},[b,i]),k=le.useCallback(()=>u(!1),[u]),{isDetected:R}=_t(),T=le.useMemo(()=>Object.keys(e),[e]),L=le.useMemo(()=>{let y={};return n&&(y["--wcm-dialog-width"]=n),l&&(y["--wcm-drawer-max-width"]=l),a&&(y["--wcm-drawer-min-width"]=a),{...y,...s}},[n,l,a,s]),_=le.useMemo(()=>({theme:t,isMobile:m,open:w,setOpen:u,close:k,wallets:e,activeWalletIds:T,isDetected:R,portalStyle:L}),[t,m,w,u,k,e,T,R,L]),h=nt("div",{"data-theme":t,style:L,children:p});return m?nt(Mt.Provider,{value:_,children:nt(Fi.Root,{direction:o,open:w,onOpenChange:u,noBodyStyles:!0,children:h},"drawer")}):nt(Mt.Provider,{value:_,children:nt(Kr.Root,{open:w,onOpenChange:u,children:h})})}var Yr=Object.assign(Bi,{Trigger:Hr,Content:Gr});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>',Hi='<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>',Ui='<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>',qi='<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 it(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Wt=it(Vi),Dt=it(Hi),At=it(Ui),Ft=it($i),Bt=it(qi);import{jsx as xe,jsxs as wo}from"react/jsx-runtime";function Xr({isConnecting:e,address:t,provider:r,providerName:o,accountName:n,onConnect:l,onDisconnect:a,onCopy:s,onSelectWallet:c,label:i="Connect Wallet",connectingLabel:p="Connecting...",disconnectLabel:m,className:g,theme:f="dark",env:b,showBalance:w=!0,showPortfolio:u,drawerDirection:k,modal:R,connectorId:T,style:L,sendTransaction:_}){if(e)return wo("button",{type:"button",disabled:!0,className:g,style:g?void 0:{...he.button,...he.buttonLoading},"aria-busy":"true",children:[xe("style",{children:Gi}),xe("span",{style:he.spinner,"aria-hidden":"true"}),p]});if(t){let h=o??Zi(r),y=r?zi[r]:void 0;return wo(qe,{env:b,theme:f,drawerDirection:k,modal:R,showBalance:w,showPortfolio:u,walletAddress:t,accountName:n,connectorId:T,onSelectWallet:c,onCopyAddress:s?(S,N)=>{N&&s()}:void 0,onDisconnect:a,disconnectLabel:m,style:L,sendTransaction:_,children:[xe(qe.Trigger,{asChild:!0,children:wo("button",{type:"button",className:g,style:g?void 0:he.connectedBtn,"aria-label":`Connected with ${h}: ${Qr(t)}`,children:[y?xe("img",{src:y,alt:"",width:20,height:20,style:he.connectedIcon}):xe("span",{style:he.connectedIconPlaceholder,"aria-hidden":"true"}),xe("span",{style:he.connectedAddress,children:Qr(t)})]})}),xe(qe.Content,{align:"end",sideOffset:8})]})}return xe("button",{type:"button",onClick:l,className:g,style:g?void 0:he.button,children:i})}var zi={google:Ft,apple:Bt,cross:Wt,metamask:Dt,binance:At},ji={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Zi(e){return e?ji[e]:"Wallet"}function Qr(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Gi="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",he={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"}};export{Bt as APPLE_ICON,Po as AppLauncher,Wo as AppLauncherContent,_o as AppLauncherTrigger,At as BINANCE_ICON,bt as CONNECTOR_REGISTRY,Wt as CROSSX_ICON,Xr as ConnectButton,Kt as ConnectorId,Ft as GOOGLE_ICON,Dt as METAMASK_ICON,ro as TOKEN_STATS_QUERY_KEY,oo as USER_BALANCE_QUERY_KEY,go as WALLET_REGISTRY,Yr as WalletConnectModal,qe as WalletInfo,Mr as WalletPortfolio,$e as WalletPortfolioBody,Q as resolveEnvironment,ht as useGlobalMenu,Fe as useTokenBalance,Be as useTokenStats,_t as useWalletDetect};