@nexus-cross/dapp-ui 1.3.5 → 1.3.6-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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ function Oa(e){try{return import.meta.env?.[e]}catch{return}}function Wa(e){if(!
|
|
|
2
2
|
`);Y(`.al-trigger-btn{--at-bg: transparent;--at-bg-hover: #eaedf1;--at-color: var(--ds-content-high, rgba(0, 0, 0, .85));--at-border: none;--at-border-radius: 8px;--at-size: 36px;--at-padding: 0;--at-press-scale: .95;--at-transition: background-color .15s ease;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--at-size);height:var(--at-size);padding:var(--at-padding);border:var(--at-border);background:var(--at-bg);border-radius:var(--at-border-radius);color:var(--at-color);cursor:pointer;transition:var(--at-transition)}.al-trigger-btn:hover,.al-trigger-btn[data-state=open]{background:var(--at-bg-hover)}.al-trigger-btn:active:not(:disabled){background:var(--at-bg-hover);transform:scale(var(--at-press-scale))}.al-trigger-btn[data-theme=dark]{--at-color: var(--ds-content-high, rgba(255, 255, 255, .85));--at-bg-hover: #252b39}.al-trigger-btn[data-theme=light]{--at-color: var(--ds-content-high, rgba(0, 0, 0, .85))}
|
|
3
3
|
`);Y(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
|
|
4
4
|
`);Y(`.al-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;border-radius:24px;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:20px 4px;box-sizing:border-box}.al-popover-content .al-menu{display:flex;flex-direction:column;width:424px;max-width:calc(100vw - 32px);padding:0 12px;box-sizing:border-box}.al-popover-content .al-grid{display:grid;grid-template-columns:repeat(4,100px);row-gap:12px;column-gap:0;justify-content:center;align-items:start}.al-popover-content .al-grid-item{position:relative;flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;padding:12px 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:50px;height:50px;border-radius:10.125px;overflow:visible}.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.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-text{flex-direction:column;align-items:center;justify-content:center;gap:2px;max-width:100%;min-height:26px}.al-popover-content .al-grid-item-status-text{font-size:10px;line-height:1.1}.al-popover-content .al-badge-list{display:none}.al-drawer-overlay{position:fixed;inset:0;z-index:100000;background:var(--al-drawer-overlay)}.al-drawer-content{-webkit-font-smoothing:antialiased;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-menu{display:flex;flex-direction:column;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:8px 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;overflow:visible}.al-drawer-content .al-grid-item-icon{width:32px;height:32px;border-radius:6.75px;overflow:visible}.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.35;letter-spacing:0;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:0;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-secondary);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:flex-start;gap:10px;padding:16px 12px;border:none;background:var(--al-bg);border-radius:8px;cursor:pointer;transition:none;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)!important}.al-grid-item-left{display:flex;align-items:center;gap:8px;min-width:0;overflow:visible}.al-grid-item-text{display:flex;flex-direction:column;align-items:flex-start;gap:1px;max-width:100%;min-width:0}.al-grid-item-icon{display:flex;align-items:center;justify-content:center;position:relative;width:24px;height:24px;overflow:visible;border-radius:5px;flex-shrink:0}.al-grid-item-icon img{width:100%;height:100%;object-fit:contain;border-radius:inherit}.al-grid-item-label{font-family:Inter,sans-serif;font-size:16px;font-weight:500;line-height:150%;letter-spacing:0;color:var(--al-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.al-grid-item-status-text{font-family:Inter,sans-serif;font-size:12px;font-weight:400;line-height:1.15;letter-spacing:0;color:var(--al-text);white-space:nowrap}.al-status-ribbon{position:absolute;top:-6px;right:-6px;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;box-sizing:border-box;border-radius:999px;color:#fff;font-family:Pretendard,Inter,sans-serif;font-size:12px;font-weight:800;line-height:1;pointer-events:none;box-shadow:0 1px 3px #0000002e}.al-status-ribbon-new{background:var(--al-new-ribbon-bg)}.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:0;white-space:nowrap;flex-shrink:0}
|
|
5
|
-
`);Y("");import{jsx as Mr}from"react/jsx-runtime";function Za({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let i=Pn(`(max-width: ${n}px)`),[a,s]=_n.useState(!1),c=_n.useCallback(()=>s(!1),[]),l=Ee(e),d=_n.useMemo(()=>({env:l,theme:t,isMobile:i,open:a,domain:o,close:c}),[l,t,i,a,o,c]);return Mr(Br.Provider,{value:d,children:i?Mr(Gc.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:r},"drawer"):Mr(Ya.Root,{open:a,onOpenChange:s,children:r},"popover")})}import*as ti from"@radix-ui/react-popover";import{Drawer as $c}from"vaul";import{jsx as ft,jsxs as Hc}from"react/jsx-runtime";function Xa({size:e=18}){return Hc("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ft("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Ja(){return ft("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ft("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ei(){return ft("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ft("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Fn}from"react/jsx-runtime";function ni({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:i}=Eo(),a=t!=null,s=e??!0,c=n?`al-trigger-btn ${n}`:"al-trigger-btn",l=a?t:Fn("button",{type:"button",className:c,"data-theme":i,"data-track":"open",style:o,children:Fn(Xa,{size:18})});return r?Fn(ge,{feature:"app_launcher",children:Fn($c.Trigger,{asChild:s,children:l})}):Fn(ge,{feature:"app_launcher",children:Fn(ti.Trigger,{asChild:s,children:l})})}import*as wn from"react";import*as Ao from"@radix-ui/react-popover";import{Drawer as Bn}from"vaul";import{useQuery as qc}from"@tanstack/react-query";var oi={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json"};var jc="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Vc="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function It(e,t){return`${e==="production"?Vc:jc}/${t}.png`}function ri(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://stg.onechain.nexus/gametoken",stage:"https://stg.onechain.nexus/gametoken",production:"https://www.onechain.nexus/gametoken"},iconUrl:It(t,"game-token"),order:1e3,type:"gametoken",badge:null,isNew:!1,serviceStatus:"available"},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg.onechain.nexus/forge",stage:"https://stg.onechain.nexus/forge",production:"https://onechain.nexus/forge"},iconUrl:It(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0,serviceStatus:"available"},{id:"crossd",label:"Bridge",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:It(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1,serviceStatus:"ending"},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:It(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0,serviceStatus:"available"},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg.onechain.nexus/rewards",stage:"https://stg.onechain.nexus/rewards",production:"https://onechain.nexus/rewards"},iconUrl:It(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1,serviceStatus:"ending"},{id:"cross-staking",label:"Staking",description:"Stake CROSS and earn rewards.",url:{dev:"https://stg-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},iconUrl:It(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,serviceStatus:"available"},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:It(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1,serviceStatus:"available"},{id:"play",label:"Quest",description:"Discover and play games on CROSS.",url:{dev:"https://stg.onechain.nexus/quest",stage:"https://stg.onechain.nexus/quest",production:"https://www.onechain.nexus/quest"},iconUrl:It(t,"play"),order:8500,type:"play",badge:null,isNew:!0,serviceStatus:"available"},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://stg.onechain.nexus/shop",stage:"https://stg.onechain.nexus/shop",production:"https://www.onechain.nexus/shop"},iconUrl:It(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.onechain.nexus",stage:"https://stg-explorer.onechain.nexus",production:"https://explorer.onechain.nexus"},iconUrl:It(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1,serviceStatus:"available"},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg.onechain.nexus/wave",stage:"https://stg.onechain.nexus/wave",production:"https://www.onechain.nexus/wave"},iconUrl:It(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function Lo(e){let t=Ee(e);return qc({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(oi[t],{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch global menu: ${o.status}`);return o.json()}catch(o){if(n.aborted)throw o;return ri(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function Dr(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function ii(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function si(e){return[...e].sort((t,n)=>{let o=ai(t)-ai(n);return o!==0?o:t.order-n.order})}function ai(e){let t=Dr(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Le,jsxs as Mn}from"react/jsx-runtime";function Kc(e){return e.id==="cross-staking"||e.type==="cross-staking"}function ci({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:i,domain:a,close:s}=Eo(),{data:c}=Lo(o),l=wn.useMemo(()=>si(c?.items??[]),[c?.items]),d=8,w=wn.useRef(null),h=wn.useCallback(x=>{w.current={x:x.clientX,y:x.clientY}},[]),m=typeof window<"u"?window.location.pathname:"",y=wn.useCallback((x,R)=>{if(w.current){let k=x.clientX-w.current.x,N=x.clientY-w.current.y;if(w.current=null,Math.abs(k)>d||Math.abs(N)>d)return}let p=R.url[o]??R.url.production,C=li(p,a);if(!C)try{let k=new URL(p).pathname;if(m===k||m.startsWith(k+"/")){s();return}}catch{}C?window.open(p,"_blank","noopener,noreferrer"):window.location.href=p,s()},[o,a,s,m]),b=x=>{let R=x.url[o]??x.url.production,p=li(R,a),C=Dr(x),k=C==="ending",N=ii(x.iconUrl,o),E=!1;if(!p)try{let T=new URL(R).pathname;E=m===T||m.startsWith(T+"/")}catch{E=!1}return Le("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":x.id,"data-active":E||void 0,"data-service-status":C,onPointerDown:h,onClick:T=>y(T,x),children:Mn("div",{className:"al-grid-item-left",children:[Mn("div",{className:"al-grid-item-icon",children:[Le("img",{src:N,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Le("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),Mn("span",{className:"al-grid-item-text",children:[Le("span",{className:"al-grid-item-label",children:x.label}),k&&Le("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!Kc(x)&&Le("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},u=Le("div",{className:"al-menu","data-theme":r,children:Le("div",{className:"al-grid",children:l.map(b)})});return i?Le(ge,{feature:"app_launcher",children:Mn(Bn.Portal,{children:[Le(Bn.Overlay,{className:"al-drawer-overlay"}),Mn(Bn.Content,{className:fe("al-drawer-content",n),"data-theme":r,children:[Mn("div",{className:"al-drawer-header",children:[Le(Bn.Close,{className:"al-drawer-close","data-track":"close",children:Le(Ja,{})}),Le(Bn.Title,{className:"al-drawer-title",children:"CROSS Services"}),Le(Bn.Close,{className:"al-drawer-close","data-track":"close",children:Le(ei,{})})]}),Le("div",{className:"al-drawer-body",children:u})]})]})}):Le(ge,{feature:"app_launcher",children:Le(Ao.Portal,{children:Le(Ao.Content,{align:e,sideOffset:t,className:fe("al-popover-content",n),"data-theme":r,children:u})})})}function li(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}import*as Ve from"react";import*as Dl from"@radix-ui/react-popover";import{Drawer as hu}from"vaul";import{createContext as Qc,useContext as Yc}from"react";var Or=Qc(null);function an(){let e=Yc(Or);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Wr=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Wr||{}),Po={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};import*as es from"react";import{jsx as re,jsxs as eo}from"react/jsx-runtime";function di({size:e=16,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("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"}),re("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 Jn({size:e=16,className:t}){return re("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("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 xn({size:e=16,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ot({size:e=24,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function pi({size:e=20,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("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"}),re("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 _o({size:e=20,className:t}){return re("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:re("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 vn({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function yn({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function fi({size:e=16,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("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"}),re("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 ui({size:e=16,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("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"}),re("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function mi({size:e=42,className:t}){return re("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:re("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})})}function gi({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M9.19133 10.8077C9.04905 10.6657 8.87947 10.554 8.69283 10.4792L2.78881 8.11167C2.71832 8.08338 2.65816 8.03421 2.61642 7.97075C2.57468 7.90729 2.55335 7.83258 2.5553 7.75665C2.55724 7.68072 2.58237 7.6072 2.6273 7.54596C2.67224 7.48472 2.73483 7.4387 2.80668 7.41406L16.9525 2.5747C17.0185 2.55087 17.0899 2.54632 17.1583 2.56159C17.2268 2.57685 17.2895 2.6113 17.3391 2.66089C17.3887 2.71049 17.4231 2.77319 17.4384 2.84165C17.4536 2.9101 17.4491 2.9815 17.4253 3.04746L12.5859 17.1933C12.5613 17.2651 12.5152 17.3277 12.454 17.3727C12.3928 17.4176 12.3192 17.4427 12.2433 17.4447C12.1674 17.4466 12.0927 17.4253 12.0292 17.3835C11.9658 17.3418 11.9166 17.2817 11.8883 17.2112L9.52073 11.3056C9.44567 11.1191 9.33362 10.9498 9.19133 10.8077ZM9.19133 10.8077L17.3367 2.66404",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function hi({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M10.8333 14.1667V7.5M15 14.1667V4.16667M2.5 2.5V15.8333C2.5 16.2754 2.67559 16.6993 2.98816 17.0118C3.30072 17.3244 3.72464 17.5 4.16667 17.5H17.5M6.66667 14.1667V11.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function bi({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M6.6665 9.99984H13.3332M9.99984 6.6665V13.3332M18.3332 9.99984C18.3332 14.6022 14.6022 18.3332 9.99984 18.3332C5.39746 18.3332 1.6665 14.6022 1.6665 9.99984C1.6665 5.39746 5.39746 1.6665 9.99984 1.6665C14.6022 1.6665 18.3332 5.39746 18.3332 9.99984Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function wi({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M6.667 2.5 3.333 5.833 6.667 9.167M3.333 5.833h13.334M13.333 17.5l3.334-3.333-3.334-3.334M16.667 14.167H3.333",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function xi({size:e=20,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),re("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as B from"react";import kn from"bignumber.js";function Zc(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 sn(e,t){if(!e||e==="0")return"0.00";let n=new kn(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,kn.ROUND_DOWN)}function ut(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Ur(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,o=Math.pow(10,n);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function vi(e,t,n){let r=new kn(e).shiftedBy(-t).multipliedBy(new kn(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(kn.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,kn.ROUND_DOWN):r.decimalPlaces(4,kn.ROUND_DOWN)).toFormat()}`}function yi(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 a=Number(n);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};n=Zc(a.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let a=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return r.length<4?{displayValue:`${o}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}import{useMemo as td}from"react";import{useQuery as nd}from"@tanstack/react-query";var Ne={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},Dn="https://terms.crosstoken.io/docs/cross-terms-of-use",Fo="https://terms.crosstoken.io/docs/nexus-privacy-policy";import*as On from"react";var Xc={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",production:"https://contents.crosstoken.io/frontend/common/app-launcher"},Jc=3e3;function Sn(e,t){if(e!=null)return typeof e=="object"&&!Array.isArray(e)&&("dev"in e||"stage"in e||"production"in e)?e[t]:e}var zr=new Map;function ki(e,t){let n=`${Xc[t]}/${e}`,o=zr.get(n);return o||(o=(async()=>{let r=new AbortController,i=setTimeout(()=>r.abort(),Jc);try{let a=await fetch(n,{cache:"no-store",signal:r.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(r=>(r===null&&zr.delete(n),r)),zr.set(n,o)),o}function ed(e){return typeof e=="string"&&e.startsWith("https://")}async function le(e,t){let n=await ki("endpoints.json",t),o=Sn(n?.apis?.[e],t);if(!ed(o))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return o}function Rn(e,t,n){let[o,r]=On.useState(void 0),i=On.useRef(n);return i.current=n,On.useEffect(()=>{let a=!0;return ki(e,t).then(s=>{if(!a)return;let c=i.current(s);c!==void 0&&r(c)}),()=>{a=!1}},[e,t]),o}var od="send:chain-info";function rd(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let n=t[0];if(!n)throw new Error("Chain info payload is empty.");return n}return t}return e}function Gr(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function ad(e,t,n,o){if(o)return t===Ne[e].cross?Si(t,o):n?.explorer_url?Gr(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):id(e,t,o)}function Si(e,t){return Gr("https://explorer.onechain.nexus",String(e),"tx",t)}function id(e,t,n){let o=Ne[e];if(t===o.cross)return Si(t,n);if(t===o.bsc)return Gr(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function Bo(e,t,n,o=!0){let r=nd({queryKey:[od,e,t],queryFn:async({signal:s})=>{let c=await le("walletServer",e),l=await fetch(`${c}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Failed to fetch chain info: ${l.status}`);let d=await l.json();if("code"in d&&d.code!==void 0&&d.code!==200)throw new Error(`Chain info API error: ${d.code}`);return rd(d)},enabled:o,staleTime:3e5}),i=r.data;return{transactionUrl:td(()=>ad(e,t,i,n),[t,i,e,n]),chainInfo:i,...r}}var Ri="0x0000000000000000000000000000000000000001";var sd="0xa9059cbb",ld=/^0x[a-fA-F0-9]{40}$/,cd="nexus-cross:dapp-ui:send:recent:",Ci=10;function dd(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function to(e){return e.toLowerCase()}function Wt(e){return ld.test(e)}function ln(e){return to(e.address)===Ri}function Hr(e){return`${cd}${e.toLowerCase()}`}function Wn(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Hr(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&Wt(o.address)&&typeof o.updatedAt=="number").slice(0,Ci):[]}catch{return[]}}function $r(e,t){if(typeof window>"u")return[];let n=to(t),o=[{address:n,updatedAt:Date.now()},...Wn(e).filter(r=>r.address!==n)].slice(0,Ci);try{window.localStorage.setItem(Hr(e),JSON.stringify(o))}catch{return Wn(e)}return o}function jr(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Hr(e))}catch{}}function Jt(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[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(o||"0"),a=r.padEnd(t,"0"),s=a?BigInt(a):0n,c=10n**BigInt(t),l=i*c+s;return l<=0n?{error:"Amount must be greater than 0."}:{value:l}}function no(e,t){let n=BigInt(e||"0"),o=10n**BigInt(t),r=n/o,i=n%o;if(i===0n)return r.toString();let a=dd(i.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Vr(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${sd}${n}${o}`}function Mo(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,i=e%o;if(i===0n)return r.toString();let s=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return s=s.replace(/0+$/,""),s?`${r.toString()}.${s}`:r.toString()}function qr(e,t){return Mo(e,t,6)}function Ti(e){return Mo(e,9,2)}function Ni(e){return e.toLocaleString("en-US")}function Do(e){return e===56||e===97}function Oo(e){return e.gasPrice??e.maxFeePerGas}function Ii(e,t=!1){return t?Oo(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Wo(e,t=!1){if(t){let n=Oo(e);return n!==void 0?e.gasLimit*n:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function Uo(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Ei(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let n=e,o=[];return typeof n.name=="string"&&o.push(n.name),typeof n.shortMessage=="string"&&o.push(n.shortMessage),typeof n.message=="string"&&o.push(n.message),typeof n.details=="string"&&o.push(n.details),n.cause!==void 0&&o.push(Ei(n.cause,t+1)),o.join(`
|
|
5
|
+
`);Y("");import{jsx as Mr}from"react/jsx-runtime";function Za({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let i=Pn(`(max-width: ${n}px)`),[a,s]=_n.useState(!1),c=_n.useCallback(()=>s(!1),[]),l=Ee(e),d=_n.useMemo(()=>({env:l,theme:t,isMobile:i,open:a,domain:o,close:c}),[l,t,i,a,o,c]);return Mr(Br.Provider,{value:d,children:i?Mr(Gc.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:r},"drawer"):Mr(Ya.Root,{open:a,onOpenChange:s,children:r},"popover")})}import*as ti from"@radix-ui/react-popover";import{Drawer as $c}from"vaul";import{jsx as ft,jsxs as Hc}from"react/jsx-runtime";function Xa({size:e=18}){return Hc("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ft("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),ft("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Ja(){return ft("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ft("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ei(){return ft("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ft("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Fn}from"react/jsx-runtime";function ni({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:i}=Eo(),a=t!=null,s=e??!0,c=n?`al-trigger-btn ${n}`:"al-trigger-btn",l=a?t:Fn("button",{type:"button",className:c,"data-theme":i,"data-track":"open",style:o,children:Fn(Xa,{size:18})});return r?Fn(ge,{feature:"app_launcher",children:Fn($c.Trigger,{asChild:s,children:l})}):Fn(ge,{feature:"app_launcher",children:Fn(ti.Trigger,{asChild:s,children:l})})}import*as wn from"react";import*as Ao from"@radix-ui/react-popover";import{Drawer as Bn}from"vaul";import{useQuery as qc}from"@tanstack/react-query";var oi={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json",production:"https://contents.crosstoken.io/frontend/common/app-launcher/app-launcher-v2.json"};var jc="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Vc="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function It(e,t){return`${e==="production"?Vc:jc}/${t}.png`}function ri(e){let t=e==="production"?"production":"stage";return{version:"0.0.1-fallback",items:[{id:"gametoken-cross",label:"Gametoken",description:"Trade game tokens easily using CROSS.",url:{dev:"https://stg.onechain.nexus/gametoken",stage:"https://stg.onechain.nexus/gametoken",production:"https://www.onechain.nexus/gametoken"},iconUrl:It(t,"game-token"),order:1e3,type:"gametoken",badge:null,isNew:!1,serviceStatus:"available"},{id:"forge",label:"Forge",description:"Launch Your Game, Ignite the Market",url:{dev:"https://stg.onechain.nexus/forge",stage:"https://stg.onechain.nexus/forge",production:"https://onechain.nexus/forge"},iconUrl:It(t,"forge"),order:4e3,type:"forge",badge:null,isNew:!0,serviceStatus:"available"},{id:"crossd",label:"Bridge",description:"The first decentralized exchange on the CROSS network.",url:{dev:"https://stg.crossdefi.io/swap-bridge",stage:"https://stg.crossdefi.io/swap-bridge",production:"https://www.crossdefi.io/swap-bridge"},iconUrl:It(t,"crossd"),order:5e3,type:"crossd",badge:null,isNew:!1,serviceStatus:"ending"},{id:"prediction",label:"Prediction",description:"Prediction market",url:{dev:"https://stg-prediction.crossdefi.io",stage:"https://stg-prediction.crossdefi.io",production:"https://prediction.crossdefi.io/"},iconUrl:It(t,"prediction"),order:6e3,type:"prediction",badge:null,isNew:!0,serviceStatus:"available"},{id:"rewards",label:"Rewards",description:"Deposit CROSS and earn rewards. Grow together.",url:{dev:"https://stg.onechain.nexus/rewards",stage:"https://stg.onechain.nexus/rewards",production:"https://onechain.nexus/rewards"},iconUrl:It(t,"reward"),order:7e3,type:"rewards",badge:null,isNew:!1,serviceStatus:"ending"},{id:"cross-staking",label:"Staking",description:"Stake CROSS and earn rewards.",url:{dev:"https://stg-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},iconUrl:It(t,"cross-staking"),order:7500,type:"cross-staking",badge:null,isNew:!0,serviceStatus:"available"},{id:"nft",label:"NFT",description:"Trade and collect NFTs in the CROSS ecosystem.",url:{dev:"https://stg.crossnft.io/",stage:"https://stg.crossnft.io/",production:"https://www.crossnft.io/"},iconUrl:It(t,"nft"),order:8e3,type:"nft",badge:null,isNew:!1,serviceStatus:"available"},{id:"play",label:"Quest",description:"Discover and play games on CROSS.",url:{dev:"https://stg.onechain.nexus/quest",stage:"https://stg.onechain.nexus/quest",production:"https://www.onechain.nexus/quest"},iconUrl:It(t,"play"),order:8500,type:"play",badge:null,isNew:!0,serviceStatus:"available"},{id:"shop",label:"Shop",description:"Game Payment Platform & In-Game Currency Store.",url:{dev:"https://stg.onechain.nexus/shop",stage:"https://stg.onechain.nexus/shop",production:"https://www.onechain.nexus/shop"},iconUrl:It(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.onechain.nexus",stage:"https://stg-explorer.onechain.nexus",production:"https://explorer.onechain.nexus"},iconUrl:It(t,"explorer"),order:12e3,type:"explorer",badge:null,isNew:!1,serviceStatus:"available"},{id:"wave",label:"Wave",description:"Stream, support, and earn in the CROSS ecosystem.",url:{dev:"https://stg.onechain.nexus/wave",stage:"https://stg.onechain.nexus/wave",production:"https://www.onechain.nexus/wave"},iconUrl:It(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function Lo(e){let t=Ee(e);return qc({queryKey:["global-menu",t],queryFn:async()=>{try{let n=await fetch(oi[t],{cache:"no-store"});if(!n.ok)throw new Error(`Failed to fetch global menu: ${n.status}`);return n.json()}catch{return ri(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function Dr(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function ii(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function si(e){return[...e].sort((t,n)=>{let o=ai(t)-ai(n);return o!==0?o:t.order-n.order})}function ai(e){let t=Dr(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as Le,jsxs as Mn}from"react/jsx-runtime";function Kc(e){return e.id==="cross-staking"||e.type==="cross-staking"}function ci({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:i,domain:a,close:s}=Eo(),{data:c}=Lo(o),l=wn.useMemo(()=>si(c?.items??[]),[c?.items]),d=8,w=wn.useRef(null),h=wn.useCallback(x=>{w.current={x:x.clientX,y:x.clientY}},[]),m=typeof window<"u"?window.location.pathname:"",y=wn.useCallback((x,R)=>{if(w.current){let k=x.clientX-w.current.x,N=x.clientY-w.current.y;if(w.current=null,Math.abs(k)>d||Math.abs(N)>d)return}let p=R.url[o]??R.url.production,C=li(p,a);if(!C)try{let k=new URL(p).pathname;if(m===k||m.startsWith(k+"/")){s();return}}catch{}C?window.open(p,"_blank","noopener,noreferrer"):window.location.href=p,s()},[o,a,s,m]),b=x=>{let R=x.url[o]??x.url.production,p=li(R,a),C=Dr(x),k=C==="ending",N=ii(x.iconUrl,o),E=!1;if(!p)try{let T=new URL(R).pathname;E=m===T||m.startsWith(T+"/")}catch{E=!1}return Le("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":x.id,"data-active":E||void 0,"data-service-status":C,onPointerDown:h,onClick:T=>y(T,x),children:Mn("div",{className:"al-grid-item-left",children:[Mn("div",{className:"al-grid-item-icon",children:[Le("img",{src:N,alt:x.label,width:24,height:24,loading:"lazy"}),x.isNew&&Le("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),Mn("span",{className:"al-grid-item-text",children:[Le("span",{className:"al-grid-item-label",children:x.label}),k&&Le("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),x.badge&&!Kc(x)&&Le("span",{className:"al-badge al-badge-list",children:x.badge})]})]})},x.id)},u=Le("div",{className:"al-menu","data-theme":r,children:Le("div",{className:"al-grid",children:l.map(b)})});return i?Le(ge,{feature:"app_launcher",children:Mn(Bn.Portal,{children:[Le(Bn.Overlay,{className:"al-drawer-overlay"}),Mn(Bn.Content,{className:fe("al-drawer-content",n),"data-theme":r,children:[Mn("div",{className:"al-drawer-header",children:[Le(Bn.Close,{className:"al-drawer-close","data-track":"close",children:Le(Ja,{})}),Le(Bn.Title,{className:"al-drawer-title",children:"CROSS Services"}),Le(Bn.Close,{className:"al-drawer-close","data-track":"close",children:Le(ei,{})})]}),Le("div",{className:"al-drawer-body",children:u})]})]})}):Le(ge,{feature:"app_launcher",children:Le(Ao.Portal,{children:Le(Ao.Content,{align:e,sideOffset:t,className:fe("al-popover-content",n),"data-theme":r,children:u})})})}function li(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}import*as Ve from"react";import*as Dl from"@radix-ui/react-popover";import{Drawer as hu}from"vaul";import{createContext as Qc,useContext as Yc}from"react";var Or=Qc(null);function an(){let e=Yc(Or);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Wr=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Wr||{}),Po={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};import*as es from"react";import{jsx as re,jsxs as eo}from"react/jsx-runtime";function di({size:e=16,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("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"}),re("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 Jn({size:e=16,className:t}){return re("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("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 xn({size:e=16,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ot({size:e=24,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function pi({size:e=20,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("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"}),re("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 _o({size:e=20,className:t}){return re("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:re("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 vn({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function yn({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function fi({size:e=16,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("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"}),re("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 ui({size:e=16,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("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"}),re("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function mi({size:e=42,className:t}){return re("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:re("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})})}function gi({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M9.19133 10.8077C9.04905 10.6657 8.87947 10.554 8.69283 10.4792L2.78881 8.11167C2.71832 8.08338 2.65816 8.03421 2.61642 7.97075C2.57468 7.90729 2.55335 7.83258 2.5553 7.75665C2.55724 7.68072 2.58237 7.6072 2.6273 7.54596C2.67224 7.48472 2.73483 7.4387 2.80668 7.41406L16.9525 2.5747C17.0185 2.55087 17.0899 2.54632 17.1583 2.56159C17.2268 2.57685 17.2895 2.6113 17.3391 2.66089C17.3887 2.71049 17.4231 2.77319 17.4384 2.84165C17.4536 2.9101 17.4491 2.9815 17.4253 3.04746L12.5859 17.1933C12.5613 17.2651 12.5152 17.3277 12.454 17.3727C12.3928 17.4176 12.3192 17.4427 12.2433 17.4447C12.1674 17.4466 12.0927 17.4253 12.0292 17.3835C11.9658 17.3418 11.9166 17.2817 11.8883 17.2112L9.52073 11.3056C9.44567 11.1191 9.33362 10.9498 9.19133 10.8077ZM9.19133 10.8077L17.3367 2.66404",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function hi({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M10.8333 14.1667V7.5M15 14.1667V4.16667M2.5 2.5V15.8333C2.5 16.2754 2.67559 16.6993 2.98816 17.0118C3.30072 17.3244 3.72464 17.5 4.16667 17.5H17.5M6.66667 14.1667V11.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function bi({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M6.6665 9.99984H13.3332M9.99984 6.6665V13.3332M18.3332 9.99984C18.3332 14.6022 14.6022 18.3332 9.99984 18.3332C5.39746 18.3332 1.6665 14.6022 1.6665 9.99984C1.6665 5.39746 5.39746 1.6665 9.99984 1.6665C14.6022 1.6665 18.3332 5.39746 18.3332 9.99984Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function wi({size:e=20,className:t}){return re("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:re("path",{d:"M6.667 2.5 3.333 5.833 6.667 9.167M3.333 5.833h13.334M13.333 17.5l3.334-3.333-3.334-3.334M16.667 14.167H3.333",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function xi({size:e=20,className:t}){return eo("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[re("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),re("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as B from"react";import kn from"bignumber.js";function Zc(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 sn(e,t){if(!e||e==="0")return"0.00";let n=new kn(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,kn.ROUND_DOWN)}function ut(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Ur(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let n=t>=1?2:4,o=Math.pow(10,n);return`$${(Math.floor(t*o)/o).toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function vi(e,t,n){let r=new kn(e).shiftedBy(-t).multipliedBy(new kn(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(kn.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,kn.ROUND_DOWN):r.decimalPlaces(4,kn.ROUND_DOWN)).toFormat()}`}function yi(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 a=Number(n);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};n=Zc(a.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let a=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return r.length<4?{displayValue:`${o}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}import{useMemo as td}from"react";import{useQuery as nd}from"@tanstack/react-query";var Ne={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},Dn="https://terms.crosstoken.io/docs/cross-terms-of-use",Fo="https://terms.crosstoken.io/docs/nexus-privacy-policy";import*as On from"react";var Xc={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",production:"https://contents.crosstoken.io/frontend/common/app-launcher"},Jc=3e3;function Sn(e,t){if(e!=null)return typeof e=="object"&&!Array.isArray(e)&&("dev"in e||"stage"in e||"production"in e)?e[t]:e}var zr=new Map;function ki(e,t){let n=`${Xc[t]}/${e}`,o=zr.get(n);return o||(o=(async()=>{let r=new AbortController,i=setTimeout(()=>r.abort(),Jc);try{let a=await fetch(n,{cache:"no-store",signal:r.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(r=>(r===null&&zr.delete(n),r)),zr.set(n,o)),o}function ed(e){return typeof e=="string"&&e.startsWith("https://")}async function le(e,t){let n=await ki("endpoints.json",t),o=Sn(n?.apis?.[e],t);if(!ed(o))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return o}function Rn(e,t,n){let[o,r]=On.useState(void 0),i=On.useRef(n);return i.current=n,On.useEffect(()=>{let a=!0;return ki(e,t).then(s=>{if(!a)return;let c=i.current(s);c!==void 0&&r(c)}),()=>{a=!1}},[e,t]),o}var od="send:chain-info";function rd(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let n=t[0];if(!n)throw new Error("Chain info payload is empty.");return n}return t}return e}function Gr(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function ad(e,t,n,o){if(o)return t===Ne[e].cross?Si(t,o):n?.explorer_url?Gr(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):id(e,t,o)}function Si(e,t){return Gr("https://explorer.onechain.nexus",String(e),"tx",t)}function id(e,t,n){let o=Ne[e];if(t===o.cross)return Si(t,n);if(t===o.bsc)return Gr(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function Bo(e,t,n,o=!0){let r=nd({queryKey:[od,e,t],queryFn:async({signal:s})=>{let c=await le("walletServer",e),l=await fetch(`${c}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Failed to fetch chain info: ${l.status}`);let d=await l.json();if("code"in d&&d.code!==void 0&&d.code!==200)throw new Error(`Chain info API error: ${d.code}`);return rd(d)},enabled:o,staleTime:3e5}),i=r.data;return{transactionUrl:td(()=>ad(e,t,i,n),[t,i,e,n]),chainInfo:i,...r}}var Ri="0x0000000000000000000000000000000000000001";var sd="0xa9059cbb",ld=/^0x[a-fA-F0-9]{40}$/,cd="nexus-cross:dapp-ui:send:recent:",Ci=10;function dd(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function to(e){return e.toLowerCase()}function Wt(e){return ld.test(e)}function ln(e){return to(e.address)===Ri}function Hr(e){return`${cd}${e.toLowerCase()}`}function Wn(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Hr(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&Wt(o.address)&&typeof o.updatedAt=="number").slice(0,Ci):[]}catch{return[]}}function $r(e,t){if(typeof window>"u")return[];let n=to(t),o=[{address:n,updatedAt:Date.now()},...Wn(e).filter(r=>r.address!==n)].slice(0,Ci);try{window.localStorage.setItem(Hr(e),JSON.stringify(o))}catch{return Wn(e)}return o}function jr(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Hr(e))}catch{}}function Jt(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[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(o||"0"),a=r.padEnd(t,"0"),s=a?BigInt(a):0n,c=10n**BigInt(t),l=i*c+s;return l<=0n?{error:"Amount must be greater than 0."}:{value:l}}function no(e,t){let n=BigInt(e||"0"),o=10n**BigInt(t),r=n/o,i=n%o;if(i===0n)return r.toString();let a=dd(i.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Vr(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${sd}${n}${o}`}function Mo(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,i=e%o;if(i===0n)return r.toString();let s=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return s=s.replace(/0+$/,""),s?`${r.toString()}.${s}`:r.toString()}function qr(e,t){return Mo(e,t,6)}function Ti(e){return Mo(e,9,2)}function Ni(e){return e.toLocaleString("en-US")}function Do(e){return e===56||e===97}function Oo(e){return e.gasPrice??e.maxFeePerGas}function Ii(e,t=!1){return t?Oo(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Wo(e,t=!1){if(t){let n=Oo(e);return n!==void 0?e.gasLimit*n:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function Uo(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Ei(e,t=0){if(t>4||e===null||e===void 0)return"";if(typeof e=="string")return e.toLowerCase();if(typeof e!="object")return"";let n=e,o=[];return typeof n.name=="string"&&o.push(n.name),typeof n.shortMessage=="string"&&o.push(n.shortMessage),typeof n.message=="string"&&o.push(n.message),typeof n.details=="string"&&o.push(n.details),n.cause!==void 0&&o.push(Ei(n.cause,t+1)),o.join(`
|
|
6
6
|
`).toLowerCase()}function pd(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;if(e&&typeof e=="object"){let t=e;if(typeof t.shortMessage=="string")return t.shortMessage;if(typeof t.message=="string")return t.message}return""}function Kr(e,t={},n="Failed to send transaction."){let o=Ei(e);if(!o)return n;let r=t.nativeSymbol?.trim()||"gas token",i=t.networkName?.trim();if(o.includes("user rejected")||o.includes("userrejected")||o.includes("user denied")||o.includes("user cancelled")||o.includes("user canceled")||o.includes("action_rejected")||o.includes("rejected by user"))return"Transaction was cancelled.";if(o.includes("insufficientfunds")||o.includes("insufficient funds")||o.includes("exceeds the balance of the account")||o.includes("insufficient balance for transfer")){let a=i?` on ${i}`:"";return`Not enough ${r} to cover the gas fee.Please top up your ${r} balance and try again.`}return o.includes("transaction underpriced")||o.includes("replacement transaction underpriced")||o.includes("fee too low")?"Gas fee was too low for the network. Please try again.":o.includes("nonce too low")||o.includes("nonce has already been used")||o.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":o.includes("execution reverted")||o.includes("contractfunctionrevertederror")||o.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":o.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":o.includes("http request failed")||o.includes("failed to fetch")||o.includes("network request failed")||o.includes("timeout")||o.includes("econnreset")||o.includes("rpc error")||o.includes("429")?"Network connection failed. Check your internet and try again.":o.includes("estimategas")||o.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":pd(e)||n}var fd=2000000000n,ud=1000000000n;async function zo(e,t,n){let o=new AbortController,r=setTimeout(()=>o.abort(),8e3),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:o.signal}).finally(()=>clearTimeout(r));if(!i.ok)throw new Error(`RPC ${t} HTTP ${i.status}`);let a=await i.json();if(a.error)throw new Error(`RPC ${t}: ${a.error.message}`);if(a.result===void 0)throw new Error(`RPC ${t}: empty result`);return a.result}function Go(e){return BigInt(e)}function md(e){return`0x${e.toString(16)}`}function gd(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=md(e.value)),e.data&&(t.data=e.data),t}function hd(e){return e===56||e===97}async function Li(e){try{let t=await zo(e,"eth_gasPrice",[]);return{gasPrice:Go(t)}}catch{return{gasPrice:fd}}}async function bd(e,t){let n=ud;try{let o=await zo(e,"eth_maxPriorityFeePerGas",[]);n=Go(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function wd(e,t){if(t)return Li(e);let n;try{n=(await zo(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?bd(e,Go(n)):Li(e)}async function Ai(e,t){let n=hd(t.chainId),o=gd(t),[r,i]=await Promise.all([zo(e,"eth_estimateGas",[o]),wd(e,n)]);return{gasLimit:Go(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function Pi(e){let{estimateGas:t,sendTransaction:n,getTransactionReceipt:o}=e;return{canSend:!!n,canEstimateGas(r){return!!t||!!r},async estimateGas(r,i){if(t)return t(r);if(i)return Ai(i,r);throw new Error("Gas estimation is not available.")},async sendTransaction(r){if(!n)throw new Error("Sending is not available for this wallet.");return n(r)},getTransactionReceipt:o}}var xd=1500,vd=120;function _i(e){return!!(e.token||e.recipient||e.amount)}function Qr({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},i=e.trim(),a=Jt(t,n.quantity.decimals),s;return i?Wt(i)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in a?r.amount=a.error:(s=a.value,s>o&&(r.amount="Amount exceeds available balance.")),!ln(n)&&!Wt(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:s,recipient:i&&Wt(i)?i:void 0}}function Yr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return ln(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:to(e.address),data:Vr(n,o),value:0n,chainId:e.chainId,from:r}}function yd(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var kd=e=>new Promise(t=>setTimeout(t,e));async function Fi({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=xd,pollMaxAttempts:i=vd}){let a=await e.sendTransaction(t);o(a);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let c=0;c<i;c+=1){let l=await s({hash:a,chainId:n}).catch(()=>null);if(l)return yd(l)?"reverted":"success";await kd(r)}return"timeout"}var Bi=["token","recipient","amount","review"];function Mi(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:i="recipient",token:a,tokens:s=[],onTokenChange:c,sendTransaction:l,getTransactionReceipt:d,estimateGas:w,getTokenPriceUsd:h,onSubmitted:m,onSuccess:y,onFailed:b,onExit:u,onOutlink:x}=e,R=B.useMemo(()=>Pi({sendTransaction:l,getTransactionReceipt:d,estimateGas:w}),[l,d,w]),[p,C]=B.useState(a);B.useEffect(()=>{C(a)},[a.address,a.chainId]);let[k,N]=B.useState(i),[E,T]=B.useState(""),[M,q]=B.useState(""),[L,K]=B.useState({}),[U,ce]=B.useState("idle"),[J,$]=B.useState(""),[ne,G]=B.useState(""),[D,ae]=B.useState(null),[me,j]=B.useState(!1),[_e,xe]=B.useState(""),O=B.useRef(0),[ee,Fe]=B.useState(null),[Q,be]=B.useState(""),[Be,Me]=B.useState(()=>Wn(n)),St=B.useRef(new Set),ue=B.useCallback((I,Z)=>{St.current.has(I)||(St.current.add(I),Te("send",I,Z))},[]);B.useEffect(()=>{ue("opened"),i!=="token"&&ue("token_selected",{tags:{item_id:a.symbol}})},[ue,i,a.symbol]);let Ke=B.useMemo(()=>Ee(t),[t]),{transactionUrl:tt,chainInfo:De}=Bo(Ke,p.chainId,J||void 0,!0),Ie=De?.currency_symbol??"",We=De?.name??`Chain ID ${p.chainId}`,Qt=B.useRef({nativeSymbol:Ie||void 0,networkName:We,tokenSymbol:p.symbol});Qt.current={nativeSymbol:Ie||void 0,networkName:We,tokenSymbol:p.symbol};let nt=B.useMemo(()=>BigInt(p.quantity.numeric||"0"),[p.quantity.numeric]),gt=B.useMemo(()=>sn(p.quantity.numeric,p.quantity.decimals),[p.quantity.numeric,p.quantity.decimals]),ze=h?.(p),Rt=B.useMemo(()=>{if(ze===void 0)return;let I=parseFloat(M.replace(/,/g,""));return Number.isFinite(I)?I*ze:0},[M,ze]);B.useEffect(()=>{q(""),K({})},[p.address,p.chainId]),B.useEffect(()=>{O.current+=1,ae(null),xe(""),j(!1)},[p.address,p.chainId,E,M]),B.useEffect(()=>{Me(Wn(n))},[n]);let ht=B.useCallback(I=>{T(I),K(Z=>({...Z,recipient:void 0}))},[]),ve=B.useCallback(I=>{q(I),K(Z=>({...Z,amount:void 0}))},[]),Mt=B.useCallback(()=>{q(gt.replace(/,/g,"")),K(I=>({...I,amount:void 0}))},[gt]),Dt=B.useCallback(I=>{C(I),c?.(I),ue("token_selected",{tags:{item_id:I.symbol}}),N("recipient")},[c,ue]),ot=B.useCallback(()=>N("token"),[]),Ge=B.useCallback(()=>{N(I=>{if(I==="result")return"review";if(I===i)return u?.(),I;let Z=Bi.indexOf(I);return Z<=0?(u?.(),I):Bi[Z-1]})},[i,u]),rt=B.useCallback(()=>{let{errors:I}=Qr({recipient:E,amount:"1",token:p,balanceRaw:nt});if(I.recipient){K(Z=>({...Z,recipient:I.recipient}));return}K(Z=>({...Z,recipient:void 0})),ue("recipient_entered"),N("amount")},[E,p,nt,ue]),Qe=B.useCallback(I=>{T(I),K(Z=>({...Z,recipient:void 0})),ue("recipient_entered"),N("amount")},[ue]),He=B.useCallback(()=>{let I=Qr({recipient:E,amount:M,token:p,balanceRaw:nt});K(I.errors),!(_i(I.errors)||I.rawAmount===void 0||!I.recipient)&&(Fe(I.rawAmount),be(I.recipient),ae(null),xe(""),ce("idle"),ue("amount_entered"),N("review"))},[E,M,p,nt,ue]);B.useEffect(()=>{if(k!=="review"||!Q||ee===null||D!==null||me||_e||!R.canEstimateGas(De?.rpc))return;let I=++O.current;j(!0),xe(""),(async()=>{try{let Z=Yr({token:p,walletAddress:n,recipient:Q,rawAmount:ee}),ie=await R.estimateGas(Z,De?.rpc);if(O.current!==I)return;ae(ie)}catch(Z){if(O.current!==I)return;xe(Kr(Z,Qt.current,"Failed to estimate gas."))}finally{O.current===I&&j(!1)}})()},[k,Q,ee,D,me,_e,R,De?.rpc,p,n]);let ye=B.useMemo(()=>{if(!ln(p)||!D||ee===null)return!1;let I=Wo(D,Do(p.chainId));return I===null?!1:ee+I>nt},[p,D,ee,nt]),dt=B.useCallback(async()=>{if(!(!Q||ee===null)&&!ye){G(""),$(""),ce("submitting"),ue("submitted");try{let I="",Z=await Fi({repository:R,args:Yr({token:p,walletAddress:n,recipient:Q,rawAmount:ee}),chainId:p.chainId,onSubmitted:ie=>{I=ie,$(ie),ce("confirming"),Me($r(n,Q)),m?.({txHash:ie,chainId:p.chainId,amount:M,tokenSymbol:p.symbol,recipient:Q})}});if(Z==="success")ce("success"),ue("confirmed"),I&&y?y?.(I):N("result");else if(Z==="reverted"){let ie="Transaction reverted on-chain.";ce("error"),G(ie),ue("confirmed",{status:"failure",reason:Nt(new Error(ie))}),I&&b?b({txHash:I,chainId:p.chainId,message:ie}):N("result")}else{let ie="Transaction receipt was not found. Please check again later.";ce("error"),G(ie),ue("confirmed",{status:"failure",reason:"timeout"}),I&&b?b({txHash:I,chainId:p.chainId,message:ie}):N("result")}}catch(I){ce("error"),ue("confirmed",{status:"failure",reason:Nt(I)}),G(Kr(I,{nativeSymbol:Ie||void 0,networkName:We,tokenSymbol:p.symbol})),N("result")}}},[R,Q,ee,ye,p,M,n,m,y,b,Ie,We,ue]),[at,Ye]=B.useState(!1),bt=B.useRef(void 0);B.useEffect(()=>()=>clearTimeout(bt.current),[]);let Yt=B.useCallback(async()=>{if(J)try{await navigator.clipboard.writeText(J),Ye(!0),clearTimeout(bt.current),bt.current=setTimeout(()=>Ye(!1),2e3)}catch{}},[J]),rn=B.useCallback(()=>{if(!tt||!J)return;let I=it=>{typeof window<"u"&&window.open(it,"_blank","noopener,noreferrer")};if(!x){I(tt);return}let Z=x(tt,{category:"send",origin:"send-transaction",payload:{chainId:p.chainId,txHash:J}});if(Z&&typeof Z.then=="function"){let it=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;Z.then(Xt=>{if(Xt===null){it?.close();return}let pt=Xt??tt;if(it)try{it.location.href=pt}catch{it.close(),I(pt)}else I(pt)});return}let ie=Z;ie!==null&&I(ie??tt)},[x,p.chainId,tt,J]),Zt=B.useCallback(()=>{G(""),$(""),ce("idle"),ae(null),xe(""),St.current.delete("submitted"),St.current.delete("confirmed"),N("review")},[]);return{step:k,status:U,token:p,tokens:s.length>0?s:[p],recipient:E,amount:M,amountUsd:Rt,fieldErrors:L,error:ne,txHash:J,gasEstimate:D,gasLoading:me,gasError:_e,insufficientGas:ye,reviewRawAmount:ee,reviewRecipient:Q,recentAddresses:Be,accounts:r,accountName:o,walletAddress:n,resolvedEnv:Ke,transactionUrl:tt,networkName:We,nativeSymbol:Ie,nativeDecimals:De?.currency_decimals??p.quantity.decimals,balanceRaw:nt,balanceText:gt,priceUsd:ze,canSelectToken:(s.length>0?s:[p]).length>1,canSend:R.canSend,getTokenPriceUsd:h,setRecipient:ht,setAmount:ve,setMax:Mt,selectToken:Dt,goToTokenSelect:ot,selectRecipient:Qe,submitRecipient:rt,submitAmount:He,confirmSend:dt,retry:Zt,back:Ge,hashCopied:at,copyHash:Yt,openTransaction:rn}}import*as Et from"react";import{jsx as oo,jsxs as Zr}from"react/jsx-runtime";function Di({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:i,token:a,setMax:s}=e,c=Et.useRef(null),l=Et.useCallback(()=>{requestAnimationFrame(()=>{let b=c.current;if(!b)return;let u=b.value.length;b.setSelectionRange(u,u)})},[]);Et.useEffect(()=>{c.current?.focus(),l()},[l]),Et.useEffect(()=>{t===""&&(h(!1),l())},[t,l]);let d=Et.useMemo(()=>{let b=Jt(t,a.quantity.decimals);return"value"in b&&b.value>i},[t,a.quantity.decimals,i]),[w,h]=Et.useState(!1),m=!w&&t===""?"0.00":t,y=t.trim()===""||t.trim()==="0";return oo("div",{className:"sf-body sf-amount",children:Zr("div",{className:"sf-amount-center",children:[oo("span",{className:"sf-amount-usd",children:o!==void 0?Uo(o):"\xA0"}),oo("div",{className:"sf-amount-input-wrap","data-over":d||void 0,"data-empty":y||void 0,onClick:()=>c.current?.focus(),children:oo("input",{ref:c,className:"sf-amount-input",value:m,onChange:b=>{let u=b.target.value;if(w)n(u);else if(t===""){if(u.length<4)return;h(!0);let x=u.startsWith("0.00")?u.slice(4):u;n(x)}else h(!0),n(u)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),Zr("div",{className:"sf-amount-balance",children:[oo("span",{children:"Balance:"}),Zr("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[r," ",a.symbol]})]})]})})}import*as Lt from"react";var Rd=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function Wi(e){return Rd.has(e.toLowerCase())}var Oi={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function ro(e,t){let n=Ne[e];if(t===n.cross)return Oi.cross;if(t===n.bsc)return Oi.bsc}var Cd={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function en(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:i="png"}=n,a=Cd[e],s=r?`&bg=${r}`:"";return`${a}/portrait/evm/${t}.${i}?size=${o}${s}`}import{jsx as xt,jsxs as Ho}from"react/jsx-runtime";function Ui({size:e=20,className:t}){return Ho("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[xt("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),xt("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function zi({size:e=20,className:t}){return xt("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:xt("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2M12 11v6M9 14h6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Gi({size:e=20,className:t}){return Ho("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[xt("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),xt("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Hi({size:e=16,className:t}){return xt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:xt("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function $i({size:e=56,className:t}){return Ho("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[xt("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),xt("path",{d:"M17 28.5 24.2 35.5 39 20.5",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ji({size:e=56,className:t}){return Ho("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[xt("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),xt("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as Ae,jsxs as Ut}from"react/jsx-runtime";function Vi(e,t){return e.name||`Account ${(e.index??t)+1}`}function qi(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Ki(e){return e.toLowerCase()}function Qi({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:i,walletAddress:a,resolvedEnv:s,selectRecipient:c}=e,l=Lt.useMemo(()=>i.filter(p=>p.address.toLowerCase()!==a.toLowerCase()),[i,a]),d=l.length>0,w=Lt.useMemo(()=>new Map(l.map((p,C)=>[Ki(p.address),{account:p,index:C}])),[l]),[h,m]=Lt.useState("recent"),y=Lt.useRef(null);Lt.useEffect(()=>{y.current?.focus()},[]);let b="1A1A2E",u=Lt.useCallback(async()=>{try{let p=await navigator.clipboard.readText();p&&n(p.trim())}catch{}},[n]),x=t.trim().length>0,R=Wt(t.trim());return Ut("div",{className:"sf-recipient",children:[Ut("div",{className:"sf-recipient-top",children:[Ut("div",{className:"sf-address-field","data-filled":x||void 0,"data-invalid":o.recipient||void 0,children:[Ae("textarea",{ref:y,className:"sf-address-input",value:t,onChange:p=>n(p.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:x?2:1}),x?Ae("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear","data-track":"recipient_clear",children:Ae(Gi,{size:20})}):Ae("button",{type:"button",className:"sf-address-action",onClick:u,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:Ae(zi,{size:20})})]}),o.recipient&&Ae("p",{className:"sf-field-error",role:"alert",children:o.recipient}),Ut("div",{className:"sf-tabs",role:"tablist",children:[Ae("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="recent"||void 0,"aria-selected":h==="recent",onClick:()=>m("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),d&&Ae("button",{type:"button",role:"tab",className:"sf-tab","data-active":h==="account"||void 0,"aria-selected":h==="account",onClick:()=>m("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),Ae("div",{className:"sf-address-list",children:h==="account"&&d?l.map((p,C)=>{let k=Vi(p,C),N=en(s,p.address,{size:56,bg:b});return Ut("button",{type:"button",className:"sf-address-row",onClick:()=>c(p.address),"data-track":"recipient_item",children:[Ut("span",{className:"sf-address-avatar",children:[N&&Ae("img",{src:N,alt:"",width:40,height:40,draggable:!1,onError:E=>{E.currentTarget.style.display="none"}}),Ae("span",{className:"sf-address-avatar-fallback",children:qi(k)})]}),Ut("span",{className:"sf-address-meta",children:[Ae("span",{className:"sf-address-name",children:k}),Ae("span",{className:"sf-address-value",children:ut(p.address)})]})]},p.address)}):r.length>0?r.map(p=>{let C=w.get(Ki(p.address)),k=C?Vi(C.account,C.index):ut(p.address),N=en(s,p.address,{size:56,bg:b});return Ut("button",{type:"button",className:"sf-address-row",onClick:()=>c(p.address),"data-track":"recipient_item",children:[Ut("span",{className:"sf-address-avatar",children:[N&&Ae("img",{src:N,alt:"",width:40,height:40,draggable:!1,onError:E=>{E.currentTarget.style.display="none"}}),Ae("span",{className:"sf-address-avatar-fallback",children:qi(k)})]}),Ut("span",{className:"sf-address-meta",children:[Ae("span",{className:"sf-address-name",children:k}),Ae("span",{className:"sf-address-value",children:ut(p.address)})]})]},p.address)}):Ae("div",{className:"sf-empty",children:"No send history"})}),x&&!R&&!o.recipient&&Ae("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as Xe,jsxs as Un}from"react/jsx-runtime";function Zi({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:i,openTransaction:a}=e,s=t==="error",c=t==="success";return s?Un("div",{className:"sf-body sf-result sf-result--error",children:[Xe("span",{className:"sf-result-icon",children:Xe(ji,{size:56})}),Un("div",{className:"sf-result-copy",children:[Xe("h3",{className:"sf-result-title",children:"Transaction Failed"}),Xe("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&Xe(Yi,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]}):Un("div",{className:"sf-body sf-result",children:[Xe("span",{className:"sf-result-icon","data-pending":!c||void 0,children:c?Xe($i,{size:56}):Xe("span",{className:"sf-result-spinner"})}),Un("div",{className:"sf-result-copy",children:[Xe("h3",{className:"sf-result-title",children:c?"Transaction Complete":"Transaction in Progress"}),Xe("p",{className:"sf-result-desc",children:c?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&Xe(Yi,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]})}function Yi({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return Un("div",{className:"sf-result-hash-card",children:[Xe("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),Un("div",{className:"sf-result-hash-row",children:[Xe("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:ut(e)}),Xe("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?Xe(xn,{size:16}):"Copy"})]})]})}import{jsx as ke,jsxs as Je}from"react/jsx-runtime";var $o="\u2014";function Xi({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:i,walletAddress:a,networkName:s,nativeSymbol:c,nativeDecimals:l,gasEstimate:d,gasLoading:w,gasError:h,insufficientGas:m,error:y,resolvedEnv:b}=e,u=ln(t),x=n!==null?Mo(n,t.quantity.decimals):"",R=r?.trim()||`Account ${(i[0]?.index??0)+1}`,p=en(b,a,{size:56,bg:"1A1A2E"}),C=c||(u?t.symbol:""),k=Do(t.chainId),N=d?Ii(d,k):null,E=d?Wo(d,k):null,T=U=>U!==null&&C?`${qr(U,l)} ${C}`:$o,M=U=>U!==void 0?`${Ti(U)} Gwei`:$o,q=(()=>{if(!u||!d||E===null||n===null)return $o;let U=n+E;return`${qr(U,l)} ${C||t.symbol}`})(),L=U=>w?"\u2026":U,K=[{label:"Est. Tx Fee",value:L(T(E))},...N==="dynamic"?[{label:"Max Priority Fee",value:L(M(d?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:L(M(d?.maxFeePerGas))}]:N==="legacy"?[{label:"Gas Price",value:L(M(d?Oo(d):void 0))}]:[],{label:"Gas Limit",value:L(d?Ni(d.gasLimit):$o)}];return Je("div",{className:"sf-body sf-review",children:[Je("div",{className:"sf-review-amount",children:[ke("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:U=>{U.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Je("span",{className:"sf-review-amount-value",children:[x,ke("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),Je("div",{className:"sf-review-parties",children:[Je("div",{className:"sf-review-card sf-review-party",children:[ke("span",{className:"sf-review-party-label",children:"From"}),Je("div",{className:"sf-review-party-head",children:[ke("span",{className:"sf-review-party-avatar",children:p&&ke("img",{src:p,alt:"",width:28,height:28,draggable:!1,onError:U=>{U.currentTarget.style.display="none"}})}),ke("span",{className:"sf-review-party-name",children:R})]}),ke("span",{className:"sf-review-party-addr",children:a})]}),ke("span",{className:"sf-review-arrow","aria-hidden":!0,children:ke(Hi,{size:16})}),Je("div",{className:"sf-review-card sf-review-party",children:[ke("span",{className:"sf-review-party-label",children:"To"}),ke("span",{className:"sf-review-party-addr",children:o})]})]}),Je("section",{className:"sf-review-card",children:[ke("h3",{className:"sf-review-section-title",children:"Summary"}),Je("div",{className:"sf-review-row",children:[ke("span",{className:"sf-review-row-label",children:"Network"}),ke("span",{className:"sf-review-row-value",children:s})]}),K.map(U=>Je("div",{className:"sf-review-row",children:[ke("span",{className:"sf-review-row-label",children:U.label}),ke("span",{className:"sf-review-row-value",children:U.value})]},U.label))]}),Je("section",{className:"sf-review-card",children:[ke("h3",{className:"sf-review-section-title",children:"Total"}),Je("div",{className:"sf-review-row",children:[ke("span",{className:"sf-review-row-label",children:"Total Amount"}),Je("span",{className:"sf-review-row-value",children:[x," ",t.symbol]})]}),u&&Je("div",{className:"sf-review-row",children:[ke("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),ke("span",{className:"sf-review-row-value",children:L(q)})]})]}),m&&!h&&!y&&Je("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",C||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(h||y)&&ke("div",{className:"sf-message sf-message--error",role:"alert",children:h||y})]})}import*as jo from"react";import{jsx as cn,jsxs as Cn}from"react/jsx-runtime";function Ji({flow:e}){let[t,n]=jo.useState(""),o=t.trim().toLowerCase(),r=jo.useMemo(()=>o?e.tokens.filter(i=>i.symbol.toLowerCase().includes(o)||i.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return Cn("div",{className:"sf-body sf-token-select",children:[Cn("div",{className:"sf-search",children:[cn(Ui,{size:20}),cn("input",{className:"sf-search-input",value:t,onChange:i=>n(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),Cn("div",{className:"sf-token-list",children:[r.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=ro(e.resolvedEnv,i.chainId),c=e.getTokenPriceUsd?.(i);return Cn("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),"data-track":"token_item","data-track-id":i.symbol,children:[Cn("span",{className:"sf-token-left",children:[Cn("span",{className:"sf-token-icon-wrap",children:[cn("img",{className:"sf-token-icon",src:i.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:l=>{l.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),s&&cn("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:l=>{l.currentTarget.style.display="none"}})]}),cn("span",{className:"sf-token-name",children:i.symbol})]}),Cn("span",{className:"sf-token-right",children:[cn("span",{className:"sf-token-balance",children:sn(i.quantity.numeric,i.quantity.decimals)}),c!==void 0&&cn("span",{className:"sf-token-price",children:Uo(c)})]})]},a)}),r.length===0&&cn("div",{className:"sf-empty",children:"No tokens found"})]})]})}Y(`.sf-root{display:flex;flex-direction:column;flex:1;min-height:0;font-family:inherit}.sf-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px;flex-shrink:0;position:relative;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.sf-header .sf-header-btn:last-child{position:absolute;top:24px;right:24px}.sf-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;filter:none;transition:color .15s ease}.sf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));filter:none}.sf-header-title{position:absolute;left:50%;transform:translate(-50%);text-align:center;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);pointer-events:none}.sf-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}[data-theme=light] .sf-body{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-body::-webkit-scrollbar{width:4px;height:4px}.sf-body::-webkit-scrollbar-track,.sf-body::-webkit-scrollbar-corner{background:transparent}.sf-body::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}.sf-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .sf-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .sf-body::-webkit-scrollbar-thumb:hover{background:#0003}.sf-empty{padding:32px 0;text-align:center;font-family:inherit;font-size:14px;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-field-error{margin:8px 24px 0;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ds-system-red-default, #da0b2e)}.sf-message--error{margin:16px 0 0;padding:12px 16px;background:var(--ds-system-red-low, #ffeeee);color:var(--ds-system-red-high, #d20609);font-family:inherit;font-size:13px;line-height:1.5;border-radius:12px;width:100%;box-sizing:border-box}.sf-footer{display:flex;flex-shrink:0;padding:16px 24px 24px}.sf-footer:empty{display:none}.sf-footer-row{display:flex;gap:8px;width:100%}.sf-footer-row .sf-btn,.sf-footer-row .sf-btn--secondary{flex:1 1 0;min-width:0}.sf-footer>.sf-btn{width:100%}.sf-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:1;height:48px;padding:0 24px;border:none;border-radius:12px;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:background-color .15s ease,transform .1s ease}.sf-btn--primary{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff)}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){background:var(--ds-accent-primary-high, #00a0a2)}.sf-btn--primary:active:not(:disabled):not([data-disabled]){transform:scale(.97)}.sf-btn--primary[data-disabled],.sf-btn--primary:disabled{background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on, #ffffff);cursor:default;opacity:.5}.sf-btn--secondary{flex:0 0 120px;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-token-select{padding:0;display:flex;flex-direction:column}.sf-token-select .sf-search{margin:16px 24px}.sf-token-select .sf-token-list{width:100%;margin-top:0}.sf-search{display:flex;align-items:center;gap:8px;padding:12px 16px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-low, rgba(0, 0, 0, .4));box-sizing:border-box;transition:border-color .15s ease}.sf-search:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-search:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-search-input{flex:1;min-width:0;border:none;background:transparent;outline:none;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-search-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-token-list{display:flex;flex-direction:column;margin-top:8px}.sf-token-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-token-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-token-left{display:flex;align-items:center;gap:16px;min-width:0}.sf-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.sf-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain}.sf-token-chain-badge{position:absolute;right:-2px;bottom:-2px;width:16px;height:16px;border-radius:50%;object-fit:cover}.sf-token-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.sf-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.sf-token-balance{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);white-space:nowrap}.sf-token-price{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.sf-recipient{display:flex;flex-direction:column;flex:1;min-height:0}.sf-recipient-top{display:flex;flex-direction:column;flex-shrink:0;padding:16px 24px 0}.sf-address-field{display:flex;align-items:center;gap:8px;padding:12px;border-radius:12px;border:1.5px solid transparent;background:var(--ds-surface-medium, #f5f7fa);transition:border-color .15s ease;box-sizing:border-box}.sf-address-field:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.sf-address-field:focus-within{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-filled]{border-color:var(--ds-accent-primary-default, #00b4b7)}.sf-address-field[data-invalid]{border-color:var(--ds-system-red-default, #da0b2e)}.sf-address-input{flex:1;min-width:0;border:none;background:transparent;outline:none;resize:none;overflow:hidden;font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));word-break:break-word;overflow-wrap:anywhere}.sf-address-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-address-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;padding:0;border:none;background:transparent;border-radius:6px;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.sf-address-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-address-field[data-filled] .sf-address-action{border-radius:9999px}.sf-tabs{display:flex;gap:0;margin:16px 0 0}.sf-tab{position:relative;padding:8px 12px;border:none;background:transparent;cursor:pointer;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-tab[data-active]{color:var(--ds-accent-primary-high, #00a0a2)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-accent-primary-high, #00a0a2)}.sf-address-list{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;margin-top:8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .sf-address-list{scrollbar-color:rgba(0,0,0,.12) transparent}.sf-address-list::-webkit-scrollbar{width:4px}.sf-address-list::-webkit-scrollbar-track{background:transparent}.sf-address-list::-webkit-scrollbar-thumb{border-radius:4px;background:#ffffff26}[data-theme=light] .sf-address-list::-webkit-scrollbar-thumb{background:#0000001f}.sf-address-row{display:flex;align-items:center;gap:16px;width:100%;padding:12px 24px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;border-radius:0;box-sizing:border-box;transition:background-color .15s ease}.sf-address-row:hover{background:var(--ds-surface-medium, rgba(0, 0, 0, .04))}.sf-address-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex-shrink:0;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:600}.sf-address-avatar img{position:absolute;inset:0;z-index:1;width:100%;height:100%;object-fit:cover}.sf-address-avatar-fallback{position:relative;z-index:0}.sf-address-meta{display:flex;flex-direction:column;min-width:0}.sf-address-name{font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sf-address-value{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-drawer-content .sf-header{padding:16px}.wi-drawer-content .sf-header .sf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .sf-token-select{padding:0}.wi-drawer-content .sf-token-select .sf-search{margin:16px}.wi-drawer-content .sf-token-row{padding:12px 16px}.wi-drawer-content .sf-recipient-top{padding:16px 16px 0}.wi-drawer-content .sf-address-row{padding:12px 16px}.wi-drawer-content .sf-footer{padding:12px 16px 24px}.wi-drawer-content .sf-field-error,.wi-drawer-content .sf-message--error{margin:16px 0 0;width:auto}.sf-amount{display:flex;flex-direction:column}.sf-amount-center{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:64px 24px 48px;text-align:center}.sf-amount-usd{font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));min-height:21px}.sf-amount-input-wrap{display:flex;justify-content:center;max-width:100%}.sf-amount-input{width:auto;max-width:100%;border:none;background:transparent;outline:none;text-align:center;font-family:inherit;font-size:40px;font-weight:700;line-height:1.25;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);field-sizing:content}.sf-amount-input-wrap[data-empty] .sf-amount-input,.sf-amount-input::placeholder{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-input-wrap[data-over] .sf-amount-input{color:var(--ds-system-red-default, #da0b2e)}.sf-amount-balance{display:inline-flex;align-items:center;gap:4px;font-family:inherit;font-size:14px;font-weight:400;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.sf-amount-max{border:none;background:transparent;padding:0;cursor:pointer;font:inherit;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.sf-amount-max:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-drawer-content .sf-amount-center{padding:64px 16px 48px}.sf-review{display:flex;flex-direction:column;gap:16px;padding:24px}.sf-review-amount{display:flex;align-items:center;gap:12px;padding:0;background:transparent}.sf-review-amount-icon{width:40px;height:40px;border-radius:0;object-fit:contain;flex-shrink:0}.sf-review-amount-value{display:inline-flex;flex-direction:column;align-items:flex-start;gap:0;font-family:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);word-break:break-all}.sf-review-amount-symbol{font-size:12px;font-weight:400;line-height:1.5;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-parties{position:relative;display:flex;flex-direction:column;gap:0}.sf-review-arrow{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-4px auto;border-radius:50%;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-card{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa)}.sf-review-party-label{font-family:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-party-head{display:flex;align-items:center;gap:8px}.sf-review-party-avatar{display:inline-flex;width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--ds-surface-high, #edf1f2);flex-shrink:0}.sf-review-party-avatar img{width:100%;height:100%;object-fit:cover}.sf-review-party-name{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.sf-review-party-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));word-break:break-all}.sf-review-section-title{margin:0 0 4px;font-family:inherit;font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-review-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.sf-review-row-label{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-review-row-value{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));text-align:left;word-break:break-all}.wi-drawer-content .sf-review{padding:16px}.sf-result{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:48px 24px;text-align:center}.sf-result-icon{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px}.sf-result-spinner{width:56px;height:56px;border-radius:50%;border:4px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-top-color:var(--ds-accent-primary-default, #00b4b7);animation:sf-spin .8s linear infinite}@keyframes sf-spin{to{transform:rotate(360deg)}}.sf-result-copy{display:flex;flex-direction:column;gap:8px}.sf-result-title{margin:0;font-family:inherit;font-size:18px;font-weight:600;letter-spacing:-.01em;color:var(--ds-content-highest, #000000)}.sf-result-desc{margin:0;font-family:inherit;font-size:14px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:16px;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);text-align:left}.sf-result-hash-label{font-family:inherit;font-size:12px;font-weight:500;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.sf-result-hash-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.sf-result-hash-link{border:none;background:transparent;padding:0;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;color:var(--ds-accent-primary-high, #00a0a2)}.sf-result-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;padding:0 10px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));border-radius:8px;background:var(--ds-surface-default, #ffffff);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;color:var(--ds-content-high, rgba(0, 0, 0, .85))}
|
|
7
7
|
`);import{jsx as Oe,jsxs as Vo}from"react/jsx-runtime";var Td={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function qo({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...i}){let a=es.useCallback(x=>{o?.(x),n?.(x)},[n,o]),c=Mi({...i,onSuccess:o||n?a:void 0,onExit:t}),{step:l,status:d}=c,w=Wt(c.recipient.trim()),h=Jt(c.amount,c.token.quantity.decimals),m="value"in h&&h.value<=c.balanceRaw,y=d==="submitting"||d==="confirming",b=l!=="result",u=Td[l]??"";return Oe(ge,{feature:"send",children:Vo("div",{className:fe("sf-root",r),"data-step":l,children:[Vo("header",{className:"sf-header",children:[b?Oe("button",{type:"button",className:"sf-header-btn",onClick:c.back,"aria-label":"Back","data-track":"back",children:Oe(vn,{size:24})}):Oe("span",{className:"sf-header-btn","aria-hidden":!0}),Oe("span",{className:"sf-header-title",children:u}),Oe("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close","data-track":"close",children:Oe(Ot,{size:24})})]}),l==="token"&&Oe(Ji,{flow:c}),l==="recipient"&&Oe(Qi,{flow:c}),l==="amount"&&Oe(Di,{flow:c}),l==="review"&&Oe(Xi,{flow:c}),l==="result"&&Oe(Zi,{flow:c}),Vo("footer",{className:"sf-footer","data-step":l,children:[l==="recipient"&&Oe("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.submitRecipient,"data-disabled":!w||void 0,"aria-disabled":!w,"data-track":"recipient_next",children:"Next"}),l==="amount"&&Oe("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.submitAmount,"data-disabled":!m||void 0,"aria-disabled":!m,"data-track":"amount_next",children:"Next"}),l==="review"&&Vo("div",{className:"sf-footer-row",children:[Oe("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:c.back,disabled:y,"data-track":"review_cancel",children:"Cancel"}),Oe("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.confirmSend,disabled:y||!c.canSend||c.insufficientGas,"data-track":"review_send",children:y?"Sending...":"Send"})]}),l==="result"&&d==="success"&&Oe("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(c.txHash||void 0),"data-track":"result_ok",children:"All done"}),l==="result"&&d==="error"&&Oe("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.retry,"data-track":"result_retry",children:"Try Again"})]})]})})}import*as ts from"@radix-ui/react-popover";import{Drawer as Nd}from"vaul";import{jsx as Ko,jsxs as Id}from"react/jsx-runtime";function ns({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:i}=an(),a=n!=null,s=e??!0,c=a?n:Id("button",{type:"button",className:fe("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[Ko(di,{size:o?14:16}),Ko("span",{className:"wi-trigger-address",children:ut(i)})]});return o?Ko(Nd.Trigger,{asChild:s,children:c}):Ko(ts.Trigger,{asChild:s,children:c})}import*as z from"react";import*as fr from"@radix-ui/react-popover";import{Drawer as pr}from"vaul";import po from"bignumber.js";import{useQueries as Ed}from"@tanstack/react-query";import{useMemo as Ld}from"react";var Xr="user-balance";async function Ad(e,t,n,o){let r=new URLSearchParams({networkId:`eip155:${t}`,account:n}),i=await fetch(`${e}/v1/public/token/balance?${r}`,{cache:"no-store",signal:o});if(!i.ok)throw new Error(`Failed to fetch token balance: ${i.status}`);let a=await i.json();if(a.code!==200)throw new Error(`Token balance API error: ${a.code}`);return a.data}function dn(e,t,n=!0){let o=Ne[e],r=[o.cross,o.bsc],i=Ed({queries:r.map(l=>({queryKey:[Xr,e,t,l],queryFn:async({signal:d})=>Ad(await le("walletServer",e),l,t,d),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),a=i.some(l=>l.isLoading),s=i.some(l=>l.isError);return{tokens:Ld(()=>{let l=[];for(let d of i)d.data&&l.push(...d.data);return l},[i]),isLoading:a,isError:s}}import{useQuery as Pd,useQueries as _d}from"@tanstack/react-query";import{useMemo as Fd}from"react";var Bd="forge-holdings",Md="forge-token-image";async function Dd(e,t,n){let o=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch forge holdings: ${o.status}`);let r=await o.json();if(!r.success)throw new Error("Forge holdings API error");return r.data.items}async function Od(e,t,n){let o=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:n});if(!o.ok)return{address:t,image_url:""};let r=await o.json();return r.success?{address:t,image_url:r.data.token.image_url}:{address:t,image_url:""}}function os(e,t,n=!0){let{data:o,...r}=Pd({queryKey:[Bd,e,t],queryFn:async({signal:i})=>Dd(await le("bondingCurve",e),t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:o??[],...r}}function rs(e,t,n=!0){let o=_d({queries:t.map(i=>({queryKey:[Md,e,i],queryFn:async({signal:a})=>Od(await le("bondingCurve",e),i,a),enabled:n,staleTime:1/0}))});return{imageMap:Fd(()=>{let i=new Map;for(let a of o)a.data&&i.set(a.data.address,a.data.image_url);return i},[o])}}import{useQuery as Wd}from"@tanstack/react-query";import{useMemo as Ud}from"react";var Jr="token-stats";function At(e,t){return`${e}:${t.toLowerCase()}`}function pn(e,t=!0){let{data:n,...o}=Wd({queryKey:[Jr,e],queryFn:async({signal:i})=>{let a=await le("walletServer",e),s=await fetch(`${a}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token stats API error: ${c.code}`);return c},enabled:t,staleTime:3e4});return{statsMap:Ud(()=>{let i=new Map;if(!n?.data)return i;for(let a of n.data){let s=At(a.chain_id,a.address);i.set(s,a)}return i},[n]),...o}}import{useQuery as zd}from"@tanstack/react-query";var Gd="crossd-apr",Hd="https://crossd-dashboard-api.crossdefi.io/api/v1/overview";function as(){let{data:e,...t}=zd({queryKey:[Gd],queryFn:async({signal:n})=>{let o=await fetch(Hd,{cache:"no-store",signal:n});if(!o.ok)throw new Error(`Failed to fetch CROSSD overview: ${o.status}`);let r=await o.json();if(r.code!==200)throw new Error(`CROSSD overview API error: ${r.code}`);let i=parseFloat(r.data.est_last_epoch_apy);if(!Number.isFinite(i))throw new Error("CROSSD overview returned a non-numeric APR");return i*100},staleTime:6e4});return{aprPercent:e??null,...t}}import{useQuery as $d}from"@tanstack/react-query";import{useMemo as jd}from"react";var Vd="token-info";function ea(e,t){return`${t.toLowerCase()}_${e}`}function is(e,t=!0){let{data:n,...o}=$d({queryKey:[Vd,e],queryFn:async({signal:i})=>{let a=await le("walletServer",e),s=await fetch(`${a}/v1/public/token/info`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token info: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token info API error: ${c.code}`);return c},enabled:t,staleTime:1/0});return{categoryMap:jd(()=>{let i=new Map;if(!n?.data)return i;for(let a of n.data){let s=ea(a.chain_id,a.address);i.set(s,a.category)}return i},[n]),...o}}import{useMemo as qd}from"react";import ta from"bignumber.js";function ss(e,t,n){let{tokens:o,isLoading:r}=dn(e,t,n),{statsMap:i}=pn(e,n);return qd(()=>{let a=new ta(0);for(let d of o){let w=i.get(At(d.chainId,d.address));if(!w)continue;let m=new ta(d.quantity.numeric).shiftedBy(-d.quantity.decimals).multipliedBy(new ta(w.price));m.isNaN()||(a=a.plus(m))}let s=a.toFixed(),{displayValue:c,isLowerBound:l}=yi(s);return{totalUsd:s,displayValue:c,isLowerBound:l,isLoading:r}},[o,i,r])}import{QRCodeSVG as du}from"qrcode.react";function et(e,t,n,o){if(!o||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let r;try{r=o(t,n)}catch(l){console.error("[dapp-ui] onOutlink threw:",l);return}let i=l=>{typeof window>"u"||window.open(l,"_blank","noopener,noreferrer")};if((l=>!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function")(r)){let l=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,d=w=>{if(w===null){l?.close();return}let h=w??t;if(l)try{l.location.href=h}catch{l.close(),i(h)}else i(h)};r.then(d,w=>{console.error("[dapp-ui] onOutlink rejected:",w),l?.close()});return}let s=r;if(s===null)return;i(s??t)}import*as In from"react";import{Drawer as wf}from"vaul";import{createContext as Yd,useContext as Zd,useMemo as Xd}from"react";import vt from"bignumber.js";var Kd=/^(\d{4}-\d{2}-\d{2})/;function ls(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:i}of e.map(a=>({key:Kd.exec(a.reference_date)?.[1],cumulative:a.cumulative_earned})).filter(a=>!!a.key&&a.cumulative!=null).sort((a,s)=>a.key<s.key?-1:a.key>s.key?1:0))t.set(r,i),n=r;if(n===void 0)return;let o=new Date().toISOString().slice(0,10);return t.get(o)??t.get(n)}function Qo(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function cs(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}var Qd="0xe00e8bf3";function ds(e,t){let n=typeof e=="bigint"?e:BigInt(e);if(n<0n)throw new Error("poolId must be non-negative");if(t<0n)throw new Error("amount must be non-negative");let o=n.toString(16).padStart(64,"0"),r=t.toString(16).padStart(64,"0");return`${Qd}${o}${r}`}function na(e){return!e||e<=0n?"0":new vt(e.toString()).shiftedBy(-9).toFormat(2,vt.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function ps(e){return!e||e<=0n?"0":new vt(e.toString()).toFormat(0,vt.ROUND_DOWN)}function fs(e){if(!e||e<=0n)return"0";let t=new vt(e.toString()).shiftedBy(-18),n=t.isLessThan(1e-4)?7:4;return t.toFormat(n,vt.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Pt(e,t){let n=new vt(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,vt.ROUND_DOWN):n.toFormat(4,vt.ROUND_DOWN)}function oa(e){return Pt(e,0)}var ao={rate:1,symbol:"$"};function io(e,t=ao){let n=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(n).toFormat(2,vt.ROUND_DOWN)}`}function fn(e,t,n,o=ao){let r=new vt(n||"0");if(!r.isFinite()||r.isLessThanOrEqualTo(0))return null;let i=new vt(e||"0").shiftedBy(-t).times(r);return i.isFinite()?io(i,o):null}var so=Yd(null);function Ue(){let e=Zd(so);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function zt(){let{conversionRatio:e,currencySymbol:t}=Ue();return Xd(()=>({rate:typeof e=="number"&&e>0?e:ao.rate,symbol:t||ao.symbol}),[e,t])}import{Drawer as Jd}from"vaul";import{jsx as us}from"react/jsx-runtime";function ms({asChild:e,children:t}){let{walletAddress:n}=Ue(),o=t!=null,r=e??!0,i=o?t:us("button",{type:"button",children:ut(n)});return us(Jd.Trigger,{asChild:r,children:i})}import{Drawer as ar}from"vaul";import*as Re from"react";import{useQueryClient as gf}from"@tanstack/react-query";import{createContext as ep,useContext as tp}from"react";var ra=ep(null);function gs(){return tp(ra)}import{jsx as mt,jsxs as Yo}from"react/jsx-runtime";function hs({size:e=22,className:t}){return mt("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mt("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function bs({size:e=22,className:t}){return Yo("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[mt("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),mt("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 ws({size:e=16,className:t}){return Yo("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[mt("path",{d:"M5.333 5.333V4a1.333 1.333 0 011.334-1.333h5.333A1.333 1.333 0 0113.333 4v5.333a1.333 1.333 0 01-1.333 1.334h-1.333",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"}),mt("path",{d:"M4 5.333h5.333c.737 0 1.334.597 1.334 1.334V12c0 .736-.597 1.333-1.334 1.333H4A1.333 1.333 0 012.667 12V6.667C2.667 5.93 3.263 5.333 4 5.333z",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function xs({size:e=16,className:t}){return mt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:mt("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function vs({size:e=48,className:t}){return Yo("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[mt("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),mt("path",{d:"M14 24.5l6.6 6.6L34.5 17.5",stroke:"var(--wp-claim-success-mark, #ffffff)",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"})]})}function _t({size:e=12,className:t}){return Yo("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[mt("path",{d:"M5 2H2.5A1.5 1.5 0 0 0 1 3.5V9.5A1.5 1.5 0 0 0 2.5 11H8.5A1.5 1.5 0 0 0 10 9.5V7",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),mt("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),mt("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as Fs from"react";import{useQuery as np}from"@tanstack/react-query";import{useMemo as ys}from"react";var op="wp:reward-pools";function zn(e,t=!0){let{data:n,...o}=np({queryKey:[op,e],queryFn:async({signal:a})=>{let s=await le("gameReward",e),c=await fetch(`${s}/v1/pools`,{cache:"no-store",signal:a});if(!c.ok)throw new Error(`Failed to fetch pools: ${c.status}`);let l=await c.json();if(l.code!==200)throw new Error(`Pools API error: ${l.code}`);return l},enabled:t,staleTime:0}),r=ys(()=>n?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[n]),i=ys(()=>n?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[n]);return{crossPools:r,gamePools:i,allPools:n?.data.pools??[],...o}}import{useQuery as rp}from"@tanstack/react-query";import{useMemo as ap}from"react";var ip="wp:user-deposits";function Zo(e,t,n=!0){let o=n&&!!t,{data:r,...i}=rp({queryKey:[ip,e,t],queryFn:async({signal:s})=>{let c=await le("gameReward",e),l=await fetch(`${c}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Deposits fetch failed: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Deposits API error: ${d.code}`);return d},enabled:o,staleTime:0});return{depositMap:ap(()=>{let s=new Map;if(!r?.data.user_deposits)return s;for(let c of r.data.user_deposits)s.set(c.pool_address.toLowerCase(),c);return s},[r]),deposits:r?.data.user_deposits??[],...i}}import{useQuery as sp}from"@tanstack/react-query";import{useMemo as lp}from"react";var ks={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Ss={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var Rs={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var aa={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},Cs={dev:`${aa.dev}/portfolio`,stage:`${aa.stage}/portfolio`,production:`${aa.production}/portfolio`};var Ts={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Gt={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",production:"https://contents.crosstoken.io/frontend/common/app-launcher/icons"};var cp="wp:token-info";function Xo(e,t=!0){let n=Ne[e].cross,{data:o,...r}=sp({queryKey:[cp,e],queryFn:async({signal:c})=>{let l=await le("walletServer",e),d=await fetch(`${l}/v1/public/token/info`,{cache:"no-store",signal:c});if(!d.ok)throw new Error(`Failed to fetch token info: ${d.status}`);let w=await d.json();if(w.code!==200)throw new Error(`Token info API error: ${w.code}`);return w},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=lp(()=>{let c=new Map,l=new Map;if(!o?.data)return{byChainAddr:c,byChainSym:l};for(let d of o.data){let w=d.address.toLowerCase();c.set(`${d.chain_id}:${w}`,d),c.set(w,d);let h=d.symbol.replace(/^t/,"").toUpperCase(),m=`${d.chain_id}:${h}`;l.has(m)||l.set(m,d),l.has(h)||l.set(h,d)}return{byChainAddr:c,byChainSym:l}},[o]);return{getTokenImage:(c,l)=>{let d=c.toLowerCase(),w=i.get(`${n}:${d}`);if(w?.image)return w.image;let h=i.get(d);if(h?.image)return h.image;if(l){let m=l.replace(/^t/,"").toUpperCase(),y=a.get(`${n}:${m}`);if(y?.image)return y.image;let b=a.get(m);if(b?.image)return b.image}return""},...r}}import{useQuery as bp}from"@tanstack/react-query";import{useMemo as Jo}from"react";var dp="0x70a08231",pp="0x18160ddd",fp="0x313ce567",up=8e3;async function mp(e,t,n,o){let r=new AbortController,i=setTimeout(()=>r.abort(),up);o&&o.addEventListener("abort",()=>r.abort(),{once:!0});let a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:r.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let s=await a.json();if(s.error)throw new Error(`RPC ${t}: ${s.error.message}`);if(s.result===void 0)throw new Error(`RPC ${t}: empty result`);return s.result}function gp(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function lo(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function Tn(e,t,n,o){try{return await mp(e,"eth_call",[{to:t,data:n},"latest"],o)}catch{return}}async function hp(e,t,n,o){let[r,i,a]=await Promise.all([Tn(e,n,dp+gp(t),o),Tn(e,n,pp,o),Tn(e,n,fp,o)]),s=lo(r);if(s===void 0)return null;let c=lo(a);return{balance:s,totalSupply:lo(i),decimals:c!==void 0?Number(c):void 0}}async function ia(e,t){let n=Ne[e].cross,o=await le("walletServer",e),r=await fetch(`${o}/v1/public/chain/info/${n}`,{cache:"no-store",signal:t});if(!r.ok)return;let i=await r.json();return("data"in i&&i.data!==void 0?Array.isArray(i.data)?i.data[0]:i.data:i)?.rpc||void 0}async function Ns(e,t,n,o){if(!t||n.length===0)return{};let r;try{r=await ia(e,o)}catch{r=void 0}if(!r)return{};let i=await Promise.all(n.map(async s=>[s.toLowerCase(),await hp(r,t,s,o)])),a={};for(let[s,c]of i)c&&(a[s]=c);return a}var wp="wp:withdraw-token-meta",xp="0xc89039c5",vp="0x95d89b41",yp="0x313ce567";function kp(e){if(!(!e||e==="0x"))try{let t=e.replace(/^0x/,""),n=Number(BigInt("0x"+t.slice(64,128)));if(!Number.isFinite(n)||n<=0||n>64)return;let o=t.slice(128,128+n*2),r="";for(let i=0;i<o.length;i+=2)r+=String.fromCharCode(parseInt(o.slice(i,i+2),16));return r||void 0}catch{return}}function Sp(e){if(!e||e==="0x")return;let n="0x"+e.replace(/^0x/,"").padStart(64,"0").slice(24,64);return/^0x[a-f0-9]{40}$/.test(n)&&n!=="0x0000000000000000000000000000000000000000"?n:void 0}async function Rp(e,t,n){if(t.length===0)return{};let o;try{o=await ia(e,n)}catch{o=void 0}if(!o)return{};let r=await Promise.all(t.map(async a=>{let s=Sp(await Tn(o,a,xp,n));if(!s)return[a.toLowerCase(),null];let[c,l]=await Promise.all([Tn(o,s,vp,n),Tn(o,s,yp,n)]),d=kp(c),w=lo(l);return d?[a.toLowerCase(),{tokenAddress:s,symbol:d,decimals:w!==void 0?Number(w):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of r)s&&(i[a]=s);return i}function er(e,t,n=!0){let r=n&&!!t,{allPools:i,isLoading:a}=zn(e,r),{deposits:s,isLoading:c}=Zo(e,t,r),l=Jo(()=>{let u=new Map;for(let x of i)u.set(x.pool_address.toLowerCase(),x);return u},[i]),d=Jo(()=>s.filter(u=>{try{return BigInt(u.deposited_amount||"0")>0n}catch{return!1}}),[s]),w=Jo(()=>d.map(u=>u.pool_address.toLowerCase()).filter(u=>!l.has(u)).sort(),[d,l]),{data:h,isLoading:m}=bp({queryKey:[wp,e,w],queryFn:({signal:u})=>Rp(e,w,u),enabled:r&&w.length>0,staleTime:1440*60*1e3});return{positions:Jo(()=>{let u=[];for(let x of d){let R=x.pool_address.toLowerCase(),p=l.get(R);if(p){u.push({poolId:x.pool_id,poolAddress:x.pool_address,poolType:p.pool_type,tokenSymbol:p.deposit_token.symbol,tokenAddress:p.deposit_token.address,decimals:p.deposit_token.decimals,price:p.deposit_token.price,depositedRaw:x.deposited_amount});continue}let C=h?.[R];C&&u.push({poolId:x.pool_id,poolAddress:x.pool_address,poolType:"Unknown",tokenSymbol:C.symbol,tokenAddress:C.tokenAddress,decimals:C.decimals,depositedRaw:x.deposited_amount})}return u},[d,l,h]),isLoading:a||c||m}}import*as la from"react";import{jsx as sa,jsxs as Is}from"react/jsx-runtime";function Ht({sectionKey:e,title:t,icon:n,iconFit:o="cover",isEmpty:r,loading:i=!1,children:a}){let s=gs();return la.useEffect(()=>{s?.report(e,{loading:i,empty:r})},[s,e,i,r]),la.useEffect(()=>()=>s?.unregister(e),[s,e]),r?null:Is("div",{className:"wp-svc-card",children:[Is("div",{className:"wp-svc-card-head",children:[sa("img",{className:"wp-svc-card-icon",src:n,alt:"",style:{objectFit:o}}),sa("span",{className:"wp-svc-card-title",children:t})]}),sa("div",{className:"wp-svc-items",children:a})]})}import*as he from"react";import{Fragment as Ls,jsx as V,jsxs as we}from"react/jsx-runtime";var Cp=/^\d*\.?\d{0,2}$/,Tp=[100n,1000n,2000n],Np=400;function Ip(e,t){if(t==="loading")return"Estimating...";if(!e||t==="error"||t==="unavailable")return"Wallet estimate";let n=e.maxFeePerGas??e.gasPrice;return!n||n<=0n||e.gasLimit<=0n?"Wallet estimate":`${fs(e.gasLimit*n)} CROSS`}function ca(e,t,n){return n==="loading"?"Estimating...":n==="error"||n==="unavailable"?"-":`${e} ${t}`.trim()}function Es({position:e,size:t}){return e.icon?V("img",{src:e.icon,alt:"",width:t,height:t}):V("span",{children:e.tokenSymbol.slice(0,1)})}function tr({open:e,status:t,positions:n,initialPoolAddress:o,walletAddress:r,txHash:i,error:a,copied:s=!1,estimateWithdraw:c,onClose:l,onConfirm:d,onCopyHash:w,trackFunnel:h}){let[m,y]=he.useState(void 0),[b,u]=he.useState(""),[x,R]=he.useState(null),[p,C]=he.useState("idle"),k=he.useRef(0),N=he.useRef(void 0),E=he.useRef(null);he.useEffect(()=>()=>clearTimeout(N.current),[]);let T=he.useMemo(()=>{let O=(m??o)?.toLowerCase();return n.find(ee=>ee.poolAddress.toLowerCase()===O)??n[0]??null},[n,m,o]),M=he.useMemo(()=>{try{return BigInt(T?.depositedRaw??"0")}catch{return 0n}},[T?.depositedRaw]),q=T?.decimals??18,L=he.useMemo(()=>{let O=Jt(b,q);return"value"in O?O.value:null},[b,q]),K=L!==null&&L>M;he.useEffect(()=>{!e||!T||h?.("position_selected")},[e,T,h]),he.useEffect(()=>{!e||L===null||L<=0n||K||h?.("amount_entered")},[e,L,K,h]);let U=t==="confirm"&&!!T&&L!==null&&L>0n&&!K,ce=he.useCallback(()=>{u(""),R(null),C(c?"idle":"unavailable"),k.current+=1,E.current=null},[]);he.useEffect(()=>{e&&(y(o),ce())},[e]);let J=he.useCallback(O=>{t==="confirm"&&(y(O.poolAddress),ce())},[t,ce]);he.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(N.current);return}if(!c||!T){clearTimeout(N.current),C("unavailable");return}if(L===null||L<=0n||K){clearTimeout(N.current),k.current+=1,E.current=null,R(null),C("idle");return}let O=`${T.poolAddress.toLowerCase()}:${L.toString()}`;if(E.current===O)return;E.current=O,clearTimeout(N.current);let ee=k.current+1;k.current=ee,C("loading"),N.current=setTimeout(()=>{c(T,L).then(Fe=>{k.current===ee&&(R(Fe??null),C(Fe?"ready":"unavailable"))}).catch(()=>{k.current===ee&&(R(null),C("error"))})},Np)},[e,t,L,K,c,T]);let $=he.useCallback(O=>{let ee=O.target.value.replace(/,/g,"");(ee===""||Cp.test(ee))&&u(ee)},[]),ne=he.useCallback(O=>{u(no(O.toString(),q))},[q]),G=he.useCallback(O=>{let ee=10n**BigInt(q),Q=(L??0n)+O*ee;ne(Q>M?M:Q)},[L,q,M,ne]),D=he.useCallback(()=>{ne(M)},[M,ne]);if(!e||!T)return null;let ae=t==="submitting",me=na(x?.maxPriorityFeePerGas),j=na(x?.maxFeePerGas??x?.gasPrice),_e=ps(x?.gasLimit),xe=Pt(T.depositedRaw,q);return V("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:O=>{O.target===O.currentTarget&&!ae&&l()},children:we("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","data-status":t,"data-vaul-no-drag":!0,children:[V("div",{className:"wp-claim-grabber","aria-hidden":!0,children:V("span",{})}),we("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?we(Ls,{children:[V("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:V(vs,{})}),we("div",{className:"wp-claim-copy",children:[V("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),V("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),V("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:we("div",{className:"wp-claim-list-item",children:[V("span",{children:"Tx Hash"}),we("button",{type:"button",className:"wp-claim-hash",onClick:w,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[V("strong",{children:cs(i)}),s?V(xs,{}):V(ws,{})]})]})})]}):we(Ls,{children:[we("div",{className:"wp-claim-heading",children:[V("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:t==="error"?"Withdraw Failed":"Withdraw"}),t==="error"&&V("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),n.length>1&&V("div",{className:"wp-withdraw-token-list",role:"listbox","aria-label":"Withdrawable tokens",children:n.map(O=>{let ee=O.poolAddress.toLowerCase()===T.poolAddress.toLowerCase();return we("button",{type:"button",role:"option","aria-selected":ee,className:"wp-withdraw-token","data-selected":ee||void 0,"data-track":"withdraw_position_select","data-track-id":O.tokenSymbol,disabled:ae,onClick:()=>J(O),children:[V("span",{className:"wp-withdraw-token-icon","aria-hidden":!0,children:V(Es,{position:O,size:28})}),V("span",{className:"wp-withdraw-token-symbol",children:O.tokenSymbol}),V("span",{className:"wp-withdraw-token-amount",children:Pt(O.depositedRaw,O.decimals)})]},O.poolAddress)})}),we("div",{className:"wp-claim-reward-card","aria-label":"Deposited balance",children:[V("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:V(Es,{position:T,size:28})}),V("strong",{className:"wp-claim-reward-symbol",children:T.tokenSymbol}),V("strong",{className:"wp-claim-reward-amount",children:xe})]}),we("div",{className:"wp-withdraw-amount-card",children:[we("div",{className:"wp-withdraw-amount-row",children:[V("input",{className:"wp-withdraw-input",type:"text",inputMode:"decimal",autoComplete:"off",placeholder:"0",value:b,disabled:ae,onChange:$,"aria-label":`Withdraw amount (${T.tokenSymbol})`,"aria-invalid":K||void 0}),V("span",{className:"wp-withdraw-input-symbol",children:T.tokenSymbol})]}),K&&V("p",{className:"wp-claim-error-message",children:"Amount exceeds deposited balance."}),we("div",{className:"wp-withdraw-quick-row",role:"group","aria-label":"Quick amounts",children:[Tp.map(O=>we("button",{type:"button",className:"wp-withdraw-quick","data-track":"withdraw_quick_add",disabled:ae,onClick:()=>G(O),children:["+",O.toString()]},O.toString())),V("button",{type:"button",className:"wp-withdraw-quick","data-track":"withdraw_max",disabled:ae,onClick:D,children:"MAX"})]})]}),we("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[we("div",{className:"wp-claim-account-row",children:[we("div",{className:"wp-claim-account",children:[V("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),we("strong",{children:[T.tokenSymbol," Pool"]})]}),V("span",{children:Qo(r)})]}),V("span",{className:"wp-claim-divider","aria-hidden":!0}),we("div",{className:"wp-claim-detail-list",children:[we("div",{className:"wp-claim-detail-row",children:[V("span",{children:"Est. Tx Fee"}),V("strong",{children:Ip(x,p)})]}),we("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[V("span",{children:"Priority Fee Per Gas"}),V("strong",{children:ca(me,"Gwei",p)})]}),we("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[V("span",{children:"Max Fee Per Gas"}),V("strong",{children:ca(j,"Gwei",p)})]}),we("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[V("span",{children:"Gas Limit"}),V("strong",{children:ca(_e,"",p)})]})]})]})]}),we("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&V("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:l,children:t==="error"?"Close":"Cancel"}),we("button",{type:"button",className:"wp-claim-primary","data-track":"withdraw_confirm",onClick:()=>{if(t==="success"){l();return}T&&L!==null&&L>0n&&!K&&d(T,L,x)},disabled:ae||(t==="confirm"||t==="error")&&(L===null||L<=0n||K),children:[t==="success"&&"Done",t==="submitting"&&V("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),V("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:V("span",{})})]})})}import*as Se from"react";import{useQueryClient as Ap}from"@tanstack/react-query";import{useQuery as Ep}from"@tanstack/react-query";var Lp="wp:reward-factory-info";function As(e,t=!0){let{data:n,...o}=Ep({queryKey:[Lp,e],queryFn:async({signal:r})=>{let i=await le("gameReward",e),a=await fetch(`${i}/v1/factory/info`,{cache:"no-store",signal:r});if(!a.ok)throw new Error(`Factory info fetch failed: ${a.status}`);let s=await a.json();if(s.code!==200)throw new Error(`Factory info API error: ${s.code}`);return s},enabled:t,staleTime:0});return{factoryInfo:n?.data??null,routerAddress:n?.data.router_address??"",...o}}var Pp="wp:";function Ps(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function nr(e){let{env:t,walletAddress:n,sendTransaction:o,estimateGas:r}=Ue(),i=!!n,a=!!o,s=Ap(),{routerAddress:c}=As(t,i&&a),l=Ps(c),[d,w]=Se.useState(!1),[h,m]=Se.useState(void 0),[y,b]=Se.useState("confirm"),[u,x]=Se.useState(),[R,p]=Se.useState(""),[C,k]=Se.useState(!1),N=Se.useRef(void 0);Se.useEffect(()=>()=>clearTimeout(N.current),[]);let E=Se.useRef(new Set),T=Se.useCallback(($,ne)=>{E.current.has($)||(E.current.add($),Te("withdraw",$,{...ne,tags:{section:e,...ne?.tags}}))},[e]),M=Se.useCallback(($,ne)=>l?{to:l,value:0n,data:ds($,ne),chainId:Ne[t].cross}:null,[t,l]),q=Se.useCallback(()=>{s.invalidateQueries({predicate:$=>typeof $.queryKey[0]=="string"&&$.queryKey[0].startsWith(Pp)})},[s]),L=Se.useCallback($=>{m($),w(!0),b("confirm"),x(void 0),p(""),k(!1),E.current=new Set,T("opened")},[T]),K=Se.useCallback(()=>{y!=="submitting"&&(w(!1),m(void 0),b("confirm"),x(void 0),p(""),k(!1),y==="success"&&q())},[y,q]),U=Se.useCallback(async($,ne)=>{if(!r)return null;let G=M($.poolId,ne),D=Ps(n);return!G||!D?null:r({...G,from:D})},[M,r,n]),ce=Se.useCallback(async()=>{if(!(!u||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(u),k(!0),clearTimeout(N.current),N.current=setTimeout(()=>k(!1),1400)}catch{k(!1)}},[u]),J=Se.useCallback(async($,ne,G)=>{if(!o){b("error"),p("Withdraw is not available for this wallet.");return}if(!l){b("error"),p("Withdraw contract address is not available.");return}try{b("submitting"),p("");let D=M($.poolId,ne);if(!D){b("error"),p("Withdraw contract address is not available.");return}T("submitted");let ae=await o({...D,gas:G?.gasLimit&&G.gasLimit>0n?G.gasLimit:void 0,maxFeePerGas:G?.maxFeePerGas&&G.maxFeePerGas>0n?G.maxFeePerGas:void 0,maxPriorityFeePerGas:G?.maxPriorityFeePerGas&&G.maxPriorityFeePerGas>0n?G.maxPriorityFeePerGas:void 0});x(ae),b("success"),T("confirmed"),q()}catch(D){b("error"),p(D instanceof Error?D.message:"Failed to request withdraw."),T("confirmed",{status:"failure",reason:Nt(D)})}},[M,q,l,o,T]);return{canWithdrawInline:a,isOpen:d,initialPoolAddress:h,status:y,txHash:u,error:R,copied:C,hasEstimator:!!r,openWithdraw:L,closeWithdraw:K,estimateWithdraw:U,confirmWithdraw:J,copyHash:ce,trackFunnelOnce:T}}import da from"bignumber.js";import{Fragment as Fp,jsx as Pe,jsxs as je}from"react/jsx-runtime";var _p="CROSS Rewards";function _s(e){return new da(e||"0").isGreaterThan(0)}function Bs(){let{env:e,walletAddress:t,onOutlink:n}=Ue(),o=zt(),r=!!t,{allPools:i,isLoading:a}=zn(e,r),{depositMap:s,isLoading:c}=Zo(e,t,r),{getTokenImage:l}=Xo(e,r),d=nr("rewards"),{positions:w}=er(e,t,r&&d.canWithdrawInline),h=Fs.useMemo(()=>w.filter(u=>u.poolType==="CrossPool").map(u=>({...u,icon:l(u.tokenAddress,u.tokenSymbol)})),[w,l]),m=(u,x)=>`${ks[e]}/rewards/${u.pool_address}?action=${x}`,y=`${Gt[e]}/reward.png`,b=i.filter(u=>{let x=s.get(u.pool_address.toLowerCase()),R=x?.deposited_amount??"0",p=x?.claimable_reward??"0";return!(new da(R).isZero()&&new da(p).isZero())});return je(Fp,{children:[Pe(Ht,{sectionKey:"rewards",title:_p,icon:y,isEmpty:b.length===0,loading:a||c,children:b.map(u=>{let x=s.get(u.pool_address.toLowerCase()),R=x?.deposited_amount??"0",p=x?.claimable_reward??"0",C=m(u,"withdraw"),k=m(u,"claim"),N=l(u.deposit_token.address,u.deposit_token.symbol),E=u.reward_tokens[0],T=E?l(E.address,E.symbol):"",M=u.reward_tokens.map(G=>G.symbol),q=M.length>0?`${u.deposit_token.symbol}-${M.join("/")}`:u.deposit_token.symbol,L=E?Pt(p,E.decimals):"0",K=E?.symbol??"Reward",U=fn(R,u.deposit_token.decimals,u.deposit_token.price,o),ce=E?fn(p,E.decimals,E.price,o):null,J=!!x&&_s(p),$=!!x&&_s(R),ne=d.canWithdrawInline&&h.some(G=>G.poolAddress.toLowerCase()===u.pool_address.toLowerCase());return je("article",{className:"wp-item","data-side":"reward",children:[je("div",{className:"wp-item-body",children:[je("div",{className:"wp-item-line",children:[Pe("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),je("div",{className:"wp-svc-token",children:[je("span",{className:"wp-token-stack","aria-hidden":!0,children:[N&&Pe("img",{className:"wp-svc-token-icon",src:N,alt:""}),T&&Pe("img",{className:"wp-svc-token-icon",src:T,alt:""})]}),Pe("span",{children:q})]})]}),je("div",{className:"wp-item-line",children:[Pe("span",{className:"wp-item-label",children:"Deposited"}),je("div",{className:"wp-svc-token wp-svc-token--amount",children:[N&&Pe("img",{className:"wp-svc-token-icon",src:N,alt:""}),je("div",{className:"wp-svc-amount",children:[Pe("span",{className:"wp-svc-amount-main",children:Pt(R,u.deposit_token.decimals)}),U&&Pe("span",{className:"wp-item-usd",children:U})]})]})]}),je("div",{className:"wp-item-line",children:[je("span",{className:"wp-item-label",children:["Claimable (",K,")"]}),je("div",{className:"wp-svc-token wp-svc-token--amount",children:[T&&Pe("img",{className:"wp-svc-token-icon",src:T,alt:""}),je("div",{className:"wp-svc-amount",children:[Pe("span",{className:"wp-svc-amount-main",children:L}),ce&&Pe("span",{className:"wp-item-usd",children:ce})]})]})]})]}),je("div",{className:"wp-item-tags",children:[ne?Pe("button",{type:"button",className:"wp-tag wp-tag--muted","data-disabled":!$||void 0,"aria-disabled":!$||void 0,"data-track":"rewards_withdraw_open",onClick:()=>{$&&d.openWithdraw(u.pool_address)},children:Pe("span",{className:"wp-tag-label",children:"Withdraw"})}):je("a",{className:"wp-tag wp-tag--muted",href:C,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:G=>et(G,C,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:u,userDeposit:x}},n),children:[Pe("span",{className:"wp-tag-label",children:"Withdraw"}),Pe(_t,{size:12,className:"wp-tag-icon"})]}),je("a",{className:"wp-tag wp-tag--mint","data-disabled":!J||void 0,"aria-disabled":!J||void 0,href:J?k:void 0,target:J?"_blank":void 0,rel:J?"noopener noreferrer":void 0,onClick:G=>{if(!J){G.preventDefault();return}et(G,k,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:u,userDeposit:x}},n)},children:[Pe("span",{className:"wp-tag-label",children:"Claim"}),Pe(_t,{size:12,className:"wp-tag-icon"})]})]})]},u.pool_address)})}),Pe(tr,{open:d.isOpen,status:d.status,positions:h,initialPoolAddress:d.initialPoolAddress,walletAddress:t,txHash:d.txHash,error:d.error,copied:d.copied,estimateWithdraw:d.hasEstimator?d.estimateWithdraw:void 0,onClose:d.closeWithdraw,onConfirm:d.confirmWithdraw,onCopyHash:d.copyHash,trackFunnel:d.trackFunnelOnce})]})}import*as Ms from"react";import{Fragment as Mp,jsx as st,jsxs as tn}from"react/jsx-runtime";var Bp="Points";function Ds(){let{env:e,walletAddress:t,onOutlink:n}=Ue(),o=zt(),r=!!t,{getTokenImage:i}=Xo(e,r),a=nr("points"),{positions:s,isLoading:c}=er(e,t,r),l=Ms.useMemo(()=>s.filter(h=>h.poolType!=="CrossPool").map(h=>({...h,icon:i(h.tokenAddress,h.tokenSymbol)})),[s,i]),d=`${Gt[e]}/point.png`,w=Ss[e];return tn(Mp,{children:[st(Ht,{sectionKey:"points",title:Bp,icon:d,isEmpty:l.length===0,loading:c,children:l.map(h=>{let m=h.price?fn(h.depositedRaw,h.decimals,h.price,o):null;return tn("article",{className:"wp-item","data-side":"reward",children:[tn("div",{className:"wp-item-body",children:[tn("div",{className:"wp-item-line",children:[st("span",{className:"wp-item-label",children:"Token"}),tn("div",{className:"wp-svc-token",children:[h.icon&&st("img",{className:"wp-svc-token-icon",src:h.icon,alt:""}),st("span",{children:h.tokenSymbol})]})]}),tn("div",{className:"wp-item-line",children:[st("span",{className:"wp-item-label",children:"Deposited"}),tn("div",{className:"wp-svc-token wp-svc-token--amount",children:[h.icon&&st("img",{className:"wp-svc-token-icon",src:h.icon,alt:""}),tn("div",{className:"wp-svc-amount",children:[st("span",{className:"wp-svc-amount-main",children:Pt(h.depositedRaw,h.decimals)}),m&&st("span",{className:"wp-item-usd",children:m})]})]})]})]}),st("div",{className:"wp-item-tags",children:a.canWithdrawInline?st("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>a.openWithdraw(h.poolAddress),children:st("span",{className:"wp-tag-label",children:"Withdraw"})}):tn("a",{className:"wp-tag wp-tag--muted",href:w,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:y=>et(y,w,{category:"portfolio",origin:"portfolio-points",payload:{position:h}},n),children:[st("span",{className:"wp-tag-label",children:"Withdraw"}),st(_t,{size:12,className:"wp-tag-icon"})]})})]},h.poolAddress)})}),st(tr,{open:a.isOpen,status:a.status,positions:l,initialPoolAddress:a.initialPoolAddress,walletAddress:t,txHash:a.txHash,error:a.error,copied:a.copied,estimateWithdraw:a.hasEstimator?a.estimateWithdraw:void 0,onClose:a.closeWithdraw,onConfirm:a.confirmWithdraw,onCopyHash:a.copyHash,trackFunnel:a.trackFunnelOnce})]})}import*as pa from"react";import{useQuery as Dp}from"@tanstack/react-query";var Op="wp:stake-info";function Os(e,t,n=!0){let o=n&&!!t,{data:r,...i}=Dp({queryKey:[Op,e,t],queryFn:async({signal:s})=>{let c=await le("posa",e),l=await fetch(`${c}/stake/${t}`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Stake info fetch failed: ${l.status}`);let d=await l.json();if(d.code!==0&&d.code!==200)throw new Error(`Stake info API error: ${d.code}`);return d},enabled:o,staleTime:0});return{stakeInfo:r?.data,...i}}import{useQuery as Wp}from"@tanstack/react-query";var Up="wp:stake-rewards",zp=31;function Ws(e,t,n=!0){let o=n&&!!t,{data:r,...i}=Wp({queryKey:[Up,e,t],queryFn:async({signal:a})=>{let s=await le("posa",e),c=await fetch(`${s}/rewards/${t}?limit=${zp}`,{cache:"no-store",signal:a});if(!c.ok)throw new Error(`Stake rewards fetch failed: ${c.status}`);let l=await c.json();if(l.code!==0&&l.code!==200)throw new Error(`Stake rewards API error: ${l.code}`);return l.data?.data??[]},enabled:o,staleTime:0});return{latestReward:r?.[0]??null,aprAccrued:ls(r),...i}}import{useQuery as Gp}from"@tanstack/react-query";var Hp="wp:staking-onchain";function Us(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...i}=Gp({queryKey:[Hp,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...i}}import{useMemo as zs}from"react";import $p from"bignumber.js";function Gs(e){return e?.trim().toUpperCase()==="CROSS"}function Hs(e){return new $p(e||"0").isGreaterThan(0)}function or(e,t,n=!0){let{allPools:o}=zn(e,n),r=zs(()=>{for(let l of o)for(let d of[l.deposit_token,...l.reward_tokens])if(Gs(d?.symbol)&&Hs(d.price))return d.price},[o]),i=n&&r===void 0,{tokens:a}=dn(e,t,i),{statsMap:s}=pn(e,i),c=Ne[e].cross;return zs(()=>{if(r)return r;let l=a.find(d=>d.chainId===c&&Gs(d.symbol));if(l){let d=s.get(At(l.chainId,l.address));if(d&&Hs(d.price))return d.price}return"0"},[r,a,s,c])}import un from"bignumber.js";import{jsx as $t,jsxs as jt}from"react/jsx-runtime";var jp="CROSS Staking";function Vp(e){if(!e)return"\u2014";let t=new un(e);return t.isFinite()?`${t.toFormat(2,un.ROUND_DOWN)}%`:"\u2014"}function $s(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=Ue(),r=zt(),i=!!t,{stakeInfo:a,isLoading:s}=Os(e,t,i),{latestReward:c,aprAccrued:l,isLoading:d}=Ws(e,t,i),{onchain:w}=Us(t,o,i),h=or(e,t,i),m=`${Gt[e]}/cross-staking.png`,y=Cs[e],b=a?.total_stake??"0",u=pa.useMemo(()=>w?new un(w.earnedWei.toString()).shiftedBy(-18).toString(10):c?.cumulative_earned??a?.rewards_earned??"0",[w,c,a]),x=pa.useMemo(()=>w?new un(w.stakedWei.toString()).shiftedBy(-18):new un(b),[w,b]),R=l!==void 0?new un(l):void 0,p=a?.days_since_first_stake,C=R!==void 0&&R.isFinite()&&x.isGreaterThan(0)&&p!==null&&p!==void 0?R.div(x).times(365).div(Math.max(1,p)).times(100):void 0,k=!(new un(b).isZero()&&new un(u).isZero()),N=fn(b,0,h,r),E=fn(u,0,h,r);return $t(Ht,{sectionKey:"staking",title:jp,icon:m,iconFit:"contain",isEmpty:!k,loading:s||d,children:jt("article",{className:"wp-item","data-side":"stake",children:[jt("div",{className:"wp-item-body",children:[jt("div",{className:"wp-item-line",children:[$t("span",{className:"wp-item-label",children:"Staked"}),jt("div",{className:"wp-svc-amount",children:[jt("span",{className:"wp-svc-amount-main",children:[oa(b)," CROSS"]}),N&&$t("span",{className:"wp-item-usd",children:N})]})]}),jt("div",{className:"wp-item-line",children:[$t("span",{className:"wp-item-label",children:"Rewards Earned"}),jt("div",{className:"wp-svc-amount",children:[jt("span",{className:"wp-svc-amount-main",children:[oa(u)," CROSS"]}),E&&$t("span",{className:"wp-item-usd",children:E})]})]}),jt("div",{className:"wp-item-line",children:[$t("span",{className:"wp-item-label",children:"My APR"}),$t("span",{children:Vp(C?.toString(10))})]})]}),$t("div",{className:"wp-item-tags",children:jt("a",{className:"wp-tag wp-tag--mint",href:y,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:T=>et(T,y,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a}},n),children:[$t("span",{className:"wp-tag-label",children:"Manage"}),$t(_t,{size:12,className:"wp-tag-icon"})]})})]})})}import*as fa from"react";import{useQuery as qp}from"@tanstack/react-query";var Kp="wp:game-swap-pools";function js(e,t,n=!0){let o=n&&!!t,{data:r,...i}=qp({queryKey:[Kp,e,t],queryFn:async({signal:a})=>{let s=await le("gameSwap",e),c=await fetch(`${s}/addresses/${t}/portfolio`,{cache:"no-store",signal:a});if(!c.ok)throw new Error(`Game-swap portfolio fetch failed: ${c.status}`);return(await c.json()).pools??[]},enabled:o,staleTime:0});return{pools:r??[],...i}}import{useQuery as Qp}from"@tanstack/react-query";var Yp="wp:game-swap-lp-balances";function Vs(e,t,n,o){let r=[...n].map(c=>c.toLowerCase()).sort(),i=!!t&&r.length>0,{data:a,...s}=Qp({queryKey:[Yp,e,t,r,!!o],queryFn:async({signal:c})=>{let l=o?await o(r):await Ns(e,t,r,c),d={};for(let[w,h]of Object.entries(l))d[w.toLowerCase()]=h;return d},enabled:i,staleTime:0});return{balances:a??{},...s}}import nn from"bignumber.js";import{jsx as yt,jsxs as Ft}from"react/jsx-runtime";var Zp="Gametoken LP",Ks=18,Xp=new nn("0.0001");function qs(e){return e?.trim().toUpperCase()==="CROSS"}function Jp(e){return e&&e>0?e:Ks}function ef(e){let t=qs(e.token_a?.symbol)&&!qs(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=Jp(t?e.token_a?.decimals:e.token_b?.decimals),r=new nn(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new nn(0):r.times(2)}function tf(e,t,n){let o=e.token_a?.symbol?.trim()||"TOKEN",r=e.token_b?.symbol?.trim()||"CROSS",i=t?.decimals??Ks,a,s;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let c=new nn(t.balance.toString()),l=new nn(t.totalSupply.toString()),d=c.div(l);a=d.times(100);let w=d.times(ef(e));if(w.isGreaterThan(0)){let h=new nn(e.quote_usd??e.cross_usd??"0");s=h.isGreaterThan(0)?io(w.times(h),n):`${w.toFormat(4,nn.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:o,tokenBSymbol:r,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:i,sharePercent:a,valueText:s}}function Qs(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=Ue(),r=zt(),i=!!t,{pools:a,isLoading:s}=js(e,t,i),c=fa.useMemo(()=>a.map(b=>b.pair_address).filter(Boolean),[a]),{balances:l,isLoading:d}=Vs(e,t,c,o),w=`${Gt[e]}/dex.png`,h=Object.keys(l).length>0,m=fa.useMemo(()=>{let b=a.map(u=>tf(u,l[u.pair_address?.toLowerCase()],r));return h?b.filter(u=>u.lpAmountRaw?new nn(u.lpAmountRaw).shiftedBy(-u.lpDecimals).isGreaterThanOrEqualTo(Xp):!1):b},[a,l,h,r]),y=b=>{let u=b.token_a?.address??b.pair_address;return`${Ts[e]}/tokens/${u}?trade=deposit`};return yt(Ht,{sectionKey:"gameSwap",title:Zp,icon:w,iconFit:"contain",isEmpty:m.length===0,loading:s||d,children:m.map(b=>{let{pool:u}=b,x=y(u),R=`${b.tokenASymbol} / ${b.tokenBSymbol}`,p=u.token_a?.logo_url,C=u.token_b?.logo_url;return Ft("article",{className:"wp-item","data-side":"game-swap",children:[Ft("div",{className:"wp-item-body",children:[Ft("div",{className:"wp-item-line",children:[yt("span",{className:"wp-item-label",children:"Pool"}),Ft("div",{className:"wp-svc-token",children:[Ft("span",{className:"wp-token-stack","aria-hidden":!0,children:[p&&yt("img",{className:"wp-svc-token-icon",src:p,alt:""}),C&&yt("img",{className:"wp-svc-token-icon",src:C,alt:""})]}),yt("span",{children:R})]})]}),b.lpAmountRaw!==void 0&&Ft("div",{className:"wp-item-line",children:[yt("span",{className:"wp-item-label",children:"My LP"}),Ft("span",{children:[Pt(b.lpAmountRaw,b.lpDecimals)," LP"]})]}),b.sharePercent!==void 0&&Ft("div",{className:"wp-item-line",children:[yt("span",{className:"wp-item-label",children:"Pool Share"}),Ft("span",{children:[b.sharePercent.toFormat(2,nn.ROUND_DOWN),"%"]})]}),b.valueText!==void 0&&Ft("div",{className:"wp-item-line",children:[yt("span",{className:"wp-item-label",children:"Value"}),yt("span",{children:b.valueText})]})]}),yt("div",{className:"wp-item-tags",children:Ft("a",{className:"wp-tag wp-tag--mint",href:x,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":R,onClick:k=>et(k,x,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:u}},n),children:[yt("span",{className:"wp-tag-label",children:"Manage"}),yt(_t,{size:12,className:"wp-tag-icon"})]})})]},u.pair_address)})})}import Nn from"bignumber.js";import{useMemo as cf}from"react";import{useQuery as nf}from"@tanstack/react-query";var of="wp:forge-pools";function Ys(e,t,n=!0){let o=n&&!!t,{data:r,...i}=nf({queryKey:[of,e,t],queryFn:async()=>{let s=await le("bondingCurve",e),c=await fetch(`${s}/v1/users/${t}/pools`,{cache:"no-store"});if(!c.ok)throw new Error(`forge pools fetch failed: ${c.status}`);return(await c.json()).data?.items??[]},enabled:o,staleTime:0}),a=r??[];return{pools:a,isEmpty:a.length===0,...i}}import{useQueries as rf}from"@tanstack/react-query";import{useMemo as af}from"react";var sf="wp:forge-token-detail";async function lf(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Zs(e,t,n=!0){let o=rf({queries:t.map(a=>({queryKey:[sf,e,a],queryFn:async()=>lf(await le("bondingCurve",e),a),enabled:n&&!!a,staleTime:3e4}))}),r=af(()=>{let a=new Map;for(let s=0;s<o.length;s++){let c=o[s]?.data,l=t[s];c&&l&&a.set(l.toLowerCase(),c)}return a},[o,t]),i=o.some(a=>a.isLoading);return{detailMap:r,isLoading:i}}import{jsx as lt,jsxs as mn}from"react/jsx-runtime";var df="Forge",Xs=18,pf="https://contents.crosstoken.io/wallet/token/images/FT.png";function ff(e){if(!e||e==="0")return"0";let t=new Nn(e).shiftedBy(-Xs);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Nn.ROUND_DOWN):t.toFormat(4,Nn.ROUND_DOWN)}function uf(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 mf(e,t,n,o){let r=new Nn(n||"0");if(!r.isGreaterThan(0))return null;let i=new Nn(e.total_supply||"0"),a=new Nn(e.lp_balance||"0"),s=new Nn(t?.reserve_b||"0").shiftedBy(-Xs);if(!i.isGreaterThan(0)||!a.isGreaterThan(0)||!s.isGreaterThan(0))return null;let c=s.times(2),d=a.div(i).times(c).times(r);return d.isFinite()?io(d,o):null}function Js(){let{env:e,walletAddress:t,onOutlink:n}=Ue(),o=zt(),r=!!t,{pools:i,isEmpty:a,isLoading:s}=Ys(e,t,r),c=cf(()=>i.map(m=>m.token.address),[i]),{detailMap:l}=Zs(e,c,r&&c.length>0),d=or(e,t,r),w=m=>`${Rs[e]}/forge/token/${m.token.address}`,h=`${Gt[e]}/forge.png`;return lt(Ht,{sectionKey:"forge",title:df,icon:h,iconFit:"contain",isEmpty:a,loading:s,children:i.map(m=>{let y=l.get(m.token.address.toLowerCase()),b=y?.image_url||y?.image||m.token.image||pf,u=y?.symbol||m.token.symbol,x=w(m),R=mf(m,y,d,o);return mn("a",{className:"wp-item","data-side":"lp",href:x,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":u,onClick:p=>et(p,x,{category:"portfolio",origin:"portfolio-forge",payload:{pool:m,tokenDetail:y}},n),children:[mn("div",{className:"wp-item-body",children:[mn("div",{className:"wp-item-line",children:[lt("span",{className:"wp-item-label",children:"Asset"}),mn("div",{className:"wp-svc-token",children:[lt("img",{className:"wp-svc-token-icon",src:b,alt:""}),lt("span",{children:u}),y?.name&<("span",{className:"wp-token-subtle",children:y.name})]})]}),mn("div",{className:"wp-item-line",children:[lt("span",{className:"wp-item-label",children:"LP Balance"}),lt("div",{className:"wp-svc-token wp-svc-token--amount",children:mn("div",{className:"wp-svc-amount",children:[lt("span",{className:"wp-svc-amount-main",children:ff(m.lp_balance)}),R&<("span",{className:"wp-item-usd",children:R})]})})]}),mn("div",{className:"wp-item-line",children:[lt("span",{className:"wp-item-label",children:"Ownership"}),lt("span",{className:"wp-line-value",children:uf(m.pool_ownership)})]})]}),lt("div",{className:"wp-item-tags",children:mn("span",{className:"wp-tag wp-tag--muted",children:[lt("span",{className:"wp-tag-label",children:"Withdraw"}),lt(_t,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}var rr=["rewards","points","staking","gameSwap","forge"];Y(`.wp-fullscreen[data-theme=dark],.wp-embed[data-theme=dark]{--wp-bg: var(--ds-bg-default, #202530);--wp-header-bg: var(--ds-surface-default, #252b39);--wp-card: var(--ds-surface-medium, #252b39);--wp-control: #292f40;--wp-border: var(--ds-border-default, #292f40);--wp-panel-border: var(--ds-border-medium, rgba(255, 255, 255, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .28);--wp-text: var(--ds-content-highest, #ffffff);--wp-text-60: var(--ds-content-high, rgba(255, 255, 255, .85));--wp-text-40: var(--ds-content-medium, rgba(255, 255, 255, .65));--wp-text-30: var(--ds-content-low, rgba(255, 255, 255, .4));--wp-chrome-text: #ffffff;--wp-tooltip-bg: #151a23;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, rgba(0, 160, 162, .14));--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #9b8cef;--wp-claim-primary-text: #202530;--wp-claim-secondary-bg: var(--wp-control);--wp-claim-success: #00d4aa;--wp-claim-success-soft: rgba(0, 212, 170, .18);--wp-claim-error: #ff3aa3;--wp-claim-error-soft: rgba(255, 58, 163, .16)}.wp-fullscreen[data-theme=light],.wp-embed[data-theme=light]{--wp-bg: var(--ds-bg-dim, #f5f7fa);--wp-header-bg: var(--ds-surface-default, #ffffff);--wp-card: var(--ds-surface-default, #ffffff);--wp-control: var(--ds-surface-medium, #f5f7fa);--wp-border: var(--ds-border-default, rgba(0, 0, 0, .07));--wp-panel-border: var(--ds-border-medium, rgba(0, 0, 0, .18));--wp-panel-shadow: 0px 4px 30px -1px rgba(0, 0, 0, .15);--wp-text: var(--ds-content-highest, #000000);--wp-text-60: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-text-40: var(--ds-content-medium, rgba(0, 0, 0, .65));--wp-text-30: var(--ds-content-low, rgba(0, 0, 0, .4));--wp-chrome-text: var(--ds-content-high, rgba(0, 0, 0, .85));--wp-card-shadow: none;--wp-tooltip-bg: #192023;--wp-tooltip-text: #ffffff;--wp-mint: var(--ds-accent-primary-default, #00a0a2);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-accent-primary-low, #e7f9f8);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #7346f3;--wp-claim-primary-text: #ffffff;--wp-claim-secondary-bg: #ffffff;--wp-claim-success: #019d92;--wp-claim-success-soft: rgba(1, 157, 146, .15);--wp-claim-error: #e70077;--wp-claim-error-soft: rgba(231, 0, 119, .12)}.wp-fullscreen{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:100dvh!important;z-index:50;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-embed{width:100%;height:100%;min-height:0;background:var(--wp-bg);display:flex;flex-direction:column;overflow:hidden;position:relative;font-family:inherit;font-feature-settings:"calt" 0,"lnum" 1,"pnum" 1;box-sizing:border-box;-webkit-font-smoothing:antialiased;color:var(--wp-chrome-text)}.wp-overlay{position:fixed;inset:0;z-index:49;background:#0009}.wp-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:73px;padding:24px;position:relative;border-bottom:1px solid var(--wp-border);background:var(--wp-header-bg);color:var(--wp-chrome-text);flex-shrink:0;box-sizing:border-box}.wp-fullscreen .wp-header{height:60px;min-height:60px;padding:11px 20px;border-bottom:none;background:transparent}.wp-fullscreen .wp-header-btn{width:22px;height:22px;color:var(--wp-chrome-text)}.wp-fullscreen .wp-header-btn:hover{color:var(--wp-chrome-text)}.wp-header-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wp-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wp-header-edge{display:flex;align-items:center;width:24px;min-width:24px}.wp-header-edge--right{justify-content:flex-end}.wp-header-edge--right .wp-header-btn{position:absolute;top:24px;right:24px}.wp-header-spacer{display:block;width:24px;height:24px}.wp-header-avatar{width:38px;height:38px;flex-shrink:0;border-radius:50%;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:var(--wp-header-avatar-bg)}.wp-header-avatar-img{width:30px;height:30px;object-fit:cover;display:block}.wp-fullscreen[data-theme=dark] .wp-header-avatar,.wp-embed[data-theme=dark] .wp-header-avatar{--wp-header-avatar-bg: hsl(221.3 24.6% 25.5%)}.wp-fullscreen[data-theme=light] .wp-header-avatar,.wp-embed[data-theme=light] .wp-header-avatar{--wp-header-avatar-bg: rgba(18, 18, 18, .1)}.wp-refresh-btn{position:relative}.wp-refresh-badge{position:absolute;top:-6px;right:-8px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--wp-mint);color:#fff;font-size:10px;font-weight:600;line-height:16px;text-align:center}.wp-spin-once{animation:wp-spin-once .6s ease-in-out}@keyframes wp-spin-once{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.wp-header-title{flex:1;font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;text-align:center;color:var(--ds-content-highest, #000000);margin:0}.wp-header-account{flex:1;display:flex;align-items:center;gap:12px;min-width:0}.wp-header-account-meta{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px}.wp-header-wallet-name{min-width:0;font-family:inherit;font-size:15px;font-weight:600;line-height:1.4;letter-spacing:0;color:var(--wp-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-btn{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;max-width:100%;padding:0;border:0;background:transparent;cursor:pointer;font:inherit}.wp-header-address{min-width:0;font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-header-address-copy{display:inline-flex;align-items:center;flex-shrink:0;color:var(--wp-text-40);transition:color .15s ease}.wp-header-address-btn:hover .wp-header-address-copy{color:var(--wp-text-60)}.wp-header-address-copy[data-copied=true]{color:var(--wp-mint)}.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:var(--wp-border) transparent}.wp-body::-webkit-scrollbar{width:4px}.wp-body::-webkit-scrollbar-track{background:transparent}.wp-body::-webkit-scrollbar-thumb{background:var(--wp-border);border-radius:4px}.wp-body-inner{padding:16px 16px 32px;display:flex;flex-direction:column;gap:32px}.wp-fullscreen .wp-body-inner{padding-top:8px;gap:24px}.wp-summary-card{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-summary-head{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:4px}.wp-summary-label{font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address{display:inline-flex;align-items:center;gap:8px;min-width:0}.wp-address-avatar{width:16px;height:16px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 68% 34%,#ff78d1 0 18%,transparent 19%),radial-gradient(circle at 34% 66%,#00d4aa 0 20%,transparent 21%),linear-gradient(135deg,#7346f3,#0488fc)}.wp-address-label{font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;color:var(--wp-text-40);white-space:nowrap}.wp-address-chevron{display:inline-flex;align-items:center;color:var(--wp-text-40);flex-shrink:0}.wp-summary-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:999px;background:#019d921a;color:var(--wp-mint);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;white-space:nowrap}.wp-summary-estimate{position:relative;display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.wp-estimate-info{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--wp-text-40);cursor:help}.wp-estimate-tooltip{position:absolute;top:calc(100% + 8px);left:0;right:auto;z-index:3;display:flex;flex-direction:column;gap:8px;width:min(280px,calc(100vw - 48px));padding:12px;border-radius:8px;background:var(--wp-tooltip-bg);box-shadow:0 12px 32px #0000003d;color:var(--wp-tooltip-text);font-size:12px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-estimate-tooltip-title{display:block;font-size:12px;font-weight:600;line-height:1.3}.wp-estimate-tooltip-group{display:flex;flex-direction:column;gap:4px}.wp-estimate-tooltip-item{display:block;color:#ffffffc7}.wp-estimate-tooltip-item:before{content:"- "}.wp-estimate-info:hover .wp-estimate-tooltip,.wp-estimate-info:focus .wp-estimate-tooltip,.wp-estimate-info:focus-visible .wp-estimate-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-total{font-family:var( --wp-total-font-family, Sora, Inter, system-ui, -apple-system, sans-serif );font-size:36px;font-weight:600;line-height:1.25;letter-spacing:0;color:var(--wp-text);margin:0}.wp-svc-card{display:flex;flex-direction:column;gap:12px;width:100%}.wp-svc-card-head{display:flex;align-items:center;gap:6px}.wp-svc-card-icon{width:24px;height:24px;border-radius:4px;flex-shrink:0;object-fit:cover}.wp-svc-card-title{font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wp-svc-items{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border-radius:0;background:transparent;box-shadow:none;box-sizing:border-box}.wp-item{position:relative;display:flex;flex-direction:column;gap:20px;width:100%;padding:12px;border-radius:12px;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);box-sizing:border-box;color:inherit;text-decoration:none;cursor:pointer;outline:none;transition:opacity .15s ease}.wp-item+.wp-item{padding-top:12px;border-top:0}.wp-item:hover{opacity:.88}.wp-item-body{display:flex;flex-direction:column;gap:12px;min-width:0}.wp-order-head{display:flex;align-items:center;width:100%}.wp-item-line{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:21px;min-width:0}.wp-item-label{flex-shrink:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-30);white-space:nowrap}.wp-line-value,.wp-order-side{min-width:0;overflow:hidden;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-order-side--buy{color:var(--wp-mint)}.wp-order-side--sell{color:var(--wp-red)}.wp-svc-token{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;min-height:21px}.wp-svc-token>span{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-svc-token-icon{width:16px;height:16px;border-radius:50%;flex-shrink:0;object-fit:cover}.wp-svc-token--amount{align-items:flex-start}.wp-svc-token--amount>.wp-svc-token-icon{margin-top:2.5px}.wp-token-stack{display:inline-flex;align-items:center;justify-content:flex-end;width:29px;min-width:29px;overflow:visible}.wp-token-stack .wp-svc-token-icon+.wp-svc-token-icon{margin-left:-3.5px}.wp-token-subtle,.wp-item-usd{color:var(--wp-text-30)!important}.wp-svc-amount{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;min-width:0}.wp-svc-amount-main{font-size:14px;font-weight:500;line-height:1.5;letter-spacing:0;color:var(--wp-text-60);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.wp-svc-amount .wp-item-usd{font-size:12px;font-weight:500;line-height:1.35}.wp-order-token{display:flex;align-items:center;gap:8px;min-width:0}.wp-order-token .wp-svc-token-icon{width:32px;height:32px}.wp-order-token-meta{display:flex;min-width:0;flex-direction:column;justify-content:center}.wp-order-token-symbol{overflow:hidden;color:var(--wp-text-60);font-size:14px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-order-token-pair{overflow:hidden;color:var(--wp-text-30);font-size:12px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.wp-item-tags{display:flex;align-items:stretch;gap:8px;width:100%}.wp-tag{appearance:none;display:inline-flex;flex:1 1 0;align-items:center;justify-content:center;gap:0;min-width:0;min-height:33px;padding:6px 10px;border-radius:6px;border:0;background:var(--wp-control);font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0;color:var(--wp-text-40);text-align:center;text-decoration:none;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,color .15s ease,transform .15s ease}a.wp-tag,button.wp-tag{cursor:pointer}.wp-tag:hover{background:var(--wp-control);transform:none}.wp-tag:focus-visible{outline:2px solid var(--wp-mint);outline-offset:2px}.wp-tag[aria-disabled=true],.wp-tag[data-disabled]{cursor:default;opacity:.48;pointer-events:none}.wp-tag-label{display:inline-flex;align-items:center}.wp-tag-icon{display:none}.wp-tag:hover .wp-tag-icon{transform:none}.wp-tag--mint{color:var(--wp-mint);background:var(--wp-accent-soft)}.wp-tag--mint:hover{background:var(--wp-accent-soft)}.wp-tag--muted{color:var(--wp-text-40)}.wp-body-inner[data-empty]{min-height:100%;box-sizing:border-box;justify-content:center}.wp-portfolio-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:280px;padding:32px 24px;text-align:center}.wp-portfolio-empty-icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin-bottom:6px;border-radius:50%;background:var(--wp-card);box-shadow:var(--wp-card-shadow, none);color:var(--wp-text-30)}.wp-portfolio-empty-title{margin:0;font-size:15px;font-weight:600;line-height:1.3;color:var(--wp-text-60)}.wp-portfolio-empty-desc{margin:0;font-size:13px;font-weight:400;line-height:1.4;color:var(--wp-text-30)}.wp-portfolio-loading{display:flex;align-items:center;justify-content:center;min-height:280px;padding:32px 24px}.wp-portfolio-spinner{width:22px;height:22px;border:2px solid var(--wp-border);border-top-color:var(--wp-mint);border-radius:50%;animation:wp-claim-spin .8s linear infinite}.wp-claim-overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:flex-end;justify-content:center;background:#00000094;box-sizing:border-box}.wp-claim-sheet{display:flex;flex-direction:column;width:100%;max-width:375px;max-height:calc(100% - 24px);overflow:hidden;border-radius:24px 24px 0 0;background:var(--wp-bg);color:var(--wp-text);box-shadow:0 -18px 48px #00000042;animation:wp-claim-slide-up .22s ease-out}@keyframes wp-claim-slide-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.wp-claim-grabber{display:flex;align-items:flex-start;justify-content:center;height:38px;min-height:38px;padding-top:12px;box-sizing:border-box}.wp-claim-grabber span{display:block;width:52px;height:5px;border-radius:999px;background:var(--wp-control)}.wp-claim-content{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;padding:20px;box-sizing:border-box}.wp-claim-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;flex-shrink:0}.wp-claim-icon--success{background:var(--wp-claim-success-soft);color:var(--wp-claim-success)}.wp-claim-icon--pending{background:#9b8cef29;color:var(--wp-claim-primary)}.wp-claim-icon--error{background:var(--wp-claim-error-soft);color:var(--wp-claim-error);font-size:30px;font-weight:600;line-height:1}.wp-claim-icon--token{background:#00d4aa29}.wp-claim-icon--token img{width:48px;height:48px;border-radius:50%;object-fit:cover}.wp-claim-icon--token span{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;background:var(--wp-mint);color:#101820;font-size:18px;font-weight:600}.wp-claim-spinner{width:36px;height:36px;border-radius:50%;border:3px solid rgba(155,140,239,.28);border-top-color:var(--wp-claim-primary);animation:wp-claim-spin .8s linear infinite}@keyframes wp-claim-spin{to{transform:rotate(360deg)}}.wp-claim-copy{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;text-align:center}.wp-claim-title{margin:0;font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;color:var(--wp-text)}.wp-claim-desc{max-width:335px;margin:0;font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-40)}.wp-claim-heading{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.wp-claim-error-message{margin:0;color:var(--wp-claim-error);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0}.wp-claim-reward-card{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-reward-token{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-claim-reward-token img{width:28px;height:28px;object-fit:cover}.wp-claim-reward-token span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-claim-reward-symbol{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wp-text);font-size:18px;font-weight:600;line-height:1.3;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-reward-amount{flex-shrink:0;color:var(--wp-text);font-size:20px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-account-row{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-height:40px}.wp-claim-account-row>span{flex-shrink:0;color:var(--wp-text-40);font-size:14px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-account{display:flex;align-items:center;gap:8px;min-width:0}.wp-claim-account strong{overflow:hidden;color:var(--wp-text);font-size:15px;font-weight:600;line-height:1.6;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.wp-claim-account-avatar{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:radial-gradient(circle at 30% 28%,#d87aff 0 12%,transparent 13%),radial-gradient(circle at 68% 28%,#f0a1ff 0 12%,transparent 13%),radial-gradient(circle at 32% 70%,#b561e7 0 13%,transparent 14%),radial-gradient(circle at 70% 70%,#d4a2ff 0 13%,transparent 14%),radial-gradient(circle at 50% 50%,#8c4fc4 0 18%,transparent 19%),#4a315f;box-shadow:inset 0 0 0 3.37px var(--wp-control)}.wp-claim-divider{display:block;width:100%;height:1px;background:var(--wp-border)}.wp-claim-detail-list{display:flex;flex-direction:column;gap:8px;width:100%}.wp-claim-detail-row{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;min-height:20px}.wp-claim-detail-row>span{min-width:0;color:var(--wp-text-40);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;white-space:nowrap}.wp-claim-detail-row--sub>span:before{content:"";display:inline-block;width:3px;height:3px;margin:0 8px 3px;background:currentColor}.wp-claim-detail-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list{display:flex;flex-direction:column;gap:8px;width:100%;padding-bottom:8px}.wp-claim-list-item{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-claim-list-item>span{flex-shrink:0;font-size:14px;font-weight:400;line-height:1.3;color:var(--wp-text-40);white-space:nowrap}.wp-claim-list-item strong{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;overflow:hidden;color:var(--wp-text);font-size:14px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-list-item img{width:16px;height:16px;border-radius:50%;flex-shrink:0}.wp-claim-hash{appearance:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);cursor:pointer;font:inherit}.wp-claim-hash svg{flex-shrink:0;color:var(--wp-text-60)}.wp-claim-gas-card{display:flex;flex-direction:column;gap:4px;width:100%;padding:14px 16px;border-radius:8px;border:1px solid var(--wp-border);background:var(--wp-card);box-sizing:border-box}.wp-claim-gas-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:28px}.wp-claim-gas-row>span{min-width:0;font-size:12px;font-weight:400;line-height:1.3;color:var(--wp-text-40)}.wp-claim-gas-row strong{min-width:0;overflow:hidden;color:var(--wp-text);font-size:12px;font-weight:400;line-height:1.3;text-align:right;text-overflow:ellipsis;white-space:nowrap}.wp-claim-gas-row--primary{min-height:32px}.wp-claim-gas-row--primary>span,.wp-claim-gas-row--primary strong{font-size:14px;color:var(--wp-text)}.wp-claim-fee-label{position:relative;display:inline-flex;align-items:center;text-decoration:underline dotted;text-underline-offset:3px;cursor:help;overflow:visible!important}.wp-claim-fee-tooltip{position:absolute;left:0;bottom:calc(100% + 8px);z-index:2;width:min(260px,calc(100vw - 64px));padding:10px 12px;border-radius:8px;background:var(--wp-tooltip-bg);color:var(--wp-tooltip-text);box-shadow:0 12px 32px #0000003d;font-size:11px;font-weight:400;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;opacity:0;pointer-events:none;transform:translateY(4px);visibility:hidden;transition:opacity .15s ease,transform .15s ease,visibility .15s ease}.wp-claim-fee-label:hover .wp-claim-fee-tooltip,.wp-claim-fee-label:focus .wp-claim-fee-tooltip,.wp-claim-fee-label:focus-visible .wp-claim-fee-tooltip{opacity:1;transform:translateY(0);visibility:visible}.wp-claim-actions{display:flex;align-items:center;gap:8px;width:100%}.wp-claim-primary,.wp-claim-secondary{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:100%;min-width:0;height:52px;padding:0 24px;border:none;border-radius:40px;font-family:inherit;font-size:15px;font-weight:600;line-height:1.3;letter-spacing:0;white-space:nowrap;cursor:pointer}.wp-claim-primary{background:var(--wp-claim-primary);color:var(--wp-claim-primary-text)}.wp-claim-primary:disabled{cursor:default;opacity:.72}.wp-claim-secondary{background:var(--wp-claim-secondary-bg, var(--wp-control));color:var(--wp-claim-primary)}.wp-claim-actions[data-count="2"] .wp-claim-primary{flex:1 1 0}.wp-claim-actions[data-count="2"] .wp-claim-secondary{flex:0 0 120px}.wp-claim-button-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(32,37,48,.28);border-top-color:var(--wp-claim-primary-text);animation:wp-claim-spin .8s linear infinite}.wp-claim-home-indicator{display:flex;align-items:flex-end;justify-content:center;height:34px;min-height:34px;padding-bottom:8px;box-sizing:border-box}.wp-claim-home-indicator span{display:block;width:134px;height:5px;border-radius:16px;background:var(--wp-text-40)}@media(max-width:359px){.wp-header{gap:12px;padding:0 12px}.wp-total{font-size:24px}.wp-body-inner{padding:0 12px 128px;gap:20px}.wp-svc-items,.wp-claim-content{padding:18px 14px}.wp-item-line{gap:10px}.wp-svc-token>span{max-width:168px}}.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}.wi-drawer-content .wp-header,.wi-portfolio-body .wp-header{padding:16px}.wi-drawer-content .wp-header-edge--right .wp-header-btn,.wi-portfolio-body .wp-header-edge--right .wp-header-btn{top:16px;right:16px}.wp-withdraw-amount-card{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;border-radius:8px;background:var(--wp-card);box-sizing:border-box}.wp-withdraw-amount-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-input{flex:1 1 auto;min-width:0;padding:0;border:none;background:transparent;color:var(--wp-text);font-family:inherit;font-size:24px;font-weight:600;line-height:1.3;letter-spacing:0;text-align:left;outline:none}.wp-withdraw-input::placeholder{color:var(--wp-text-30)}.wp-withdraw-input[aria-invalid=true]{color:var(--wp-claim-error)}.wp-withdraw-input-symbol{flex-shrink:0;color:var(--wp-text-40);font-size:15px;font-weight:600;line-height:1.3}.wp-withdraw-quick-row{display:flex;align-items:center;gap:8px;width:100%}.wp-withdraw-quick{appearance:none;flex:1 1 0;min-width:0;height:32px;padding:0 10px;border:1px solid var(--wp-border);border-radius:999px;background:transparent;color:var(--wp-text-60);font-family:inherit;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer}.wp-withdraw-quick:hover:not(:disabled){border-color:var(--wp-claim-primary);color:var(--wp-claim-primary)}.wp-withdraw-quick:disabled{cursor:default;opacity:.5}.wp-withdraw-content{overflow-y:auto}.wp-withdraw-token-list{display:flex;flex-direction:column;gap:8px;width:100%;max-height:216px;overflow-y:auto}.wp-withdraw-token{appearance:none;display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:10px 12px;border:1px solid var(--wp-border);border-radius:8px;background:var(--wp-card);color:var(--wp-text);font-family:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.wp-withdraw-token[data-selected]{border-color:var(--wp-claim-primary);box-shadow:inset 0 0 0 1px var(--wp-claim-primary)}.wp-withdraw-token:disabled{cursor:default;opacity:.6}.wp-withdraw-token-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:var(--wp-control)}.wp-withdraw-token-icon img{width:28px;height:28px;object-fit:cover}.wp-withdraw-token-icon span{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--wp-mint);color:#101820;font-size:13px;font-weight:600;line-height:1}.wp-withdraw-token-symbol{flex:1 1 auto;min-width:0;overflow:hidden;font-size:15px;font-weight:600;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.wp-withdraw-token-amount{flex-shrink:0;color:var(--wp-text-40);font-size:13px;font-weight:500;line-height:1.3;white-space:nowrap}
|
|
8
8
|
`);import{Fragment as bf,jsx as pe,jsxs as on}from"react/jsx-runtime";var ua=15,hf="wp:";function Gn({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:i=!0,variant:a="embed",className:s,onOutlink:c,lpBalanceReader:l,stakingRewardsReader:d,sendTransaction:w,estimateGas:h,conversionRatio:m,currencySymbol:y,sections:b}){let u=Ee(e),x=Re.useCallback(Q=>!b||b.includes(Q),[b]),R=!!n,p=gf(),[C,k]=Re.useState({}),N=Re.useCallback((Q,be)=>{k(Be=>{let Me=Be[Q];return Me&&Me.loading===be.loading&&Me.empty===be.empty?Be:{...Be,[Q]:be}})},[]),E=Re.useCallback(Q=>{k(be=>{if(!(Q in be))return be;let Be={...be};return delete Be[Q],Be})},[]),T=Re.useMemo(()=>({report:N,unregister:E}),[N,E]),[M,q]=Re.useState(ua),[L,K]=Re.useState(!1),[U,ce]=Re.useState(!1),J=Re.useRef(void 0),$=Re.useCallback(()=>{p.invalidateQueries({predicate:Q=>typeof Q.queryKey[0]=="string"&&Q.queryKey[0].startsWith(hf)})},[p]),ne=Re.useCallback(()=>{$(),K(!0),setTimeout(()=>K(!1),600),q(ua)},[$]);Re.useEffect(()=>{if(!R)return;let Q=setInterval(()=>{q(be=>be<=1?(ne(),ua):be-1)},1e3);return()=>clearInterval(Q)},[R,ne]);let G=Re.useCallback(()=>{r?.()},[r]),D=R?en(u,n,{size:64}):void 0,ae=Re.useCallback(async()=>{if(!(U||!n))try{await navigator.clipboard.writeText(n),ce(!0),clearTimeout(J.current),J.current=setTimeout(()=>ce(!1),2e3)}catch{}},[n,U]);Re.useEffect(()=>()=>clearTimeout(J.current),[]);let me=Re.useMemo(()=>({env:u,theme:t,open:!0,walletAddress:n,close:G,onOutlink:c,lpBalanceReader:l,stakingRewardsReader:d,sendTransaction:w,estimateGas:h,conversionRatio:m,currencySymbol:y}),[u,t,n,G,c,l,d,w,h,m,y]),j=rr.filter(x),_e=j.length>0&&j.every(Q=>{let be=C[Q];return!!be&&!be.loading}),xe=_e&&j.every(Q=>C[Q]?.empty),O=j.some(Q=>{let be=C[Q];return!!be&&!be.empty}),ee=j.length>0&&!_e&&!O,Fe=on(bf,{children:[i&&on("div",{className:"wp-header",children:[on("div",{className:"wp-header-account",children:[r&&pe("button",{type:"button",className:"wp-header-btn","aria-label":"Back","data-track":"back",onClick:r,children:pe(hs,{})}),pe("span",{className:"wp-header-avatar","aria-hidden":!0,children:D&&pe("img",{src:D,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&on("div",{className:"wp-header-account-meta",children:[o&&pe("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&on("button",{type:"button",className:"wp-header-address-btn",onClick:ae,"aria-label":"Copy wallet address","data-track":"address_copy",children:[pe("span",{className:"wp-header-address",children:Qo(n)}),pe("span",{className:"wp-header-address-copy","data-copied":U,children:U?pe(xn,{size:14}):pe(Jn,{size:14})})]})]})]}),on("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio","data-track":"refresh",onClick:ne,children:[pe(bs,{className:L?"wp-spin-once":void 0}),R&&pe("span",{className:"wp-refresh-badge",children:M})]})]}),pe("div",{className:"wp-body",children:on("div",{className:"wp-body-inner","data-empty":xe||void 0,children:[x("rewards")&&pe(Bs,{}),x("points")&&pe(Ds,{}),x("staking")&&pe($s,{}),x("gameSwap")&&pe(Qs,{}),x("forge")&&pe(Js,{}),ee&&pe("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:pe("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),xe&&on("div",{className:"wp-portfolio-empty",role:"status",children:[pe("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:on("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[pe("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),pe("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),pe("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),pe("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),pe("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across CROSS services will appear here."})]})]})})]});return pe(so.Provider,{value:me,children:pe(ra.Provider,{value:T,children:pe(ge,{feature:"wallet_portfolio",children:a==="none"?Fe:pe("div",{className:fe(a==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:Fe})})})})}import{jsx as ma,jsxs as el}from"react/jsx-runtime";function tl({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s}=Ue();return el(ar.Portal,{children:[ma(ar.Overlay,{className:"wp-overlay"}),el(ar.Content,{className:fe("wp-fullscreen",e),"data-theme":n,children:[ma(ar.Title,{className:"wp-sr-only",children:"Portfolio"}),ma(Gn,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s})]})]})}import{jsx as nl}from"react/jsx-runtime";function xf({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:c,estimateGas:l,conversionRatio:d,currencySymbol:w,children:h}){let m=Ee(e),y=o!==void 0,[b,u]=In.useState(!1),x=y?o:b,R=In.useCallback(k=>{y||u(k),r?.(k)},[y,r]),p=In.useCallback(()=>R(!1),[R]),C=In.useMemo(()=>({env:m,theme:t,open:x,walletAddress:n,close:p,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:c,estimateGas:l,conversionRatio:d,currencySymbol:w}),[m,t,x,n,p,i,a,s,c,l,d,w]);return nl(so.Provider,{value:C,children:nl(wf.Root,{direction:"bottom",open:x,onOpenChange:R,noBodyStyles:!0,children:h})})}var ol=Object.assign(xf,{Trigger:ms,Content:tl});import*as _ from"react";import{createPortal as Hn}from"react-dom";import Vt from"bignumber.js";import{jsx as kt,jsxs as vf}from"react/jsx-runtime";function rl({size:e=20,className:t}){return vf("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[kt("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),kt("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function al({size:e=16,className:t}){return kt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:kt("path",{d:"M2.667 8a5.333 5.333 0 1 0 1.562-3.771L2.667 5.79M2.667 2.667v3.124h3.124M8 5.333V8l1.667 1",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function il({size:e=16,className:t}){return kt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:kt("path",{d:"M2.667 4h4M9.333 4h4M6.667 2.667v2.666M2.667 12h4M9.333 12h4M9.333 10.667v2.666M2.667 8h1.666M7 8h6.333M4.333 6.667v2.666",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function sl({size:e=20,className:t}){return kt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:kt("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ll({size:e=16,className:t}){return kt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:kt("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function cl({size:e=12,className:t}){return kt("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:kt("path",{d:"M3.5 2 1.5 4l2 2M1.5 4h9M8.5 10l2-2-2-2M10.5 8h-9",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})})}import*as A from"react";import fl from"bignumber.js";function dl(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function pl(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,fl.ROUND_DOWN).toFixed()}function yf(e){return e.fromToken.symbol.toLowerCase()===e.toToken.symbol.toLowerCase()||e.fromToken.chainId===e.toToken.chainId&&e.fromToken.address.toLowerCase()===e.toToken.address.toLowerCase()}function kf(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new fl(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:dl(t)&&dl(n)?e.lastChangedBy==="to"?{fromAmount:pl(r.multipliedBy(n).dividedBy(t))}:{toAmount:pl(r.multipliedBy(t).dividedBy(n))}:yf(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function ul({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):kf(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var ml=15,Sf=18,wl="cross_bridge_terms_accepted",Rf=3600*24*365;function Cf(e){let t=e.replace(/[^\d.]/g,""),n=t.indexOf(".");n!==-1&&(t=t.slice(0,n+1)+t.slice(n+1).replace(/\./g,""));let o=t.indexOf(".");if(o===-1)return t.slice(0,ml);let r=t.slice(0,o).slice(0,ml),i=t.slice(o+1).slice(0,Sf);return`${r}.${i}`}function Tf(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${wl}=true`)}function Nf(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${wl}=true`,"Path=/",`Max-Age=${Rf}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function If(e){let t=Number(e??"0");if(!Number.isFinite(t)||t<.1)return"1";let n=o=>Math.floor(o*100)/100;if(t<3){let o=n(t*3);return String(o<1?1:o)}return"10"}function gl(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function Ef(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([gl(e.symbol),gl(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function Bt(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function ir(e){return e[0]}function ga(e,t,n,o){if(n&&!Bt(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??ir(e);let i=e.findIndex(s=>Bt(s,t)),a=i>=0?e[i+1]:void 0;return a&&!Bt(a,t)?a:e.find(s=>!Bt(s,t))??t}function hl({fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:i}){return{fromToken:e,toToken:t,fromAmount:n,toAmount:o,lastChangedBy:r,slippage:i}}function sr(e,t=0){if(!e||t>5)return[];if(typeof e=="string")return[e];if(!(e instanceof Error)&&typeof e!="object")return[String(e)];let n=e;return[...[e instanceof Error?e.name:n.name,e instanceof Error?e.message:n.message,n.shortMessage,n.details,n.code].filter(r=>typeof r=="string"||typeof r=="number").map(String),...sr(n.cause,t+1),...sr(n.data,t+1),...sr(n.error,t+1)]}function ha(e){let t=sr(e).join(" ").toLowerCase(),n=t.includes("signature_failed")&&(t.includes("\uD0C0\uC785 \uB370\uC774\uD130 \uC11C\uBA85\uC5D0 \uC2E4\uD328")||t.includes("typed data")||t.includes("signtypeddata"));return t.includes("4001")||t.includes("err_user_rejected")||t.includes("userrejectedrequesterror")||t.includes("user rejected")||t.includes("user denied")||t.includes("user cancelled")||t.includes("user canceled")||t.includes("rejected the request")||t.includes("request rejected")||t.includes("action_rejected")||t.includes("rejected by user")||n}function bl(e,t){return ha(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
|