@nexus-cross/dapp-ui 1.3.4-beta.7 → 1.3.4-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
- function wa(e){try{return import.meta.env?.[e]}catch{return}}function xa(e){if(!(typeof process>"u"))return process.env?.[e]}function $e(e){if(e)return va(e);let t=wa("VITE_CROSSX_ENVIRONMENT")??wa("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??xa("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??xa("CROSSX_ENVIRONMENT");return va(t)}function va(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var br="1.3.4";var fo="__nexusCrossAppLauncherRuntime";function Kl(){if(typeof window>"u")return null;let e=window;return e[fo]??(e[fo]={mode:"dapp-ui"}),e[fo]}function Ql(e){if(e.scheduled)return;e.scheduled=!0;let t=()=>{if(e.scheduled=!1,e.loggedMode!==e.mode){if(e.mode==="connect-kit-react"){let n=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${n} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${br}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${br} \uCD08\uAE30\uD654 \uC644\uB8CC (\uC0AC\uC6A9 \uBAA8\uB4DC: dapp-ui only)`);e.loggedMode=e.mode}};typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function wr(e){let t=Kl();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Ql(t))}import*as In from"react";import*as ya from"@radix-ui/react-popover";import{Drawer as ec}from"vaul";import{createContext as Yl,useContext as Zl}from"react";var xr=Yl(null);function uo(){let e=Zl(xr);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import{useState as Xl,useEffect as Jl}from"react";function Nn(e){let[t,n]=Xl(!1);return Jl(()=>{let o=window.matchMedia(e);n(o.matches);let r=i=>n(i.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function $(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}$(`[data-theme=dark]{--al-bg: var(--ds-surface-default, #1e232e);--al-bg-hover: var(--ds-surface-medium, #252b39);--al-text: var(--ds-content-highest, #ffffff);--al-text-secondary: var(--ds-content-medium, #ffffffa6);--al-border: var(--ds-border-default, #ffffff12);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .7));--al-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #3a261f;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--al-drawer-overlay: var(--ds-overlay-dim, #000000b3)}[data-theme=light]{--al-bg: var(--ds-surface-default, #ffffff);--al-bg-hover: var(--ds-surface-medium, #f5f7fa);--al-text: var(--ds-content-highest, #000000);--al-text-secondary: var(--ds-content-medium, #000000a6);--al-border: var(--ds-border-default, #00000012);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .15));--al-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #fff1eb;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
- `);$(`.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
- `);$(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
- `);$(`.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
- `);$("");import{jsx as vr}from"react/jsx-runtime";function ka({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let i=Nn(`(max-width: ${n}px)`),[a,s]=In.useState(!1),l=In.useCallback(()=>s(!1),[]),c=$e(e),d=In.useMemo(()=>({env:c,theme:t,isMobile:i,open:a,domain:o,close:l}),[c,t,i,a,o,l]);return vr(xr.Provider,{value:d,children:i?vr(ec.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:r},"drawer"):vr(ya.Root,{open:a,onOpenChange:s,children:r},"popover")})}import*as Ta from"@radix-ui/react-popover";import{Drawer as nc}from"vaul";import{jsx as at,jsxs as tc}from"react/jsx-runtime";function Sa({size:e=18}){return tc("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[at("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Ra(){return at("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ca(){return at("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as mo}from"react/jsx-runtime";function Na({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:i}=uo(),a=t!=null,s=e??!0,l=n?`al-trigger-btn ${n}`:"al-trigger-btn",c=a?t:mo("button",{type:"button",className:l,"data-theme":i,style:o,children:mo(Sa,{size:18})});return r?mo(nc.Trigger,{asChild:s,children:c}):mo(Ta.Trigger,{asChild:s,children:c})}import*as mn from"react";import*as ho from"@radix-ui/react-popover";import{Drawer as En}from"vaul";import{useQuery as ac}from"@tanstack/react-query";var Ia={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 oc="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",rc="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function ut(e,t){return`${e==="production"?rc:oc}/${t}.png`}function Ea(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:ut(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:ut(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:ut(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:ut(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:ut(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:ut(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:ut(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:ut(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:ut(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://onechain.nexus/points"},iconUrl:ut(t,"point"),order:1e4,type:"points",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:ut(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:ut(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function go(e){let t=$e(e);return ac({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(Ia[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 Ea(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function yr(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function Aa(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function Pa(e){return[...e].sort((t,n)=>{let o=La(t)-La(n);return o!==0?o:t.order-n.order})}function La(e){let t=yr(e);return t==="comingSoon"?0:t==="ending"?2:1}function re(...e){return e.filter(Boolean).join(" ")}import{jsx as Le,jsxs as Ln}from"react/jsx-runtime";function ic(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Ba({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:i,domain:a,close:s}=uo(),{data:l}=go(o),c=mn.useMemo(()=>Pa(l?.items??[]),[l?.items]),d=8,g=mn.useRef(null),m=mn.useCallback(y=>{g.current={x:y.clientX,y:y.clientY}},[]),p=typeof window<"u"?window.location.pathname:"",v=mn.useCallback((y,L)=>{if(g.current){let R=y.clientX-g.current.x,k=y.clientY-g.current.y;if(g.current=null,Math.abs(R)>d||Math.abs(k)>d)return}let u=L.url[o]??L.url.production,C=Fa(u,a);if(!C)try{let R=new URL(u).pathname;if(p===R||p.startsWith(R+"/")){s();return}}catch{}C?window.open(u,"_blank","noopener,noreferrer"):window.location.href=u,s()},[o,a,s,p]),b=y=>{let L=y.url[o]??y.url.production,u=Fa(L,a),C=yr(y),R=C==="ending",k=Aa(y.iconUrl,o),N=!1;if(!u)try{let G=new URL(L).pathname;N=p===G||p.startsWith(G+"/")}catch{N=!1}return Le("button",{type:"button",className:"al-grid-item","data-active":N||void 0,"data-service-status":C,onPointerDown:m,onClick:G=>v(G,y),children:Ln("div",{className:"al-grid-item-left",children:[Ln("div",{className:"al-grid-item-icon",children:[Le("img",{src:k,alt:y.label,width:24,height:24,loading:"lazy"}),y.isNew&&Le("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),Ln("span",{className:"al-grid-item-text",children:[Le("span",{className:"al-grid-item-label",children:y.label}),R&&Le("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),y.badge&&!ic(y)&&Le("span",{className:"al-badge al-badge-list",children:y.badge})]})]})},y.id)},w=Le("div",{className:"al-menu","data-theme":r,children:Le("div",{className:"al-grid",children:c.map(b)})});return i?Ln(En.Portal,{children:[Le(En.Overlay,{className:"al-drawer-overlay"}),Ln(En.Content,{className:re("al-drawer-content",n),"data-theme":r,children:[Ln("div",{className:"al-drawer-header",children:[Le(En.Close,{className:"al-drawer-close",children:Le(Ra,{})}),Le(En.Title,{className:"al-drawer-title",children:"CROSS Services"}),Le(En.Close,{className:"al-drawer-close",children:Le(Ca,{})})]}),Le("div",{className:"al-drawer-body",children:w})]})]}):Le(ho.Portal,{children:Le(ho.Content,{align:e,sideOffset:t,className:re("al-popover-content",n),"data-theme":r,children:w})})}function Fa(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}import*as Ke from"react";import*as dl from"@radix-ui/react-popover";import{Drawer as Sf}from"vaul";import{createContext as sc,useContext as lc}from"react";var kr=sc(null);function en(){let e=lc(kr);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Sr=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Sr||{}),bo={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 Ri from"react";import{jsx as te,jsxs as Vn}from"react/jsx-runtime";function _a({size:e=16,className:t}){return Vn("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[te("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"}),te("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 te("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("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 gn({size:e=16,className:t}){return te("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Wt({size:e=24,className:t}){return te("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ma({size:e=20,className:t}){return Vn("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[te("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"}),te("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 wo({size:e=20,className:t}){return te("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:te("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 hn({size:e=20,className:t}){return te("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function bn({size:e=20,className:t}){return te("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Oa({size:e=16,className:t}){return Vn("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[te("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"}),te("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 Wa({size:e=16,className:t}){return Vn("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[te("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"}),te("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Da({size:e=42,className:t}){return te("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:te("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 za({size:e=20,className:t}){return te("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("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 Ga({size:e=20,className:t}){return te("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("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 Ua({size:e=20,className:t}){return te("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("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 Ha({size:e=20,className:t}){return te("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:te("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 $a({size:e=20,className:t}){return Vn("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[te("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),te("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 O from"react";import wn from"bignumber.js";function cc(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 tn(e,t){if(!e||e==="0")return"0.00";let n=new wn(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,wn.ROUND_DOWN)}function it(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Rr(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 ja(e,t,n){let r=new wn(e).shiftedBy(-t).multipliedBy(new wn(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(wn.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,wn.ROUND_DOWN):r.decimalPlaces(4,wn.ROUND_DOWN)).toFormat()}`}function Va(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=cc(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 dc}from"react";import{useQuery as pc}from"@tanstack/react-query";var Ye={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},ge={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},An="https://terms.crosstoken.io/docs/cross-terms-of-use",xo="https://terms.crosstoken.io/docs/nexus-privacy-policy";var fc="send:chain-info";function uc(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 Cr(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function mc(e,t,n,o){if(o)return t===ge[e].cross?qa(t,o):n?.explorer_url?Cr(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):gc(e,t,o)}function qa(e,t){return Cr("https://explorer.onechain.nexus",String(e),"tx",t)}function gc(e,t,n){let o=ge[e];if(t===o.cross)return qa(t,n);if(t===o.bsc)return Cr(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function vo(e,t,n,o=!0){let r=Ye[e],i=pc({queryKey:[fc,e,t],queryFn:async({signal:l})=>{let c=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let d=await c.json();if("code"in d&&d.code!==void 0&&d.code!==200)throw new Error(`Chain info API error: ${d.code}`);return uc(d)},enabled:o,staleTime:300*1e3}),a=i.data;return{transactionUrl:dc(()=>mc(e,t,a,n),[t,a,e,n]),chainInfo:a,...i}}var Ka="0x0000000000000000000000000000000000000001";var hc="0xa9059cbb",bc=/^0x[a-fA-F0-9]{40}$/,wc="nexus-cross:dapp-ui:send:recent:",Qa=10;function xc(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function qn(e){return e.toLowerCase()}function Dt(e){return bc.test(e)}function nn(e){return qn(e.address)===Ka}function Tr(e){return`${wc}${e.toLowerCase()}`}function Pn(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Tr(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&Dt(o.address)&&typeof o.updatedAt=="number").slice(0,Qa):[]}catch{return[]}}function Nr(e,t){if(typeof window>"u")return[];let n=qn(t),o=[{address:n,updatedAt:Date.now()},...Pn(e).filter(r=>r.address!==n)].slice(0,Qa);try{window.localStorage.setItem(Tr(e),JSON.stringify(o))}catch{return Pn(e)}return o}function Ir(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Tr(e))}catch{}}function Yt(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,l=10n**BigInt(t),c=i*l+s;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function Kn(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=xc(i.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Er(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${hc}${n}${o}`}function yo(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 Lr(e,t){return yo(e,t,6)}function Ya(e){return yo(e,9,2)}function Za(e){return e.toLocaleString("en-US")}function ko(e){return e===56||e===97}function So(e){return e.gasPrice??e.maxFeePerGas}function Xa(e,t=!1){return t?So(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Ro(e,t=!1){if(t){let n=So(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 Co(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Ja(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(Ja(n.cause,t+1)),o.join(`
6
- `).toLowerCase()}function vc(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 Ar(e,t={},n="Failed to send transaction."){let o=Ja(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.":vc(e)||n}var yc=2000000000n,kc=1000000000n;async function To(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 No(e){return BigInt(e)}function Sc(e){return`0x${e.toString(16)}`}function Rc(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Sc(e.value)),e.data&&(t.data=e.data),t}function Cc(e){return e===56||e===97}async function ei(e){try{let t=await To(e,"eth_gasPrice",[]);return{gasPrice:No(t)}}catch{return{gasPrice:yc}}}async function Tc(e,t){let n=kc;try{let o=await To(e,"eth_maxPriorityFeePerGas",[]);n=No(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Nc(e,t){if(t)return ei(e);let n;try{n=(await To(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Tc(e,No(n)):ei(e)}async function ti(e,t){let n=Cc(t.chainId),o=Rc(t),[r,i]=await Promise.all([To(e,"eth_estimateGas",[o]),Nc(e,n)]);return{gasLimit:No(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function ni(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 ti(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 Ic=1500,Ec=120;function oi(e){return!!(e.token||e.recipient||e.amount)}function Pr({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},i=e.trim(),a=Yt(t,n.quantity.decimals),s;return i?Dt(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.")),!nn(n)&&!Dt(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:s,recipient:i&&Dt(i)?i:void 0}}function Fr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return nn(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:qn(e.address),data:Er(n,o),value:0n,chainId:e.chainId,from:r}}function Lc(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Ac=e=>new Promise(t=>setTimeout(t,e));async function ri({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Ic,pollMaxAttempts:i=Ec}){let a=await e.sendTransaction(t);o(a);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let l=0;l<i;l+=1){let c=await s({hash:a,chainId:n}).catch(()=>null);if(c)return Lc(c)?"reverted":"success";await Ac(r)}return"timeout"}var ai=["token","recipient","amount","review"];function ii(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:i="recipient",token:a,tokens:s=[],onTokenChange:l,sendTransaction:c,getTransactionReceipt:d,estimateGas:g,getTokenPriceUsd:m,onSubmitted:p,onSuccess:v,onFailed:b,onExit:w,onOutlink:y}=e,L=O.useMemo(()=>ni({sendTransaction:c,getTransactionReceipt:d,estimateGas:g}),[c,d,g]),[u,C]=O.useState(a);O.useEffect(()=>{C(a)},[a.address,a.chainId]);let[R,k]=O.useState(i),[N,G]=O.useState(""),[F,j]=O.useState(""),[D,V]=O.useState({}),[A,ne]=O.useState("idle"),[B,q]=O.useState(""),[ue,ae]=O.useState(""),[Q,le]=O.useState(null),[se,K]=O.useState(!1),[z,X]=O.useState(""),Fe=O.useRef(0),[pe,xt]=O.useState(null),[Te,Jt]=O.useState(""),[vt,Qe]=O.useState(()=>Pn(n)),qt=O.useMemo(()=>$e(t),[t]),{transactionUrl:Ne,chainInfo:he}=vo(qt,u.chainId,B||void 0,!0),ct=he?.currency_symbol??"",Ie=he?.name??`Chain ID ${u.chainId}`,Be=O.useRef({nativeSymbol:ct||void 0,networkName:Ie,tokenSymbol:u.symbol});Be.current={nativeSymbol:ct||void 0,networkName:Ie,tokenSymbol:u.symbol};let be=O.useMemo(()=>BigInt(u.quantity.numeric||"0"),[u.quantity.numeric]),Bt=O.useMemo(()=>tn(u.quantity.numeric,u.quantity.decimals),[u.quantity.numeric,u.quantity.decimals]),yt=m?.(u),_t=O.useMemo(()=>{if(yt===void 0)return;let I=parseFloat(F.replace(/,/g,""));return Number.isFinite(I)?I*yt:0},[F,yt]);O.useEffect(()=>{j(""),V({})},[u.address,u.chainId]),O.useEffect(()=>{Fe.current+=1,le(null),X(""),K(!1)},[u.address,u.chainId,N,F]),O.useEffect(()=>{Qe(Pn(n))},[n]);let Je=O.useCallback(I=>{G(I),V(J=>({...J,recipient:void 0}))},[]),Mt=O.useCallback(I=>{j(I),V(J=>({...J,amount:void 0}))},[]),et=O.useCallback(()=>{j(Bt.replace(/,/g,"")),V(I=>({...I,amount:void 0}))},[Bt]),we=O.useCallback(I=>{C(I),l?.(I),k("recipient")},[l]),tt=O.useCallback(()=>k("token"),[]),dt=O.useCallback(()=>{k(I=>{if(I==="result")return"review";if(I===i)return w?.(),I;let J=ai.indexOf(I);return J<=0?(w?.(),I):ai[J-1]})},[i,w]),De=O.useCallback(()=>{let{errors:I}=Pr({recipient:N,amount:"1",token:u,balanceRaw:be});if(I.recipient){V(J=>({...J,recipient:I.recipient}));return}V(J=>({...J,recipient:void 0})),k("amount")},[N,u,be]),kt=O.useCallback(I=>{G(I),V(J=>({...J,recipient:void 0})),k("amount")},[]),me=O.useCallback(()=>{let I=Pr({recipient:N,amount:F,token:u,balanceRaw:be});V(I.errors),!(oi(I.errors)||I.rawAmount===void 0||!I.recipient)&&(xt(I.rawAmount),Jt(I.recipient),le(null),X(""),ne("idle"),k("review"))},[N,F,u,be]);O.useEffect(()=>{if(R!=="review"||!Te||pe===null||Q!==null||se||z||!L.canEstimateGas(he?.rpc))return;let I=++Fe.current;K(!0),X(""),(async()=>{try{let J=Fr({token:u,walletAddress:n,recipient:Te,rawAmount:pe}),ce=await L.estimateGas(J,he?.rpc);if(Fe.current!==I)return;le(ce)}catch(J){if(Fe.current!==I)return;X(Ar(J,Be.current,"Failed to estimate gas."))}finally{Fe.current===I&&K(!1)}})()},[R,Te,pe,Q,se,z,L,he?.rpc,u,n]);let Se=O.useMemo(()=>{if(!nn(u)||!Q||pe===null)return!1;let I=Ro(Q,ko(u.chainId));return I===null?!1:pe+I>be},[u,Q,pe,be]),Ot=O.useCallback(async()=>{if(!(!Te||pe===null)&&!Se){ae(""),q(""),ne("submitting");try{let I="",J=await ri({repository:L,args:Fr({token:u,walletAddress:n,recipient:Te,rawAmount:pe}),chainId:u.chainId,onSubmitted:ce=>{I=ce,q(ce),ne("confirming"),Qe(Nr(n,Te)),p?.({txHash:ce,chainId:u.chainId,amount:F,tokenSymbol:u.symbol,recipient:Te})}});if(J==="success")ne("success"),I&&v?v?.(I):k("result");else if(J==="reverted"){let ce="Transaction reverted on-chain.";ne("error"),ae(ce),I&&b?b({txHash:I,chainId:u.chainId,message:ce}):k("result")}else{let ce="Transaction receipt was not found. Please check again later.";ne("error"),ae(ce),I&&b?b({txHash:I,chainId:u.chainId,message:ce}):k("result")}}catch(I){ne("error"),ae(Ar(I,{nativeSymbol:ct||void 0,networkName:Ie,tokenSymbol:u.symbol})),k("result")}}},[L,Te,pe,Se,u,F,n,p,v,b,ct,Ie]),[St,ze]=O.useState(!1),pt=O.useRef(void 0);O.useEffect(()=>()=>clearTimeout(pt.current),[]);let Rt=O.useCallback(async()=>{if(B)try{await navigator.clipboard.writeText(B),ze(!0),clearTimeout(pt.current),pt.current=setTimeout(()=>ze(!1),2e3)}catch{}},[B]),Re=O.useCallback(()=>{if(!Ne||!B)return;let I=nt=>{typeof window<"u"&&window.open(nt,"_blank","noopener,noreferrer")};if(!y){I(Ne);return}let J=y(Ne,{category:"send",origin:"send-transaction",payload:{chainId:u.chainId,txHash:B}});if(J&&typeof J.then=="function"){let nt=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;J.then(Kt=>{if(Kt===null){nt?.close();return}let ot=Kt??Ne;if(nt)try{nt.location.href=ot}catch{nt.close(),I(ot)}else I(ot)});return}let ce=J;ce!==null&&I(ce??Ne)},[y,u.chainId,Ne,B]),Ee=O.useCallback(()=>{ae(""),q(""),ne("idle"),le(null),X(""),k("review")},[]);return{step:R,status:A,token:u,tokens:s.length>0?s:[u],recipient:N,amount:F,amountUsd:_t,fieldErrors:D,error:ue,txHash:B,gasEstimate:Q,gasLoading:se,gasError:z,insufficientGas:Se,reviewRawAmount:pe,reviewRecipient:Te,recentAddresses:vt,accounts:r,accountName:o,walletAddress:n,resolvedEnv:qt,transactionUrl:Ne,networkName:Ie,nativeSymbol:ct,nativeDecimals:he?.currency_decimals??u.quantity.decimals,balanceRaw:be,balanceText:Bt,priceUsd:yt,canSelectToken:(s.length>0?s:[u]).length>1,canSend:L.canSend,getTokenPriceUsd:m,setRecipient:Je,setAmount:Mt,setMax:et,selectToken:we,goToTokenSelect:tt,selectRecipient:kt,submitRecipient:De,submitAmount:me,confirmSend:Ot,retry:Ee,back:dt,hashCopied:St,copyHash:Rt,openTransaction:Re}}import*as Tt from"react";import{jsx as Qn,jsxs as Br}from"react/jsx-runtime";function si({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:i,token:a,setMax:s}=e,l=Tt.useRef(null),c=Tt.useCallback(()=>{requestAnimationFrame(()=>{let b=l.current;if(!b)return;let w=b.value.length;b.setSelectionRange(w,w)})},[]);Tt.useEffect(()=>{l.current?.focus(),c()},[c]),Tt.useEffect(()=>{t===""&&(m(!1),c())},[t,c]);let d=Tt.useMemo(()=>{let b=Yt(t,a.quantity.decimals);return"value"in b&&b.value>i},[t,a.quantity.decimals,i]),[g,m]=Tt.useState(!1),p=!g&&t===""?"0.00":t,v=t.trim()===""||t.trim()==="0";return Qn("div",{className:"sf-body sf-amount",children:Br("div",{className:"sf-amount-center",children:[Qn("span",{className:"sf-amount-usd",children:o!==void 0?Co(o):"\xA0"}),Qn("div",{className:"sf-amount-input-wrap","data-over":d||void 0,"data-empty":v||void 0,onClick:()=>l.current?.focus(),children:Qn("input",{ref:l,className:"sf-amount-input",value:p,onChange:b=>{let w=b.target.value;if(g)n(w);else if(t===""){if(w.length<4)return;m(!0);let y=w.startsWith("0.00")?w.slice(4):w;n(y)}else m(!0),n(w)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),Br("div",{className:"sf-amount-balance",children:[Qn("span",{children:"Balance:"}),Br("button",{type:"button",className:"sf-amount-max",onClick:s,children:[r," ",a.symbol]})]})]})})}import*as Nt from"react";var Pc=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function ci(e){return Pc.has(e.toLowerCase())}var _r={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},li={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Yn(e,t){let n=ge[e];if(t===n.cross)return li.cross;if(t===n.bsc)return li.bsc}var Fc={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Zt(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:i="png"}=n,a=Fc[e],s=r?`&bg=${r}`:"";return`${a}/portrait/evm/${t}.${i}?size=${o}${s}`}import{jsx as mt,jsxs as Io}from"react/jsx-runtime";function di({size:e=20,className:t}){return Io("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[mt("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),mt("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function pi({size:e=20,className:t}){return mt("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:mt("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 fi({size:e=20,className:t}){return Io("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[mt("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),mt("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function ui({size:e=16,className:t}){return mt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:mt("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function mi({size:e=56,className:t}){return Io("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[mt("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),mt("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 gi({size:e=56,className:t}){return Io("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[mt("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),mt("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as xe,jsxs as zt}from"react/jsx-runtime";function hi(e,t){return e.name||`Account ${(e.index??t)+1}`}function bi(e){return e.trim().slice(0,1).toUpperCase()||"A"}function wi(e){return e.toLowerCase()}function xi({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:i,walletAddress:a,resolvedEnv:s,selectRecipient:l}=e,c=Nt.useMemo(()=>i.filter(u=>u.address.toLowerCase()!==a.toLowerCase()),[i,a]),d=c.length>0,g=Nt.useMemo(()=>new Map(c.map((u,C)=>[wi(u.address),{account:u,index:C}])),[c]),[m,p]=Nt.useState("recent"),v=Nt.useRef(null);Nt.useEffect(()=>{v.current?.focus()},[]);let b="1A1A2E",w=Nt.useCallback(async()=>{try{let u=await navigator.clipboard.readText();u&&n(u.trim())}catch{}},[n]),y=t.trim().length>0,L=Dt(t.trim());return zt("div",{className:"sf-recipient",children:[zt("div",{className:"sf-recipient-top",children:[zt("div",{className:"sf-address-field","data-filled":y||void 0,"data-invalid":o.recipient||void 0,children:[xe("textarea",{ref:v,className:"sf-address-input",value:t,onChange:u=>n(u.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:y?2:1}),y?xe("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:xe(fi,{size:20})}):xe("button",{type:"button",className:"sf-address-action",onClick:w,"aria-label":"Paste from clipboard",children:xe(pi,{size:20})})]}),o.recipient&&xe("p",{className:"sf-field-error",role:"alert",children:o.recipient}),zt("div",{className:"sf-tabs",role:"tablist",children:[xe("button",{type:"button",role:"tab",className:"sf-tab","data-active":m==="recent"||void 0,"aria-selected":m==="recent",onClick:()=>p("recent"),children:"Recent"}),d&&xe("button",{type:"button",role:"tab",className:"sf-tab","data-active":m==="account"||void 0,"aria-selected":m==="account",onClick:()=>p("account"),children:"My Account"})]})]}),xe("div",{className:"sf-address-list",children:m==="account"&&d?c.map((u,C)=>{let R=hi(u,C),k=Zt(s,u.address,{size:56,bg:b});return zt("button",{type:"button",className:"sf-address-row",onClick:()=>l(u.address),children:[zt("span",{className:"sf-address-avatar",children:[k&&xe("img",{src:k,alt:"",width:40,height:40,draggable:!1,onError:N=>{N.currentTarget.style.display="none"}}),xe("span",{className:"sf-address-avatar-fallback",children:bi(R)})]}),zt("span",{className:"sf-address-meta",children:[xe("span",{className:"sf-address-name",children:R}),xe("span",{className:"sf-address-value",children:it(u.address)})]})]},u.address)}):r.length>0?r.map(u=>{let C=g.get(wi(u.address)),R=C?hi(C.account,C.index):it(u.address),k=Zt(s,u.address,{size:56,bg:b});return zt("button",{type:"button",className:"sf-address-row",onClick:()=>l(u.address),children:[zt("span",{className:"sf-address-avatar",children:[k&&xe("img",{src:k,alt:"",width:40,height:40,draggable:!1,onError:N=>{N.currentTarget.style.display="none"}}),xe("span",{className:"sf-address-avatar-fallback",children:bi(R)})]}),zt("span",{className:"sf-address-meta",children:[xe("span",{className:"sf-address-name",children:R}),xe("span",{className:"sf-address-value",children:it(u.address)})]})]},u.address)}):xe("div",{className:"sf-empty",children:"No send history"})}),y&&!L&&!o.recipient&&xe("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as je,jsxs as Fn}from"react/jsx-runtime";function yi({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:i,openTransaction:a}=e,s=t==="error",l=t==="success";return s?Fn("div",{className:"sf-body sf-result sf-result--error",children:[je("span",{className:"sf-result-icon",children:je(gi,{size:56})}),Fn("div",{className:"sf-result-copy",children:[je("h3",{className:"sf-result-title",children:"Transaction Failed"}),je("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&je(vi,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]}):Fn("div",{className:"sf-body sf-result",children:[je("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?je(mi,{size:56}):je("span",{className:"sf-result-spinner"})}),Fn("div",{className:"sf-result-copy",children:[je("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),je("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&je(vi,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]})}function vi({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return Fn("div",{className:"sf-result-hash-card",children:[je("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),Fn("div",{className:"sf-result-hash-row",children:[je("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:it(e)}),je("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?je(gn,{size:16}):"Copy"})]})]})}import{jsx as fe,jsxs as Ve}from"react/jsx-runtime";var Eo="\u2014";function ki({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:i,walletAddress:a,networkName:s,nativeSymbol:l,nativeDecimals:c,gasEstimate:d,gasLoading:g,gasError:m,insufficientGas:p,error:v,resolvedEnv:b}=e,w=nn(t),y=n!==null?yo(n,t.quantity.decimals):"",L=r?.trim()||`Account ${(i[0]?.index??0)+1}`,u=Zt(b,a,{size:56,bg:"1A1A2E"}),C=l||(w?t.symbol:""),R=ko(t.chainId),k=d?Xa(d,R):null,N=d?Ro(d,R):null,G=A=>A!==null&&C?`${Lr(A,c)} ${C}`:Eo,F=A=>A!==void 0?`${Ya(A)} Gwei`:Eo,j=(()=>{if(!w||!d||N===null||n===null)return Eo;let A=n+N;return`${Lr(A,c)} ${C||t.symbol}`})(),D=A=>g?"\u2026":A,V=[{label:"Est. Tx Fee",value:D(G(N))},...k==="dynamic"?[{label:"Max Priority Fee",value:D(F(d?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:D(F(d?.maxFeePerGas))}]:k==="legacy"?[{label:"Gas Price",value:D(F(d?So(d):void 0))}]:[],{label:"Gas Limit",value:D(d?Za(d.gasLimit):Eo)}];return Ve("div",{className:"sf-body sf-review",children:[Ve("div",{className:"sf-review-amount",children:[fe("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:A=>{A.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Ve("span",{className:"sf-review-amount-value",children:[y,fe("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),Ve("div",{className:"sf-review-parties",children:[Ve("div",{className:"sf-review-card sf-review-party",children:[fe("span",{className:"sf-review-party-label",children:"From"}),Ve("div",{className:"sf-review-party-head",children:[fe("span",{className:"sf-review-party-avatar",children:u&&fe("img",{src:u,alt:"",width:28,height:28,draggable:!1,onError:A=>{A.currentTarget.style.display="none"}})}),fe("span",{className:"sf-review-party-name",children:L})]}),fe("span",{className:"sf-review-party-addr",children:a})]}),fe("span",{className:"sf-review-arrow","aria-hidden":!0,children:fe(ui,{size:16})}),Ve("div",{className:"sf-review-card sf-review-party",children:[fe("span",{className:"sf-review-party-label",children:"To"}),fe("span",{className:"sf-review-party-addr",children:o})]})]}),Ve("section",{className:"sf-review-card",children:[fe("h3",{className:"sf-review-section-title",children:"Summary"}),Ve("div",{className:"sf-review-row",children:[fe("span",{className:"sf-review-row-label",children:"Network"}),fe("span",{className:"sf-review-row-value",children:s})]}),V.map(A=>Ve("div",{className:"sf-review-row",children:[fe("span",{className:"sf-review-row-label",children:A.label}),fe("span",{className:"sf-review-row-value",children:A.value})]},A.label))]}),Ve("section",{className:"sf-review-card",children:[fe("h3",{className:"sf-review-section-title",children:"Total"}),Ve("div",{className:"sf-review-row",children:[fe("span",{className:"sf-review-row-label",children:"Total Amount"}),Ve("span",{className:"sf-review-row-value",children:[y," ",t.symbol]})]}),w&&Ve("div",{className:"sf-review-row",children:[fe("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),fe("span",{className:"sf-review-row-value",children:D(j)})]})]}),p&&!m&&!v&&Ve("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."]}),(m||v)&&fe("div",{className:"sf-message sf-message--error",role:"alert",children:m||v})]})}import*as Lo from"react";import{jsx as on,jsxs as xn}from"react/jsx-runtime";function Si({flow:e}){let[t,n]=Lo.useState(""),o=t.trim().toLowerCase(),r=Lo.useMemo(()=>o?e.tokens.filter(i=>i.symbol.toLowerCase().includes(o)||i.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return xn("div",{className:"sf-body sf-token-select",children:[xn("div",{className:"sf-search",children:[on(di,{size:20}),on("input",{className:"sf-search-input",value:t,onChange:i=>n(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),xn("div",{className:"sf-token-list",children:[r.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=Yn(e.resolvedEnv,i.chainId),l=e.getTokenPriceUsd?.(i);return xn("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),children:[xn("span",{className:"sf-token-left",children:[xn("span",{className:"sf-token-icon-wrap",children:[on("img",{className:"sf-token-icon",src:i.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),s&&on("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),on("span",{className:"sf-token-name",children:i.symbol})]}),xn("span",{className:"sf-token-right",children:[on("span",{className:"sf-token-balance",children:tn(i.quantity.numeric,i.quantity.decimals)}),l!==void 0&&on("span",{className:"sf-token-price",children:Co(l)})]})]},a)}),r.length===0&&on("div",{className:"sf-empty",children:"No tokens found"})]})]})}$(`.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
- `);import{jsx as Ae,jsxs as Ao}from"react/jsx-runtime";var Bc={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Po({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...i}){let a=Ri.useCallback(y=>{o?.(y),n?.(y)},[n,o]),l=ii({...i,onSuccess:o||n?a:void 0,onExit:t}),{step:c,status:d}=l,g=Dt(l.recipient.trim()),m=Yt(l.amount,l.token.quantity.decimals),p="value"in m&&m.value<=l.balanceRaw,v=d==="submitting"||d==="confirming",b=c!=="result",w=Bc[c]??"";return Ao("div",{className:re("sf-root",r),"data-step":c,children:[Ao("header",{className:"sf-header",children:[b?Ae("button",{type:"button",className:"sf-header-btn",onClick:l.back,"aria-label":"Back",children:Ae(hn,{size:24})}):Ae("span",{className:"sf-header-btn","aria-hidden":!0}),Ae("span",{className:"sf-header-title",children:w}),Ae("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:Ae(Wt,{size:24})})]}),c==="token"&&Ae(Si,{flow:l}),c==="recipient"&&Ae(xi,{flow:l}),c==="amount"&&Ae(si,{flow:l}),c==="review"&&Ae(ki,{flow:l}),c==="result"&&Ae(yi,{flow:l}),Ao("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&Ae("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitRecipient,"data-disabled":!g||void 0,"aria-disabled":!g,children:"Next"}),c==="amount"&&Ae("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitAmount,"data-disabled":!p||void 0,"aria-disabled":!p,children:"Next"}),c==="review"&&Ao("div",{className:"sf-footer-row",children:[Ae("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:l.back,disabled:v,children:"Cancel"}),Ae("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.confirmSend,disabled:v||!l.canSend||l.insufficientGas,children:v?"Sending...":"Send"})]}),c==="result"&&d==="success"&&Ae("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(l.txHash||void 0),children:"All done"}),c==="result"&&d==="error"&&Ae("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.retry,children:"Try Again"})]})]})}import*as Ci from"@radix-ui/react-popover";import{Drawer as _c}from"vaul";import{jsx as Fo,jsxs as Mc}from"react/jsx-runtime";function Ti({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:i}=en(),a=n!=null,s=e??!0,l=a?n:Mc("button",{type:"button",className:re("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[Fo(_a,{size:o?14:16}),Fo("span",{className:"wi-trigger-address",children:it(i)})]});return o?Fo(_c.Trigger,{asChild:s,children:l}):Fo(Ci.Trigger,{asChild:s,children:l})}import*as W from"react";import*as Jo from"@radix-ui/react-popover";import{Drawer as Zo}from"vaul";import to from"bignumber.js";import{useQueries as Oc}from"@tanstack/react-query";import{useMemo as Wc}from"react";var Mr="user-balance";async function Dc(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 rn(e,t,n=!0){let o=Ye[e],r=ge[e],i=[r.cross,r.bsc],a=Oc({queries:i.map(d=>({queryKey:[Mr,e,t,d],queryFn:({signal:g})=>Dc(o,d,t,g),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),s=a.some(d=>d.isLoading),l=a.some(d=>d.isError);return{tokens:Wc(()=>{let d=[];for(let g of a)g.data&&d.push(...g.data);return d},[a]),isLoading:s,isError:l}}import{useQuery as zc,useQueries as Gc}from"@tanstack/react-query";import{useMemo as Uc}from"react";var Hc="forge-holdings",$c="forge-token-image";async function jc(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 Vc(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 Ni(e,t,n=!0){let o=_r[e],{data:r,...i}=zc({queryKey:[Hc,e,t],queryFn:({signal:a})=>jc(o,t,a),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...i}}function Ii(e,t,n=!0){let o=_r[e],r=Gc({queries:t.map(a=>({queryKey:[$c,e,a],queryFn:({signal:s})=>Vc(o,a,s),enabled:n,staleTime:1/0}))});return{imageMap:Uc(()=>{let a=new Map;for(let s of r)s.data&&a.set(s.data.address,s.data.image_url);return a},[r])}}import{useQuery as qc}from"@tanstack/react-query";import{useMemo as Kc}from"react";var Or="token-stats";function It(e,t){return`${e}:${t.toLowerCase()}`}function an(e,t=!0){let n=Ye[e],{data:o,...r}=qc({queryKey:[Or,e],queryFn:async({signal:a})=>{let s=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let l=await s.json();if(l.code!==200)throw new Error(`Token stats API error: ${l.code}`);return l},enabled:t,staleTime:3e4});return{statsMap:Kc(()=>{let a=new Map;if(!o?.data)return a;for(let s of o.data){let l=It(s.chain_id,s.address);a.set(l,s)}return a},[o]),...r}}import{useQuery as Qc}from"@tanstack/react-query";var Yc="crossd-apy",Zc="https://crossd-dashboard-api.crossdefi.io/api/v1/overview";function Ei(){let{data:e,...t}=Qc({queryKey:[Yc],queryFn:async({signal:n})=>{let o=await fetch(Zc,{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 APY");return i*100},staleTime:6e4});return{apyPercent:e??null,...t}}import{useQuery as Xc}from"@tanstack/react-query";import{useMemo as Jc}from"react";var ed="token-info";function Wr(e,t){return`${t.toLowerCase()}_${e}`}function Li(e,t=!0){let n=Ye[e],{data:o,...r}=Xc({queryKey:[ed,e],queryFn:async({signal:a})=>{let s=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Failed to fetch token info: ${s.status}`);let l=await s.json();if(l.code!==200)throw new Error(`Token info API error: ${l.code}`);return l},enabled:t,staleTime:1/0});return{categoryMap:Jc(()=>{let a=new Map;if(!o?.data)return a;for(let s of o.data){let l=Wr(s.chain_id,s.address);a.set(l,s.category)}return a},[o]),...r}}import{useMemo as td}from"react";import Dr from"bignumber.js";function Ai(e,t,n){let{tokens:o,isLoading:r}=rn(e,t,n),{statsMap:i}=an(e,n);return td(()=>{let a=new Dr(0);for(let d of o){let g=i.get(It(d.chainId,d.address));if(!g)continue;let p=new Dr(d.quantity.numeric).shiftedBy(-d.quantity.decimals).multipliedBy(new Dr(g.price));p.isNaN()||(a=a.plus(p))}let s=a.toFixed(),{displayValue:l,isLowerBound:c}=Va(s);return{totalUsd:s,displayValue:l,isLowerBound:c,isLoading:r}},[o,i,r])}import{QRCodeSVG as wf}from"qrcode.react";function qe(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(c){console.error("[dapp-ui] onOutlink threw:",c);return}let i=c=>{typeof window>"u"||window.open(c,"_blank","noopener,noreferrer")};if((c=>!!c&&(typeof c=="object"||typeof c=="function")&&typeof c.then=="function")(r)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,d=g=>{if(g===null){c?.close();return}let m=g??t;if(c)try{c.location.href=m}catch{c.close(),i(m)}else i(m)};r.then(d,g=>{console.error("[dapp-ui] onOutlink rejected:",g),c?.close()});return}let s=r;if(s===null)return;i(s??t)}import*as kn from"react";import{Drawer as Rp}from"vaul";import{createContext as nd,useContext as od}from"react";var Zn=nd(null);function Me(){let e=od(Zn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}import{Drawer as rd}from"vaul";import{jsx as Pi}from"react/jsx-runtime";function Fi({asChild:e,children:t}){let{walletAddress:n}=Me(),o=t!=null,r=e??!0,i=o?t:Pi("button",{type:"button",children:it(n)});return Pi(rd.Trigger,{asChild:r,children:i})}import{Drawer as jo}from"vaul";import*as Pe from"react";import{useQueryClient as yp}from"@tanstack/react-query";import{jsx as st,jsxs as Bo}from"react/jsx-runtime";function Bi({size:e=22,className:t}){return st("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:st("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function _i({size:e=22,className:t}){return Bo("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[st("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),st("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 Mi({size:e=16,className:t}){return Bo("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[st("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"}),st("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 Oi({size:e=16,className:t}){return st("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:st("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Wi({size:e=48,className:t}){return Bo("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[st("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),st("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 Et({size:e=12,className:t}){return Bo("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:[st("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"}),st("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),st("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import gt from"bignumber.js";var ad=/^(\d{4}-\d{2}-\d{2})/;function Di(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:i}of e.map(a=>({key:ad.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 _o(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function zi(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}var id="0xe00e8bf3";function Gi(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`${id}${o}${r}`}function zr(e){return!e||e<=0n?"0":new gt(e.toString()).shiftedBy(-9).toFormat(2,gt.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Ui(e){return!e||e<=0n?"0":new gt(e.toString()).toFormat(0,gt.ROUND_DOWN)}function Hi(e){if(!e||e<=0n)return"0";let t=new gt(e.toString()).shiftedBy(-18),n=t.isLessThan(1e-4)?7:4;return t.toFormat(n,gt.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Lt(e,t){let n=new gt(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,gt.ROUND_DOWN):n.toFormat(4,gt.ROUND_DOWN)}function Gr(e){return Lt(e,0)}function sn(e,t,n){let o=new gt(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let r=new gt(e||"0").shiftedBy(-t).times(o);return r.isFinite()?`$${r.toFormat(2,gt.ROUND_DOWN)}`:null}import*as rs from"react";import{useQuery as sd}from"@tanstack/react-query";import{useMemo as Yi}from"react";var Bn={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},$i={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},ji={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"},Mo={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Vi={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},_n={dev:"https://stg-posa-api.crosstoken.io/api/v1",stage:"https://stg-posa-api.crosstoken.io/api/v1",production:"https://posa-api.crosstoken.io/api/v1"},Xn={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},qi={dev:`${Xn.dev}/portfolio`,stage:`${Xn.stage}/portfolio`,production:`${Xn.production}/portfolio`},Ki={dev:"https://stg-game-swap-api.cross.nexus/v1",stage:"https://stg-game-swap-api.cross.nexus/v1",production:"https://game-swap-api.cross.nexus/v1"},Qi={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 ld="wp:reward-pools";function Mn(e,t=!0){let n=Bn[e],{data:o,...r}=sd({queryKey:[ld,e],queryFn:async({signal:s})=>{let l=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),i=Yi(()=>o?.data.pools.filter(s=>s.pool_type==="CrossPool")??[],[o]),a=Yi(()=>o?.data.pools.filter(s=>s.pool_type==="GamePool")??[],[o]);return{crossPools:i,gamePools:a,allPools:o?.data.pools??[],...r}}import{useQuery as cd}from"@tanstack/react-query";import{useMemo as dd}from"react";var pd="wp:user-deposits";function Oo(e,t,n=!0){let o=Bn[e],r=n&&!!t,{data:i,...a}=cd({queryKey:[pd,e,t],queryFn:async({signal:l})=>{let c=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let d=await c.json();if(d.code!==200)throw new Error(`Deposits API error: ${d.code}`);return d},enabled:r,staleTime:0});return{depositMap:dd(()=>{let l=new Map;if(!i?.data.user_deposits)return l;for(let c of i.data.user_deposits)l.set(c.pool_address.toLowerCase(),c);return l},[i]),deposits:i?.data.user_deposits??[],...a}}import{useQuery as fd}from"@tanstack/react-query";import{useMemo as ud}from"react";var md="wp:token-info";function Wo(e,t=!0){let n=Ye[e],o=ge[e].cross,{data:r,...i}=fd({queryKey:[md,e],queryFn:async({signal:c})=>{let d=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:c});if(!d.ok)throw new Error(`Failed to fetch token info: ${d.status}`);let g=await d.json();if(g.code!==200)throw new Error(`Token info API error: ${g.code}`);return g},enabled:t,staleTime:300*1e3}),{byChainAddr:a,byChainSym:s}=ud(()=>{let c=new Map,d=new Map;if(!r?.data)return{byChainAddr:c,byChainSym:d};for(let g of r.data){let m=g.address.toLowerCase();c.set(`${g.chain_id}:${m}`,g),c.set(m,g);let p=g.symbol.replace(/^t/,"").toUpperCase(),v=`${g.chain_id}:${p}`;d.has(v)||d.set(v,g),d.has(p)||d.set(p,g)}return{byChainAddr:c,byChainSym:d}},[r]);return{getTokenImage:(c,d)=>{let g=c.toLowerCase(),m=a.get(`${o}:${g}`);if(m?.image)return m.image;let p=a.get(g);if(p?.image)return p.image;if(d){let v=d.replace(/^t/,"").toUpperCase(),b=s.get(`${o}:${v}`);if(b?.image)return b.image;let w=s.get(v);if(w?.image)return w.image}return""},...i}}import{useQuery as kd}from"@tanstack/react-query";import{useMemo as Do}from"react";var gd="0x70a08231",hd="0x18160ddd",bd="0x313ce567",wd=8e3;async function xd(e,t,n,o){let r=new AbortController,i=setTimeout(()=>r.abort(),wd);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 vd(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function Jn(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function vn(e,t,n,o){try{return await xd(e,"eth_call",[{to:t,data:n},"latest"],o)}catch{return}}async function yd(e,t,n,o){let[r,i,a]=await Promise.all([vn(e,n,gd+vd(t),o),vn(e,n,hd,o),vn(e,n,bd,o)]),s=Jn(r);if(s===void 0)return null;let l=Jn(a);return{balance:s,totalSupply:Jn(i),decimals:l!==void 0?Number(l):void 0}}async function Ur(e,t){let n=ge[e].cross,o=await fetch(`${Ye[e]}/v1/public/chain/info/${n}`,{cache:"no-store",signal:t});if(!o.ok)return;let r=await o.json();return("data"in r&&r.data!==void 0?Array.isArray(r.data)?r.data[0]:r.data:r)?.rpc||void 0}async function Zi(e,t,n,o){if(!t||n.length===0)return{};let r;try{r=await Ur(e,o)}catch{r=void 0}if(!r)return{};let i=await Promise.all(n.map(async s=>[s.toLowerCase(),await yd(r,t,s,o)])),a={};for(let[s,l]of i)l&&(a[s]=l);return a}var Sd="wp:withdraw-token-meta",Rd="0xc89039c5",Cd="0x95d89b41",Td="0x313ce567";function Nd(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 Id(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 Ed(e,t,n){if(t.length===0)return{};let o;try{o=await Ur(e,n)}catch{o=void 0}if(!o)return{};let r=await Promise.all(t.map(async a=>{let s=Id(await vn(o,a,Rd,n));if(!s)return[a.toLowerCase(),null];let[l,c]=await Promise.all([vn(o,s,Cd,n),vn(o,s,Td,n)]),d=Nd(l),g=Jn(c);return d?[a.toLowerCase(),{tokenAddress:s,symbol:d,decimals:g!==void 0?Number(g):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of r)s&&(i[a]=s);return i}function zo(e,t,n=!0){let r=n&&!!t,{allPools:i}=Mn(e,r),{deposits:a}=Oo(e,t,r),s=Do(()=>{let m=new Map;for(let p of i)m.set(p.pool_address.toLowerCase(),p);return m},[i]),l=Do(()=>a.filter(m=>{try{return BigInt(m.deposited_amount||"0")>0n}catch{return!1}}),[a]),c=Do(()=>l.map(m=>m.pool_address.toLowerCase()).filter(m=>!s.has(m)).sort(),[l,s]),{data:d}=kd({queryKey:[Sd,e,c],queryFn:({signal:m})=>Ed(e,c,m),enabled:r&&c.length>0,staleTime:1440*60*1e3});return{positions:Do(()=>{let m=[];for(let p of l){let v=p.pool_address.toLowerCase(),b=s.get(v);if(b){m.push({poolId:p.pool_id,poolAddress:p.pool_address,poolType:b.pool_type,tokenSymbol:b.deposit_token.symbol,tokenAddress:b.deposit_token.address,decimals:b.deposit_token.decimals,price:b.deposit_token.price,depositedRaw:p.deposited_amount});continue}let w=d?.[v];w&&m.push({poolId:p.pool_id,poolAddress:p.pool_address,poolType:"Unknown",tokenSymbol:w.symbol,tokenAddress:w.tokenAddress,decimals:w.decimals,depositedRaw:p.deposited_amount})}return m},[l,s,d])}}import{jsx as Go,jsxs as Xi}from"react/jsx-runtime";function Ut({title:e,icon:t,iconFit:n="cover",isEmpty:o,children:r}){return Xi("div",{className:"wp-svc-card",children:[Xi("div",{className:"wp-svc-card-head",children:[Go("img",{className:"wp-svc-card-icon",src:t,alt:"",style:{objectFit:n}}),Go("span",{className:"wp-svc-card-title",children:e})]}),o?Go("div",{className:"wp-svc-empty",children:"No assets yet"}):Go("div",{className:"wp-svc-items",children:r})]})}import*as de from"react";import{Fragment as es,jsx as U,jsxs as ie}from"react/jsx-runtime";var Ld=/^\d*\.?\d{0,2}$/,Ad=[100n,1000n,2000n],Pd=400;function Fd(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":`${Hi(e.gasLimit*n)} CROSS`}function Hr(e,t,n){return n==="loading"?"Estimating...":n==="error"||n==="unavailable"?"-":`${e} ${t}`.trim()}function Ji({position:e,size:t}){return e.icon?U("img",{src:e.icon,alt:"",width:t,height:t}):U("span",{children:e.tokenSymbol.slice(0,1)})}function Uo({open:e,status:t,positions:n,initialPoolAddress:o,walletAddress:r,txHash:i,error:a,copied:s=!1,estimateWithdraw:l,onClose:c,onConfirm:d,onCopyHash:g}){let[m,p]=de.useState(void 0),[v,b]=de.useState(""),[w,y]=de.useState(null),[L,u]=de.useState("idle"),C=de.useRef(0),R=de.useRef(void 0),k=de.useMemo(()=>{let z=(m??o)?.toLowerCase();return n.find(X=>X.poolAddress.toLowerCase()===z)??n[0]??null},[n,m,o]),N=de.useMemo(()=>{try{return BigInt(k?.depositedRaw??"0")}catch{return 0n}},[k?.depositedRaw]),G=k?.decimals??18,F=de.useMemo(()=>{let z=Yt(v,G);return"value"in z?z.value:null},[v,G]),j=F!==null&&F>N,D=t==="confirm"&&!!k&&F!==null&&F>0n&&!j,V=de.useCallback(()=>{b(""),y(null),u(l?"idle":"unavailable"),C.current+=1},[]);de.useEffect(()=>{e&&(p(o),V())},[e]);let A=de.useCallback(z=>{t==="confirm"&&(p(z.poolAddress),V())},[t,V]);de.useEffect(()=>{if(!e||t!=="confirm")return;if(clearTimeout(R.current),!l||!k){u("unavailable");return}if(F===null||F<=0n||j){C.current+=1,y(null),u("idle");return}let z=C.current+1;return C.current=z,u("loading"),R.current=setTimeout(()=>{l(k,F).then(X=>{C.current===z&&(y(X??null),u(X?"ready":"unavailable"))}).catch(()=>{C.current===z&&(y(null),u("error"))})},Pd),()=>clearTimeout(R.current)},[e,t,F,j,l,k]);let ne=de.useCallback(z=>{let X=z.target.value.replace(/,/g,"");(X===""||Ld.test(X))&&b(X)},[]),B=de.useCallback(z=>{b(Kn(z.toString(),G))},[G]),q=de.useCallback(z=>{let X=10n**BigInt(G),pe=(F??0n)+z*X;B(pe>N?N:pe)},[F,G,N,B]),ue=de.useCallback(()=>{B(N)},[N,B]);if(!e||!k)return null;let ae=t==="submitting",Q=zr(w?.maxPriorityFeePerGas),le=zr(w?.maxFeePerGas??w?.gasPrice),se=Ui(w?.gasLimit),K=Lt(k.depositedRaw,G);return U("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:z=>{z.target===z.currentTarget&&!ae&&c()},children:ie("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","data-status":t,"data-vaul-no-drag":!0,children:[U("div",{className:"wp-claim-grabber","aria-hidden":!0,children:U("span",{})}),ie("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?ie(es,{children:[U("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:U(Wi,{})}),ie("div",{className:"wp-claim-copy",children:[U("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),U("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),U("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:ie("div",{className:"wp-claim-list-item",children:[U("span",{children:"Tx Hash"}),ie("button",{type:"button",className:"wp-claim-hash",onClick:g,"aria-label":"Copy transaction hash",children:[U("strong",{children:zi(i)}),s?U(Oi,{}):U(Mi,{})]})]})})]}):ie(es,{children:[ie("div",{className:"wp-claim-heading",children:[U("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:t==="error"?"Withdraw Failed":"Withdraw"}),t==="error"&&U("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),n.length>1&&U("div",{className:"wp-withdraw-token-list",role:"listbox","aria-label":"Withdrawable tokens",children:n.map(z=>{let X=z.poolAddress.toLowerCase()===k.poolAddress.toLowerCase();return ie("button",{type:"button",role:"option","aria-selected":X,className:"wp-withdraw-token","data-selected":X||void 0,disabled:ae,onClick:()=>A(z),children:[U("span",{className:"wp-withdraw-token-icon","aria-hidden":!0,children:U(Ji,{position:z,size:28})}),U("span",{className:"wp-withdraw-token-symbol",children:z.tokenSymbol}),U("span",{className:"wp-withdraw-token-amount",children:Lt(z.depositedRaw,z.decimals)})]},z.poolAddress)})}),ie("div",{className:"wp-claim-reward-card","aria-label":"Deposited balance",children:[U("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:U(Ji,{position:k,size:28})}),U("strong",{className:"wp-claim-reward-symbol",children:k.tokenSymbol}),U("strong",{className:"wp-claim-reward-amount",children:K})]}),ie("div",{className:"wp-withdraw-amount-card",children:[ie("div",{className:"wp-withdraw-amount-row",children:[U("input",{className:"wp-withdraw-input",type:"text",inputMode:"decimal",autoComplete:"off",placeholder:"0",value:v,disabled:ae,onChange:ne,"aria-label":`Withdraw amount (${k.tokenSymbol})`,"aria-invalid":j||void 0}),U("span",{className:"wp-withdraw-input-symbol",children:k.tokenSymbol})]}),j&&U("p",{className:"wp-claim-error-message",children:"Amount exceeds deposited balance."}),ie("div",{className:"wp-withdraw-quick-row",role:"group","aria-label":"Quick amounts",children:[Ad.map(z=>ie("button",{type:"button",className:"wp-withdraw-quick",disabled:ae,onClick:()=>q(z),children:["+",z.toString()]},z.toString())),U("button",{type:"button",className:"wp-withdraw-quick",disabled:ae,onClick:ue,children:"MAX"})]})]}),ie("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[ie("div",{className:"wp-claim-account-row",children:[ie("div",{className:"wp-claim-account",children:[U("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),ie("strong",{children:[k.tokenSymbol," Pool"]})]}),U("span",{children:_o(r)})]}),U("span",{className:"wp-claim-divider","aria-hidden":!0}),ie("div",{className:"wp-claim-detail-list",children:[ie("div",{className:"wp-claim-detail-row",children:[U("span",{children:"Est. Tx Fee"}),U("strong",{children:Fd(w,L)})]}),ie("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[U("span",{children:"Priority Fee Per Gas"}),U("strong",{children:Hr(Q,"Gwei",L)})]}),ie("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[U("span",{children:"Max Fee Per Gas"}),U("strong",{children:Hr(le,"Gwei",L)})]}),ie("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[U("span",{children:"Gas Limit"}),U("strong",{children:Hr(se,"",L)})]})]})]})]}),ie("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&U("button",{type:"button",className:"wp-claim-secondary",onClick:c,children:t==="error"?"Close":"Cancel"}),ie("button",{type:"button",className:"wp-claim-primary",onClick:()=>{if(t==="success"){c();return}k&&F!==null&&F>0n&&!j&&d(k,F,w)},disabled:ae||(t==="confirm"||t==="error")&&(F===null||F<=0n||j),children:[t==="success"&&"Done",t==="submitting"&&U("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),U("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:U("span",{})})]})})}import*as ve from"react";import{useQueryClient as Md}from"@tanstack/react-query";import{useQuery as Bd}from"@tanstack/react-query";var _d="wp:reward-factory-info";function ts(e,t=!0){let n=Bn[e],{data:o,...r}=Bd({queryKey:[_d,e],queryFn:async({signal:i})=>{let a=await fetch(`${n}/v1/factory/info`,{cache:"no-store",signal:i});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:o?.data??null,routerAddress:o?.data.router_address??"",...r}}var Od="wp:";function ns(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Ho(){let{env:e,walletAddress:t,sendTransaction:n,estimateGas:o}=Me(),r=!!t,i=!!n,a=Md(),{routerAddress:s}=ts(e,r&&i),l=ns(s),[c,d]=ve.useState(!1),[g,m]=ve.useState(void 0),[p,v]=ve.useState("confirm"),[b,w]=ve.useState(),[y,L]=ve.useState(""),[u,C]=ve.useState(!1),R=ve.useRef(void 0);ve.useEffect(()=>()=>clearTimeout(R.current),[]);let k=ve.useCallback((A,ne)=>l?{to:l,value:0n,data:Gi(A,ne),chainId:ge[e].cross}:null,[e,l]),N=ve.useCallback(()=>{a.invalidateQueries({predicate:A=>typeof A.queryKey[0]=="string"&&A.queryKey[0].startsWith(Od)})},[a]),G=ve.useCallback(A=>{m(A),d(!0),v("confirm"),w(void 0),L(""),C(!1)},[]),F=ve.useCallback(()=>{p!=="submitting"&&(d(!1),m(void 0),v("confirm"),w(void 0),L(""),C(!1),p==="success"&&N())},[p,N]),j=ve.useCallback(async(A,ne)=>{if(!o)return null;let B=k(A.poolId,ne),q=ns(t);return!B||!q?null:o({...B,from:q})},[k,o,t]),D=ve.useCallback(async()=>{if(!(!b||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(b),C(!0),clearTimeout(R.current),R.current=setTimeout(()=>C(!1),1400)}catch{C(!1)}},[b]),V=ve.useCallback(async(A,ne,B)=>{if(!n){v("error"),L("Withdraw is not available for this wallet.");return}if(!l){v("error"),L("Withdraw contract address is not available.");return}try{v("submitting"),L("");let q=k(A.poolId,ne);if(!q){v("error"),L("Withdraw contract address is not available.");return}let ue=await n({...q,gas:B?.gasLimit&&B.gasLimit>0n?B.gasLimit:void 0,maxFeePerGas:B?.maxFeePerGas&&B.maxFeePerGas>0n?B.maxFeePerGas:void 0,maxPriorityFeePerGas:B?.maxPriorityFeePerGas&&B.maxPriorityFeePerGas>0n?B.maxPriorityFeePerGas:void 0});w(ue),v("success"),N()}catch(q){v("error"),L(q instanceof Error?q.message:"Failed to request withdraw.")}},[k,N,l,n]);return{canWithdrawInline:i,isOpen:c,initialPoolAddress:g,status:p,txHash:b,error:y,copied:u,hasEstimator:!!o,openWithdraw:G,closeWithdraw:F,estimateWithdraw:j,confirmWithdraw:V,copyHash:D}}import $r from"bignumber.js";import{Fragment as Dd,jsx as ye,jsxs as Oe}from"react/jsx-runtime";var Wd="CROSS Rewards";function os(e){return new $r(e||"0").isGreaterThan(0)}function as(){let{env:e,walletAddress:t,onOutlink:n}=Me(),o=!!t,{allPools:r}=Mn(e,o),{depositMap:i}=Oo(e,t,o),{getTokenImage:a}=Wo(e,o),s=Ho(),{positions:l}=zo(e,t,o&&s.canWithdrawInline),c=rs.useMemo(()=>l.filter(p=>p.poolType==="CrossPool").map(p=>({...p,icon:a(p.tokenAddress,p.tokenSymbol)})),[l,a]),d=(p,v)=>`${$i[e]}/rewards/${p.pool_address}?action=${v}`,g=`${Gt[e]}/reward.png`,m=r.filter(p=>{let v=i.get(p.pool_address.toLowerCase()),b=v?.deposited_amount??"0",w=v?.claimable_reward??"0";return!(new $r(b).isZero()&&new $r(w).isZero())});return Oe(Dd,{children:[ye(Ut,{title:Wd,icon:g,isEmpty:m.length===0,children:m.map(p=>{let v=i.get(p.pool_address.toLowerCase()),b=v?.deposited_amount??"0",w=v?.claimable_reward??"0",y=d(p,"withdraw"),L=d(p,"claim"),u=a(p.deposit_token.address,p.deposit_token.symbol),C=p.reward_tokens[0],R=C?a(C.address,C.symbol):"",k=p.reward_tokens.map(B=>B.symbol),N=k.length>0?`${p.deposit_token.symbol}-${k.join("/")}`:p.deposit_token.symbol,G=C?Lt(w,C.decimals):"0",F=C?.symbol??"Reward",j=sn(b,p.deposit_token.decimals,p.deposit_token.price),D=C?sn(w,C.decimals,C.price):null,V=!!v&&os(w),A=!!v&&os(b),ne=s.canWithdrawInline&&c.some(B=>B.poolAddress.toLowerCase()===p.pool_address.toLowerCase());return Oe("article",{className:"wp-item","data-side":"reward",children:[Oe("div",{className:"wp-item-body",children:[Oe("div",{className:"wp-item-line",children:[ye("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),Oe("div",{className:"wp-svc-token",children:[Oe("span",{className:"wp-token-stack","aria-hidden":!0,children:[u&&ye("img",{className:"wp-svc-token-icon",src:u,alt:""}),R&&ye("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),ye("span",{children:N})]})]}),Oe("div",{className:"wp-item-line",children:[ye("span",{className:"wp-item-label",children:"Deposited"}),Oe("div",{className:"wp-svc-token wp-svc-token--amount",children:[u&&ye("img",{className:"wp-svc-token-icon",src:u,alt:""}),Oe("div",{className:"wp-svc-amount",children:[ye("span",{className:"wp-svc-amount-main",children:Lt(b,p.deposit_token.decimals)}),j&&ye("span",{className:"wp-item-usd",children:j})]})]})]}),Oe("div",{className:"wp-item-line",children:[Oe("span",{className:"wp-item-label",children:["Claimable (",F,")"]}),Oe("div",{className:"wp-svc-token wp-svc-token--amount",children:[R&&ye("img",{className:"wp-svc-token-icon",src:R,alt:""}),Oe("div",{className:"wp-svc-amount",children:[ye("span",{className:"wp-svc-amount-main",children:G}),D&&ye("span",{className:"wp-item-usd",children:D})]})]})]})]}),Oe("div",{className:"wp-item-tags",children:[ne?ye("button",{type:"button",className:"wp-tag wp-tag--muted","data-disabled":!A||void 0,"aria-disabled":!A||void 0,onClick:()=>{A&&s.openWithdraw(p.pool_address)},children:ye("span",{className:"wp-tag-label",children:"Withdraw"})}):Oe("a",{className:"wp-tag wp-tag--muted",href:y,target:"_blank",rel:"noopener noreferrer",onClick:B=>qe(B,y,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:p,userDeposit:v}},n),children:[ye("span",{className:"wp-tag-label",children:"Withdraw"}),ye(Et,{size:12,className:"wp-tag-icon"})]}),Oe("a",{className:"wp-tag wp-tag--mint","data-disabled":!V||void 0,"aria-disabled":!V||void 0,href:V?L:void 0,target:V?"_blank":void 0,rel:V?"noopener noreferrer":void 0,onClick:B=>{if(!V){B.preventDefault();return}qe(B,L,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:p,userDeposit:v}},n)},children:[ye("span",{className:"wp-tag-label",children:"Claim"}),ye(Et,{size:12,className:"wp-tag-icon"})]})]})]},p.pool_address)})}),ye(Uo,{open:s.isOpen,status:s.status,positions:c,initialPoolAddress:s.initialPoolAddress,walletAddress:t,txHash:s.txHash,error:s.error,copied:s.copied,estimateWithdraw:s.hasEstimator?s.estimateWithdraw:void 0,onClose:s.closeWithdraw,onConfirm:s.confirmWithdraw,onCopyHash:s.copyHash})]})}import*as is from"react";import{Fragment as Gd,jsx as Ze,jsxs as Xt}from"react/jsx-runtime";var zd="Points";function ss(){let{env:e,walletAddress:t,onOutlink:n}=Me(),o=!!t,{getTokenImage:r}=Wo(e,o),i=Ho(),{positions:a}=zo(e,t,o),s=is.useMemo(()=>a.filter(d=>d.poolType!=="CrossPool").map(d=>({...d,icon:r(d.tokenAddress,d.tokenSymbol)})),[a,r]),l=`${Gt[e]}/point.png`,c=ji[e];return Xt(Gd,{children:[Ze(Ut,{title:zd,icon:l,isEmpty:s.length===0,children:s.map(d=>{let g=d.price?sn(d.depositedRaw,d.decimals,d.price):null;return Xt("article",{className:"wp-item","data-side":"reward",children:[Xt("div",{className:"wp-item-body",children:[Xt("div",{className:"wp-item-line",children:[Ze("span",{className:"wp-item-label",children:"Token"}),Xt("div",{className:"wp-svc-token",children:[d.icon&&Ze("img",{className:"wp-svc-token-icon",src:d.icon,alt:""}),Ze("span",{children:d.tokenSymbol})]})]}),Xt("div",{className:"wp-item-line",children:[Ze("span",{className:"wp-item-label",children:"Deposited"}),Xt("div",{className:"wp-svc-token wp-svc-token--amount",children:[d.icon&&Ze("img",{className:"wp-svc-token-icon",src:d.icon,alt:""}),Xt("div",{className:"wp-svc-amount",children:[Ze("span",{className:"wp-svc-amount-main",children:Lt(d.depositedRaw,d.decimals)}),g&&Ze("span",{className:"wp-item-usd",children:g})]})]})]})]}),Ze("div",{className:"wp-item-tags",children:i.canWithdrawInline?Ze("button",{type:"button",className:"wp-tag wp-tag--muted",onClick:()=>i.openWithdraw(d.poolAddress),children:Ze("span",{className:"wp-tag-label",children:"Withdraw"})}):Xt("a",{className:"wp-tag wp-tag--muted",href:c,target:"_blank",rel:"noopener noreferrer",onClick:m=>qe(m,c,{category:"portfolio",origin:"portfolio-points",payload:{position:d}},n),children:[Ze("span",{className:"wp-tag-label",children:"Withdraw"}),Ze(Et,{size:12,className:"wp-tag-icon"})]})})]},d.poolAddress)})}),Ze(Uo,{open:i.isOpen,status:i.status,positions:s,initialPoolAddress:i.initialPoolAddress,walletAddress:t,txHash:i.txHash,error:i.error,copied:i.copied,estimateWithdraw:i.hasEstimator?i.estimateWithdraw:void 0,onClose:i.closeWithdraw,onConfirm:i.confirmWithdraw,onCopyHash:i.copyHash})]})}import*as jr from"react";import{useQuery as Ud}from"@tanstack/react-query";var Hd="wp:stake-info";function ls(e,t,n=!0){let o=_n[e],r=n&&!!t,{data:i,...a}=Ud({queryKey:[Hd,e,t],queryFn:async({signal:l})=>{let c=await fetch(`${o}/stake/${t}`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let d=await c.json();if(d.code!==0&&d.code!==200)throw new Error(`Stake info API error: ${d.code}`);return d},enabled:r,staleTime:0});return{stakeInfo:i?.data,...a}}import{useQuery as $d}from"@tanstack/react-query";var jd="wp:stake-rewards",Vd=31;function cs(e,t,n=!0){let o=_n[e],r=n&&!!t,{data:i,...a}=$d({queryKey:[jd,e,t],queryFn:async({signal:s})=>{let l=await fetch(`${o}/rewards/${t}?limit=${Vd}`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Stake rewards fetch failed: ${l.status}`);let c=await l.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:r,staleTime:0});return{latestReward:i?.[0]??null,aprAccrued:Di(i),...a}}import{useQuery as qd}from"@tanstack/react-query";var Kd="wp:network-stats";function ds(e,t=!0){let n=_n[e],{data:o,...r}=qd({queryKey:[Kd,e],queryFn:async({signal:a})=>{let s=await fetch(`${n}/network/stats`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Network stats fetch failed: ${s.status}`);let l=await s.json();if(l.code!==0&&l.code!==200)throw new Error(`Network stats API error: ${l.code}`);return l},enabled:t,staleTime:0});return{networkStats:o?.data,...r}}import{useQuery as Qd}from"@tanstack/react-query";var Yd="wp:staking-onchain";function ps(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...i}=Qd({queryKey:[Yd,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 fs}from"react";import Zd from"bignumber.js";function us(e){return e?.trim().toUpperCase()==="CROSS"}function ms(e){return new Zd(e||"0").isGreaterThan(0)}function $o(e,t,n=!0){let{allPools:o}=Mn(e,n),r=fs(()=>{for(let c of o)for(let d of[c.deposit_token,...c.reward_tokens])if(us(d?.symbol)&&ms(d.price))return d.price},[o]),i=n&&r===void 0,{tokens:a}=rn(e,t,i),{statsMap:s}=an(e,i),l=ge[e].cross;return fs(()=>{if(r)return r;let c=a.find(d=>d.chainId===l&&us(d.symbol));if(c){let d=s.get(It(c.chainId,c.address));if(d&&ms(d.price))return d.price}return"0"},[r,a,s,l])}import ln from"bignumber.js";import{Fragment as Jd,jsx as lt,jsxs as At}from"react/jsx-runtime";var Xd="CROSS Staking";function gs(e){if(!e)return"\u2014";let t=new ln(e);return t.isFinite()?`${t.toFormat(2,ln.ROUND_DOWN)}%`:"\u2014"}function hs(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=Me(),r=!!t,{stakeInfo:i}=ls(e,t,r),{latestReward:a,aprAccrued:s}=cs(e,t,r),{networkStats:l}=ds(e,r),{onchain:c}=ps(t,o,r),d=$o(e,t,r),g=`${Gt[e]}/cross-staking.png`,m=qi[e],p=i?.total_stake??"0",v=jr.useMemo(()=>c?new ln(c.earnedWei.toString()).shiftedBy(-18).toString(10):a?.cumulative_earned??i?.rewards_earned??"0",[c,a,i]),b=jr.useMemo(()=>c?new ln(c.stakedWei.toString()).shiftedBy(-18):new ln(p),[c,p]),w=s!==void 0?new ln(s):void 0,y=i?.days_since_first_stake,L=w!==void 0&&w.isFinite()&&b.isGreaterThan(0)&&y!==null&&y!==void 0?w.div(b).times(365).div(Math.max(1,y)).times(100):void 0,u=!(new ln(p).isZero()&&new ln(v).isZero()),C=Xn[e],R=sn(p,0,d),k=sn(v,0,d);return lt(Ut,{title:Xd,icon:g,iconFit:"contain",isEmpty:!1,children:At("article",{className:"wp-item","data-side":"stake",children:[lt("div",{className:"wp-item-body",children:u?At(Jd,{children:[At("div",{className:"wp-item-line",children:[lt("span",{className:"wp-item-label",children:"Staked"}),At("div",{className:"wp-svc-amount",children:[At("span",{className:"wp-svc-amount-main",children:[Gr(p)," CROSS"]}),R&&lt("span",{className:"wp-item-usd",children:R})]})]}),At("div",{className:"wp-item-line",children:[lt("span",{className:"wp-item-label",children:"Rewards Earned"}),At("div",{className:"wp-svc-amount",children:[At("span",{className:"wp-svc-amount-main",children:[Gr(v)," CROSS"]}),k&&lt("span",{className:"wp-item-usd",children:k})]})]}),At("div",{className:"wp-item-line",children:[lt("span",{className:"wp-item-label",children:"My APR"}),lt("span",{children:gs(L?.toString(10))})]})]}):At("div",{className:"wp-item-line",children:[lt("span",{className:"wp-item-label",children:"Delegation APR"}),lt("span",{children:gs(l?.apr)})]})}),lt("div",{className:"wp-item-tags",children:At("a",{className:"wp-tag wp-tag--mint",href:u?m:C,target:"_blank",rel:"noopener noreferrer",onClick:N=>qe(N,u?m:C,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:i,networkStats:l}},n),children:[lt("span",{className:"wp-tag-label",children:u?"Manage":"Stake Now"}),lt(Et,{size:12,className:"wp-tag-icon"})]})})]})})}import*as Vr from"react";import{useQuery as ep}from"@tanstack/react-query";var tp="wp:game-swap-pools";function bs(e,t,n=!0){let o=Ki[e],r=n&&!!t,{data:i,...a}=ep({queryKey:[tp,e,t],queryFn:async({signal:s})=>{let l=await fetch(`${o}/addresses/${t}/portfolio`,{cache:"no-store",signal:s});if(!l.ok)throw new Error(`Game-swap portfolio fetch failed: ${l.status}`);return(await l.json()).pools??[]},enabled:r,staleTime:0});return{pools:i??[],...a}}import{useQuery as np}from"@tanstack/react-query";var op="wp:game-swap-lp-balances";function ws(e,t,n,o){let r=[...n].map(l=>l.toLowerCase()).sort(),i=!!t&&r.length>0,{data:a,...s}=np({queryKey:[op,e,t,r,!!o],queryFn:async({signal:l})=>{let c=o?await o(r):await Zi(e,t,r,l),d={};for(let[g,m]of Object.entries(c))d[g.toLowerCase()]=m;return d},enabled:i,staleTime:0});return{balances:a??{},...s}}import Ht from"bignumber.js";import{jsx as ht,jsxs as Pt}from"react/jsx-runtime";var rp="Gametoken LP",vs=18,ap=new Ht("0.0001");function xs(e){return e?.trim().toUpperCase()==="CROSS"}function ip(e){return e&&e>0?e:vs}function sp(e){let t=xs(e.token_a?.symbol)&&!xs(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=ip(t?e.token_a?.decimals:e.token_b?.decimals),r=new Ht(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new Ht(0):r.times(2)}function lp(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??vs,i,a;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let s=new Ht(t.balance.toString()),l=new Ht(t.totalSupply.toString()),c=s.div(l);i=c.times(100);let d=c.times(sp(e));if(d.isGreaterThan(0)){let g=new Ht(e.quote_usd??e.cross_usd??"0");a=g.isGreaterThan(0)?`$${d.times(g).toFormat(2,Ht.ROUND_DOWN)}`:`${d.toFormat(4,Ht.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:i,valueText:a}}function ys(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=Me(),r=!!t,{pools:i}=bs(e,t,r),a=Vr.useMemo(()=>i.map(m=>m.pair_address).filter(Boolean),[i]),{balances:s}=ws(e,t,a,o),l=`${Gt[e]}/dex.png`,c=Object.keys(s).length>0,d=Vr.useMemo(()=>{let m=i.map(p=>lp(p,s[p.pair_address?.toLowerCase()]));return c?m.filter(p=>p.lpAmountRaw?new Ht(p.lpAmountRaw).shiftedBy(-p.lpDecimals).isGreaterThanOrEqualTo(ap):!1):m},[i,s,c]),g=m=>{let p=m.token_a?.address??m.pair_address;return`${Qi[e]}/tokens/${p}?trade=deposit`};return ht(Ut,{title:rp,icon:l,iconFit:"contain",isEmpty:d.length===0,children:d.map(m=>{let{pool:p}=m,v=g(p),b=`${m.tokenASymbol} / ${m.tokenBSymbol}`,w=p.token_a?.logo_url,y=p.token_b?.logo_url;return Pt("article",{className:"wp-item","data-side":"game-swap",children:[Pt("div",{className:"wp-item-body",children:[Pt("div",{className:"wp-item-line",children:[ht("span",{className:"wp-item-label",children:"Pool"}),Pt("div",{className:"wp-svc-token",children:[Pt("span",{className:"wp-token-stack","aria-hidden":!0,children:[w&&ht("img",{className:"wp-svc-token-icon",src:w,alt:""}),y&&ht("img",{className:"wp-svc-token-icon",src:y,alt:""})]}),ht("span",{children:b})]})]}),m.lpAmountRaw!==void 0&&Pt("div",{className:"wp-item-line",children:[ht("span",{className:"wp-item-label",children:"My LP"}),Pt("span",{children:[Lt(m.lpAmountRaw,m.lpDecimals)," LP"]})]}),m.sharePercent!==void 0&&Pt("div",{className:"wp-item-line",children:[ht("span",{className:"wp-item-label",children:"Pool Share"}),Pt("span",{children:[m.sharePercent.toFormat(2,Ht.ROUND_DOWN),"%"]})]}),m.valueText!==void 0&&Pt("div",{className:"wp-item-line",children:[ht("span",{className:"wp-item-label",children:"Value"}),ht("span",{children:m.valueText})]})]}),ht("div",{className:"wp-item-tags",children:Pt("a",{className:"wp-tag wp-tag--mint",href:v,target:"_blank",rel:"noopener noreferrer",onClick:L=>qe(L,v,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:p}},n),children:[ht("span",{className:"wp-tag-label",children:"Manage"}),ht(Et,{size:12,className:"wp-tag-icon"})]})})]},p.pair_address)})})}import dn from"bignumber.js";import{useMemo as gp}from"react";import{useQuery as cp}from"@tanstack/react-query";var dp="wp:forge-pools";function ks(e,t,n=!0){let o=Mo[e],r=n&&!!t,{data:i,...a}=cp({queryKey:[dp,e,t],queryFn:async()=>{let l=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!l.ok)throw new Error(`forge pools fetch failed: ${l.status}`);return(await l.json()).data?.items??[]},enabled:r,staleTime:0}),s=i??[];return{pools:s,isEmpty:s.length===0,...a}}import{useQueries as pp}from"@tanstack/react-query";import{useMemo as fp}from"react";var up="wp:forge-token-detail";async function mp(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Ss(e,t,n=!0){let o=Mo[e],r=pp({queries:t.map(s=>({queryKey:[up,e,s],queryFn:()=>mp(o,s),enabled:n&&!!s,staleTime:3e4}))}),i=fp(()=>{let s=new Map;for(let l=0;l<r.length;l++){let c=r[l]?.data,d=t[l];c&&d&&s.set(d.toLowerCase(),c)}return s},[r,t]),a=r.some(s=>s.isLoading);return{detailMap:i,isLoading:a}}import{jsx as Xe,jsxs as cn}from"react/jsx-runtime";var hp="Forge",Rs=18,bp="https://contents.crosstoken.io/wallet/token/images/FT.png";function wp(e){if(!e||e==="0")return"0";let t=new dn(e).shiftedBy(-Rs);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,dn.ROUND_DOWN):t.toFormat(4,dn.ROUND_DOWN)}function xp(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 vp(e,t,n){let o=new dn(n||"0");if(!o.isGreaterThan(0))return null;let r=new dn(e.total_supply||"0"),i=new dn(e.lp_balance||"0"),a=new dn(t?.reserve_b||"0").shiftedBy(-Rs);if(!r.isGreaterThan(0)||!i.isGreaterThan(0)||!a.isGreaterThan(0))return null;let s=a.times(2),c=i.div(r).times(s).times(o);return c.isFinite()?`$${c.toFormat(2,dn.ROUND_DOWN)}`:null}function Cs(){let{env:e,walletAddress:t,onOutlink:n}=Me(),o=!!t,{pools:r,isEmpty:i}=ks(e,t,o),a=gp(()=>r.map(g=>g.token.address),[r]),{detailMap:s}=Ss(e,a,o&&a.length>0),l=$o(e,t,o),c=g=>`${Vi[e]}/forge/token/${g.token.address}`,d=`${Gt[e]}/forge.png`;return Xe(Ut,{title:hp,icon:d,iconFit:"contain",isEmpty:i,children:r.map(g=>{let m=s.get(g.token.address.toLowerCase()),p=m?.image_url||m?.image||g.token.image||bp,v=m?.symbol||g.token.symbol,b=c(g),w=vp(g,m,l);return cn("a",{className:"wp-item","data-side":"lp",href:b,target:"_blank",rel:"noopener noreferrer",onClick:y=>qe(y,b,{category:"portfolio",origin:"portfolio-forge",payload:{pool:g,tokenDetail:m}},n),children:[cn("div",{className:"wp-item-body",children:[cn("div",{className:"wp-item-line",children:[Xe("span",{className:"wp-item-label",children:"Asset"}),cn("div",{className:"wp-svc-token",children:[Xe("img",{className:"wp-svc-token-icon",src:p,alt:""}),Xe("span",{children:v}),m?.name&&Xe("span",{className:"wp-token-subtle",children:m.name})]})]}),cn("div",{className:"wp-item-line",children:[Xe("span",{className:"wp-item-label",children:"LP Balance"}),Xe("div",{className:"wp-svc-token wp-svc-token--amount",children:cn("div",{className:"wp-svc-amount",children:[Xe("span",{className:"wp-svc-amount-main",children:wp(g.lp_balance)}),w&&Xe("span",{className:"wp-item-usd",children:w})]})})]}),cn("div",{className:"wp-item-line",children:[Xe("span",{className:"wp-item-label",children:"Ownership"}),Xe("span",{className:"wp-line-value",children:xp(g.pool_ownership)})]})]}),Xe("div",{className:"wp-item-tags",children:cn("span",{className:"wp-tag wp-tag--muted",children:[Xe("span",{className:"wp-tag-label",children:"Withdraw"}),Xe(Et,{size:12,className:"wp-tag-icon"})]})})]},g.pair_address)})})}$(`.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-svc-empty{display:flex;align-items:center;justify-content:center;min-height:74px;padding:20px 16px;background:var(--wp-card);border-radius:12px;box-shadow:var(--wp-card-shadow, none);font-size:13px;font-weight:400;line-height:1.3;letter-spacing:0;color:var(--wp-text-30);box-sizing:border-box}.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
- `);import{Fragment as Sp,jsx as ke,jsxs as yn}from"react/jsx-runtime";var qr=2,kp="wp:";function On({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:i=!0,variant:a="embed",className:s,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:d,sendTransaction:g,estimateGas:m,sections:p}){let v=$e(e),b=Pe.useCallback(q=>!p||p.includes(q),[p]),w=!!n,y=yp(),[L,u]=Pe.useState(qr),[C,R]=Pe.useState(!1),[k,N]=Pe.useState(!1),G=Pe.useRef(void 0),F=Pe.useCallback(()=>{y.invalidateQueries({predicate:q=>typeof q.queryKey[0]=="string"&&q.queryKey[0].startsWith(kp)})},[y]),j=Pe.useCallback(()=>{F(),R(!0),setTimeout(()=>R(!1),600),u(qr)},[F]);Pe.useEffect(()=>{if(!w)return;let q=setInterval(()=>{u(ue=>ue<=1?(j(),qr):ue-1)},1e3);return()=>clearInterval(q)},[w,j]);let D=Pe.useCallback(()=>{r?.()},[r]),V=w?Zt(v,n,{size:64}):void 0,A=Pe.useCallback(async()=>{if(!(k||!n))try{await navigator.clipboard.writeText(n),N(!0),clearTimeout(G.current),G.current=setTimeout(()=>N(!1),2e3)}catch{}},[n,k]);Pe.useEffect(()=>()=>clearTimeout(G.current),[]);let ne=Pe.useMemo(()=>({env:v,theme:t,open:!0,walletAddress:n,close:D,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:d,sendTransaction:g,estimateGas:m}),[v,t,n,D,l,c,d,g,m]),B=yn(Sp,{children:[i&&yn("div",{className:"wp-header",children:[yn("div",{className:"wp-header-account",children:[r&&ke("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:r,children:ke(Bi,{})}),ke("span",{className:"wp-header-avatar","aria-hidden":!0,children:V&&ke("img",{src:V,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&yn("div",{className:"wp-header-account-meta",children:[o&&ke("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&yn("button",{type:"button",className:"wp-header-address-btn",onClick:A,"aria-label":"Copy wallet address",children:[ke("span",{className:"wp-header-address",children:_o(n)}),ke("span",{className:"wp-header-address-copy","data-copied":k,children:k?ke(gn,{size:14}):ke(jn,{size:14})})]})]})]}),yn("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio",onClick:j,children:[ke(_i,{className:C?"wp-spin-once":void 0}),w&&ke("span",{className:"wp-refresh-badge",children:L})]})]}),ke("div",{className:"wp-body",children:yn("div",{className:"wp-body-inner",children:[b("rewards")&&ke(as,{}),b("points")&&ke(ss,{}),b("staking")&&ke(hs,{}),b("gameSwap")&&ke(ys,{}),b("forge")&&ke(Cs,{})]})})]});return ke(Zn.Provider,{value:ne,children:a==="none"?B:ke("div",{className:re(a==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:B})})}import{jsx as Kr,jsxs as Ts}from"react/jsx-runtime";function Ns({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s}=Me();return Ts(jo.Portal,{children:[Kr(jo.Overlay,{className:"wp-overlay"}),Ts(jo.Content,{className:re("wp-fullscreen",e),"data-theme":n,children:[Kr(jo.Title,{className:"wp-sr-only",children:"Portfolio"}),Kr(On,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s})]})]})}import{jsx as Is}from"react/jsx-runtime";function Cp({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,children:d}){let g=$e(e),m=o!==void 0,[p,v]=kn.useState(!1),b=m?o:p,w=kn.useCallback(u=>{m||v(u),r?.(u)},[m,r]),y=kn.useCallback(()=>w(!1),[w]),L=kn.useMemo(()=>({env:g,theme:t,open:b,walletAddress:n,close:y,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c}),[g,t,b,n,y,i,a,s,l,c]);return Is(Zn.Provider,{value:L,children:Is(Rp.Root,{direction:"bottom",open:b,onOpenChange:w,noBodyStyles:!0,children:d})})}var Es=Object.assign(Cp,{Trigger:Fi,Content:Ns});var Ls=["rewards","points","staking","gameSwap","forge"];import*as E from"react";import{createPortal as Wn}from"react-dom";import $t from"bignumber.js";import{jsx as bt,jsxs as Tp}from"react/jsx-runtime";function As({size:e=20,className:t}){return Tp("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:[bt("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),bt("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function Ps({size:e=16,className:t}){return bt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:bt("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 Fs({size:e=16,className:t}){return bt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:bt("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 Bs({size:e=20,className:t}){return bt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:bt("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function _s({size:e=16,className:t}){return bt("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:bt("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ms({size:e=12,className:t}){return bt("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:bt("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 P from"react";import Ds from"bignumber.js";function Os(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ws(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,Ds.ROUND_DOWN).toFixed()}function Np(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 Ip(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new Ds(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:Os(t)&&Os(n)?e.lastChangedBy==="to"?{fromAmount:Ws(r.multipliedBy(n).dividedBy(t))}:{toAmount:Ws(r.multipliedBy(t).dividedBy(n))}:Np(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function zs({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):Ip(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var Gs=15,Ep=18,js="cross_bridge_terms_accepted",Lp=3600*24*365;function Ap(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,Gs);let r=t.slice(0,o).slice(0,Gs),i=t.slice(o+1).slice(0,Ep);return`${r}.${i}`}function Pp(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${js}=true`)}function Fp(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${js}=true`,"Path=/",`Max-Age=${Lp}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function Bp(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 Us(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function _p(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([Us(e.symbol),Us(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function Ft(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Vo(e){return e[0]}function Qr(e,t,n,o){if(n&&!Ft(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??Vo(e);let i=e.findIndex(s=>Ft(s,t)),a=i>=0?e[i+1]:void 0;return a&&!Ft(a,t)?a:e.find(s=>!Ft(s,t))??t}function Hs({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 qo(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),...qo(n.cause,t+1),...qo(n.data,t+1),...qo(n.error,t+1)]}function Yr(e){let t=qo(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 $s(e,t){return Yr(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
9
- `)[0]?.trim()||t}function Vs(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:i,approveBridge:a,history:s=[],initialSlippage:l="1",termsUrl:c=An,getQuote:d,submitBridge:g,onSubmitted:m,onSuccess:p,onFailed:v,onExit:b}=e,w=P.useMemo(()=>zs({getQuote:d,submitBridge:g}),[d,g]),[y,L]=P.useState("form"),[u,C]=P.useState(n??Vo(t)),[R,k]=P.useState(()=>Qr(t,n??Vo(t),o,r)),[N,G]=P.useState(""),[F,j]=P.useState(""),[D,V]=P.useState("from"),[A,ne]=P.useState(l),[B,q]=P.useState(null),ue=P.useMemo(()=>_p(u,R),[u,R]),ae=P.useMemo(()=>ue?"1":A==="auto"?Bp(B?.priceImpact):A,[ue,A,B?.priceImpact]),[Q,le]=P.useState(""),[se,K]=P.useState("idle"),[z,X]=P.useState(""),[Fe,pe]=P.useState(null),[xt,Te]=P.useState([]),[Jt,vt]=P.useState(!1),[Qe,qt]=P.useState(Pp),[Ne,he]=P.useState(null),[ct,Ie]=P.useState(!1),[Be,be]=P.useState(null),[Bt,yt]=P.useState(null),[_t,Je]=P.useState(!1),[Mt,et]=P.useState(!1),we=P.useRef(0),tt=P.useRef(null),dt=P.useCallback(()=>{tt.current&&(clearTimeout(tt.current),tt.current=null)},[]),De=P.useCallback(_=>{dt(),yt(_)},[dt]);P.useEffect(()=>dt,[dt]),P.useEffect(()=>{let _=t.find(Ge=>Ft(Ge,u))??Vo(t),Ce=_?r?.(_,t):void 0,H=Ce?.find(Ge=>Ft(Ge,R))??(Ce?void 0:t.find(Ge=>Ft(Ge,R)))??Qr(t,_,void 0,r);C(_),k(H)},[r,t,u,R]);let kt=P.useCallback((_,Ce)=>{let H=Ap(_);if(!H){we.current+=1,G(""),j(""),V(Ce),q(null),le(""),K("idle");return}Ce==="from"?G(H):j(H),V(Ce),le("")},[]),me=P.useCallback(()=>{we.current+=1,G(""),j(""),V("from"),q(null),le(""),X(""),K("idle"),he(null),Ie(!1),be(null),Je(!1),De(null)},[De]),Se=P.useCallback(_=>{Ft(_,u)||(C(_),k(Qr(t,_,void 0,r)),me())},[u,r,me,t]),Ot=P.useCallback(_=>{Ft(_,R)||Ft(_,u)||(k(_),me())},[u,me,R]),St=P.useMemo(()=>u?r?.(u,t)??t.filter(_=>!Ft(_,u)):[],[u,r,t]),ze=P.useCallback(()=>{u?.balance&&kt(u.balance,"from")},[u?.balance,kt]),pt=P.useCallback(()=>{!u||!R||(C(R),k(u),me())},[u,me,R]),Rt=P.useCallback(()=>{we.current+=1,G(""),j(""),V("from"),q(null),le(""),X("")},[]);P.useEffect(()=>{if(!u||!R)return;if(!N&&!F){q(null),le(""),K(H=>H==="quoting"?"idle":H);return}let _=++we.current,Ce=Hs({fromToken:u,toToken:R,fromAmount:N,toAmount:F,lastChangedBy:D,slippage:A});K(H=>H==="submitting"?H:w.canQuote?"quoting":"idle"),(async()=>{try{let H=await w.getQuote(Ce);if(we.current!==_)return;H.fromAmount!==void 0&&D==="to"&&G(H.fromAmount),H.toAmount!==void 0&&D==="from"&&j(H.toAmount),q(H.summary??null),le(H.error??"")}catch(H){if(we.current!==_)return;le(H instanceof Error?H.message:"Failed to quote bridge.")}finally{we.current===_&&K(H=>H==="quoting"?"idle":H)}})()},[N,u,D,w,A,F,R]);let Re=P.useCallback(()=>!u||!R?null:Hs({fromToken:u,toToken:R,fromAmount:N,toAmount:F,lastChangedBy:D,slippage:ae}),[ae,N,u,D,F,R]),Ee=P.useCallback(async(_,Ce)=>{X(""),Je(!1),Ie(!1),K("submitting");try{if(!Ce?.skipApprovalCheck&&i){let Ge=await i(_);if(Ge){he(Ge),be(_),K("idle");return}}he(null),be(null),De("processing");let H=await w.submitBridge(_);pe(H),K("success"),Te(Ge=>[{id:H.txHash,timestamp:new Date().toISOString(),txHash:H.txHash,fromToken:H.fromToken,toToken:H.toToken,fromAmount:H.fromAmount,toAmount:H.toAmount,summary:B??void 0,status:"pending"},...Ge.filter(ft=>ft.txHash!==H.txHash)]),Rt(),et(!0),De(null),Je(!0),m?.(H),p?.(H)}catch(H){if(De(null),Yr(H)){K("idle");return}let Ge=$s(H,"Failed to submit bridge.");X(Ge),K("error"),v?.({message:Ge})}},[i,v,m,p,w,Rt,De,B]),I=P.useCallback(async()=>{if(Q)return;let _=Re();if(_){if(!Qe){be(_),vt(!0);return}await Ee(_)}},[Re,Q,Ee,Qe]),J=P.useCallback(async()=>{let _=Be??Re();_&&(Fp(),qt(!0),vt(!1),await Ee(_))},[Re,Be,Ee]),ce=P.useCallback(()=>{vt(!1),be(null)},[]),nt=P.useCallback(async()=>{if(!(se==="submitting"||!Ne||!Be||!a)){X(""),K("submitting");try{await a(Be,Ne),he(null),K("idle"),Ie(!0)}catch(_){if(Yr(_)){K("idle");return}let Ce=$s(_,"Failed to approve token.");X(Ce),K("error"),v?.({message:Ce})}}},[Ne,a,v,Be,Ee,se]),Kt=P.useCallback(()=>{se!=="submitting"&&(he(null),Ie(!1),be(null),K("idle"))},[se]),ot=P.useCallback(async()=>{if(se==="submitting")return;let _=Be??Re();if(!_){Ie(!1),X("Bridge input is no longer available. Please try again."),K("error");return}Ie(!1),await Ee(_,{skipApprovalCheck:!0})},[Re,Be,Ee,se]),Sn=P.useCallback(()=>{Je(!1)},[]),Qt=P.useCallback(_=>{L(_),_==="history"&&et(!1)},[]),Rn=P.useCallback(()=>{if(y==="history"){Qt("form");return}b?.()},[b,Qt,y]),so=P.useMemo(()=>[...s,...xt.filter(_=>!s.some(Ce=>Ce.txHash===_.txHash))],[s,xt]);return{step:y,setStep:Qt,status:se,error:z,quoteError:Q,fromToken:u,toToken:R,tokens:t,availableToTokens:St,fromAmount:N,toAmount:F,lastChangedBy:D,slippage:A,effectiveSlippage:ae,slippageLocked:ue,setSlippage:ne,summary:B,history:so,submitted:Fe,canSubmit:w.canSubmit,termsOpen:Jt,approvalInfo:Ne,approvalSuccessOpen:ct,approveBridge:a,pendingSubmitInput:Be,submitToast:Bt,successDialogOpen:_t,dismissSuccessDialog:Sn,hasNewHistory:Mt,termsUrl:c,setFromToken:C,setToToken:k,selectFromToken:Se,selectToToken:Ot,setAmount:kt,setMax:ze,swapTokens:pt,submit:I,confirmTerms:J,cancelTerms:ce,confirmApproval:nt,cancelApproval:Kt,continueAfterApproval:ot,back:Rn}}$(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: #1e232e;--bf-toast-color: rgba(255, 255, 255, .85);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover:not(:disabled){color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip:disabled{cursor:default}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-token-pill:hover:not(:disabled):not([data-locked=true]){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-pill[data-locked=true]{cursor:default}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-picker-overlay{--bf-bg: #1e232e;--bf-surface: rgba(255, 255, 255, .05);--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .07);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-token-picker-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-surface: rgba(18, 18, 18, .05);--bf-surface-hover: rgba(18, 18, 18, .08);--bf-border: rgba(18, 18, 18, .07);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-token-picker{display:flex;width:min(480px,calc(100vw - 48px));height:min(466px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #0006;box-sizing:border-box}.bf-token-picker-handle{display:none}.bf-token-picker-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--bf-border);box-sizing:border-box}.bf-token-picker-head h3{margin:0;color:var(--bf-text-high);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-token-picker-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--bf-text-medium);cursor:pointer}.bf-token-picker-close:hover{color:var(--bf-text-high)}.bf-token-search{display:flex;min-height:48px;flex-shrink:0;align-items:center;gap:8px;margin:16px 24px;padding:12px 16px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, rgba(18, 18, 18, .05));color:var(--bf-text-low);box-sizing:border-box}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:auto;min-height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-accent-primary-low, #e7f9f8)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-slippage-apply:disabled{cursor:not-allowed;opacity:.5;filter:none}.bf-slippage-message{margin:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-message[data-variant=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-slippage-message[data-variant=error]{color:var(--ds-system-red-default, #da0b2e)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:center;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:20px minmax(0,1fr);align-items:center;column-gap:12px;padding:14px 16px;border:none;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font-size:16px;font-weight:700;line-height:1.4;box-sizing:border-box}.bf-terms-check-button{appearance:none;display:inline-flex;min-width:0;width:20px;height:20px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-copy{display:flex;width:100%;min-width:0;align-items:baseline;justify-content:space-between;column-gap:12px;row-gap:4px;flex-wrap:wrap}.bf-terms-label{min-width:0}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:5px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #00ceb2);background:var(--ds-accent-primary-default, #00ceb2)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #00ceb2);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-privacy{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #00ceb2);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--bf-toast-bg, #1e232e);color:var(--bf-toast-color, rgba(255, 255, 255, .85));box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-right-color:var(--ds-accent-primary-default, #00ceb2);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-accent-primary-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:#fff;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--bf-toast-color, rgba(255, 255, 255, .85));font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-accent-primary-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg, #1e232e)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:#fff}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:#ffffffe0}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;border:0;background:transparent;color:var(--bf-text-low);font:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-exchange-rate:hover{color:var(--bf-text-medium)}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-tree-marker{width:10px;flex-shrink:0;color:var(--bf-text-low)}.bf-info-value{min-width:0;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{color:var(--bf-text-medium)}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head,.bf-root[data-view=history] .bf-tree-marker{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #00ceb2)}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #00a0a2);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-token-picker-overlay{align-items:flex-end;padding:0}.bf-token-picker{width:100%;max-height:82dvh;min-height:min(520px,82dvh);border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}.bf-token-picker-handle{display:block;width:40px;height:4px;flex-shrink:0;align-self:center;margin:10px 0 0;border-radius:999px;background:#ffffff38}.bf-token-picker-head{min-height:55px;padding:12px 56px 16px 24px;border-bottom:0}.bf-token-picker-close{top:13px}.bf-token-search{margin:0 16px 12px}.bf-token-list{padding:0 16px 16px}.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}
10
- `);import{Fragment as Xr,jsx as f,jsxs as S}from"react/jsx-runtime";var Xs=E.createContext(void 0);function Dn(){return E.useContext(Xs)}function Mp(e){let[t,n]=E.useState(void 0);return E.useEffect(()=>{let o=e.current;if(!o)return;let r=()=>{let a=o.closest("[data-theme]");n(a?.getAttribute("data-theme")??void 0)};r();let i=new MutationObserver(r);return i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[e]),t}var qs=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],Op={dev:"https://dev.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://crossdefi.io"},Wp=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function Dp(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function Ks(e){let t=e.replace(/[^\d.]/g,""),[n="",...o]=t.split("."),r=o.join("");return o.length===0?n:`${n}.${r.slice(0,2)}`}function zp(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Js(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function Qs(e,t){let n=Number(e||"0"),o=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(n)?n*o:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function Gp(e,t=6){if(!e)return e;let[n,o=""]=e.split(".");if(!o)return n;let r=o.slice(0,t).replace(/0+$/,"");return r?`${n}.${r}`:n}function Up(e,t){if(!t)return!1;let n=new $t(e||"0"),o=new $t(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function Hp(e){if(e.priceUsd===void 0)return null;let t=new $t(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function $p(e){if(e.priceUsd===void 0)return null;let t=new $t(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function el(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,$t.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),i=new $t(o||"0").toFormat(0);return r?`${i}.${r}`:i}function jp(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function Vp(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=o=>o.toString().padStart(2,"0");return[`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`,`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`].join(" ")}function qp(e){let t=new $t(e||"0");return!t.isFinite()||t.isNaN()?e||"0":el(t)}function Kp(e,t){if(t?.priceUsd===void 0)return null;let n=new $t(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function Qo(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function Qp(e,t){return t==="all"?!0:Qo(e)===t}function Yp(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function Ys(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function tl(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function nl(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":tl(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function ol(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Ko(e){return!e||e==="0"||Number(e)===0}function Zp(e){let t=e.trim().toLowerCase();return t?t.startsWith("minimum ")?{from:e}:t.startsWith("available ")&&t.includes("or more")?{to:e}:t.includes("insufficient balance")||t.includes("not enough balance")||t.includes("exceeds balance")||t.includes("insufficient network fee")?{from:e}:t.includes("insufficient liquidity")||t.includes("not enough liquidity")?{to:e}:{}:{}}function Xp(e){let t=e.fromToken,n=e.toToken,o=nl(t,n),r=e.fromAmount||"0",i=e.toAmount||"0",a=o!==void 0&&!ol(o),s=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:a?[{label:"Route",value:t&&n?`${Ys(t.chainId)} \u2192 ${Ys(n.chainId)}`:"-"},{label:"Validator Fee",value:Ko(r)?"0":"Free",tone:Ko(r)?"default":"accent"},{label:"Network Fee",value:Ko(r)?"0":"Free",tone:Ko(r)?"default":"accent"}]:void 0,swapInfo:s?[t&&n?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:n.symbol,iconUrl:n.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:r,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:i,valueToken:n?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function eo({token:e,size:t=20}){let n=e?.iconUrl;return f("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?f("img",{src:n,alt:"",width:t,height:t,draggable:!1}):f("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function Zs({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:i,locked:a=!1}){return S("section",{className:"bf-amount-panel",children:[S("div",{className:"bf-amount-head",children:[f("span",{children:e}),S("span",{className:"bf-balance",children:[Js(t?.balance??"0")," ",t?.symbol??""]})]}),S("div",{className:"bf-amount-main",children:[S("label",{className:"bf-amount-input-wrap",children:[S("span",{className:"bf-sr-only",children:[e," amount"]}),f("input",{type:"text",inputMode:"decimal",value:n,onChange:s=>r(s.target.value),placeholder:"0",className:"bf-amount-input"}),f("span",{className:"bf-amount-usd",children:o})]}),S("button",{type:"button",className:"bf-token-pill",onClick:a?void 0:i,disabled:!a&&!i,"data-locked":a?"true":void 0,"aria-label":`Select ${e.toLowerCase()} token`,children:[f(eo,{token:t}),f("span",{children:t?.symbol??"Select"}),!a&&f(bn,{size:16})]})]})]})}function Jp({flow:e,side:t,onClose:n}){let o=E.useId(),[r,i]=E.useState(""),[a,s]=E.useState(null),l=Dn(),c=t==="from"?e.fromToken:e.toToken;E.useEffect(()=>{s(document.body)},[]),E.useEffect(()=>{let p=v=>{v.key==="Escape"&&n()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[n]);let d=E.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),g=E.useMemo(()=>{let p=r.trim().toLowerCase();return p?d.filter(v=>v.symbol.toLowerCase().includes(p)||v.name.toLowerCase().includes(p)):d},[r,d]),m=E.useCallback(p=>{t==="from"?e.selectFromToken(p):e.selectToToken(p),n()},[e,n,t]);return a?Wn(f("div",{className:"bf-token-picker-overlay","data-theme":l,role:"presentation",onMouseDown:p=>{p.target===p.currentTarget&&n()},children:S("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[f("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),S("header",{className:"bf-token-picker-head",children:[f("h3",{id:o,children:"Select a token"}),f("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:f(Wt,{size:24})})]}),S("label",{className:"bf-token-search",children:[f(As,{size:20}),f("span",{className:"bf-sr-only",children:"Search tokens"}),f("input",{value:r,onChange:p=>i(p.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),S("div",{className:"bf-token-list",children:[g.map(p=>{let v=tl(p,c),b=v?$p(p):Hp(p);return S("button",{type:"button",className:"bf-token-row","data-selected":v?"true":"false",onClick:()=>m(p),children:[S("span",{className:"bf-token-row-left",children:[f(eo,{token:p,size:40}),S("span",{className:"bf-token-meta",children:[f("span",{className:"bf-token-symbol",children:p.symbol}),!v&&f("span",{className:"bf-token-name",children:p.name})]})]}),S("span",{className:"bf-token-row-right",children:[S("span",{className:"bf-token-balance",children:[Js(p.balance),v?null:` ${p.symbol}`]}),b&&f("span",{className:"bf-token-price",children:b})]})]},zp(p))}),g.length===0&&f("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a):null}function ef({flow:e,onClose:t}){let n=E.useId(),[o,r]=E.useState(null),i=qs.find(b=>b.value===e.slippage),[a,s]=E.useState(e.slippage&&!i?e.slippage:""),l=a.trim()!==""&&a.trim()!==".",c=l?Number(a):NaN,d=Number.isFinite(c)&&c>50,g=Number.isFinite(c)&&c>5&&!d,m=b=>{e.setSlippage(b),t()},p=()=>{!l||d||(e.setSlippage(Ks(a)),t())};if(E.useEffect(()=>{r(document.body)},[]),E.useEffect(()=>{let b=w=>{w.key==="Escape"&&t()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t]),!o)return null;let v=Dn();return Wn(f("div",{className:"bf-slippage-overlay","data-theme":v,role:"presentation",onMouseDown:b=>{b.target===b.currentTarget&&t()},children:S("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[S("header",{className:"bf-slippage-head",children:[f("h3",{id:n,children:"Slippage Settings"}),f("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:f(Wt,{size:24})})]}),S("div",{className:"bf-slippage-body",children:[f("p",{className:"bf-slippage-desc",children:"The maximum price difference you are willing to accept before the transaction is reverted. Higher slippage increases the chance of execution but may result in a worse price."}),S("div",{className:"bf-slippage-controls",children:[f("div",{className:"bf-slippage-presets",children:qs.map(b=>f("button",{type:"button",className:"bf-slippage-preset","data-selected":!l&&e.slippage===b.value?"true":"false",onClick:()=>m(b.value),children:b.label},b.value))}),S("label",{className:"bf-slippage-custom","data-selected":l?"true":"false",children:[f("span",{className:"bf-sr-only",children:"Custom slippage percent"}),f("input",{value:a,onChange:b=>{s(Ks(b.target.value))},onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),p())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),f("span",{"aria-hidden":"true",children:"%"})]})]}),d?f("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):g?f("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,l&&f("button",{type:"button",className:"bf-slippage-apply",onClick:p,disabled:d,children:"Apply"})]})]})}),o)}function tf({flow:e}){let t=E.useId(),[n,o]=E.useState(!1),[r,i]=E.useState(null),a=Dn();return E.useEffect(()=>{i(document.body)},[]),E.useEffect(()=>{let s=l=>{l.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!r||!e.termsOpen?null:Wn(f("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:s=>{s.target===s.currentTarget&&e.cancelTerms()},children:S("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[f("h3",{id:t,children:"Agree to Terms of Service"}),f("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),S("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[f("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,"aria-label":"Agree to Terms of Use",onClick:()=>o(s=>!s),children:f("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"})}),S("div",{className:"bf-terms-copy",children:[f("span",{className:"bf-terms-label",children:"Agree to Terms of Use"}),e.termsUrl&&f("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),f("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),f("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function nf({value:e,disabled:t=!1}){let[n,o]=E.useState(!1);return f("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{o(!0),window.setTimeout(()=>o(!1),1200)})},children:n?"OK":"Copy"})}function of({flow:e,approval:t}){let n=E.useId(),[o,r]=E.useState(null),i=Dn();if(E.useEffect(()=>{r(document.body)},[]),E.useEffect(()=>{let l=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!o)return null;let a=e.status==="submitting"||!e.approveBridge,s=e.status==="submitting";return Wn(f("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",children:S("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[S("h3",{id:n,children:["Approve ",t.token.symbol]}),f(eo,{token:t.token,size:72}),S("div",{className:"bf-approve-address-box",children:[f("span",{children:"Token Address"}),S("div",{children:[f("strong",{children:t.tokenAddress}),f(nf,{value:t.tokenAddress,disabled:s})]})]}),S("div",{className:"bf-action-buttons",children:[f("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),S("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":s,children:[s&&f("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),f("span",{children:s?"Approving...":"Approve"})]})]})]})}),o)}function rf({flow:e}){let t=E.useId(),[n,o]=E.useState(null),r=Dn();if(E.useEffect(()=>{o(document.body)},[]),E.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=s=>{s.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.approvalSuccessOpen)return null;let i=e.status==="submitting";return Wn(f("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:S("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[f("h3",{id:t,children:"Approval Success"}),f("span",{className:"bf-success-mark","aria-hidden":"true"}),S("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",f("br",{}),"Please continue to the next step."]}),S("div",{className:"bf-action-buttons",children:[f("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:i,children:"Cancel"}),S("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:i,"aria-busy":i,children:[i&&f("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),f("span",{children:i?"Continuing...":"Continue"})]})]})]})}),n)}function af({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,i]=E.useState(!1),a=E.useMemo(()=>{let c=new $t(e||"0"),d=new $t(t||"0");return!c.isFinite()||!d.isFinite()||c.lte(0)||d.lte(0)?null:r?c.dividedBy(d):d.dividedBy(c)},[e,r,t]);if(!a||!n||!o||n.symbol===o.symbol)return null;let s=r?o.symbol:n.symbol,l=r?n.symbol:o.symbol;return S("button",{type:"button",className:"bf-exchange-rate",onClick:()=>i(c=>!c),children:[S("span",{children:["1 ",s]}),f(Ms,{size:12}),S("span",{children:[el(a)," ",l]})]})}function sf({flow:e}){return e.submitToast?S("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[f("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:f("span",{className:"bf-status-spinner"})}),S("span",{className:"bf-status-toast-copy",children:[f("strong",{children:"Transaction Processing"}),f("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function lf({message:e}){let[t,n]=E.useState(!1);return E.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:S("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[f("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:f("span",{className:"bf-status-error-mark",children:"!"})}),S("span",{className:"bf-status-toast-copy",children:[f("strong",{children:"Error"}),f("span",{children:e})]})]})}function cf(e){switch(e){case"swap":case"deposit-swap":case"swap-withdraw":return"Swap Transaction Sent";case"bridge":return"Bridge Transaction Sent";case"swap-bridge":return"Swap & Bridge Transaction Sent";case"bridge-swap":return"Bridge & Swap Transaction Sent";default:return"Transaction Sent"}}function df({flow:e}){let t=E.useId(),[n,o]=E.useState(null),r=e.submitted,i=Dn();return E.useEffect(()=>{o(document.body)},[]),E.useEffect(()=>{if(!e.successDialogOpen)return;let a=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.successDialogOpen||!r?null:Wn(f("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:f("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:S("div",{className:"bf-success-body",children:[f("span",{className:"bf-success-mark","aria-hidden":"true"}),S("div",{className:"bf-success-copy",children:[f("strong",{id:t,children:cf(r.pathType)}),f("span",{children:"Please check the results in the history."})]}),f("div",{className:"bf-success-route","aria-hidden":"true",children:(r.routeTokens&&r.routeTokens.length>0?r.routeTokens:[{symbol:r.fromToken.symbol,iconUrl:r.fromToken.iconUrl},{symbol:r.toToken.symbol,iconUrl:r.toToken.iconUrl}]).map((a,s)=>S(E.Fragment,{children:[s>0&&f("span",{className:"bf-success-route-arrow",children:"\u2192"}),f(Zr,{token:a,size:43})]},`${a.symbol}-${s}`))}),f("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,children:"OK"})]})})}),n)}function Zr({token:e,size:t=16}){let n=!!e.iconUrl;return f("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?f("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):f("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function pf({row:e}){return e.routeTokens&&e.routeTokens.length>0?f("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>S(E.Fragment,{children:[n>0&&f("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),f(Zr,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?S("span",{className:"bf-info-value-token",children:[f(Zr,{token:e.valueToken}),f("span",{children:e.value})]}):f(Xr,{children:e.value})}function rl({rows:e}){return!e||e.length===0?null:f("div",{className:"bf-info-rows",children:e.map((t,n)=>S("div",{className:"bf-info-row",children:[S("span",{className:"bf-info-label",children:[f("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),f("span",{children:t.label})]}),f("span",{className:"bf-info-value","data-tone":t.tone??"default",children:f(pf,{row:t})})]},`${t.label}-${t.value}`))})}function ff(e,t,n){return e.pathType==="bridge"?"Bridge Info":ol(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function uf({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return f(Xr,{children:r.map(i=>{let a=i==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?S("div",{className:"bf-info-section",children:[o&&f("h4",{children:i==="swap"?"Swap Info":"Bridge Info"}),f(rl,{rows:a})]},i):null})})}function mf({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=ff(e,t,n),[i,a]=E.useState(!0),[s,l]=E.useState(!0);return S("div",{className:"bf-details",children:[e.liquidity&&S("section",{className:"bf-liquidity",children:[S("div",{className:"bf-liquidity-head",children:[f("span",{children:e.liquidity.label??"Available Liquidity"}),f("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),f("div",{className:"bf-liquidity-track",children:f("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&S("section",{className:"bf-detail-section bf-info-card","data-open":i?"true":"false",children:[S("button",{type:"button",className:"bf-collapse-head","aria-expanded":i,onClick:()=>a(c=>!c),children:[f("h3",{children:r}),f(bn,{size:16,className:"bf-collapse-chevron"})]}),i&&f("div",{className:"bf-collapse-body",children:f(uf,{summary:e})})]}),o&&S("section",{className:"bf-detail-section bf-tx-fee-section","data-open":s?"true":"false",children:[S("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":s,onClick:()=>l(c=>!c),children:[f("h3",{children:"Est. Tx Fee"}),S("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&f("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&f("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),f("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:Gp(e.txFeeInfo?.estTxFee??"0")}),f(bn,{size:16,className:"bf-collapse-chevron"})]})]}),s&&f("div",{className:"bf-collapse-body",children:f(rl,{rows:e.txFee})})]})]})}function gf({item:e}){let t=Qo(e),n=Kp(e.fromAmount,e.fromToken);return S("article",{className:"bf-history-item",children:[S("div",{className:"bf-history-item-head",children:[f("span",{className:"bf-history-status","data-status":t,children:Yp(t)}),f("time",{className:"bf-history-time",dateTime:e.timestamp,children:Vp(e.timestamp)})]}),S("div",{className:"bf-history-item-body",children:[S("strong",{className:"bf-history-amount",children:[qp(e.fromAmount)," ",e.fromToken.symbol]}),S("div",{className:"bf-history-meta",children:[f("span",{className:"bf-history-usd",children:n??jp(e.txHash)}),S("span",{className:"bf-history-route",children:[S("span",{className:"bf-history-route-token",children:[f(eo,{token:e.fromToken,size:16}),f("span",{children:e.fromToken.symbol})]}),f(_s,{size:16,className:"bf-history-route-arrow"}),S("span",{className:"bf-history-route-token",children:[f(eo,{token:e.toToken,size:16}),f("span",{children:e.toToken.symbol})]})]})]})]})]})}function hf({flow:e}){let[t,n]=E.useState("all"),o=e.history.some(a=>Qo(a)==="pending"),r=e.history.filter(a=>Qp(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return S("main",{className:"bf-history-body",children:[f("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:Wp.map(a=>S("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>n(a.value),children:[f("span",{children:a.label}),a.value==="pending"&&o&&f("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),r.length>0?f("div",{className:"bf-history-list",children:r.map(a=>f(gf,{item:a},a.id||a.txHash))}):f("div",{className:"bf-empty",children:i})]})}function bf({flow:e,env:t}){let[n,o]=E.useState(null),[r,i]=E.useState(!1),[a,s]=E.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??Xp(e):null,d=Op[t],g=Zp(e.quoteError),m=Up(e.fromAmount,e.fromToken),p=m?"Insufficient balance":g.from,v=e.quoteError&&!g.from&&!g.to?e.quoteError:"",b=e.error||v,w=e.history.some(u=>Qo(u)==="pending"),L=(c?.pathType??nl(e.fromToken,e.toToken))!=="bridge";return S(Xr,{children:[S("main",{className:"bf-body",children:[S("div",{className:"bf-toolbar",children:[S("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[f(Ps,{}),f("span",{children:"History"}),(w||e.hasNewHistory)&&f("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),L&&S("button",{type:"button",className:"bf-chip",onClick:()=>i(!0),disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[f(Fs,{}),f("span",{children:e.slippageLocked?"Auto 1%":Dp(e.slippage,e.effectiveSlippage)})]})]}),S("div",{className:"bf-swap-card","data-has-from-error":p?"true":"false",children:[f(Zs,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:Qs(e.fromAmount,e.fromToken),onAmountChange:u=>e.setAmount(u,"from"),onTokenClick:()=>o("from")}),p&&f("div",{className:"bf-field-error",children:p}),f("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),s(u=>u+360)},style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:f(Bs,{size:22})}),f(Zs,{label:"To",token:e.toToken,amount:e.toAmount,usd:Qs(e.toAmount,e.toToken),onAmountChange:u=>e.setAmount(u,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),g.to&&f("div",{className:"bf-field-error",children:g.to})]}),f(af,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&f(mf,{summary:c})]}),S("footer",{className:"bf-footer",children:[f("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError||m,children:e.status==="submitting"?"Processing...":"Next"}),S("a",{className:"bf-powered",href:d,target:"_blank",rel:"noreferrer",children:["Powered by ",f("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&f(Jp,{flow:e,side:n,onClose:()=>o(null)}),r&&f(ef,{flow:e,onClose:()=>i(!1)}),f(tf,{flow:e}),e.approvalInfo&&f(of,{flow:e,approval:e.approvalInfo}),f(rf,{flow:e}),f(sf,{flow:e}),f(lf,{message:e.submitToast?"":b}),f(df,{flow:e})]})}function Yo({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let i=E.useMemo(()=>$e(n),[n]),a=Vs({...r,onExit:t}),s=E.useRef(null),l=Mp(s),c=a.step==="history"?"History":"Swap & Bridge";return f(Xs.Provider,{value:l,children:S("div",{ref:s,className:re("bf-root",o),"data-view":a.step,"data-status":a.status,children:[S("header",{className:"bf-header",children:[f("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:f(hn,{size:24})}),f("span",{className:"bf-header-title",children:c}),f("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:f(Wt,{size:24})})]}),a.step==="history"?f(hf,{flow:a}):f(bf,{flow:a,env:i})]})})}import{Fragment as Xo,jsx as h,jsxs as T}from"react/jsx-runtime";var xf="On-ramp is not available in your region.";function Jr(e,t,n){let o=ge[e],r=n.toUpperCase();if(t===o.cross&&r.includes("CROSSD"))return 0;if(t===o.cross&&r==="CROSS")return 1;if(t===o.bsc&&r==="CROSS")return 2}function vf(e){return parseInt(e.split(":")[1],10)}function yf(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function kf(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(n.slice(0,4),16)%360,r=(o+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${r} 80% 55%))`}function al({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:i,isMobile:a,open:s,drawerDirection:l,modal:c,showBalance:d,showForgeToken:g,showGameToken:m,showQR:p,showBridge:v,qrLogoSrc:b,walletAddress:w,accountName:y,sendAccounts:L,profileImageUrl:u,preferredTokens:C,close:R,onSelectWallet:k,onCopyAddress:N,onBuy:G,onDisconnect:F,disconnectLabel:j,termsUrl:D,termsLabel:V,privacyUrl:A,privacyLabel:ne,portalStyle:B,navContent:q,navPosition:ue,footerContent:ae,view:Q,setView:le,selectedSendToken:se,setSelectedSendToken:K,showPortfolio:z,portfolioTitle:X,portfolioSections:Fe,showTotalAssets:pe,totalAssetsLabel:xt,sendTransaction:Te,getTransactionReceipt:Jt,estimateGas:vt,onOutlink:Qe,lpBalanceReader:qt,stakingRewardsReader:Ne,bridgeTokens:he,bridgeHistory:ct,getBridgeQuote:Ie,getBridgeToTokens:Be,getBridgeApproval:be,approveBridge:Bt,submitBridge:yt,onReceive:_t,onBridge:Je,onSend:Mt,onBuyDisabledMessage:et,onBridgeDisabledMessage:we,onSendDisabledMessage:tt}=en(),[dt,De]=W.useState(null),kt=W.useRef(void 0),me=W.useCallback(x=>{De(x),clearTimeout(kt.current),kt.current=setTimeout(()=>De(null),4e3)},[]);W.useEffect(()=>()=>clearTimeout(kt.current),[]);let Se=!!et,Ot=W.useCallback(()=>{if(Se){me(et);return}let x=G?.();x&&typeof x.then=="function"&&x.catch(()=>{me(et??xf)})},[Se,et,G,me]),St=!!we,ze=!!tt,{tokens:pt,isLoading:Rt}=rn(r,w,s&&d),{statsMap:Re}=an(r,d),{apyPercent:Ee}=Ei(),{categoryMap:I}=Li(r,d),J=d&&pe,{displayValue:ce,isLowerBound:nt,isLoading:Kt}=Ai(r,w,s&&J),[ot,Sn]=W.useState(!1),Qt=W.useRef(null),[Rn,so]=W.useState(0),{holdings:_,isLoading:Ce}=Ni(r,w,s&&d&&g),H=W.useMemo(()=>_.map(x=>x.token),[_]),{imageMap:Ge}=Ii(r,H,g&&_.length>0),ft=W.useMemo(()=>{let x=[],M=[],ee=[],He=new Map((C??[]).map((oe,_e)=>[`${vf(oe.chainId)}:${oe.address.toLowerCase()}`,_e]));for(let oe of pt){let _e=Jr(r,oe.chainId,oe.symbol)!==void 0,Ct=`${oe.chainId}:${oe.address.toLowerCase()}`,un=He.get(Ct),hr=new to(oe.quantity.numeric).shiftedBy(-oe.quantity.decimals);if(_e)x.push(oe);else if(un!==void 0)M.push(oe);else if(hr.isGreaterThan(0)){if(!m&&I.get(Wr(oe.chainId,oe.address))==="game")continue;ee.push(oe)}}return x.sort((oe,_e)=>{let Ct=Jr(r,oe.chainId,oe.symbol)??99,un=Jr(r,_e.chainId,_e.symbol)??99;return Ct-un}),M.sort((oe,_e)=>{let Ct=He.get(`${oe.chainId}:${oe.address.toLowerCase()}`)??99,un=He.get(`${_e.chainId}:${_e.address.toLowerCase()}`)??99;return Ct-un}),ee.sort((oe,_e)=>{let Ct=Re.get(It(oe.chainId,oe.address)),un=Re.get(It(_e.chainId,_e.address)),hr=new to(oe.quantity.numeric).shiftedBy(-oe.quantity.decimals).multipliedBy(Ct?.price??0);return new to(_e.quantity.numeric).shiftedBy(-_e.quantity.decimals).multipliedBy(un?.price??0).minus(hr).toNumber()}),[...x,...M,...ee]},[pt,r,Re,m,I,C]),aa=W.useMemo(()=>{if(!g)return[];let x=new Set(pt.map(M=>M.address.toLowerCase()));return[..._].filter(M=>!x.has(M.token.toLowerCase())).sort((M,ee)=>{let He=new to(M.value);return new to(ee.value).minus(He).toNumber()})},[_,g,pt]),fn=W.useRef(!1),[Ue,Gn]=W.useState(null),Cn=W.useRef(void 0),ia=Ue?.chainId??se?.chainId??ft[0]?.chainId??0,{transactionUrl:cr}=vo(r,ia,Ue?.txHash,!!(Ue?.txHash&&ia)),rt=W.useCallback(x=>{fn.current=!0,le(x)},[le]),[Fl,dr]=W.useState("recipient"),lo=W.useCallback(()=>{K(null),dr("recipient"),rt("wallet")},[K,rt]),pr=W.useCallback((x,M="recipient")=>{if(ze){me(tt);return}dr(M),K(x),rt("send")},[ze,tt,me,K,rt]),Bl=W.useCallback(()=>{if(St){me(we);return}if(Je){Je();return}rt("bridge")},[St,we,Je,rt,me]),_l=W.useCallback(x=>{clearTimeout(Cn.current),K(null),rt("wallet"),Gn({status:"pending",txHash:x.txHash,chainId:x.chainId,description:`${x.amount} ${x.tokenSymbol} to ${it(x.recipient)}`})},[K,rt]),Ml=W.useCallback(x=>{let M=se?.chainId;K(null),rt("wallet"),!(!x||!M)&&(Gn(ee=>({status:"success",txHash:x,chainId:M,description:ee?.txHash===x?ee.description:"Tap to see your transaction"})),clearTimeout(Cn.current),Cn.current=setTimeout(()=>Gn(null),5e3))},[se?.chainId,K,rt]),Ol=W.useCallback(x=>{let M=x.txHash;M&&(Gn({status:"error",txHash:M,chainId:x.chainId,description:x.message}),clearTimeout(Cn.current),Cn.current=setTimeout(()=>Gn(null),5e3))},[]),Un=W.useMemo(()=>{if(_t)return _t;if(p)return()=>rt("qr")},[_t,p,rt]),fr=W.useMemo(()=>{if(Mt)return Mt;if(ft.length===0)return;let x=ft[0];return()=>pr(x,"token")},[Mt,ft,pr]),Wl=W.useCallback(()=>{if(ze){me(tt);return}fr?.()},[ze,tt,fr,me]);W.useEffect(()=>{s||(fn.current=!1,dr("recipient"))},[s]);let sa=W.useRef(null);W.useEffect(()=>{let x=sa.current;if(!x||!a)return;let M=ee=>{ee.pointerType==="touch"&&ee.stopPropagation()};return x.addEventListener("pointerdown",M),()=>x.removeEventListener("pointerdown",M)},[a]);let[Tn,la]=W.useState(!1),ur=W.useRef(void 0),[Hn,$n]=W.useState(!1);W.useEffect(()=>{if(!Hn)return;let x=()=>$n(!1),M=He=>{He.key==="Escape"&&$n(!1)},ee=setTimeout(()=>{document.addEventListener("mousedown",x,!0),document.addEventListener("keydown",M,!0)},0);return()=>{clearTimeout(ee),document.removeEventListener("mousedown",x,!0),document.removeEventListener("keydown",M,!0)}},[Hn]),W.useEffect(()=>{$n(!1)},[w]),W.useEffect(()=>()=>clearTimeout(ur.current),[]),W.useEffect(()=>()=>clearTimeout(Cn.current),[]),W.useEffect(()=>{let x=Qt.current;if(!x||ae===null){so(0);return}let M=()=>{so(x.offsetHeight)};if(M(),typeof ResizeObserver>"u")return;let ee=new ResizeObserver(M);return ee.observe(x),()=>ee.disconnect()},[ae]);let ca=W.useCallback(async()=>{if(!Tn)try{await navigator.clipboard.writeText(w),la(!0),clearTimeout(ur.current),ur.current=setTimeout(()=>la(!1),2e3),N?.(w,!0)}catch{N?.(w,!1)}},[w,N,Tn]),co=W.useCallback(x=>{x.currentTarget.setAttribute("data-loaded","true")},[]),da=W.useMemo(()=>({background:kf(w)}),[w]),po=W.useMemo(()=>u||Zt(r,w,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[u,r,w,i]),mr=W.useMemo(()=>yf(ce),[ce]),pa=D||A?T("div",{className:"wi-legal-links",children:[D&&h("a",{className:"wi-legal-link",href:D,target:"_blank",rel:"noopener noreferrer",onClick:x=>qe(x,D,{category:"terms",origin:"terms"},Qe),children:V}),D&&A&&h("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),A&&h("a",{className:"wi-legal-link",href:A,target:"_blank",rel:"noopener noreferrer",onClick:x=>qe(x,A,{category:"privacy",origin:"privacy"},Qe),children:ne})]}):null,fa=F?T("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{F(),R()},children:[h(Ma,{size:16}),h("span",{className:"wi-disconnect-label",children:j})]}):null,Dl=d&&!q?T("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[T("button",{type:"button",className:re("wi-action-card",Se&&"wi-action-card--dimmed"),onClick:Ot,disabled:!G&&!Se,"aria-disabled":Se||void 0,"aria-label":"Buy",children:[h(Ua,{size:20}),h("span",{children:"Buy"})]}),v?T("button",{type:"button",className:re("wi-action-card",St&&"wi-action-card--dimmed"),onClick:Bl,"aria-disabled":St||void 0,"aria-label":"Bridge",children:[h(Ha,{size:20}),h("span",{children:"Bridge"})]}):T("button",{type:"button",className:"wi-action-card",onClick:Un,disabled:!Un,"aria-label":"Receive",children:[h(wo,{size:20}),h("span",{children:"Receive"})]}),T("button",{type:"button",className:re("wi-action-card",ze&&"wi-action-card--dimmed"),onClick:Wl,disabled:!ze&&!fr,"aria-disabled":ze||void 0,"aria-label":"Send",children:[h(za,{size:20}),h("span",{children:"Send"})]}),z?T("button",{type:"button",className:"wi-action-card",onClick:()=>rt("portfolio"),"aria-label":"View portfolio",children:[h(Ga,{size:20}),h("span",{children:"Portfolio"})]}):v?T("button",{type:"button",className:"wi-action-card",onClick:Un,disabled:!Un,"aria-label":"Receive",children:[h(wo,{size:20}),h("span",{children:"Receive"})]}):null]}):null,zl=T("div",{className:re("wi-view-inner",fn.current&&"wi-view-wallet"),children:[J&&T("div",{className:"wi-total-section",children:[T("div",{className:"wi-total-head",children:[h("span",{className:"wi-total-label",children:xt}),h("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:x=>{x.stopPropagation(),Sn(M=>!M)},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),Sn(M=>!M))},"aria-label":ot?"Show balance":"Hide balance",children:ot?h(Wa,{}):h(Oa,{})})]}),h("div",{className:"wi-total-body",children:Kt?h("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):h("div",{className:"wi-total-value","data-hidden":ot||void 0,children:ot?h("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):T(Xo,{children:[nt&&h("span",{className:"wi-total-lte",children:"\u2264"}),h("span",{className:"wi-total-currency",children:"$"}),h("span",{className:"wi-total-amount",children:mr.main}),mr.decimal&&h("span",{className:"wi-total-decimal",children:mr.decimal})]})})})]}),ue==="top"&&(q?h("div",{className:"wi-nav-fixed",children:q}):Dl),d&&h("div",{ref:sa,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:T("div",{className:"wi-token-list",children:[Rt&&Array.from({length:5},(x,M)=>T("div",{className:"wi-skeleton-item",children:[T("div",{className:"wi-skeleton-left",children:[h("div",{className:"wi-skeleton-block wi-skeleton-icon"}),T("div",{className:"wi-skeleton-lines",children:[h("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),h("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),T("div",{className:"wi-skeleton-right",children:[h("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),h("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},M)),!Rt&&ft.length===0&&!g&&h("div",{className:"wi-empty",children:"No Tokens Found"}),ft.map(x=>{let M=Re.get(It(x.chainId,x.address)),ee=M?parseFloat(M.percent_change_24h):null,He=ee!==null&&ee>=0,oe=Yn(r,x.chainId),_e=ci(x.address);return T("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>pr(x),"aria-label":`Send ${x.symbol}`,children:[T("div",{className:"wi-token-left",children:[T("div",{className:"wi-token-icon-wrap",children:[h("img",{src:x.icon_url,alt:x.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:co,onError:Ct=>{Ct.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),oe&&h("img",{src:oe,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Ct=>{Ct.currentTarget.style.display="none"}})]}),T("div",{className:"wi-token-info",children:[T("span",{className:"wi-token-name-row",children:[h("span",{className:"wi-token-name",children:x.symbol}),_e&&Ee!==null&&h("span",{className:"wi-token-apy",children:`APY ${Ee>=0?"+":"-"}${(Ee>=0?Math.floor:Math.ceil)(Math.abs(Ee)*100)/100}%`})]}),M&&T("div",{className:"wi-token-price-row",children:[h("span",{className:"wi-token-price",children:Rr(M.price)}),h("span",{className:"wi-token-change","data-positive":He,"data-zero":ee===0||void 0,children:ee!==null&&(ee===0?"0%":`${He?"+":"-"}${(He?Math.floor:Math.ceil)(Math.abs(ee)*100)/100}%`)})]})]})]}),T("div",{className:"wi-token-right",children:[h("span",{className:"wi-token-balance",children:tn(x.quantity.numeric,x.quantity.decimals)}),M&&h("span",{className:"wi-token-value",children:ja(x.quantity.numeric,x.quantity.decimals,M.price)})]})]},`${x.address}-${x.chainId}`)}),g&&Ce&&Array.from({length:3},(x,M)=>T("div",{className:"wi-skeleton-item",children:[T("div",{className:"wi-skeleton-left",children:[h("div",{className:"wi-skeleton-block wi-skeleton-icon"}),T("div",{className:"wi-skeleton-lines",children:[h("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),h("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),T("div",{className:"wi-skeleton-right",children:[h("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),h("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${M}`)),g&&!Ce&&!Rt&&ft.length===0&&aa.length===0&&h("div",{className:"wi-empty",children:"No Tokens Found"}),g&&aa.map(x=>{let M=Ge.get(x.token)||"",ee=Yn(r,ge[r].cross);return T("div",{className:"wi-token-item",children:[T("div",{className:"wi-token-left",children:[T("div",{className:"wi-token-icon-wrap",children:[h("img",{src:M||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:x.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:co,onError:He=>{He.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),ee&&h("img",{src:ee,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:He=>{He.currentTarget.style.display="none"}})]}),T("div",{className:"wi-token-info",children:[h("span",{className:"wi-token-name",children:x.token_name}),h("div",{className:"wi-token-price-row",children:T("span",{className:"wi-token-price",children:[tn(x.current_price,18)," CROSS"]})})]})]}),T("div",{className:"wi-token-right",children:[h("span",{className:"wi-token-balance",children:tn(x.balance,18)}),h("span",{className:"wi-token-value",children:Rr(x.current_value_usd)})]})]},`forge-${x.token}`)})]})}),ue==="bottom"&&q&&h("div",{className:"wi-nav-fixed",children:q}),fa&&h("div",{className:"wi-wallet-disconnect-row",children:fa})]},"wallet"),Gl=z?h("div",{className:re("wi-view-inner wi-portfolio-body",fn.current&&"wi-view-portfolio"),children:h(On,{env:r,theme:i,walletAddress:w,showHeader:!1,onOutlink:Qe,lpBalanceReader:qt,stakingRewardsReader:Ne,sendTransaction:Te,estimateGas:vt,sections:Fe})},"portfolio"):null,Ul=se?h("div",{className:re("wi-view-inner wi-send-body",fn.current&&"wi-view-send"),children:h(Po,{env:r,theme:i,walletAddress:w,accountName:y,accounts:L,initialStep:Fl,token:se,tokens:ft,onTokenChange:K,sendTransaction:Te,getTransactionReceipt:Jt,estimateGas:vt,getTokenPriceUsd:x=>{let M=Re.get(It(x.chainId,x.address));if(!M?.price)return;let ee=parseFloat(M.price);return Number.isFinite(ee)?ee:void 0},onClose:R,onBackToWallet:lo,onSubmitted:_l,onSuccess:Ml,onFailed:Ol,onOutlink:Qe})},"send"):null,Hl=W.useMemo(()=>he||ft.map(x=>{let M=Re.get(It(x.chainId,x.address)),ee=M?.price?parseFloat(M.price):void 0;return{name:x.name,symbol:x.symbol,chainId:x.chainId,address:x.address,decimals:x.quantity.decimals,balance:Kn(x.quantity.numeric,x.quantity.decimals),iconUrl:x.icon_url,priceUsd:Number.isFinite(ee)?ee:void 0}}),[he,Re,ft]),$l=h("div",{className:re("wi-view-inner wi-bridge-body",fn.current&&"wi-view-send"),children:h(Yo,{env:r,walletAddress:w,tokens:Hl,history:ct,termsUrl:D,getQuote:Ie,getToTokens:Be,getApproval:be,approveBridge:Bt,submitBridge:yt,onClose:R,onBackToWallet:lo})},"bridge"),gr=!!k&&y?.trim().toLowerCase()!=="my wallet",ua=T(Xo,{children:[T("span",{className:"wi-receive-avatar",children:[h("span",{className:"wi-avatar-fallback",style:da}),po&&h("img",{src:po,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:co,onError:x=>{x.currentTarget.style.display="none"}})]}),h("span",{className:"wi-receive-account-name",children:y??"Account 1"}),gr&&h("span",{className:"wi-receive-chevron","data-open":Hn,"aria-hidden":"true",children:h(bn,{size:16})})]}),jl=T("div",{className:re("wi-view-inner wi-qr-body",fn.current&&"wi-view-qr"),children:[T("div",{className:"wi-receive-section",children:[gr?h("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{$n(!0),k?.()},"aria-label":"Switch account",children:ua}):h("div",{className:"wi-receive-account",children:ua}),T("div",{className:"wi-qr-block",children:[T("div",{className:"wi-qr-box",children:[h(wf,{value:w,size:180,level:"H",marginSize:2,...b&&{imageSettings:{src:b,height:33,width:33,excavate:!0}}}),!b&&h("div",{className:"wi-qr-logo",children:h(Da,{size:33})})]}),h("p",{className:"wi-qr-address",children:w})]}),T("button",{type:"button",className:"wi-qr-copy-btn",onClick:ca,children:[h("span",{className:"wi-qr-copy-icon",children:Tn?h(gn,{size:16}):h(jn,{size:16})}),h("span",{className:"wi-qr-copy-text",children:Tn?"Copied!":"Copy address"})]})]}),pa&&h("div",{className:"wi-receive-footer",children:pa})]},"qr"),Vl=Q==="qr"||Q==="portfolio"||Q==="send"||Q==="bridge",ma=ae!==null?h("div",{className:"wi-builtin-footer",children:ae}):null,ga=T("div",{className:"wi-account-text",children:[gr?T("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{$n(!0),k?.()},"aria-label":"Switch account","aria-expanded":Hn,children:[h("span",{className:"wi-account-name",children:y??"Account 1"}),h("span",{className:"wi-account-switch","data-open":Hn,"aria-hidden":"true",children:h(bn,{size:20})})]}):h("div",{className:"wi-account-row",children:h("span",{className:"wi-account-name",children:y??"Account 1"})}),T("button",{type:"button",className:"wi-address-row-btn",onClick:ca,"aria-label":"Copy address",children:[h("span",{className:"wi-account-address",children:it(w)}),h("span",{className:"wi-account-copy","data-copied":Tn,children:Tn?h(gn,{size:12}):h(jn,{size:12})})]})]}),ha=T(Xo,{children:[o,Q==="qr"?h("div",{className:"wi-sticky-header",children:T("div",{className:"wi-header wi-header--receive",children:[h("button",{type:"button",className:"wi-header-back",onClick:lo,"aria-label":"Back",children:h(hn,{size:24})}),h("span",{className:"wi-receive-title",children:"Receive"}),h("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:h(Wt,{size:24})})]})}):Q==="send"||Q==="bridge"?null:Vl?T("div",{className:"wi-sticky-header",children:[T("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[h("button",{type:"button",className:"wi-header-back",onClick:lo,"aria-label":"Back",children:h(hn,{size:24})}),h("div",{className:"wi-account-block wi-account-block--sub-account",children:ga}),h("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:h(Wt,{size:24})})]}),h("hr",{className:"wi-divider"})]}):T("div",{className:"wi-sticky-header",children:[T("div",{className:"wi-header wi-header--wallet",children:[T("div",{className:"wi-account-block",children:[T("div",{className:"wi-avatar",children:[h("div",{className:"wi-avatar-fallback",style:da}),po&&h("img",{src:po,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:co,onError:x=>{x.currentTarget.style.display="none"}})]}),ga]}),T("div",{className:"wi-header-actions",children:[p&&v&&h("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:Un,"aria-label":"Show QR code",children:h(wo,{size:20})}),h("button",{type:"button",className:"wi-header-action",onClick:R,"aria-label":"Close",children:h(Wt,{size:24})})]})]}),h("hr",{className:"wi-divider"})]}),T("div",{className:"wi-view-container",children:[Q==="wallet"&&zl,Q==="qr"&&jl,Q==="portfolio"&&Gl,Q==="send"&&Ul,Q==="bridge"&&$l]}),Q==="wallet"&&dt&&h("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:dt}),Q==="wallet"&&Ue&&T("a",{className:"wi-send-toast",href:cr??"#",target:"_blank",rel:"noopener noreferrer",onClick:x=>{if(!cr){x.preventDefault();return}qe(x,cr,{category:"send",origin:"send-transaction",payload:{chainId:Ue.chainId,txHash:Ue.txHash}},Qe)},children:[h("span",{className:"wi-send-toast-icon","data-status":Ue.status,"aria-hidden":!0,children:Ue.status==="pending"?h("span",{className:"wi-send-toast-spinner"}):Ue.status==="error"?h("span",{className:"wi-send-toast-error-dot"}):h($a,{size:20})}),T("span",{className:"wi-send-toast-copy",children:[h("span",{className:"wi-send-toast-title",children:Ue.status==="pending"?"Sending...":Ue.status==="error"?"Send failed":"Send complete"}),h("span",{className:"wi-send-toast-desc",children:Ue.status==="pending"||Ue.status==="error"?Ue.description:"Tap to see your transaction"})]})]}),ma&&Q!=="portfolio"&&Q!=="send"&&h("div",{className:"wi-sticky-footer",children:h("div",{className:"wi-footer",ref:Qt,children:ma})})]}),ba={...B,...Rn>0?{"--wi-footer-height":`${Rn}px`}:null};return a?T(Zo.Portal,{children:[c&&h(Zo.Overlay,{className:"wi-drawer-overlay"}),T(Zo.Content,{className:re("wi-drawer-content",n),"data-theme":i,"data-vaul-no-drag":l==="left"||l==="right"?!0:void 0,style:ba,"data-direction":l,"data-no-balance":!d||void 0,"data-has-footer":Rn>0||void 0,"data-view":Q,children:[h(Zo.Title,{className:"wi-sr-only",children:"My Wallet"}),ha]})]}):T(Xo,{children:[c&&s&&h("div",{className:"wi-drawer-overlay",onClick:R}),h(Jo.Portal,{children:h(Jo.Content,{align:e,sideOffset:t,className:re("wi-popover-content",n),"data-theme":i,style:ba,"data-no-balance":!d||void 0,"data-has-footer":Rn>0||void 0,"data-view":Q,children:ha})})]})}import*as il from"react";function sl({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=en();return il.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}import*as ll from"react";function cl({children:e}){let{setFooterContent:t}=en();return ll.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}$(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
11
- `);$(`.wi-trigger-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid rgba(255,255,255,.2);background:#1a2332;border-radius:9999px;cursor:pointer;color:#fff;font-family:inherit;font-size:16px;font-weight:500;line-height:24px;letter-spacing:-.3125px;transition:opacity .15s ease}.wi-trigger-btn:hover{opacity:.85}.wi-trigger-btn[data-theme=light]{background:#f3f6f8;border-color:#1212121a;color:#121212}.wi-trigger-btn[data-mobile]{font-size:14px;padding:6px 12px;gap:6px;line-height:20px}.wi-trigger-address{white-space:nowrap}.wi-divider{height:1px;background:var(--wi-border-default);margin:0;border:none;flex-shrink:0}[data-theme=light] .wi-divider{background:#1212121a}[data-theme=dark] .wi-divider{background:#ffffff1a}
12
- `);$(`@keyframes wi-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes wi-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes wi-slide-in-right{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes wi-slide-in-left{0%{transform:translate(-40px);opacity:0}to{transform:translate(0);opacity:1}}
13
- `);$(`.wi-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;width:393px;border-radius:24px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--wi-surface-bg);box-shadow:var(--ds-shadow-modal, var(--wi-shadow));animation:wi-fade-in .15s ease-out;height:600px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(600px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{max-height:calc(100dvh - 32px)}.wi-sticky-header{flex-shrink:0;position:relative}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px}.wi-header--wallet{align-items:flex-start;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--wallet+.wi-divider{display:none}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:32px;height:32px;border-radius:50%;object-fit:cover;background:transparent}.wi-account-text{display:flex;flex-direction:column;gap:2px;min-width:0}.wi-account-row{display:flex;align-items:center;gap:8px;min-width:0}.wi-account-row--btn{padding:2px;margin:0;width:fit-content;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;border-radius:6px;transition:background-color .15s ease,opacity .15s ease}.wi-account-row--btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .06))}.wi-account-row--btn:focus-visible{outline:2px solid var(--wi-primary, #00d5aa);outline-offset:2px}.wi-account-name{font-family:inherit;font-size: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}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px 0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));border-radius:4px;flex-shrink:0;transition:color .15s ease,transform .2s ease}.wi-account-switch[data-open=true]{transform:rotate(180deg)}.wi-account-row--btn:hover .wi-account-switch{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;text-align:left;min-width:0;transition:color .15s ease}.wi-address-row-btn:hover .wi-account-address,.wi-address-row-btn:hover .wi-account-copy{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-account-address{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));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-copy{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:var(--wi-texticon-tertiary);flex-shrink:0;transition:color .15s ease}.wi-account-copy[data-copied=true]{color:var(--ds-system-green-high, #00a869)}.wi-header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0;margin-top:-4px}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;border-radius:0;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header-action--qr{width:32px;height:32px;border-radius:8px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));transition:background-color .15s ease,color .15s ease}.wi-header-action--qr:hover{background:var(--ds-surface-high, rgba(0, 0, 0, .08));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header--receive{align-items:center;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--receive .wi-header-action,.wi-header--sub-account .wi-header-action{position:absolute;top:24px;right:24px}.wi-receive-title{position:absolute;left:50%;transform:translate(-50%);font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);text-align:center;pointer-events:none}.wi-header-info{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}.wi-header-title{font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);margin:0}.wi-header-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--ds-content-low, #00000066);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:24px 24px 0;padding:0;flex-shrink:0;display:flex;flex-direction:column;gap:8px;border:none;background:transparent;border-radius:12px;color:inherit;font:inherit;text-align:left;width:auto}.wi-action-row{display:flex;align-items:flex-start;gap:8px;width:auto;margin:24px 24px 0}.wi-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,color .15s ease}.wi-action-card:hover:not(:disabled){background:#2e3544!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}:root[data-ds-theme=light] .wi-action-card:hover:not(:disabled){background:#e4e8ef!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-action-card:disabled{cursor:default}.wi-action-card>svg{flex-shrink:0}.wi-action-card:not(:disabled){transition:background-color .15s ease,transform .1s ease}.wi-action-card:active:not(:disabled){transform:scale(.93)}.wi-total-head{display:flex;align-items:center;gap:4px}.wi-total-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.wi-total-label{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))}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease;border-radius:4px}.wi-total-eye:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-total-eye:focus-visible{outline:1px solid var(--wi-texticon-secondary);outline-offset:2px}.wi-total-value{display:flex;align-items:baseline;gap:0;font-family:inherit;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000);font-variant-numeric:tabular-nums;min-height:45px;white-space:nowrap}.wi-total-currency,.wi-total-amount,.wi-total-decimal{font-size:36px;color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:22px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:32px;color:var(--wi-texticon-secondary)}.wi-total-skeleton{border-radius:6px}.wi-scrollable-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:8px 0 0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}.wi-drawer-content .wi-scrollable-body{touch-action:pan-y}[data-theme=light] .wi-scrollable-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-scrollable-body::-webkit-scrollbar{width:4px}.wi-scrollable-body::-webkit-scrollbar-track{background:transparent}.wi-scrollable-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#0003}.wi-nav-fixed{flex-shrink:0;padding:0 24px}.wi-token-list{display:flex;flex-direction:column;gap:0;padding:8px 0}.wi-token-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 24px;border:none;background:transparent;text-align:left;font-family:inherit;width:100%;box-sizing:border-box}.wi-token-item--button{cursor:pointer;background:var(--ds-surface-default, #ffffff);transition:none}.wi-token-item--button:hover{background:#252b39!important}:root[data-ds-theme=light] .wi-token-item--button:hover{background:#eff3f8!important}button.wi-token-item:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px;border-radius:4px}.wi-token-left{display:flex;align-items:center;gap:16px;min-width:0}.wi-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.wi-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain;opacity:0;transition:opacity .2s ease}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name-row{display:flex;align-items:center;gap:6px;min-width:0}.wi-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}.wi-token-apy{flex-shrink:0;font-family:inherit;font-size:12px;font-weight:600;line-height:1;color:var(--ds-system-purple-high, #9b78ff);background:var(--ds-system-purple-low, #2e2854);padding:4px;border-radius:6px;white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:8px}.wi-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}.wi-token-change{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--ds-system-green-high, #00a0a2)}.wi-token-change[data-positive=false]{color:var(--ds-system-red-high, #a80927)}.wi-token-change[data-zero]{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-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}.wi-token-value{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}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-send-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:2;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);box-sizing:border-box;text-decoration:none}.wi-action-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:3;padding:12px 14px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);font-size:14px;line-height:1.4;text-align:center;box-sizing:border-box;animation:wi-action-toast-in .18s ease-out}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-action-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-action-toast{bottom:72px}@keyframes wi-action-toast-in{0%{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}.wi-action-card--dimmed{opacity:.4;cursor:pointer}.wi-action-card--dimmed:hover{opacity:.5}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-send-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-send-toast{bottom:72px}.wi-send-toast:hover{opacity:.92}.wi-send-toast-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--ds-accent-primary-default, #00b4b7)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(0,232,201,.22);border-top-color:var(--ds-accent-primary-on-inverted, #00e8c9);border-radius:50%;animation:wi-send-toast-spin .8s linear infinite}.wi-send-toast-error-dot{width:18px;height:18px;border-radius:50%;background:var(--ds-system-red-default, #ff3358)}@keyframes wi-send-toast-spin{to{transform:rotate(360deg)}}.wi-send-toast-copy{display:flex;min-width:0;flex-direction:column}.wi-send-toast-title{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-inverted, #ffffff)}.wi-send-toast-desc{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-accent-primary-on-inverted, #00e8c9)}.wi-send-toast-icon[data-status=error]+.wi-send-toast-copy .wi-send-toast-desc{color:var(--ds-system-red-default, #ff3358)}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:16px;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:color .15s ease}.wi-disconnect-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;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))}.wi-receive-avatar .wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-receive-avatar .wi-avatar-img{width:24px;height:24px}.wi-legal-link{color:var(--ds-content-low, rgba(0, 0, 0, .4));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.wi-legal-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-legal-sep{color:inherit}.wi-empty{display:flex;align-items:center;justify-content:center;padding:32px 0;font-family:inherit;font-size:16px;color:var(--wi-texticon-secondary)}.wi-skeleton-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-skeleton-left{display:flex;align-items:center;gap:12px}.wi-skeleton-block{border-radius:6px;background:var(--wi-border-default);position:relative;overflow:hidden}.wi-skeleton-block:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:wi-shimmer 1.5s ease-in-out infinite}[data-theme=light] .wi-skeleton-block:after{background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 50%,transparent 100%)}.wi-skeleton-icon{width:32px;height:32px;border-radius:50%;flex-shrink:0}.wi-skeleton-lines{display:flex;flex-direction:column;gap:6px}.wi-skeleton-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.wi-header-back{display:inline-flex;align-items:center;justify-content:center;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}.wi-header-back:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:1;min-height:0}.wi-view-inner{display:flex;flex-direction:column;flex:1;min-height:0}.wi-view-wallet{animation:wi-slide-in-left .25s ease-out}.wi-view-qr,.wi-view-portfolio{animation:wi-slide-in-right .25s ease-out}.wi-qr-body{flex:1;min-height:0;display:flex;flex-direction:column}.wi-portfolio-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-portfolio-body>.wp-embed{flex:1;min-height:0}.wi-portfolio-body .wp-body-inner{padding:16px 16px 32px;gap:32px}.wi-receive-section{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px}.wi-receive-account{display:inline-flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border:0;background:var(--ds-surface-high, #edf1f2);border-radius:9999px;font-family:inherit;color:inherit}.wi-receive-account--btn{cursor:pointer;transition:none}.wi-receive-account--btn:hover{background:#2e3544}:root[data-ds-theme=light] .wi-receive-account--btn:hover{background:#e4e8ef}.wi-receive-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;overflow:hidden;flex-shrink:0}.wi-receive-account-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}.wi-receive-account>svg{color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0}.wi-receive-chevron{display:inline-flex;align-items:center;color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0;transition:transform .2s ease}.wi-receive-chevron[data-open=true]{transform:rotate(180deg)}.wi-qr-block{display:flex;flex-direction:column;align-items:center;gap:16px}.wi-qr-box{position:relative;display:flex;align-items:center;justify-content:center;padding:10px;background:#fff;border-radius:6px;overflow:hidden}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:16px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;word-break:break-all;max-width:281px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:12px 16px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);border-radius:12px;cursor:pointer;transition:border-color .15s ease}.wi-qr-copy-btn:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-qr-copy-icon{display:inline-flex;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-qr-copy-text{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));white-space:nowrap}.wi-receive-footer{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-drawer-content .wi-header{padding:16px}.wi-drawer-content .wi-header--receive .wi-header-action,.wi-drawer-content .wi-header--sub-account .wi-header-action{top:16px;right:16px}.wi-drawer-content .wi-total-section,.wi-drawer-content .wi-action-row{margin:16px 16px 0}.wi-drawer-content .wi-nav-fixed{padding:0 16px}.wi-drawer-content .wi-token-item{padding:12px 16px}.wi-drawer-content .wi-wallet-disconnect-row{padding:16px}
14
- `);$(`.wi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
15
- `);import{jsx as ea}from"react/jsx-runtime";function Rf({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:i=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:l=!0,showBridge:c=!0,qrLogoSrc:d,walletAddress:g,accountName:m,sendAccounts:p,profileImageUrl:v,connectorId:b,connectorName:w,connectorIconUrl:y,preferredTokens:L=[],onSelectWallet:u,onCopyAddress:C,onBuy:R,onBuyDisabledMessage:k,onBridgeDisabledMessage:N,onSendDisabledMessage:G,onDisconnect:F,disconnectLabel:j="Disconnect",termsUrl:D=An,termsLabel:V="Terms of Service",privacyUrl:A=xo,privacyLabel:ne="Privacy Policy",open:B,onOpenChange:q,showPortfolio:ue=!1,portfolioTitle:ae="My Portfolio",portfolioSections:Q,showTotalAssets:le=!0,totalAssetsLabel:se="Total Assets USD",sendTransaction:K,getTransactionReceipt:z,estimateGas:X,onOutlink:Fe,lpBalanceReader:pe,stakingRewardsReader:xt,bridgeTokens:Te,bridgeHistory:Jt,getBridgeQuote:vt,getBridgeToTokens:Qe,getBridgeApproval:qt,approveBridge:Ne,submitBridge:he,onReceive:ct,onBridge:Ie,onSend:Be,style:be,children:Bt}){let yt=$e(e),_t=b?bo[b]:void 0,Je=w??_t?.name,Mt=y??_t?.iconUrl,et=Nn(`(max-width: ${n}px)`),we=o??(i?"right":"bottom"),tt=we==="left"||we==="right",dt=r??!1,De=B!==void 0,[kt,me]=Ke.useState(!1),Se=De?B:kt,Ot=Ke.useCallback(Qt=>{De||me(Qt),q?.(Qt)},[De,q]),St=Ke.useCallback(()=>Ot(!1),[Ot]),[ze,pt]=Ke.useState(null),[Rt,Re]=Ke.useState("top"),[Ee,I]=Ke.useState(null),[J,ce]=Ke.useState("wallet"),[nt,Kt]=Ke.useState(null);Ke.useEffect(()=>{Se||(ce("wallet"),Kt(null))},[Se]);let ot=Ke.useCallback(()=>{Ir(g),F?.()},[F,g]),Sn=Ke.useMemo(()=>({env:yt,theme:t,isMobile:et,open:Se,drawerDirection:we,modal:dt,showBalance:i,showForgeToken:a,showGameToken:s,showQR:l,showBridge:c,qrLogoSrc:d,walletAddress:g,accountName:m,sendAccounts:p,profileImageUrl:v,connectorName:Je,connectorIconUrl:Mt,preferredTokens:L,close:St,onSelectWallet:u,onCopyAddress:C,onBuy:R,onBuyDisabledMessage:k,onBridgeDisabledMessage:N,onSendDisabledMessage:G,onDisconnect:F?ot:void 0,disconnectLabel:j,termsUrl:D,termsLabel:V,privacyUrl:A,privacyLabel:ne,portalStyle:be,navContent:ze,navPosition:Rt,setNavContent:pt,setNavPosition:Re,footerContent:Ee,setFooterContent:I,view:J,setView:ce,selectedSendToken:nt,setSelectedSendToken:Kt,showPortfolio:ue,portfolioTitle:ae,portfolioSections:Q,showTotalAssets:le,totalAssetsLabel:se,sendTransaction:K,getTransactionReceipt:z,estimateGas:X,onOutlink:Fe,lpBalanceReader:pe,stakingRewardsReader:xt,bridgeTokens:Te,bridgeHistory:Jt,getBridgeQuote:vt,getBridgeToTokens:Qe,getBridgeApproval:qt,approveBridge:Ne,submitBridge:he,onReceive:ct,onBridge:Ie,onSend:Be}),[yt,t,et,Se,we,dt,i,a,s,l,c,d,g,m,p,v,Je,Mt,L,St,u,C,R,k,N,G,F,ot,j,D,V,A,ne,be,ze,Rt,Ee,J,nt,ue,ae,Q,le,se,K,z,X,Fe,pe,xt,Te,Jt,vt,Qe,qt,Ne,he,ct,Ie,Be]);return ea(kr.Provider,{value:Sn,children:et?ea(Sf.Root,{direction:we,open:Se,onOpenChange:Ot,handleOnly:tt,noBodyStyles:!0,repositionInputs:!1,children:Bt},"drawer"):ea(dl.Root,{open:Se,onOpenChange:Ot,children:Bt},"popover")})}var zn=Object.assign(Rf,{Trigger:Ti,Content:al,Nav:sl,Footer:cl});import*as Vt from"react";import*as Nl from"@radix-ui/react-dialog";import{Drawer as Pf}from"vaul";import{createContext as Cf,useContext as Tf}from"react";var er=Cf(null);function no(){let e=Tf(er);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as pl,useEffect as Nf,useCallback as If}from"react";function tr(){let[e,t]=pl([]),[n,o]=pl(!0);Nf(()=>{if(typeof window>"u"){o(!1);return}let i=[],a=l=>{let{info:c}=l.detail;c?.rdns&&!i.some(d=>d.rdns===c.rdns)&&(i.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let r=If(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:n}}import*as ul from"@radix-ui/react-dialog";import{Drawer as Ef}from"vaul";import{jsx as fl}from"react/jsx-runtime";function ml({asChild:e,children:t}){let{isMobile:n}=no(),o=n?Ef.Trigger:ul.Trigger;return fl(o,{asChild:e??t!=null,children:t??fl("button",{type:"button",children:"Connect Wallet"})})}import*as jt from"@radix-ui/react-dialog";import{Drawer as or}from"vaul";import{jsx as Z,jsxs as pn}from"react/jsx-runtime";function nr(){return pn("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Z("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),Z("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function gl(){return pn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[pn("g",{clipPath:"url(#clip0_1331_27065)",children:[Z("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),Z("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),Z("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),Z("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),Z("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),Z("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),Z("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),Z("defs",{children:Z("clipPath",{id:"clip0_1331_27065",children:Z("rect",{width:"40",height:"40",fill:"white"})})})]})}function hl(){return pn("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Z("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),Z("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),Z("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),Z("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),Z("path",{d:"M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z",fill:"#F3BA2F"})]})}function bl(){return pn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[Z("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),Z("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),Z("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),Z("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function wl(){return pn("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[pn("g",{clipPath:"url(#clip0_1185_7785)",children:[Z("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),Z("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),Z("defs",{children:Z("clipPath",{id:"clip0_1185_7785",children:Z("rect",{width:"28",height:"28",fill:"white"})})})]})}function xl(){return pn("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[Z("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"}),Z("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),Z("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"}),Z("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"})]})}function vl(){return Z("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:Z("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function yl(){return Z("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Z("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var ta={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:nr},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:nr,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:nr,rdns:"nexus.to.crosswallet.desktop",installUrl:"https://chromewebstore.google.com/detail/crossx/nninbdadmocnokibpaaohnoepbnpdgcg",visibility:"desktop-only"},metamask:{id:"metamask",name:"MetaMask",description:"Browser extension approval is required",icon:gl,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:hl},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:bl,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:wl,badge:"For SHOP"}};function na(e){return ta[e]}var oa={google:{id:"google",name:"Google",icon:xl},apple:{id:"apple",name:"Apple",icon:vl}};function kl(e){return oa[e]}import{Fragment as Cl,jsx as Y,jsxs as We}from"react/jsx-runtime";function Lf({wallet:e,detected:t,onConnect:n}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},r=e.icon,i=e.featured===!0;return We("button",{type:"button",className:re("wcm-wallet-item",i&&"wcm-wallet-item--featured"),onClick:o,children:[We("div",{className:"wcm-wallet-item-left",children:[Y("div",{className:"wcm-wallet-icon",children:Y(r,{})}),We("div",{className:"wcm-wallet-name-row",children:[Y("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&Y("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?Y("span",{className:"wcm-installed-label",children:"Installed"}):Y("span",{className:"wcm-install-btn",children:"Install"}))]})}function Af({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return We("button",{type:"button",className:"wcm-social-item","data-provider":e.id,onClick:t,"aria-label":o,children:[Y("span",{className:"wcm-social-icon",children:Y(n,{})}),Y("span",{className:"wcm-social-name",children:o})]})}function Sl(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:i,isDetected:a,close:s,isMobile:l}=no(),c=t.filter(m=>{let p=na(m).visibility;return!p||p==="always"?!0:p==="desktop-only"?!l:p==="mobile-only"?l:!0}),d=o.length>0,g=c.length>0;return We(Cl,{children:[We("div",{className:"wcm-header",children:[We("div",{className:"wcm-header-text",children:[Y("h2",{className:"wcm-title",children:"CROSS Wallet"}),!l&&Y("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),Y("button",{type:"button",className:"wcm-close-btn",onClick:s,"aria-label":"Close",children:Y(yl,{})})]}),We("div",{className:"wcm-body",children:[d&&We(Cl,{children:[!l&&We("div",{className:"wcm-section-header",children:[Y("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),Y("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),Y("div",{className:"wcm-social-grid",children:o.map(m=>{let p=kl(m);return Y(Af,{social:p,onSignIn:()=>{n[m]?.(),s()}},m)})}),g&&We("div",{className:"wcm-separator",children:[Y("div",{className:"wcm-separator-line"}),Y("span",{className:"wcm-separator-text",children:"Other Wallets"}),Y("div",{className:"wcm-separator-line"})]})]}),g&&Y("div",{className:"wcm-wallet-list",children:c.map(m=>{let p=na(m),v=p.rdns?a(p.rdns):!1;return Y(Lf,{wallet:p,detected:v,onConnect:()=>{e[m]?.(),s()}},m)})}),We("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",Y(Rl,{href:r,children:"Terms of Service"})," and consent to its ",Y(Rl,{href:i,children:"Privacy Policy"}),"."]})]})]})}function Rl({href:e,children:t}){return e?Y("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):Y("span",{className:"wcm-terms-link",children:t})}function Tl({className:e}){let{isMobile:t,theme:n,portalStyle:o}=no();return t?We(or.Portal,{children:[Y(or.Overlay,{className:"wcm-overlay"}),We(or.Content,{className:re("wcm-drawer-content",e),"data-theme":n,style:o,children:[Y(or.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),Y("div",{className:"wcm-drawer-handle"}),Y("div",{className:"wcm-drawer-body",children:Y(Sl,{})})]})]}):We(jt.Portal,{children:[Y(jt.Overlay,{className:"wcm-overlay"}),We(jt.Content,{className:re("wcm-dialog-content",e),"data-theme":n,style:o,children:[Y(jt.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),Y(jt.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),Y("div",{className:"wcm-dialog-body",children:Y(Sl,{})})]})]})}$(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.wcm-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:var(--ds-border-medium, rgba(0, 0, 0, .18)) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:4px}.wcm-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-header-text{display:flex;flex-direction:column;gap:4px;min-width:0}.wcm-title{font-family:Inter,sans-serif;font-weight:600;font-size:20px;line-height:1.25;letter-spacing:0;color:var(--ds-content-highest, #000000);margin:0}.wcm-subtitle{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));margin:0}.wcm-close-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:none;background:transparent;color:var(--ds-content-low, #00000066);cursor:pointer;padding:0;transition:opacity .15s ease}.wcm-close-btn:hover{opacity:.6}.wcm-close-btn>svg{width:24px;height:24px}.wcm-divider{display:none}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:24px}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1;letter-spacing:0;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-low, #e7f9f8);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-high, #00a0a2);white-space:nowrap}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;transition:none;font-family:inherit;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-social-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-social-item:hover{background:#eff3f8!important}.wcm-social-item[data-provider=apple] .wcm-social-icon{color:#000}[data-theme=dark] .wcm-social-item[data-provider=apple] .wcm-social-icon{color:#fff}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:16px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:12px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-separator-text{font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-wallet-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:20px 16px;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;text-align:left;transition:none;font-family:inherit}.wcm-wallet-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-wallet-item:hover{background:#eff3f8!important}.wcm-wallet-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg,.wcm-wallet-icon>img{width:28px;height:28px;border-radius:0;object-fit:cover}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-system-purple-low, #f5f3ff);border:.5px solid var(--ds-system-purple-default, #7e54f4);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-purple-high, #7346f3);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-default, #00b4b7);border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-on, #ffffff);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-terms{font-family:Inter,sans-serif;font-weight:400;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;margin:0}.wcm-terms-link{color:var(--ds-accent-primary-high, #00a0a2);text-decoration:none}.wcm-terms-link:hover{text-decoration:underline}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
16
- `);$(`@keyframes wcm-overlay-show{0%{opacity:0}to{opacity:1}}@keyframes wcm-overlay-hide{0%{opacity:1}to{opacity:0}}@keyframes wcm-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes wcm-dialog-hide{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
17
- `);import{jsx as oo}from"react/jsx-runtime";var Ff={};function Bf({wallets:e,socialProviders:t=Ff,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:i=768,drawerDirection:a="bottom",dialogWidth:s,drawerMaxWidth:l,drawerMinWidth:c,style:d,open:g,onOpenChange:m,children:p}){let v=Nn(`(max-width: ${i}px)`),[b,w]=Vt.useState(!1),y=g!==void 0,L=y?g:b,u=Vt.useCallback(D=>{y||w(D),m?.(D)},[y,m]),C=Vt.useCallback(()=>u(!1),[u]),{isDetected:R}=tr(),k=Vt.useMemo(()=>Object.keys(e),[e]),N=Vt.useMemo(()=>Object.keys(t),[t]),G=Vt.useMemo(()=>{let D={};return s&&(D["--wcm-dialog-width"]=s),l&&(D["--wcm-drawer-max-width"]=l),c&&(D["--wcm-drawer-min-width"]=c),{...D,...d}},[s,l,c,d]),F=Vt.useMemo(()=>({theme:r,isMobile:v,open:L,setOpen:u,close:C,wallets:e,activeWalletIds:k,socialProviders:t,activeSocialIds:N,termsUrl:n??An,privacyUrl:o??xo,isDetected:R,portalStyle:G}),[r,v,L,u,C,e,k,t,N,n,o,R,G]),j=oo("div",{"data-theme":r,style:G,children:p});return v?oo(er.Provider,{value:F,children:oo(Pf.Root,{direction:a,open:L,onOpenChange:u,noBodyStyles:!0,children:j},"drawer")}):oo(er.Provider,{value:F,children:oo(Nl.Root,{open:L,onOpenChange:u,children:j})})}var Il=Object.assign(Bf,{Trigger:ml,Content:Tl});$(`.cb-button{--cb-bg: var(--ds-accent-primary-default, #00b4b7);--cb-bg-hover: var(--cb-bg);--cb-color: var(--ds-accent-primary-on-primary, #ffffff);--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 8px 16px;--cb-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-font-size: 14px;--cb-font-weight: 500;--cb-line-height: 1.5;--cb-letter-spacing: -.01em;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-icon-size: 18px;--cb-spinner-size: 18px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--ds-surface-default, #ffffff);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--ds-content-high, rgba(0, 0, 0, .85));--cb-pill-border: 1px solid var(--ds-border-default, rgba(0, 0, 0, .07));--cb-pill-border-hover: 1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 1px 13px;--cb-pill-press-scale: .95;--cb-pill-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-pill-font-size: 14px;--cb-pill-font-weight: 500;--cb-pill-line-height: 1.5;--cb-pill-gap: 8px;--cb-pill-icon-size: 18px;--cb-pill-icon-placeholder-bg: var(--ds-surface-medium, #f5f7fa);--cb-pill-address-font: Inter, system-ui, -apple-system, sans-serif;--cb-pill-address-font-size: 14px;--cb-pill-address-letter-spacing: -.01em}
18
- `);$(`.cb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-height);gap:var(--cb-gap);padding:var(--cb-padding);border-radius:var(--cb-radius);border:var(--cb-border);background:var(--cb-bg);color:var(--cb-color);font-family:var(--cb-font-family);font-size:var(--cb-font-size);font-weight:var(--cb-font-weight);line-height:var(--cb-line-height);letter-spacing:var(--cb-letter-spacing);cursor:pointer;transition:var(--cb-transition)}.cb-button:hover:not(:disabled){background:var(--cb-bg-hover)}.cb-button:active:not(:disabled){transform:scale(var(--cb-press-scale))}.cb-button:disabled,.cb-button[aria-busy=true]{cursor:default;opacity:var(--cb-loading-opacity)}.cb-spinner{display:inline-block;width:var(--cb-spinner-size);height:var(--cb-spinner-size);border:2px solid var(--cb-spinner-track);border-top-color:var(--cb-spinner-thumb);border-radius:50%;animation:cb-spin .6s linear infinite;flex-shrink:0}.cb-button-icon{width:var(--cb-icon-size);height:var(--cb-icon-size);flex-shrink:0}.cb-button-label{white-space:nowrap}.cb-pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-pill-height);gap:var(--cb-pill-gap);padding:var(--cb-pill-padding);border-radius:var(--cb-pill-radius);border:var(--cb-pill-border);background:var(--cb-pill-bg);color:var(--cb-pill-color);font-family:var(--cb-pill-font-family);font-size:var(--cb-pill-font-size);font-weight:var(--cb-pill-font-weight);line-height:var(--cb-pill-line-height);cursor:pointer}.cb-pill:hover{background:var(--cb-pill-bg-hover)}.cb-pill:active:not(:disabled){transform:scale(var(--cb-pill-press-scale))}.cb-pill-icon{width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;object-fit:contain;flex-shrink:0;background:transparent}[data-theme=dark] .cb-pill-icon[data-provider=apple]{filter:invert(1)}.cb-pill-icon-placeholder{display:inline-block;width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;background:var(--cb-pill-icon-placeholder-bg);flex-shrink:0}.cb-pill-address{font-family:var(--cb-pill-address-font);font-size:var(--cb-pill-address-font-size);letter-spacing:var(--cb-pill-address-letter-spacing);white-space:nowrap}@media(max-width:767.98px){.cb-button,.cb-pill{width:36px;min-width:36px;padding:0}.cb-button{height:36px}.cb-button-label,.cb-pill-address{display:none}}@keyframes cb-spin{to{transform:rotate(360deg)}}
19
- `);var _f='<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#c0)"><path d="M18 36C27.9411 36 36 27.9411 36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36Z" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.2903 2.57169L21.3525 5.63385V10.6471L25.3058 6.69381L29.6364 11.0244L25.7226 14.9381H18.2903C16.5992 14.9381 15.2283 16.309 15.2283 18.0003C15.2283 19.6915 16.5992 21.0624 18.2903 21.0624H25.6836L29.6365 25.0154L25.3059 29.3459L21.3525 25.3925V30.3666L18.2903 33.4288L15.2283 30.3666V25.4326L11.3148 29.3459L6.98426 25.0154L10.9372 21.0624H5.92394L2.86178 18.0003L5.92394 14.9381H10.8981L6.98437 11.0244L11.3149 6.69383L15.2283 10.6071V5.63385L18.2903 2.57169Z" fill="#000"/></g><defs><clipPath id="c0"><rect width="36" height="36" fill="#fff"/></clipPath></defs></svg>',Mf='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 28 28" fill="none"><g clip-path="url(#m0)"><path d="M26.07 26.93L20.06 25.07L15.53 27.88L12.37 27.88L7.83 25.07L1.83 26.93L0 20.53L1.83 13.44L0 7.44L1.83 0L11.21 5.81H16.69L26.07 0L27.9 7.44L26.07 13.44L27.9 20.53Z" fill="#FF5C16"/><path d="M7.83 20.54L11.96 23.8L7.83 25.07V20.54Z" fill="#FF5C16"/><path d="M20.06 20.54L15.93 23.8L20.06 25.07L20.06 20.54Z" fill="#FF5C16"/><path d="M11.63 15.14L12.78 22.85L11.19 18.56L5.77 17.17L7.83 15.14H11.63Z" fill="#E34807"/><path d="M16.27 15.14L15.12 22.85L16.71 18.56L22.13 17.17L20.07 15.14H16.27Z" fill="#E34807"/><path d="M0 20.53L1.83 13.44H5.76L5.77 17.17L11.19 18.56L12.78 22.85L11.96 23.79L7.83 20.53H0Z" fill="#FF8D5D"/><path d="M27.9 20.53L26.07 13.44H22.14L22.13 17.17L16.71 18.56L15.12 22.85L15.94 23.79L20.07 20.53H27.9Z" fill="#FF8D5D"/><path d="M16.69 5.81H11.21L10.84 9.81L12.78 22.85H15.12L17.06 9.81L16.69 5.81Z" fill="#FF8D5D"/><path d="M15.53 25.34V27.88H12.37V25.34H15.53Z" fill="#C0C4CD"/><path d="M7.83 25.07L12.37 27.88V25.34L11.96 23.79L7.83 25.07Z" fill="#E7EBF6"/><path d="M20.07 25.07L15.53 27.88V25.34L15.94 23.79L20.07 25.07Z" fill="#E7EBF6"/></g><defs><clipPath id="m0"><rect width="28" height="28" fill="#fff"/></clipPath></defs></svg>',Of='<svg width="100%" height="100%" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z" fill="#F3BA2F"/><path d="M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z" fill="#F3BA2F"/><path d="M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z" fill="#F3BA2F"/><path d="M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z" fill="#F3BA2F"/><path d="M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z" fill="#F3BA2F"/></svg>',Wf='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"/><path fill="#FF3D00" d="M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"/><path fill="#4CAF50" d="M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"/><path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"/></svg>',Df='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>';function ro(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var rr=ro(_f),ar=ro(Mf),ir=ro(Of),sr=ro(Wf),lr=ro(Df);import{jsx as wt,jsxs as ao}from"react/jsx-runtime";function Ll({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:i,onConnect:a,onDisconnect:s,onCopy:l,onSelectWallet:c,onBuy:d,onBuyDisabledMessage:g,label:m="Connect Wallet",connectingLabel:p="Connecting...",disconnectLabel:v,className:b,theme:w="dark",env:y,showBalance:L=!0,showPortfolio:u,drawerDirection:C,modal:R,connectorId:k,style:N,walletInfoStyle:G,sendTransaction:F,getTransactionReceipt:j,estimateGas:D,onReceive:V,onBridge:A,onSend:ne,bridgeTokens:B,bridgeHistory:q,getBridgeQuote:ue,getBridgeToTokens:ae,getBridgeApproval:Q,approveBridge:le,submitBridge:se}){let K=b?`cb-button ${b}`:"cb-button",z=b?`cb-pill ${b}`:"cb-pill";if(e)return ao("button",{type:"button",disabled:!0,className:K,style:N,"aria-busy":"true",children:[wt("span",{className:"cb-spinner","aria-hidden":"true"}),wt("span",{className:"cb-button-label",children:p})]});if(t){let X=o??Hf(n),Fe=n?Gf[n]:void 0;return ao(zn,{env:y,theme:w,drawerDirection:C,modal:R,showBalance:L,showPortfolio:u,walletAddress:t,accountName:r,sendAccounts:i,connectorId:k,onSelectWallet:c,onCopyAddress:l?(pe,xt)=>{xt&&l()}:void 0,onDisconnect:s,disconnectLabel:v,style:G,sendTransaction:F,getTransactionReceipt:j,estimateGas:D,onReceive:V,onBridge:A,onBuy:d,onBuyDisabledMessage:g,onSend:ne,bridgeTokens:B,bridgeHistory:q,getBridgeQuote:ue,getBridgeToTokens:ae,getBridgeApproval:Q,approveBridge:le,submitBridge:se,children:[wt(zn.Trigger,{asChild:!0,children:ao("button",{type:"button",className:z,style:N,"aria-label":`Connected with ${X}: ${El(t)}`,children:[Fe?wt("img",{src:Fe,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):wt("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),wt("span",{className:"cb-pill-address",children:El(t)})]})}),wt(zn.Content,{align:"end",sideOffset:8})]})}return ao("button",{type:"button",onClick:a,className:K,style:N,"aria-label":typeof m=="string"?m:"Connect Wallet",children:[wt(zf,{}),wt("span",{className:"cb-button-label",children:m})]})}function zf(){return ao("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[wt("path",{d:"M3.75 5.25H14.25C15.0784 5.25 15.75 5.92157 15.75 6.75V13.5C15.75 14.3284 15.0784 15 14.25 15H3.75C2.92157 15 2.25 14.3284 2.25 13.5V4.5C2.25 3.67157 2.92157 3 3.75 3H13.5",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),wt("path",{d:"M12 9.75H15.75V12.75H12C11.1716 12.75 10.5 12.0784 10.5 11.25C10.5 10.4216 11.1716 9.75 12 9.75Z",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),wt("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var Gf={google:sr,apple:lr,cross:rr,metamask:ar,binance:ir},Uf={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function Hf(e){return e?Uf[e]:"Wallet"}function El(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}import*as Al from"react";$(`.sb-button{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-border-hover: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-color: var(--ds-content-medium, rgba(0, 0, 0, .65));--sb-color-hover: var(--ds-content-high, rgba(0, 0, 0, .85));--sb-radius: 8px;--sb-height: 36px;--sb-padding: 1px 11px;--sb-gap: 4px;--sb-font-size: 14px;--sb-font-weight: 500;--sb-line-height: 21px;--sb-letter-spacing: 0;--sb-blur: 0px;--sb-border-width: 1px;--sb-icon-size: 18px;--sb-icon-hover-rotation: 180deg;--sb-spinner-size: 18px;--sb-spinner-thumb: currentColor;--sb-spinner-track: color-mix(in srgb, currentColor 20%, transparent);--sb-disabled-opacity: .6;--sb-press-scale: .95;--sb-hover-duration: .2s;--sb-icon-duration: .3s;--sb-easing: ease}.sb-button[data-theme=dark]{--sb-bg: var(--ds-surface-default, #1e232e);--sb-border: var(--ds-border-default, #ffffff12);--sb-border-hover: var(--ds-border-medium, #ffffff2e);--sb-color: var(--ds-content-medium, #ffffffa6);--sb-color-hover: var(--ds-content-high, #ffffffd9)}.sb-button[data-theme=light]{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, #00000012);--sb-border-hover: var(--ds-border-medium, #0000002e);--sb-color: var(--ds-content-medium, #000000a6);--sb-color-hover: var(--ds-content-high, #000000d9)}
20
- `);$(`.sb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--sb-height);gap:var(--sb-gap);padding:var(--sb-padding);border-radius:var(--sb-radius);border:var(--sb-border-width) solid var(--sb-border);background:var(--sb-bg);backdrop-filter:blur(var(--sb-blur));-webkit-backdrop-filter:blur(var(--sb-blur));color:var(--sb-color);font-family:Inter,system-ui,-apple-system,sans-serif;font-weight:var(--sb-font-weight);font-size:var(--sb-font-size);line-height:var(--sb-line-height);letter-spacing:var(--sb-letter-spacing);cursor:pointer;transition:border-color var(--sb-hover-duration) var(--sb-easing),color var(--sb-hover-duration) var(--sb-easing)}@media(hover:hover){.sb-button:hover:not(:disabled){border-color:var(--sb-border-hover);color:var(--sb-color-hover)}.sb-button:hover:not(:disabled) .sb-button-icon{transform:rotate(var(--sb-icon-hover-rotation))}}.sb-button:active:not(:disabled){transform:scale(var(--sb-press-scale))}.sb-button:disabled,.sb-button[aria-busy=true]{cursor:default;opacity:var(--sb-disabled-opacity)}.sb-button-icon{width:var(--sb-icon-size);height:var(--sb-icon-size);flex-shrink:0;color:inherit;transition:transform var(--sb-icon-duration) var(--sb-easing),color var(--sb-icon-duration) var(--sb-easing)}.sb-spinner{display:inline-block;width:var(--sb-spinner-size);height:var(--sb-spinner-size);border:2px solid var(--sb-spinner-track);border-top-color:var(--sb-spinner-thumb);border-radius:50%;animation:sb-spin .6s linear infinite;flex-shrink:0}.sb-label{white-space:nowrap}@keyframes sb-spin{to{transform:rotate(360deg)}}
21
- `);import{jsx as io,jsxs as jf}from"react/jsx-runtime";var ra="https://www.onechain.nexus/skills";function Pl({label:e="Skills",href:t=ra,onClick:n,className:o,style:r,theme:i,disabled:a=!1,isLoading:s=!1,loadingLabel:l="Loading...",openInNewTab:c=!1,type:d="button"}){let[g,m]=Al.useState(!1),p=async L=>{if(t&&!n){c?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t;return}if(n)try{m(!0),await n()}finally{m(!1)}},v=a||s||g,b=s||g,w=b?l:e,y=o?`sb-button ${o}`:"sb-button";return jf("button",{type:d,onClick:p,disabled:v,className:y,"data-theme":i,style:r,"aria-busy":b,children:[b?io("span",{className:"sb-spinner","aria-hidden":"true"}):io($f,{}),io("span",{className:"sb-label",children:w})]})}function $f(){return io("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:io("path",{d:"M15.5879 3.95142C16.0211 2.78097 17.6761 2.78099 18.1094 3.95142L19.6221 8.03833C20.6569 10.8348 22.8618 13.0396 25.6582 14.0745L29.7451 15.5872C30.9157 16.0204 30.9157 17.6754 29.7451 18.1086L25.6582 19.6213C22.8618 20.6562 20.657 22.861 19.6221 25.6575L18.1094 29.7444C17.6762 30.9149 16.0211 30.9149 15.5879 29.7444L14.0752 25.6575C13.0403 22.861 10.8355 20.6562 8.03906 19.6213L3.95215 18.1086C2.78172 17.6754 2.7817 16.0204 3.95215 15.5872L8.03906 14.0745C10.8355 13.0396 13.0403 10.8348 14.0752 8.03833L15.5879 3.95142Z",stroke:"currentColor",strokeWidth:"1.93556"})})}wr({mode:"dapp-ui"});export{lr as APPLE_ICON,ka as AppLauncher,Ba as AppLauncherContent,Na as AppLauncherTrigger,ir as BINANCE_ICON,Yo as BridgeFlow,bo as CONNECTOR_REGISTRY,rr as CROSSX_ICON,Ll as ConnectButton,Sr as ConnectorId,ra as DEFAULT_SKILLS_HREF,sr as GOOGLE_ICON,ar as METAMASK_ICON,Ls as PORTFOLIO_SECTIONS,oa as SOCIAL_REGISTRY,Po as SendFlow,Pl as SkillsButton,Or as TOKEN_STATS_QUERY_KEY,Mr as USER_BALANCE_QUERY_KEY,ta as WALLET_REGISTRY,Il as WalletConnectModal,zn as WalletInfo,Es as WalletPortfolio,On as WalletPortfolioBody,wr as announceAppLauncherUsage,$e as resolveEnvironment,go as useGlobalMenu,rn as useTokenBalance,an as useTokenStats,tr as useWalletDetect};
1
+ function yi(e){try{return import.meta.env?.[e]}catch{return}}function ki(e){if(!(typeof process>"u"))return process.env?.[e]}function je(e){if(e)return Si(e);let t=yi("VITE_CROSSX_ENVIRONMENT")??yi("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??ki("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??ki("CROSSX_ENVIRONMENT");return Si(t)}function Si(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}var hr="1.3.4";var co="__nexusCrossAppLauncherRuntime";function Ql(){if(typeof window>"u")return null;let e=window;return e[co]??(e[co]={mode:"dapp-ui"}),e[co]}function Yl(e){if(e.scheduled)return;e.scheduled=!0;let t=()=>{if(e.scheduled=!1,e.loggedMode!==e.mode){if(e.mode==="connect-kit-react"){let n=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${n} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${hr}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${hr} \uCD08\uAE30\uD654 \uC644\uB8CC (\uC0AC\uC6A9 \uBAA8\uB4DC: dapp-ui only)`);e.loggedMode=e.mode}};typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function br(e){let t=Ql();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Yl(t))}import*as In from"react";import*as Ri from"@radix-ui/react-popover";import{Drawer as tc}from"vaul";import{createContext as Zl,useContext as Xl}from"react";var wr=Zl(null);function po(){let e=Xl(wr);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import{useState as Jl,useEffect as ec}from"react";function Nn(e){let[t,n]=Jl(!1);return ec(()=>{let o=window.matchMedia(e);n(o.matches);let r=i=>n(i.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function Q(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}Q(`[data-theme=dark]{--al-bg: var(--ds-surface-default, #1e232e);--al-bg-hover: var(--ds-surface-medium, #252b39);--al-text: var(--ds-content-highest, #ffffff);--al-text-secondary: var(--ds-content-medium, #ffffffa6);--al-border: var(--ds-border-default, #ffffff12);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .7));--al-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #3a261f;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #123235);--al-badge-text: var(--ds-accent-primary-default, #00ceb2);--al-drawer-overlay: var(--ds-overlay-dim, #000000b3)}[data-theme=light]{--al-bg: var(--ds-surface-default, #ffffff);--al-bg-hover: var(--ds-surface-medium, #f5f7fa);--al-text: var(--ds-content-highest, #000000);--al-text-secondary: var(--ds-content-medium, #000000a6);--al-border: var(--ds-border-default, #00000012);--al-shadow: var(--ds-shadow-modal, 0px 4px 30px -1px rgba(0, 0, 0, .15));--al-primary: #f3742e;--al-primary-hover: #ff8a4a;--al-primary-soft: #fff1eb;--al-new-ribbon-bg: #ed0a72;--al-badge-bg: var(--ds-accent-primary-low, #e7f9f8);--al-badge-text: var(--ds-accent-primary-default, #00b4b7);--al-drawer-overlay: var(--ds-overlay-dim, #00000080)}
2
+ `);Q(`.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
+ `);Q(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
+ `);Q(`.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
+ `);Q("");import{jsx as xr}from"react/jsx-runtime";function Ci({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let i=Nn(`(max-width: ${n}px)`),[a,s]=In.useState(!1),c=In.useCallback(()=>s(!1),[]),l=je(e),d=In.useMemo(()=>({env:l,theme:t,isMobile:i,open:a,domain:o,close:c}),[l,t,i,a,o,c]);return xr(wr.Provider,{value:d,children:i?xr(tc.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:r},"drawer"):xr(Ri.Root,{open:a,onOpenChange:s,children:r},"popover")})}import*as Li from"@radix-ui/react-popover";import{Drawer as oc}from"vaul";import{jsx as at,jsxs as nc}from"react/jsx-runtime";function Ti({size:e=18}){return nc("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[at("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),at("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Ni(){return at("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ii(){return at("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as fo}from"react/jsx-runtime";function Ei({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:i}=po(),a=t!=null,s=e??!0,c=n?`al-trigger-btn ${n}`:"al-trigger-btn",l=a?t:fo("button",{type:"button",className:c,"data-theme":i,style:o,children:fo(Ti,{size:18})});return r?fo(oc.Trigger,{asChild:s,children:l}):fo(Li.Trigger,{asChild:s,children:l})}import*as gn from"react";import*as mo from"@radix-ui/react-popover";import{Drawer as Ln}from"vaul";import{useQuery as ac}from"@tanstack/react-query";var Ai={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 rc="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",ic="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function mt(e,t){return`${e==="production"?ic:rc}/${t}.png`}function Pi(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:mt(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:mt(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:mt(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:mt(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:mt(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:mt(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:mt(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:mt(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:mt(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"points",label:"Points",description:"Dive into CROSS World, Earn CROSS Points",url:{dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://onechain.nexus/points"},iconUrl:mt(t,"point"),order:1e4,type:"points",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:mt(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:mt(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function uo(e){let t=je(e);return ac({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(Ai[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 Pi(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function vr(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function Bi(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function _i(e){return[...e].sort((t,n)=>{let o=Fi(t)-Fi(n);return o!==0?o:t.order-n.order})}function Fi(e){let t=vr(e);return t==="comingSoon"?0:t==="ending"?2:1}function le(...e){return e.filter(Boolean).join(" ")}import{jsx as Fe,jsxs as En}from"react/jsx-runtime";function sc(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Oi({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:i,domain:a,close:s}=po(),{data:c}=uo(o),l=gn.useMemo(()=>_i(c?.items??[]),[c?.items]),d=8,m=gn.useRef(null),w=gn.useCallback(y=>{m.current={x:y.clientX,y:y.clientY}},[]),b=typeof window<"u"?window.location.pathname:"",x=gn.useCallback((y,C)=>{if(m.current){let S=y.clientX-m.current.x,T=y.clientY-m.current.y;if(m.current=null,Math.abs(S)>d||Math.abs(T)>d)return}let f=C.url[o]??C.url.production,N=Mi(f,a);if(!N)try{let S=new URL(f).pathname;if(b===S||b.startsWith(S+"/")){s();return}}catch{}N?window.open(f,"_blank","noopener,noreferrer"):window.location.href=f,s()},[o,a,s,b]),u=y=>{let C=y.url[o]??y.url.production,f=Mi(C,a),N=vr(y),S=N==="ending",T=Bi(y.iconUrl,o),R=!1;if(!f)try{let U=new URL(C).pathname;R=b===U||b.startsWith(U+"/")}catch{R=!1}return Fe("button",{type:"button",className:"al-grid-item","data-active":R||void 0,"data-service-status":N,onPointerDown:w,onClick:U=>x(U,y),children:En("div",{className:"al-grid-item-left",children:[En("div",{className:"al-grid-item-icon",children:[Fe("img",{src:T,alt:y.label,width:24,height:24,loading:"lazy"}),y.isNew&&Fe("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),En("span",{className:"al-grid-item-text",children:[Fe("span",{className:"al-grid-item-label",children:y.label}),S&&Fe("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),y.badge&&!sc(y)&&Fe("span",{className:"al-badge al-badge-list",children:y.badge})]})]})},y.id)},h=Fe("div",{className:"al-menu","data-theme":r,children:Fe("div",{className:"al-grid",children:l.map(u)})});return i?En(Ln.Portal,{children:[Fe(Ln.Overlay,{className:"al-drawer-overlay"}),En(Ln.Content,{className:le("al-drawer-content",n),"data-theme":r,children:[En("div",{className:"al-drawer-header",children:[Fe(Ln.Close,{className:"al-drawer-close",children:Fe(Ni,{})}),Fe(Ln.Title,{className:"al-drawer-title",children:"CROSS Services"}),Fe(Ln.Close,{className:"al-drawer-close",children:Fe(Ii,{})})]}),Fe("div",{className:"al-drawer-body",children:h})]})]}):Fe(mo.Portal,{children:Fe(mo.Content,{align:e,sideOffset:t,className:le("al-popover-content",n),"data-theme":r,children:h})})}function Mi(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}import*as Qe from"react";import*as pl from"@radix-ui/react-popover";import{Drawer as Rf}from"vaul";import{createContext as lc,useContext as cc}from"react";var yr=lc(null);function tn(){let e=cc(yr);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var kr=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(kr||{}),go={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 Na from"react";import{jsx as ne,jsxs as jn}from"react/jsx-runtime";function Wi({size:e=16,className:t}){return jn("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("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"}),ne("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 $n({size:e=16,className:t}){return ne("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("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 hn({size:e=16,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("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 ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Di({size:e=20,className:t}){return jn("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("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"}),ne("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 ho({size:e=20,className:t}){return ne("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:ne("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 bn({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function wn({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function zi({size:e=16,className:t}){return jn("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("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"}),ne("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 Gi({size:e=16,className:t}){return jn("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("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"}),ne("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Hi({size:e=42,className:t}){return ne("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:ne("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 Ui({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("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 $i({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("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 ji({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("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 Vi({size:e=20,className:t}){return ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:ne("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 qi({size:e=20,className:t}){return jn("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[ne("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),ne("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 O from"react";import xn from"bignumber.js";function dc(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 nn(e,t){if(!e||e==="0")return"0.00";let n=new xn(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,xn.ROUND_DOWN)}function st(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Sr(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 Ki(e,t,n){let r=new xn(e).shiftedBy(-t).multipliedBy(new xn(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(xn.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,xn.ROUND_DOWN):r.decimalPlaces(4,xn.ROUND_DOWN)).toFormat()}`}function Qi(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=dc(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 pc}from"react";import{useQuery as fc}from"@tanstack/react-query";var Ze={dev:"https://stg-wallet-server.crosstoken.io/api",stage:"https://stg-wallet-server.crosstoken.io/api",production:"https://wallet-server.crosstoken.io/api"},xe={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},An="https://terms.crosstoken.io/docs/cross-terms-of-use",bo="https://terms.crosstoken.io/docs/nexus-privacy-policy";var uc="send:chain-info";function mc(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 Rr(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function gc(e,t,n,o){if(o)return t===xe[e].cross?Yi(t,o):n?.explorer_url?Rr(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):hc(e,t,o)}function Yi(e,t){return Rr("https://explorer.onechain.nexus",String(e),"tx",t)}function hc(e,t,n){let o=xe[e];if(t===o.cross)return Yi(t,n);if(t===o.bsc)return Rr(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function wo(e,t,n,o=!0){let r=Ze[e],i=fc({queryKey:[uc,e,t],queryFn:async({signal:c})=>{let l=await fetch(`${r}/v1/public/chain/info/${t}`,{cache:"no-store",signal:c});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 mc(d)},enabled:o,staleTime:300*1e3}),a=i.data;return{transactionUrl:pc(()=>gc(e,t,a,n),[t,a,e,n]),chainInfo:a,...i}}var Zi="0x0000000000000000000000000000000000000001";var bc="0xa9059cbb",wc=/^0x[a-fA-F0-9]{40}$/,xc="nexus-cross:dapp-ui:send:recent:",Xi=10;function vc(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Vn(e){return e.toLowerCase()}function Wt(e){return wc.test(e)}function on(e){return Vn(e.address)===Zi}function Cr(e){return`${xc}${e.toLowerCase()}`}function Pn(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Cr(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,Xi):[]}catch{return[]}}function Tr(e,t){if(typeof window>"u")return[];let n=Vn(t),o=[{address:n,updatedAt:Date.now()},...Pn(e).filter(r=>r.address!==n)].slice(0,Xi);try{window.localStorage.setItem(Cr(e),JSON.stringify(o))}catch{return Pn(e)}return o}function Nr(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Cr(e))}catch{}}function Zt(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 qn(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=vc(i.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Ir(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${bc}${n}${o}`}function xo(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 Lr(e,t){return xo(e,t,6)}function Ji(e){return xo(e,9,2)}function ea(e){return e.toLocaleString("en-US")}function vo(e){return e===56||e===97}function yo(e){return e.gasPrice??e.maxFeePerGas}function ta(e,t=!1){return t?yo(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function ko(e,t=!1){if(t){let n=yo(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 So(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function na(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(na(n.cause,t+1)),o.join(`
6
+ `).toLowerCase()}function yc(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 Er(e,t={},n="Failed to send transaction."){let o=na(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.":yc(e)||n}var kc=2000000000n,Sc=1000000000n;async function Ro(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 Co(e){return BigInt(e)}function Rc(e){return`0x${e.toString(16)}`}function Cc(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Rc(e.value)),e.data&&(t.data=e.data),t}function Tc(e){return e===56||e===97}async function oa(e){try{let t=await Ro(e,"eth_gasPrice",[]);return{gasPrice:Co(t)}}catch{return{gasPrice:kc}}}async function Nc(e,t){let n=Sc;try{let o=await Ro(e,"eth_maxPriorityFeePerGas",[]);n=Co(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Ic(e,t){if(t)return oa(e);let n;try{n=(await Ro(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Nc(e,Co(n)):oa(e)}async function ra(e,t){let n=Tc(t.chainId),o=Cc(t),[r,i]=await Promise.all([Ro(e,"eth_estimateGas",[o]),Ic(e,n)]);return{gasLimit:Co(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function ia(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 ra(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 Lc=1500,Ec=120;function aa(e){return!!(e.token||e.recipient||e.amount)}function Ar({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},i=e.trim(),a=Zt(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.")),!on(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 Pr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return on(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Vn(e.address),data:Ir(n,o),value:0n,chainId:e.chainId,from:r}}function Ac(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Pc=e=>new Promise(t=>setTimeout(t,e));async function sa({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Lc,pollMaxAttempts:i=Ec}){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 Ac(l)?"reverted":"success";await Pc(r)}return"timeout"}var la=["token","recipient","amount","review"];function ca(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:i="recipient",token:a,tokens:s=[],onTokenChange:c,sendTransaction:l,getTransactionReceipt:d,estimateGas:m,getTokenPriceUsd:w,onSubmitted:b,onSuccess:x,onFailed:u,onExit:h,onOutlink:y}=e,C=O.useMemo(()=>ia({sendTransaction:l,getTransactionReceipt:d,estimateGas:m}),[l,d,m]),[f,N]=O.useState(a);O.useEffect(()=>{N(a)},[a.address,a.chainId]);let[S,T]=O.useState(i),[R,U]=O.useState(""),[D,z]=O.useState(""),[F,oe]=O.useState({}),[L,Z]=O.useState("idle"),[G,K]=O.useState(""),[ie,me]=O.useState(""),[$,se]=O.useState(null),[de,j]=O.useState(!1),[Le,B]=O.useState(""),J=O.useRef(0),[V,re]=O.useState(null),[fe,ct]=O.useState(""),[vt,Ye]=O.useState(()=>Pn(n)),Kt=O.useMemo(()=>je(t),[t]),{transactionUrl:Ee,chainInfo:ve}=wo(Kt,f.chainId,G||void 0,!0),dt=ve?.currency_symbol??"",Ae=ve?.name??`Chain ID ${f.chainId}`,_e=O.useRef({nativeSymbol:dt||void 0,networkName:Ae,tokenSymbol:f.symbol});_e.current={nativeSymbol:dt||void 0,networkName:Ae,tokenSymbol:f.symbol};let ye=O.useMemo(()=>BigInt(f.quantity.numeric||"0"),[f.quantity.numeric]),Ft=O.useMemo(()=>nn(f.quantity.numeric,f.quantity.decimals),[f.quantity.numeric,f.quantity.decimals]),yt=w?.(f),Bt=O.useMemo(()=>{if(yt===void 0)return;let E=parseFloat(D.replace(/,/g,""));return Number.isFinite(E)?E*yt:0},[D,yt]);O.useEffect(()=>{z(""),oe({})},[f.address,f.chainId]),O.useEffect(()=>{J.current+=1,se(null),B(""),j(!1)},[f.address,f.chainId,R,D]),O.useEffect(()=>{Ye(Pn(n))},[n]);let et=O.useCallback(E=>{U(E),oe(ee=>({...ee,recipient:void 0}))},[]),_t=O.useCallback(E=>{z(E),oe(ee=>({...ee,amount:void 0}))},[]),tt=O.useCallback(()=>{z(Ft.replace(/,/g,"")),oe(E=>({...E,amount:void 0}))},[Ft]),ke=O.useCallback(E=>{N(E),c?.(E),T("recipient")},[c]),nt=O.useCallback(()=>T("token"),[]),pt=O.useCallback(()=>{T(E=>{if(E==="result")return"review";if(E===i)return h?.(),E;let ee=la.indexOf(E);return ee<=0?(h?.(),E):la[ee-1]})},[i,h]),ze=O.useCallback(()=>{let{errors:E}=Ar({recipient:R,amount:"1",token:f,balanceRaw:ye});if(E.recipient){oe(ee=>({...ee,recipient:E.recipient}));return}oe(ee=>({...ee,recipient:void 0})),T("amount")},[R,f,ye]),kt=O.useCallback(E=>{U(E),oe(ee=>({...ee,recipient:void 0})),T("amount")},[]),we=O.useCallback(()=>{let E=Ar({recipient:R,amount:D,token:f,balanceRaw:ye});oe(E.errors),!(aa(E.errors)||E.rawAmount===void 0||!E.recipient)&&(re(E.rawAmount),ct(E.recipient),se(null),B(""),Z("idle"),T("review"))},[R,D,f,ye]);O.useEffect(()=>{if(S!=="review"||!fe||V===null||$!==null||de||Le||!C.canEstimateGas(ve?.rpc))return;let E=++J.current;j(!0),B(""),(async()=>{try{let ee=Pr({token:f,walletAddress:n,recipient:fe,rawAmount:V}),ge=await C.estimateGas(ee,ve?.rpc);if(J.current!==E)return;se(ge)}catch(ee){if(J.current!==E)return;B(Er(ee,_e.current,"Failed to estimate gas."))}finally{J.current===E&&j(!1)}})()},[S,fe,V,$,de,Le,C,ve?.rpc,f,n]);let Te=O.useMemo(()=>{if(!on(f)||!$||V===null)return!1;let E=ko($,vo(f.chainId));return E===null?!1:V+E>ye},[f,$,V,ye]),Mt=O.useCallback(async()=>{if(!(!fe||V===null)&&!Te){me(""),K(""),Z("submitting");try{let E="",ee=await sa({repository:C,args:Pr({token:f,walletAddress:n,recipient:fe,rawAmount:V}),chainId:f.chainId,onSubmitted:ge=>{E=ge,K(ge),Z("confirming"),Ye(Tr(n,fe)),b?.({txHash:ge,chainId:f.chainId,amount:D,tokenSymbol:f.symbol,recipient:fe})}});if(ee==="success")Z("success"),E&&x?x?.(E):T("result");else if(ee==="reverted"){let ge="Transaction reverted on-chain.";Z("error"),me(ge),E&&u?u({txHash:E,chainId:f.chainId,message:ge}):T("result")}else{let ge="Transaction receipt was not found. Please check again later.";Z("error"),me(ge),E&&u?u({txHash:E,chainId:f.chainId,message:ge}):T("result")}}catch(E){Z("error"),me(Er(E,{nativeSymbol:dt||void 0,networkName:Ae,tokenSymbol:f.symbol})),T("result")}}},[C,fe,V,Te,f,D,n,b,x,u,dt,Ae]),[St,Ge]=O.useState(!1),ft=O.useRef(void 0);O.useEffect(()=>()=>clearTimeout(ft.current),[]);let Rt=O.useCallback(async()=>{if(G)try{await navigator.clipboard.writeText(G),Ge(!0),clearTimeout(ft.current),ft.current=setTimeout(()=>Ge(!1),2e3)}catch{}},[G]),Ne=O.useCallback(()=>{if(!Ee||!G)return;let E=ot=>{typeof window<"u"&&window.open(ot,"_blank","noopener,noreferrer")};if(!y){E(Ee);return}let ee=y(Ee,{category:"send",origin:"send-transaction",payload:{chainId:f.chainId,txHash:G}});if(ee&&typeof ee.then=="function"){let ot=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;ee.then(Qt=>{if(Qt===null){ot?.close();return}let rt=Qt??Ee;if(ot)try{ot.location.href=rt}catch{ot.close(),E(rt)}else E(rt)});return}let ge=ee;ge!==null&&E(ge??Ee)},[y,f.chainId,Ee,G]),Pe=O.useCallback(()=>{me(""),K(""),Z("idle"),se(null),B(""),T("review")},[]);return{step:S,status:L,token:f,tokens:s.length>0?s:[f],recipient:R,amount:D,amountUsd:Bt,fieldErrors:F,error:ie,txHash:G,gasEstimate:$,gasLoading:de,gasError:Le,insufficientGas:Te,reviewRawAmount:V,reviewRecipient:fe,recentAddresses:vt,accounts:r,accountName:o,walletAddress:n,resolvedEnv:Kt,transactionUrl:Ee,networkName:Ae,nativeSymbol:dt,nativeDecimals:ve?.currency_decimals??f.quantity.decimals,balanceRaw:ye,balanceText:Ft,priceUsd:yt,canSelectToken:(s.length>0?s:[f]).length>1,canSend:C.canSend,getTokenPriceUsd:w,setRecipient:et,setAmount:_t,setMax:tt,selectToken:ke,goToTokenSelect:nt,selectRecipient:kt,submitRecipient:ze,submitAmount:we,confirmSend:Mt,retry:Pe,back:pt,hashCopied:St,copyHash:Rt,openTransaction:Ne}}import*as Tt from"react";import{jsx as Kn,jsxs as Fr}from"react/jsx-runtime";function da({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:i,token:a,setMax:s}=e,c=Tt.useRef(null),l=Tt.useCallback(()=>{requestAnimationFrame(()=>{let u=c.current;if(!u)return;let h=u.value.length;u.setSelectionRange(h,h)})},[]);Tt.useEffect(()=>{c.current?.focus(),l()},[l]),Tt.useEffect(()=>{t===""&&(w(!1),l())},[t,l]);let d=Tt.useMemo(()=>{let u=Zt(t,a.quantity.decimals);return"value"in u&&u.value>i},[t,a.quantity.decimals,i]),[m,w]=Tt.useState(!1),b=!m&&t===""?"0.00":t,x=t.trim()===""||t.trim()==="0";return Kn("div",{className:"sf-body sf-amount",children:Fr("div",{className:"sf-amount-center",children:[Kn("span",{className:"sf-amount-usd",children:o!==void 0?So(o):"\xA0"}),Kn("div",{className:"sf-amount-input-wrap","data-over":d||void 0,"data-empty":x||void 0,onClick:()=>c.current?.focus(),children:Kn("input",{ref:c,className:"sf-amount-input",value:b,onChange:u=>{let h=u.target.value;if(m)n(h);else if(t===""){if(h.length<4)return;w(!0);let y=h.startsWith("0.00")?h.slice(4):h;n(y)}else w(!0),n(h)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),Fr("div",{className:"sf-amount-balance",children:[Kn("span",{children:"Balance:"}),Fr("button",{type:"button",className:"sf-amount-max",onClick:s,children:[r," ",a.symbol]})]})]})})}import*as Nt from"react";var Fc=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function fa(e){return Fc.has(e.toLowerCase())}var Br={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},pa={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Qn(e,t){let n=xe[e];if(t===n.cross)return pa.cross;if(t===n.bsc)return pa.bsc}var Bc={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Xt(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:i="png"}=n,a=Bc[e],s=r?`&bg=${r}`:"";return`${a}/portrait/evm/${t}.${i}?size=${o}${s}`}import{jsx as gt,jsxs as To}from"react/jsx-runtime";function ua({size:e=20,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[gt("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),gt("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function ma({size:e=20,className:t}){return gt("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:gt("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 ga({size:e=20,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[gt("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),gt("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function ha({size:e=16,className:t}){return gt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:gt("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function ba({size:e=56,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[gt("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),gt("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 wa({size:e=56,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[gt("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),gt("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as Se,jsxs as Dt}from"react/jsx-runtime";function xa(e,t){return e.name||`Account ${(e.index??t)+1}`}function va(e){return e.trim().slice(0,1).toUpperCase()||"A"}function ya(e){return e.toLowerCase()}function ka({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:i,walletAddress:a,resolvedEnv:s,selectRecipient:c}=e,l=Nt.useMemo(()=>i.filter(f=>f.address.toLowerCase()!==a.toLowerCase()),[i,a]),d=l.length>0,m=Nt.useMemo(()=>new Map(l.map((f,N)=>[ya(f.address),{account:f,index:N}])),[l]),[w,b]=Nt.useState("recent"),x=Nt.useRef(null);Nt.useEffect(()=>{x.current?.focus()},[]);let u="1A1A2E",h=Nt.useCallback(async()=>{try{let f=await navigator.clipboard.readText();f&&n(f.trim())}catch{}},[n]),y=t.trim().length>0,C=Wt(t.trim());return Dt("div",{className:"sf-recipient",children:[Dt("div",{className:"sf-recipient-top",children:[Dt("div",{className:"sf-address-field","data-filled":y||void 0,"data-invalid":o.recipient||void 0,children:[Se("textarea",{ref:x,className:"sf-address-input",value:t,onChange:f=>n(f.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:y?2:1}),y?Se("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:Se(ga,{size:20})}):Se("button",{type:"button",className:"sf-address-action",onClick:h,"aria-label":"Paste from clipboard",children:Se(ma,{size:20})})]}),o.recipient&&Se("p",{className:"sf-field-error",role:"alert",children:o.recipient}),Dt("div",{className:"sf-tabs",role:"tablist",children:[Se("button",{type:"button",role:"tab",className:"sf-tab","data-active":w==="recent"||void 0,"aria-selected":w==="recent",onClick:()=>b("recent"),children:"Recent"}),d&&Se("button",{type:"button",role:"tab",className:"sf-tab","data-active":w==="account"||void 0,"aria-selected":w==="account",onClick:()=>b("account"),children:"My Account"})]})]}),Se("div",{className:"sf-address-list",children:w==="account"&&d?l.map((f,N)=>{let S=xa(f,N),T=Xt(s,f.address,{size:56,bg:u});return Dt("button",{type:"button",className:"sf-address-row",onClick:()=>c(f.address),children:[Dt("span",{className:"sf-address-avatar",children:[T&&Se("img",{src:T,alt:"",width:40,height:40,draggable:!1,onError:R=>{R.currentTarget.style.display="none"}}),Se("span",{className:"sf-address-avatar-fallback",children:va(S)})]}),Dt("span",{className:"sf-address-meta",children:[Se("span",{className:"sf-address-name",children:S}),Se("span",{className:"sf-address-value",children:st(f.address)})]})]},f.address)}):r.length>0?r.map(f=>{let N=m.get(ya(f.address)),S=N?xa(N.account,N.index):st(f.address),T=Xt(s,f.address,{size:56,bg:u});return Dt("button",{type:"button",className:"sf-address-row",onClick:()=>c(f.address),children:[Dt("span",{className:"sf-address-avatar",children:[T&&Se("img",{src:T,alt:"",width:40,height:40,draggable:!1,onError:R=>{R.currentTarget.style.display="none"}}),Se("span",{className:"sf-address-avatar-fallback",children:va(S)})]}),Dt("span",{className:"sf-address-meta",children:[Se("span",{className:"sf-address-name",children:S}),Se("span",{className:"sf-address-value",children:st(f.address)})]})]},f.address)}):Se("div",{className:"sf-empty",children:"No send history"})}),y&&!C&&!o.recipient&&Se("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as Ve,jsxs as Fn}from"react/jsx-runtime";function Ra({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:i,openTransaction:a}=e,s=t==="error",c=t==="success";return s?Fn("div",{className:"sf-body sf-result sf-result--error",children:[Ve("span",{className:"sf-result-icon",children:Ve(wa,{size:56})}),Fn("div",{className:"sf-result-copy",children:[Ve("h3",{className:"sf-result-title",children:"Transaction Failed"}),Ve("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&Ve(Sa,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]}):Fn("div",{className:"sf-body sf-result",children:[Ve("span",{className:"sf-result-icon","data-pending":!c||void 0,children:c?Ve(ba,{size:56}):Ve("span",{className:"sf-result-spinner"})}),Fn("div",{className:"sf-result-copy",children:[Ve("h3",{className:"sf-result-title",children:c?"Transaction Complete":"Transaction in Progress"}),Ve("p",{className:"sf-result-desc",children:c?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&Ve(Sa,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]})}function Sa({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return Fn("div",{className:"sf-result-hash-card",children:[Ve("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),Fn("div",{className:"sf-result-hash-row",children:[Ve("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:st(e)}),Ve("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?Ve(hn,{size:16}):"Copy"})]})]})}import{jsx as he,jsxs as qe}from"react/jsx-runtime";var No="\u2014";function Ca({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:i,walletAddress:a,networkName:s,nativeSymbol:c,nativeDecimals:l,gasEstimate:d,gasLoading:m,gasError:w,insufficientGas:b,error:x,resolvedEnv:u}=e,h=on(t),y=n!==null?xo(n,t.quantity.decimals):"",C=r?.trim()||`Account ${(i[0]?.index??0)+1}`,f=Xt(u,a,{size:56,bg:"1A1A2E"}),N=c||(h?t.symbol:""),S=vo(t.chainId),T=d?ta(d,S):null,R=d?ko(d,S):null,U=L=>L!==null&&N?`${Lr(L,l)} ${N}`:No,D=L=>L!==void 0?`${Ji(L)} Gwei`:No,z=(()=>{if(!h||!d||R===null||n===null)return No;let L=n+R;return`${Lr(L,l)} ${N||t.symbol}`})(),F=L=>m?"\u2026":L,oe=[{label:"Est. Tx Fee",value:F(U(R))},...T==="dynamic"?[{label:"Max Priority Fee",value:F(D(d?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:F(D(d?.maxFeePerGas))}]:T==="legacy"?[{label:"Gas Price",value:F(D(d?yo(d):void 0))}]:[],{label:"Gas Limit",value:F(d?ea(d.gasLimit):No)}];return qe("div",{className:"sf-body sf-review",children:[qe("div",{className:"sf-review-amount",children:[he("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:L=>{L.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),qe("span",{className:"sf-review-amount-value",children:[y,he("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),qe("div",{className:"sf-review-parties",children:[qe("div",{className:"sf-review-card sf-review-party",children:[he("span",{className:"sf-review-party-label",children:"From"}),qe("div",{className:"sf-review-party-head",children:[he("span",{className:"sf-review-party-avatar",children:f&&he("img",{src:f,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),he("span",{className:"sf-review-party-name",children:C})]}),he("span",{className:"sf-review-party-addr",children:a})]}),he("span",{className:"sf-review-arrow","aria-hidden":!0,children:he(ha,{size:16})}),qe("div",{className:"sf-review-card sf-review-party",children:[he("span",{className:"sf-review-party-label",children:"To"}),he("span",{className:"sf-review-party-addr",children:o})]})]}),qe("section",{className:"sf-review-card",children:[he("h3",{className:"sf-review-section-title",children:"Summary"}),qe("div",{className:"sf-review-row",children:[he("span",{className:"sf-review-row-label",children:"Network"}),he("span",{className:"sf-review-row-value",children:s})]}),oe.map(L=>qe("div",{className:"sf-review-row",children:[he("span",{className:"sf-review-row-label",children:L.label}),he("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),qe("section",{className:"sf-review-card",children:[he("h3",{className:"sf-review-section-title",children:"Total"}),qe("div",{className:"sf-review-row",children:[he("span",{className:"sf-review-row-label",children:"Total Amount"}),qe("span",{className:"sf-review-row-value",children:[y," ",t.symbol]})]}),h&&qe("div",{className:"sf-review-row",children:[he("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),he("span",{className:"sf-review-row-value",children:F(z)})]})]}),b&&!w&&!x&&qe("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",N||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(w||x)&&he("div",{className:"sf-message sf-message--error",role:"alert",children:w||x})]})}import*as Io from"react";import{jsx as rn,jsxs as vn}from"react/jsx-runtime";function Ta({flow:e}){let[t,n]=Io.useState(""),o=t.trim().toLowerCase(),r=Io.useMemo(()=>o?e.tokens.filter(i=>i.symbol.toLowerCase().includes(o)||i.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return vn("div",{className:"sf-body sf-token-select",children:[vn("div",{className:"sf-search",children:[rn(ua,{size:20}),rn("input",{className:"sf-search-input",value:t,onChange:i=>n(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),vn("div",{className:"sf-token-list",children:[r.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=Qn(e.resolvedEnv,i.chainId),c=e.getTokenPriceUsd?.(i);return vn("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),children:[vn("span",{className:"sf-token-left",children:[vn("span",{className:"sf-token-icon-wrap",children:[rn("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&&rn("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"}})]}),rn("span",{className:"sf-token-name",children:i.symbol})]}),vn("span",{className:"sf-token-right",children:[rn("span",{className:"sf-token-balance",children:nn(i.quantity.numeric,i.quantity.decimals)}),c!==void 0&&rn("span",{className:"sf-token-price",children:So(c)})]})]},a)}),r.length===0&&rn("div",{className:"sf-empty",children:"No tokens found"})]})]})}Q(`.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
+ `);import{jsx as Be,jsxs as Lo}from"react/jsx-runtime";var _c={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Eo({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...i}){let a=Na.useCallback(y=>{o?.(y),n?.(y)},[n,o]),c=ca({...i,onSuccess:o||n?a:void 0,onExit:t}),{step:l,status:d}=c,m=Wt(c.recipient.trim()),w=Zt(c.amount,c.token.quantity.decimals),b="value"in w&&w.value<=c.balanceRaw,x=d==="submitting"||d==="confirming",u=l!=="result",h=_c[l]??"";return Lo("div",{className:le("sf-root",r),"data-step":l,children:[Lo("header",{className:"sf-header",children:[u?Be("button",{type:"button",className:"sf-header-btn",onClick:c.back,"aria-label":"Back",children:Be(bn,{size:24})}):Be("span",{className:"sf-header-btn","aria-hidden":!0}),Be("span",{className:"sf-header-title",children:h}),Be("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:Be(Ot,{size:24})})]}),l==="token"&&Be(Ta,{flow:c}),l==="recipient"&&Be(ka,{flow:c}),l==="amount"&&Be(da,{flow:c}),l==="review"&&Be(Ca,{flow:c}),l==="result"&&Be(Ra,{flow:c}),Lo("footer",{className:"sf-footer","data-step":l,children:[l==="recipient"&&Be("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.submitRecipient,"data-disabled":!m||void 0,"aria-disabled":!m,children:"Next"}),l==="amount"&&Be("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.submitAmount,"data-disabled":!b||void 0,"aria-disabled":!b,children:"Next"}),l==="review"&&Lo("div",{className:"sf-footer-row",children:[Be("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:c.back,disabled:x,children:"Cancel"}),Be("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.confirmSend,disabled:x||!c.canSend||c.insufficientGas,children:x?"Sending...":"Send"})]}),l==="result"&&d==="success"&&Be("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(c.txHash||void 0),children:"All done"}),l==="result"&&d==="error"&&Be("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:c.retry,children:"Try Again"})]})]})}import*as Ia from"@radix-ui/react-popover";import{Drawer as Mc}from"vaul";import{jsx as Ao,jsxs as Oc}from"react/jsx-runtime";function La({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:i}=tn(),a=n!=null,s=e??!0,c=a?n:Oc("button",{type:"button",className:le("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[Ao(Wi,{size:o?14:16}),Ao("span",{className:"wi-trigger-address",children:st(i)})]});return o?Ao(Mc.Trigger,{asChild:s,children:c}):Ao(Ia.Trigger,{asChild:s,children:c})}import*as W from"react";import*as Xo from"@radix-ui/react-popover";import{Drawer as Yo}from"vaul";import Jn from"bignumber.js";import{useQueries as Wc}from"@tanstack/react-query";import{useMemo as Dc}from"react";var _r="user-balance";async function zc(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 an(e,t,n=!0){let o=Ze[e],r=xe[e],i=[r.cross,r.bsc],a=Wc({queries:i.map(d=>({queryKey:[_r,e,t,d],queryFn:({signal:m})=>zc(o,d,t,m),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),s=a.some(d=>d.isLoading),c=a.some(d=>d.isError);return{tokens:Dc(()=>{let d=[];for(let m of a)m.data&&d.push(...m.data);return d},[a]),isLoading:s,isError:c}}import{useQuery as Gc,useQueries as Hc}from"@tanstack/react-query";import{useMemo as Uc}from"react";var $c="forge-holdings",jc="forge-token-image";async function Vc(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 qc(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 Ea(e,t,n=!0){let o=Br[e],{data:r,...i}=Gc({queryKey:[$c,e,t],queryFn:({signal:a})=>Vc(o,t,a),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:r??[],...i}}function Aa(e,t,n=!0){let o=Br[e],r=Hc({queries:t.map(a=>({queryKey:[jc,e,a],queryFn:({signal:s})=>qc(o,a,s),enabled:n,staleTime:1/0}))});return{imageMap:Uc(()=>{let a=new Map;for(let s of r)s.data&&a.set(s.data.address,s.data.image_url);return a},[r])}}import{useQuery as Kc}from"@tanstack/react-query";import{useMemo as Qc}from"react";var Mr="token-stats";function It(e,t){return`${e}:${t.toLowerCase()}`}function sn(e,t=!0){let n=Ze[e],{data:o,...r}=Kc({queryKey:[Mr,e],queryFn:async({signal:a})=>{let s=await fetch(`${n}/v1/public/token/stats`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token stats API error: ${c.code}`);return c},enabled:t,staleTime:3e4});return{statsMap:Qc(()=>{let a=new Map;if(!o?.data)return a;for(let s of o.data){let c=It(s.chain_id,s.address);a.set(c,s)}return a},[o]),...r}}import{useQuery as Yc}from"@tanstack/react-query";var Zc="crossd-apy",Xc="https://crossd-dashboard-api.crossdefi.io/api/v1/overview";function Pa(){let{data:e,...t}=Yc({queryKey:[Zc],queryFn:async({signal:n})=>{let o=await fetch(Xc,{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 APY");return i*100},staleTime:6e4});return{apyPercent:e??null,...t}}import{useQuery as Jc}from"@tanstack/react-query";import{useMemo as ed}from"react";var td="token-info";function Or(e,t){return`${t.toLowerCase()}_${e}`}function Fa(e,t=!0){let n=Ze[e],{data:o,...r}=Jc({queryKey:[td,e],queryFn:async({signal:a})=>{let s=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:a});if(!s.ok)throw new Error(`Failed to fetch token info: ${s.status}`);let c=await s.json();if(c.code!==200)throw new Error(`Token info API error: ${c.code}`);return c},enabled:t,staleTime:1/0});return{categoryMap:ed(()=>{let a=new Map;if(!o?.data)return a;for(let s of o.data){let c=Or(s.chain_id,s.address);a.set(c,s.category)}return a},[o]),...r}}import{useMemo as nd}from"react";import Wr from"bignumber.js";function Ba(e,t,n){let{tokens:o,isLoading:r}=an(e,t,n),{statsMap:i}=sn(e,n);return nd(()=>{let a=new Wr(0);for(let d of o){let m=i.get(It(d.chainId,d.address));if(!m)continue;let b=new Wr(d.quantity.numeric).shiftedBy(-d.quantity.decimals).multipliedBy(new Wr(m.price));b.isNaN()||(a=a.plus(b))}let s=a.toFixed(),{displayValue:c,isLowerBound:l}=Qi(s);return{totalUsd:s,displayValue:c,isLowerBound:l,isLoading:r}},[o,i,r])}import{QRCodeSVG as xf}from"qrcode.react";function Ke(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=m=>{if(m===null){l?.close();return}let w=m??t;if(l)try{l.location.href=w}catch{l.close(),i(w)}else i(w)};r.then(d,m=>{console.error("[dapp-ui] onOutlink rejected:",m),l?.close()});return}let s=r;if(s===null)return;i(s??t)}import*as kn from"react";import{Drawer as Cp}from"vaul";import{createContext as od,useContext as rd}from"react";var Yn=od(null);function Oe(){let e=rd(Yn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}import{Drawer as id}from"vaul";import{jsx as _a}from"react/jsx-runtime";function Ma({asChild:e,children:t}){let{walletAddress:n}=Oe(),o=t!=null,r=e??!0,i=o?t:_a("button",{type:"button",children:st(n)});return _a(id.Trigger,{asChild:r,children:i})}import{Drawer as $o}from"vaul";import*as be from"react";import{useQueryClient as kp}from"@tanstack/react-query";import{createContext as ad,useContext as sd}from"react";var Dr=ad(null);function Oa(){return sd(Dr)}import{jsx as lt,jsxs as Po}from"react/jsx-runtime";function Wa({size:e=22,className:t}){return lt("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:lt("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Da({size:e=22,className:t}){return Po("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[lt("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),lt("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 za({size:e=16,className:t}){return Po("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[lt("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"}),lt("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 Ga({size:e=16,className:t}){return lt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:lt("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ha({size:e=48,className:t}){return Po("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[lt("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),lt("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 Lt({size:e=12,className:t}){return Po("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:[lt("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"}),lt("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),lt("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import ht from"bignumber.js";var ld=/^(\d{4}-\d{2}-\d{2})/;function Ua(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:i}of e.map(a=>({key:ld.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 Fo(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function $a(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}var cd="0xe00e8bf3";function ja(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`${cd}${o}${r}`}function zr(e){return!e||e<=0n?"0":new ht(e.toString()).shiftedBy(-9).toFormat(2,ht.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Va(e){return!e||e<=0n?"0":new ht(e.toString()).toFormat(0,ht.ROUND_DOWN)}function qa(e){if(!e||e<=0n)return"0";let t=new ht(e.toString()).shiftedBy(-18),n=t.isLessThan(1e-4)?7:4;return t.toFormat(n,ht.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Et(e,t){let n=new ht(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,ht.ROUND_DOWN):n.toFormat(4,ht.ROUND_DOWN)}function Gr(e){return Et(e,0)}function ln(e,t,n){let o=new ht(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let r=new ht(e||"0").shiftedBy(-t).times(o);return r.isFinite()?`$${r.toFormat(2,ht.ROUND_DOWN)}`:null}import*as ls from"react";import{useQuery as dd}from"@tanstack/react-query";import{useMemo as es}from"react";var Bn={dev:"https://stg-cross-game-reward-api.crosstoken.io/api",stage:"https://stg-cross-game-reward-api.crosstoken.io/api",production:"https://cross-game-reward-api.crosstoken.io/api"},Ka={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Qa={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"},Bo={dev:"https://stg-bonding-curve-api.crosstoken.io/api",stage:"https://stg-bonding-curve-api.crosstoken.io/api",production:"https://bonding-curve-api.crosstoken.io/api"},Ya={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},_o={dev:"https://stg-posa-api.crosstoken.io/api/v1",stage:"https://stg-posa-api.crosstoken.io/api/v1",production:"https://posa-api.crosstoken.io/api/v1"},Hr={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},Za={dev:`${Hr.dev}/portfolio`,stage:`${Hr.stage}/portfolio`,production:`${Hr.production}/portfolio`},Xa={dev:"https://stg-game-swap-api.cross.nexus/v1",stage:"https://stg-game-swap-api.cross.nexus/v1",production:"https://game-swap-api.cross.nexus/v1"},Ja={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},zt={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 pd="wp:reward-pools";function _n(e,t=!0){let n=Bn[e],{data:o,...r}=dd({queryKey:[pd,e],queryFn:async({signal:s})=>{let c=await fetch(`${n}/v1/pools`,{cache:"no-store",signal:s});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}),i=es(()=>o?.data.pools.filter(s=>s.pool_type==="CrossPool")??[],[o]),a=es(()=>o?.data.pools.filter(s=>s.pool_type==="GamePool")??[],[o]);return{crossPools:i,gamePools:a,allPools:o?.data.pools??[],...r}}import{useQuery as fd}from"@tanstack/react-query";import{useMemo as ud}from"react";var md="wp:user-deposits";function Mo(e,t,n=!0){let o=Bn[e],r=n&&!!t,{data:i,...a}=fd({queryKey:[md,e,t],queryFn:async({signal:c})=>{let l=await fetch(`${o}/v1/users/${t}/deposits`,{cache:"no-store",signal:c});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:r,staleTime:0});return{depositMap:ud(()=>{let c=new Map;if(!i?.data.user_deposits)return c;for(let l of i.data.user_deposits)c.set(l.pool_address.toLowerCase(),l);return c},[i]),deposits:i?.data.user_deposits??[],...a}}import{useQuery as gd}from"@tanstack/react-query";import{useMemo as hd}from"react";var bd="wp:token-info";function Oo(e,t=!0){let n=Ze[e],o=xe[e].cross,{data:r,...i}=gd({queryKey:[bd,e],queryFn:async({signal:l})=>{let d=await fetch(`${n}/v1/public/token/info`,{cache:"no-store",signal:l});if(!d.ok)throw new Error(`Failed to fetch token info: ${d.status}`);let m=await d.json();if(m.code!==200)throw new Error(`Token info API error: ${m.code}`);return m},enabled:t,staleTime:300*1e3}),{byChainAddr:a,byChainSym:s}=hd(()=>{let l=new Map,d=new Map;if(!r?.data)return{byChainAddr:l,byChainSym:d};for(let m of r.data){let w=m.address.toLowerCase();l.set(`${m.chain_id}:${w}`,m),l.set(w,m);let b=m.symbol.replace(/^t/,"").toUpperCase(),x=`${m.chain_id}:${b}`;d.has(x)||d.set(x,m),d.has(b)||d.set(b,m)}return{byChainAddr:l,byChainSym:d}},[r]);return{getTokenImage:(l,d)=>{let m=l.toLowerCase(),w=a.get(`${o}:${m}`);if(w?.image)return w.image;let b=a.get(m);if(b?.image)return b.image;if(d){let x=d.replace(/^t/,"").toUpperCase(),u=s.get(`${o}:${x}`);if(u?.image)return u.image;let h=s.get(x);if(h?.image)return h.image}return""},...i}}import{useQuery as Cd}from"@tanstack/react-query";import{useMemo as Wo}from"react";var wd="0x70a08231",xd="0x18160ddd",vd="0x313ce567",yd=8e3;async function kd(e,t,n,o){let r=new AbortController,i=setTimeout(()=>r.abort(),yd);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 Sd(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function Zn(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function yn(e,t,n,o){try{return await kd(e,"eth_call",[{to:t,data:n},"latest"],o)}catch{return}}async function Rd(e,t,n,o){let[r,i,a]=await Promise.all([yn(e,n,wd+Sd(t),o),yn(e,n,xd,o),yn(e,n,vd,o)]),s=Zn(r);if(s===void 0)return null;let c=Zn(a);return{balance:s,totalSupply:Zn(i),decimals:c!==void 0?Number(c):void 0}}async function Ur(e,t){let n=xe[e].cross,o=await fetch(`${Ze[e]}/v1/public/chain/info/${n}`,{cache:"no-store",signal:t});if(!o.ok)return;let r=await o.json();return("data"in r&&r.data!==void 0?Array.isArray(r.data)?r.data[0]:r.data:r)?.rpc||void 0}async function ts(e,t,n,o){if(!t||n.length===0)return{};let r;try{r=await Ur(e,o)}catch{r=void 0}if(!r)return{};let i=await Promise.all(n.map(async s=>[s.toLowerCase(),await Rd(r,t,s,o)])),a={};for(let[s,c]of i)c&&(a[s]=c);return a}var Td="wp:withdraw-token-meta",Nd="0xc89039c5",Id="0x95d89b41",Ld="0x313ce567";function Ed(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 Ad(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 Pd(e,t,n){if(t.length===0)return{};let o;try{o=await Ur(e,n)}catch{o=void 0}if(!o)return{};let r=await Promise.all(t.map(async a=>{let s=Ad(await yn(o,a,Nd,n));if(!s)return[a.toLowerCase(),null];let[c,l]=await Promise.all([yn(o,s,Id,n),yn(o,s,Ld,n)]),d=Ed(c),m=Zn(l);return d?[a.toLowerCase(),{tokenAddress:s,symbol:d,decimals:m!==void 0?Number(m):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of r)s&&(i[a]=s);return i}function Do(e,t,n=!0){let r=n&&!!t,{allPools:i,isLoading:a}=_n(e,r),{deposits:s,isLoading:c}=Mo(e,t,r),l=Wo(()=>{let h=new Map;for(let y of i)h.set(y.pool_address.toLowerCase(),y);return h},[i]),d=Wo(()=>s.filter(h=>{try{return BigInt(h.deposited_amount||"0")>0n}catch{return!1}}),[s]),m=Wo(()=>d.map(h=>h.pool_address.toLowerCase()).filter(h=>!l.has(h)).sort(),[d,l]),{data:w,isLoading:b}=Cd({queryKey:[Td,e,m],queryFn:({signal:h})=>Pd(e,m,h),enabled:r&&m.length>0,staleTime:1440*60*1e3});return{positions:Wo(()=>{let h=[];for(let y of d){let C=y.pool_address.toLowerCase(),f=l.get(C);if(f){h.push({poolId:y.pool_id,poolAddress:y.pool_address,poolType:f.pool_type,tokenSymbol:f.deposit_token.symbol,tokenAddress:f.deposit_token.address,decimals:f.deposit_token.decimals,price:f.deposit_token.price,depositedRaw:y.deposited_amount});continue}let N=w?.[C];N&&h.push({poolId:y.pool_id,poolAddress:y.pool_address,poolType:"Unknown",tokenSymbol:N.symbol,tokenAddress:N.tokenAddress,decimals:N.decimals,depositedRaw:y.deposited_amount})}return h},[d,l,w]),isLoading:a||c||b}}import*as jr from"react";import{jsx as $r,jsxs as ns}from"react/jsx-runtime";function Gt({sectionKey:e,title:t,icon:n,iconFit:o="cover",isEmpty:r,loading:i=!1,children:a}){let s=Oa();return jr.useEffect(()=>{s?.report(e,{loading:i,empty:r})},[s,e,i,r]),jr.useEffect(()=>()=>s?.unregister(e),[s,e]),r?null:ns("div",{className:"wp-svc-card",children:[ns("div",{className:"wp-svc-card-head",children:[$r("img",{className:"wp-svc-card-icon",src:n,alt:"",style:{objectFit:o}}),$r("span",{className:"wp-svc-card-title",children:t})]}),$r("div",{className:"wp-svc-items",children:a})]})}import*as ue from"react";import{Fragment as rs,jsx as H,jsxs as pe}from"react/jsx-runtime";var Fd=/^\d*\.?\d{0,2}$/,Bd=[100n,1000n,2000n],_d=400;function Md(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":`${qa(e.gasLimit*n)} CROSS`}function Vr(e,t,n){return n==="loading"?"Estimating...":n==="error"||n==="unavailable"?"-":`${e} ${t}`.trim()}function os({position:e,size:t}){return e.icon?H("img",{src:e.icon,alt:"",width:t,height:t}):H("span",{children:e.tokenSymbol.slice(0,1)})}function zo({open:e,status:t,positions:n,initialPoolAddress:o,walletAddress:r,txHash:i,error:a,copied:s=!1,estimateWithdraw:c,onClose:l,onConfirm:d,onCopyHash:m}){let[w,b]=ue.useState(void 0),[x,u]=ue.useState(""),[h,y]=ue.useState(null),[C,f]=ue.useState("idle"),N=ue.useRef(0),S=ue.useRef(void 0),T=ue.useRef(null);ue.useEffect(()=>()=>clearTimeout(S.current),[]);let R=ue.useMemo(()=>{let B=(w??o)?.toLowerCase();return n.find(J=>J.poolAddress.toLowerCase()===B)??n[0]??null},[n,w,o]),U=ue.useMemo(()=>{try{return BigInt(R?.depositedRaw??"0")}catch{return 0n}},[R?.depositedRaw]),D=R?.decimals??18,z=ue.useMemo(()=>{let B=Zt(x,D);return"value"in B?B.value:null},[x,D]),F=z!==null&&z>U,oe=t==="confirm"&&!!R&&z!==null&&z>0n&&!F,L=ue.useCallback(()=>{u(""),y(null),f(c?"idle":"unavailable"),N.current+=1,T.current=null},[]);ue.useEffect(()=>{e&&(b(o),L())},[e]);let Z=ue.useCallback(B=>{t==="confirm"&&(b(B.poolAddress),L())},[t,L]);ue.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(S.current);return}if(!c||!R){clearTimeout(S.current),f("unavailable");return}if(z===null||z<=0n||F){clearTimeout(S.current),N.current+=1,T.current=null,y(null),f("idle");return}let B=`${R.poolAddress.toLowerCase()}:${z.toString()}`;if(T.current===B)return;T.current=B,clearTimeout(S.current);let J=N.current+1;N.current=J,f("loading"),S.current=setTimeout(()=>{c(R,z).then(V=>{N.current===J&&(y(V??null),f(V?"ready":"unavailable"))}).catch(()=>{N.current===J&&(y(null),f("error"))})},_d)},[e,t,z,F,c,R]);let G=ue.useCallback(B=>{let J=B.target.value.replace(/,/g,"");(J===""||Fd.test(J))&&u(J)},[]),K=ue.useCallback(B=>{u(qn(B.toString(),D))},[D]),ie=ue.useCallback(B=>{let J=10n**BigInt(D),re=(z??0n)+B*J;K(re>U?U:re)},[z,D,U,K]),me=ue.useCallback(()=>{K(U)},[U,K]);if(!e||!R)return null;let $=t==="submitting",se=zr(h?.maxPriorityFeePerGas),de=zr(h?.maxFeePerGas??h?.gasPrice),j=Va(h?.gasLimit),Le=Et(R.depositedRaw,D);return H("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:B=>{B.target===B.currentTarget&&!$&&l()},children:pe("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","data-status":t,"data-vaul-no-drag":!0,children:[H("div",{className:"wp-claim-grabber","aria-hidden":!0,children:H("span",{})}),pe("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?pe(rs,{children:[H("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:H(Ha,{})}),pe("div",{className:"wp-claim-copy",children:[H("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),H("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),H("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:pe("div",{className:"wp-claim-list-item",children:[H("span",{children:"Tx Hash"}),pe("button",{type:"button",className:"wp-claim-hash",onClick:m,"aria-label":"Copy transaction hash",children:[H("strong",{children:$a(i)}),s?H(Ga,{}):H(za,{})]})]})})]}):pe(rs,{children:[pe("div",{className:"wp-claim-heading",children:[H("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:t==="error"?"Withdraw Failed":"Withdraw"}),t==="error"&&H("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),n.length>1&&H("div",{className:"wp-withdraw-token-list",role:"listbox","aria-label":"Withdrawable tokens",children:n.map(B=>{let J=B.poolAddress.toLowerCase()===R.poolAddress.toLowerCase();return pe("button",{type:"button",role:"option","aria-selected":J,className:"wp-withdraw-token","data-selected":J||void 0,disabled:$,onClick:()=>Z(B),children:[H("span",{className:"wp-withdraw-token-icon","aria-hidden":!0,children:H(os,{position:B,size:28})}),H("span",{className:"wp-withdraw-token-symbol",children:B.tokenSymbol}),H("span",{className:"wp-withdraw-token-amount",children:Et(B.depositedRaw,B.decimals)})]},B.poolAddress)})}),pe("div",{className:"wp-claim-reward-card","aria-label":"Deposited balance",children:[H("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:H(os,{position:R,size:28})}),H("strong",{className:"wp-claim-reward-symbol",children:R.tokenSymbol}),H("strong",{className:"wp-claim-reward-amount",children:Le})]}),pe("div",{className:"wp-withdraw-amount-card",children:[pe("div",{className:"wp-withdraw-amount-row",children:[H("input",{className:"wp-withdraw-input",type:"text",inputMode:"decimal",autoComplete:"off",placeholder:"0",value:x,disabled:$,onChange:G,"aria-label":`Withdraw amount (${R.tokenSymbol})`,"aria-invalid":F||void 0}),H("span",{className:"wp-withdraw-input-symbol",children:R.tokenSymbol})]}),F&&H("p",{className:"wp-claim-error-message",children:"Amount exceeds deposited balance."}),pe("div",{className:"wp-withdraw-quick-row",role:"group","aria-label":"Quick amounts",children:[Bd.map(B=>pe("button",{type:"button",className:"wp-withdraw-quick",disabled:$,onClick:()=>ie(B),children:["+",B.toString()]},B.toString())),H("button",{type:"button",className:"wp-withdraw-quick",disabled:$,onClick:me,children:"MAX"})]})]}),pe("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[pe("div",{className:"wp-claim-account-row",children:[pe("div",{className:"wp-claim-account",children:[H("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),pe("strong",{children:[R.tokenSymbol," Pool"]})]}),H("span",{children:Fo(r)})]}),H("span",{className:"wp-claim-divider","aria-hidden":!0}),pe("div",{className:"wp-claim-detail-list",children:[pe("div",{className:"wp-claim-detail-row",children:[H("span",{children:"Est. Tx Fee"}),H("strong",{children:Md(h,C)})]}),pe("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[H("span",{children:"Priority Fee Per Gas"}),H("strong",{children:Vr(se,"Gwei",C)})]}),pe("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[H("span",{children:"Max Fee Per Gas"}),H("strong",{children:Vr(de,"Gwei",C)})]}),pe("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[H("span",{children:"Gas Limit"}),H("strong",{children:Vr(j,"",C)})]})]})]})]}),pe("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&H("button",{type:"button",className:"wp-claim-secondary",onClick:l,children:t==="error"?"Close":"Cancel"}),pe("button",{type:"button",className:"wp-claim-primary",onClick:()=>{if(t==="success"){l();return}R&&z!==null&&z>0n&&!F&&d(R,z,h)},disabled:$||(t==="confirm"||t==="error")&&(z===null||z<=0n||F),children:[t==="success"&&"Done",t==="submitting"&&H("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),H("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:H("span",{})})]})})}import*as Re from"react";import{useQueryClient as Dd}from"@tanstack/react-query";import{useQuery as Od}from"@tanstack/react-query";var Wd="wp:reward-factory-info";function is(e,t=!0){let n=Bn[e],{data:o,...r}=Od({queryKey:[Wd,e],queryFn:async({signal:i})=>{let a=await fetch(`${n}/v1/factory/info`,{cache:"no-store",signal:i});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:o?.data??null,routerAddress:o?.data.router_address??"",...r}}var zd="wp:";function as(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Go(){let{env:e,walletAddress:t,sendTransaction:n,estimateGas:o}=Oe(),r=!!t,i=!!n,a=Dd(),{routerAddress:s}=is(e,r&&i),c=as(s),[l,d]=Re.useState(!1),[m,w]=Re.useState(void 0),[b,x]=Re.useState("confirm"),[u,h]=Re.useState(),[y,C]=Re.useState(""),[f,N]=Re.useState(!1),S=Re.useRef(void 0);Re.useEffect(()=>()=>clearTimeout(S.current),[]);let T=Re.useCallback((L,Z)=>c?{to:c,value:0n,data:ja(L,Z),chainId:xe[e].cross}:null,[e,c]),R=Re.useCallback(()=>{a.invalidateQueries({predicate:L=>typeof L.queryKey[0]=="string"&&L.queryKey[0].startsWith(zd)})},[a]),U=Re.useCallback(L=>{w(L),d(!0),x("confirm"),h(void 0),C(""),N(!1)},[]),D=Re.useCallback(()=>{b!=="submitting"&&(d(!1),w(void 0),x("confirm"),h(void 0),C(""),N(!1),b==="success"&&R())},[b,R]),z=Re.useCallback(async(L,Z)=>{if(!o)return null;let G=T(L.poolId,Z),K=as(t);return!G||!K?null:o({...G,from:K})},[T,o,t]),F=Re.useCallback(async()=>{if(!(!u||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(u),N(!0),clearTimeout(S.current),S.current=setTimeout(()=>N(!1),1400)}catch{N(!1)}},[u]),oe=Re.useCallback(async(L,Z,G)=>{if(!n){x("error"),C("Withdraw is not available for this wallet.");return}if(!c){x("error"),C("Withdraw contract address is not available.");return}try{x("submitting"),C("");let K=T(L.poolId,Z);if(!K){x("error"),C("Withdraw contract address is not available.");return}let ie=await n({...K,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});h(ie),x("success"),R()}catch(K){x("error"),C(K instanceof Error?K.message:"Failed to request withdraw.")}},[T,R,c,n]);return{canWithdrawInline:i,isOpen:l,initialPoolAddress:m,status:b,txHash:u,error:y,copied:f,hasEstimator:!!o,openWithdraw:U,closeWithdraw:D,estimateWithdraw:z,confirmWithdraw:oe,copyHash:F}}import qr from"bignumber.js";import{Fragment as Hd,jsx as Ce,jsxs as We}from"react/jsx-runtime";var Gd="CROSS Rewards";function ss(e){return new qr(e||"0").isGreaterThan(0)}function cs(){let{env:e,walletAddress:t,onOutlink:n}=Oe(),o=!!t,{allPools:r,isLoading:i}=_n(e,o),{depositMap:a,isLoading:s}=Mo(e,t,o),{getTokenImage:c}=Oo(e,o),l=Go(),{positions:d}=Do(e,t,o&&l.canWithdrawInline),m=ls.useMemo(()=>d.filter(u=>u.poolType==="CrossPool").map(u=>({...u,icon:c(u.tokenAddress,u.tokenSymbol)})),[d,c]),w=(u,h)=>`${Ka[e]}/rewards/${u.pool_address}?action=${h}`,b=`${zt[e]}/reward.png`,x=r.filter(u=>{let h=a.get(u.pool_address.toLowerCase()),y=h?.deposited_amount??"0",C=h?.claimable_reward??"0";return!(new qr(y).isZero()&&new qr(C).isZero())});return We(Hd,{children:[Ce(Gt,{sectionKey:"rewards",title:Gd,icon:b,isEmpty:x.length===0,loading:i||s,children:x.map(u=>{let h=a.get(u.pool_address.toLowerCase()),y=h?.deposited_amount??"0",C=h?.claimable_reward??"0",f=w(u,"withdraw"),N=w(u,"claim"),S=c(u.deposit_token.address,u.deposit_token.symbol),T=u.reward_tokens[0],R=T?c(T.address,T.symbol):"",U=u.reward_tokens.map(ie=>ie.symbol),D=U.length>0?`${u.deposit_token.symbol}-${U.join("/")}`:u.deposit_token.symbol,z=T?Et(C,T.decimals):"0",F=T?.symbol??"Reward",oe=ln(y,u.deposit_token.decimals,u.deposit_token.price),L=T?ln(C,T.decimals,T.price):null,Z=!!h&&ss(C),G=!!h&&ss(y),K=l.canWithdrawInline&&m.some(ie=>ie.poolAddress.toLowerCase()===u.pool_address.toLowerCase());return We("article",{className:"wp-item","data-side":"reward",children:[We("div",{className:"wp-item-body",children:[We("div",{className:"wp-item-line",children:[Ce("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),We("div",{className:"wp-svc-token",children:[We("span",{className:"wp-token-stack","aria-hidden":!0,children:[S&&Ce("img",{className:"wp-svc-token-icon",src:S,alt:""}),R&&Ce("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),Ce("span",{children:D})]})]}),We("div",{className:"wp-item-line",children:[Ce("span",{className:"wp-item-label",children:"Deposited"}),We("div",{className:"wp-svc-token wp-svc-token--amount",children:[S&&Ce("img",{className:"wp-svc-token-icon",src:S,alt:""}),We("div",{className:"wp-svc-amount",children:[Ce("span",{className:"wp-svc-amount-main",children:Et(y,u.deposit_token.decimals)}),oe&&Ce("span",{className:"wp-item-usd",children:oe})]})]})]}),We("div",{className:"wp-item-line",children:[We("span",{className:"wp-item-label",children:["Claimable (",F,")"]}),We("div",{className:"wp-svc-token wp-svc-token--amount",children:[R&&Ce("img",{className:"wp-svc-token-icon",src:R,alt:""}),We("div",{className:"wp-svc-amount",children:[Ce("span",{className:"wp-svc-amount-main",children:z}),L&&Ce("span",{className:"wp-item-usd",children:L})]})]})]})]}),We("div",{className:"wp-item-tags",children:[K?Ce("button",{type:"button",className:"wp-tag wp-tag--muted","data-disabled":!G||void 0,"aria-disabled":!G||void 0,onClick:()=>{G&&l.openWithdraw(u.pool_address)},children:Ce("span",{className:"wp-tag-label",children:"Withdraw"})}):We("a",{className:"wp-tag wp-tag--muted",href:f,target:"_blank",rel:"noopener noreferrer",onClick:ie=>Ke(ie,f,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:u,userDeposit:h}},n),children:[Ce("span",{className:"wp-tag-label",children:"Withdraw"}),Ce(Lt,{size:12,className:"wp-tag-icon"})]}),We("a",{className:"wp-tag wp-tag--mint","data-disabled":!Z||void 0,"aria-disabled":!Z||void 0,href:Z?N:void 0,target:Z?"_blank":void 0,rel:Z?"noopener noreferrer":void 0,onClick:ie=>{if(!Z){ie.preventDefault();return}Ke(ie,N,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:u,userDeposit:h}},n)},children:[Ce("span",{className:"wp-tag-label",children:"Claim"}),Ce(Lt,{size:12,className:"wp-tag-icon"})]})]})]},u.pool_address)})}),Ce(zo,{open:l.isOpen,status:l.status,positions:m,initialPoolAddress:l.initialPoolAddress,walletAddress:t,txHash:l.txHash,error:l.error,copied:l.copied,estimateWithdraw:l.hasEstimator?l.estimateWithdraw:void 0,onClose:l.closeWithdraw,onConfirm:l.confirmWithdraw,onCopyHash:l.copyHash})]})}import*as ds from"react";import{Fragment as $d,jsx as Xe,jsxs as Jt}from"react/jsx-runtime";var Ud="Points";function ps(){let{env:e,walletAddress:t,onOutlink:n}=Oe(),o=!!t,{getTokenImage:r}=Oo(e,o),i=Go(),{positions:a,isLoading:s}=Do(e,t,o),c=ds.useMemo(()=>a.filter(m=>m.poolType!=="CrossPool").map(m=>({...m,icon:r(m.tokenAddress,m.tokenSymbol)})),[a,r]),l=`${zt[e]}/point.png`,d=Qa[e];return Jt($d,{children:[Xe(Gt,{sectionKey:"points",title:Ud,icon:l,isEmpty:c.length===0,loading:s,children:c.map(m=>{let w=m.price?ln(m.depositedRaw,m.decimals,m.price):null;return Jt("article",{className:"wp-item","data-side":"reward",children:[Jt("div",{className:"wp-item-body",children:[Jt("div",{className:"wp-item-line",children:[Xe("span",{className:"wp-item-label",children:"Token"}),Jt("div",{className:"wp-svc-token",children:[m.icon&&Xe("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),Xe("span",{children:m.tokenSymbol})]})]}),Jt("div",{className:"wp-item-line",children:[Xe("span",{className:"wp-item-label",children:"Deposited"}),Jt("div",{className:"wp-svc-token wp-svc-token--amount",children:[m.icon&&Xe("img",{className:"wp-svc-token-icon",src:m.icon,alt:""}),Jt("div",{className:"wp-svc-amount",children:[Xe("span",{className:"wp-svc-amount-main",children:Et(m.depositedRaw,m.decimals)}),w&&Xe("span",{className:"wp-item-usd",children:w})]})]})]})]}),Xe("div",{className:"wp-item-tags",children:i.canWithdrawInline?Xe("button",{type:"button",className:"wp-tag wp-tag--muted",onClick:()=>i.openWithdraw(m.poolAddress),children:Xe("span",{className:"wp-tag-label",children:"Withdraw"})}):Jt("a",{className:"wp-tag wp-tag--muted",href:d,target:"_blank",rel:"noopener noreferrer",onClick:b=>Ke(b,d,{category:"portfolio",origin:"portfolio-points",payload:{position:m}},n),children:[Xe("span",{className:"wp-tag-label",children:"Withdraw"}),Xe(Lt,{size:12,className:"wp-tag-icon"})]})})]},m.poolAddress)})}),Xe(zo,{open:i.isOpen,status:i.status,positions:c,initialPoolAddress:i.initialPoolAddress,walletAddress:t,txHash:i.txHash,error:i.error,copied:i.copied,estimateWithdraw:i.hasEstimator?i.estimateWithdraw:void 0,onClose:i.closeWithdraw,onConfirm:i.confirmWithdraw,onCopyHash:i.copyHash})]})}import*as Kr from"react";import{useQuery as jd}from"@tanstack/react-query";var Vd="wp:stake-info";function fs(e,t,n=!0){let o=_o[e],r=n&&!!t,{data:i,...a}=jd({queryKey:[Vd,e,t],queryFn:async({signal:c})=>{let l=await fetch(`${o}/stake/${t}`,{cache:"no-store",signal:c});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:r,staleTime:0});return{stakeInfo:i?.data,...a}}import{useQuery as qd}from"@tanstack/react-query";var Kd="wp:stake-rewards",Qd=31;function us(e,t,n=!0){let o=_o[e],r=n&&!!t,{data:i,...a}=qd({queryKey:[Kd,e,t],queryFn:async({signal:s})=>{let c=await fetch(`${o}/rewards/${t}?limit=${Qd}`,{cache:"no-store",signal:s});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:r,staleTime:0});return{latestReward:i?.[0]??null,aprAccrued:Ua(i),...a}}import{useQuery as Yd}from"@tanstack/react-query";var Zd="wp:staking-onchain";function ms(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...i}=Yd({queryKey:[Zd,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 gs}from"react";import Xd from"bignumber.js";function hs(e){return e?.trim().toUpperCase()==="CROSS"}function bs(e){return new Xd(e||"0").isGreaterThan(0)}function Ho(e,t,n=!0){let{allPools:o}=_n(e,n),r=gs(()=>{for(let l of o)for(let d of[l.deposit_token,...l.reward_tokens])if(hs(d?.symbol)&&bs(d.price))return d.price},[o]),i=n&&r===void 0,{tokens:a}=an(e,t,i),{statsMap:s}=sn(e,i),c=xe[e].cross;return gs(()=>{if(r)return r;let l=a.find(d=>d.chainId===c&&hs(d.symbol));if(l){let d=s.get(It(l.chainId,l.address));if(d&&bs(d.price))return d.price}return"0"},[r,a,s,c])}import cn from"bignumber.js";import{jsx as Ht,jsxs as Ut}from"react/jsx-runtime";var Jd="CROSS Staking";function ep(e){if(!e)return"\u2014";let t=new cn(e);return t.isFinite()?`${t.toFormat(2,cn.ROUND_DOWN)}%`:"\u2014"}function ws(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=Oe(),r=!!t,{stakeInfo:i,isLoading:a}=fs(e,t,r),{latestReward:s,aprAccrued:c,isLoading:l}=us(e,t,r),{onchain:d}=ms(t,o,r),m=Ho(e,t,r),w=`${zt[e]}/cross-staking.png`,b=Za[e],x=i?.total_stake??"0",u=Kr.useMemo(()=>d?new cn(d.earnedWei.toString()).shiftedBy(-18).toString(10):s?.cumulative_earned??i?.rewards_earned??"0",[d,s,i]),h=Kr.useMemo(()=>d?new cn(d.stakedWei.toString()).shiftedBy(-18):new cn(x),[d,x]),y=c!==void 0?new cn(c):void 0,C=i?.days_since_first_stake,f=y!==void 0&&y.isFinite()&&h.isGreaterThan(0)&&C!==null&&C!==void 0?y.div(h).times(365).div(Math.max(1,C)).times(100):void 0,N=!(new cn(x).isZero()&&new cn(u).isZero()),S=ln(x,0,m),T=ln(u,0,m);return Ht(Gt,{sectionKey:"staking",title:Jd,icon:w,iconFit:"contain",isEmpty:!N,loading:a||l,children:Ut("article",{className:"wp-item","data-side":"stake",children:[Ut("div",{className:"wp-item-body",children:[Ut("div",{className:"wp-item-line",children:[Ht("span",{className:"wp-item-label",children:"Staked"}),Ut("div",{className:"wp-svc-amount",children:[Ut("span",{className:"wp-svc-amount-main",children:[Gr(x)," CROSS"]}),S&&Ht("span",{className:"wp-item-usd",children:S})]})]}),Ut("div",{className:"wp-item-line",children:[Ht("span",{className:"wp-item-label",children:"Rewards Earned"}),Ut("div",{className:"wp-svc-amount",children:[Ut("span",{className:"wp-svc-amount-main",children:[Gr(u)," CROSS"]}),T&&Ht("span",{className:"wp-item-usd",children:T})]})]}),Ut("div",{className:"wp-item-line",children:[Ht("span",{className:"wp-item-label",children:"My APR"}),Ht("span",{children:ep(f?.toString(10))})]})]}),Ht("div",{className:"wp-item-tags",children:Ut("a",{className:"wp-tag wp-tag--mint",href:b,target:"_blank",rel:"noopener noreferrer",onClick:R=>Ke(R,b,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:i}},n),children:[Ht("span",{className:"wp-tag-label",children:"Manage"}),Ht(Lt,{size:12,className:"wp-tag-icon"})]})})]})})}import*as Qr from"react";import{useQuery as tp}from"@tanstack/react-query";var np="wp:game-swap-pools";function xs(e,t,n=!0){let o=Xa[e],r=n&&!!t,{data:i,...a}=tp({queryKey:[np,e,t],queryFn:async({signal:s})=>{let c=await fetch(`${o}/addresses/${t}/portfolio`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Game-swap portfolio fetch failed: ${c.status}`);return(await c.json()).pools??[]},enabled:r,staleTime:0});return{pools:i??[],...a}}import{useQuery as op}from"@tanstack/react-query";var rp="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}=op({queryKey:[rp,e,t,r,!!o],queryFn:async({signal:c})=>{let l=o?await o(r):await ts(e,t,r,c),d={};for(let[m,w]of Object.entries(l))d[m.toLowerCase()]=w;return d},enabled:i,staleTime:0});return{balances:a??{},...s}}import $t from"bignumber.js";import{jsx as bt,jsxs as At}from"react/jsx-runtime";var ip="Gametoken LP",ks=18,ap=new $t("0.0001");function ys(e){return e?.trim().toUpperCase()==="CROSS"}function sp(e){return e&&e>0?e:ks}function lp(e){let t=ys(e.token_a?.symbol)&&!ys(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=sp(t?e.token_a?.decimals:e.token_b?.decimals),r=new $t(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new $t(0):r.times(2)}function cp(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??ks,i,a;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let s=new $t(t.balance.toString()),c=new $t(t.totalSupply.toString()),l=s.div(c);i=l.times(100);let d=l.times(lp(e));if(d.isGreaterThan(0)){let m=new $t(e.quote_usd??e.cross_usd??"0");a=m.isGreaterThan(0)?`$${d.times(m).toFormat(2,$t.ROUND_DOWN)}`:`${d.toFormat(4,$t.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:i,valueText:a}}function Ss(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=Oe(),r=!!t,{pools:i,isLoading:a}=xs(e,t,r),s=Qr.useMemo(()=>i.map(x=>x.pair_address).filter(Boolean),[i]),{balances:c,isLoading:l}=vs(e,t,s,o),d=`${zt[e]}/dex.png`,m=Object.keys(c).length>0,w=Qr.useMemo(()=>{let x=i.map(u=>cp(u,c[u.pair_address?.toLowerCase()]));return m?x.filter(u=>u.lpAmountRaw?new $t(u.lpAmountRaw).shiftedBy(-u.lpDecimals).isGreaterThanOrEqualTo(ap):!1):x},[i,c,m]),b=x=>{let u=x.token_a?.address??x.pair_address;return`${Ja[e]}/tokens/${u}?trade=deposit`};return bt(Gt,{sectionKey:"gameSwap",title:ip,icon:d,iconFit:"contain",isEmpty:w.length===0,loading:a||l,children:w.map(x=>{let{pool:u}=x,h=b(u),y=`${x.tokenASymbol} / ${x.tokenBSymbol}`,C=u.token_a?.logo_url,f=u.token_b?.logo_url;return At("article",{className:"wp-item","data-side":"game-swap",children:[At("div",{className:"wp-item-body",children:[At("div",{className:"wp-item-line",children:[bt("span",{className:"wp-item-label",children:"Pool"}),At("div",{className:"wp-svc-token",children:[At("span",{className:"wp-token-stack","aria-hidden":!0,children:[C&&bt("img",{className:"wp-svc-token-icon",src:C,alt:""}),f&&bt("img",{className:"wp-svc-token-icon",src:f,alt:""})]}),bt("span",{children:y})]})]}),x.lpAmountRaw!==void 0&&At("div",{className:"wp-item-line",children:[bt("span",{className:"wp-item-label",children:"My LP"}),At("span",{children:[Et(x.lpAmountRaw,x.lpDecimals)," LP"]})]}),x.sharePercent!==void 0&&At("div",{className:"wp-item-line",children:[bt("span",{className:"wp-item-label",children:"Pool Share"}),At("span",{children:[x.sharePercent.toFormat(2,$t.ROUND_DOWN),"%"]})]}),x.valueText!==void 0&&At("div",{className:"wp-item-line",children:[bt("span",{className:"wp-item-label",children:"Value"}),bt("span",{children:x.valueText})]})]}),bt("div",{className:"wp-item-tags",children:At("a",{className:"wp-tag wp-tag--mint",href:h,target:"_blank",rel:"noopener noreferrer",onClick:N=>Ke(N,h,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:u}},n),children:[bt("span",{className:"wp-tag-label",children:"Manage"}),bt(Lt,{size:12,className:"wp-tag-icon"})]})})]},u.pair_address)})})}import pn from"bignumber.js";import{useMemo as hp}from"react";import{useQuery as dp}from"@tanstack/react-query";var pp="wp:forge-pools";function Rs(e,t,n=!0){let o=Bo[e],r=n&&!!t,{data:i,...a}=dp({queryKey:[pp,e,t],queryFn:async()=>{let c=await fetch(`${o}/v1/users/${t}/pools`,{cache:"no-store"});if(!c.ok)throw new Error(`forge pools fetch failed: ${c.status}`);return(await c.json()).data?.items??[]},enabled:r,staleTime:0}),s=i??[];return{pools:s,isEmpty:s.length===0,...a}}import{useQueries as fp}from"@tanstack/react-query";import{useMemo as up}from"react";var mp="wp:forge-token-detail";async function gp(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Cs(e,t,n=!0){let o=Bo[e],r=fp({queries:t.map(s=>({queryKey:[mp,e,s],queryFn:()=>gp(o,s),enabled:n&&!!s,staleTime:3e4}))}),i=up(()=>{let s=new Map;for(let c=0;c<r.length;c++){let l=r[c]?.data,d=t[c];l&&d&&s.set(d.toLowerCase(),l)}return s},[r,t]),a=r.some(s=>s.isLoading);return{detailMap:i,isLoading:a}}import{jsx as Je,jsxs as dn}from"react/jsx-runtime";var bp="Forge",Ts=18,wp="https://contents.crosstoken.io/wallet/token/images/FT.png";function xp(e){if(!e||e==="0")return"0";let t=new pn(e).shiftedBy(-Ts);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,pn.ROUND_DOWN):t.toFormat(4,pn.ROUND_DOWN)}function vp(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 yp(e,t,n){let o=new pn(n||"0");if(!o.isGreaterThan(0))return null;let r=new pn(e.total_supply||"0"),i=new pn(e.lp_balance||"0"),a=new pn(t?.reserve_b||"0").shiftedBy(-Ts);if(!r.isGreaterThan(0)||!i.isGreaterThan(0)||!a.isGreaterThan(0))return null;let s=a.times(2),l=i.div(r).times(s).times(o);return l.isFinite()?`$${l.toFormat(2,pn.ROUND_DOWN)}`:null}function Ns(){let{env:e,walletAddress:t,onOutlink:n}=Oe(),o=!!t,{pools:r,isEmpty:i,isLoading:a}=Rs(e,t,o),s=hp(()=>r.map(w=>w.token.address),[r]),{detailMap:c}=Cs(e,s,o&&s.length>0),l=Ho(e,t,o),d=w=>`${Ya[e]}/forge/token/${w.token.address}`,m=`${zt[e]}/forge.png`;return Je(Gt,{sectionKey:"forge",title:bp,icon:m,iconFit:"contain",isEmpty:i,loading:a,children:r.map(w=>{let b=c.get(w.token.address.toLowerCase()),x=b?.image_url||b?.image||w.token.image||wp,u=b?.symbol||w.token.symbol,h=d(w),y=yp(w,b,l);return dn("a",{className:"wp-item","data-side":"lp",href:h,target:"_blank",rel:"noopener noreferrer",onClick:C=>Ke(C,h,{category:"portfolio",origin:"portfolio-forge",payload:{pool:w,tokenDetail:b}},n),children:[dn("div",{className:"wp-item-body",children:[dn("div",{className:"wp-item-line",children:[Je("span",{className:"wp-item-label",children:"Asset"}),dn("div",{className:"wp-svc-token",children:[Je("img",{className:"wp-svc-token-icon",src:x,alt:""}),Je("span",{children:u}),b?.name&&Je("span",{className:"wp-token-subtle",children:b.name})]})]}),dn("div",{className:"wp-item-line",children:[Je("span",{className:"wp-item-label",children:"LP Balance"}),Je("div",{className:"wp-svc-token wp-svc-token--amount",children:dn("div",{className:"wp-svc-amount",children:[Je("span",{className:"wp-svc-amount-main",children:xp(w.lp_balance)}),y&&Je("span",{className:"wp-item-usd",children:y})]})})]}),dn("div",{className:"wp-item-line",children:[Je("span",{className:"wp-item-label",children:"Ownership"}),Je("span",{className:"wp-line-value",children:vp(w.pool_ownership)})]})]}),Je("div",{className:"wp-item-tags",children:dn("span",{className:"wp-tag wp-tag--muted",children:[Je("span",{className:"wp-tag-label",children:"Withdraw"}),Je(Lt,{size:12,className:"wp-tag-icon"})]})})]},w.pair_address)})})}var Uo=["rewards","points","staking","gameSwap","forge"];Q(`.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
+ `);import{Fragment as Rp,jsx as ce,jsxs as en}from"react/jsx-runtime";var Yr=15,Sp="wp:";function Mn({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:m,estimateGas:w,sections:b}){let x=je(e),u=be.useCallback(V=>!b||b.includes(V),[b]),h=!!n,y=kp(),[C,f]=be.useState({}),N=be.useCallback((V,re)=>{f(fe=>{let ct=fe[V];return ct&&ct.loading===re.loading&&ct.empty===re.empty?fe:{...fe,[V]:re}})},[]),S=be.useCallback(V=>{f(re=>{if(!(V in re))return re;let fe={...re};return delete fe[V],fe})},[]),T=be.useMemo(()=>({report:N,unregister:S}),[N,S]),[R,U]=be.useState(Yr),[D,z]=be.useState(!1),[F,oe]=be.useState(!1),L=be.useRef(void 0),Z=be.useCallback(()=>{y.invalidateQueries({predicate:V=>typeof V.queryKey[0]=="string"&&V.queryKey[0].startsWith(Sp)})},[y]),G=be.useCallback(()=>{Z(),z(!0),setTimeout(()=>z(!1),600),U(Yr)},[Z]);be.useEffect(()=>{if(!h)return;let V=setInterval(()=>{U(re=>re<=1?(G(),Yr):re-1)},1e3);return()=>clearInterval(V)},[h,G]);let K=be.useCallback(()=>{r?.()},[r]),ie=h?Xt(x,n,{size:64}):void 0,me=be.useCallback(async()=>{if(!(F||!n))try{await navigator.clipboard.writeText(n),oe(!0),clearTimeout(L.current),L.current=setTimeout(()=>oe(!1),2e3)}catch{}},[n,F]);be.useEffect(()=>()=>clearTimeout(L.current),[]);let $=be.useMemo(()=>({env:x,theme:t,open:!0,walletAddress:n,close:K,onOutlink:c,lpBalanceReader:l,stakingRewardsReader:d,sendTransaction:m,estimateGas:w}),[x,t,n,K,c,l,d,m,w]),se=Uo.filter(u),de=se.length>0&&se.every(V=>{let re=C[V];return!!re&&!re.loading}),j=de&&se.every(V=>C[V]?.empty),Le=se.some(V=>{let re=C[V];return!!re&&!re.empty}),B=se.length>0&&!de&&!Le,J=en(Rp,{children:[i&&en("div",{className:"wp-header",children:[en("div",{className:"wp-header-account",children:[r&&ce("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:r,children:ce(Wa,{})}),ce("span",{className:"wp-header-avatar","aria-hidden":!0,children:ie&&ce("img",{src:ie,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&en("div",{className:"wp-header-account-meta",children:[o&&ce("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&en("button",{type:"button",className:"wp-header-address-btn",onClick:me,"aria-label":"Copy wallet address",children:[ce("span",{className:"wp-header-address",children:Fo(n)}),ce("span",{className:"wp-header-address-copy","data-copied":F,children:F?ce(hn,{size:14}):ce($n,{size:14})})]})]})]}),en("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio",onClick:G,children:[ce(Da,{className:D?"wp-spin-once":void 0}),h&&ce("span",{className:"wp-refresh-badge",children:R})]})]}),ce("div",{className:"wp-body",children:en("div",{className:"wp-body-inner","data-empty":j||void 0,children:[u("rewards")&&ce(cs,{}),u("points")&&ce(ps,{}),u("staking")&&ce(ws,{}),u("gameSwap")&&ce(Ss,{}),u("forge")&&ce(Ns,{}),B&&ce("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:ce("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),j&&en("div",{className:"wp-portfolio-empty",role:"status",children:[ce("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:en("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[ce("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),ce("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),ce("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),ce("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),ce("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across CROSS services will appear here."})]})]})})]});return ce(Yn.Provider,{value:$,children:ce(Dr.Provider,{value:T,children:a==="none"?J:ce("div",{className:le(a==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:J})})})}import{jsx as Zr,jsxs as Is}from"react/jsx-runtime";function Ls({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s}=Oe();return Is($o.Portal,{children:[Zr($o.Overlay,{className:"wp-overlay"}),Is($o.Content,{className:le("wp-fullscreen",e),"data-theme":n,children:[Zr($o.Title,{className:"wp-sr-only",children:"Portfolio"}),Zr(Mn,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s})]})]})}import{jsx as Es}from"react/jsx-runtime";function Tp({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:c,estimateGas:l,children:d}){let m=je(e),w=o!==void 0,[b,x]=kn.useState(!1),u=w?o:b,h=kn.useCallback(f=>{w||x(f),r?.(f)},[w,r]),y=kn.useCallback(()=>h(!1),[h]),C=kn.useMemo(()=>({env:m,theme:t,open:u,walletAddress:n,close:y,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:c,estimateGas:l}),[m,t,u,n,y,i,a,s,c,l]);return Es(Yn.Provider,{value:C,children:Es(Cp.Root,{direction:"bottom",open:u,onOpenChange:h,noBodyStyles:!0,children:d})})}var As=Object.assign(Tp,{Trigger:Ma,Content:Ls});import*as A from"react";import{createPortal as On}from"react-dom";import jt from"bignumber.js";import{jsx as wt,jsxs as Np}from"react/jsx-runtime";function Ps({size:e=20,className:t}){return Np("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:[wt("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),wt("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function Fs({size:e=16,className:t}){return wt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:wt("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 Bs({size:e=16,className:t}){return wt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:wt("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 _s({size:e=20,className:t}){return wt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:wt("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ms({size:e=16,className:t}){return wt("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:wt("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function Os({size:e=12,className:t}){return wt("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:wt("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 P from"react";import zs from"bignumber.js";function Ws(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ds(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,zs.ROUND_DOWN).toFixed()}function Ip(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 Lp(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new zs(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:Ws(t)&&Ws(n)?e.lastChangedBy==="to"?{fromAmount:Ds(r.multipliedBy(n).dividedBy(t))}:{toAmount:Ds(r.multipliedBy(t).dividedBy(n))}:Ip(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function Gs({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):Lp(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var Hs=15,Ep=18,Vs="cross_bridge_terms_accepted",Ap=3600*24*365;function Pp(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,Hs);let r=t.slice(0,o).slice(0,Hs),i=t.slice(o+1).slice(0,Ep);return`${r}.${i}`}function Fp(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${Vs}=true`)}function Bp(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${Vs}=true`,"Path=/",`Max-Age=${Ap}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function _p(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 Us(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function Mp(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([Us(e.symbol),Us(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function Pt(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function jo(e){return e[0]}function Xr(e,t,n,o){if(n&&!Pt(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??jo(e);let i=e.findIndex(s=>Pt(s,t)),a=i>=0?e[i+1]:void 0;return a&&!Pt(a,t)?a:e.find(s=>!Pt(s,t))??t}function $s({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 Vo(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),...Vo(n.cause,t+1),...Vo(n.data,t+1),...Vo(n.error,t+1)]}function Jr(e){let t=Vo(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 js(e,t){return Jr(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
9
+ `)[0]?.trim()||t}function qs(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:i,approveBridge:a,history:s=[],initialSlippage:c="1",termsUrl:l=An,getQuote:d,submitBridge:m,onSubmitted:w,onSuccess:b,onFailed:x,onExit:u}=e,h=P.useMemo(()=>Gs({getQuote:d,submitBridge:m}),[d,m]),[y,C]=P.useState("form"),[f,N]=P.useState(n??jo(t)),[S,T]=P.useState(()=>Xr(t,n??jo(t),o,r)),[R,U]=P.useState(""),[D,z]=P.useState(""),[F,oe]=P.useState("from"),[L,Z]=P.useState(c),[G,K]=P.useState(null),ie=P.useMemo(()=>Mp(f,S),[f,S]),me=P.useMemo(()=>ie?"1":L==="auto"?_p(G?.priceImpact):L,[ie,L,G?.priceImpact]),[$,se]=P.useState(""),[de,j]=P.useState("idle"),[Le,B]=P.useState(""),[J,V]=P.useState(null),[re,fe]=P.useState([]),[ct,vt]=P.useState(!1),[Ye,Kt]=P.useState(Fp),[Ee,ve]=P.useState(null),[dt,Ae]=P.useState(!1),[_e,ye]=P.useState(null),[Ft,yt]=P.useState(null),[Bt,et]=P.useState(!1),[_t,tt]=P.useState(!1),ke=P.useRef(0),nt=P.useRef(null),pt=P.useCallback(()=>{nt.current&&(clearTimeout(nt.current),nt.current=null)},[]),ze=P.useCallback(_=>{pt(),yt(_)},[pt]);P.useEffect(()=>pt,[pt]),P.useEffect(()=>{let _=t.find(He=>Pt(He,f))??jo(t),Ie=_?r?.(_,t):void 0,q=Ie?.find(He=>Pt(He,S))??(Ie?void 0:t.find(He=>Pt(He,S)))??Xr(t,_,void 0,r);N(_),T(q)},[r,t,f,S]);let kt=P.useCallback((_,Ie)=>{let q=Pp(_);if(!q){ke.current+=1,U(""),z(""),oe(Ie),K(null),se(""),j("idle");return}Ie==="from"?U(q):z(q),oe(Ie),se("")},[]),we=P.useCallback(()=>{ke.current+=1,U(""),z(""),oe("from"),K(null),se(""),B(""),j("idle"),ve(null),Ae(!1),ye(null),et(!1),ze(null)},[ze]),Te=P.useCallback(_=>{Pt(_,f)||(N(_),T(Xr(t,_,void 0,r)),we())},[f,r,we,t]),Mt=P.useCallback(_=>{Pt(_,S)||Pt(_,f)||(T(_),we())},[f,we,S]),St=P.useMemo(()=>f?r?.(f,t)??t.filter(_=>!Pt(_,f)):[],[f,r,t]),Ge=P.useCallback(()=>{f?.balance&&kt(f.balance,"from")},[f?.balance,kt]),ft=P.useCallback(()=>{!f||!S||(N(S),T(f),we())},[f,we,S]),Rt=P.useCallback(()=>{ke.current+=1,U(""),z(""),oe("from"),K(null),se(""),B("")},[]);P.useEffect(()=>{if(!f||!S)return;if(!R&&!D){K(null),se(""),j(q=>q==="quoting"?"idle":q);return}let _=++ke.current,Ie=$s({fromToken:f,toToken:S,fromAmount:R,toAmount:D,lastChangedBy:F,slippage:L});j(q=>q==="submitting"?q:h.canQuote?"quoting":"idle"),(async()=>{try{let q=await h.getQuote(Ie);if(ke.current!==_)return;q.fromAmount!==void 0&&F==="to"&&U(q.fromAmount),q.toAmount!==void 0&&F==="from"&&z(q.toAmount),K(q.summary??null),se(q.error??"")}catch(q){if(ke.current!==_)return;se(q instanceof Error?q.message:"Failed to quote bridge.")}finally{ke.current===_&&j(q=>q==="quoting"?"idle":q)}})()},[R,f,F,h,L,D,S]);let Ne=P.useCallback(()=>!f||!S?null:$s({fromToken:f,toToken:S,fromAmount:R,toAmount:D,lastChangedBy:F,slippage:me}),[me,R,f,F,D,S]),Pe=P.useCallback(async(_,Ie)=>{B(""),et(!1),Ae(!1),j("submitting");try{if(!Ie?.skipApprovalCheck&&i){let He=await i(_);if(He){ve(He),ye(_),j("idle");return}}ve(null),ye(null),ze("processing");let q=await h.submitBridge(_);V(q),j("success"),fe(He=>[{id:q.txHash,timestamp:new Date().toISOString(),txHash:q.txHash,fromToken:q.fromToken,toToken:q.toToken,fromAmount:q.fromAmount,toAmount:q.toAmount,summary:G??void 0,status:"pending"},...He.filter(ut=>ut.txHash!==q.txHash)]),Rt(),tt(!0),ze(null),et(!0),w?.(q),b?.(q)}catch(q){if(ze(null),Jr(q)){j("idle");return}let He=js(q,"Failed to submit bridge.");B(He),j("error"),x?.({message:He})}},[i,x,w,b,h,Rt,ze,G]),E=P.useCallback(async()=>{if($)return;let _=Ne();if(_){if(!Ye){ye(_),vt(!0);return}await Pe(_)}},[Ne,$,Pe,Ye]),ee=P.useCallback(async()=>{let _=_e??Ne();_&&(Bp(),Kt(!0),vt(!1),await Pe(_))},[Ne,_e,Pe]),ge=P.useCallback(()=>{vt(!1),ye(null)},[]),ot=P.useCallback(async()=>{if(!(de==="submitting"||!Ee||!_e||!a)){B(""),j("submitting");try{await a(_e,Ee),ve(null),j("idle"),Ae(!0)}catch(_){if(Jr(_)){j("idle");return}let Ie=js(_,"Failed to approve token.");B(Ie),j("error"),x?.({message:Ie})}}},[Ee,a,x,_e,Pe,de]),Qt=P.useCallback(()=>{de!=="submitting"&&(ve(null),Ae(!1),ye(null),j("idle"))},[de]),rt=P.useCallback(async()=>{if(de==="submitting")return;let _=_e??Ne();if(!_){Ae(!1),B("Bridge input is no longer available. Please try again."),j("error");return}Ae(!1),await Pe(_,{skipApprovalCheck:!0})},[Ne,_e,Pe,de]),Sn=P.useCallback(()=>{et(!1)},[]),Yt=P.useCallback(_=>{C(_),_==="history"&&tt(!1)},[]),Rn=P.useCallback(()=>{if(y==="history"){Yt("form");return}u?.()},[u,Yt,y]),io=P.useMemo(()=>[...s,...re.filter(_=>!s.some(Ie=>Ie.txHash===_.txHash))],[s,re]);return{step:y,setStep:Yt,status:de,error:Le,quoteError:$,fromToken:f,toToken:S,tokens:t,availableToTokens:St,fromAmount:R,toAmount:D,lastChangedBy:F,slippage:L,effectiveSlippage:me,slippageLocked:ie,setSlippage:Z,summary:G,history:io,submitted:J,canSubmit:h.canSubmit,termsOpen:ct,approvalInfo:Ee,approvalSuccessOpen:dt,approveBridge:a,pendingSubmitInput:_e,submitToast:Ft,successDialogOpen:Bt,dismissSuccessDialog:Sn,hasNewHistory:_t,termsUrl:l,setFromToken:N,setToToken:T,selectFromToken:Te,selectToToken:Mt,setAmount:kt,setMax:Ge,swapTokens:ft,submit:E,confirmTerms:ee,cancelTerms:ge,confirmApproval:ot,cancelApproval:Qt,continueAfterApproval:rt,back:Rn}}Q(`.bf-root{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .07));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));--bf-toast-bg: #1e232e;--bf-toast-color: rgba(255, 255, 255, .85);position:relative;display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;background:var(--bf-bg);color:var(--ds-content-highest, #ffffff);font-family:inherit}[data-theme=dark].wi-popover-content .bf-root,[data-theme=dark].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #121212);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .1));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .05));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .85));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .7));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .5))}[data-theme=light].wi-popover-content .bf-root,[data-theme=light].wi-drawer-content .bf-root{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .05));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .7));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .5))}.bf-root[data-view=history]{background:var(--ds-bg-dim, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header{position:relative;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid var(--bf-border);background:var(--ds-bg-default, var(--bf-bg));box-sizing:border-box}.bf-root[data-view=history] .bf-header{padding:24px;border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff)}.bf-header-btn{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease}.bf-header-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-header .bf-header-btn:last-child{position:absolute;top:24px;right:24px}.bf-header-title{position:absolute;left:50%;transform:translate(-50%);font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--bf-text-high);white-space:nowrap}.bf-root[data-view=history] .bf-header-title{color:var(--ds-content-highest, #000000)}.bf-body,.bf-history-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.bf-body{padding:24px}.bf-history-body{display:flex;flex-direction:column;gap:12px;padding:24px;background:var(--ds-bg-dim, #f5f7fa)}.bf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.bf-chip{display:inline-flex;align-items:center;gap:4px;min-height:33px;padding:6px 8px;border:0;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-chip:hover:not(:disabled){color:var(--bf-text-high);background:var(--bf-surface-hover)}.bf-chip:disabled{cursor:default}.bf-chip-history{position:relative}.bf-chip-dot{position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-swap-card{position:relative;display:flex;flex-direction:column;gap:12px;margin-bottom:12px}.bf-field-error{margin-top:-4px;color:var(--ds-system-red-default, #ff2b5f);font-size:13px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-amount-panel{display:flex;min-height:110px;flex-direction:column;gap:8px;padding:16px;border:1px solid transparent;border-radius:12px;background:var(--bf-surface);box-sizing:border-box;transition:border-color .2s ease}.bf-amount-panel:hover{border-color:var(--bf-border)}.bf-amount-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bf-text-high);font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-balance{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;color:var(--bf-text-low);font-size:12px;white-space:nowrap}.bf-amount-main{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-amount-input-wrap{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bf-amount-input{width:100%;min-width:0;padding:0;border:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;outline:none}.bf-amount-input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-amount-usd{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis}.bf-token-pill{display:inline-flex;flex-shrink:0;align-items:center;gap:6px;min-height:33px;padding:6px 8px 6px 6px;border:1px solid var(--bf-border);border-radius:9999px;background:var(--bf-bg);color:var(--bf-text-high);font:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-token-pill:hover:not(:disabled):not([data-locked=true]){background:var(--bf-surface-hover)}.bf-token-pill:disabled{cursor:default;opacity:.6}.bf-token-pill[data-locked=true]{cursor:default}.bf-token-icon{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font-size:11px;font-weight:700}.bf-token-icon[data-has-image=true]{background:transparent}.bf-token-icon img{width:100%;height:100%;border-radius:0;object-fit:cover}.bf-token-fallback{line-height:1}.bf-token-picker-overlay{--bf-bg: #1e232e;--bf-surface: rgba(255, 255, 255, .05);--bf-surface-hover: rgba(255, 255, 255, .08);--bf-border: rgba(255, 255, 255, .07);--bf-text-high: rgba(255, 255, 255, .85);--bf-text-medium: rgba(255, 255, 255, .65);--bf-text-low: rgba(255, 255, 255, .4);position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-token-picker-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-surface: rgba(18, 18, 18, .05);--bf-surface-hover: rgba(18, 18, 18, .08);--bf-border: rgba(18, 18, 18, .07);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-token-picker{display:flex;width:min(480px,calc(100vw - 48px));height:min(466px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);min-height:0;flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #0006;box-sizing:border-box}.bf-token-picker-handle{display:none}.bf-token-picker-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--bf-border);box-sizing:border-box}.bf-token-picker-head h3{margin:0;color:var(--bf-text-high);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-token-picker-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--bf-text-medium);cursor:pointer}.bf-token-picker-close:hover{color:var(--bf-text-high)}.bf-token-search{display:flex;min-height:48px;flex-shrink:0;align-items:center;gap:8px;margin:16px 24px;padding:12px 16px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, rgba(18, 18, 18, .05));color:var(--bf-text-low);box-sizing:border-box}.bf-token-search:focus-within{border-color:var(--ds-accent-primary-default, #00ceb2)}.bf-token-search input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--bf-text-high);font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-search input::placeholder{color:var(--bf-text-low)}.bf-token-list{display:flex;min-height:0;flex:1;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;padding:0 24px 24px;scrollbar-width:thin;box-sizing:border-box}.bf-token-row{position:relative;display:flex;width:100%;min-height:69px;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid transparent;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-sizing:border-box}.bf-token-row:hover:not([data-selected=true]){background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-surface-medium, rgba(18, 18, 18, .05))}.bf-token-row-left{display:inline-flex;min-width:0;align-items:center;gap:16px}.bf-token-meta{display:flex;min-width:0;flex-direction:column}.bf-token-symbol{overflow:hidden;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-name{overflow:hidden;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-overflow:ellipsis;white-space:nowrap}.bf-token-row-right{display:flex;min-width:86px;max-width:42%;flex-shrink:0;flex-direction:column;align-items:flex-end}.bf-token-balance,.bf-token-price{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-token-balance{color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-token-price{color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-token-row[data-selected=true] .bf-token-symbol{color:var(--bf-text-high)}.bf-token-row[data-selected=true] .bf-token-balance{color:var(--bf-text-high);font-size:16px}.bf-token-row[data-selected=true] .bf-token-price{color:var(--bf-text-low);font-size:14px}.bf-token-empty{padding:32px 16px;color:var(--bf-text-low);font-size:14px;font-weight:500;line-height:1.5;text-align:center}.bf-slippage-overlay{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000085;pointer-events:auto;box-sizing:border-box}.bf-slippage-dialog{display:flex;width:min(480px,calc(100vw - 48px));height:auto;min-height:min(316px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);flex-direction:column;overflow:hidden;border:1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:24px;background:var(--ds-surface-default, #ffffff);color:var(--ds-content-highest, #000000);box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));box-sizing:border-box}.bf-slippage-head{position:relative;display:flex;min-height:73px;flex-shrink:0;align-items:center;justify-content:flex-start;padding:24px 56px 24px 24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-slippage-head h3{margin:0;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;letter-spacing:0}.bf-slippage-close{position:absolute;top:24px;right:24px;display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-slippage-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-slippage-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;padding:24px;box-sizing:border-box}.bf-slippage-desc{margin:0;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-controls{display:flex;flex-direction:column;gap:12px;width:100%}.bf-slippage-presets{display:flex;gap:8px;width:100%}.bf-slippage-preset{appearance:none;display:inline-flex;flex:1 1 0;min-width:0;min-height:48px;align-items:center;justify-content:center;padding:12px 8px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-preset:hover,.bf-slippage-preset[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7);background:var(--ds-accent-primary-low, #e7f9f8)}.bf-slippage-custom{display:flex;min-height:48px;align-items:center;gap:8px;padding:12px;border:1px solid transparent;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));box-sizing:border-box}.bf-slippage-custom:focus-within,.bf-slippage-custom[data-selected=true]{border-color:var(--ds-accent-primary-default, #00b4b7)}.bf-slippage-custom input{width:100%;min-width:0;padding:0;border:0;outline:0;background:transparent;color:var(--ds-content-high, rgba(0, 0, 0, .85));font:inherit;font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-custom input::placeholder{color:var(--ds-content-lowest, rgba(0, 0, 0, .25))}.bf-slippage-custom span:not(.bf-sr-only){flex-shrink:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-apply{appearance:none;margin-top:auto;width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00b4b7);color:var(--ds-accent-primary-on-primary, #ffffff);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer;box-sizing:border-box}.bf-slippage-apply:hover{filter:brightness(.96)}.bf-slippage-apply:disabled{cursor:not-allowed;opacity:.5;filter:none}.bf-slippage-message{margin:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-slippage-message[data-variant=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-slippage-message[data-variant=error]{color:var(--ds-system-red-default, #da0b2e)}.bf-action-modal-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-surface: var(--ds-surface-medium, rgba(255, 255, 255, .05));--bf-surface-hover: var(--ds-surface-high, rgba(255, 255, 255, .08));--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));--bf-text-low: var(--ds-content-low, rgba(255, 255, 255, .4));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#040912b8;pointer-events:auto;box-sizing:border-box}.bf-action-modal-overlay[data-theme=light]{--bf-bg: var(--ds-bg-default, #ffffff);--bf-surface: var(--ds-surface-medium, rgba(18, 18, 18, .05));--bf-surface-hover: var(--ds-surface-high, rgba(18, 18, 18, .1));--bf-border: var(--ds-border-default, rgba(18, 18, 18, .08));--bf-text-high: var(--ds-content-high, rgba(18, 18, 18, .85));--bf-text-medium: var(--ds-content-medium, rgba(18, 18, 18, .65));--bf-text-low: var(--ds-content-low, rgba(18, 18, 18, .4))}.bf-action-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;align-items:center;gap:24px;padding:48px 24px 24px;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:#fff;box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-action-modal h3{width:100%;margin:0;color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;text-align:center;letter-spacing:0}.bf-action-modal-desc{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-terms-check-row{display:grid;width:100%;min-height:56px;grid-template-columns:20px minmax(0,1fr);align-items:center;column-gap:12px;padding:14px 16px;border:none;border-radius:12px;background:var(--bf-surface);color:var(--bf-text-medium);font-size:16px;font-weight:700;line-height:1.4;box-sizing:border-box}.bf-terms-check-button{appearance:none;display:inline-flex;min-width:0;width:20px;height:20px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.bf-terms-copy{display:flex;width:100%;min-width:0;align-items:baseline;justify-content:space-between;column-gap:12px;row-gap:4px;flex-wrap:wrap}.bf-terms-label{min-width:0}.bf-terms-check-button:focus-visible .bf-terms-checkbox{outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-terms-checkbox{position:relative;display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;border:1px solid rgba(124,143,180,.72);border-radius:5px;background:transparent;box-sizing:border-box}.bf-terms-checkbox[data-checked=true]{border-color:var(--ds-accent-primary-default, #00ceb2);background:var(--ds-accent-primary-default, #00ceb2)}.bf-terms-checkbox[data-checked=true]:after{width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg) translate(1px,-1px)}.bf-terms-check-row a{position:relative;z-index:1;color:var(--ds-accent-primary-default, #00ceb2);font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.bf-terms-privacy{max-width:380px;margin:0;color:var(--bf-text-low);font-size:15px;font-weight:500;line-height:1.45;text-align:center;letter-spacing:0}.bf-action-primary,.bf-action-secondary{display:inline-flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:14px 16px;border:0;border-radius:12px;font:inherit;font-size:18px;font-weight:700;line-height:1.4;letter-spacing:0;cursor:pointer}.bf-action-primary{background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000)}.bf-action-primary:disabled{cursor:not-allowed;opacity:.35}.bf-action-primary[aria-busy=true]{gap:8px;opacity:1}.bf-action-button-spinner{width:18px;height:18px;border:2px solid rgba(0,0,0,.22);border-top-color:currentColor;border-right-color:currentColor;border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-action-secondary{background:var(--bf-surface);color:var(--bf-text-low)}.bf-action-secondary:disabled{cursor:not-allowed;opacity:.5}.bf-approve-address-box{display:flex;width:100%;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--bf-border);border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-approve-address-box>span{color:var(--bf-text-low);font-size:14px;font-weight:700;line-height:1.4}.bf-approve-address-box>div{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px}.bf-approve-address-box strong{min-width:0;overflow:hidden;color:var(--bf-text-high);font-size:15px;font-weight:500;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.bf-copy-button{flex-shrink:0;min-width:48px;min-height:32px;padding:6px 10px;border:1px solid rgba(0,206,178,.65);border-radius:8px;background:transparent;color:var(--ds-accent-primary-default, #00ceb2);font:inherit;font-size:12px;font-weight:700;line-height:1.2;cursor:pointer}.bf-copy-button:disabled{cursor:not-allowed;opacity:.45}.bf-action-buttons{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:12px}.bf-approval-success-modal{gap:28px}.bf-success-mark{position:relative;display:inline-flex;width:96px;height:96px;flex-shrink:0;align-items:center;justify-content:center;border:12px solid rgba(0,206,178,.12);border-radius:999px;background:#00ceb2a8;box-shadow:0 0 0 10px #00ceb20f;box-sizing:border-box}.bf-success-mark:after{width:34px;height:18px;border:solid #ffffff;border-width:0 0 6px 6px;content:"";transform:rotate(-45deg) translate(2px,-3px)}.bf-status-toast{position:absolute;right:16px;bottom:14px;left:16px;z-index:5;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--bf-toast-bg, #1e232e);color:var(--bf-toast-color, rgba(255, 255, 255, .85));box-shadow:0 8px 24px #0000003d;box-sizing:border-box}.bf-status-toast-icon{display:inline-flex;width:28px;height:28px;flex-shrink:0;align-items:center;justify-content:center;border-radius:999px}.bf-status-spinner{width:20px;height:20px;border:3px solid rgba(255,255,255,.18);border-top-color:var(--ds-accent-primary-default, #00ceb2);border-right-color:var(--ds-accent-primary-default, #00ceb2);border-radius:999px;animation:bf-loading-spin .9s linear infinite}.bf-status-check{position:relative;width:20px;height:20px;border-radius:999px;background:var(--ds-accent-primary-default, #00ceb2)}.bf-status-check:after{position:absolute;top:6px;left:5px;width:8px;height:4px;border:solid var(--ds-accent-primary-on, #000000);border-width:0 0 2px 2px;content:"";transform:rotate(-45deg)}.bf-status-toast-copy{display:flex;min-width:0;flex:1;flex-direction:column}.bf-status-toast-copy strong,.bf-status-toast-copy span{overflow:hidden;text-overflow:ellipsis}.bf-status-toast-copy strong{color:#fff;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-status-toast-copy span{color:var(--bf-toast-color, rgba(255, 255, 255, .85));font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em}.bf-status-toast[data-variant=success] .bf-status-toast-copy span{color:var(--ds-accent-primary-on-inverted, #00e8c9)}.bf-status-toast[data-variant=error]{border:1px solid rgba(255,43,95,.28);background:var(--bf-toast-bg, #1e232e)}.bf-status-toast[data-variant=error] .bf-status-toast-copy strong{color:#fff}.bf-status-error-mark{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:999px;background:var(--ds-system-red-default, #ff2b5f);color:#fff;font-size:14px;font-weight:700;line-height:1}.bf-status-toast[data-variant=error] .bf-status-toast-copy span{color:#ffffffe0}.bf-success-overlay{--bf-bg: var(--ds-bg-default, #1e232e);--bf-border: var(--ds-border-default, rgba(255, 255, 255, .12));--bf-text-high: var(--ds-content-high, rgba(255, 255, 255, .92));--bf-text-medium: var(--ds-content-medium, rgba(255, 255, 255, .65));position:fixed;inset:0;z-index:100003;display:flex;align-items:center;justify-content:center;padding:24px;background:#000000b8;pointer-events:auto;box-sizing:border-box}.bf-success-overlay[data-theme=light]{--bf-bg: #ffffff;--bf-border: rgba(18, 18, 18, .08);--bf-text-high: rgba(18, 18, 18, .85);--bf-text-medium: rgba(18, 18, 18, .65);--bf-text-low: rgba(18, 18, 18, .4)}.bf-success-modal{display:flex;width:min(480px,calc(100vw - 48px));flex-direction:column;overflow:hidden;border:1px solid var(--bf-border);border-radius:24px;background:var(--bf-bg);color:var(--bf-text-high);box-shadow:0 24px 80px #00000073;box-sizing:border-box}.bf-success-head{display:flex;min-height:73px;align-items:center;justify-content:space-between;gap:16px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));box-sizing:border-box}.bf-success-head h3{min-width:0;margin:0;overflow:hidden;color:var(--ds-content-highest, #000000);font-size:20px;font-weight:600;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}.bf-success-close{display:inline-flex;width:24px;height:24px;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer}.bf-success-close:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-success-body{display:flex;flex-direction:column;align-items:center;gap:24px;padding:40px 24px 24px;box-sizing:border-box}.bf-success-copy{display:flex;width:100%;flex-direction:column;align-items:center;gap:4px;color:var(--bf-text-medium);text-align:center}.bf-success-copy strong{color:var(--bf-text-high);font-size:24px;font-weight:700;line-height:1.25;letter-spacing:0}.bf-success-copy span{color:var(--bf-text-medium);font-size:15px;font-weight:500;line-height:1.5;letter-spacing:0}.bf-success-route{display:flex;align-items:center;justify-content:center;gap:12px}.bf-success-route .bf-token-icon{width:48px!important;height:48px!important;background:transparent;font-size:18px}.bf-success-route-arrow{color:var(--bf-text-low);font-size:24px;font-weight:500;line-height:1}.bf-success-ok{display:inline-flex;width:100%;min-height:48px;align-items:center;justify-content:center;padding:12px;border:0;border-radius:12px;background:#00b4b7e0;color:#fff;font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}@media(max-width:767px){.bf-success-body{padding:40px 24px 24px}.bf-success-copy strong{font-size:22px}.bf-success-copy span{font-size:14px}.bf-success-mark{width:88px;height:88px}.bf-success-route .bf-token-icon{width:44px!important;height:44px!important}}@keyframes bf-loading-spin{to{transform:rotate(360deg)}}.bf-swap-toggle{position:absolute;top:100px;left:50%;z-index:1;display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;padding:0;border:0;border-radius:9999px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);box-shadow:0 1px 5px #0000001f;cursor:pointer}.bf-swap-card[data-has-from-error=true] .bf-swap-toggle{top:132px}.bf-details{display:flex;flex-direction:column;gap:24px}.bf-exchange-rate{display:flex;width:100%;align-items:center;justify-content:center;gap:4px;padding:0 0 24px;border:0;background:transparent;color:var(--bf-text-low);font:inherit;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-exchange-rate:hover{color:var(--bf-text-medium)}.bf-detail-section,.bf-history-card{display:flex;flex-direction:column;gap:12px;padding:0;border-radius:12px;background:transparent;box-sizing:border-box}.bf-liquidity{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:12px;background:var(--bf-surface);box-sizing:border-box}.bf-root[data-view=history] .bf-liquidity,.bf-root[data-view=history] .bf-detail-section,.bf-root[data-view=history] .bf-history-card{background:var(--ds-surface-default, #ffffff)}.bf-detail-section h3{margin:0;color:var(--bf-text-high);font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em}.bf-tx-fee-section{gap:12px}.bf-tx-fee-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.bf-collapse-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin:0;padding:0;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.bf-detail-section[data-open=true] .bf-collapse-head{padding-bottom:12px;border-bottom:1px solid var(--bf-border)}.bf-collapse-chevron{flex-shrink:0;color:var(--bf-text-low);transition:transform .2s ease}.bf-detail-section[data-open=true] .bf-collapse-chevron{transform:rotate(180deg)}.bf-collapse-body{display:flex;flex-direction:column;gap:14px}.bf-root[data-view=history] .bf-detail-section[data-open=true] .bf-collapse-head{border-bottom-color:var(--ds-border-default, rgba(0, 0, 0, .07))}.bf-root[data-view=history] .bf-collapse-chevron{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-tx-fee-total{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--bf-text-medium);font-size:14px;font-weight:600;line-height:1.4;text-align:right}.bf-tx-fee-total>span[data-delegated=true]{text-decoration:line-through;text-decoration-thickness:2px;text-decoration-color:currentColor}.bf-fee-delegated{display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:2px 8px;border-radius:6px;background:#379cff2e;color:#4eb3ff;font-size:10px;font-weight:500;line-height:1.3;white-space:nowrap}.bf-tx-fee-token{width:16px;height:16px;flex-shrink:0;border-radius:999px;object-fit:cover}.bf-info-card{gap:14px}.bf-info-section{display:flex;flex-direction:column;gap:10px}.bf-info-section+.bf-info-section{padding-top:2px}.bf-info-section h4{margin:0;color:var(--bf-text-high);font-size:14px;font-weight:600;line-height:1.5}.bf-root[data-view=history] .bf-detail-section h3,.bf-root[data-view=history] .bf-info-section h4{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.bf-info-rows{display:flex;flex-direction:column;gap:8px}.bf-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-liquidity-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em}.bf-info-label{display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--bf-text-low)}.bf-tree-marker{width:10px;flex-shrink:0;color:var(--bf-text-low)}.bf-info-value{min-width:0;color:var(--bf-text-medium);text-align:right}.bf-info-route,.bf-info-value-token{display:inline-flex;align-items:center;gap:4px}.bf-info-route .bf-token-icon,.bf-info-value-token .bf-token-icon{flex-shrink:0}.bf-info-route-arrow{color:var(--bf-text-medium)}.bf-root[data-view=history] .bf-info-route-arrow{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-root[data-view=history] .bf-info-label,.bf-root[data-view=history] .bf-liquidity-head,.bf-root[data-view=history] .bf-tree-marker{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-root[data-view=history] .bf-info-value{color:var(--ds-content-medium, rgba(0, 0, 0, .65))}.bf-root[data-view=history] .bf-info-value[data-tone=accent]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-root[data-view=history] .bf-info-value[data-tone=warning]{color:var(--ds-system-orange-high, #e56f00)}.bf-liquidity-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap}.bf-liquidity-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.bf-liquidity-status[data-status=normal],.bf-liquidity-status:not([data-status]){background:#00ceb21f;color:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=normal]:before,.bf-liquidity-status:not([data-status]):before{background:var(--ds-accent-primary-default, #00ceb2)}.bf-liquidity-status[data-status=low]{background:#e56f001f;color:#e56f00}.bf-liquidity-status[data-status=low]:before{background:#e56f00}.bf-liquidity-status[data-status=rebalancing]{background:#da0b2e1a;color:#da0b2e}.bf-liquidity-status[data-status=rebalancing]:before{background:#da0b2e}.bf-liquidity-track{height:8px;overflow:hidden;border-radius:999px;background:var(--bf-surface-hover)}.bf-liquidity-track span{display:block;height:100%;border-radius:inherit;background:var(--ds-accent-primary-default, #00ceb2)}.bf-error{padding:12px;border-radius:12px;background:#da0b2e1f;color:var(--ds-system-red-default, #da0b2e);font-size:13px;line-height:1.4}.bf-footer{display:flex;flex-shrink:0;flex-direction:column;align-items:center;gap:10px;padding:12px 24px 24px;background:var(--ds-bg-default, var(--bf-bg))}.bf-next{width:100%;min-height:48px;padding:12px;border:0;border-radius:12px;background:var(--ds-accent-primary-default, #00ceb2);color:var(--ds-accent-primary-on, #000000);font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:-.01em;cursor:pointer}.bf-next:disabled{cursor:default;opacity:.6}.bf-powered{display:inline-flex;align-items:center;gap:3px;color:var(--bf-text-low);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-decoration:none}.bf-powered:focus-visible{border-radius:4px;outline:2px solid var(--ds-accent-primary-default, #00ceb2);outline-offset:2px}.bf-powered-brand{text-decoration:underline;text-underline-offset:2px}.bf-history-tabs{display:flex;align-items:center;gap:4px;width:100%}.bf-history-tab{position:relative;display:inline-flex;min-height:37px;align-items:center;justify-content:center;padding:8px 12px;border:0;background:transparent;color:var(--ds-content-lowest, rgba(0, 0, 0, .25));font:inherit;font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0;cursor:pointer}.bf-history-tab[data-active=true]{color:var(--ds-accent-primary-high, #00a0a2)}.bf-history-tab[data-active=true]:after{position:absolute;right:8px;bottom:0;left:8px;height:3px;border-radius:999px;background:var(--ds-accent-primary-high, #00a0a2);content:""}.bf-history-tab-dot{position:absolute;top:8px;right:4px;width:6px;height:6px;border-radius:999px;background:var(--ds-system-red-default, #da0b2e)}.bf-history-list{display:flex;flex-direction:column;gap:12px}.bf-history-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:12px;background:var(--ds-surface-default, #ffffff);box-sizing:border-box}.bf-history-item-head,.bf-history-meta,.bf-history-route,.bf-history-route-token{display:inline-flex;align-items:center}.bf-history-item-head{justify-content:space-between;gap:12px;width:100%}.bf-history-status{display:inline-flex;min-height:24px;align-items:center;justify-content:center;padding:3px 8px;border-radius:4px;background:var(--ds-system-orange-low, #fcf5e9);color:var(--ds-system-orange-high, #e56f00);font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;white-space:nowrap}.bf-history-status[data-status=completed]{background:var(--ds-system-green-low, #e7f9f8);color:var(--ds-system-green-high, #00a0a2)}.bf-history-status[data-status=failed]{background:var(--ds-system-red-low, rgba(218, 11, 46, .12));color:var(--ds-system-red-default, #da0b2e)}.bf-history-time{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;text-align:right;white-space:nowrap}.bf-history-item-body{display:flex;flex-direction:column;gap:4px}.bf-history-amount{color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:16px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-meta{justify-content:space-between;gap:12px;min-width:0}.bf-history-usd{min-width:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:12px;font-weight:500;line-height:1.5;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route{justify-content:flex-end;gap:4px;min-width:0;color:var(--ds-content-high, rgba(0, 0, 0, .85));font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0}.bf-history-route-token{gap:4px;min-width:0}.bf-history-route-token span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bf-history-route-arrow{flex-shrink:0;color:var(--ds-content-low, rgba(0, 0, 0, .4))}.bf-empty{padding:32px 16px;text-align:center;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-size:14px}.bf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:767px){.bf-token-picker-overlay{align-items:flex-end;padding:0}.bf-token-picker{width:100%;max-height:82dvh;min-height:min(520px,82dvh);border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}.bf-token-picker-handle{display:block;width:40px;height:4px;flex-shrink:0;align-self:center;margin:10px 0 0;border-radius:999px;background:#ffffff38}.bf-token-picker-head{min-height:55px;padding:12px 56px 16px 24px;border-bottom:0}.bf-token-picker-close{top:13px}.bf-token-search{margin:0 16px 12px}.bf-token-list{padding:0 16px 16px}.bf-slippage-overlay{align-items:flex-end;padding:0}.bf-slippage-dialog{width:100%;height:auto;min-height:316px;max-height:82dvh;border-right:0;border-bottom:0;border-left:0;border-radius:24px 24px 0 0}}.wi-drawer-content .bf-header{padding:16px}.wi-drawer-content .bf-header .bf-header-btn:last-child{top:16px;right:16px}.wi-drawer-content .bf-body,.wi-drawer-content .bf-history-body{padding:16px}
10
+ `);import{Fragment as ti,jsx as p,jsxs as k}from"react/jsx-runtime";var Js=A.createContext(void 0);function Wn(){return A.useContext(Js)}function Op(e){let[t,n]=A.useState(void 0);return A.useEffect(()=>{let o=e.current;if(!o)return;let r=()=>{let a=o.closest("[data-theme]");n(a?.getAttribute("data-theme")??void 0)};r();let i=new MutationObserver(r);return i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[e]),t}var Ks=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],Wp={dev:"https://dev.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://crossdefi.io"},Dp=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function zp(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function Qs(e){let t=e.replace(/[^\d.]/g,""),[n="",...o]=t.split("."),r=o.join("");return o.length===0?n:`${n}.${r.slice(0,2)}`}function Gp(e){return`${e.chainId}:${e.address.toLowerCase()}`}function el(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function Ys(e,t){let n=Number(e||"0"),o=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(n)?n*o:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function Hp(e,t=6){if(!e)return e;let[n,o=""]=e.split(".");if(!o)return n;let r=o.slice(0,t).replace(/0+$/,"");return r?`${n}.${r}`:n}function Up(e,t){if(!t)return!1;let n=new jt(e||"0"),o=new jt(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function $p(e){if(e.priceUsd===void 0)return null;let t=new jt(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function jp(e){if(e.priceUsd===void 0)return null;let t=new jt(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function tl(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,jt.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),i=new jt(o||"0").toFormat(0);return r?`${i}.${r}`:i}function Vp(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function qp(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=o=>o.toString().padStart(2,"0");return[`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`,`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`].join(" ")}function Kp(e){let t=new jt(e||"0");return!t.isFinite()||t.isNaN()?e||"0":tl(t)}function Qp(e,t){if(t?.priceUsd===void 0)return null;let n=new jt(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function Ko(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function Yp(e,t){return t==="all"?!0:Ko(e)===t}function Zp(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function Zs(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function nl(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function ol(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":nl(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function rl(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function qo(e){return!e||e==="0"||Number(e)===0}function Xp(e){let t=e.trim().toLowerCase();return t?t.startsWith("minimum ")?{from:e}:t.startsWith("available ")&&t.includes("or more")?{to:e}:t.includes("insufficient balance")||t.includes("not enough balance")||t.includes("exceeds balance")||t.includes("insufficient network fee")?{from:e}:t.includes("insufficient liquidity")||t.includes("not enough liquidity")?{to:e}:{}:{}}function Jp(e){let t=e.fromToken,n=e.toToken,o=ol(t,n),r=e.fromAmount||"0",i=e.toAmount||"0",a=o!==void 0&&!rl(o),s=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:a?[{label:"Route",value:t&&n?`${Zs(t.chainId)} \u2192 ${Zs(n.chainId)}`:"-"},{label:"Validator Fee",value:qo(r)?"0":"Free",tone:qo(r)?"default":"accent"},{label:"Network Fee",value:qo(r)?"0":"Free",tone:qo(r)?"default":"accent"}]:void 0,swapInfo:s?[t&&n?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:n.symbol,iconUrl:n.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:r,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:i,valueToken:n?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function Xn({token:e,size:t=20}){let n=e?.iconUrl;return p("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?p("img",{src:n,alt:"",width:t,height:t,draggable:!1}):p("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function Xs({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:i,locked:a=!1}){return k("section",{className:"bf-amount-panel",children:[k("div",{className:"bf-amount-head",children:[p("span",{children:e}),k("span",{className:"bf-balance",children:[el(t?.balance??"0")," ",t?.symbol??""]})]}),k("div",{className:"bf-amount-main",children:[k("label",{className:"bf-amount-input-wrap",children:[k("span",{className:"bf-sr-only",children:[e," amount"]}),p("input",{type:"text",inputMode:"decimal",value:n,onChange:s=>r(s.target.value),placeholder:"0",className:"bf-amount-input"}),p("span",{className:"bf-amount-usd",children:o})]}),k("button",{type:"button",className:"bf-token-pill",onClick:a?void 0:i,disabled:!a&&!i,"data-locked":a?"true":void 0,"aria-label":`Select ${e.toLowerCase()} token`,children:[p(Xn,{token:t}),p("span",{children:t?.symbol??"Select"}),!a&&p(wn,{size:16})]})]})]})}function ef({flow:e,side:t,onClose:n}){let o=A.useId(),[r,i]=A.useState(""),[a,s]=A.useState(null),c=Wn(),l=t==="from"?e.fromToken:e.toToken;A.useEffect(()=>{s(document.body)},[]),A.useEffect(()=>{let b=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]);let d=A.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),m=A.useMemo(()=>{let b=r.trim().toLowerCase();return b?d.filter(x=>x.symbol.toLowerCase().includes(b)||x.name.toLowerCase().includes(b)):d},[r,d]),w=A.useCallback(b=>{t==="from"?e.selectFromToken(b):e.selectToToken(b),n()},[e,n,t]);return a?On(p("div",{className:"bf-token-picker-overlay","data-theme":c,role:"presentation",onMouseDown:b=>{b.target===b.currentTarget&&n()},children:k("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[p("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),k("header",{className:"bf-token-picker-head",children:[p("h3",{id:o,children:"Select a token"}),p("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:p(Ot,{size:24})})]}),k("label",{className:"bf-token-search",children:[p(Ps,{size:20}),p("span",{className:"bf-sr-only",children:"Search tokens"}),p("input",{value:r,onChange:b=>i(b.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),k("div",{className:"bf-token-list",children:[m.map(b=>{let x=nl(b,l),u=x?jp(b):$p(b);return k("button",{type:"button",className:"bf-token-row","data-selected":x?"true":"false",onClick:()=>w(b),children:[k("span",{className:"bf-token-row-left",children:[p(Xn,{token:b,size:40}),k("span",{className:"bf-token-meta",children:[p("span",{className:"bf-token-symbol",children:b.symbol}),!x&&p("span",{className:"bf-token-name",children:b.name})]})]}),k("span",{className:"bf-token-row-right",children:[k("span",{className:"bf-token-balance",children:[el(b.balance),x?null:` ${b.symbol}`]}),u&&p("span",{className:"bf-token-price",children:u})]})]},Gp(b))}),m.length===0&&p("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a):null}function tf({flow:e,onClose:t}){let n=A.useId(),[o,r]=A.useState(null),i=Ks.find(u=>u.value===e.slippage),[a,s]=A.useState(e.slippage&&!i?e.slippage:""),c=a.trim()!==""&&a.trim()!==".",l=c?Number(a):NaN,d=Number.isFinite(l)&&l>50,m=Number.isFinite(l)&&l>5&&!d,w=u=>{e.setSlippage(u),t()},b=()=>{!c||d||(e.setSlippage(Qs(a)),t())};if(A.useEffect(()=>{r(document.body)},[]),A.useEffect(()=>{let u=h=>{h.key==="Escape"&&t()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t]),!o)return null;let x=Wn();return On(p("div",{className:"bf-slippage-overlay","data-theme":x,role:"presentation",onMouseDown:u=>{u.target===u.currentTarget&&t()},children:k("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[k("header",{className:"bf-slippage-head",children:[p("h3",{id:n,children:"Slippage Settings"}),p("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:p(Ot,{size:24})})]}),k("div",{className:"bf-slippage-body",children:[p("p",{className:"bf-slippage-desc",children:"The maximum price difference you are willing to accept before the transaction is reverted. Higher slippage increases the chance of execution but may result in a worse price."}),k("div",{className:"bf-slippage-controls",children:[p("div",{className:"bf-slippage-presets",children:Ks.map(u=>p("button",{type:"button",className:"bf-slippage-preset","data-selected":!c&&e.slippage===u.value?"true":"false",onClick:()=>w(u.value),children:u.label},u.value))}),k("label",{className:"bf-slippage-custom","data-selected":c?"true":"false",children:[p("span",{className:"bf-sr-only",children:"Custom slippage percent"}),p("input",{value:a,onChange:u=>{s(Qs(u.target.value))},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),b())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),p("span",{"aria-hidden":"true",children:"%"})]})]}),d?p("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):m?p("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,c&&p("button",{type:"button",className:"bf-slippage-apply",onClick:b,disabled:d,children:"Apply"})]})]})}),o)}function nf({flow:e}){let t=A.useId(),[n,o]=A.useState(!1),[r,i]=A.useState(null),a=Wn();return A.useEffect(()=>{i(document.body)},[]),A.useEffect(()=>{let s=c=>{c.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!r||!e.termsOpen?null:On(p("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:s=>{s.target===s.currentTarget&&e.cancelTerms()},children:k("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[p("h3",{id:t,children:"Agree to Terms of Service"}),p("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),k("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[p("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,"aria-label":"Agree to Terms of Use",onClick:()=>o(s=>!s),children:p("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"})}),k("div",{className:"bf-terms-copy",children:[p("span",{className:"bf-terms-label",children:"Agree to Terms of Use"}),e.termsUrl&&p("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),p("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),p("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function of({value:e,disabled:t=!1}){let[n,o]=A.useState(!1);return p("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{o(!0),window.setTimeout(()=>o(!1),1200)})},children:n?"OK":"Copy"})}function rf({flow:e,approval:t}){let n=A.useId(),[o,r]=A.useState(null),i=Wn();if(A.useEffect(()=>{r(document.body)},[]),A.useEffect(()=>{let c=l=>{e.status!=="submitting"&&l.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e]),!o)return null;let a=e.status==="submitting"||!e.approveBridge,s=e.status==="submitting";return On(p("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",children:k("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[k("h3",{id:n,children:["Approve ",t.token.symbol]}),p(Xn,{token:t.token,size:72}),k("div",{className:"bf-approve-address-box",children:[p("span",{children:"Token Address"}),k("div",{children:[p("strong",{children:t.tokenAddress}),p(of,{value:t.tokenAddress,disabled:s})]})]}),k("div",{className:"bf-action-buttons",children:[p("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),k("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":s,children:[s&&p("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),p("span",{children:s?"Approving...":"Approve"})]})]})]})}),o)}function af({flow:e}){let t=A.useId(),[n,o]=A.useState(null),r=Wn();if(A.useEffect(()=>{o(document.body)},[]),A.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=s=>{s.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.approvalSuccessOpen)return null;let i=e.status==="submitting";return On(p("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:k("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[p("h3",{id:t,children:"Approval Success"}),p("span",{className:"bf-success-mark","aria-hidden":"true"}),k("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",p("br",{}),"Please continue to the next step."]}),k("div",{className:"bf-action-buttons",children:[p("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:i,children:"Cancel"}),k("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:i,"aria-busy":i,children:[i&&p("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),p("span",{children:i?"Continuing...":"Continue"})]})]})]})}),n)}function sf({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,i]=A.useState(!1),a=A.useMemo(()=>{let l=new jt(e||"0"),d=new jt(t||"0");return!l.isFinite()||!d.isFinite()||l.lte(0)||d.lte(0)?null:r?l.dividedBy(d):d.dividedBy(l)},[e,r,t]);if(!a||!n||!o||n.symbol===o.symbol)return null;let s=r?o.symbol:n.symbol,c=r?n.symbol:o.symbol;return k("button",{type:"button",className:"bf-exchange-rate",onClick:()=>i(l=>!l),children:[k("span",{children:["1 ",s]}),p(Os,{size:12}),k("span",{children:[tl(a)," ",c]})]})}function lf({flow:e}){return e.submitToast?k("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[p("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:p("span",{className:"bf-status-spinner"})}),k("span",{className:"bf-status-toast-copy",children:[p("strong",{children:"Transaction Processing"}),p("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function cf({message:e}){let[t,n]=A.useState(!1);return A.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:k("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[p("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:p("span",{className:"bf-status-error-mark",children:"!"})}),k("span",{className:"bf-status-toast-copy",children:[p("strong",{children:"Error"}),p("span",{children:e})]})]})}function df(e){switch(e){case"swap":case"deposit-swap":case"swap-withdraw":return"Swap Transaction Sent";case"bridge":return"Bridge Transaction Sent";case"swap-bridge":return"Swap & Bridge Transaction Sent";case"bridge-swap":return"Bridge & Swap Transaction Sent";default:return"Transaction Sent"}}function pf({flow:e}){let t=A.useId(),[n,o]=A.useState(null),r=e.submitted,i=Wn();return A.useEffect(()=>{o(document.body)},[]),A.useEffect(()=>{if(!e.successDialogOpen)return;let a=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.successDialogOpen||!r?null:On(p("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:p("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:k("div",{className:"bf-success-body",children:[p("span",{className:"bf-success-mark","aria-hidden":"true"}),k("div",{className:"bf-success-copy",children:[p("strong",{id:t,children:df(r.pathType)}),p("span",{children:"Please check the results in the history."})]}),p("div",{className:"bf-success-route","aria-hidden":"true",children:(r.routeTokens&&r.routeTokens.length>0?r.routeTokens:[{symbol:r.fromToken.symbol,iconUrl:r.fromToken.iconUrl},{symbol:r.toToken.symbol,iconUrl:r.toToken.iconUrl}]).map((a,s)=>k(A.Fragment,{children:[s>0&&p("span",{className:"bf-success-route-arrow",children:"\u2192"}),p(ei,{token:a,size:43})]},`${a.symbol}-${s}`))}),p("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,children:"OK"})]})})}),n)}function ei({token:e,size:t=16}){let n=!!e.iconUrl;return p("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?p("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):p("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function ff({row:e}){return e.routeTokens&&e.routeTokens.length>0?p("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>k(A.Fragment,{children:[n>0&&p("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),p(ei,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?k("span",{className:"bf-info-value-token",children:[p(ei,{token:e.valueToken}),p("span",{children:e.value})]}):p(ti,{children:e.value})}function il({rows:e}){return!e||e.length===0?null:p("div",{className:"bf-info-rows",children:e.map((t,n)=>k("div",{className:"bf-info-row",children:[k("span",{className:"bf-info-label",children:[p("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),p("span",{children:t.label})]}),p("span",{className:"bf-info-value","data-tone":t.tone??"default",children:p(ff,{row:t})})]},`${t.label}-${t.value}`))})}function uf(e,t,n){return e.pathType==="bridge"?"Bridge Info":rl(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function mf({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return p(ti,{children:r.map(i=>{let a=i==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?k("div",{className:"bf-info-section",children:[o&&p("h4",{children:i==="swap"?"Swap Info":"Bridge Info"}),p(il,{rows:a})]},i):null})})}function gf({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=uf(e,t,n),[i,a]=A.useState(!0),[s,c]=A.useState(!0);return k("div",{className:"bf-details",children:[e.liquidity&&k("section",{className:"bf-liquidity",children:[k("div",{className:"bf-liquidity-head",children:[p("span",{children:e.liquidity.label??"Available Liquidity"}),p("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),p("div",{className:"bf-liquidity-track",children:p("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&k("section",{className:"bf-detail-section bf-info-card","data-open":i?"true":"false",children:[k("button",{type:"button",className:"bf-collapse-head","aria-expanded":i,onClick:()=>a(l=>!l),children:[p("h3",{children:r}),p(wn,{size:16,className:"bf-collapse-chevron"})]}),i&&p("div",{className:"bf-collapse-body",children:p(mf,{summary:e})})]}),o&&k("section",{className:"bf-detail-section bf-tx-fee-section","data-open":s?"true":"false",children:[k("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":s,onClick:()=>c(l=>!l),children:[p("h3",{children:"Est. Tx Fee"}),k("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&p("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&p("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),p("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:Hp(e.txFeeInfo?.estTxFee??"0")}),p(wn,{size:16,className:"bf-collapse-chevron"})]})]}),s&&p("div",{className:"bf-collapse-body",children:p(il,{rows:e.txFee})})]})]})}function hf({item:e}){let t=Ko(e),n=Qp(e.fromAmount,e.fromToken);return k("article",{className:"bf-history-item",children:[k("div",{className:"bf-history-item-head",children:[p("span",{className:"bf-history-status","data-status":t,children:Zp(t)}),p("time",{className:"bf-history-time",dateTime:e.timestamp,children:qp(e.timestamp)})]}),k("div",{className:"bf-history-item-body",children:[k("strong",{className:"bf-history-amount",children:[Kp(e.fromAmount)," ",e.fromToken.symbol]}),k("div",{className:"bf-history-meta",children:[p("span",{className:"bf-history-usd",children:n??Vp(e.txHash)}),k("span",{className:"bf-history-route",children:[k("span",{className:"bf-history-route-token",children:[p(Xn,{token:e.fromToken,size:16}),p("span",{children:e.fromToken.symbol})]}),p(Ms,{size:16,className:"bf-history-route-arrow"}),k("span",{className:"bf-history-route-token",children:[p(Xn,{token:e.toToken,size:16}),p("span",{children:e.toToken.symbol})]})]})]})]})]})}function bf({flow:e}){let[t,n]=A.useState("all"),o=e.history.some(a=>Ko(a)==="pending"),r=e.history.filter(a=>Yp(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return k("main",{className:"bf-history-body",children:[p("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:Dp.map(a=>k("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>n(a.value),children:[p("span",{children:a.label}),a.value==="pending"&&o&&p("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),r.length>0?p("div",{className:"bf-history-list",children:r.map(a=>p(hf,{item:a},a.id||a.txHash))}):p("div",{className:"bf-empty",children:i})]})}function wf({flow:e,env:t}){let[n,o]=A.useState(null),[r,i]=A.useState(!1),[a,s]=A.useState(0),l=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??Jp(e):null,d=Wp[t],m=Xp(e.quoteError),w=Up(e.fromAmount,e.fromToken),b=w?"Insufficient balance":m.from,x=e.quoteError&&!m.from&&!m.to?e.quoteError:"",u=e.error||x,h=e.history.some(f=>Ko(f)==="pending"),C=(l?.pathType??ol(e.fromToken,e.toToken))!=="bridge";return k(ti,{children:[k("main",{className:"bf-body",children:[k("div",{className:"bf-toolbar",children:[k("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[p(Fs,{}),p("span",{children:"History"}),(h||e.hasNewHistory)&&p("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),C&&k("button",{type:"button",className:"bf-chip",onClick:()=>i(!0),disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[p(Bs,{}),p("span",{children:e.slippageLocked?"Auto 1%":zp(e.slippage,e.effectiveSlippage)})]})]}),k("div",{className:"bf-swap-card","data-has-from-error":b?"true":"false",children:[p(Xs,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:Ys(e.fromAmount,e.fromToken),onAmountChange:f=>e.setAmount(f,"from"),onTokenClick:()=>o("from")}),b&&p("div",{className:"bf-field-error",children:b}),p("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),s(f=>f+360)},style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:p(_s,{size:22})}),p(Xs,{label:"To",token:e.toToken,amount:e.toAmount,usd:Ys(e.toAmount,e.toToken),onAmountChange:f=>e.setAmount(f,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),m.to&&p("div",{className:"bf-field-error",children:m.to})]}),p(sf,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),l&&p(gf,{summary:l})]}),k("footer",{className:"bf-footer",children:[p("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError||w,children:e.status==="submitting"?"Processing...":"Next"}),k("a",{className:"bf-powered",href:d,target:"_blank",rel:"noreferrer",children:["Powered by ",p("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&p(ef,{flow:e,side:n,onClose:()=>o(null)}),r&&p(tf,{flow:e,onClose:()=>i(!1)}),p(nf,{flow:e}),e.approvalInfo&&p(rf,{flow:e,approval:e.approvalInfo}),p(af,{flow:e}),p(lf,{flow:e}),p(cf,{message:e.submitToast?"":u}),p(pf,{flow:e})]})}function Qo({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let i=A.useMemo(()=>je(n),[n]),a=qs({...r,onExit:t}),s=A.useRef(null),c=Op(s),l=a.step==="history"?"History":"Swap & Bridge";return p(Js.Provider,{value:c,children:k("div",{ref:s,className:le("bf-root",o),"data-view":a.step,"data-status":a.status,children:[k("header",{className:"bf-header",children:[p("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:p(bn,{size:24})}),p("span",{className:"bf-header-title",children:l}),p("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:p(Ot,{size:24})})]}),a.step==="history"?p(bf,{flow:a}):p(wf,{flow:a,env:i})]})})}import{Fragment as Zo,jsx as g,jsxs as I}from"react/jsx-runtime";var vf="On-ramp is not available in your region.";function ni(e,t,n){let o=xe[e],r=n.toUpperCase();if(t===o.cross&&r.includes("CROSSD"))return 0;if(t===o.cross&&r==="CROSS")return 1;if(t===o.bsc&&r==="CROSS")return 2}function yf(e){return parseInt(e.split(":")[1],10)}function kf(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Sf(e){let t=e.toLowerCase().replace(/^0x/,""),n=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),o=parseInt(n.slice(0,4),16)%360,r=(o+60+parseInt(n.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${o} 85% 65%), hsl(${r} 80% 55%))`}function al({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:i,isMobile:a,open:s,drawerDirection:c,modal:l,showBalance:d,showForgeToken:m,showGameToken:w,showQR:b,showBridge:x,qrLogoSrc:u,walletAddress:h,accountName:y,sendAccounts:C,profileImageUrl:f,preferredTokens:N,close:S,onSelectWallet:T,onCopyAddress:R,onBuy:U,onDisconnect:D,disconnectLabel:z,termsUrl:F,termsLabel:oe,privacyUrl:L,privacyLabel:Z,portalStyle:G,navContent:K,navPosition:ie,footerContent:me,view:$,setView:se,selectedSendToken:de,setSelectedSendToken:j,showPortfolio:Le,portfolioTitle:B,portfolioSections:J,showTotalAssets:V,totalAssetsLabel:re,sendTransaction:fe,getTransactionReceipt:ct,estimateGas:vt,onOutlink:Ye,lpBalanceReader:Kt,stakingRewardsReader:Ee,bridgeTokens:ve,bridgeHistory:dt,getBridgeQuote:Ae,getBridgeToTokens:_e,getBridgeApproval:ye,approveBridge:Ft,submitBridge:yt,onReceive:Bt,onBridge:et,onSend:_t,onBuyDisabledMessage:tt,onBridgeDisabledMessage:ke,onSendDisabledMessage:nt}=tn(),[pt,ze]=W.useState(null),kt=W.useRef(void 0),we=W.useCallback(v=>{ze(v),clearTimeout(kt.current),kt.current=setTimeout(()=>ze(null),4e3)},[]);W.useEffect(()=>()=>clearTimeout(kt.current),[]);let Te=!!tt,Mt=W.useCallback(()=>{if(Te){we(tt);return}let v=U?.();v&&typeof v.then=="function"&&v.catch(()=>{we(tt??vf)})},[Te,tt,U,we]),St=!!ke,Ge=!!nt,{tokens:ft,isLoading:Rt}=an(r,h,s&&d),{statsMap:Ne}=sn(r,d),{apyPercent:Pe}=Pa(),{categoryMap:E}=Fa(r,d),ee=d&&V,{displayValue:ge,isLowerBound:ot,isLoading:Qt}=Ba(r,h,s&&ee),[rt,Sn]=W.useState(!1),Yt=W.useRef(null),[Rn,io]=W.useState(0),{holdings:_,isLoading:Ie}=Ea(r,h,s&&d&&m),q=W.useMemo(()=>_.map(v=>v.token),[_]),{imageMap:He}=Aa(r,q,m&&_.length>0),ut=W.useMemo(()=>{let v=[],M=[],te=[],$e=new Map((N??[]).map((ae,Me)=>[`${yf(ae.chainId)}:${ae.address.toLowerCase()}`,Me]));for(let ae of ft){let Me=ni(r,ae.chainId,ae.symbol)!==void 0,Ct=`${ae.chainId}:${ae.address.toLowerCase()}`,mn=$e.get(Ct),gr=new Jn(ae.quantity.numeric).shiftedBy(-ae.quantity.decimals);if(Me)v.push(ae);else if(mn!==void 0)M.push(ae);else if(gr.isGreaterThan(0)){if(!w&&E.get(Or(ae.chainId,ae.address))==="game")continue;te.push(ae)}}return v.sort((ae,Me)=>{let Ct=ni(r,ae.chainId,ae.symbol)??99,mn=ni(r,Me.chainId,Me.symbol)??99;return Ct-mn}),M.sort((ae,Me)=>{let Ct=$e.get(`${ae.chainId}:${ae.address.toLowerCase()}`)??99,mn=$e.get(`${Me.chainId}:${Me.address.toLowerCase()}`)??99;return Ct-mn}),te.sort((ae,Me)=>{let Ct=Ne.get(It(ae.chainId,ae.address)),mn=Ne.get(It(Me.chainId,Me.address)),gr=new Jn(ae.quantity.numeric).shiftedBy(-ae.quantity.decimals).multipliedBy(Ct?.price??0);return new Jn(Me.quantity.numeric).shiftedBy(-Me.quantity.decimals).multipliedBy(mn?.price??0).minus(gr).toNumber()}),[...v,...M,...te]},[ft,r,Ne,w,E,N]),li=W.useMemo(()=>{if(!m)return[];let v=new Set(ft.map(M=>M.address.toLowerCase()));return[..._].filter(M=>!v.has(M.token.toLowerCase())).sort((M,te)=>{let $e=new Jn(M.value);return new Jn(te.value).minus($e).toNumber()})},[_,m,ft]),un=W.useRef(!1),[Ue,zn]=W.useState(null),Cn=W.useRef(void 0),ci=Ue?.chainId??de?.chainId??ut[0]?.chainId??0,{transactionUrl:lr}=wo(r,ci,Ue?.txHash,!!(Ue?.txHash&&ci)),it=W.useCallback(v=>{un.current=!0,se(v)},[se]),[Bl,cr]=W.useState("recipient"),ao=W.useCallback(()=>{j(null),cr("recipient"),it("wallet")},[j,it]),dr=W.useCallback((v,M="recipient")=>{if(Ge){we(nt);return}cr(M),j(v),it("send")},[Ge,nt,we,j,it]),_l=W.useCallback(()=>{if(St){we(ke);return}if(et){et();return}it("bridge")},[St,ke,et,it,we]),Ml=W.useCallback(v=>{clearTimeout(Cn.current),j(null),it("wallet"),zn({status:"pending",txHash:v.txHash,chainId:v.chainId,description:`${v.amount} ${v.tokenSymbol} to ${st(v.recipient)}`})},[j,it]),Ol=W.useCallback(v=>{let M=de?.chainId;j(null),it("wallet"),!(!v||!M)&&(zn(te=>({status:"success",txHash:v,chainId:M,description:te?.txHash===v?te.description:"Tap to see your transaction"})),clearTimeout(Cn.current),Cn.current=setTimeout(()=>zn(null),5e3))},[de?.chainId,j,it]),Wl=W.useCallback(v=>{let M=v.txHash;M&&(zn({status:"error",txHash:M,chainId:v.chainId,description:v.message}),clearTimeout(Cn.current),Cn.current=setTimeout(()=>zn(null),5e3))},[]),Gn=W.useMemo(()=>{if(Bt)return Bt;if(b)return()=>it("qr")},[Bt,b,it]),pr=W.useMemo(()=>{if(_t)return _t;if(ut.length===0)return;let v=ut[0];return()=>dr(v,"token")},[_t,ut,dr]),Dl=W.useCallback(()=>{if(Ge){we(nt);return}pr?.()},[Ge,nt,pr,we]);W.useEffect(()=>{s||(un.current=!1,cr("recipient"))},[s]);let di=W.useRef(null);W.useEffect(()=>{let v=di.current;if(!v||!a)return;let M=te=>{te.pointerType==="touch"&&te.stopPropagation()};return v.addEventListener("pointerdown",M),()=>v.removeEventListener("pointerdown",M)},[a]);let[Tn,pi]=W.useState(!1),fr=W.useRef(void 0),[Hn,Un]=W.useState(!1);W.useEffect(()=>{if(!Hn)return;let v=()=>Un(!1),M=$e=>{$e.key==="Escape"&&Un(!1)},te=setTimeout(()=>{document.addEventListener("mousedown",v,!0),document.addEventListener("keydown",M,!0)},0);return()=>{clearTimeout(te),document.removeEventListener("mousedown",v,!0),document.removeEventListener("keydown",M,!0)}},[Hn]),W.useEffect(()=>{Un(!1)},[h]),W.useEffect(()=>()=>clearTimeout(fr.current),[]),W.useEffect(()=>()=>clearTimeout(Cn.current),[]),W.useEffect(()=>{let v=Yt.current;if(!v||me===null){io(0);return}let M=()=>{io(v.offsetHeight)};if(M(),typeof ResizeObserver>"u")return;let te=new ResizeObserver(M);return te.observe(v),()=>te.disconnect()},[me]);let fi=W.useCallback(async()=>{if(!Tn)try{await navigator.clipboard.writeText(h),pi(!0),clearTimeout(fr.current),fr.current=setTimeout(()=>pi(!1),2e3),R?.(h,!0)}catch{R?.(h,!1)}},[h,R,Tn]),so=W.useCallback(v=>{v.currentTarget.setAttribute("data-loaded","true")},[]),ui=W.useMemo(()=>({background:Sf(h)}),[h]),lo=W.useMemo(()=>f||Xt(r,h,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[f,r,h,i]),ur=W.useMemo(()=>kf(ge),[ge]),mi=F||L?I("div",{className:"wi-legal-links",children:[F&&g("a",{className:"wi-legal-link",href:F,target:"_blank",rel:"noopener noreferrer",onClick:v=>Ke(v,F,{category:"terms",origin:"terms"},Ye),children:oe}),F&&L&&g("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),L&&g("a",{className:"wi-legal-link",href:L,target:"_blank",rel:"noopener noreferrer",onClick:v=>Ke(v,L,{category:"privacy",origin:"privacy"},Ye),children:Z})]}):null,gi=D?I("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{D(),S()},children:[g(Di,{size:16}),g("span",{className:"wi-disconnect-label",children:z})]}):null,zl=d&&!K?I("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[I("button",{type:"button",className:le("wi-action-card",Te&&"wi-action-card--dimmed"),onClick:Mt,disabled:!U&&!Te,"aria-disabled":Te||void 0,"aria-label":"Buy",children:[g(ji,{size:20}),g("span",{children:"Buy"})]}),x?I("button",{type:"button",className:le("wi-action-card",St&&"wi-action-card--dimmed"),onClick:_l,"aria-disabled":St||void 0,"aria-label":"Bridge",children:[g(Vi,{size:20}),g("span",{children:"Bridge"})]}):I("button",{type:"button",className:"wi-action-card",onClick:Gn,disabled:!Gn,"aria-label":"Receive",children:[g(ho,{size:20}),g("span",{children:"Receive"})]}),I("button",{type:"button",className:le("wi-action-card",Ge&&"wi-action-card--dimmed"),onClick:Dl,disabled:!Ge&&!pr,"aria-disabled":Ge||void 0,"aria-label":"Send",children:[g(Ui,{size:20}),g("span",{children:"Send"})]}),Le?I("button",{type:"button",className:"wi-action-card",onClick:()=>it("portfolio"),"aria-label":"View portfolio",children:[g($i,{size:20}),g("span",{children:"Portfolio"})]}):x?I("button",{type:"button",className:"wi-action-card",onClick:Gn,disabled:!Gn,"aria-label":"Receive",children:[g(ho,{size:20}),g("span",{children:"Receive"})]}):null]}):null,Gl=I("div",{className:le("wi-view-inner",un.current&&"wi-view-wallet"),children:[ee&&I("div",{className:"wi-total-section",children:[I("div",{className:"wi-total-head",children:[g("span",{className:"wi-total-label",children:re}),g("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:v=>{v.stopPropagation(),Sn(M=>!M)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),Sn(M=>!M))},"aria-label":rt?"Show balance":"Hide balance",children:rt?g(Gi,{}):g(zi,{})})]}),g("div",{className:"wi-total-body",children:Qt?g("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):g("div",{className:"wi-total-value","data-hidden":rt||void 0,children:rt?g("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):I(Zo,{children:[ot&&g("span",{className:"wi-total-lte",children:"\u2264"}),g("span",{className:"wi-total-currency",children:"$"}),g("span",{className:"wi-total-amount",children:ur.main}),ur.decimal&&g("span",{className:"wi-total-decimal",children:ur.decimal})]})})})]}),ie==="top"&&(K?g("div",{className:"wi-nav-fixed",children:K}):zl),d&&g("div",{ref:di,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:I("div",{className:"wi-token-list",children:[Rt&&Array.from({length:5},(v,M)=>I("div",{className:"wi-skeleton-item",children:[I("div",{className:"wi-skeleton-left",children:[g("div",{className:"wi-skeleton-block wi-skeleton-icon"}),I("div",{className:"wi-skeleton-lines",children:[g("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),g("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),I("div",{className:"wi-skeleton-right",children:[g("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),g("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},M)),!Rt&&ut.length===0&&!m&&g("div",{className:"wi-empty",children:"No Tokens Found"}),ut.map(v=>{let M=Ne.get(It(v.chainId,v.address)),te=M?parseFloat(M.percent_change_24h):null,$e=te!==null&&te>=0,ae=Qn(r,v.chainId),Me=fa(v.address);return I("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>dr(v),"aria-label":`Send ${v.symbol}`,children:[I("div",{className:"wi-token-left",children:[I("div",{className:"wi-token-icon-wrap",children:[g("img",{src:v.icon_url,alt:v.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:so,onError:Ct=>{Ct.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),ae&&g("img",{src:ae,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Ct=>{Ct.currentTarget.style.display="none"}})]}),I("div",{className:"wi-token-info",children:[I("span",{className:"wi-token-name-row",children:[g("span",{className:"wi-token-name",children:v.symbol}),Me&&Pe!==null&&g("span",{className:"wi-token-apy",children:`APY ${Pe>=0?"+":"-"}${(Pe>=0?Math.floor:Math.ceil)(Math.abs(Pe)*100)/100}%`})]}),M&&I("div",{className:"wi-token-price-row",children:[g("span",{className:"wi-token-price",children:Sr(M.price)}),g("span",{className:"wi-token-change","data-positive":$e,"data-zero":te===0||void 0,children:te!==null&&(te===0?"0%":`${$e?"+":"-"}${($e?Math.floor:Math.ceil)(Math.abs(te)*100)/100}%`)})]})]})]}),I("div",{className:"wi-token-right",children:[g("span",{className:"wi-token-balance",children:nn(v.quantity.numeric,v.quantity.decimals)}),M&&g("span",{className:"wi-token-value",children:Ki(v.quantity.numeric,v.quantity.decimals,M.price)})]})]},`${v.address}-${v.chainId}`)}),m&&Ie&&Array.from({length:3},(v,M)=>I("div",{className:"wi-skeleton-item",children:[I("div",{className:"wi-skeleton-left",children:[g("div",{className:"wi-skeleton-block wi-skeleton-icon"}),I("div",{className:"wi-skeleton-lines",children:[g("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),g("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),I("div",{className:"wi-skeleton-right",children:[g("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),g("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${M}`)),m&&!Ie&&!Rt&&ut.length===0&&li.length===0&&g("div",{className:"wi-empty",children:"No Tokens Found"}),m&&li.map(v=>{let M=He.get(v.token)||"",te=Qn(r,xe[r].cross);return I("div",{className:"wi-token-item",children:[I("div",{className:"wi-token-left",children:[I("div",{className:"wi-token-icon-wrap",children:[g("img",{src:M||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:v.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:so,onError:$e=>{$e.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),te&&g("img",{src:te,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:$e=>{$e.currentTarget.style.display="none"}})]}),I("div",{className:"wi-token-info",children:[g("span",{className:"wi-token-name",children:v.token_name}),g("div",{className:"wi-token-price-row",children:I("span",{className:"wi-token-price",children:[nn(v.current_price,18)," CROSS"]})})]})]}),I("div",{className:"wi-token-right",children:[g("span",{className:"wi-token-balance",children:nn(v.balance,18)}),g("span",{className:"wi-token-value",children:Sr(v.current_value_usd)})]})]},`forge-${v.token}`)})]})}),ie==="bottom"&&K&&g("div",{className:"wi-nav-fixed",children:K}),gi&&g("div",{className:"wi-wallet-disconnect-row",children:gi})]},"wallet"),Hl=Le?g("div",{className:le("wi-view-inner wi-portfolio-body",un.current&&"wi-view-portfolio"),children:g(Mn,{env:r,theme:i,walletAddress:h,showHeader:!1,onOutlink:Ye,lpBalanceReader:Kt,stakingRewardsReader:Ee,sendTransaction:fe,estimateGas:vt,sections:J})},"portfolio"):null,Ul=de?g("div",{className:le("wi-view-inner wi-send-body",un.current&&"wi-view-send"),children:g(Eo,{env:r,theme:i,walletAddress:h,accountName:y,accounts:C,initialStep:Bl,token:de,tokens:ut,onTokenChange:j,sendTransaction:fe,getTransactionReceipt:ct,estimateGas:vt,getTokenPriceUsd:v=>{let M=Ne.get(It(v.chainId,v.address));if(!M?.price)return;let te=parseFloat(M.price);return Number.isFinite(te)?te:void 0},onClose:S,onBackToWallet:ao,onSubmitted:Ml,onSuccess:Ol,onFailed:Wl,onOutlink:Ye})},"send"):null,$l=W.useMemo(()=>ve||ut.map(v=>{let M=Ne.get(It(v.chainId,v.address)),te=M?.price?parseFloat(M.price):void 0;return{name:v.name,symbol:v.symbol,chainId:v.chainId,address:v.address,decimals:v.quantity.decimals,balance:qn(v.quantity.numeric,v.quantity.decimals),iconUrl:v.icon_url,priceUsd:Number.isFinite(te)?te:void 0}}),[ve,Ne,ut]),jl=g("div",{className:le("wi-view-inner wi-bridge-body",un.current&&"wi-view-send"),children:g(Qo,{env:r,walletAddress:h,tokens:$l,history:dt,termsUrl:F,getQuote:Ae,getToTokens:_e,getApproval:ye,approveBridge:Ft,submitBridge:yt,onClose:S,onBackToWallet:ao})},"bridge"),mr=!!T&&y?.trim().toLowerCase()!=="my wallet",hi=I(Zo,{children:[I("span",{className:"wi-receive-avatar",children:[g("span",{className:"wi-avatar-fallback",style:ui}),lo&&g("img",{src:lo,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:so,onError:v=>{v.currentTarget.style.display="none"}})]}),g("span",{className:"wi-receive-account-name",children:y??"Account 1"}),mr&&g("span",{className:"wi-receive-chevron","data-open":Hn,"aria-hidden":"true",children:g(wn,{size:16})})]}),Vl=I("div",{className:le("wi-view-inner wi-qr-body",un.current&&"wi-view-qr"),children:[I("div",{className:"wi-receive-section",children:[mr?g("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{Un(!0),T?.()},"aria-label":"Switch account",children:hi}):g("div",{className:"wi-receive-account",children:hi}),I("div",{className:"wi-qr-block",children:[I("div",{className:"wi-qr-box",children:[g(xf,{value:h,size:180,level:"H",marginSize:2,...u&&{imageSettings:{src:u,height:33,width:33,excavate:!0}}}),!u&&g("div",{className:"wi-qr-logo",children:g(Hi,{size:33})})]}),g("p",{className:"wi-qr-address",children:h})]}),I("button",{type:"button",className:"wi-qr-copy-btn",onClick:fi,children:[g("span",{className:"wi-qr-copy-icon",children:Tn?g(hn,{size:16}):g($n,{size:16})}),g("span",{className:"wi-qr-copy-text",children:Tn?"Copied!":"Copy address"})]})]}),mi&&g("div",{className:"wi-receive-footer",children:mi})]},"qr"),ql=$==="qr"||$==="portfolio"||$==="send"||$==="bridge",bi=me!==null?g("div",{className:"wi-builtin-footer",children:me}):null,wi=I("div",{className:"wi-account-text",children:[mr?I("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{Un(!0),T?.()},"aria-label":"Switch account","aria-expanded":Hn,children:[g("span",{className:"wi-account-name",children:y??"Account 1"}),g("span",{className:"wi-account-switch","data-open":Hn,"aria-hidden":"true",children:g(wn,{size:20})})]}):g("div",{className:"wi-account-row",children:g("span",{className:"wi-account-name",children:y??"Account 1"})}),I("button",{type:"button",className:"wi-address-row-btn",onClick:fi,"aria-label":"Copy address",children:[g("span",{className:"wi-account-address",children:st(h)}),g("span",{className:"wi-account-copy","data-copied":Tn,children:Tn?g(hn,{size:12}):g($n,{size:12})})]})]}),xi=I(Zo,{children:[o,$==="qr"?g("div",{className:"wi-sticky-header",children:I("div",{className:"wi-header wi-header--receive",children:[g("button",{type:"button",className:"wi-header-back",onClick:ao,"aria-label":"Back",children:g(bn,{size:24})}),g("span",{className:"wi-receive-title",children:"Receive"}),g("button",{type:"button",className:"wi-header-action",onClick:S,"aria-label":"Close",children:g(Ot,{size:24})})]})}):$==="send"||$==="bridge"?null:ql?I("div",{className:"wi-sticky-header",children:[I("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[g("button",{type:"button",className:"wi-header-back",onClick:ao,"aria-label":"Back",children:g(bn,{size:24})}),g("div",{className:"wi-account-block wi-account-block--sub-account",children:wi}),g("button",{type:"button",className:"wi-header-action",onClick:S,"aria-label":"Close",children:g(Ot,{size:24})})]}),g("hr",{className:"wi-divider"})]}):I("div",{className:"wi-sticky-header",children:[I("div",{className:"wi-header wi-header--wallet",children:[I("div",{className:"wi-account-block",children:[I("div",{className:"wi-avatar",children:[g("div",{className:"wi-avatar-fallback",style:ui}),lo&&g("img",{src:lo,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:so,onError:v=>{v.currentTarget.style.display="none"}})]}),wi]}),I("div",{className:"wi-header-actions",children:[b&&x&&g("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:Gn,"aria-label":"Show QR code",children:g(ho,{size:20})}),g("button",{type:"button",className:"wi-header-action",onClick:S,"aria-label":"Close",children:g(Ot,{size:24})})]})]}),g("hr",{className:"wi-divider"})]}),I("div",{className:"wi-view-container",children:[$==="wallet"&&Gl,$==="qr"&&Vl,$==="portfolio"&&Hl,$==="send"&&Ul,$==="bridge"&&jl]}),$==="wallet"&&pt&&g("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:pt}),$==="wallet"&&Ue&&I("a",{className:"wi-send-toast",href:lr??"#",target:"_blank",rel:"noopener noreferrer",onClick:v=>{if(!lr){v.preventDefault();return}Ke(v,lr,{category:"send",origin:"send-transaction",payload:{chainId:Ue.chainId,txHash:Ue.txHash}},Ye)},children:[g("span",{className:"wi-send-toast-icon","data-status":Ue.status,"aria-hidden":!0,children:Ue.status==="pending"?g("span",{className:"wi-send-toast-spinner"}):Ue.status==="error"?g("span",{className:"wi-send-toast-error-dot"}):g(qi,{size:20})}),I("span",{className:"wi-send-toast-copy",children:[g("span",{className:"wi-send-toast-title",children:Ue.status==="pending"?"Sending...":Ue.status==="error"?"Send failed":"Send complete"}),g("span",{className:"wi-send-toast-desc",children:Ue.status==="pending"||Ue.status==="error"?Ue.description:"Tap to see your transaction"})]})]}),bi&&$!=="portfolio"&&$!=="send"&&g("div",{className:"wi-sticky-footer",children:g("div",{className:"wi-footer",ref:Yt,children:bi})})]}),vi={...G,...Rn>0?{"--wi-footer-height":`${Rn}px`}:null};return a?I(Yo.Portal,{children:[l&&g(Yo.Overlay,{className:"wi-drawer-overlay"}),I(Yo.Content,{className:le("wi-drawer-content",n),"data-theme":i,"data-vaul-no-drag":c==="left"||c==="right"?!0:void 0,style:vi,"data-direction":c,"data-no-balance":!d||void 0,"data-has-footer":Rn>0||void 0,"data-view":$,children:[g(Yo.Title,{className:"wi-sr-only",children:"My Wallet"}),xi]})]}):I(Zo,{children:[l&&s&&g("div",{className:"wi-drawer-overlay",onClick:S}),g(Xo.Portal,{children:g(Xo.Content,{align:e,sideOffset:t,className:le("wi-popover-content",n),"data-theme":i,style:vi,"data-no-balance":!d||void 0,"data-has-footer":Rn>0||void 0,"data-view":$,children:xi})})]})}import*as sl from"react";function ll({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=tn();return sl.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}import*as cl from"react";function dl({children:e}){let{setFooterContent:t}=tn();return cl.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}Q(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #121212);--wi-surface-default: var(--ds-surface-medium, rgba(255, 255, 255, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(255, 255, 255, .1));--wi-border-default: var(--ds-border-default, rgba(255, 255, 255, .05));--wi-border-subtle: var(--ds-border-medium, rgba(255, 255, 255, .1));--wi-texticon-primary: var(--ds-content-highest, #ffffff);--wi-texticon-secondary: var(--ds-content-medium, rgba(255, 255, 255, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(255, 255, 255, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .4)}[data-theme=light].wi-popover-content,[data-theme=light].wi-drawer-content{--wi-primary: var(--ds-accent-primary-default, #019d92);--wi-secondary: var(--ds-system-red-default, #e70077);--wi-surface-bg: var(--ds-bg-default, #ffffff);--wi-surface-default: var(--ds-surface-medium, rgba(18, 18, 18, .05));--wi-surface-subtle: var(--ds-surface-high, rgba(18, 18, 18, .1));--wi-border-default: var(--ds-border-default, rgba(18, 18, 18, .05));--wi-border-subtle: var(--ds-border-medium, rgba(18, 18, 18, .1));--wi-texticon-primary: var(--ds-content-highest, #121212);--wi-texticon-secondary: var(--ds-content-medium, rgba(18, 18, 18, .7));--wi-texticon-tertiary: var(--ds-content-low, rgba(18, 18, 18, .5));--wi-on-primary: var(--ds-accent-primary-on, #ffffff);--wi-error: var(--ds-system-red-default, #e70077);--wi-shadow: 0 2px 16px -2px rgba(0, 0, 0, .15)}
11
+ `);Q(`.wi-trigger-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid rgba(255,255,255,.2);background:#1a2332;border-radius:9999px;cursor:pointer;color:#fff;font-family:inherit;font-size:16px;font-weight:500;line-height:24px;letter-spacing:-.3125px;transition:opacity .15s ease}.wi-trigger-btn:hover{opacity:.85}.wi-trigger-btn[data-theme=light]{background:#f3f6f8;border-color:#1212121a;color:#121212}.wi-trigger-btn[data-mobile]{font-size:14px;padding:6px 12px;gap:6px;line-height:20px}.wi-trigger-address{white-space:nowrap}.wi-divider{height:1px;background:var(--wi-border-default);margin:0;border:none;flex-shrink:0}[data-theme=light] .wi-divider{background:#1212121a}[data-theme=dark] .wi-divider{background:#ffffff1a}
12
+ `);Q(`@keyframes wi-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes wi-shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes wi-slide-in-right{0%{transform:translate(40px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes wi-slide-in-left{0%{transform:translate(-40px);opacity:0}to{transform:translate(0);opacity:1}}
13
+ `);Q(`.wi-popover-content{-webkit-font-smoothing:antialiased;z-index:100001;width:393px;border-radius:24px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--wi-surface-bg);box-shadow:var(--ds-shadow-modal, var(--wi-shadow));animation:wi-fade-in .15s ease-out;height:600px;overflow:hidden;display:flex;flex-direction:column}.wi-popover-content[data-no-balance]{height:auto}.wi-popover-content[data-has-footer]:not([data-no-balance]){height:min(calc(600px + var(--wi-footer-height, 0px)),calc(100dvh - 32px))}.wi-drawer-overlay{position:fixed;inset:0;z-index:100000;background:#0009}.wi-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;top:0;right:0;bottom:0;z-index:100001;width:100vw;max-height:100vh;background:var(--wi-surface-bg);overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box}.wi-drawer-content[data-no-balance]{bottom:auto;max-height:none}.wi-drawer-content[data-no-balance][data-direction=bottom]{bottom:0;top:auto;border-radius:24px 24px 0 0}.wi-drawer-content[data-direction=left]{right:auto;left:0}.wi-drawer-content[data-direction=bottom]{top:0;left:0;right:0;width:100%;max-height:100dvh;margin:0 auto}.wi-drawer-content[data-direction=bottom][data-view=qr]{max-height:100dvh}.wi-popover-content[data-view=qr]{max-height:calc(100dvh - 32px)}.wi-sticky-header{flex-shrink:0;position:relative}.wi-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:24px}.wi-header--wallet{align-items:flex-start;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--wallet+.wi-divider{display:none}.wi-header--sub-account{align-items:center}.wi-header--sub-account .wi-header-back{width:32px;height:38px}.wi-header--sub-account .wi-header-action{flex-shrink:0}.wi-account-block{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wi-account-block--sub-account{align-items:center}.wi-avatar{flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:50%;background:var(--wi-surface-bg);box-sizing:border-box;overflow:hidden}.wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-avatar-img{position:relative;z-index:1;width:32px;height:32px;border-radius:50%;object-fit:cover;background:transparent}.wi-account-text{display:flex;flex-direction:column;gap:2px;min-width:0}.wi-account-row{display:flex;align-items:center;gap:8px;min-width:0}.wi-account-row--btn{padding:2px;margin:0;width:fit-content;border:none;background:transparent;cursor:pointer;color:inherit;font:inherit;border-radius:6px;transition:background-color .15s ease,opacity .15s ease}.wi-account-row--btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .06))}.wi-account-row--btn:focus-visible{outline:2px solid var(--wi-primary, #00d5aa);outline-offset:2px}.wi-account-name{font-family:inherit;font-size: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}.wi-account-switch{display:inline-flex;align-items:center;justify-content:center;padding:2px 0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));border-radius:4px;flex-shrink:0;transition:color .15s ease,transform .2s ease}.wi-account-switch[data-open=true]{transform:rotate(180deg)}.wi-account-row--btn:hover .wi-account-switch{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-address-row-btn{display:inline-flex;align-items:center;gap:4px;padding:0;border:none;background:transparent;cursor:pointer;color:var(--ds-content-medium, rgba(0, 0, 0, .65));font:inherit;text-align:left;min-width:0;transition:color .15s ease}.wi-address-row-btn:hover .wi-account-address,.wi-address-row-btn:hover .wi-account-copy{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-account-address{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));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wi-account-copy{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:var(--wi-texticon-tertiary);flex-shrink:0;transition:color .15s ease}.wi-account-copy[data-copied=true]{color:var(--ds-system-green-high, #00a869)}.wi-header-actions{display:flex;align-items:center;gap:16px;flex-shrink:0;margin-top:-4px}.wi-header-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;border-radius:0;cursor:pointer;color:var(--ds-content-low, rgba(0, 0, 0, .4));flex-shrink:0;transition:color .15s ease}.wi-header-action:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header-action--qr{width:32px;height:32px;border-radius:8px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-medium, rgba(0, 0, 0, .65));transition:background-color .15s ease,color .15s ease}.wi-header-action--qr:hover{background:var(--ds-surface-high, rgba(0, 0, 0, .08));color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-header--receive{align-items:center;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-header--receive .wi-header-action,.wi-header--sub-account .wi-header-action{position:absolute;top:24px;right:24px}.wi-receive-title{position:absolute;left:50%;transform:translate(-50%);font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-highest, #000000);text-align:center;pointer-events:none}.wi-header-info{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}.wi-header-title{font-family:inherit;font-size:16px;font-weight:600;line-height:1.3;color:var(--wi-texticon-primary);margin:0}.wi-header-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;background:var(--wi-surface-default);border-radius:8px;cursor:pointer;color:var(--ds-content-low, #00000066);transition:opacity .15s ease}.wi-header-close:hover{opacity:.7}.wi-total-section{margin:24px 24px 0;padding:0;flex-shrink:0;display:flex;flex-direction:column;gap:8px;border:none;background:transparent;border-radius:12px;color:inherit;font:inherit;text-align:left;width:auto}.wi-action-row{display:flex;align-items:flex-start;gap:8px;width:auto;margin:24px 24px 0}.wi-action-card{appearance:none;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 8px;border:none;border-radius:12px;background:var(--ds-surface-medium, #f5f7fa);color:var(--ds-content-high, rgba(0, 0, 0, .85));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;text-align:center;cursor:pointer;transition:background-color .15s ease,color .15s ease}.wi-action-card:hover:not(:disabled){background:#2e3544!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}:root[data-ds-theme=light] .wi-action-card:hover:not(:disabled){background:#e4e8ef!important;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-action-card:disabled{cursor:default}.wi-action-card>svg{flex-shrink:0}.wi-action-card:not(:disabled){transition:background-color .15s ease,transform .1s ease}.wi-action-card:active:not(:disabled){transform:scale(.93)}.wi-total-head{display:flex;align-items:center;gap:4px}.wi-total-body{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.wi-total-label{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))}.wi-total-eye{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));cursor:pointer;transition:color .15s ease;border-radius:4px}.wi-total-eye:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-total-eye:focus-visible{outline:1px solid var(--wi-texticon-secondary);outline-offset:2px}.wi-total-value{display:flex;align-items:baseline;gap:0;font-family:inherit;font-weight:600;line-height:1.25;color:var(--ds-content-highest, #000000);font-variant-numeric:tabular-nums;min-height:45px;white-space:nowrap}.wi-total-currency,.wi-total-amount,.wi-total-decimal{font-size:36px;color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:22px;color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:32px;color:var(--wi-texticon-secondary)}.wi-total-skeleton{border-radius:6px}.wi-scrollable-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:8px 0 0;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;overscroll-behavior:contain}.wi-drawer-content .wi-scrollable-body{touch-action:pan-y}[data-theme=light] .wi-scrollable-body{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-scrollable-body::-webkit-scrollbar{width:4px}.wi-scrollable-body::-webkit-scrollbar-track{background:transparent}.wi-scrollable-body::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-scrollable-body::-webkit-scrollbar-thumb:hover{background:#0003}.wi-nav-fixed{flex-shrink:0;padding:0 24px}.wi-token-list{display:flex;flex-direction:column;gap:0;padding:8px 0}.wi-token-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 24px;border:none;background:transparent;text-align:left;font-family:inherit;width:100%;box-sizing:border-box}.wi-token-item--button{cursor:pointer;background:var(--ds-surface-default, #ffffff);transition:none}.wi-token-item--button:hover{background:#252b39!important}:root[data-ds-theme=light] .wi-token-item--button:hover{background:#eff3f8!important}button.wi-token-item:focus-visible{outline:2px solid var(--wi-primary);outline-offset:2px;border-radius:4px}.wi-token-left{display:flex;align-items:center;gap:16px;min-width:0}.wi-token-icon-wrap{position:relative;width:40px;height:40px;flex-shrink:0}.wi-token-icon{width:40px;height:40px;border-radius:0;object-fit:contain;opacity:0;transition:opacity .2s ease}.wi-token-icon[data-loaded=true]{opacity:1}.wi-token-chain-badge{position:absolute;right:0;bottom:0;width:14px;height:14px;border-radius:50%;background:var(--wi-surface-bg);box-shadow:0 0 0 1.5px var(--wi-surface-bg);object-fit:contain}.wi-token-info{display:flex;flex-direction:column;min-width:0}.wi-token-name-row{display:flex;align-items:center;gap:6px;min-width:0}.wi-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}.wi-token-apy{flex-shrink:0;font-family:inherit;font-size:12px;font-weight:600;line-height:1;color:var(--ds-system-purple-high, #9b78ff);background:var(--ds-system-purple-low, #2e2854);padding:4px;border-radius:6px;white-space:nowrap}.wi-token-price-row{display:flex;align-items:center;gap:8px}.wi-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}.wi-token-change{font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;white-space:nowrap}.wi-token-change[data-positive=true]{color:var(--ds-system-green-high, #00a0a2)}.wi-token-change[data-positive=false]{color:var(--ds-system-red-high, #a80927)}.wi-token-change[data-zero]{color:var(--ds-content-low, rgba(0, 0, 0, .4))}.wi-token-right{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.wi-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}.wi-token-value{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}.wi-sticky-footer{flex-shrink:0}.wi-footer{padding:16px 24px 24px}.wi-builtin-footer{display:flex;flex-direction:column;gap:8px;align-items:stretch}.wi-wallet-disconnect-row{display:flex;justify-content:flex-end;flex-shrink:0;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-send-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:2;display:flex;align-items:center;gap:12px;min-height:52px;padding:12px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);box-sizing:border-box;text-decoration:none}.wi-action-toast{position:absolute;left:15px;right:15px;bottom:20px;z-index:3;padding:12px 14px;border-radius:12px;background:var(--ds-surface-inverted, #1e232e);color:var(--ds-content-inverted, #ffffff);font-size:14px;line-height:1.4;text-align:center;box-sizing:border-box;animation:wi-action-toast-in .18s ease-out}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-action-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-action-toast{bottom:72px}@keyframes wi-action-toast-in{0%{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}.wi-action-card--dimmed{opacity:.4;cursor:pointer}.wi-action-card--dimmed:hover{opacity:.5}.wi-popover-content:has(.wi-wallet-disconnect-row) .wi-send-toast,.wi-drawer-content:has(.wi-wallet-disconnect-row) .wi-send-toast{bottom:72px}.wi-send-toast:hover{opacity:.92}.wi-send-toast-icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--ds-accent-primary-default, #00b4b7)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(0,232,201,.22);border-top-color:var(--ds-accent-primary-on-inverted, #00e8c9);border-radius:50%;animation:wi-send-toast-spin .8s linear infinite}.wi-send-toast-error-dot{width:18px;height:18px;border-radius:50%;background:var(--ds-system-red-default, #ff3358)}@keyframes wi-send-toast-spin{to{transform:rotate(360deg)}}.wi-send-toast-copy{display:flex;min-width:0;flex-direction:column}.wi-send-toast-title{font-family:inherit;font-size:14px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-inverted, #ffffff)}.wi-send-toast-desc{font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-accent-primary-on-inverted, #00e8c9)}.wi-send-toast-icon[data-status=error]+.wi-send-toast-copy .wi-send-toast-desc{color:var(--ds-system-red-default, #ff3358)}.wi-disconnect-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:16px;padding:0;border:none;background:transparent;color:var(--ds-content-low, rgba(0, 0, 0, .4));font-family:inherit;font-size:14px;font-weight:500;line-height:1.5;letter-spacing:-.01em;cursor:pointer;transition:color .15s ease}.wi-disconnect-btn:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-disconnect-label{white-space:nowrap}.wi-legal-links{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;flex-shrink:0;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))}.wi-receive-avatar .wi-avatar-fallback{position:absolute;inset:0;border-radius:50%;z-index:0}.wi-receive-avatar .wi-avatar-img{width:24px;height:24px}.wi-legal-link{color:var(--ds-content-low, rgba(0, 0, 0, .4));text-decoration:underline;text-underline-offset:2px;transition:color .15s ease}.wi-legal-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-legal-sep{color:inherit}.wi-empty{display:flex;align-items:center;justify-content:center;padding:32px 0;font-family:inherit;font-size:16px;color:var(--wi-texticon-secondary)}.wi-skeleton-item{display:flex;align-items:center;justify-content:space-between;padding:4px 0}.wi-skeleton-left{display:flex;align-items:center;gap:12px}.wi-skeleton-block{border-radius:6px;background:var(--wi-border-default);position:relative;overflow:hidden}.wi-skeleton-block:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 50%,transparent 100%);animation:wi-shimmer 1.5s ease-in-out infinite}[data-theme=light] .wi-skeleton-block:after{background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 50%,transparent 100%)}.wi-skeleton-icon{width:32px;height:32px;border-radius:50%;flex-shrink:0}.wi-skeleton-lines{display:flex;flex-direction:column;gap:6px}.wi-skeleton-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.wi-header-back{display:inline-flex;align-items:center;justify-content:center;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}.wi-header-back:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-view-container{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-popover-content[data-view=qr] .wi-view-container,.wi-drawer-content[data-view=qr] .wi-view-container{flex:1;min-height:0}.wi-view-inner{display:flex;flex-direction:column;flex:1;min-height:0}.wi-view-wallet{animation:wi-slide-in-left .25s ease-out}.wi-view-qr,.wi-view-portfolio{animation:wi-slide-in-right .25s ease-out}.wi-qr-body{flex:1;min-height:0;display:flex;flex-direction:column}.wi-portfolio-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.wi-portfolio-body>.wp-embed{flex:1;min-height:0}.wi-portfolio-body .wp-body-inner{padding:16px 16px 32px;gap:32px}.wi-receive-section{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px}.wi-receive-account{display:inline-flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border:0;background:var(--ds-surface-high, #edf1f2);border-radius:9999px;font-family:inherit;color:inherit}.wi-receive-account--btn{cursor:pointer;transition:none}.wi-receive-account--btn:hover{background:#2e3544}:root[data-ds-theme=light] .wi-receive-account--btn:hover{background:#e4e8ef}.wi-receive-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;overflow:hidden;flex-shrink:0}.wi-receive-account-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}.wi-receive-account>svg{color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0}.wi-receive-chevron{display:inline-flex;align-items:center;color:var(--ds-content-medium, rgba(0, 0, 0, .65));flex-shrink:0;transition:transform .2s ease}.wi-receive-chevron[data-open=true]{transform:rotate(180deg)}.wi-qr-block{display:flex;flex-direction:column;align-items:center;gap:16px}.wi-qr-box{position:relative;display:flex;align-items:center;justify-content:center;padding:10px;background:#fff;border-radius:6px;overflow:hidden}.wi-qr-logo{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none}.wi-qr-address{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:16px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;word-break:break-all;max-width:281px;margin:0}.wi-qr-copy-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:12px 16px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));background:var(--ds-surface-default, #ffffff);border-radius:12px;cursor:pointer;transition:border-color .15s ease}.wi-qr-copy-btn:hover{border-color:var(--ds-border-medium, rgba(0, 0, 0, .18))}.wi-qr-copy-icon{display:inline-flex;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wi-qr-copy-text{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));white-space:nowrap}.wi-receive-footer{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:16px 24px;border-top:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wi-drawer-content .wi-header{padding:16px}.wi-drawer-content .wi-header--receive .wi-header-action,.wi-drawer-content .wi-header--sub-account .wi-header-action{top:16px;right:16px}.wi-drawer-content .wi-total-section,.wi-drawer-content .wi-action-row{margin:16px 16px 0}.wi-drawer-content .wi-nav-fixed{padding:0 16px}.wi-drawer-content .wi-token-item{padding:12px 16px}.wi-drawer-content .wi-wallet-disconnect-row{padding:16px}
14
+ `);Q(`.wi-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
15
+ `);import{jsx as oi}from"react/jsx-runtime";function Cf({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:i=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:c=!0,showBridge:l=!0,qrLogoSrc:d,walletAddress:m,accountName:w,sendAccounts:b,profileImageUrl:x,connectorId:u,connectorName:h,connectorIconUrl:y,preferredTokens:C=[],onSelectWallet:f,onCopyAddress:N,onBuy:S,onBuyDisabledMessage:T,onBridgeDisabledMessage:R,onSendDisabledMessage:U,onDisconnect:D,disconnectLabel:z="Disconnect",termsUrl:F=An,termsLabel:oe="Terms of Service",privacyUrl:L=bo,privacyLabel:Z="Privacy Policy",open:G,onOpenChange:K,showPortfolio:ie=!1,portfolioTitle:me="My Portfolio",portfolioSections:$,showTotalAssets:se=!0,totalAssetsLabel:de="Total Assets USD",sendTransaction:j,getTransactionReceipt:Le,estimateGas:B,onOutlink:J,lpBalanceReader:V,stakingRewardsReader:re,bridgeTokens:fe,bridgeHistory:ct,getBridgeQuote:vt,getBridgeToTokens:Ye,getBridgeApproval:Kt,approveBridge:Ee,submitBridge:ve,onReceive:dt,onBridge:Ae,onSend:_e,style:ye,children:Ft}){let yt=je(e),Bt=u?go[u]:void 0,et=h??Bt?.name,_t=y??Bt?.iconUrl,tt=Nn(`(max-width: ${n}px)`),ke=o??(i?"right":"bottom"),nt=ke==="left"||ke==="right",pt=r??!1,ze=G!==void 0,[kt,we]=Qe.useState(!1),Te=ze?G:kt,Mt=Qe.useCallback(Yt=>{ze||we(Yt),K?.(Yt)},[ze,K]),St=Qe.useCallback(()=>Mt(!1),[Mt]),[Ge,ft]=Qe.useState(null),[Rt,Ne]=Qe.useState("top"),[Pe,E]=Qe.useState(null),[ee,ge]=Qe.useState("wallet"),[ot,Qt]=Qe.useState(null);Qe.useEffect(()=>{Te||(ge("wallet"),Qt(null))},[Te]);let rt=Qe.useCallback(()=>{Nr(m),D?.()},[D,m]),Sn=Qe.useMemo(()=>({env:yt,theme:t,isMobile:tt,open:Te,drawerDirection:ke,modal:pt,showBalance:i,showForgeToken:a,showGameToken:s,showQR:c,showBridge:l,qrLogoSrc:d,walletAddress:m,accountName:w,sendAccounts:b,profileImageUrl:x,connectorName:et,connectorIconUrl:_t,preferredTokens:C,close:St,onSelectWallet:f,onCopyAddress:N,onBuy:S,onBuyDisabledMessage:T,onBridgeDisabledMessage:R,onSendDisabledMessage:U,onDisconnect:D?rt:void 0,disconnectLabel:z,termsUrl:F,termsLabel:oe,privacyUrl:L,privacyLabel:Z,portalStyle:ye,navContent:Ge,navPosition:Rt,setNavContent:ft,setNavPosition:Ne,footerContent:Pe,setFooterContent:E,view:ee,setView:ge,selectedSendToken:ot,setSelectedSendToken:Qt,showPortfolio:ie,portfolioTitle:me,portfolioSections:$,showTotalAssets:se,totalAssetsLabel:de,sendTransaction:j,getTransactionReceipt:Le,estimateGas:B,onOutlink:J,lpBalanceReader:V,stakingRewardsReader:re,bridgeTokens:fe,bridgeHistory:ct,getBridgeQuote:vt,getBridgeToTokens:Ye,getBridgeApproval:Kt,approveBridge:Ee,submitBridge:ve,onReceive:dt,onBridge:Ae,onSend:_e}),[yt,t,tt,Te,ke,pt,i,a,s,c,l,d,m,w,b,x,et,_t,C,St,f,N,S,T,R,U,D,rt,z,F,oe,L,Z,ye,Ge,Rt,Pe,ee,ot,ie,me,$,se,de,j,Le,B,J,V,re,fe,ct,vt,Ye,Kt,Ee,ve,dt,Ae,_e]);return oi(yr.Provider,{value:Sn,children:tt?oi(Rf.Root,{direction:ke,open:Te,onOpenChange:Mt,handleOnly:nt,noBodyStyles:!0,repositionInputs:!1,children:Ft},"drawer"):oi(pl.Root,{open:Te,onOpenChange:Mt,children:Ft},"popover")})}var Dn=Object.assign(Cf,{Trigger:La,Content:al,Nav:ll,Footer:dl});import*as qt from"react";import*as Il from"@radix-ui/react-dialog";import{Drawer as Ff}from"vaul";import{createContext as Tf,useContext as Nf}from"react";var Jo=Tf(null);function eo(){let e=Nf(Jo);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as fl,useEffect as If,useCallback as Lf}from"react";function er(){let[e,t]=fl([]),[n,o]=fl(!0);If(()=>{if(typeof window>"u"){o(!1);return}let i=[],a=c=>{let{info:l}=c.detail;l?.rdns&&!i.some(d=>d.rdns===l.rdns)&&(i.push({rdns:l.rdns,name:l.name,icon:l.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let r=Lf(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:n}}import*as ml from"@radix-ui/react-dialog";import{Drawer as Ef}from"vaul";import{jsx as ul}from"react/jsx-runtime";function gl({asChild:e,children:t}){let{isMobile:n}=eo(),o=n?Ef.Trigger:ml.Trigger;return ul(o,{asChild:e??t!=null,children:t??ul("button",{type:"button",children:"Connect Wallet"})})}import*as Vt from"@radix-ui/react-dialog";import{Drawer as nr}from"vaul";import{jsx as X,jsxs as fn}from"react/jsx-runtime";function tr(){return fn("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[X("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),X("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function hl(){return fn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[fn("g",{clipPath:"url(#clip0_1331_27065)",children:[X("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),X("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),X("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),X("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),X("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),X("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),X("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),X("defs",{children:X("clipPath",{id:"clip0_1331_27065",children:X("rect",{width:"40",height:"40",fill:"white"})})})]})}function bl(){return fn("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[X("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),X("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),X("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),X("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),X("path",{d:"M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z",fill:"#F3BA2F"})]})}function wl(){return fn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[X("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),X("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),X("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),X("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function xl(){return fn("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[fn("g",{clipPath:"url(#clip0_1185_7785)",children:[X("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),X("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),X("defs",{children:X("clipPath",{id:"clip0_1185_7785",children:X("rect",{width:"28",height:"28",fill:"white"})})})]})}function vl(){return fn("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[X("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"}),X("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),X("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"}),X("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"})]})}function yl(){return X("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:X("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function kl(){return X("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:X("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var ri={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:tr},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:tr,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:tr,rdns:"nexus.to.crosswallet.desktop",installUrl:"https://chromewebstore.google.com/detail/crossx/nninbdadmocnokibpaaohnoepbnpdgcg",visibility:"desktop-only"},metamask:{id:"metamask",name:"MetaMask",description:"Browser extension approval is required",icon:hl,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:bl},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:wl,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:xl,badge:"For SHOP"}};function ii(e){return ri[e]}var ai={google:{id:"google",name:"Google",icon:vl},apple:{id:"apple",name:"Apple",icon:yl}};function Sl(e){return ai[e]}import{Fragment as Tl,jsx as Y,jsxs as De}from"react/jsx-runtime";function Af({wallet:e,detected:t,onConnect:n}){let o=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}n()},r=e.icon,i=e.featured===!0;return De("button",{type:"button",className:le("wcm-wallet-item",i&&"wcm-wallet-item--featured"),onClick:o,children:[De("div",{className:"wcm-wallet-item-left",children:[Y("div",{className:"wcm-wallet-icon",children:Y(r,{})}),De("div",{className:"wcm-wallet-name-row",children:[Y("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&Y("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?Y("span",{className:"wcm-installed-label",children:"Installed"}):Y("span",{className:"wcm-install-btn",children:"Install"}))]})}function Pf({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return De("button",{type:"button",className:"wcm-social-item","data-provider":e.id,onClick:t,"aria-label":o,children:[Y("span",{className:"wcm-social-icon",children:Y(n,{})}),Y("span",{className:"wcm-social-name",children:o})]})}function Rl(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:i,isDetected:a,close:s,isMobile:c}=eo(),l=t.filter(w=>{let b=ii(w).visibility;return!b||b==="always"?!0:b==="desktop-only"?!c:b==="mobile-only"?c:!0}),d=o.length>0,m=l.length>0;return De(Tl,{children:[De("div",{className:"wcm-header",children:[De("div",{className:"wcm-header-text",children:[Y("h2",{className:"wcm-title",children:"CROSS Wallet"}),!c&&Y("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),Y("button",{type:"button",className:"wcm-close-btn",onClick:s,"aria-label":"Close",children:Y(kl,{})})]}),De("div",{className:"wcm-body",children:[d&&De(Tl,{children:[!c&&De("div",{className:"wcm-section-header",children:[Y("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),Y("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),Y("div",{className:"wcm-social-grid",children:o.map(w=>{let b=Sl(w);return Y(Pf,{social:b,onSignIn:()=>{n[w]?.(),s()}},w)})}),m&&De("div",{className:"wcm-separator",children:[Y("div",{className:"wcm-separator-line"}),Y("span",{className:"wcm-separator-text",children:"Other Wallets"}),Y("div",{className:"wcm-separator-line"})]})]}),m&&Y("div",{className:"wcm-wallet-list",children:l.map(w=>{let b=ii(w),x=b.rdns?a(b.rdns):!1;return Y(Af,{wallet:b,detected:x,onConnect:()=>{e[w]?.(),s()}},w)})}),De("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",Y(Cl,{href:r,children:"Terms of Service"})," and consent to its ",Y(Cl,{href:i,children:"Privacy Policy"}),"."]})]})]})}function Cl({href:e,children:t}){return e?Y("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):Y("span",{className:"wcm-terms-link",children:t})}function Nl({className:e}){let{isMobile:t,theme:n,portalStyle:o}=eo();return t?De(nr.Portal,{children:[Y(nr.Overlay,{className:"wcm-overlay"}),De(nr.Content,{className:le("wcm-drawer-content",e),"data-theme":n,style:o,children:[Y(nr.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),Y("div",{className:"wcm-drawer-handle"}),Y("div",{className:"wcm-drawer-body",children:Y(Rl,{})})]})]}):De(Vt.Portal,{children:[Y(Vt.Overlay,{className:"wcm-overlay"}),De(Vt.Content,{className:le("wcm-dialog-content",e),"data-theme":n,style:o,children:[Y(Vt.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),Y(Vt.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),Y("div",{className:"wcm-dialog-body",children:Y(Rl,{})})]})]})}Q(`.wcm-overlay{position:fixed;inset:0;z-index:100000;background:var(--ds-overlay-dim, rgba(0, 0, 0, .5));-webkit-backdrop-filter:var(--ds-bg-blur-7, blur(3.5px));backdrop-filter:var(--ds-bg-blur-7, blur(3.5px))}.wcm-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--wcm-dialog-width, 480px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-radius:24px;box-shadow:var(--ds-shadow-modal, 0 4px 30px -1px rgba(0, 0, 0, .15));outline:none;animation:wcm-dialog-show .2s ease-out;font-family:inherit}.wcm-dialog-content[data-state=closed]{animation:wcm-dialog-hide .15s ease-in}.wcm-dialog-body,.wcm-drawer-body{scrollbar-width:thin;scrollbar-color:var(--ds-border-medium, rgba(0, 0, 0, .18)) transparent}.wcm-dialog-body::-webkit-scrollbar,.wcm-drawer-body::-webkit-scrollbar{width:4px}.wcm-dialog-body::-webkit-scrollbar-track,.wcm-drawer-body::-webkit-scrollbar-track{background:transparent}.wcm-dialog-body::-webkit-scrollbar-thumb,.wcm-drawer-body::-webkit-scrollbar-thumb{background:var(--ds-border-medium, rgba(0, 0, 0, .18));border-radius:4px}.wcm-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--wcm-drawer-max-width, none);min-width:var(--wcm-drawer-min-width, 0);max-height:85dvh;margin:0 auto;display:flex;flex-direction:column;background:var(--ds-surface-default, #ffffff);border:1px solid var(--ds-border-default, #00000012);border-top-left-radius:16px;border-top-right-radius:16px;outline:none;font-family:inherit;box-sizing:border-box}.wcm-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.wcm-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--wcm-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.wcm-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.wcm-drawer-handle{width:60px;height:4px;border-radius:999px;background:var(--ds-border-medium, rgba(0, 0, 0, .18));margin:12px auto 8px;flex-shrink:0}.wcm-drawer-content[data-vaul-drawer-direction=left] .wcm-drawer-handle,.wcm-drawer-content[data-vaul-drawer-direction=right] .wcm-drawer-handle{display:none}.wcm-dialog-body,.wcm-drawer-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.wcm-drawer-body{overscroll-behavior:contain}.wcm-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px;border-bottom:1px solid var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-header-text{display:flex;flex-direction:column;gap:4px;min-width:0}.wcm-title{font-family:Inter,sans-serif;font-weight:600;font-size:20px;line-height:1.25;letter-spacing:0;color:var(--ds-content-highest, #000000);margin:0}.wcm-subtitle{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));margin:0}.wcm-close-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border:none;background:transparent;color:var(--ds-content-low, #00000066);cursor:pointer;padding:0;transition:opacity .15s ease}.wcm-close-btn:hover{opacity:.6}.wcm-close-btn>svg{width:24px;height:24px}.wcm-divider{display:none}.wcm-body{display:flex;flex-direction:column;gap:16px;padding:24px}.wcm-section-header{display:flex;align-items:center;gap:8px;width:100%}.wcm-section-title{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1;letter-spacing:0;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-recommended-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-low, #e7f9f8);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-high, #00a0a2);white-space:nowrap}.wcm-social-grid{display:grid;gap:8px;width:100%}.wcm-dialog-body .wcm-social-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wcm-drawer-body .wcm-social-grid{grid-template-columns:1fr}.wcm-social-item{display:flex;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;transition:none;font-family:inherit;color:var(--ds-content-high, rgba(0, 0, 0, .85))}.wcm-social-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-social-item:hover{background:#eff3f8!important}.wcm-social-item[data-provider=apple] .wcm-social-icon{color:#000}[data-theme=dark] .wcm-social-item[data-provider=apple] .wcm-social-icon{color:#fff}.wcm-dialog-body .wcm-social-item{flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px}.wcm-drawer-body .wcm-social-item{flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:16px}.wcm-social-icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}.wcm-social-icon>svg{width:32px;height:32px}.wcm-social-name{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-separator{display:flex;align-items:center;gap:12px;width:100%}.wcm-separator-line{flex:1;height:1px;background:var(--ds-border-default, rgba(0, 0, 0, .07))}.wcm-separator-text{font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-wallet-list{display:flex;flex-direction:column;gap:8px}.wcm-wallet-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:20px 16px;background:var(--ds-surface-medium, #f5f7fa);border:none;border-radius:12px;cursor:pointer;text-align:left;transition:none;font-family:inherit}.wcm-wallet-item:hover{background:#2e3544!important}:root[data-ds-theme=light] .wcm-wallet-item:hover{background:#eff3f8!important}.wcm-wallet-item-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.wcm-wallet-icon{flex-shrink:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center}.wcm-wallet-icon>svg,.wcm-wallet-icon>img{width:28px;height:28px;border-radius:0;object-fit:cover}.wcm-wallet-name-row{display:flex;align-items:center;gap:8px;min-width:0}.wcm-wallet-name{font-family:Inter,sans-serif;font-weight:600;font-size:16px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-high, rgba(0, 0, 0, .85));white-space:nowrap}.wcm-wallet-badge{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-system-purple-low, #f5f3ff);border:.5px solid var(--ds-system-purple-default, #7e54f4);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-purple-high, #7346f3);white-space:nowrap}.wcm-install-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;background:var(--ds-accent-primary-default, #00b4b7);border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-accent-primary-on, #ffffff);white-space:nowrap}.wcm-installed-label{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-content-low, rgba(0, 0, 0, .4));white-space:nowrap}.wcm-terms{font-family:Inter,sans-serif;font-weight:400;font-size:12px;line-height:1.5;letter-spacing:-.01em;color:var(--ds-content-medium, rgba(0, 0, 0, .65));text-align:center;margin:0}.wcm-terms-link{color:var(--ds-accent-primary-high, #00a0a2);text-decoration:none}.wcm-terms-link:hover{text-decoration:underline}.wcm-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
16
+ `);Q(`@keyframes wcm-overlay-show{0%{opacity:0}to{opacity:1}}@keyframes wcm-overlay-hide{0%{opacity:1}to{opacity:0}}@keyframes wcm-dialog-show{0%{opacity:0;transform:translate(-50%,-48%) scale(.96)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes wcm-dialog-hide{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
17
+ `);import{jsx as to}from"react/jsx-runtime";var Bf={};function _f({wallets:e,socialProviders:t=Bf,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:i=768,drawerDirection:a="bottom",dialogWidth:s,drawerMaxWidth:c,drawerMinWidth:l,style:d,open:m,onOpenChange:w,children:b}){let x=Nn(`(max-width: ${i}px)`),[u,h]=qt.useState(!1),y=m!==void 0,C=y?m:u,f=qt.useCallback(F=>{y||h(F),w?.(F)},[y,w]),N=qt.useCallback(()=>f(!1),[f]),{isDetected:S}=er(),T=qt.useMemo(()=>Object.keys(e),[e]),R=qt.useMemo(()=>Object.keys(t),[t]),U=qt.useMemo(()=>{let F={};return s&&(F["--wcm-dialog-width"]=s),c&&(F["--wcm-drawer-max-width"]=c),l&&(F["--wcm-drawer-min-width"]=l),{...F,...d}},[s,c,l,d]),D=qt.useMemo(()=>({theme:r,isMobile:x,open:C,setOpen:f,close:N,wallets:e,activeWalletIds:T,socialProviders:t,activeSocialIds:R,termsUrl:n??An,privacyUrl:o??bo,isDetected:S,portalStyle:U}),[r,x,C,f,N,e,T,t,R,n,o,S,U]),z=to("div",{"data-theme":r,style:U,children:b});return x?to(Jo.Provider,{value:D,children:to(Ff.Root,{direction:a,open:C,onOpenChange:f,noBodyStyles:!0,children:z},"drawer")}):to(Jo.Provider,{value:D,children:to(Il.Root,{open:C,onOpenChange:f,children:z})})}var Ll=Object.assign(_f,{Trigger:gl,Content:Nl});Q(`.cb-button{--cb-bg: var(--ds-accent-primary-default, #00b4b7);--cb-bg-hover: var(--cb-bg);--cb-color: var(--ds-accent-primary-on-primary, #ffffff);--cb-border: none;--cb-radius: 8px;--cb-height: 36px;--cb-padding: 8px 16px;--cb-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-font-size: 14px;--cb-font-weight: 500;--cb-line-height: 1.5;--cb-letter-spacing: -.01em;--cb-gap: 8px;--cb-transition: opacity .15s;--cb-loading-opacity: .7;--cb-press-scale: .95;--cb-icon-size: 18px;--cb-spinner-size: 18px;--cb-spinner-thumb: currentColor;--cb-spinner-track: color-mix(in srgb, currentColor 20%, transparent)}.cb-pill{--cb-pill-bg: var(--ds-surface-default, #ffffff);--cb-pill-bg-hover: var(--cb-pill-bg);--cb-pill-color: var(--ds-content-high, rgba(0, 0, 0, .85));--cb-pill-border: 1px solid var(--ds-border-default, rgba(0, 0, 0, .07));--cb-pill-border-hover: 1px solid var(--ds-border-medium, rgba(0, 0, 0, .18));--cb-pill-radius: 8px;--cb-pill-height: 36px;--cb-pill-padding: 1px 13px;--cb-pill-press-scale: .95;--cb-pill-font-family: Inter, system-ui, -apple-system, sans-serif;--cb-pill-font-size: 14px;--cb-pill-font-weight: 500;--cb-pill-line-height: 1.5;--cb-pill-gap: 8px;--cb-pill-icon-size: 18px;--cb-pill-icon-placeholder-bg: var(--ds-surface-medium, #f5f7fa);--cb-pill-address-font: Inter, system-ui, -apple-system, sans-serif;--cb-pill-address-font-size: 14px;--cb-pill-address-letter-spacing: -.01em}
18
+ `);Q(`.cb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-height);gap:var(--cb-gap);padding:var(--cb-padding);border-radius:var(--cb-radius);border:var(--cb-border);background:var(--cb-bg);color:var(--cb-color);font-family:var(--cb-font-family);font-size:var(--cb-font-size);font-weight:var(--cb-font-weight);line-height:var(--cb-line-height);letter-spacing:var(--cb-letter-spacing);cursor:pointer;transition:var(--cb-transition)}.cb-button:hover:not(:disabled){background:var(--cb-bg-hover)}.cb-button:active:not(:disabled){transform:scale(var(--cb-press-scale))}.cb-button:disabled,.cb-button[aria-busy=true]{cursor:default;opacity:var(--cb-loading-opacity)}.cb-spinner{display:inline-block;width:var(--cb-spinner-size);height:var(--cb-spinner-size);border:2px solid var(--cb-spinner-track);border-top-color:var(--cb-spinner-thumb);border-radius:50%;animation:cb-spin .6s linear infinite;flex-shrink:0}.cb-button-icon{width:var(--cb-icon-size);height:var(--cb-icon-size);flex-shrink:0}.cb-button-label{white-space:nowrap}.cb-pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--cb-pill-height);gap:var(--cb-pill-gap);padding:var(--cb-pill-padding);border-radius:var(--cb-pill-radius);border:var(--cb-pill-border);background:var(--cb-pill-bg);color:var(--cb-pill-color);font-family:var(--cb-pill-font-family);font-size:var(--cb-pill-font-size);font-weight:var(--cb-pill-font-weight);line-height:var(--cb-pill-line-height);cursor:pointer}.cb-pill:hover{background:var(--cb-pill-bg-hover)}.cb-pill:active:not(:disabled){transform:scale(var(--cb-pill-press-scale))}.cb-pill-icon{width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;object-fit:contain;flex-shrink:0;background:transparent}[data-theme=dark] .cb-pill-icon[data-provider=apple]{filter:invert(1)}.cb-pill-icon-placeholder{display:inline-block;width:var(--cb-pill-icon-size);height:var(--cb-pill-icon-size);border-radius:50%;background:var(--cb-pill-icon-placeholder-bg);flex-shrink:0}.cb-pill-address{font-family:var(--cb-pill-address-font);font-size:var(--cb-pill-address-font-size);letter-spacing:var(--cb-pill-address-letter-spacing);white-space:nowrap}@media(max-width:767.98px){.cb-button,.cb-pill{width:36px;min-width:36px;padding:0}.cb-button{height:36px}.cb-button-label,.cb-pill-address{display:none}}@keyframes cb-spin{to{transform:rotate(360deg)}}
19
+ `);var Mf='<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#c0)"><path d="M18 36C27.9411 36 36 27.9411 36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36Z" fill="#00D5AA"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.2903 2.57169L21.3525 5.63385V10.6471L25.3058 6.69381L29.6364 11.0244L25.7226 14.9381H18.2903C16.5992 14.9381 15.2283 16.309 15.2283 18.0003C15.2283 19.6915 16.5992 21.0624 18.2903 21.0624H25.6836L29.6365 25.0154L25.3059 29.3459L21.3525 25.3925V30.3666L18.2903 33.4288L15.2283 30.3666V25.4326L11.3148 29.3459L6.98426 25.0154L10.9372 21.0624H5.92394L2.86178 18.0003L5.92394 14.9381H10.8981L6.98437 11.0244L11.3149 6.69383L15.2283 10.6071V5.63385L18.2903 2.57169Z" fill="#000"/></g><defs><clipPath id="c0"><rect width="36" height="36" fill="#fff"/></clipPath></defs></svg>',Of='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 28 28" fill="none"><g clip-path="url(#m0)"><path d="M26.07 26.93L20.06 25.07L15.53 27.88L12.37 27.88L7.83 25.07L1.83 26.93L0 20.53L1.83 13.44L0 7.44L1.83 0L11.21 5.81H16.69L26.07 0L27.9 7.44L26.07 13.44L27.9 20.53Z" fill="#FF5C16"/><path d="M7.83 20.54L11.96 23.8L7.83 25.07V20.54Z" fill="#FF5C16"/><path d="M20.06 20.54L15.93 23.8L20.06 25.07L20.06 20.54Z" fill="#FF5C16"/><path d="M11.63 15.14L12.78 22.85L11.19 18.56L5.77 17.17L7.83 15.14H11.63Z" fill="#E34807"/><path d="M16.27 15.14L15.12 22.85L16.71 18.56L22.13 17.17L20.07 15.14H16.27Z" fill="#E34807"/><path d="M0 20.53L1.83 13.44H5.76L5.77 17.17L11.19 18.56L12.78 22.85L11.96 23.79L7.83 20.53H0Z" fill="#FF8D5D"/><path d="M27.9 20.53L26.07 13.44H22.14L22.13 17.17L16.71 18.56L15.12 22.85L15.94 23.79L20.07 20.53H27.9Z" fill="#FF8D5D"/><path d="M16.69 5.81H11.21L10.84 9.81L12.78 22.85H15.12L17.06 9.81L16.69 5.81Z" fill="#FF8D5D"/><path d="M15.53 25.34V27.88H12.37V25.34H15.53Z" fill="#C0C4CD"/><path d="M7.83 25.07L12.37 27.88V25.34L11.96 23.79L7.83 25.07Z" fill="#E7EBF6"/><path d="M20.07 25.07L15.53 27.88V25.34L15.94 23.79L20.07 25.07Z" fill="#E7EBF6"/></g><defs><clipPath id="m0"><rect width="28" height="28" fill="#fff"/></clipPath></defs></svg>',Wf='<svg width="100%" height="100%" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z" fill="#F3BA2F"/><path d="M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z" fill="#F3BA2F"/><path d="M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z" fill="#F3BA2F"/><path d="M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z" fill="#F3BA2F"/><path d="M24.58 20L20 15.41L16.61 18.8L16.22 19.19L15.42 19.99L20 24.59L24.59 20L24.58 20Z" fill="#F3BA2F"/></svg>',Df='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3A12 12 0 1 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.4-.4-3.5z"/><path fill="#FF3D00" d="M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.2 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"/><path fill="#4CAF50" d="M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28l-6.5 5A20 20 0 0 0 24 44z"/><path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.3 5.3C41 35.7 44 30.3 44 24c0-1.2-.1-2.4-.4-3.5z"/></svg>',zf='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.53 4.08zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>';function no(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var or=no(Mf),rr=no(Of),ir=no(Wf),ar=no(Df),sr=no(zf);import{jsx as xt,jsxs as oo}from"react/jsx-runtime";function Al({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:i,onConnect:a,onDisconnect:s,onCopy:c,onSelectWallet:l,onBuy:d,onBuyDisabledMessage:m,label:w="Connect Wallet",connectingLabel:b="Connecting...",disconnectLabel:x,className:u,theme:h="dark",env:y,showBalance:C=!0,showPortfolio:f,drawerDirection:N,modal:S,connectorId:T,style:R,walletInfoStyle:U,sendTransaction:D,getTransactionReceipt:z,estimateGas:F,onReceive:oe,onBridge:L,onSend:Z,bridgeTokens:G,bridgeHistory:K,getBridgeQuote:ie,getBridgeToTokens:me,getBridgeApproval:$,approveBridge:se,submitBridge:de}){let j=u?`cb-button ${u}`:"cb-button",Le=u?`cb-pill ${u}`:"cb-pill";if(e)return oo("button",{type:"button",disabled:!0,className:j,style:R,"aria-busy":"true",children:[xt("span",{className:"cb-spinner","aria-hidden":"true"}),xt("span",{className:"cb-button-label",children:b})]});if(t){let B=o??$f(n),J=n?Hf[n]:void 0;return oo(Dn,{env:y,theme:h,drawerDirection:N,modal:S,showBalance:C,showPortfolio:f,walletAddress:t,accountName:r,sendAccounts:i,connectorId:T,onSelectWallet:l,onCopyAddress:c?(V,re)=>{re&&c()}:void 0,onDisconnect:s,disconnectLabel:x,style:U,sendTransaction:D,getTransactionReceipt:z,estimateGas:F,onReceive:oe,onBridge:L,onBuy:d,onBuyDisabledMessage:m,onSend:Z,bridgeTokens:G,bridgeHistory:K,getBridgeQuote:ie,getBridgeToTokens:me,getBridgeApproval:$,approveBridge:se,submitBridge:de,children:[xt(Dn.Trigger,{asChild:!0,children:oo("button",{type:"button",className:Le,style:R,"aria-label":`Connected with ${B}: ${El(t)}`,children:[J?xt("img",{src:J,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):xt("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),xt("span",{className:"cb-pill-address",children:El(t)})]})}),xt(Dn.Content,{align:"end",sideOffset:8})]})}return oo("button",{type:"button",onClick:a,className:j,style:R,"aria-label":typeof w=="string"?w:"Connect Wallet",children:[xt(Gf,{}),xt("span",{className:"cb-button-label",children:w})]})}function Gf(){return oo("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[xt("path",{d:"M3.75 5.25H14.25C15.0784 5.25 15.75 5.92157 15.75 6.75V13.5C15.75 14.3284 15.0784 15 14.25 15H3.75C2.92157 15 2.25 14.3284 2.25 13.5V4.5C2.25 3.67157 2.92157 3 3.75 3H13.5",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),xt("path",{d:"M12 9.75H15.75V12.75H12C11.1716 12.75 10.5 12.0784 10.5 11.25C10.5 10.4216 11.1716 9.75 12 9.75Z",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),xt("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var Hf={google:ar,apple:sr,cross:or,metamask:rr,binance:ir},Uf={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function $f(e){return e?Uf[e]:"Wallet"}function El(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}import*as Pl from"react";Q(`.sb-button{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-border-hover: var(--ds-border-default, rgba(0, 0, 0, .07));--sb-color: var(--ds-content-medium, rgba(0, 0, 0, .65));--sb-color-hover: var(--ds-content-high, rgba(0, 0, 0, .85));--sb-radius: 8px;--sb-height: 36px;--sb-padding: 1px 11px;--sb-gap: 4px;--sb-font-size: 14px;--sb-font-weight: 500;--sb-line-height: 21px;--sb-letter-spacing: 0;--sb-blur: 0px;--sb-border-width: 1px;--sb-icon-size: 18px;--sb-icon-hover-rotation: 180deg;--sb-spinner-size: 18px;--sb-spinner-thumb: currentColor;--sb-spinner-track: color-mix(in srgb, currentColor 20%, transparent);--sb-disabled-opacity: .6;--sb-press-scale: .95;--sb-hover-duration: .2s;--sb-icon-duration: .3s;--sb-easing: ease}.sb-button[data-theme=dark]{--sb-bg: var(--ds-surface-default, #1e232e);--sb-border: var(--ds-border-default, #ffffff12);--sb-border-hover: var(--ds-border-medium, #ffffff2e);--sb-color: var(--ds-content-medium, #ffffffa6);--sb-color-hover: var(--ds-content-high, #ffffffd9)}.sb-button[data-theme=light]{--sb-bg: var(--ds-surface-default, #ffffff);--sb-border: var(--ds-border-default, #00000012);--sb-border-hover: var(--ds-border-medium, #0000002e);--sb-color: var(--ds-content-medium, #000000a6);--sb-color-hover: var(--ds-content-high, #000000d9)}
20
+ `);Q(`.sb-button{-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--sb-height);gap:var(--sb-gap);padding:var(--sb-padding);border-radius:var(--sb-radius);border:var(--sb-border-width) solid var(--sb-border);background:var(--sb-bg);backdrop-filter:blur(var(--sb-blur));-webkit-backdrop-filter:blur(var(--sb-blur));color:var(--sb-color);font-family:Inter,system-ui,-apple-system,sans-serif;font-weight:var(--sb-font-weight);font-size:var(--sb-font-size);line-height:var(--sb-line-height);letter-spacing:var(--sb-letter-spacing);cursor:pointer;transition:border-color var(--sb-hover-duration) var(--sb-easing),color var(--sb-hover-duration) var(--sb-easing)}@media(hover:hover){.sb-button:hover:not(:disabled){border-color:var(--sb-border-hover);color:var(--sb-color-hover)}.sb-button:hover:not(:disabled) .sb-button-icon{transform:rotate(var(--sb-icon-hover-rotation))}}.sb-button:active:not(:disabled){transform:scale(var(--sb-press-scale))}.sb-button:disabled,.sb-button[aria-busy=true]{cursor:default;opacity:var(--sb-disabled-opacity)}.sb-button-icon{width:var(--sb-icon-size);height:var(--sb-icon-size);flex-shrink:0;color:inherit;transition:transform var(--sb-icon-duration) var(--sb-easing),color var(--sb-icon-duration) var(--sb-easing)}.sb-spinner{display:inline-block;width:var(--sb-spinner-size);height:var(--sb-spinner-size);border:2px solid var(--sb-spinner-track);border-top-color:var(--sb-spinner-thumb);border-radius:50%;animation:sb-spin .6s linear infinite;flex-shrink:0}.sb-label{white-space:nowrap}@keyframes sb-spin{to{transform:rotate(360deg)}}
21
+ `);import{jsx as ro,jsxs as Vf}from"react/jsx-runtime";var si="https://www.onechain.nexus/skills";function Fl({label:e="Skills",href:t=si,onClick:n,className:o,style:r,theme:i,disabled:a=!1,isLoading:s=!1,loadingLabel:c="Loading...",openInNewTab:l=!1,type:d="button"}){let[m,w]=Pl.useState(!1),b=async C=>{if(t&&!n){l?window.open(t,"_blank","noopener,noreferrer"):window.location.href=t;return}if(n)try{w(!0),await n()}finally{w(!1)}},x=a||s||m,u=s||m,h=u?c:e,y=o?`sb-button ${o}`:"sb-button";return Vf("button",{type:d,onClick:b,disabled:x,className:y,"data-theme":i,style:r,"aria-busy":u,children:[u?ro("span",{className:"sb-spinner","aria-hidden":"true"}):ro(jf,{}),ro("span",{className:"sb-label",children:h})]})}function jf(){return ro("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:ro("path",{d:"M15.5879 3.95142C16.0211 2.78097 17.6761 2.78099 18.1094 3.95142L19.6221 8.03833C20.6569 10.8348 22.8618 13.0396 25.6582 14.0745L29.7451 15.5872C30.9157 16.0204 30.9157 17.6754 29.7451 18.1086L25.6582 19.6213C22.8618 20.6562 20.657 22.861 19.6221 25.6575L18.1094 29.7444C17.6762 30.9149 16.0211 30.9149 15.5879 29.7444L14.0752 25.6575C13.0403 22.861 10.8355 20.6562 8.03906 19.6213L3.95215 18.1086C2.78172 17.6754 2.7817 16.0204 3.95215 15.5872L8.03906 14.0745C10.8355 13.0396 13.0403 10.8348 14.0752 8.03833L15.5879 3.95142Z",stroke:"currentColor",strokeWidth:"1.93556"})})}br({mode:"dapp-ui"});export{sr as APPLE_ICON,Ci as AppLauncher,Oi as AppLauncherContent,Ei as AppLauncherTrigger,ir as BINANCE_ICON,Qo as BridgeFlow,go as CONNECTOR_REGISTRY,or as CROSSX_ICON,Al as ConnectButton,kr as ConnectorId,si as DEFAULT_SKILLS_HREF,ar as GOOGLE_ICON,rr as METAMASK_ICON,Uo as PORTFOLIO_SECTIONS,ai as SOCIAL_REGISTRY,Eo as SendFlow,Fl as SkillsButton,Mr as TOKEN_STATS_QUERY_KEY,_r as USER_BALANCE_QUERY_KEY,ri as WALLET_REGISTRY,Ll as WalletConnectModal,Dn as WalletInfo,As as WalletPortfolio,Mn as WalletPortfolioBody,br as announceAppLauncherUsage,je as resolveEnvironment,uo as useGlobalMenu,an as useTokenBalance,sn as useTokenStats,er as useWalletDetect};