@nexus-cross/dapp-ui 1.0.1 → 1.0.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -6
- package/dist/index.d.cts +54 -3
- package/dist/index.d.ts +54 -3
- package/dist/index.js +15 -14
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var ia=Object.create;var Ht=Object.defineProperty;var sa=Object.getOwnPropertyDescriptor;var la=Object.getOwnPropertyNames;var ca=Object.getPrototypeOf,da=Object.prototype.hasOwnProperty;var pa=(e,t)=>{for(var n in t)Ht(e,n,{get:t[n],enumerable:!0})},cn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of la(t))!da.call(e,o)&&o!==n&&Ht(e,o,{get:()=>t[o],enumerable:!(r=sa(t,o))||r.enumerable});return e};var V=(e,t,n)=>(n=e!=null?ia(ca(e)):{},cn(t||!e||!e.__esModule?Ht(n,"default",{value:e,enumerable:!0}):n,e)),ma=e=>cn(Ht({},"__esModule",{value:!0}),e);var xi={};pa(xi,{APPLE_ICON:()=>Wt,AppLauncher:()=>bo,AppLauncherContent:()=>yo,AppLauncherTrigger:()=>vo,BINANCE_ICON:()=>Ot,CONNECTOR_REGISTRY:()=>yt,CROSSX_ICON:()=>_t,ConnectButton:()=>Xo,ConnectorId:()=>Zt,GOOGLE_ICON:()=>Dt,METAMASK_ICON:()=>At,SendPage:()=>Lt,TOKEN_STATS_QUERY_KEY:()=>Xt,USER_BALANCE_QUERY_KEY:()=>Yt,WALLET_REGISTRY:()=>fo,WalletConnectModal:()=>Qo,WalletInfo:()=>Je,WalletPortfolio:()=>Zo,WalletPortfolioBody:()=>Ye,resolveEnvironment:()=>ae,useGlobalMenu:()=>vt,useTokenBalance:()=>Ge,useTokenStats:()=>Ke,useWalletDetect:()=>Et});module.exports=ma(xi);function ae(e){if(e)return dn(e);let t=typeof process<"u"?process.env?.NEXT_PUBLIC_CROSSX_ENVIRONMENT:void 0;return dn(t)}function dn(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var it=V(require("react"),1),pn=V(require("@radix-ui/react-popover"),1),mn=require("vaul");var $t=require("react"),xo=(0,$t.createContext)(null);function zt(){let e=(0,$t.useContext)(xo);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var Ut=require("react");function at(e){let[t,n]=(0,Ut.useState)(!1);return(0,Ut.useEffect)(()=>{let r=window.matchMedia(e);n(r.matches);let o=l=>n(l.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),t}function E(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}E(`[data-theme=dark]{--al-bg: var(--cck-surface-bg, #1e232e);--al-bg-hover: var(--cck-surface-default, #252b39);--al-text: var(--cck-texticon-primary, hsla(200, 19%, 94%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(200, 10%, 70%, 1));--al-border: var(--cck-border-subtle, #3b4153);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #123f3c;--al-badge-text: hsla(168, 85%, 47%, 1);--al-badge-new-text: #000;--al-drawer-overlay: rgba(0, 0, 0, .6)}[data-theme=light]{--al-bg: var(--cck-surface-bg, #fff);--al-bg-hover: var(--cck-surface-default, #f3f6f8);--al-text: var(--cck-texticon-primary, hsla(221, 21%, 15%, 1));--al-text-secondary: var(--cck-texticon-secondary, hsla(220, 10%, 40%, 1));--al-border: var(--cck-border-subtle, #ecf0f2);--al-shadow: 0 2px 8px -1px rgba(0, 0, 0, .15);--al-badge-bg: #cdf4ed;--al-badge-text: hsla(170, 82%, 32%, 1);--al-badge-new-text: #fff;--al-drawer-overlay: rgba(0, 0, 0, .4)}
|
|
2
2
|
`);E(`.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
|
`);E(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
|
|
4
4
|
`);E(`.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
|
-
`);E("");var Pt=require("react/jsx-runtime");function ro({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:o,children:n}){let p=Ve(`(max-width: ${r}px)`),[s,c]=He.useState(!1),l=He.useCallback(()=>c(!1),[]),a=Q(e),d=He.useMemo(()=>({env:a,theme:t,isMobile:p,open:s,domain:o,close:l}),[a,t,p,s,o,l]);return(0,Pt.jsx)(oo.Provider,{value:d,children:p?(0,Pt.jsx)(Uo.Drawer.Root,{direction:"right",open:s,onOpenChange:c,noBodyStyles:!0,children:n},"drawer"):(0,Pt.jsx)(Ho.Root,{open:s,onOpenChange:c,children:n},"popover")})}var jo=W(require("@radix-ui/react-popover"),1),Go=require("vaul");var j=require("react/jsx-runtime");function $o({size:e=18}){return(0,j.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,j.jsx)("rect",{width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),(0,j.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function qo(){return(0,j.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,j.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function zo(){return(0,j.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,j.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Je=require("react/jsx-runtime");function no({asChild:e,children:t}){let{isMobile:r,theme:o}=Nt(),n=t!=null,p=e??!0,s=n?t:(0,Je.jsx)("button",{type:"button",className:"al-trigger-btn","data-theme":o,children:(0,Je.jsx)($o,{size:r?12:18})});return r?(0,Je.jsx)(Go.Drawer.Trigger,{asChild:p,children:s}):(0,Je.jsx)(jo.Trigger,{asChild:p,children:s})}var Ie=W(require("react"),1),Rt=W(require("@radix-ui/react-popover"),1),Ne=require("vaul");var Ko=require("@tanstack/react-query");var Zo={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 et(e){let t=Q(e);return(0,Ko.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:r})=>{let o=await fetch(Zo[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 $(...e){return e.filter(Boolean).join(" ")}var F=require("react/jsx-runtime");function io({align:e="end",sideOffset:t=12,className:r}){let{env:o,theme:n,isMobile:p,domain:s,close:c}=Nt(),{data:l}=et(o),a=Ie.useMemo(()=>(l?.items??[]).sort((u,C)=>u.order-C.order),[l]),d=8,m=Ie.useRef(null),f=Ie.useCallback(u=>{m.current={x:u.clientX,y:u.clientY}},[]),x=typeof window<"u"?window.location.pathname:"",v=Ie.useCallback((u,C)=>{if(m.current){let N=u.clientX-m.current.x,D=u.clientY-m.current.y;if(m.current=null,Math.abs(N)>d||Math.abs(D)>d)return}let M=C.url[o]??C.url.production,_=Yo(M,s);if(!_)try{let N=new URL(M).pathname;if(x===N||x.startsWith(N+"/")){c();return}}catch{}_?window.open(M,"_blank","noopener,noreferrer"):window.location.href=M,c()},[o,s,c,x]),g=(0,F.jsx)("div",{className:"al-grid","data-theme":n,children:a.map(u=>{let C=u.url[o]??u.url.production,M=Yo(C,s),_=!1;if(!M)try{let N=new URL(C).pathname;_=x===N||x.startsWith(N+"/")}catch{_=!1}return(0,F.jsxs)("button",{type:"button",className:"al-grid-item","data-active":_||void 0,onPointerDown:f,onClick:N=>v(N,u),children:[(0,F.jsxs)("div",{className:"al-grid-item-left",children:[(0,F.jsx)("div",{className:"al-grid-item-icon",children:(0,F.jsx)("img",{src:u.iconUrl,alt:u.label,width:24,height:24,loading:"lazy"})}),(0,F.jsx)("span",{className:"al-grid-item-label",children:u.label}),u.isNew&&(0,F.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,F.jsx)("div",{className:"al-grid-item-right",children:u.badge&&(0,F.jsx)("span",{className:"al-badge",children:u.badge})})]},u.id)})});return p?(0,F.jsxs)(Ne.Drawer.Portal,{children:[(0,F.jsx)(Ne.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,F.jsxs)(Ne.Drawer.Content,{className:$("al-drawer-content",r),"data-theme":n,children:[(0,F.jsxs)("div",{className:"al-drawer-header",children:[(0,F.jsx)(Ne.Drawer.Close,{className:"al-drawer-close",children:(0,F.jsx)(qo,{})}),(0,F.jsx)(Ne.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,F.jsx)(Ne.Drawer.Close,{className:"al-drawer-close",children:(0,F.jsx)(zo,{})})]}),(0,F.jsx)("div",{className:"al-drawer-body",children:g})]})]}):(0,F.jsx)(Rt.Portal,{children:(0,F.jsx)(Rt.Content,{align:e,sideOffset:t,className:$("al-popover-content",r),"data-theme":n,children:g})})}function Yo(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}var K=W(require("react"),1),pn=W(require("@radix-ui/react-popover"),1),dn=require("vaul");var Tt=require("react"),ao=(0,Tt.createContext)(null);function me(){let e=(0,Tt.useContext)(ao);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Et=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Et||{}),tt={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};var lr=W(require("@radix-ui/react-popover"),1),cr=require("vaul");var R=require("react/jsx-runtime");function Qo({size:e=16,className:t}){return(0,R.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,R.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,R.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function so({size:e=16,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function lo({size:e=16,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function co({size:e=24,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xo({size:e=20,className:t}){return(0,R.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,R.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,R.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Jo({size:e=20,className:t}){return(0,R.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,R.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function er({size:e=20,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function tr({size:e=20,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function or({size:e=20,className:t}){return(0,R.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,R.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function rr({size:e=16,className:t}){return(0,R.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,R.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,R.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function nr({size:e=16,className:t}){return(0,R.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,R.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,R.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ir({size:e=42,className:t}){return(0,R.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,R.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}var fe=W(require("bignumber.js"),1);function Bn(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 Mt(e,t){if(!e||e==="0")return"0.00";let r=new fe.default(e).shiftedBy(-t),o=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(o,fe.default.ROUND_DOWN)}function Ue(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function po(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 ar(e,t,r){let n=new fe.default(e).shiftedBy(-t).multipliedBy(new fe.default(r));return n.isZero()||n.isNaN()?"$0.00":`$${(n.integerValue(fe.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?n.decimalPlaces(2,fe.default.ROUND_DOWN):n.decimalPlaces(4,fe.default.ROUND_DOWN)).toFormat()}`}function sr(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 s=Number(r);if(!Number.isFinite(s)||s===0)return{displayValue:"0",isLowerBound:!1};r=Bn(s.toFixed(18))}let[o="0",n=""]=r.split(".");if(Number(o)>=1){let s=n.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${s}`,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}}var Pe=require("react/jsx-runtime");function pr({asChild:e,className:t,children:r}){let{isMobile:o,theme:n,walletAddress:p}=me(),s=r!=null,c=e??!0,l=s?r:(0,Pe.jsxs)("button",{type:"button",className:$("wi-trigger-btn",t),"data-theme":n,"data-mobile":o||void 0,children:[(0,Pe.jsx)(Qo,{size:o?14:16}),(0,Pe.jsx)("span",{className:"wi-trigger-address",children:Ue(p)})]});return o?(0,Pe.jsx)(cr.Drawer.Trigger,{asChild:c,children:l}):(0,Pe.jsx)(lr.Trigger,{asChild:c,children:l})}var B=W(require("react"),1),qt=W(require("@radix-ui/react-popover"),1),nt=require("vaul");var qe=W(require("bignumber.js"),1);var fr=require("@tanstack/react-query"),ur=require("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"},J={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var mo={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"},dr={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function fo(e,t){let r=J[e];if(t===r.cross)return dr.cross;if(t===r.bsc)return dr.bsc}var Vn={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function mr(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:n,format:p="png"}=r,s=Vn[e],c=n?`&bg=${n}`:"";return`${s}/portrait/evm/${t}.${p}?size=${o}${c}`}var _t="user-balance";async function Hn(e,t,r,o){let n=new URLSearchParams({networkId:`eip155:${t}`,account:r}),p=await fetch(`${e}/v1/public/token/balance?${n}`,{cache:"no-store",signal:o});if(!p.ok)throw new Error(`Failed to fetch token balance: ${p.status}`);let s=await p.json();if(s.code!==200)throw new Error(`Token balance API error: ${s.code}`);return s.data}function Re(e,t,r=!0){let o=te[e],n=J[e],p=[n.cross,n.bsc],s=(0,fr.useQueries)({queries:p.map(d=>({queryKey:[_t,e,t,d],queryFn:({signal:m})=>Hn(o,d,t,m),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1}))}),c=s.some(d=>d.isLoading),l=s.some(d=>d.isError);return{tokens:(0,ur.useMemo)(()=>{let d=[];for(let m of s)m.data&&d.push(...m.data);return d},[s]),isLoading:c,isError:l}}var St=require("@tanstack/react-query"),gr=require("react");var Un="forge-holdings",$n="forge-token-image";async function qn(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 zn(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 wr(e,t,r=!0){let o=mo[e],{data:n,...p}=(0,St.useQuery)({queryKey:[Un,e,t],queryFn:({signal:s})=>qn(o,t,s),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1});return{holdings:n??[],...p}}function hr(e,t,r=!0){let o=mo[e],n=(0,St.useQueries)({queries:t.map(s=>({queryKey:[$n,e,s],queryFn:({signal:c})=>zn(o,s,c),enabled:r,staleTime:1/0}))});return{imageMap:(0,gr.useMemo)(()=>{let s=new Map;for(let c of n)c.data&&s.set(c.data.address,c.data.image_url);return s},[n])}}var xr=require("@tanstack/react-query"),br=require("react");var Ot="token-stats";function Te(e,t){return`${e}:${t.toLowerCase()}`}function Ee(e,t=!0){let r=te[e],{data:o,...n}=(0,xr.useQuery)({queryKey:[Ot,e],queryFn:async({signal:s})=>{let c=await fetch(`${r}/v1/public/token/stats`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch token stats: ${c.status}`);let l=await c.json();if(l.code!==200)throw new Error(`Token stats API error: ${l.code}`);return l},enabled:t,staleTime:3e4});return{statsMap:(0,br.useMemo)(()=>{let s=new Map;if(!o?.data)return s;for(let c of o.data){let l=Te(c.chain_id,c.address);s.set(l,c)}return s},[o]),...n}}var vr=require("@tanstack/react-query"),yr=require("react");var jn="token-info";function uo(e,t){return`${t.toLowerCase()}_${e}`}function kr(e,t=!0){let r=te[e],{data:o,...n}=(0,vr.useQuery)({queryKey:[jn,e],queryFn:async({signal:s})=>{let c=await fetch(`${r}/v1/public/token/info`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch token info: ${c.status}`);let l=await c.json();if(l.code!==200)throw new Error(`Token info API error: ${l.code}`);return l},enabled:t,staleTime:1/0});return{categoryMap:(0,yr.useMemo)(()=>{let s=new Map;if(!o?.data)return s;for(let c of o.data){let l=uo(c.chain_id,c.address);s.set(l,c.category)}return s},[o]),...n}}var Cr=require("react"),Wt=W(require("bignumber.js"),1);function Lr(e,t,r){let{tokens:o,isLoading:n}=Re(e,t,r),{statsMap:p}=Ee(e,r);return(0,Cr.useMemo)(()=>{let s=new Wt.default(0);for(let d of o){let m=p.get(Te(d.chainId,d.address));if(!m)continue;let x=new Wt.default(d.quantity.numeric).shiftedBy(-d.quantity.decimals).multipliedBy(new Wt.default(m.price));x.isNaN()||(s=s.plus(x))}let c=s.toFixed(),{displayValue:l,isLowerBound:a}=sr(c);return{totalUsd:c,displayValue:l,isLowerBound:a,isLoading:n}},[o,p,n])}var rn=require("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(a){console.error("[dapp-ui] onOutlink threw:",a);return}let p=a=>{typeof window>"u"||window.open(a,"_blank","noopener,noreferrer")};if((a=>!!a&&(typeof a=="object"||typeof a=="function")&&typeof a.then=="function")(n)){let a=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,d=m=>{if(m===null){a?.close();return}let f=m??t;if(a)try{a.location.href=f}catch{a.close(),p(f)}else p(f)};n.then(d,m=>{console.error("[dapp-ui] onOutlink rejected:",m),a?.close()});return}let c=n;if(c===null)return;p(c??t)}var Se=W(require("react"),1),on=require("vaul");var Dt=require("react"),ot=(0,Dt.createContext)(null);function G(){let e=(0,Dt.useContext)(ot);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var Nr=require("vaul");var go=require("react/jsx-runtime");function Ir({asChild:e,children:t}){let{walletAddress:r}=G(),o=t!=null,n=e??!0,p=o?t:(0,go.jsx)("button",{type:"button",children:Ue(r)});return(0,go.jsx)(Nr.Drawer.Trigger,{asChild:n,children:p})}var rt=require("vaul");var ee=W(require("react"),1),en=require("@tanstack/react-query");var Or=require("react"),Ht=W(require("bignumber.js"),1);var Tr=require("@tanstack/react-query"),wo=require("react");var At={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"},Pr={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Ft={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"},ue={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Rr={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 Gn="wp:reward-pools";function Bt(e,t=!0){let r=At[e],{data:o,...n}=(0,Tr.useQuery)({queryKey:[Gn,e],queryFn:async({signal:c})=>{let l=await fetch(`${r}/v1/pools`,{cache:"no-store",signal:c});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let a=await l.json();if(a.code!==200)throw new Error(`Pools API error: ${a.code}`);return a},enabled:t,staleTime:0}),p=(0,wo.useMemo)(()=>o?.data.pools.filter(c=>c.pool_type==="CrossPool")??[],[o]),s=(0,wo.useMemo)(()=>o?.data.pools.filter(c=>c.pool_type==="GamePool")??[],[o]);return{crossPools:p,gamePools:s,allPools:o?.data.pools??[],...n}}var Er=require("@tanstack/react-query"),Mr=require("react");var Zn="wp:user-deposits";function Vt(e,t,r=!0){let o=At[e],n=r&&!!t,{data:p,...s}=(0,Er.useQuery)({queryKey:[Zn,e,t],queryFn:async({signal:l})=>{let a=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:l});if(!a.ok)throw new Error(`Deposits fetch failed: ${a.status}`);let d=await a.json();if(d.code!==200)throw new Error(`Deposits API error: ${d.code}`);return d},enabled:n,staleTime:0});return{depositMap:(0,Mr.useMemo)(()=>{let l=new Map;if(!p?.data.user_deposits)return l;for(let a of p.data.user_deposits)l.set(a.pool_address.toLowerCase(),a);return l},[p]),deposits:p?.data.user_deposits??[],...s}}var ho=require("@tanstack/react-query"),xo=require("react");function re(e,t,r,o=!0){let n=Rr[e][t],p=o&&!!r,{data:s,...c}=(0,ho.useQuery)({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}),l=s?.data??[],a=(0,xo.useMemo)(()=>{let v=new Map;for(let g of l)v.set(g.pair_address.toLowerCase(),g);return v},[l]),{data:d,...m}=(0,ho.useQuery)({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)}),C=await fetch(`${n}/open-order?${u}`,{cache:"no-store",signal:v});if(!C.ok)throw new Error(`open-order fetch failed: ${C.status}`);let M=await C.json();if(M.code!==200)throw new Error(`open-order API error: ${M.code}`);return M.data?.data??[]},enabled:p,staleTime:0}),f=d??[],x=(0,xo.useMemo)(()=>{let v=new Map;for(let g of f){let u=g.pair.toLowerCase();v.has(u)||v.set(u,{buys:[],sells:[]});let C=v.get(u);g.order_side===1?C.buys.push(g):C.sells.push(g)}return v},[f]);return{allPairs:l,pairMap:a,orders:f,ordersByPair:x,isEmpty:f.length===0,isLoading:c.isLoading||m.isLoading}}var Kn=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],_r="var(--wp-green)",Sr=4;function Wr(e,t,r=!0){let o=r&&!!t,{allPools:n}=Bt(e,o),{depositMap:p}=Vt(e,t,o),{allPairs:s,pairMap:c,ordersByPair:l}=re(e,"cross",t,o),{allPairs:a,pairMap:d,ordersByPair:m}=re(e,"crossd",t,o),{allPairs:f,pairMap:x,ordersByPair:v}=re(e,"forge",t,o);return(0,Or.useMemo)(()=>{let g=new Map,u=new Map,C=(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 A of w.reward_tokens){let I=Number(A.price);I>0&&g.set(A.symbol,I)}}for(let w of[...s,...a,...f]){let y=g.get(w.quote_symbol),A=Number(w.billboard?.price);y&&A>0&&!g.has(w.base_symbol)&&g.set(w.base_symbol,A*y)}for(let w of n){let y=p.get(w.pool_address.toLowerCase());if(!y)continue;let A=new Ht.default(y.deposited_amount).shiftedBy(-w.deposit_token.decimals).toNumber();if(C(w.deposit_token.symbol,A),w.reward_tokens.length>0){let I=w.reward_tokens[0],H=new Ht.default(y.claimable_reward).shiftedBy(-I.decimals).toNumber();C(I.symbol,H)}}let M=[{pairMap:c,ordersByPair:l},{pairMap:d,ordersByPair:m},{pairMap:x,ordersByPair:v}];for(let{pairMap:w,ordersByPair:y}of M)for(let[A,I]of y){let H=w.get(A);if(H){for(let Z of I.buys){let ie=Number(Z.amount)-Number(Z.filled);C(H.quote_symbol,ie*Number(Z.price))}for(let Z of I.sells){let ie=Number(Z.amount)-Number(Z.filled);C(H.base_symbol,ie)}}}let _=[],N=0;for(let[w,y]of u){let A=g.get(w)??0,I=y*A;I>0&&(_.push({symbol:w,usdValue:I}),N+=I)}_.sort((w,y)=>y.usdValue-w.usdValue);let D=[];if(N>0){let w=_.slice(0,Sr),y=_.slice(Sr);for(let I=0;I<w.length;I++)D.push({symbol:w[I].symbol,usdValue:w[I].usdValue,percentage:Math.round(w[I].usdValue/N*100),color:Kn[I]??_r});if(y.length>0){let I=y.reduce((H,Z)=>H+Z.usdValue,0);D.push({symbol:"Others",usdValue:I,percentage:Math.round(I/N*100),color:_r})}let A=D.reduce((I,H)=>I+H.percentage,0);A!==100&&D.length>0&&(D[0].percentage+=100-A)}return{totalUsd:N,formattedTotal:N>0?`$${new Ht.default(N).toFormat(2)}`:"$0.00",segments:D}},[n,p,s,c,l,a,d,m,f,x,v])}var se=require("react/jsx-runtime");function Dr({size:e=22,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ar({size:e=22,className:t}){return(0,se.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,se.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,se.jsx)("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Fr({size:e=12,className:t}){return(0,se.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,se.jsx)("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}var Br=require("@tanstack/react-query"),Vr=require("react");var Yn="wp:token-info";function ge(e,t=!0){let r=te[e],o=J[e].cross,{data:n,...p}=(0,Br.useQuery)({queryKey:[Yn,e],queryFn:async({signal:a})=>{let d=await fetch(`${r}/v1/public/token/info`,{cache:"no-store",signal:a});if(!d.ok)throw new Error(`Failed to fetch token info: ${d.status}`);let m=await d.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:s,byChainSym:c}=(0,Vr.useMemo)(()=>{let a=new Map,d=new Map;if(!n?.data)return{byChainAddr:a,byChainSym:d};for(let m of n.data){let f=m.address.toLowerCase();a.set(`${m.chain_id}:${f}`,m),a.set(f,m);let x=m.symbol.replace(/^t/,"").toUpperCase(),v=`${m.chain_id}:${x}`;d.has(v)||d.set(v,m),d.has(x)||d.set(x,m)}return{byChainAddr:a,byChainSym:d}},[n]);return{getTokenImage:(a,d)=>{let m=a.toLowerCase(),f=s.get(`${o}:${m}`);if(f?.image)return f.image;let x=s.get(m);if(x?.image)return x.image;if(d){let v=d.replace(/^t/,"").toUpperCase(),g=c.get(`${o}:${v}`);if(g?.image)return g.image;let u=c.get(v);if(u?.image)return u.image}return""},...p}}var we=require("react/jsx-runtime");function ne({title:e,icon:t,iconFit:r="cover",isEmpty:o,children:n}){return(0,we.jsxs)("div",{className:"wp-svc-card",children:[(0,we.jsxs)("div",{className:"wp-svc-card-head",children:[(0,we.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:r}}),(0,we.jsx)("span",{className:"wp-svc-card-title",children:e})]}),o?(0,we.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,we.jsx)("div",{className:"wp-svc-items",children:n})]})}var Ut=W(require("bignumber.js"),1),q=require("react/jsx-runtime"),Qn="CROSS Rewards",Xn="https://contents.crosstoken.io/frontend/common/app-launcher/icons/award.svg";function Hr(e,t){let r=new Ut.default(e).shiftedBy(-t);return r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,Ut.default.ROUND_DOWN):r.toFormat(4,Ut.default.ROUND_DOWN)}function Ur(){let{env:e,walletAddress:t,onOutlink:r}=G(),o=!!t,{allPools:n}=Bt(e,o),{depositMap:p}=Vt(e,t,o),{getTokenImage:s}=ge(e,o),c=l=>`${Pr[e]}/rewards/${l.pool_address}?action=withdraw`;return(0,q.jsx)(ne,{title:Qn,icon:Xn,isEmpty:n.length===0,children:n.map(l=>{let a=p.get(l.pool_address.toLowerCase()),d=a?.deposited_amount??"0",m=c(l);return(0,q.jsxs)("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:l,userDeposit:a}},r),children:[(0,q.jsxs)("div",{className:"wp-item-body",children:[(0,q.jsxs)("div",{className:"wp-item-field",children:[(0,q.jsxs)("span",{className:"wp-item-label",children:["Deposited (",l.deposit_token.symbol,")"]}),(0,q.jsxs)("div",{className:"wp-svc-token",children:[s(l.deposit_token.address,l.deposit_token.symbol)&&(0,q.jsx)("img",{className:"wp-svc-token-icon",src:s(l.deposit_token.address,l.deposit_token.symbol),alt:""}),(0,q.jsx)("span",{children:Hr(d,l.deposit_token.decimals)})]})]}),(0,q.jsxs)("div",{className:"wp-item-field",children:[(0,q.jsxs)("span",{className:"wp-item-label",children:["Rewards (",l.reward_tokens.map(f=>f.symbol).join(", "),")"]}),l.reward_tokens.map(f=>{let x=s(f.address,f.symbol);return(0,q.jsxs)("div",{className:"wp-svc-token",children:[x&&(0,q.jsx)("img",{className:"wp-svc-token-icon",src:x,alt:""}),(0,q.jsx)("span",{children:a?Hr(a.claimable_reward,f.decimals):"0"})]},f.address)})]})]}),(0,q.jsxs)("div",{className:"wp-item-badges",children:[(0,q.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),(0,q.jsx)("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},l.pool_address)})})}var vo=W(require("bignumber.js"),1);var L=require("react/jsx-runtime");function bo(e){let t=new vo.default(e);if(t.isNaN())return e;let r=t.decimalPlaces()??0;return t.toFormat(r)}function $r(e){let t=new vo.default(e.amount).minus(e.filled);return bo(t.toString())}function $e({market:e,pairMap:t,ordersByPair:r,getDexUrl:o,getTokenImage:n}){let{onOutlink:p}=G(),s=[];for(let[c,l]of r){let a=t.get(c),d=a?n(a.base_address,a.base_symbol):"",m=a?n(a.quote_address,a.quote_symbol):"",f=o(c);for(let x of l.buys)s.push((0,L.jsxs)("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:x,pair:a}},p),children:[(0,L.jsxs)("div",{className:"wp-item-body",children:[(0,L.jsxs)("div",{className:"wp-item-field",children:[(0,L.jsxs)("span",{className:"wp-item-label wp-item-label--buy",children:["Buy",a?.base_symbol?` (${a.base_symbol})`:""]}),(0,L.jsxs)("div",{className:"wp-svc-token",children:[d&&(0,L.jsx)("img",{className:"wp-svc-token-icon",src:d,alt:""}),(0,L.jsx)("span",{children:$r(x)})]})]}),(0,L.jsxs)("div",{className:"wp-item-field",children:[(0,L.jsxs)("span",{className:"wp-item-label",children:["Price",a?.quote_symbol?` (${a.quote_symbol})`:""]}),(0,L.jsxs)("div",{className:"wp-svc-token",children:[m&&(0,L.jsx)("img",{className:"wp-svc-token-icon",src:m,alt:""}),(0,L.jsx)("span",{children:bo(x.price)})]})]})]}),(0,L.jsx)("div",{className:"wp-item-badges",children:(0,L.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"})})]},`buy-${x.order_id}`));for(let x of l.sells)s.push((0,L.jsxs)("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:x,pair:a}},p),children:[(0,L.jsxs)("div",{className:"wp-item-body",children:[(0,L.jsxs)("div",{className:"wp-item-field",children:[(0,L.jsxs)("span",{className:"wp-item-label wp-item-label--sell",children:["Sell",a?.base_symbol?` (${a.base_symbol})`:""]}),(0,L.jsxs)("div",{className:"wp-svc-token",children:[d&&(0,L.jsx)("img",{className:"wp-svc-token-icon",src:d,alt:""}),(0,L.jsx)("span",{children:$r(x)})]})]}),(0,L.jsxs)("div",{className:"wp-item-field",children:[(0,L.jsxs)("span",{className:"wp-item-label",children:["Price",a?.quote_symbol?` (${a.quote_symbol})`:""]}),(0,L.jsxs)("div",{className:"wp-svc-token",children:[m&&(0,L.jsx)("img",{className:"wp-svc-token-icon",src:m,alt:""}),(0,L.jsx)("span",{children:bo(x.price)})]})]})]}),(0,L.jsx)("div",{className:"wp-item-badges",children:(0,L.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${x.order_id}`))}return(0,L.jsx)(L.Fragment,{children:s})}var yo=require("react/jsx-runtime"),Jn="Gametoken - CROSS",ei="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function qr(){let{env:e,walletAddress:t}=G(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:p}=re(e,"cross",t,r),{getTokenImage:s}=ge(e,r);return(0,yo.jsx)(ne,{title:Jn,icon:ei,isEmpty:p,children:(0,yo.jsx)($e,{market:"cross",pairMap:o,ordersByPair:n,getDexUrl:l=>{let a=o.get(l.toLowerCase());return`${ue[e]}/gametoken/cross/${a?.base_symbol??""}`},getTokenImage:s})})}var ko=require("react/jsx-runtime"),ti="Gametoken - CROSSD",oi="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function zr(){let{env:e,walletAddress:t}=G(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:p}=re(e,"crossd",t,r),{getTokenImage:s}=ge(e,r);return(0,ko.jsx)(ne,{title:ti,icon:oi,isEmpty:p,children:(0,ko.jsx)($e,{market:"crossd",pairMap:o,ordersByPair:n,getDexUrl:l=>{let a=o.get(l.toLowerCase());return`${ue[e]}/gametoken/crossd/${a?.base_symbol??""}`},getTokenImage:s})})}var Co=require("react/jsx-runtime"),ri="Gametoken - Forge",ni="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function jr(){let{env:e,walletAddress:t}=G(),r=!!t,{pairMap:o,ordersByPair:n,isEmpty:p}=re(e,"forge",t,r),{getTokenImage:s}=ge(e,r);return(0,Co.jsx)(ne,{title:ri,icon:ni,isEmpty:p,children:(0,Co.jsx)($e,{market:"forge",pairMap:o,ordersByPair:n,getDexUrl:l=>{let a=o.get(l.toLowerCase());return`${ue[e]}/gametoken/forge/${a?.base_symbol??""}`},getTokenImage:s})})}var $t=W(require("bignumber.js"),1),Xr=require("react");var Gr=require("@tanstack/react-query");var ii="wp:forge-pools";function Zr(e,t,r=!0){let o=Ft[e],n=r&&!!t,{data:p,...s}=(0,Gr.useQuery)({queryKey:[ii,e,t],queryFn:async()=>{let l=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!l.ok)throw new Error(`forge pools fetch failed: ${l.status}`);return(await l.json()).data?.items??[]},enabled:n,staleTime:0}),c=p??[];return{pools:c,isEmpty:c.length===0,...s}}var Kr=require("@tanstack/react-query"),Yr=require("react");var ai="wp:forge-token-detail";async function si(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function Qr(e,t,r=!0){let o=Ft[e],n=(0,Kr.useQueries)({queries:t.map(c=>({queryKey:[ai,e,c],queryFn:()=>si(o,c),enabled:r&&!!c,staleTime:3e4}))}),p=(0,Yr.useMemo)(()=>{let c=new Map;for(let l=0;l<n.length;l++){let a=n[l]?.data,d=t[l];a&&d&&c.set(d.toLowerCase(),a)}return c},[n,t]),s=n.some(c=>c.isLoading);return{detailMap:p,isLoading:s}}var V=require("react/jsx-runtime"),li="Forge",ci="https://x.crosstoken.io/forge/favicon-96x96.png",pi=18,di="https://contents.crosstoken.io/wallet/token/images/FT.png";function mi(e){if(!e||e==="0")return"0";let t=new $t.default(e).shiftedBy(-pi);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,$t.default.ROUND_DOWN):t.toFormat(4,$t.default.ROUND_DOWN)}function fi(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 Jr(){let{env:e,walletAddress:t,onOutlink:r}=G(),o=!!t,{pools:n,isEmpty:p}=Zr(e,t,o),s=(0,Xr.useMemo)(()=>n.map(a=>a.token.address),[n]),{detailMap:c}=Qr(e,s,o&&s.length>0),l=a=>`${ue[e]}/forge/token/${a.token.address}`;return(0,V.jsx)(ne,{title:li,icon:ci,iconFit:"contain",isEmpty:p,children:n.map(a=>{let d=c.get(a.token.address.toLowerCase()),m=d?.image_url||d?.image||a.token.image||di,f=d?.symbol||a.token.symbol,x=l(a);return(0,V.jsxs)("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer",onClick:v=>oe(v,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:a,tokenDetail:d}},r),children:[(0,V.jsxs)("div",{className:"wp-item-body",children:[(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsxs)("span",{className:"wp-item-label",children:["Pair (",f,")"]}),(0,V.jsx)("div",{className:"wp-svc-token",children:(0,V.jsx)("img",{className:"wp-svc-token-icon",src:m,alt:""})})]}),(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,V.jsx)("div",{className:"wp-svc-token",children:(0,V.jsx)("span",{children:mi(a.lp_balance)})})]}),(0,V.jsxs)("div",{className:"wp-item-field",children:[(0,V.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,V.jsx)("div",{className:"wp-svc-token",children:(0,V.jsx)("span",{children:fi(a.pool_ownership)})})]})]}),(0,V.jsx)("div",{className:"wp-item-badges",children:(0,V.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},a.pair_address)})})}E(`.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
|
-
`);var k=require("react/jsx-runtime"),Lo=5,ui="wp:";function Me({env:e,theme:t="dark",walletAddress:r,onBack:o,showHeader:n=!0,variant:p="embed",className:s,sendTransaction:c,onOutlink:l}){let a=Q(e),d=!!r,m=(0,en.useQueryClient)(),{segments:f}=Wr(a,r,d),[x,v]=ee.useState(Lo),[g,u]=ee.useState(!1),C=ee.useCallback(()=>{m.invalidateQueries({predicate:w=>typeof w.queryKey[0]=="string"&&w.queryKey[0].startsWith(ui)})},[m]),M=ee.useCallback(()=>{C(),u(!0),setTimeout(()=>u(!1),600),v(Lo)},[C]);ee.useEffect(()=>{if(!d)return;let w=setInterval(()=>{v(y=>y<=1?(M(),Lo):y-1)},1e3);return()=>clearInterval(w)},[d,M]);let _=ee.useCallback(()=>{o?.()},[o]),N=ee.useMemo(()=>({env:a,theme:t,open:!0,walletAddress:r,close:_,sendTransaction:c,onOutlink:l}),[a,t,r,_,c,l]),D=(0,k.jsxs)(k.Fragment,{children:[n&&(0,k.jsxs)("div",{className:"wp-header",children:[o?(0,k.jsx)("button",{type:"button",className:"wp-header-btn",onClick:o,children:(0,k.jsx)(Dr,{})}):(0,k.jsx)("span",{className:"wp-header-btn","aria-hidden":!0}),(0,k.jsx)("h2",{className:"wp-header-title",children:"My Portfolio"}),(0,k.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:M,children:[(0,k.jsx)(Ar,{className:g?"wp-spin-once":void 0}),d&&(0,k.jsx)("span",{className:"wp-refresh-badge",children:x})]})]}),(0,k.jsx)("div",{className:"wp-top",children:f.length>0&&(0,k.jsxs)("div",{className:"wp-asset",children:[(0,k.jsxs)("div",{className:"wp-asset-head",children:[(0,k.jsx)("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),(0,k.jsx)("span",{className:"wp-asset-head-icon",children:(0,k.jsx)(Fr,{})})]}),(0,k.jsx)("div",{className:"wp-bar",children:f.map(w=>(0,k.jsx)("div",{className:"wp-bar-seg",style:{flex:`${w.percentage} 0 0`,background:w.color},children:w.percentage>=5&&(0,k.jsxs)("span",{className:"wp-bar-seg-pct",children:[w.percentage,"%"]})},w.symbol))}),(0,k.jsx)("div",{className:"wp-legend",children:f.map(w=>(0,k.jsxs)("div",{className:"wp-legend-item",children:[(0,k.jsx)("span",{className:"wp-legend-dot",style:{background:w.color}}),(0,k.jsx)("span",{className:"wp-legend-label",children:w.symbol})]},w.symbol))})]})}),(0,k.jsx)("div",{className:"wp-body",children:(0,k.jsxs)("div",{className:"wp-body-inner",children:[(0,k.jsx)(Ur,{}),(0,k.jsx)(qr,{}),(0,k.jsx)(zr,{}),(0,k.jsx)(jr,{}),(0,k.jsx)(Jr,{})]})})]});return(0,k.jsx)(ot.Provider,{value:N,children:p==="none"?D:(0,k.jsx)("div",{className:$(p==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:D})})}var _e=require("react/jsx-runtime");function tn({className:e}){let{env:t,theme:r,walletAddress:o,close:n,sendTransaction:p}=G();return(0,_e.jsxs)(rt.Drawer.Portal,{children:[(0,_e.jsx)(rt.Drawer.Overlay,{className:"wp-overlay"}),(0,_e.jsxs)(rt.Drawer.Content,{className:$("wp-fullscreen",e),"data-theme":r,children:[(0,_e.jsx)(rt.Drawer.Title,{className:"wp-sr-only",children:"My Portfolio"}),(0,_e.jsx)(Me,{env:t,theme:r,walletAddress:o,onBack:n,variant:"none",sendTransaction:p})]})]})}var No=require("react/jsx-runtime");function gi({env:e,theme:t="dark",walletAddress:r,open:o,onOpenChange:n,sendTransaction:p,onOutlink:s,children:c}){let l=Q(e),a=o!==void 0,[d,m]=Se.useState(!1),f=a?o:d,x=Se.useCallback(u=>{a||m(u),n?.(u)},[a,n]),v=Se.useCallback(()=>x(!1),[x]),g=Se.useMemo(()=>({env:l,theme:t,open:f,walletAddress:r,close:v,sendTransaction:p,onOutlink:s}),[l,t,f,r,v,p,s]);return(0,No.jsx)(ot.Provider,{value:g,children:(0,No.jsx)(on.Drawer.Root,{direction:"bottom",open:f,onOpenChange:x,noBodyStyles:!0,children:c})})}var Io=Object.assign(gi,{Trigger:Ir,Content:tn});var i=require("react/jsx-runtime");function Po(e,t,r){let o=J[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 wi(e){return parseInt(e.split(":")[1],10)}function hi(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function xi(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 nn({align:e="end",sideOffset:t=12,className:r,children:o}){let{env:n,theme:p,isMobile:s,open:c,drawerDirection:l,modal:a,showBalance:d,showForgeToken:m,showGameToken:f,showQR:x,qrLogoSrc:v,walletAddress:g,accountName:u,profileImageUrl:C,preferredTokens:M,close:_,onSelectWallet:N,onCopyAddress:D,onDisconnect:w,disconnectLabel:y,termsUrl:A,termsLabel:I,privacyUrl:H,privacyLabel:Z,portalStyle:ie,navContent:be,navPosition:Ge,footerContent:Ze,view:X,setView:Ke,showPortfolio:Ye,portfolioTitle:Yt,showTotalAssets:ut,totalAssetsLabel:gt,sendTransaction:wt,onOutlink:ve}=me(),{tokens:ce,isLoading:De}=Re(n,g,c&&d),{statsMap:pe}=Ee(n,d),{categoryMap:ht}=kr(n,d),xt=d&&ut,{displayValue:ae,isLowerBound:Ae,isLoading:bt}=Lr(n,g,c&&xt),[ye,vt]=B.useState(!1),{holdings:de,isLoading:yt}=wr(n,g,c&&d&&m),kt=B.useMemo(()=>de.map(b=>b.token),[de]),{imageMap:Qt}=hr(n,kt,m&&de.length>0),Fe=B.useMemo(()=>{let b=[],S=[],O=[],z=new Map((M??[]).map((T,U)=>[`${wi(T.chainId)}:${T.address.toLowerCase()}`,U]));for(let T of ce){let U=Po(n,T.chainId,T.symbol)!==void 0,Ce=`${T.chainId}:${T.address.toLowerCase()}`,Le=z.get(Ce),to=new qe.default(T.quantity.numeric).shiftedBy(-T.quantity.decimals);if(U)b.push(T);else if(Le!==void 0)S.push(T);else if(to.isGreaterThan(0)){if(!f&&ht.get(uo(T.chainId,T.address))==="game")continue;O.push(T)}}return b.sort((T,U)=>{let Ce=Po(n,T.chainId,T.symbol)??99,Le=Po(n,U.chainId,U.symbol)??99;return Ce-Le}),S.sort((T,U)=>{let Ce=z.get(`${T.chainId}:${T.address.toLowerCase()}`)??99,Le=z.get(`${U.chainId}:${U.address.toLowerCase()}`)??99;return Ce-Le}),O.sort((T,U)=>{let Ce=pe.get(Te(T.chainId,T.address)),Le=pe.get(Te(U.chainId,U.address)),to=new qe.default(T.quantity.numeric).shiftedBy(-T.quantity.decimals).multipliedBy(Ce?.price??0);return new qe.default(U.quantity.numeric).shiftedBy(-U.quantity.decimals).multipliedBy(Le?.price??0).minus(to).toNumber()}),[...b,...S,...O]},[ce,n,pe,f,ht,M]),Qe=B.useMemo(()=>{if(!m)return[];let b=new Set(ce.map(S=>S.address.toLowerCase()));return[...de].filter(S=>!b.has(S.token.toLowerCase())).sort((S,O)=>{let z=new qe.default(S.value);return new qe.default(O.value).minus(z).toNumber()})},[de,m,ce]),ke=B.useRef(!1),Be=B.useCallback(b=>{ke.current=!0,Ke(b)},[Ke]);B.useEffect(()=>{c||(ke.current=!1)},[c]);let Mo=B.useRef(null);B.useEffect(()=>{let b=Mo.current;if(!b||!s)return;let S=O=>{O.pointerType==="touch"&&O.stopPropagation()};return b.addEventListener("pointerdown",S),()=>b.removeEventListener("pointerdown",S)},[s]);let[Xe,_o]=B.useState(!1),Xt=B.useRef(void 0);B.useEffect(()=>()=>clearTimeout(Xt.current),[]);let So=B.useCallback(async()=>{if(!Xe)try{await navigator.clipboard.writeText(g),_o(!0),clearTimeout(Xt.current),Xt.current=setTimeout(()=>_o(!1),2e3),D?.(g,!0)}catch{D?.(g,!1)}},[g,D,Xe]),Jt=B.useCallback(b=>{b.currentTarget.setAttribute("data-loaded","true")},[]),Nn=B.useMemo(()=>({background:xi(g)}),[g]),Oo=B.useMemo(()=>C||mr(n,g,{size:120,bg:p==="dark"?"1A1A2E":"F3F6F8"}),[C,n,g,p]),eo=B.useMemo(()=>hi(ae),[ae]),In=A||H?(0,i.jsxs)("div",{className:"wi-legal-links",children:[A&&(0,i.jsx)("a",{className:"wi-legal-link",href:A,target:"_blank",rel:"noopener noreferrer",onClick:b=>oe(b,A,{category:"terms",origin:"terms"},ve),children:I}),A&&H&&(0,i.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),H&&(0,i.jsx)("a",{className:"wi-legal-link",href:H,target:"_blank",rel:"noopener noreferrer",onClick:b=>oe(b,H,{category:"privacy",origin:"privacy"},ve),children:Z})]}):null,Wo=w?(0,i.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{w(),_()},children:[(0,i.jsx)(Xo,{size:12}),(0,i.jsx)("span",{className:"wi-disconnect-label",children:y})]}):null,Pn=(0,i.jsxs)("div",{className:$("wi-view-inner",ke.current&&"wi-view-wallet"),children:[xt&&(()=>{let b=Ye;return(0,i.jsxs)(b?"button":"div",{...b?{type:"button",onClick:()=>Be("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":b||void 0,children:[(0,i.jsxs)("div",{className:"wi-total-head",children:[(0,i.jsx)("span",{className:"wi-total-label",children:gt}),(0,i.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:O=>{O.stopPropagation(),vt(z=>!z)},onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),O.stopPropagation(),vt(z=>!z))},"aria-label":ye?"Show balance":"Hide balance",children:ye?(0,i.jsx)(nr,{}):(0,i.jsx)(rr,{})})]}),(0,i.jsxs)("div",{className:"wi-total-body",children:[bt?(0,i.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):(0,i.jsx)("div",{className:"wi-total-value","data-hidden":ye||void 0,children:ye?(0,i.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,i.jsxs)(i.Fragment,{children:[Ae&&(0,i.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,i.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,i.jsx)("span",{className:"wi-total-amount",children:eo.main}),eo.decimal&&(0,i.jsx)("span",{className:"wi-total-decimal",children:eo.decimal})]})}),b&&(0,i.jsx)("span",{className:"wi-total-chevron","aria-hidden":!0,children:(0,i.jsx)(tr,{size:18})})]})]})})(),Ge==="top"&&be&&(0,i.jsx)("div",{className:"wi-nav-fixed",children:be}),d&&(0,i.jsx)("div",{ref:Mo,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,i.jsxs)("div",{className:"wi-token-list",children:[De&&Array.from({length:5},(b,S)=>(0,i.jsxs)("div",{className:"wi-skeleton-item",children:[(0,i.jsxs)("div",{className:"wi-skeleton-left",children:[(0,i.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,i.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,i.jsxs)("div",{className:"wi-skeleton-right",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},S)),!De&&Fe.length===0&&!m&&(0,i.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),Fe.map(b=>{let S=pe.get(Te(b.chainId,b.address)),O=S?parseFloat(S.percent_change_24h):null,z=O!==null&&O>=0,T=fo(n,b.chainId);return(0,i.jsxs)("div",{className:"wi-token-item",children:[(0,i.jsxs)("div",{className:"wi-token-left",children:[(0,i.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,i.jsx)("img",{src:b.icon_url,alt:b.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Jt,onError:U=>{U.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),T&&(0,i.jsx)("img",{src:T,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:U=>{U.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-token-info",children:[(0,i.jsx)("span",{className:"wi-token-name",children:b.symbol}),S&&(0,i.jsxs)("div",{className:"wi-token-price-row",children:[(0,i.jsx)("span",{className:"wi-token-price",children:po(S.price)}),(0,i.jsx)("span",{className:"wi-token-change","data-positive":z,"data-zero":O===0||void 0,children:O!==null&&(O===0?"0%":`${z?"+":"-"}${(z?Math.floor:Math.ceil)(Math.abs(O)*100)/100}%`)})]})]})]}),(0,i.jsxs)("div",{className:"wi-token-right",children:[(0,i.jsx)("span",{className:"wi-token-balance",children:Mt(b.quantity.numeric,b.quantity.decimals)}),S&&(0,i.jsx)("span",{className:"wi-token-value",children:ar(b.quantity.numeric,b.quantity.decimals,S.price)})]})]},`${b.address}-${b.chainId}`)}),m&&yt&&Array.from({length:3},(b,S)=>(0,i.jsxs)("div",{className:"wi-skeleton-item",children:[(0,i.jsxs)("div",{className:"wi-skeleton-left",children:[(0,i.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,i.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,i.jsxs)("div",{className:"wi-skeleton-right",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${S}`)),m&&!yt&&!De&&Fe.length===0&&Qe.length===0&&(0,i.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),m&&Qe.map(b=>{let S=Qt.get(b.token)||"",O=fo(n,J[n].cross);return(0,i.jsxs)("div",{className:"wi-token-item",children:[(0,i.jsxs)("div",{className:"wi-token-left",children:[(0,i.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,i.jsx)("img",{src:S||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:b.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Jt,onError:z=>{z.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),O&&(0,i.jsx)("img",{src:O,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:z=>{z.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-token-info",children:[(0,i.jsx)("span",{className:"wi-token-name",children:b.token_name}),(0,i.jsx)("div",{className:"wi-token-price-row",children:(0,i.jsxs)("span",{className:"wi-token-price",children:[Mt(b.current_price,18)," CROSS"]})})]})]}),(0,i.jsxs)("div",{className:"wi-token-right",children:[(0,i.jsx)("span",{className:"wi-token-balance",children:Mt(b.balance,18)}),(0,i.jsx)("span",{className:"wi-token-value",children:po(b.current_value_usd)})]})]},`forge-${b.token}`)})]})}),Ge==="bottom"&&be&&(0,i.jsx)("div",{className:"wi-nav-fixed",children:be}),Wo&&(0,i.jsx)("div",{className:"wi-wallet-disconnect-row",children:Wo})]},"wallet"),Rn=Ye?(0,i.jsx)("div",{className:$("wi-view-inner wi-portfolio-body",ke.current&&"wi-view-portfolio"),children:(0,i.jsx)(Me,{env:n,theme:p,walletAddress:g,showHeader:!1,sendTransaction:wt,onOutlink:ve})},"portfolio"):null,Tn=(0,i.jsx)("div",{className:$("wi-view-inner wi-qr-body",ke.current&&"wi-view-qr"),children:(0,i.jsxs)("div",{className:"wi-qr-section",children:[(0,i.jsxs)("div",{className:"wi-qr-card",children:[(0,i.jsxs)("div",{className:"wi-qr-code",children:[(0,i.jsx)(rn.QRCodeSVG,{value:g,size:180,level:"H",marginSize:2,...v&&{imageSettings:{src:v,height:33,width:33,excavate:!0}}}),!v&&(0,i.jsx)("div",{className:"wi-qr-logo",children:(0,i.jsx)(ir,{size:33})})]}),(0,i.jsx)("p",{className:"wi-qr-address",children:g}),(0,i.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:So,children:[(0,i.jsx)("span",{className:"wi-qr-copy-icon",children:Xe?(0,i.jsx)(lo,{size:16}):(0,i.jsx)(so,{size:16})}),(0,i.jsx)("span",{className:"wi-qr-copy-text",children:Xe?"Copied!":"Copy address"})]})]}),In]})},"qr"),En=X==="qr"||X==="portfolio",Do=Ze!==null?(0,i.jsx)("div",{className:"wi-builtin-footer",children:Ze}):null,Ao=(0,i.jsxs)("div",{className:"wi-account-text",children:[N?(0,i.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:N,"aria-label":"Switch account",children:[(0,i.jsx)("span",{className:"wi-account-name",children:u??"Account 1"}),(0,i.jsx)("span",{className:"wi-account-switch","aria-hidden":"true",children:(0,i.jsx)(or,{size:12})})]}):(0,i.jsx)("div",{className:"wi-account-row",children:(0,i.jsx)("span",{className:"wi-account-name",children:u??"Account 1"})}),(0,i.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:So,"aria-label":"Copy address",children:[(0,i.jsx)("span",{className:"wi-account-address",children:Ue(g)}),(0,i.jsx)("span",{className:"wi-account-copy",children:Xe?(0,i.jsx)(lo,{size:14}):(0,i.jsx)(so,{size:14})})]})]}),Fo=(0,i.jsxs)(i.Fragment,{children:[o,En?(0,i.jsxs)("div",{className:"wi-sticky-header",children:[(0,i.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,i.jsx)("button",{type:"button",className:"wi-header-back",onClick:()=>Be("wallet"),"aria-label":"Back",children:(0,i.jsx)(er,{})}),(0,i.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:Ao}),(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:_,"aria-label":"Close",children:(0,i.jsx)(co,{size:24})})]}),(0,i.jsx)("hr",{className:"wi-divider"})]}):(0,i.jsxs)("div",{className:"wi-sticky-header",children:[(0,i.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,i.jsxs)("div",{className:"wi-account-block",children:[(0,i.jsxs)("div",{className:"wi-avatar",children:[(0,i.jsx)("div",{className:"wi-avatar-fallback",style:Nn}),Oo&&(0,i.jsx)("img",{src:Oo,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:Jt,onError:b=>{b.currentTarget.style.display="none"}})]}),Ao]}),(0,i.jsxs)("div",{className:"wi-header-actions",children:[x&&(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:()=>Be("qr"),"aria-label":"Show QR code",children:(0,i.jsx)(Jo,{size:20})}),(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:_,"aria-label":"Close",children:(0,i.jsx)(co,{size:24})})]})]}),(0,i.jsx)("hr",{className:"wi-divider"})]}),(0,i.jsxs)("div",{className:"wi-view-container",children:[X==="wallet"&&Pn,X==="qr"&&Tn,X==="portfolio"&&Rn]}),Do&&X!=="portfolio"&&(0,i.jsx)("div",{className:"wi-sticky-footer",children:(0,i.jsx)("div",{className:"wi-footer",children:Do})})]});return s?(0,i.jsxs)(nt.Drawer.Portal,{children:[a&&(0,i.jsx)(nt.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,i.jsxs)(nt.Drawer.Content,{className:$("wi-drawer-content",r),"data-theme":p,style:ie,"data-direction":l,"data-no-balance":!d||void 0,"data-view":X,children:[(0,i.jsx)(nt.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),Fo]})]}):(0,i.jsxs)(i.Fragment,{children:[a&&c&&(0,i.jsx)("div",{className:"wi-drawer-overlay",onClick:_}),(0,i.jsx)(qt.Portal,{children:(0,i.jsx)(qt.Content,{align:e,sideOffset:t,className:$("wi-popover-content",r),"data-theme":p,style:ie,"data-no-balance":!d||void 0,"data-view":X,children:Fo})})]})}var an=W(require("react"),1);function sn({position:e="top",children:t}){let{setNavContent:r,setNavPosition:o}=me();return an.useEffect(()=>(r(t),o(e),()=>r(null)),[t,e,r,o]),null}var ln=W(require("react"),1);function cn({children:e}){let{setFooterContent:t}=me();return ln.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}E(`[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
|
+
`);E("");var jt=require("react/jsx-runtime");function bo({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:r,children:o}){let l=at(`(max-width: ${n}px)`),[s,c]=it.useState(!1),d=it.useCallback(()=>c(!1),[]),a=ae(e),p=it.useMemo(()=>({env:a,theme:t,isMobile:l,open:s,domain:r,close:d}),[a,t,l,s,r,d]);return(0,jt.jsx)(xo.Provider,{value:p,children:l?(0,jt.jsx)(mn.Drawer.Root,{direction:"right",open:s,onOpenChange:c,noBodyStyles:!0,children:o},"drawer"):(0,jt.jsx)(pn.Root,{open:s,onOpenChange:c,children:o},"popover")})}var wn=V(require("@radix-ui/react-popover"),1),hn=require("vaul");var ee=require("react/jsx-runtime");function fn({size:e=18}){return(0,ee.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ee.jsx)("rect",{width:"4",height:"4",fill:"currentColor"}),(0,ee.jsx)("rect",{x:"7",width:"4",height:"4",fill:"currentColor"}),(0,ee.jsx)("rect",{x:"14",width:"4",height:"4",fill:"currentColor"}),(0,ee.jsx)("rect",{y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ee.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ee.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",fill:"currentColor"}),(0,ee.jsx)("rect",{y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ee.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",fill:"currentColor"}),(0,ee.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",fill:"currentColor"})]})}function un(){return(0,ee.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ee.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function gn(){return(0,ee.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ee.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var bt=require("react/jsx-runtime");function vo({asChild:e,children:t}){let{isMobile:n,theme:r}=zt(),o=t!=null,l=e??!0,s=o?t:(0,bt.jsx)("button",{type:"button",className:"al-trigger-btn","data-theme":r,children:(0,bt.jsx)(fn,{size:n?12:18})});return n?(0,bt.jsx)(hn.Drawer.Trigger,{asChild:l,children:s}):(0,bt.jsx)(wn.Trigger,{asChild:l,children:s})}var Ue=V(require("react"),1),qt=V(require("@radix-ui/react-popover"),1),ze=require("vaul");var bn=require("@tanstack/react-query");var xn={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 vt(e){let t=ae(e);return(0,bn.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:n})=>{let r=await fetch(xn[t],{cache:"no-store",signal:n});if(!r.ok)throw new Error(`Failed to fetch global menu: ${r.status}`);return r.json()},staleTime:0,gcTime:0,refetchOnMount:!0})}function Z(...e){return e.filter(Boolean).join(" ")}var z=require("react/jsx-runtime");function yo({align:e="end",sideOffset:t=12,className:n}){let{env:r,theme:o,isMobile:l,domain:s,close:c}=zt(),{data:d}=vt(r),a=Ue.useMemo(()=>(d?.items??[]).sort((g,L)=>g.order-L.order),[d]),p=8,f=Ue.useRef(null),v=Ue.useCallback(g=>{f.current={x:g.clientX,y:g.clientY}},[]),u=typeof window<"u"?window.location.pathname:"",b=Ue.useCallback((g,L)=>{if(f.current){let R=g.clientX-f.current.x,B=g.clientY-f.current.y;if(f.current=null,Math.abs(R)>p||Math.abs(B)>p)return}let P=L.url[r]??L.url.production,D=vn(P,s);if(!D)try{let R=new URL(P).pathname;if(u===R||u.startsWith(R+"/")){c();return}}catch{}D?window.open(P,"_blank","noopener,noreferrer"):window.location.href=P,c()},[r,s,c,u]),w=(0,z.jsx)("div",{className:"al-grid","data-theme":o,children:a.map(g=>{let L=g.url[r]??g.url.production,P=vn(L,s),D=!1;if(!P)try{let R=new URL(L).pathname;D=u===R||u.startsWith(R+"/")}catch{D=!1}return(0,z.jsxs)("button",{type:"button",className:"al-grid-item","data-active":D||void 0,onPointerDown:v,onClick:R=>b(R,g),children:[(0,z.jsxs)("div",{className:"al-grid-item-left",children:[(0,z.jsx)("div",{className:"al-grid-item-icon",children:(0,z.jsx)("img",{src:g.iconUrl,alt:g.label,width:24,height:24,loading:"lazy"})}),(0,z.jsx)("span",{className:"al-grid-item-label",children:g.label}),g.isNew&&(0,z.jsx)("span",{className:"al-badge-new",children:"N"})]}),(0,z.jsx)("div",{className:"al-grid-item-right",children:g.badge&&(0,z.jsx)("span",{className:"al-badge",children:g.badge})})]},g.id)})});return l?(0,z.jsxs)(ze.Drawer.Portal,{children:[(0,z.jsx)(ze.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,z.jsxs)(ze.Drawer.Content,{className:Z("al-drawer-content",n),"data-theme":o,children:[(0,z.jsxs)("div",{className:"al-drawer-header",children:[(0,z.jsx)(ze.Drawer.Close,{className:"al-drawer-close",children:(0,z.jsx)(un,{})}),(0,z.jsx)(ze.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,z.jsx)(ze.Drawer.Close,{className:"al-drawer-close",children:(0,z.jsx)(gn,{})})]}),(0,z.jsx)("div",{className:"al-drawer-body",children:w})]})]}):(0,z.jsx)(qt.Portal,{children:(0,z.jsx)(qt.Content,{align:e,sideOffset:t,className:Z("al-popover-content",n),"data-theme":o,children:w})})}function vn(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var ne=V(require("react"),1),Ar=V(require("@radix-ui/react-popover"),1),Or=require("vaul");var Gt=require("react"),ko=(0,Gt.createContext)(null);function Pe(){let e=(0,Gt.useContext)(ko);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Zt=(r=>(r.CROSSx="crossx",r.MetaMask="io.metamask",r.Binance="com.binance.wallet",r))(Zt||{}),yt={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};var O=V(require("react"),1);var Ee=V(require("bignumber.js"),1);function fa(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 je(e,t){if(!e||e==="0")return"0.00";let n=new Ee.default(e).shiftedBy(-t),r=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(r,Ee.default.ROUND_DOWN)}function pe(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Co(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,r=Math.pow(10,n);return`$${(Math.floor(t*r)/r).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function yn(e,t,n){let o=new Ee.default(e).shiftedBy(-t).multipliedBy(new Ee.default(n));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(Ee.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,Ee.default.ROUND_DOWN):o.decimalPlaces(4,Ee.default.ROUND_DOWN)).toFormat()}`}function kn(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let n=t;if(n.includes("e")||n.includes("E")){let s=Number(n);if(!Number.isFinite(s)||s===0)return{displayValue:"0",isLowerBound:!1};n=fa(s.toFixed(18))}let[r="0",o=""]=n.split(".");if(Number(r)>=1){let s=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(r).toLocaleString("en-US")}.${s}`,isLowerBound:!1}}return o.length<4?{displayValue:`${r}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}var we={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},me={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}};var No={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"},Cn={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Lo(e,t){let n=me[e];if(t===n.cross)return Cn.cross;if(t===n.bsc)return Cn.bsc}var ua={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Kt(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:r=120,bg:o,format:l="png"}=n,s=ua[e],c=o?`&bg=${o}`:"";return`${s}/portrait/evm/${t}.${l}?size=${r}${c}`}var M=require("react/jsx-runtime");function Nn({size:e=16,className:t}){return(0,M.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,M.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,M.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ro({size:e=16,className:t}){return(0,M.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,M.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function kt({size:e=16,className:t}){return(0,M.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,M.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function To({size:e=24,className:t}){return(0,M.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,M.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ln({size:e=20,className:t}){return(0,M.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,M.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,M.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Rn({size:e=20,className:t}){return(0,M.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,M.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function Tn({size:e=20,className:t}){return(0,M.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,M.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function In({size:e=20,className:t}){return(0,M.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,M.jsx)("path",{d:"M8 5L13 10L8 15",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Pn({size:e=20,className:t}){return(0,M.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,M.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function En({size:e=16,className:t}){return(0,M.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,M.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,M.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Sn({size:e=16,className:t}){return(0,M.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,M.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,M.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Mn({size:e=42,className:t}){return(0,M.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,M.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}var _n="0x0000000000000000000000000000000000000001";var ga="0xa9059cbb",wa=/^0x[a-fA-F0-9]{40}$/,ha="nexus-cross:dapp-ui:send:recent:",An=10;function xa(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Ct(e){return e.toLowerCase()}function Nt(e){return wa.test(e)}function Io(e){return Ct(e.address)===_n}function Po(e){return`${ha}${e.toLowerCase()}`}function st(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Po(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>r!==null&&typeof r=="object"&&Nt(r.address)&&typeof r.updatedAt=="number").slice(0,An):[]}catch{return[]}}function Eo(e,t){if(typeof window>"u")return[];let n=Ct(t),r=[{address:n,updatedAt:Date.now()},...st(e).filter(o=>o.address!==n)].slice(0,An);try{window.localStorage.setItem(Po(e),JSON.stringify(r))}catch{return st(e)}return r}function So(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Po(e))}catch{}}function Mo(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[r="0",o=""]=n.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let l=BigInt(r||"0"),s=o.padEnd(t,"0"),c=s?BigInt(s):0n,d=10n**BigInt(t),a=l*d+c;return a<=0n?{error:"Amount must be greater than 0."}:{value:a}}function _o(e,t){let n=BigInt(e||"0"),r=10n**BigInt(t),o=n/r,l=n%r;if(l===0n)return o.toString();let s=xa(l.toString().padStart(t,"0"));return`${o.toString()}.${s}`}function Ao(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),r=t.toString(16).padStart(64,"0");return`${ga}${n}${r}`}E(`.wi-token-item--button{position:relative;width:100%;border:none;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:12px;padding:6px 8px;margin:-2px -8px;transition:background-color .15s ease,transform .15s ease}.wi-token-item--button:before{content:"";position:absolute;inset:-6px -16px;border-radius:16px}.wi-token-item--button:active{transform:scale(.99)}.wi-token-item--button:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.wi-view-send{animation:wi-slide-in-right .25s ease-out}.wi-send-body{flex:1;min-height:0;overflow:hidden}.wi-drawer-content[data-direction=bottom][data-view=send]{max-height:85dvh}.send-page{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.send-scroll{flex:1;min-height:0;display:flex;flex-direction:column;gap:16px;overflow-y:auto;overflow-x:hidden;padding:16px 24px 18px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .send-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.send-scroll::-webkit-scrollbar{width:4px}.send-scroll::-webkit-scrollbar-track{background:transparent}.send-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}[data-theme=light] .send-scroll::-webkit-scrollbar-thumb{background:#0000001f}.send-section{display:flex;flex-direction:column;gap:8px}.send-asset-card{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.send-asset-card:disabled{cursor:default}.send-asset-card:not(:disabled):hover,.send-asset-card[aria-expanded=true]{border-color:var(--wi-primary);background:var(--wi-surface-subtle)}.send-token-list{display:flex;flex-direction:column;gap:6px;max-height:180px;overflow-y:auto;padding:6px;border:1px solid var(--wi-border-subtle);border-radius:16px;background:var(--wi-surface-default)}.send-token-option{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:48px;border:none;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer}.send-token-option:hover,.send-token-option[data-selected]{background:var(--wi-surface-subtle)}.send-token-option:focus-visible,.send-asset-card:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-token-option-icon{flex-shrink:0;width:28px;height:28px;border-radius:8px;object-fit:contain;background:transparent}.send-token-option-symbol{color:var(--wi-texticon-primary);font-size:13px;font-weight:700;line-height:1.3}.send-token-option-balance{color:var(--wi-texticon-secondary);font-size:12px;font-weight:600;line-height:1.3;white-space:nowrap}.send-asset-left{display:flex;align-items:center;gap:12px;min-width:0}.send-asset-icon{flex-shrink:0;width:40px;height:40px;border-radius:12px;object-fit:contain;background:transparent}.send-asset-info,.send-asset-balance{min-width:0;display:flex;flex-direction:column}.send-asset-symbol{color:var(--wi-texticon-primary);font-size:15px;font-weight:700;line-height:1.3}.send-asset-name,.send-balance-label{color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.send-asset-balance{align-items:flex-end;text-align:right}.send-balance-value{color:var(--wi-texticon-primary);font-size:13px;font-weight:600;line-height:1.35;white-space:nowrap}.send-form{display:flex;flex-direction:column;gap:14px}.send-field{display:flex;flex-direction:column;gap:8px}.send-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.send-label{color:var(--wi-texticon-secondary);font-size:13px;font-weight:600;line-height:1.3}.send-input,.send-amount-wrap{width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);color:var(--wi-texticon-primary);font:inherit}.send-input{min-height:46px;padding:0 14px;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.send-input:focus{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input::placeholder{color:var(--wi-texticon-tertiary)}.send-address-wrap{display:flex;align-items:center;width:100%;box-sizing:border-box;border:1px solid var(--wi-border-subtle);border-radius:14px;background:var(--wi-surface-default);transition:border-color .15s ease,box-shadow .15s ease}.send-address-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--address{flex:1;min-width:0;border:none;background:transparent;box-shadow:none}.send-input--address:focus{box-shadow:none}.send-address-book-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;margin-right:2px;border:none;border-radius:12px;background:transparent;color:var(--wi-texticon-tertiary);cursor:pointer;transition:background-color .15s ease,color .15s ease}.send-address-book-btn:hover,.send-address-book-btn[aria-expanded=true]{background:var(--wi-surface-subtle);color:var(--wi-primary)}.send-address-book-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-picker{display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default)}.send-address-tabs{display:flex;align-items:center;gap:22px;border-bottom:1px solid var(--wi-border-subtle)}.send-address-tab{position:relative;border:none;background:transparent;color:var(--wi-texticon-tertiary);font:inherit;font-size:14px;font-weight:800;line-height:1.3;padding:0 0 12px;cursor:pointer}.send-address-tab[data-active]{color:var(--wi-primary)}.send-address-tab[data-active]:after{content:"";position:absolute;left:50%;bottom:-1px;width:34px;height:4px;border-radius:999px;background:var(--wi-primary);transform:translate(-50%)}.send-address-list{display:flex;flex-direction:column;gap:10px;max-height:224px;overflow-y:auto;padding-right:10px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}[data-theme=light] .send-address-list{scrollbar-color:rgba(0,0,0,.14) transparent}.send-address-list::-webkit-scrollbar{width:3px}.send-address-list::-webkit-scrollbar-track{background:transparent}.send-address-list::-webkit-scrollbar-thumb{background:#ffffff2e;border-radius:999px}[data-theme=light] .send-address-list::-webkit-scrollbar-thumb{background:#00000024}.send-address-option{display:flex;align-items:center;gap:12px;width:100%;min-height:54px;border:none;border-radius:14px;background:transparent;color:inherit;font:inherit;text-align:left;padding:8px;cursor:pointer;transition:background-color .15s ease}.send-address-option:hover{background:var(--wi-surface-subtle)}.send-address-option:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-address-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--wi-surface-subtle);color:var(--wi-primary);font-size:12px;font-weight:800;overflow:hidden}.send-address-avatar-img{position:relative;z-index:1;width:36px;height:36px;border-radius:50%;object-fit:cover}.send-address-avatar-fallback{position:absolute;inset:0;display:inline-flex;align-items:center;justify-content:center}.send-address-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.send-address-name{color:var(--wi-texticon-primary);font-size:14px;font-weight:800;line-height:1.3}.send-address-value{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:600;line-height:1.3}.send-address-empty{display:flex;align-items:center;justify-content:center;min-height:120px;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:700}.send-amount-wrap{display:flex;align-items:center;padding-right:12px}.send-amount-wrap:focus-within{border-color:var(--wi-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--wi-primary) 18%,transparent)}.send-input--amount{border:none;background:transparent;box-shadow:none;flex:1;min-width:0}.send-input--amount:focus{box-shadow:none}.send-amount-symbol{color:var(--wi-texticon-secondary);font-size:13px;font-weight:700}.send-max-btn{border:none;border-radius:999px;background:var(--wi-surface-subtle);color:var(--wi-primary);font:inherit;font-size:12px;font-weight:700;padding:4px 10px;cursor:pointer}.send-max-btn:disabled{cursor:not-allowed;opacity:.45}.send-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--wi-texticon-tertiary);font-size:12px;line-height:1.4}.send-meta span:last-child{color:var(--wi-texticon-secondary);font-weight:600}.send-message{border-radius:14px;padding:10px 12px;font-size:12px;line-height:1.45}.send-message--error{background:#ff50501f;color:#ff6b6b}.send-message--success{background:color-mix(in srgb,var(--wi-primary) 12%,transparent);color:var(--wi-primary)}.send-message span{font-weight:700}.send-submit-btn{width:100%;min-height:48px;border:none;border-radius:999px;background:var(--wi-primary);color:var(--wi-primary-contrast, #001410);font:inherit;font-size:15px;font-weight:800;cursor:pointer;transition:opacity .15s ease,transform .15s ease}.send-submit-btn:hover:not(:disabled){transform:translateY(-1px)}.send-submit-btn:disabled{cursor:not-allowed;opacity:.45}.send-footer{flex-shrink:0;padding:14px 24px 24px;border-top:1px solid var(--wi-border-subtle);background:var(--wi-surface-bg)}.send-page--success{background:var(--wi-surface-bg)}.send-success-body{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:32px 24px;text-align:center}.send-success-icon{display:inline-flex;align-items:center;justify-content:center}.send-success-icon[data-pending]{width:56px;height:56px;border-radius:50%;background:color-mix(in srgb,var(--wi-primary) 14%,transparent)}.send-success-spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--wi-primary) 22%,transparent);border-top-color:var(--wi-primary);border-radius:50%;animation:cross-send-spin .8s linear infinite}.send-success-copy{display:flex;flex-direction:column;gap:8px}.send-success-title{margin:0;color:var(--wi-texticon-primary);font-size:22px;font-weight:800;line-height:1.25}.send-success-desc{margin:0;color:var(--wi-texticon-tertiary);font-size:14px;font-weight:600;line-height:1.45}.send-success-hash-card{width:100%;display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid var(--wi-border-subtle);border-radius:18px;background:var(--wi-surface-default);box-sizing:border-box}.send-success-hash-label{color:var(--wi-texticon-tertiary);font-size:12px;font-weight:700;line-height:1.3;text-align:left}.send-success-hash-btn{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;border:none;border-radius:12px;background:var(--wi-surface-subtle);color:var(--wi-texticon-primary);font:inherit;font-size:14px;font-weight:800;padding:12px;cursor:pointer}.send-success-hash-btn:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px}.send-success-copy-icon{display:inline-flex;align-items:center;justify-content:center;min-width:32px;color:var(--wi-primary);font-size:12px;font-weight:800}@keyframes cross-send-spin{to{transform:rotate(360deg)}}
|
|
6
|
+
`);var m=require("react/jsx-runtime"),ba=1500,va=120;function Oo(e){return`${e.chainId}:${e.address.toLowerCase()}`}function ya(e,t){return e.name||`Account ${(e.index??t)+1}`}function ka(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Ca(e){return new Promise(t=>setTimeout(t,e))}function Na(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}function La(){return(0,m.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[(0,m.jsx)("path",{d:"M4.5 4.5C4.5 3.67 5.17 3 6 3h8.25c.69 0 1.25.56 1.25 1.25V16.5H6A1.5 1.5 0 0 1 4.5 15V4.5Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M4.5 14.5C4.5 13.67 5.17 13 6 13h9.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),(0,m.jsx)("path",{d:"M8 6.5h4M8 9h3",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Ra(){return(0,m.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none","aria-hidden":"true",children:[(0,m.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--wi-primary)"}),(0,m.jsx)("path",{d:"M17 28.5L24.2 35.5L39 20.5",stroke:"var(--wi-primary-contrast, #001410)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Lt({env:e,theme:t="dark",walletAddress:n,accounts:r=[],token:o,tokens:l=[],onTokenChange:s,sendTransaction:c,getTransactionReceipt:d,onSuccess:a,onConfirmSuccess:p}){let[f,v]=O.useState(""),[u,b]=O.useState(""),[w,g]=O.useState(""),[L,P]=O.useState(""),[D,R]=O.useState(!1),[B,h]=O.useState(!1),[N,H]=O.useState(!1),[C,U]=O.useState("account"),$=O.useRef(void 0),[ce,De]=O.useState(()=>st(n)),[re,j]=O.useState("idle"),de=Io(o),q=O.useMemo(()=>BigInt(o.quantity.numeric||"0"),[o.quantity.numeric]),We=O.useMemo(()=>je(o.quantity.numeric,o.quantity.decimals),[o.quantity.numeric,o.quantity.decimals]),Ce=O.useMemo(()=>r.filter(k=>k.address.toLowerCase()!==n.toLowerCase()),[r,n]),oe=Ce.length>0,Fe=O.useMemo(()=>ae(e),[e]),ft=t==="dark"?"1A1A2E":"F3F6F8",Be=l.length>0?l:[o],ve=Be.length>1&&!!s;O.useEffect(()=>{g(""),P(""),j("idle")},[o.address,o.chainId,f,u]),O.useEffect(()=>{b(""),R(!1)},[o.address,o.chainId]),O.useEffect(()=>{De(st(n))},[n]),O.useEffect(()=>()=>clearTimeout($.current),[]),O.useEffect(()=>{!oe&&C==="account"&&U("recent")},[C,oe]);let Ne=O.useCallback(()=>{b(_o(o.quantity.numeric,o.quantity.decimals))},[o.quantity.numeric,o.quantity.decimals]),Le=O.useCallback(k=>{v(k),h(!1)},[]),Re=O.useCallback(async()=>{if(L)try{await navigator.clipboard.writeText(L),H(!0),clearTimeout($.current),$.current=setTimeout(()=>H(!1),2e3)}catch{}},[L]),ue=O.useCallback(async k=>{if(k.preventDefault(),g(""),P(""),!c){j("error"),g("Sending is not available for this wallet.");return}let G=f.trim();if(!Nt(G)){j("error"),g("Enter a valid EVM recipient address.");return}let J=Mo(u,o.quantity.decimals);if("error"in J){j("error"),g(J.error);return}let le=J.value;if(le>q){j("error"),g("Amount exceeds available balance.");return}if(!de&&!Nt(o.address)){j("error"),g("Token contract address is invalid.");return}try{j("submitting");let ie=de?await c({to:G,value:le,chainId:o.chainId}):await c({to:Ct(o.address),data:Ao(G,le),value:0n,chainId:o.chainId});if(P(ie),j("confirming"),De(Eo(n,G)),a?.(ie),!d){j("success");return}for(let tt=0;tt<va;tt+=1){let ge=await d({hash:ie,chainId:o.chainId}).catch(()=>null);if(ge){if(Na(ge)){j("error"),g("Transaction reverted on-chain.");return}j("success");return}await Ca(ba)}j("error"),g("Transaction receipt was not found. Please check again later.")}catch(ie){j("error"),g(ie instanceof Error?ie.message:"Failed to send transaction.")}},[u,q,d,de,a,f,c,o.address,o.chainId,o.quantity.decimals,n]),Ve=re==="submitting"||q<=0n;if((re==="confirming"||re==="success")&&L){let k=re==="success";return(0,m.jsxs)("div",{className:"send-page send-page--success",children:[(0,m.jsxs)("div",{className:"send-success-body",children:[(0,m.jsx)("div",{className:"send-success-icon","data-pending":!k||void 0,children:k?(0,m.jsx)(Ra,{}):(0,m.jsx)("span",{className:"send-success-spinner"})}),(0,m.jsxs)("div",{className:"send-success-copy",children:[(0,m.jsx)("h3",{className:"send-success-title",children:k?"Transfer Complete":"Transfer in Progress"}),(0,m.jsx)("p",{className:"send-success-desc",children:k?"Transfer complete.":"Transfer in progress. Waiting for confirmation."})]}),(0,m.jsxs)("div",{className:"send-success-hash-card",children:[(0,m.jsx)("span",{className:"send-success-hash-label",children:"Transaction Hash"}),(0,m.jsxs)("button",{type:"button",className:"send-success-hash-btn",onClick:Re,"aria-label":"Copy transaction hash",children:[(0,m.jsx)("span",{children:pe(L)}),(0,m.jsx)("span",{className:"send-success-copy-icon","aria-hidden":!0,children:N?(0,m.jsx)(kt,{size:16}):"Copy"})]})]})]}),(0,m.jsx)("div",{className:"send-footer",children:(0,m.jsx)("button",{type:"button",className:"send-submit-btn",onClick:p,disabled:!k,children:k?"Confirm":"Sending..."})})]})}return(0,m.jsxs)("form",{className:"send-page",onSubmit:ue,children:[(0,m.jsxs)("div",{className:"send-scroll","data-vaul-no-drag":!0,children:[(0,m.jsxs)("section",{className:"send-section","aria-label":"Select token to send",children:[(0,m.jsx)("span",{className:"send-label",children:"Token"}),(0,m.jsxs)("button",{type:"button",className:"send-asset-card",onClick:()=>{ve&&R(k=>!k)},disabled:!ve,"aria-expanded":ve?D:void 0,children:[(0,m.jsxs)("span",{className:"send-asset-left",children:[(0,m.jsx)("img",{className:"send-asset-icon",src:o.icon_url,alt:o.symbol,width:40,height:40,draggable:!1,onError:k=>{k.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,m.jsxs)("span",{className:"send-asset-info",children:[(0,m.jsx)("span",{className:"send-asset-symbol",children:o.symbol}),(0,m.jsx)("span",{className:"send-asset-name",children:o.name})]})]}),(0,m.jsxs)("span",{className:"send-asset-balance",children:[(0,m.jsx)("span",{className:"send-balance-label",children:"Available"}),(0,m.jsxs)("span",{className:"send-balance-value",children:[We," ",o.symbol]})]})]}),ve&&D&&(0,m.jsx)("div",{className:"send-token-list",role:"listbox",children:Be.map(k=>{let G=Oo(k)===Oo(o);return(0,m.jsxs)("button",{type:"button",role:"option","aria-selected":G,className:"send-token-option","data-selected":G||void 0,onClick:()=>s?.(k),children:[(0,m.jsxs)("span",{className:"send-asset-left",children:[(0,m.jsx)("img",{className:"send-token-option-icon",src:k.icon_url,alt:k.symbol,width:28,height:28,draggable:!1,onError:J=>{J.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,m.jsxs)("span",{className:"send-asset-info",children:[(0,m.jsx)("span",{className:"send-token-option-symbol",children:k.symbol}),(0,m.jsx)("span",{className:"send-asset-name",children:k.name})]})]}),(0,m.jsx)("span",{className:"send-token-option-balance",children:je(k.quantity.numeric,k.quantity.decimals)})]},Oo(k))})})]}),(0,m.jsxs)("section",{className:"send-field","aria-label":"Recipient address",children:[(0,m.jsx)("span",{className:"send-label",children:"To"}),(0,m.jsxs)("div",{className:"send-address-wrap",children:[(0,m.jsx)("input",{className:"send-input send-input--address",value:f,onChange:k=>v(k.target.value),placeholder:"0x...",autoComplete:"off",spellCheck:!1}),(0,m.jsx)("button",{type:"button",className:"send-address-book-btn",onClick:()=>h(k=>!k),"aria-label":"Open address book","aria-expanded":B,children:(0,m.jsx)(La,{})})]}),B&&(0,m.jsxs)("div",{className:"send-address-picker",children:[(0,m.jsxs)("div",{className:"send-address-tabs",role:"tablist",children:[oe&&(0,m.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":C==="account"||void 0,"aria-selected":C==="account",onClick:()=>U("account"),children:"My Account"}),(0,m.jsx)("button",{type:"button",role:"tab",className:"send-address-tab","data-active":C==="recent"||void 0,"aria-selected":C==="recent",onClick:()=>U("recent"),children:"Recent"})]}),oe&&C==="account"?(0,m.jsx)("div",{className:"send-address-list",children:Ce.map((k,G)=>{let J=ya(k,G),le=Kt(Fe,k.address,{size:56,bg:ft});return(0,m.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>Le(k.address),children:[(0,m.jsxs)("span",{className:"send-address-avatar","aria-hidden":!0,children:[le&&(0,m.jsx)("img",{className:"send-address-avatar-img",src:le,alt:"",width:36,height:36,draggable:!1,onError:ie=>{ie.currentTarget.style.display="none"}}),(0,m.jsx)("span",{className:"send-address-avatar-fallback",children:ka(J)})]}),(0,m.jsxs)("span",{className:"send-address-copy",children:[(0,m.jsx)("span",{className:"send-address-name",children:J}),(0,m.jsx)("span",{className:"send-address-value",children:pe(k.address)})]})]},k.address)})}):ce.length>0?(0,m.jsx)("div",{className:"send-address-list",children:ce.map(k=>(0,m.jsxs)("button",{type:"button",className:"send-address-option",onClick:()=>Le(k.address),children:[(0,m.jsx)("span",{className:"send-address-avatar","aria-hidden":!0,children:k.address.slice(2,4).toUpperCase()}),(0,m.jsxs)("span",{className:"send-address-copy",children:[(0,m.jsx)("span",{className:"send-address-name",children:pe(k.address)}),(0,m.jsx)("span",{className:"send-address-value",children:"Recently sent"})]})]},k.address))}):(0,m.jsx)("div",{className:"send-address-empty",children:"No Send History"})]})]}),(0,m.jsxs)("label",{className:"send-field",children:[(0,m.jsxs)("span",{className:"send-label-row",children:[(0,m.jsx)("span",{className:"send-label",children:"Amount"}),(0,m.jsx)("button",{type:"button",className:"send-max-btn",onClick:Ne,disabled:q<=0n||re==="submitting",children:"Max"})]}),(0,m.jsxs)("div",{className:"send-amount-wrap",children:[(0,m.jsx)("input",{className:"send-input send-input--amount",value:u,onChange:k=>b(k.target.value),placeholder:"0.00",inputMode:"decimal",autoComplete:"off"}),(0,m.jsx)("span",{className:"send-amount-symbol",children:o.symbol})]})]}),(0,m.jsxs)("div",{className:"send-meta",children:[(0,m.jsx)("span",{children:"From"}),(0,m.jsx)("span",{children:pe(n)})]}),(0,m.jsxs)("div",{className:"send-meta",children:[(0,m.jsx)("span",{children:"Network"}),(0,m.jsxs)("span",{children:["Chain ID ",o.chainId]})]}),w&&(0,m.jsx)("div",{className:"send-message send-message--error",role:"alert",children:w})]}),(0,m.jsx)("div",{className:"send-footer",children:(0,m.jsx)("button",{type:"submit",className:"send-submit-btn",disabled:Ve,children:re==="submitting"?"Sending...":"Send"})})]})}var On=V(require("@radix-ui/react-popover"),1),Dn=require("vaul");var qe=require("react/jsx-runtime");function Wn({asChild:e,className:t,children:n}){let{isMobile:r,theme:o,walletAddress:l}=Pe(),s=n!=null,c=e??!0,d=s?n:(0,qe.jsxs)("button",{type:"button",className:Z("wi-trigger-btn",t),"data-theme":o,"data-mobile":r||void 0,children:[(0,qe.jsx)(Nn,{size:r?14:16}),(0,qe.jsx)("span",{className:"wi-trigger-address",children:pe(l)})]});return r?(0,qe.jsx)(Dn.Drawer.Trigger,{asChild:c,children:d}):(0,qe.jsx)(On.Trigger,{asChild:c,children:d})}var F=V(require("react"),1),so=V(require("@radix-ui/react-popover"),1),It=require("vaul");var dt=V(require("bignumber.js"),1);var Fn=require("@tanstack/react-query"),Bn=require("react");var Yt="user-balance";async function Ta(e,t,n,r){let o=new URLSearchParams({networkId:`eip155:${t}`,account:n}),l=await fetch(`${e}/v1/public/token/balance?${o}`,{cache:"no-store",signal:r});if(!l.ok)throw new Error(`Failed to fetch token balance: ${l.status}`);let s=await l.json();if(s.code!==200)throw new Error(`Token balance API error: ${s.code}`);return s.data}function Ge(e,t,n=!0){let r=we[e],o=me[e],l=[o.cross,o.bsc],s=(0,Fn.useQueries)({queries:l.map(p=>({queryKey:[Yt,e,t,p],queryFn:({signal:f})=>Ta(r,p,t,f),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),c=s.some(p=>p.isLoading),d=s.some(p=>p.isError);return{tokens:(0,Bn.useMemo)(()=>{let p=[];for(let f of s)f.data&&p.push(...f.data);return p},[s]),isLoading:c,isError:d}}var Qt=require("@tanstack/react-query"),Vn=require("react");var Ia="forge-holdings",Pa="forge-token-image";async function Ea(e,t,n){let r=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!r.ok)throw new Error(`Failed to fetch forge holdings: ${r.status}`);let o=await r.json();if(!o.success)throw new Error("Forge holdings API error");return o.data.items}async function Sa(e,t,n){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!r.ok)return{address:t,image_url:""};let o=await r.json();return o.success?{address:t,image_url:o.data.token.image_url}:{address:t,image_url:""}}function Hn(e,t,n=!0){let r=No[e],{data:o,...l}=(0,Qt.useQuery)({queryKey:[Ia,e,t],queryFn:({signal:s})=>Ea(r,t,s),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:o??[],...l}}function $n(e,t,n=!0){let r=No[e],o=(0,Qt.useQueries)({queries:t.map(s=>({queryKey:[Pa,e,s],queryFn:({signal:c})=>Sa(r,s,c),enabled:n,staleTime:1/0}))});return{imageMap:(0,Vn.useMemo)(()=>{let s=new Map;for(let c of o)c.data&&s.set(c.data.address,c.data.image_url);return s},[o])}}var zn=require("@tanstack/react-query"),Un=require("react");var Xt="token-stats";function Ze(e,t){return`${e}:${t.toLowerCase()}`}function Ke(e,t=!0){let n=we[e],{data:r,...o}=(0,zn.useQuery)({queryKey:[Xt,e],queryFn:async({signal:s})=>{let c=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch token stats: ${c.status}`);let d=await c.json();if(d.code!==200)throw new Error(`Token stats API error: ${d.code}`);return d},enabled:t,staleTime:3e4});return{statsMap:(0,Un.useMemo)(()=>{let s=new Map;if(!r?.data)return s;for(let c of r.data){let d=Ze(c.chain_id,c.address);s.set(d,c)}return s},[r]),...o}}var jn=require("@tanstack/react-query"),qn=require("react");var Ma="token-info";function Do(e,t){return`${t.toLowerCase()}_${e}`}function Gn(e,t=!0){let n=we[e],{data:r,...o}=(0,jn.useQuery)({queryKey:[Ma,e],queryFn:async({signal:s})=>{let c=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch token info: ${c.status}`);let d=await c.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:1/0});return{categoryMap:(0,qn.useMemo)(()=>{let s=new Map;if(!r?.data)return s;for(let c of r.data){let d=Do(c.chain_id,c.address);s.set(d,c.category)}return s},[r]),...o}}var Zn=require("react"),Jt=V(require("bignumber.js"),1);function Kn(e,t,n){let{tokens:r,isLoading:o}=Ge(e,t,n),{statsMap:l}=Ke(e,n);return(0,Zn.useMemo)(()=>{let s=new Jt.default(0);for(let p of r){let f=l.get(Ze(p.chainId,p.address));if(!f)continue;let u=new Jt.default(p.quantity.numeric).shiftedBy(-p.quantity.decimals).multipliedBy(new Jt.default(f.price));u.isNaN()||(s=s.plus(u))}let c=s.toFixed(),{displayValue:d,isLowerBound:a}=kn(c);return{totalUsd:c,displayValue:d,isLowerBound:a,isLoading:o}},[r,l,o])}var Ir=require("qrcode.react");function he(e,t,n,r){if(!r||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let o;try{o=r(t,n)}catch(a){console.error("[dapp-ui] onOutlink threw:",a);return}let l=a=>{typeof window>"u"||window.open(a,"_blank","noopener,noreferrer")};if((a=>!!a&&(typeof a=="object"||typeof a=="function")&&typeof a.then=="function")(o)){let a=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,p=f=>{if(f===null){a?.close();return}let v=f??t;if(a)try{a.location.href=v}catch{a.close(),l(v)}else l(v)};o.then(p,f=>{console.error("[dapp-ui] onOutlink rejected:",f),a?.close()});return}let c=o;if(c===null)return;l(c??t)}var Xe=V(require("react"),1),Tr=require("vaul");var eo=require("react"),Rt=(0,eo.createContext)(null);function te(){let e=(0,eo.useContext)(Rt);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var Yn=require("vaul");var Wo=require("react/jsx-runtime");function Qn({asChild:e,children:t}){let{walletAddress:n}=te(),r=t!=null,o=e??!0,l=r?t:(0,Wo.jsx)("button",{type:"button",children:pe(n)});return(0,Wo.jsx)(Yn.Drawer.Trigger,{asChild:o,children:l})}var Tt=require("vaul");var fe=V(require("react"),1),Lr=require("@tanstack/react-query");var ar=require("react"),ao=V(require("bignumber.js"),1);var er=require("@tanstack/react-query"),Fo=require("react");var to={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"},Xn={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},oo={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"},Se={dev:"https://stg-x.crosstoken.io",stage:"https://stg-x.crosstoken.io",production:"https://x.crosstoken.io"},Jn={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 _a="wp:reward-pools";function no(e,t=!0){let n=to[e],{data:r,...o}=(0,er.useQuery)({queryKey:[_a,e],queryFn:async({signal:c})=>{let d=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:c});if(!d.ok)throw new Error(`Failed to fetch pools: ${d.status}`);let a=await d.json();if(a.code!==200)throw new Error(`Pools API error: ${a.code}`);return a},enabled:t,staleTime:0}),l=(0,Fo.useMemo)(()=>r?.data.pools.filter(c=>c.pool_type==="CrossPool")??[],[r]),s=(0,Fo.useMemo)(()=>r?.data.pools.filter(c=>c.pool_type==="GamePool")??[],[r]);return{crossPools:l,gamePools:s,allPools:r?.data.pools??[],...o}}var tr=require("@tanstack/react-query"),or=require("react");var Aa="wp:user-deposits";function ro(e,t,n=!0){let r=to[e],o=n&&!!t,{data:l,...s}=(0,tr.useQuery)({queryKey:[Aa,e,t],queryFn:async({signal:d})=>{let a=await fetch(`${r}/v1/users/${t}/deposits`,{cache:"no-store",signal:d});if(!a.ok)throw new Error(`Deposits fetch failed: ${a.status}`);let p=await a.json();if(p.code!==200)throw new Error(`Deposits API error: ${p.code}`);return p},enabled:o,staleTime:0});return{depositMap:(0,or.useMemo)(()=>{let d=new Map;if(!l?.data.user_deposits)return d;for(let a of l.data.user_deposits)d.set(a.pool_address.toLowerCase(),a);return d},[l]),deposits:l?.data.user_deposits??[],...s}}var Bo=require("@tanstack/react-query"),Vo=require("react");function xe(e,t,n,r=!0){let o=Jn[e][t],l=r&&!!n,{data:s,...c}=(0,Bo.useQuery)({queryKey:["wp:dex-pairs",e,t],queryFn:async({signal:b})=>{let w=await fetch(`${o}/pair-info`,{cache:"no-store",signal:b});if(!w.ok)throw new Error(`pair-info fetch failed: ${w.status}`);let g=await w.json();if(g.code!==200)throw new Error(`pair-info API error: ${g.code}`);return g},enabled:r,staleTime:0}),d=s?.data??[],a=(0,Vo.useMemo)(()=>{let b=new Map;for(let w of d)b.set(w.pair_address.toLowerCase(),w);return b},[d]),{data:p,...f}=(0,Bo.useQuery)({queryKey:["wp:dex-orders",e,t,n],queryFn:async({signal:b})=>{let w=Math.floor(Date.now()/1e3),g=new URLSearchParams({owner:n,size:"200",start_date:"0",end_date:String(w)}),L=await fetch(`${o}/open-order?${g}`,{cache:"no-store",signal:b});if(!L.ok)throw new Error(`open-order fetch failed: ${L.status}`);let P=await L.json();if(P.code!==200)throw new Error(`open-order API error: ${P.code}`);return P.data?.data??[]},enabled:l,staleTime:0}),v=p??[],u=(0,Vo.useMemo)(()=>{let b=new Map;for(let w of v){let g=w.pair.toLowerCase();b.has(g)||b.set(g,{buys:[],sells:[]});let L=b.get(g);w.order_side===1?L.buys.push(w):L.sells.push(w)}return b},[v]);return{allPairs:d,pairMap:a,orders:v,ordersByPair:u,isEmpty:v.length===0,isLoading:c.isLoading||f.isLoading}}var Oa=["var(--wp-blue)","var(--wp-purple)","var(--wp-red)","var(--wp-orange)"],nr="var(--wp-green)",rr=4;function ir(e,t,n=!0){let r=n&&!!t,{allPools:o}=no(e,r),{depositMap:l}=ro(e,t,r),{allPairs:s,pairMap:c,ordersByPair:d}=xe(e,"cross",t,r),{allPairs:a,pairMap:p,ordersByPair:f}=xe(e,"crossd",t,r),{allPairs:v,pairMap:u,ordersByPair:b}=xe(e,"forge",t,r);return(0,ar.useMemo)(()=>{let w=new Map,g=new Map,L=(h,N)=>{!Number.isFinite(N)||N<=0||g.set(h,(g.get(h)??0)+N)};for(let h of o){let N=Number(h.deposit_token.price);N>0&&w.set(h.deposit_token.symbol,N);for(let H of h.reward_tokens){let C=Number(H.price);C>0&&w.set(H.symbol,C)}}for(let h of[...s,...a,...v]){let N=w.get(h.quote_symbol),H=Number(h.billboard?.price);N&&H>0&&!w.has(h.base_symbol)&&w.set(h.base_symbol,H*N)}for(let h of o){let N=l.get(h.pool_address.toLowerCase());if(!N)continue;let H=new ao.default(N.deposited_amount).shiftedBy(-h.deposit_token.decimals).toNumber();if(L(h.deposit_token.symbol,H),h.reward_tokens.length>0){let C=h.reward_tokens[0],U=new ao.default(N.claimable_reward).shiftedBy(-C.decimals).toNumber();L(C.symbol,U)}}let P=[{pairMap:c,ordersByPair:d},{pairMap:p,ordersByPair:f},{pairMap:u,ordersByPair:b}];for(let{pairMap:h,ordersByPair:N}of P)for(let[H,C]of N){let U=h.get(H);if(U){for(let $ of C.buys){let ce=Number($.amount)-Number($.filled);L(U.quote_symbol,ce*Number($.price))}for(let $ of C.sells){let ce=Number($.amount)-Number($.filled);L(U.base_symbol,ce)}}}let D=[],R=0;for(let[h,N]of g){let H=w.get(h)??0,C=N*H;C>0&&(D.push({symbol:h,usdValue:C}),R+=C)}D.sort((h,N)=>N.usdValue-h.usdValue);let B=[];if(R>0){let h=D.slice(0,rr),N=D.slice(rr);for(let C=0;C<h.length;C++)B.push({symbol:h[C].symbol,usdValue:h[C].usdValue,percentage:Math.round(h[C].usdValue/R*100),color:Oa[C]??nr});if(N.length>0){let C=N.reduce((U,$)=>U+$.usdValue,0);B.push({symbol:"Others",usdValue:C,percentage:Math.round(C/R*100),color:nr})}let H=B.reduce((C,U)=>C+U.percentage,0);H!==100&&B.length>0&&(B[0].percentage+=100-H)}return{totalUsd:R,formattedTotal:R>0?`$${new ao.default(R).toFormat(2)}`:"$0.00",segments:B}},[o,l,s,c,d,a,p,f,v,u,b])}var ye=require("react/jsx-runtime");function sr({size:e=22,className:t}){return(0,ye.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ye.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function lr({size:e=22,className:t}){return(0,ye.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,ye.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,ye.jsx)("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function cr({size:e=12,className:t}){return(0,ye.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,ye.jsx)("path",{d:"M6 11A5 5 0 106 1a5 5 0 000 10zM6 8V6M6 4h.005",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})})}var dr=require("@tanstack/react-query"),pr=require("react");var Da="wp:token-info";function Me(e,t=!0){let n=we[e],r=me[e].cross,{data:o,...l}=(0,dr.useQuery)({queryKey:[Da,e],queryFn:async({signal:a})=>{let p=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:a});if(!p.ok)throw new Error(`Failed to fetch token info: ${p.status}`);let f=await p.json();if(f.code!==200)throw new Error(`Token info API error: ${f.code}`);return f},enabled:t,staleTime:300*1e3}),{byChainAddr:s,byChainSym:c}=(0,pr.useMemo)(()=>{let a=new Map,p=new Map;if(!o?.data)return{byChainAddr:a,byChainSym:p};for(let f of o.data){let v=f.address.toLowerCase();a.set(`${f.chain_id}:${v}`,f),a.set(v,f);let u=f.symbol.replace(/^t/,"").toUpperCase(),b=`${f.chain_id}:${u}`;p.has(b)||p.set(b,f),p.has(u)||p.set(u,f)}return{byChainAddr:a,byChainSym:p}},[o]);return{getTokenImage:(a,p)=>{let f=a.toLowerCase(),v=s.get(`${r}:${f}`);if(v?.image)return v.image;let u=s.get(f);if(u?.image)return u.image;if(p){let b=p.replace(/^t/,"").toUpperCase(),w=c.get(`${r}:${b}`);if(w?.image)return w.image;let g=c.get(b);if(g?.image)return g.image}return""},...l}}var _e=require("react/jsx-runtime");function be({title:e,icon:t,iconFit:n="cover",isEmpty:r,children:o}){return(0,_e.jsxs)("div",{className:"wp-svc-card",children:[(0,_e.jsxs)("div",{className:"wp-svc-card-head",children:[(0,_e.jsx)("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),(0,_e.jsx)("span",{className:"wp-svc-card-title",children:e})]}),r?(0,_e.jsx)("div",{className:"wp-svc-empty",children:"No assets yet"}):(0,_e.jsx)("div",{className:"wp-svc-items",children:o})]})}var lt=V(require("bignumber.js"),1),Q=require("react/jsx-runtime"),Wa="CROSS Rewards",Fa="https://contents.crosstoken.io/frontend/common/app-launcher/icons/award.svg";function mr(e,t){let n=new lt.default(e).shiftedBy(-t);return n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,lt.default.ROUND_DOWN):n.toFormat(4,lt.default.ROUND_DOWN)}function fr(){let{env:e,walletAddress:t,onOutlink:n}=te(),r=!!t,{allPools:o}=no(e,r),{depositMap:l}=ro(e,t,r),{getTokenImage:s}=Me(e,r),c=a=>`${Xn[e]}/rewards/${a.pool_address}?action=withdraw`,d=o.filter(a=>{let p=l.get(a.pool_address.toLowerCase()),f=p?.deposited_amount??"0",v=p?.claimable_reward??"0";return!(new lt.default(f).isZero()&&new lt.default(v).isZero())});return(0,Q.jsx)(be,{title:Wa,icon:Fa,isEmpty:d.length===0,children:d.map(a=>{let p=l.get(a.pool_address.toLowerCase()),f=p?.deposited_amount??"0",v=c(a);return(0,Q.jsxs)("a",{className:"wp-item","data-side":"reward",href:v,target:"_blank",rel:"noopener noreferrer",onClick:u=>he(u,v,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:a,userDeposit:p}},n),children:[(0,Q.jsxs)("div",{className:"wp-item-body",children:[(0,Q.jsxs)("div",{className:"wp-item-field",children:[(0,Q.jsxs)("span",{className:"wp-item-label",children:["Deposited (",a.deposit_token.symbol,")"]}),(0,Q.jsxs)("div",{className:"wp-svc-token",children:[s(a.deposit_token.address,a.deposit_token.symbol)&&(0,Q.jsx)("img",{className:"wp-svc-token-icon",src:s(a.deposit_token.address,a.deposit_token.symbol),alt:""}),(0,Q.jsx)("span",{children:mr(f,a.deposit_token.decimals)})]})]}),(0,Q.jsxs)("div",{className:"wp-item-field",children:[(0,Q.jsxs)("span",{className:"wp-item-label",children:["Rewards (",a.reward_tokens.map(u=>u.symbol).join(", "),")"]}),a.reward_tokens.map(u=>{let b=s(u.address,u.symbol);return(0,Q.jsxs)("div",{className:"wp-svc-token",children:[b&&(0,Q.jsx)("img",{className:"wp-svc-token-icon",src:b,alt:""}),(0,Q.jsx)("span",{children:p?mr(p.claimable_reward,u.decimals):"0"})]},u.address)})]})]}),(0,Q.jsxs)("div",{className:"wp-item-badges",children:[(0,Q.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Claim"}),(0,Q.jsx)("span",{className:"wp-badge wp-badge--muted",children:"Withdraw"})]})]},a.pool_address)})})}var $o=V(require("bignumber.js"),1);var I=require("react/jsx-runtime");function Ho(e){let t=new $o.default(e);if(t.isNaN())return e;let n=t.decimalPlaces()??0;return t.toFormat(n)}function ur(e){let t=new $o.default(e.amount).minus(e.filled);return Ho(t.toString())}function ct({market:e,pairMap:t,ordersByPair:n,getDexUrl:r,getTokenImage:o}){let{onOutlink:l}=te(),s=[];for(let[c,d]of n){let a=t.get(c),p=a?o(a.base_address,a.base_symbol):"",f=a?o(a.quote_address,a.quote_symbol):"",v=r(c);for(let u of d.buys)s.push((0,I.jsxs)("a",{className:"wp-item","data-side":"buy",href:v,target:"_blank",rel:"noopener noreferrer",onClick:b=>he(b,v,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"buy",order:u,pair:a}},l),children:[(0,I.jsxs)("div",{className:"wp-item-body",children:[(0,I.jsxs)("div",{className:"wp-item-field",children:[(0,I.jsxs)("span",{className:"wp-item-label wp-item-label--buy",children:["Buy",a?.base_symbol?` (${a.base_symbol})`:""]}),(0,I.jsxs)("div",{className:"wp-svc-token",children:[p&&(0,I.jsx)("img",{className:"wp-svc-token-icon",src:p,alt:""}),(0,I.jsx)("span",{children:ur(u)})]})]}),(0,I.jsxs)("div",{className:"wp-item-field",children:[(0,I.jsxs)("span",{className:"wp-item-label",children:["Price",a?.quote_symbol?` (${a.quote_symbol})`:""]}),(0,I.jsxs)("div",{className:"wp-svc-token",children:[f&&(0,I.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""}),(0,I.jsx)("span",{children:Ho(u.price)})]})]})]}),(0,I.jsx)("div",{className:"wp-item-badges",children:(0,I.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`buy-${u.order_id}`));for(let u of d.sells)s.push((0,I.jsxs)("a",{className:"wp-item","data-side":"sell",href:v,target:"_blank",rel:"noopener noreferrer",onClick:b=>he(b,v,{category:"portfolio",origin:"portfolio-dex-order",payload:{market:e,side:"sell",order:u,pair:a}},l),children:[(0,I.jsxs)("div",{className:"wp-item-body",children:[(0,I.jsxs)("div",{className:"wp-item-field",children:[(0,I.jsxs)("span",{className:"wp-item-label wp-item-label--sell",children:["Sell",a?.base_symbol?` (${a.base_symbol})`:""]}),(0,I.jsxs)("div",{className:"wp-svc-token",children:[p&&(0,I.jsx)("img",{className:"wp-svc-token-icon",src:p,alt:""}),(0,I.jsx)("span",{children:ur(u)})]})]}),(0,I.jsxs)("div",{className:"wp-item-field",children:[(0,I.jsxs)("span",{className:"wp-item-label",children:["Price",a?.quote_symbol?` (${a.quote_symbol})`:""]}),(0,I.jsxs)("div",{className:"wp-svc-token",children:[f&&(0,I.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""}),(0,I.jsx)("span",{children:Ho(u.price)})]})]})]}),(0,I.jsx)("div",{className:"wp-item-badges",children:(0,I.jsx)("span",{className:"wp-badge wp-badge--red",children:"Cancel"})})]},`sell-${u.order_id}`))}return(0,I.jsx)(I.Fragment,{children:s})}var zo=require("react/jsx-runtime"),Ba="Gametoken - CROSS",Va="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function gr(){let{env:e,walletAddress:t}=te(),n=!!t,{pairMap:r,ordersByPair:o,isEmpty:l}=xe(e,"cross",t,n),{getTokenImage:s}=Me(e,n);return(0,zo.jsx)(be,{title:Ba,icon:Va,isEmpty:l,children:(0,zo.jsx)(ct,{market:"cross",pairMap:r,ordersByPair:o,getDexUrl:d=>{let a=r.get(d.toLowerCase());return`${Se[e]}/gametoken/cross/${a?.base_symbol??""}`},getTokenImage:s})})}var Uo=require("react/jsx-runtime"),Ha="Gametoken - CROSSD",$a="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function wr(){let{env:e,walletAddress:t}=te(),n=!!t,{pairMap:r,ordersByPair:o,isEmpty:l}=xe(e,"crossd",t,n),{getTokenImage:s}=Me(e,n);return(0,Uo.jsx)(be,{title:Ha,icon:$a,isEmpty:l,children:(0,Uo.jsx)(ct,{market:"crossd",pairMap:r,ordersByPair:o,getDexUrl:d=>{let a=r.get(d.toLowerCase());return`${Se[e]}/gametoken/crossd/${a?.base_symbol??""}`},getTokenImage:s})})}var jo=require("react/jsx-runtime"),za="Gametoken - Forge",Ua="https://contents.crosstoken.io/frontend/common/app-launcher/icons/dex.svg";function hr(){let{env:e,walletAddress:t}=te(),n=!!t,{pairMap:r,ordersByPair:o,isEmpty:l}=xe(e,"forge",t,n),{getTokenImage:s}=Me(e,n);return l?null:(0,jo.jsx)(be,{title:za,icon:Ua,isEmpty:l,children:(0,jo.jsx)(ct,{market:"forge",pairMap:r,ordersByPair:o,getDexUrl:d=>{let a=r.get(d.toLowerCase());return`${Se[e]}/gametoken/forge/${a?.base_symbol??""}`},getTokenImage:s})})}var io=V(require("bignumber.js"),1),Cr=require("react");var xr=require("@tanstack/react-query");var ja="wp:forge-pools";function br(e,t,n=!0){let r=oo[e],o=n&&!!t,{data:l,...s}=(0,xr.useQuery)({queryKey:[ja,e,t],queryFn:async()=>{let d=await fetch(`${r}/v1/users/${t}/pools`,{cache:"no-store"});if(!d.ok)throw new Error(`forge pools fetch failed: ${d.status}`);return(await d.json()).data?.items??[]},enabled:o,staleTime:0}),c=l??[];return{pools:c,isEmpty:c.length===0,...s}}var vr=require("@tanstack/react-query"),yr=require("react");var qa="wp:forge-token-detail";async function Ga(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function kr(e,t,n=!0){let r=oo[e],o=(0,vr.useQueries)({queries:t.map(c=>({queryKey:[qa,e,c],queryFn:()=>Ga(r,c),enabled:n&&!!c,staleTime:3e4}))}),l=(0,yr.useMemo)(()=>{let c=new Map;for(let d=0;d<o.length;d++){let a=o[d]?.data,p=t[d];a&&p&&c.set(p.toLowerCase(),a)}return c},[o,t]),s=o.some(c=>c.isLoading);return{detailMap:l,isLoading:s}}var K=require("react/jsx-runtime"),Za="Forge",Ka="https://x.crosstoken.io/forge/favicon-96x96.png",Ya=18,Qa="https://contents.crosstoken.io/wallet/token/images/FT.png";function Xa(e){if(!e||e==="0")return"0";let t=new io.default(e).shiftedBy(-Ya);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,io.default.ROUND_DOWN):t.toFormat(4,io.default.ROUND_DOWN)}function Ja(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 Nr(){let{env:e,walletAddress:t,onOutlink:n}=te(),r=!!t,{pools:o,isEmpty:l}=br(e,t,r),s=(0,Cr.useMemo)(()=>o.map(a=>a.token.address),[o]),{detailMap:c}=kr(e,s,r&&s.length>0),d=a=>`${Se[e]}/forge/token/${a.token.address}`;return(0,K.jsx)(be,{title:Za,icon:Ka,iconFit:"contain",isEmpty:l,children:o.map(a=>{let p=c.get(a.token.address.toLowerCase()),f=p?.image_url||p?.image||a.token.image||Qa,v=p?.symbol||a.token.symbol,u=d(a);return(0,K.jsxs)("a",{className:"wp-item","data-side":"lp",href:u,target:"_blank",rel:"noopener noreferrer",onClick:b=>he(b,u,{category:"portfolio",origin:"portfolio-forge",payload:{pool:a,tokenDetail:p}},n),children:[(0,K.jsxs)("div",{className:"wp-item-body",children:[(0,K.jsxs)("div",{className:"wp-item-field",children:[(0,K.jsxs)("span",{className:"wp-item-label",children:["Pair (",v,")"]}),(0,K.jsx)("div",{className:"wp-svc-token",children:(0,K.jsx)("img",{className:"wp-svc-token-icon",src:f,alt:""})})]}),(0,K.jsxs)("div",{className:"wp-item-field",children:[(0,K.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,K.jsx)("div",{className:"wp-svc-token",children:(0,K.jsx)("span",{children:Xa(a.lp_balance)})})]}),(0,K.jsxs)("div",{className:"wp-item-field",children:[(0,K.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,K.jsx)("div",{className:"wp-svc-token",children:(0,K.jsx)("span",{children:Ja(a.pool_ownership)})})]})]}),(0,K.jsx)("div",{className:"wp-item-badges",children:(0,K.jsx)("span",{className:"wp-badge wp-badge--mint",children:"Withdraw"})})]},a.pair_address)})})}E(`.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}
|
|
7
|
+
`);var T=require("react/jsx-runtime"),qo=5,ei="wp:";function Ye({env:e,theme:t="dark",walletAddress:n,onBack:r,showHeader:o=!0,variant:l="embed",className:s,sendTransaction:c,onOutlink:d}){let a=ae(e),p=!!n,f=(0,Lr.useQueryClient)(),{segments:v}=ir(a,n,p),[u,b]=fe.useState(qo),[w,g]=fe.useState(!1),L=fe.useCallback(()=>{f.invalidateQueries({predicate:h=>typeof h.queryKey[0]=="string"&&h.queryKey[0].startsWith(ei)})},[f]),P=fe.useCallback(()=>{L(),g(!0),setTimeout(()=>g(!1),600),b(qo)},[L]);fe.useEffect(()=>{if(!p)return;let h=setInterval(()=>{b(N=>N<=1?(P(),qo):N-1)},1e3);return()=>clearInterval(h)},[p,P]);let D=fe.useCallback(()=>{r?.()},[r]),R=fe.useMemo(()=>({env:a,theme:t,open:!0,walletAddress:n,close:D,sendTransaction:c,onOutlink:d}),[a,t,n,D,c,d]),B=(0,T.jsxs)(T.Fragment,{children:[o&&(0,T.jsxs)("div",{className:"wp-header",children:[r?(0,T.jsx)("button",{type:"button",className:"wp-header-btn",onClick:r,children:(0,T.jsx)(sr,{})}):(0,T.jsx)("span",{className:"wp-header-btn","aria-hidden":!0}),(0,T.jsx)("h2",{className:"wp-header-title",children:"My Portfolio"}),(0,T.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn",onClick:P,children:[(0,T.jsx)(lr,{className:w?"wp-spin-once":void 0}),p&&(0,T.jsx)("span",{className:"wp-refresh-badge",children:u})]})]}),(0,T.jsx)("div",{className:"wp-top",children:v.length>0&&(0,T.jsxs)("div",{className:"wp-asset",children:[(0,T.jsxs)("div",{className:"wp-asset-head",children:[(0,T.jsx)("span",{className:"wp-asset-head-label",children:"Consolidated Asset"}),(0,T.jsx)("span",{className:"wp-asset-head-icon",children:(0,T.jsx)(cr,{})})]}),(0,T.jsx)("div",{className:"wp-bar",children:v.map(h=>(0,T.jsx)("div",{className:"wp-bar-seg",style:{flex:`${h.percentage} 0 0`,background:h.color},children:h.percentage>=5&&(0,T.jsxs)("span",{className:"wp-bar-seg-pct",children:[h.percentage,"%"]})},h.symbol))}),(0,T.jsx)("div",{className:"wp-legend",children:v.map(h=>(0,T.jsxs)("div",{className:"wp-legend-item",children:[(0,T.jsx)("span",{className:"wp-legend-dot",style:{background:h.color}}),(0,T.jsx)("span",{className:"wp-legend-label",children:h.symbol})]},h.symbol))})]})}),(0,T.jsx)("div",{className:"wp-body",children:(0,T.jsxs)("div",{className:"wp-body-inner",children:[(0,T.jsx)(fr,{}),(0,T.jsx)(gr,{}),(0,T.jsx)(wr,{}),(0,T.jsx)(hr,{}),(0,T.jsx)(Nr,{})]})})]});return(0,T.jsx)(Rt.Provider,{value:R,children:l==="none"?B:(0,T.jsx)("div",{className:Z(l==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:B})})}var Qe=require("react/jsx-runtime");function Rr({className:e}){let{env:t,theme:n,walletAddress:r,close:o,sendTransaction:l}=te();return(0,Qe.jsxs)(Tt.Drawer.Portal,{children:[(0,Qe.jsx)(Tt.Drawer.Overlay,{className:"wp-overlay"}),(0,Qe.jsxs)(Tt.Drawer.Content,{className:Z("wp-fullscreen",e),"data-theme":n,children:[(0,Qe.jsx)(Tt.Drawer.Title,{className:"wp-sr-only",children:"My Portfolio"}),(0,Qe.jsx)(Ye,{env:t,theme:n,walletAddress:r,onBack:o,variant:"none",sendTransaction:l})]})]})}var Go=require("react/jsx-runtime");function ti({env:e,theme:t="dark",walletAddress:n,open:r,onOpenChange:o,sendTransaction:l,onOutlink:s,children:c}){let d=ae(e),a=r!==void 0,[p,f]=Xe.useState(!1),v=a?r:p,u=Xe.useCallback(g=>{a||f(g),o?.(g)},[a,o]),b=Xe.useCallback(()=>u(!1),[u]),w=Xe.useMemo(()=>({env:d,theme:t,open:v,walletAddress:n,close:b,sendTransaction:l,onOutlink:s}),[d,t,v,n,b,l,s]);return(0,Go.jsx)(Rt.Provider,{value:w,children:(0,Go.jsx)(Tr.Drawer.Root,{direction:"bottom",open:v,onOpenChange:u,noBodyStyles:!0,children:c})})}var Zo=Object.assign(ti,{Trigger:Qn,Content:Rr});var i=require("react/jsx-runtime");function Ko(e,t,n){let r=me[e],o=n.toUpperCase();if(t===r.cross&&o.includes("CROSSD"))return 0;if(t===r.cross&&o==="CROSS")return 1;if(t===r.bsc&&o==="CROSS")return 2}function oi(e){return parseInt(e.split(":")[1],10)}function ni(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function ri(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),r=parseInt(n.slice(0,4),16)%360,o=(r+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${r} 85% 65%), hsl(${o} 80% 55%))`}function Pr({align:e="end",sideOffset:t=12,className:n,children:r}){let{env:o,theme:l,isMobile:s,open:c,drawerDirection:d,modal:a,showBalance:p,showForgeToken:f,showGameToken:v,showQR:u,qrLogoSrc:b,walletAddress:w,accountName:g,sendAccounts:L,profileImageUrl:P,preferredTokens:D,close:R,onSelectWallet:B,onCopyAddress:h,onDisconnect:N,disconnectLabel:H,termsUrl:C,termsLabel:U,privacyUrl:$,privacyLabel:ce,portalStyle:De,navContent:re,navPosition:j,footerContent:de,view:q,setView:We,selectedSendToken:Ce,setSelectedSendToken:oe,showPortfolio:Fe,portfolioTitle:ft,showTotalAssets:Be,totalAssetsLabel:ve,sendTransaction:Ne,getTransactionReceipt:Le,onOutlink:Re}=Pe(),{tokens:ue,isLoading:Ve}=Ge(o,w,c&&p),{statsMap:k}=Ke(o,p),{categoryMap:G}=Gn(o,p),J=p&&Be,{displayValue:le,isLowerBound:ie,isLoading:tt}=Kn(o,w,c&&J),[ge,Ft]=F.useState(!1),ut=F.useRef(null),[ot,gt]=F.useState(0),{holdings:Te,isLoading:wt}=Hn(o,w,c&&p&&f),Bt=F.useMemo(()=>Te.map(x=>x.token),[Te]),{imageMap:Vt}=$n(o,Bt,f&&Te.length>0),nt=F.useMemo(()=>{let x=[],_=[],W=[],X=new Map((D??[]).map((A,Y)=>[`${oi(A.chainId)}:${A.address.toLowerCase()}`,Y]));for(let A of ue){let Y=Ko(o,A.chainId,A.symbol)!==void 0,He=`${A.chainId}:${A.address.toLowerCase()}`,$e=X.get(He),ho=new dt.default(A.quantity.numeric).shiftedBy(-A.quantity.decimals);if(Y)x.push(A);else if($e!==void 0)_.push(A);else if(ho.isGreaterThan(0)){if(!v&&G.get(Do(A.chainId,A.address))==="game")continue;W.push(A)}}return x.sort((A,Y)=>{let He=Ko(o,A.chainId,A.symbol)??99,$e=Ko(o,Y.chainId,Y.symbol)??99;return He-$e}),_.sort((A,Y)=>{let He=X.get(`${A.chainId}:${A.address.toLowerCase()}`)??99,$e=X.get(`${Y.chainId}:${Y.address.toLowerCase()}`)??99;return He-$e}),W.sort((A,Y)=>{let He=k.get(Ze(A.chainId,A.address)),$e=k.get(Ze(Y.chainId,Y.address)),ho=new dt.default(A.quantity.numeric).shiftedBy(-A.quantity.decimals).multipliedBy(He?.price??0);return new dt.default(Y.quantity.numeric).shiftedBy(-Y.quantity.decimals).multipliedBy($e?.price??0).minus(ho).toNumber()}),[...x,..._,...W]},[ue,o,k,v,G,D]),ht=F.useMemo(()=>{if(!f)return[];let x=new Set(ue.map(_=>_.address.toLowerCase()));return[...Te].filter(_=>!x.has(_.token.toLowerCase())).sort((_,W)=>{let X=new dt.default(_.value);return new dt.default(W.value).minus(X).toNumber()})},[Te,f,ue]),rt=F.useRef(!1),Ie=F.useCallback(x=>{rt.current=!0,We(x)},[We]),Kr=F.useCallback(()=>{oe(null),Ie("wallet")},[oe,Ie]),Yr=F.useCallback(x=>{oe(x),Ie("send")},[oe,Ie]),Qr=F.useCallback(()=>{oe(null),Ie("wallet")},[oe,Ie]);F.useEffect(()=>{c||(rt.current=!1)},[c]);let Jo=F.useRef(null);F.useEffect(()=>{let x=Jo.current;if(!x||!s)return;let _=W=>{W.pointerType==="touch"&&W.stopPropagation()};return x.addEventListener("pointerdown",_),()=>x.removeEventListener("pointerdown",_)},[s]);let[xt,en]=F.useState(!1),uo=F.useRef(void 0);F.useEffect(()=>()=>clearTimeout(uo.current),[]),F.useEffect(()=>{let x=ut.current;if(!x||de===null){gt(0);return}let _=()=>{gt(x.offsetHeight)};if(_(),typeof ResizeObserver>"u")return;let W=new ResizeObserver(_);return W.observe(x),()=>W.disconnect()},[de]);let tn=F.useCallback(async()=>{if(!xt)try{await navigator.clipboard.writeText(w),en(!0),clearTimeout(uo.current),uo.current=setTimeout(()=>en(!1),2e3),h?.(w,!0)}catch{h?.(w,!1)}},[w,h,xt]),go=F.useCallback(x=>{x.currentTarget.setAttribute("data-loaded","true")},[]),Xr=F.useMemo(()=>({background:ri(w)}),[w]),on=F.useMemo(()=>P||Kt(o,w,{size:120,bg:l==="dark"?"1A1A2E":"F3F6F8"}),[P,o,w,l]),wo=F.useMemo(()=>ni(le),[le]),Jr=C||$?(0,i.jsxs)("div",{className:"wi-legal-links",children:[C&&(0,i.jsx)("a",{className:"wi-legal-link",href:C,target:"_blank",rel:"noopener noreferrer",onClick:x=>he(x,C,{category:"terms",origin:"terms"},Re),children:U}),C&&$&&(0,i.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),$&&(0,i.jsx)("a",{className:"wi-legal-link",href:$,target:"_blank",rel:"noopener noreferrer",onClick:x=>he(x,$,{category:"privacy",origin:"privacy"},Re),children:ce})]}):null,nn=N?(0,i.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{N(),R()},children:[(0,i.jsx)(Ln,{size:12}),(0,i.jsx)("span",{className:"wi-disconnect-label",children:H})]}):null,ea=(0,i.jsxs)("div",{className:Z("wi-view-inner",rt.current&&"wi-view-wallet"),children:[J&&(()=>{let x=Fe;return(0,i.jsxs)(x?"button":"div",{...x?{type:"button",onClick:()=>Ie("portfolio"),"aria-label":"View Portfolio"}:{},className:"wi-total-section","data-clickable":x||void 0,children:[(0,i.jsxs)("div",{className:"wi-total-head",children:[(0,i.jsx)("span",{className:"wi-total-label",children:ve}),(0,i.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:W=>{W.stopPropagation(),Ft(X=>!X)},onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),W.stopPropagation(),Ft(X=>!X))},"aria-label":ge?"Show balance":"Hide balance",children:ge?(0,i.jsx)(Sn,{}):(0,i.jsx)(En,{})})]}),(0,i.jsxs)("div",{className:"wi-total-body",children:[tt?(0,i.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:36}}):(0,i.jsx)("div",{className:"wi-total-value","data-hidden":ge||void 0,children:ge?(0,i.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,i.jsxs)(i.Fragment,{children:[ie&&(0,i.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,i.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,i.jsx)("span",{className:"wi-total-amount",children:wo.main}),wo.decimal&&(0,i.jsx)("span",{className:"wi-total-decimal",children:wo.decimal})]})}),x&&(0,i.jsx)("span",{className:"wi-total-chevron","aria-hidden":!0,children:(0,i.jsx)(In,{size:18})})]})]})})(),j==="top"&&re&&(0,i.jsx)("div",{className:"wi-nav-fixed",children:re}),p&&(0,i.jsx)("div",{ref:Jo,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,i.jsxs)("div",{className:"wi-token-list",children:[Ve&&Array.from({length:5},(x,_)=>(0,i.jsxs)("div",{className:"wi-skeleton-item",children:[(0,i.jsxs)("div",{className:"wi-skeleton-left",children:[(0,i.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,i.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,i.jsxs)("div",{className:"wi-skeleton-right",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},_)),!Ve&&nt.length===0&&!f&&(0,i.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),nt.map(x=>{let _=k.get(Ze(x.chainId,x.address)),W=_?parseFloat(_.percent_change_24h):null,X=W!==null&&W>=0,A=Lo(o,x.chainId);return(0,i.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>Yr(x),"aria-label":`Send ${x.symbol}`,children:[(0,i.jsxs)("div",{className:"wi-token-left",children:[(0,i.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,i.jsx)("img",{src:x.icon_url,alt:x.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:go,onError:Y=>{Y.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),A&&(0,i.jsx)("img",{src:A,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Y=>{Y.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-token-info",children:[(0,i.jsx)("span",{className:"wi-token-name",children:x.symbol}),_&&(0,i.jsxs)("div",{className:"wi-token-price-row",children:[(0,i.jsx)("span",{className:"wi-token-price",children:Co(_.price)}),(0,i.jsx)("span",{className:"wi-token-change","data-positive":X,"data-zero":W===0||void 0,children:W!==null&&(W===0?"0%":`${X?"+":"-"}${(X?Math.floor:Math.ceil)(Math.abs(W)*100)/100}%`)})]})]})]}),(0,i.jsxs)("div",{className:"wi-token-right",children:[(0,i.jsx)("span",{className:"wi-token-balance",children:je(x.quantity.numeric,x.quantity.decimals)}),_&&(0,i.jsx)("span",{className:"wi-token-value",children:yn(x.quantity.numeric,x.quantity.decimals,_.price)})]})]},`${x.address}-${x.chainId}`)}),f&&wt&&Array.from({length:3},(x,_)=>(0,i.jsxs)("div",{className:"wi-skeleton-item",children:[(0,i.jsxs)("div",{className:"wi-skeleton-left",children:[(0,i.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,i.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,i.jsxs)("div",{className:"wi-skeleton-right",children:[(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,i.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${_}`)),f&&!wt&&!Ve&&nt.length===0&&ht.length===0&&(0,i.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),f&&ht.map(x=>{let _=Vt.get(x.token)||"",W=Lo(o,me[o].cross);return(0,i.jsxs)("div",{className:"wi-token-item",children:[(0,i.jsxs)("div",{className:"wi-token-left",children:[(0,i.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,i.jsx)("img",{src:_||"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:go,onError:X=>{X.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),W&&(0,i.jsx)("img",{src:W,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:X=>{X.currentTarget.style.display="none"}})]}),(0,i.jsxs)("div",{className:"wi-token-info",children:[(0,i.jsx)("span",{className:"wi-token-name",children:x.token_name}),(0,i.jsx)("div",{className:"wi-token-price-row",children:(0,i.jsxs)("span",{className:"wi-token-price",children:[je(x.current_price,18)," CROSS"]})})]})]}),(0,i.jsxs)("div",{className:"wi-token-right",children:[(0,i.jsx)("span",{className:"wi-token-balance",children:je(x.balance,18)}),(0,i.jsx)("span",{className:"wi-token-value",children:Co(x.current_value_usd)})]})]},`forge-${x.token}`)})]})}),j==="bottom"&&re&&(0,i.jsx)("div",{className:"wi-nav-fixed",children:re}),nn&&(0,i.jsx)("div",{className:"wi-wallet-disconnect-row",children:nn})]},"wallet"),ta=Fe?(0,i.jsx)("div",{className:Z("wi-view-inner wi-portfolio-body",rt.current&&"wi-view-portfolio"),children:(0,i.jsx)(Ye,{env:o,theme:l,walletAddress:w,showHeader:!1,sendTransaction:Ne,onOutlink:Re})},"portfolio"):null,oa=Ce?(0,i.jsx)("div",{className:Z("wi-view-inner wi-send-body",rt.current&&"wi-view-send"),children:(0,i.jsx)(Lt,{env:o,theme:l,walletAddress:w,accountName:g,accounts:L,token:Ce,tokens:nt,onTokenChange:oe,sendTransaction:Ne,getTransactionReceipt:Le,onConfirmSuccess:Qr})},"send"):null,na=(0,i.jsx)("div",{className:Z("wi-view-inner wi-qr-body",rt.current&&"wi-view-qr"),children:(0,i.jsxs)("div",{className:"wi-qr-section",children:[(0,i.jsxs)("div",{className:"wi-qr-card",children:[(0,i.jsxs)("div",{className:"wi-qr-code",children:[(0,i.jsx)(Ir.QRCodeSVG,{value:w,size:180,level:"H",marginSize:2,...b&&{imageSettings:{src:b,height:33,width:33,excavate:!0}}}),!b&&(0,i.jsx)("div",{className:"wi-qr-logo",children:(0,i.jsx)(Mn,{size:33})})]}),(0,i.jsx)("p",{className:"wi-qr-address",children:w}),(0,i.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:tn,children:[(0,i.jsx)("span",{className:"wi-qr-copy-icon",children:xt?(0,i.jsx)(kt,{size:16}):(0,i.jsx)(Ro,{size:16})}),(0,i.jsx)("span",{className:"wi-qr-copy-text",children:xt?"Copied!":"Copy address"})]})]}),Jr]})},"qr"),ra=q==="qr"||q==="portfolio"||q==="send",rn=de!==null?(0,i.jsx)("div",{className:"wi-builtin-footer",children:de}):null,an=(0,i.jsxs)("div",{className:"wi-account-text",children:[B?(0,i.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:B,"aria-label":"Switch account",children:[(0,i.jsx)("span",{className:"wi-account-name",children:g??"Account 1"}),(0,i.jsx)("span",{className:"wi-account-switch","aria-hidden":"true",children:(0,i.jsx)(Pn,{size:12})})]}):(0,i.jsx)("div",{className:"wi-account-row",children:(0,i.jsx)("span",{className:"wi-account-name",children:g??"Account 1"})}),(0,i.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:tn,"aria-label":"Copy address",children:[(0,i.jsx)("span",{className:"wi-account-address",children:pe(w)}),(0,i.jsx)("span",{className:"wi-account-copy",children:xt?(0,i.jsx)(kt,{size:14}):(0,i.jsx)(Ro,{size:14})})]})]}),sn=(0,i.jsxs)(i.Fragment,{children:[r,ra?(0,i.jsxs)("div",{className:"wi-sticky-header",children:[(0,i.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,i.jsx)("button",{type:"button",className:"wi-header-back",onClick:Kr,"aria-label":"Back",children:(0,i.jsx)(Tn,{})}),(0,i.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:an}),(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:(0,i.jsx)(To,{size:24})})]}),(0,i.jsx)("hr",{className:"wi-divider"})]}):(0,i.jsxs)("div",{className:"wi-sticky-header",children:[(0,i.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,i.jsxs)("div",{className:"wi-account-block",children:[(0,i.jsxs)("div",{className:"wi-avatar",children:[(0,i.jsx)("div",{className:"wi-avatar-fallback",style:Xr}),on&&(0,i.jsx)("img",{src:on,alt:"",className:"wi-avatar-img",width:30,height:30,draggable:!1,onLoad:go,onError:x=>{x.currentTarget.style.display="none"}})]}),an]}),(0,i.jsxs)("div",{className:"wi-header-actions",children:[u&&(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:()=>Ie("qr"),"aria-label":"Show QR code",children:(0,i.jsx)(Rn,{size:20})}),(0,i.jsx)("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:(0,i.jsx)(To,{size:24})})]})]}),(0,i.jsx)("hr",{className:"wi-divider"})]}),(0,i.jsxs)("div",{className:"wi-view-container",children:[q==="wallet"&&ea,q==="qr"&&na,q==="portfolio"&&ta,q==="send"&&oa]}),rn&&q!=="portfolio"&&q!=="send"&&(0,i.jsx)("div",{className:"wi-sticky-footer",children:(0,i.jsx)("div",{className:"wi-footer",ref:ut,children:rn})})]}),ln={...De,...ot>0?{"--wi-footer-height":`${ot}px`}:null};return s?(0,i.jsxs)(It.Drawer.Portal,{children:[a&&(0,i.jsx)(It.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,i.jsxs)(It.Drawer.Content,{className:Z("wi-drawer-content",n),"data-theme":l,style:ln,"data-direction":d,"data-no-balance":!p||void 0,"data-has-footer":ot>0||void 0,"data-view":q,children:[(0,i.jsx)(It.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),sn]})]}):(0,i.jsxs)(i.Fragment,{children:[a&&c&&(0,i.jsx)("div",{className:"wi-drawer-overlay",onClick:R}),(0,i.jsx)(so.Portal,{children:(0,i.jsx)(so.Content,{align:e,sideOffset:t,className:Z("wi-popover-content",n),"data-theme":l,style:ln,"data-no-balance":!p||void 0,"data-has-footer":ot>0||void 0,"data-view":q,children:sn})})]})}var Er=V(require("react"),1);function Sr({position:e="top",children:t}){let{setNavContent:n,setNavPosition:r}=Pe();return Er.useEffect(()=>(n(t),r(e),()=>n(null)),[t,e,n,r]),null}var Mr=V(require("react"),1);function _r({children:e}){let{setFooterContent:t}=Pe();return Mr.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}E(`[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
8
|
`);E(`.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
9
|
`);E(`@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
|
-
`);E(`.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
|
+
`);E(`.wi-popover-content{z-index:100001;width:343px;border-radius:24px;border:1px solid var(--wi-border-default);background:var(--wi-surface-bg);box-shadow:var(--wi-shadow);animation:wi-fade-in .15s ease-out;height:552px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(552px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:auto;left:0;right:0;width:100%;max-height:60vh;margin:0 auto}.wi-drawer-content[data-has-footer][data-direction=bottom]{max-height:min(calc(60vh + var(--wi-footer-height, 0px)),85dvh)}.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
11
|
`);E(`.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
|
-
`);var zt=require("react/jsx-runtime"),bi="https://terms.crosstoken.io/docs/cross-terms-of-use",vi="https://terms.crosstoken.io/docs/nexus-privacy-policy";function yi({env:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:o,modal:n,showBalance:p=!1,showForgeToken:s=!1,showGameToken:c=!0,showQR:l=!0,qrLogoSrc:a,walletAddress:d,accountName:m,profileImageUrl:f,connectorId:x,connectorName:v,connectorIconUrl:g,preferredTokens:u=[],onSelectWallet:C,onCopyAddress:M,onDisconnect:_,disconnectLabel:N="Disconnect",termsUrl:D=bi,termsLabel:w="Terms of Service",privacyUrl:y=vi,privacyLabel:A="Privacy Policy",open:I,onOpenChange:H,showPortfolio:Z=!1,portfolioTitle:ie="My Portfolio",showTotalAssets:be=!0,totalAssetsLabel:Ge="Total Assets USD",sendTransaction:Ze,onOutlink:X,style:Ke,children:Ye}){let Yt=Q(e),ut=x?tt[x]:void 0,gt=v??ut?.name,wt=g??ut?.iconUrl,ve=Ve(`(max-width: ${r}px)`),ce=o??(p?"right":"bottom"),De=n??!1,pe=I!==void 0,[ht,xt]=K.useState(!1),ae=pe?I:ht,Ae=K.useCallback(Be=>{pe||xt(Be),H?.(Be)},[pe,H]),bt=K.useCallback(()=>Ae(!1),[Ae]),[ye,vt]=K.useState(null),[de,yt]=K.useState("top"),[kt,Qt]=K.useState(null),[Fe,Qe]=K.useState("wallet");K.useEffect(()=>{ae||Qe("wallet")},[ae]);let ke=K.useMemo(()=>({env:Yt,theme:t,isMobile:ve,open:ae,drawerDirection:ce,modal:De,showBalance:p,showForgeToken:s,showGameToken:c,showQR:l,qrLogoSrc:a,walletAddress:d,accountName:m,profileImageUrl:f,connectorName:gt,connectorIconUrl:wt,preferredTokens:u,close:bt,onSelectWallet:C,onCopyAddress:M,onDisconnect:_,disconnectLabel:N,termsUrl:D,termsLabel:w,privacyUrl:y,privacyLabel:A,portalStyle:Ke,navContent:ye,navPosition:de,setNavContent:vt,setNavPosition:yt,footerContent:kt,setFooterContent:Qt,view:Fe,setView:Qe,showPortfolio:Z,portfolioTitle:ie,showTotalAssets:be,totalAssetsLabel:Ge,sendTransaction:Ze,onOutlink:X}),[Yt,t,ve,ae,ce,De,p,s,c,l,a,d,m,f,gt,wt,u,bt,C,M,_,N,D,w,y,A,Ke,ye,de,kt,Fe,Z,ie,be,Ge,Ze,X]);return(0,zt.jsx)(ao.Provider,{value:ke,children:ve?(0,zt.jsx)(dn.Drawer.Root,{direction:ce,open:ae,onOpenChange:Ae,noBodyStyles:!0,children:Ye},"drawer"):(0,zt.jsx)(pn.Root,{open:ae,onOpenChange:Ae,children:Ye},"popover")})}var Oe=Object.assign(yi,{Trigger:pr,Content:nn,Nav:sn,Footer:cn});var le=W(require("react"),1),kn=W(require("@radix-ui/react-dialog"),1),Cn=require("vaul");var jt=require("react"),Gt=(0,jt.createContext)(null);function it(){let e=(0,jt.useContext)(Gt);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var We=require("react");function at(){let[e,t]=(0,We.useState)([]),[r,o]=(0,We.useState)(!0);(0,We.useEffect)(()=>{if(typeof window>"u"){o(!1);return}let p=[],s=l=>{let{info:a}=l.detail;a?.rdns&&!p.some(d=>d.rdns===a.rdns)&&(p.push({rdns:a.rdns,name:a.name,icon:a.icon}),t([...p]))};window.addEventListener("eip6963:announceProvider",s),window.addEventListener("eip6963:crossAnnounceProvider",s),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let c=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",s),window.removeEventListener("eip6963:crossAnnounceProvider",s),clearTimeout(c)}},[]);let n=(0,We.useCallback)(p=>e.some(s=>s.rdns===p),[e]);return{wallets:e,isDetected:n,isLoading:r}}var mn=W(require("@radix-ui/react-dialog"),1),fn=require("vaul");var Ro=require("react/jsx-runtime");function un({asChild:e,children:t}){let{isMobile:r}=it(),o=r?fn.Drawer.Trigger:mn.Trigger;return(0,Ro.jsx)(o,{asChild:e??t!=null,children:t??(0,Ro.jsx)("button",{type:"button",children:"Connect Wallet"})})}var he=W(require("@radix-ui/react-dialog"),1),st=require("vaul");var P=require("react/jsx-runtime");function Zt(){return(0,P.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,P.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function gn(){return(0,P.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,P.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,P.jsx)("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),(0,P.jsx)("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),(0,P.jsx)("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),(0,P.jsx)("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),(0,P.jsx)("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),(0,P.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,P.jsx)("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),(0,P.jsx)("defs",{children:(0,P.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,P.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function wn(){return(0,P.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,P.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,P.jsx)("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),(0,P.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,P.jsx)("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function hn(){return(0,P.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,P.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,P.jsx)("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),(0,P.jsx)("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),(0,P.jsx)("defs",{children:(0,P.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,P.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function xn(){return(0,P.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Kt={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:Zt,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:Zt},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:Zt,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:gn,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:wn,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:hn,badge:"For SHOP"}};function ze(e){return Kt[e]}var h=require("react/jsx-runtime");function bn({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(0,h.jsxs)("button",{type:"button",className:"wcm-wallet-item",onClick:o,children:[(0,h.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,h.jsx)("div",{className:"wcm-wallet-icon",children:(0,h.jsx)(n,{})}),(0,h.jsxs)("div",{className:"wcm-wallet-info",children:[(0,h.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,h.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,h.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]}),(0,h.jsx)("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?(0,h.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,h.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function vn(){let{wallets:e,activeWalletIds:t,isDetected:r,close:o,isMobile:n}=it(),p=t.filter(l=>{let a=ze(l).visibility;return!a||a==="always"?!0:a==="desktop-only"?!n:a==="mobile-only"?n:!0}),s=p.filter(l=>ze(l).featured),c=p.filter(l=>!ze(l).featured);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:"wcm-header",children:[(0,h.jsxs)("div",{className:"wcm-header-text",children:[(0,h.jsx)("h2",{className:"wcm-title",children:"Connect Wallet"}),(0,h.jsx)("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),(0,h.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:o,children:(0,h.jsx)(xn,{})})]}),(0,h.jsx)("div",{className:"wcm-divider"}),(0,h.jsxs)("div",{className:"wcm-body",children:[s.map(l=>{let a=ze(l),d=a.rdns?r(a.rdns):!1;return(0,h.jsx)(bn,{wallet:a,detected:d,onConnect:()=>{e[l]?.(),o()}},l)}),s.length>0&&c.length>0&&(0,h.jsxs)("div",{className:"wcm-separator",children:[(0,h.jsx)("div",{className:"wcm-separator-line"}),(0,h.jsx)("span",{className:"wcm-separator-text",children:"or"}),(0,h.jsx)("div",{className:"wcm-separator-line"})]}),(0,h.jsx)("div",{className:"wcm-wallet-list",children:c.map(l=>{let a=ze(l),d=a.rdns?r(a.rdns):!1;return(0,h.jsx)(bn,{wallet:a,detected:d,onConnect:()=>{e[l]?.(),o()}},l)})}),(0,h.jsxs)("div",{className:"wcm-help",children:[(0,h.jsx)("p",{className:"wcm-help-title",children:"Wallet not detected?"}),(0,h.jsxs)("ul",{className:"wcm-help-list",children:[(0,h.jsx)("li",{children:"Ensure your wallet extension is installed and unlocked"}),(0,h.jsx)("li",{children:"Try refreshing the page"}),(0,h.jsx)("li",{children:"Some wallets may require you to first open the extension"}),(0,h.jsx)("li",{children:"You can try clicking the wallet anyway"})]})]}),(0,h.jsx)("div",{className:"wcm-divider"}),(0,h.jsx)("p",{className:"wcm-terms",children:"By connecting your wallet and accessing this service, you acknowledge and agree to be bound by the applicable terms and conditions."})]})]})}function yn({className:e}){let{isMobile:t,theme:r,portalStyle:o}=it();return t?(0,h.jsxs)(st.Drawer.Portal,{children:[(0,h.jsx)(st.Drawer.Overlay,{className:"wcm-overlay"}),(0,h.jsxs)(st.Drawer.Content,{className:$("wcm-drawer-content",e),"data-theme":r,style:o,children:[(0,h.jsx)(st.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,h.jsx)("div",{className:"wcm-drawer-handle"}),(0,h.jsx)("div",{className:"wcm-drawer-body",children:(0,h.jsx)(vn,{})})]})]}):(0,h.jsxs)(he.Portal,{children:[(0,h.jsx)(he.Overlay,{className:"wcm-overlay"}),(0,h.jsxs)(he.Content,{className:$("wcm-dialog-content",e),"data-theme":r,style:o,children:[(0,h.jsx)(he.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,h.jsx)("div",{className:"wcm-dialog-body",children:(0,h.jsx)(vn,{})})]})]})}E(`[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
|
+
`);var lo=require("react/jsx-runtime"),ai="https://terms.crosstoken.io/docs/cross-terms-of-use",ii="https://terms.crosstoken.io/docs/nexus-privacy-policy";function si({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:r,modal:o,showBalance:l=!1,showForgeToken:s=!1,showGameToken:c=!0,showQR:d=!0,qrLogoSrc:a,walletAddress:p,accountName:f,sendAccounts:v,profileImageUrl:u,connectorId:b,connectorName:w,connectorIconUrl:g,preferredTokens:L=[],onSelectWallet:P,onCopyAddress:D,onDisconnect:R,disconnectLabel:B="Disconnect",termsUrl:h=ai,termsLabel:N="Terms of Service",privacyUrl:H=ii,privacyLabel:C="Privacy Policy",open:U,onOpenChange:$,showPortfolio:ce=!1,portfolioTitle:De="My Portfolio",showTotalAssets:re=!0,totalAssetsLabel:j="Total Assets USD",sendTransaction:de,getTransactionReceipt:q,onOutlink:We,style:Ce,children:oe}){let Fe=ae(e),ft=b?yt[b]:void 0,Be=w??ft?.name,ve=g??ft?.iconUrl,Ne=at(`(max-width: ${n}px)`),Le=r??(l?"right":"bottom"),Re=o??!1,ue=U!==void 0,[Ve,k]=ne.useState(!1),G=ue?U:Ve,J=ne.useCallback(ht=>{ue||k(ht),$?.(ht)},[ue,$]),le=ne.useCallback(()=>J(!1),[J]),[ie,tt]=ne.useState(null),[ge,Ft]=ne.useState("top"),[ut,ot]=ne.useState(null),[gt,Te]=ne.useState("wallet"),[wt,Bt]=ne.useState(null);ne.useEffect(()=>{G||(Te("wallet"),Bt(null))},[G]);let Vt=ne.useCallback(()=>{So(p),R?.()},[R,p]),nt=ne.useMemo(()=>({env:Fe,theme:t,isMobile:Ne,open:G,drawerDirection:Le,modal:Re,showBalance:l,showForgeToken:s,showGameToken:c,showQR:d,qrLogoSrc:a,walletAddress:p,accountName:f,sendAccounts:v,profileImageUrl:u,connectorName:Be,connectorIconUrl:ve,preferredTokens:L,close:le,onSelectWallet:P,onCopyAddress:D,onDisconnect:R?Vt:void 0,disconnectLabel:B,termsUrl:h,termsLabel:N,privacyUrl:H,privacyLabel:C,portalStyle:Ce,navContent:ie,navPosition:ge,setNavContent:tt,setNavPosition:Ft,footerContent:ut,setFooterContent:ot,view:gt,setView:Te,selectedSendToken:wt,setSelectedSendToken:Bt,showPortfolio:ce,portfolioTitle:De,showTotalAssets:re,totalAssetsLabel:j,sendTransaction:de,getTransactionReceipt:q,onOutlink:We}),[Fe,t,Ne,G,Le,Re,l,s,c,d,a,p,f,v,u,Be,ve,L,le,P,D,R,Vt,B,h,N,H,C,Ce,ie,ge,ut,gt,wt,ce,De,re,j,de,q,We]);return(0,lo.jsx)(ko.Provider,{value:nt,children:Ne?(0,lo.jsx)(Or.Drawer.Root,{direction:Le,open:G,onOpenChange:J,noBodyStyles:!0,children:oe},"drawer"):(0,lo.jsx)(Ar.Root,{open:G,onOpenChange:J,children:oe},"popover")})}var Je=Object.assign(si,{Trigger:Wn,Content:Pr,Nav:Sr,Footer:_r});var ke=V(require("react"),1),qr=V(require("@radix-ui/react-dialog"),1),Gr=require("vaul");var co=require("react"),po=(0,co.createContext)(null);function Pt(){let e=(0,co.useContext)(po);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var et=require("react");function Et(){let[e,t]=(0,et.useState)([]),[n,r]=(0,et.useState)(!0);(0,et.useEffect)(()=>{if(typeof window>"u"){r(!1);return}let l=[],s=d=>{let{info:a}=d.detail;a?.rdns&&!l.some(p=>p.rdns===a.rdns)&&(l.push({rdns:a.rdns,name:a.name,icon:a.icon}),t([...l]))};window.addEventListener("eip6963:announceProvider",s),window.addEventListener("eip6963:crossAnnounceProvider",s),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let c=setTimeout(()=>r(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",s),window.removeEventListener("eip6963:crossAnnounceProvider",s),clearTimeout(c)}},[]);let o=(0,et.useCallback)(l=>e.some(s=>s.rdns===l),[e]);return{wallets:e,isDetected:o,isLoading:n}}var Dr=V(require("@radix-ui/react-dialog"),1),Wr=require("vaul");var Yo=require("react/jsx-runtime");function Fr({asChild:e,children:t}){let{isMobile:n}=Pt(),r=n?Wr.Drawer.Trigger:Dr.Trigger;return(0,Yo.jsx)(r,{asChild:e??t!=null,children:t??(0,Yo.jsx)("button",{type:"button",children:"Connect Wallet"})})}var Ae=V(require("@radix-ui/react-dialog"),1),St=require("vaul");var S=require("react/jsx-runtime");function mo(){return(0,S.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function Br(){return(0,S.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,S.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,S.jsx)("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),(0,S.jsx)("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),(0,S.jsx)("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),(0,S.jsx)("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),(0,S.jsx)("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),(0,S.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,S.jsx)("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),(0,S.jsx)("defs",{children:(0,S.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,S.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function Vr(){return(0,S.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,S.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,S.jsx)("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),(0,S.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,S.jsx)("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function Hr(){return(0,S.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,S.jsx)("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),(0,S.jsx)("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),(0,S.jsx)("defs",{children:(0,S.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,S.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function $r(){return(0,S.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,S.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var fo={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:mo,featured:!0},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:mo},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:mo,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:Br,rdns:"io.metamask"},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Vr,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Hr,badge:"For SHOP"}};function pt(e){return fo[e]}var y=require("react/jsx-runtime");function zr({wallet:e,detected:t,onConnect:n}){let r=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},o=e.icon;return(0,y.jsxs)("button",{type:"button",className:"wcm-wallet-item",onClick:r,children:[(0,y.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,y.jsx)("div",{className:"wcm-wallet-icon",children:(0,y.jsx)(o,{})}),(0,y.jsxs)("div",{className:"wcm-wallet-info",children:[(0,y.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,y.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,y.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]}),(0,y.jsx)("span",{className:"wcm-wallet-desc",children:e.description})]})]}),e.installUrl&&(t?(0,y.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,y.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function Ur(){let{wallets:e,activeWalletIds:t,isDetected:n,close:r,isMobile:o}=Pt(),l=t.filter(d=>{let a=pt(d).visibility;return!a||a==="always"?!0:a==="desktop-only"?!o:a==="mobile-only"?o:!0}),s=l.filter(d=>pt(d).featured),c=l.filter(d=>!pt(d).featured);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"wcm-header",children:[(0,y.jsxs)("div",{className:"wcm-header-text",children:[(0,y.jsx)("h2",{className:"wcm-title",children:"Connect Wallet"}),(0,y.jsx)("p",{className:"wcm-subtitle",children:"Connect with one of our available wallet providers to continue."})]}),(0,y.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:r,children:(0,y.jsx)($r,{})})]}),(0,y.jsx)("div",{className:"wcm-divider"}),(0,y.jsxs)("div",{className:"wcm-body",children:[s.map(d=>{let a=pt(d),p=a.rdns?n(a.rdns):!1;return(0,y.jsx)(zr,{wallet:a,detected:p,onConnect:()=>{e[d]?.(),r()}},d)}),s.length>0&&c.length>0&&(0,y.jsxs)("div",{className:"wcm-separator",children:[(0,y.jsx)("div",{className:"wcm-separator-line"}),(0,y.jsx)("span",{className:"wcm-separator-text",children:"or"}),(0,y.jsx)("div",{className:"wcm-separator-line"})]}),(0,y.jsx)("div",{className:"wcm-wallet-list",children:c.map(d=>{let a=pt(d),p=a.rdns?n(a.rdns):!1;return(0,y.jsx)(zr,{wallet:a,detected:p,onConnect:()=>{e[d]?.(),r()}},d)})}),(0,y.jsxs)("div",{className:"wcm-help",children:[(0,y.jsx)("p",{className:"wcm-help-title",children:"Wallet not detected?"}),(0,y.jsxs)("ul",{className:"wcm-help-list",children:[(0,y.jsx)("li",{children:"Ensure your wallet extension is installed and unlocked"}),(0,y.jsx)("li",{children:"Try refreshing the page"}),(0,y.jsx)("li",{children:"Some wallets may require you to first open the extension"}),(0,y.jsx)("li",{children:"You can try clicking the wallet anyway"})]})]}),(0,y.jsx)("div",{className:"wcm-divider"}),(0,y.jsx)("p",{className:"wcm-terms",children:"By connecting your wallet and accessing this service, you acknowledge and agree to be bound by the applicable terms and conditions."})]})]})}function jr({className:e}){let{isMobile:t,theme:n,portalStyle:r}=Pt();return t?(0,y.jsxs)(St.Drawer.Portal,{children:[(0,y.jsx)(St.Drawer.Overlay,{className:"wcm-overlay"}),(0,y.jsxs)(St.Drawer.Content,{className:Z("wcm-drawer-content",e),"data-theme":n,style:r,children:[(0,y.jsx)(St.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,y.jsx)("div",{className:"wcm-drawer-handle"}),(0,y.jsx)("div",{className:"wcm-drawer-body",children:(0,y.jsx)(Ur,{})})]})]}):(0,y.jsxs)(Ae.Portal,{children:[(0,y.jsx)(Ae.Overlay,{className:"wcm-overlay"}),(0,y.jsxs)(Ae.Content,{className:Z("wcm-dialog-content",e),"data-theme":n,style:r,children:[(0,y.jsx)(Ae.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,y.jsx)("div",{className:"wcm-dialog-body",children:(0,y.jsx)(Ur,{})})]})]})}E(`[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
13
|
`);E(`.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
14
|
`);E(`@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
|
-
`);var
|
|
15
|
+
`);var mt=require("react/jsx-runtime");function li({wallets:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:r="bottom",dialogWidth:o,drawerMaxWidth:l,drawerMinWidth:s,style:c,open:d,onOpenChange:a,children:p}){let f=at(`(max-width: ${n}px)`),[v,u]=ke.useState(!1),b=d!==void 0,w=b?d:v,g=ke.useCallback(N=>{b||u(N),a?.(N)},[b,a]),L=ke.useCallback(()=>g(!1),[g]),{isDetected:P}=Et(),D=ke.useMemo(()=>Object.keys(e),[e]),R=ke.useMemo(()=>{let N={};return o&&(N["--wcm-dialog-width"]=o),l&&(N["--wcm-drawer-max-width"]=l),s&&(N["--wcm-drawer-min-width"]=s),{...N,...c}},[o,l,s,c]),B=ke.useMemo(()=>({theme:t,isMobile:f,open:w,setOpen:g,close:L,wallets:e,activeWalletIds:D,isDetected:P,portalStyle:R}),[t,f,w,g,L,e,D,P,R]),h=(0,mt.jsx)("div",{"data-theme":t,style:R,children:p});return f?(0,mt.jsx)(po.Provider,{value:B,children:(0,mt.jsx)(Gr.Drawer.Root,{direction:r,open:w,onOpenChange:g,noBodyStyles:!0,children:h},"drawer")}):(0,mt.jsx)(po.Provider,{value:B,children:(0,mt.jsx)(qr.Root,{open:w,onOpenChange:g,children:h})})}var Qo=Object.assign(li,{Trigger:Fr,Content:jr});var ci='<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>',di='<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>',pi='<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>',mi='<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>',fi='<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 Mt(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var _t=Mt(ci),At=Mt(di),Ot=Mt(pi),Dt=Mt(mi),Wt=Mt(fi);var se=require("react/jsx-runtime");function Xo({isConnecting:e,address:t,provider:n,providerName:r,accountName:o,sendAccounts:l,onConnect:s,onDisconnect:c,onCopy:d,onSelectWallet:a,label:p="Connect Wallet",connectingLabel:f="Connecting...",disconnectLabel:v,className:u,theme:b="dark",env:w,showBalance:g=!0,showPortfolio:L,drawerDirection:P,modal:D,connectorId:R,style:B,sendTransaction:h,getTransactionReceipt:N}){if(e)return(0,se.jsxs)("button",{type:"button",disabled:!0,className:u,style:u?void 0:{...Oe.button,...Oe.buttonLoading},"aria-busy":"true",children:[(0,se.jsx)("style",{children:hi}),(0,se.jsx)("span",{style:Oe.spinner,"aria-hidden":"true"}),f]});if(t){let H=r??wi(n),C=n?ui[n]:void 0;return(0,se.jsxs)(Je,{env:w,theme:b,drawerDirection:P,modal:D,showBalance:g,showPortfolio:L,walletAddress:t,accountName:o,sendAccounts:l,connectorId:R,onSelectWallet:a,onCopyAddress:d?(U,$)=>{$&&d()}:void 0,onDisconnect:c,disconnectLabel:v,style:B,sendTransaction:h,getTransactionReceipt:N,children:[(0,se.jsx)(Je.Trigger,{asChild:!0,children:(0,se.jsxs)("button",{type:"button",className:u,style:u?void 0:Oe.connectedBtn,"aria-label":`Connected with ${H}: ${Zr(t)}`,children:[C?(0,se.jsx)("img",{src:C,alt:"",width:20,height:20,style:Oe.connectedIcon}):(0,se.jsx)("span",{style:Oe.connectedIconPlaceholder,"aria-hidden":"true"}),(0,se.jsx)("span",{style:Oe.connectedAddress,children:Zr(t)})]})}),(0,se.jsx)(Je.Content,{align:"end",sideOffset:8})]})}return(0,se.jsx)("button",{type:"button",onClick:s,className:u,style:u?void 0:Oe.button,children:p})}var ui={google:Dt,apple:Wt,cross:_t,metamask:At,binance:Ot},gi={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function wi(e){return e?gi[e]:"Wallet"}function Zr(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var hi="@keyframes cross-cb-spin{to{transform:rotate(360deg)}}",Oe={button:{padding:"10px 24px",borderRadius:"12px",border:"none",background:"#00D5AA",color:"#000",fontWeight:700,fontSize:"14px",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"opacity 0.15s",fontFamily:"inherit"},buttonLoading:{opacity:.7,cursor:"default"},spinner:{display:"inline-block",width:"14px",height:"14px",border:"2px solid #00000030",borderTopColor:"#000",borderRadius:"50%",animation:"cross-cb-spin 0.6s linear infinite"},connectedBtn:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"8px 14px",borderRadius:"999px",border:"1px solid var(--wi-border-default, #2a2d3a)",background:"var(--wi-surface-default, #1e232e)",color:"var(--wi-texticon-primary, #ffffff)",fontWeight:600,fontSize:"14px",cursor:"pointer",fontFamily:"inherit"},connectedIcon:{width:"20px",height:"20px",borderRadius:"50%",objectFit:"contain",flexShrink:0,background:"transparent"},connectedIconPlaceholder:{display:"inline-block",width:"20px",height:"20px",borderRadius:"50%",background:"var(--wi-surface-subtle, #2a2d3a)",flexShrink:0},connectedAddress:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"13px",letterSpacing:"0.02em"}};0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,GOOGLE_ICON,METAMASK_ICON,SendPage,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
|