@nexus-cross/dapp-ui 1.3.4-beta.10 → 1.3.4-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,21 +1,21 @@
1
- "use strict";var wc=Object.create;var go=Object.defineProperty;var xc=Object.getOwnPropertyDescriptor;var vc=Object.getOwnPropertyNames;var yc=Object.getPrototypeOf,kc=Object.prototype.hasOwnProperty;var Sc=(e,t)=>{for(var n in t)go(e,n,{get:t[n],enumerable:!0})},yi=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of vc(t))!kc.call(e,r)&&r!==n&&go(e,r,{get:()=>t[r],enumerable:!(o=xc(t,r))||o.enumerable});return e};var G=(e,t,n)=>(n=e!=null?wc(yc(e)):{},yi(t||!e||!e.__esModule?go(n,"default",{value:e,enumerable:!0}):n,e)),Rc=e=>yi(go({},"__esModule",{value:!0}),e);var wf={};Sc(wf,{APPLE_ICON:()=>co,AppLauncher:()=>xr,AppLauncherContent:()=>kr,AppLauncherTrigger:()=>vr,BINANCE_ICON:()=>so,BridgeFlow:()=>Jn,CONNECTOR_REGISTRY:()=>Gn,CROSSX_ICON:()=>io,ConnectButton:()=>ii,ConnectorId:()=>Ro,DEFAULT_SKILLS_HREF:()=>ai,GOOGLE_ICON:()=>lo,METAMASK_ICON:()=>ao,PORTFOLIO_SECTIONS:()=>Yn,SOCIAL_REGISTRY:()=>sr,SendFlow:()=>Vn,SkillsButton:()=>si,TOKEN_STATS_QUERY_KEY:()=>Do,USER_BALANCE_QUERY_KEY:()=>Oo,WALLET_REGISTRY:()=>ar,WalletConnectModal:()=>ri,WalletInfo:()=>xn,WalletPortfolio:()=>Yr,WalletPortfolioBody:()=>gn,announceAppLauncherUsage:()=>bo,resolveEnvironment:()=>Oe,useGlobalMenu:()=>zn,useTokenBalance:()=>qt,useTokenStats:()=>Kt,useWalletDetect:()=>no});module.exports=Rc(wf);var Cc={};function ki(e){try{return Cc.env?.[e]}catch{return}}function Si(e){if(!(typeof process>"u"))return process.env?.[e]}function Oe(e){if(e)return Ri(e);let t=ki("VITE_CROSSX_ENVIRONMENT")??ki("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Si("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??Si("CROSSX_ENVIRONMENT");return Ri(t)}function Ri(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 ho="__nexusCrossAppLauncherRuntime";function Tc(){if(typeof window>"u")return null;let e=window;return e[ho]??(e[ho]={mode:"dapp-ui"}),e[ho]}function Nc(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 bo(e){let t=Tc();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Nc(t))}var Tn=G(require("react"),1),Ci=G(require("@radix-ui/react-popover"),1),Ti=require("vaul");var wo=require("react"),wr=(0,wo.createContext)(null);function xo(){let e=(0,wo.useContext)(wr);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var vo=require("react");function Cn(e){let[t,n]=(0,vo.useState)(!1);return(0,vo.useEffect)(()=>{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 Z(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))}Z(`[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)}
1
+ "use strict";var bc=Object.create;var go=Object.defineProperty;var wc=Object.getOwnPropertyDescriptor;var xc=Object.getOwnPropertyNames;var vc=Object.getPrototypeOf,yc=Object.prototype.hasOwnProperty;var kc=(e,t)=>{for(var n in t)go(e,n,{get:t[n],enumerable:!0})},vi=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xc(t))!yc.call(e,r)&&r!==n&&go(e,r,{get:()=>t[r],enumerable:!(o=wc(t,r))||o.enumerable});return e};var G=(e,t,n)=>(n=e!=null?bc(vc(e)):{},vi(t||!e||!e.__esModule?go(n,"default",{value:e,enumerable:!0}):n,e)),Sc=e=>vi(go({},"__esModule",{value:!0}),e);var bf={};kc(bf,{APPLE_ICON:()=>lo,AppLauncher:()=>xr,AppLauncherContent:()=>kr,AppLauncherTrigger:()=>vr,BINANCE_ICON:()=>ao,BridgeFlow:()=>Xn,CONNECTOR_REGISTRY:()=>zn,CROSSX_ICON:()=>ro,ConnectButton:()=>ii,ConnectorId:()=>Ro,DEFAULT_SKILLS_HREF:()=>ai,GOOGLE_ICON:()=>so,METAMASK_ICON:()=>io,PORTFOLIO_SECTIONS:()=>Qn,SOCIAL_REGISTRY:()=>sr,SendFlow:()=>jn,SkillsButton:()=>si,TOKEN_STATS_QUERY_KEY:()=>Do,USER_BALANCE_QUERY_KEY:()=>Oo,WALLET_REGISTRY:()=>ar,WalletConnectModal:()=>ri,WalletInfo:()=>xn,WalletPortfolio:()=>Yr,WalletPortfolioBody:()=>gn,announceAppLauncherUsage:()=>bo,resolveEnvironment:()=>Fe,useGlobalMenu:()=>Dn,useTokenBalance:()=>Vt,useTokenStats:()=>qt,useWalletDetect:()=>to});module.exports=Sc(bf);var Rc={};function yi(e){try{return Rc.env?.[e]}catch{return}}function ki(e){if(!(typeof process>"u"))return process.env?.[e]}function Fe(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 br="1.3.4";var ho="__nexusCrossAppLauncherRuntime";function Cc(){if(typeof window>"u")return null;let e=window;return e[ho]??(e[ho]={mode:"dapp-ui"}),e[ho]}function Tc(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 bo(e){let t=Cc();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Tc(t))}var Cn=G(require("react"),1),Ri=G(require("@radix-ui/react-popover"),1),Ci=require("vaul");var wo=require("react"),wr=(0,wo.createContext)(null);function xo(){let e=(0,wo.useContext)(wr);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}var vo=require("react");function Rn(e){let[t,n]=(0,vo.useState)(!1);return(0,vo.useEffect)(()=>{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 Z(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))}Z(`[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
2
  `);Z(`.al-trigger-btn{--at-bg: transparent;--at-bg-hover: #eaedf1;--at-color: var(--ds-content-high, rgba(0, 0, 0, .85));--at-border: none;--at-border-radius: 8px;--at-size: 36px;--at-padding: 0;--at-press-scale: .95;--at-transition: background-color .15s ease;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--at-size);height:var(--at-size);padding:var(--at-padding);border:var(--at-border);background:var(--at-bg);border-radius:var(--at-border-radius);color:var(--at-color);cursor:pointer;transition:var(--at-transition)}.al-trigger-btn:hover,.al-trigger-btn[data-state=open]{background:var(--at-bg-hover)}.al-trigger-btn:active:not(:disabled){background:var(--at-bg-hover);transform:scale(var(--at-press-scale))}.al-trigger-btn[data-theme=dark]{--at-color: var(--ds-content-high, rgba(255, 255, 255, .85));--at-bg-hover: #252b39}.al-trigger-btn[data-theme=light]{--at-color: var(--ds-content-high, rgba(0, 0, 0, .85))}
3
3
  `);Z(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
4
4
  `);Z(`.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
- `);Z("");var yo=require("react/jsx-runtime");function xr({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let i=Cn(`(max-width: ${n}px)`),[a,l]=Tn.useState(!1),d=Tn.useCallback(()=>l(!1),[]),c=Oe(e),f=Tn.useMemo(()=>({env:c,theme:t,isMobile:i,open:a,domain:o,close:d}),[c,t,i,a,o,d]);return(0,yo.jsx)(wr.Provider,{value:f,children:i?(0,yo.jsx)(Ti.Drawer.Root,{direction:"right",open:a,onOpenChange:l,noBodyStyles:!0,children:r},"drawer"):(0,yo.jsx)(Ci.Root,{open:a,onOpenChange:l,children:r},"popover")})}var Li=G(require("@radix-ui/react-popover"),1),Ai=require("vaul");var Ve=require("react/jsx-runtime");function Ni({size:e=18}){return(0,Ve.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ve.jsx)("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Ii(){return(0,Ve.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ve.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ei(){return(0,Ve.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ve.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Dn=require("react/jsx-runtime");function vr({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:i}=xo(),a=t!=null,l=e??!0,d=n?`al-trigger-btn ${n}`:"al-trigger-btn",c=a?t:(0,Dn.jsx)("button",{type:"button",className:d,"data-theme":i,style:o,children:(0,Dn.jsx)(Ni,{size:18})});return r?(0,Dn.jsx)(Ai.Drawer.Trigger,{asChild:l,children:c}):(0,Dn.jsx)(Li.Trigger,{asChild:l,children:c})}var sn=G(require("react"),1),ko=G(require("@radix-ui/react-popover"),1),an=require("vaul");var Fi=require("@tanstack/react-query");var Pi={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 Ic="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Ec="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function gt(e,t){return`${e==="production"?Ec:Ic}/${t}.png`}function Bi(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:gt(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:gt(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:gt(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:gt(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:gt(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:gt(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:gt(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:gt(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:gt(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:gt(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:gt(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:gt(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function zn(e){let t=Oe(e);return(0,Fi.useQuery)({queryKey:["global-menu",t],queryFn:async({signal:n})=>{try{let o=await fetch(Pi[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 Bi(t)}},staleTime:0,gcTime:0,retry:!1,refetchOnMount:!0})}function yr(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function Mi(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function Oi(e){return[...e].sort((t,n)=>{let o=_i(t)-_i(n);return o!==0?o:t.order-n.order})}function _i(e){let t=yr(e);return t==="comingSoon"?0:t==="ending"?2:1}function fe(...e){return e.filter(Boolean).join(" ")}var ge=require("react/jsx-runtime");function Lc(e){return e.id==="cross-staking"||e.type==="cross-staking"}function kr({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:i,domain:a,close:l}=xo(),{data:d}=zn(o),c=sn.useMemo(()=>Oi(d?.items??[]),[d?.items]),f=8,g=sn.useRef(null),w=sn.useCallback(y=>{g.current={x:y.clientX,y:y.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",x=sn.useCallback((y,R)=>{if(g.current){let k=y.clientX-g.current.x,T=y.clientY-g.current.y;if(g.current=null,Math.abs(k)>f||Math.abs(T)>f)return}let u=R.url[o]??R.url.production,N=Wi(u,a);if(!N)try{let k=new URL(u).pathname;if(h===k||h.startsWith(k+"/")){l();return}}catch{}N?window.open(u,"_blank","noopener,noreferrer"):window.location.href=u,l()},[o,a,l,h]),m=y=>{let R=y.url[o]??y.url.production,u=Wi(R,a),N=yr(y),k=N==="ending",T=Mi(y.iconUrl,o),C=!1;if(!u)try{let $=new URL(R).pathname;C=h===$||h.startsWith($+"/")}catch{C=!1}return(0,ge.jsx)("button",{type:"button",className:"al-grid-item","data-active":C||void 0,"data-service-status":N,onPointerDown:w,onClick:$=>x($,y),children:(0,ge.jsxs)("div",{className:"al-grid-item-left",children:[(0,ge.jsxs)("div",{className:"al-grid-item-icon",children:[(0,ge.jsx)("img",{src:T,alt:y.label,width:24,height:24,loading:"lazy"}),y.isNew&&(0,ge.jsx)("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),(0,ge.jsxs)("span",{className:"al-grid-item-text",children:[(0,ge.jsx)("span",{className:"al-grid-item-label",children:y.label}),k&&(0,ge.jsx)("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),y.badge&&!Lc(y)&&(0,ge.jsx)("span",{className:"al-badge al-badge-list",children:y.badge})]})]})},y.id)},b=(0,ge.jsx)("div",{className:"al-menu","data-theme":r,children:(0,ge.jsx)("div",{className:"al-grid",children:c.map(m)})});return i?(0,ge.jsxs)(an.Drawer.Portal,{children:[(0,ge.jsx)(an.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,ge.jsxs)(an.Drawer.Content,{className:fe("al-drawer-content",n),"data-theme":r,children:[(0,ge.jsxs)("div",{className:"al-drawer-header",children:[(0,ge.jsx)(an.Drawer.Close,{className:"al-drawer-close",children:(0,ge.jsx)(Ii,{})}),(0,ge.jsx)(an.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,ge.jsx)(an.Drawer.Close,{className:"al-drawer-close",children:(0,ge.jsx)(Ei,{})})]}),(0,ge.jsx)("div",{className:"al-drawer-body",children:b})]})]}):(0,ge.jsx)(ko.Portal,{children:(0,ge.jsx)(ko.Content,{align:e,sideOffset:t,className:fe("al-popover-content",n),"data-theme":r,children:b})})}function Wi(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var tt=G(require("react"),1),Ol=G(require("@radix-ui/react-popover"),1),Wl=require("vaul");var So=require("react"),Sr=(0,So.createContext)(null);function Zt(){let e=(0,So.useContext)(Sr);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Ro=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Ro||{}),Gn={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};var Aa=G(require("react"),1);var X=require("react/jsx-runtime");function Di({size:e=16,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,X.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Hn({size:e=16,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function ln({size:e=16,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function _t({size:e=24,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function zi({size:e=20,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,X.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Co({size:e=20,className:t}){return(0,X.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,X.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function cn({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function dn({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Gi({size:e=16,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,X.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Hi({size:e=16,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,X.jsx)("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ui({size:e=42,className:t}){return(0,X.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,X.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}function $i({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("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 ji({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("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 Vi({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("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 qi({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("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 Ki({size:e=20,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),(0,X.jsx)("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}var O=G(require("react"),1);var Xt=G(require("bignumber.js"),1);function Ac(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 Jt(e,t){if(!e||e==="0")return"0.00";let n=new Xt.default(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,Xt.default.ROUND_DOWN)}function lt(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 Qi(e,t,n){let r=new Xt.default(e).shiftedBy(-t).multipliedBy(new Xt.default(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(Xt.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,Xt.default.ROUND_DOWN):r.decimalPlaces(4,Xt.default.ROUND_DOWN)).toFormat()}`}function Yi(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let n=t;if(n.includes("e")||n.includes("E")){let a=Number(n);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};n=Ac(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}}var Xi=require("react"),Ji=require("@tanstack/react-query");var Ne={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},Nn="https://terms.crosstoken.io/docs/cross-terms-of-use",To="https://terms.crosstoken.io/docs/nexus-privacy-policy";var In=G(require("react"),1),Pc={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",production:"https://contents.crosstoken.io/frontend/common/app-launcher"},Bc=3e3;function pn(e,t){if(e!=null)return typeof e=="object"&&!Array.isArray(e)&&("dev"in e||"stage"in e||"production"in e)?e[t]:e}var Cr=new Map;function Zi(e,t){let n=`${Pc[t]}/${e}`,o=Cr.get(n);return o||(o=(async()=>{let r=new AbortController,i=setTimeout(()=>r.abort(),Bc);try{let a=await fetch(n,{cache:"no-store",signal:r.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(r=>(r===null&&Cr.delete(n),r)),Cr.set(n,o)),o}function Fc(e){return typeof e=="string"&&e.startsWith("https://")}async function se(e,t){let n=await Zi("endpoints.json",t),o=pn(n?.apis?.[e],t);if(!Fc(o))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return o}function En(e,t,n){let[o,r]=In.useState(void 0),i=In.useRef(n);return i.current=n,In.useEffect(()=>{let a=!0;return Zi(e,t).then(l=>{if(!a)return;let d=i.current(l);d!==void 0&&r(d)}),()=>{a=!1}},[e,t]),o}var _c="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 Tr(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function Oc(e,t,n,o){if(o)return t===Ne[e].cross?ea(t,o):n?.explorer_url?Tr(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):Wc(e,t,o)}function ea(e,t){return Tr("https://explorer.onechain.nexus",String(e),"tx",t)}function Wc(e,t,n){let o=Ne[e];if(t===o.cross)return ea(t,n);if(t===o.bsc)return Tr(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function No(e,t,n,o=!0){let r=(0,Ji.useQuery)({queryKey:[_c,e,t],queryFn:async({signal:l})=>{let d=await se("walletServer",e),c=await fetch(`${d}/v1/public/chain/info/${t}`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let f=await c.json();if("code"in f&&f.code!==void 0&&f.code!==200)throw new Error(`Chain info API error: ${f.code}`);return Mc(f)},enabled:o,staleTime:3e5}),i=r.data;return{transactionUrl:(0,Xi.useMemo)(()=>Oc(e,t,i,n),[t,i,e,n]),chainInfo:i,...r}}var ta="0x0000000000000000000000000000000000000001";var Dc="0xa9059cbb",zc=/^0x[a-fA-F0-9]{40}$/,Gc="nexus-cross:dapp-ui:send:recent:",na=10;function Hc(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Un(e){return e.toLowerCase()}function Mt(e){return zc.test(e)}function en(e){return Un(e.address)===ta}function Nr(e){return`${Gc}${e.toLowerCase()}`}function Ln(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Nr(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&Mt(o.address)&&typeof o.updatedAt=="number").slice(0,na):[]}catch{return[]}}function Ir(e,t){if(typeof window>"u")return[];let n=Un(t),o=[{address:n,updatedAt:Date.now()},...Ln(e).filter(r=>r.address!==n)].slice(0,na);try{window.localStorage.setItem(Nr(e),JSON.stringify(o))}catch{return Ln(e)}return o}function Er(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Nr(e))}catch{}}function jt(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(o||"0"),a=r.padEnd(t,"0"),l=a?BigInt(a):0n,d=10n**BigInt(t),c=i*d+l;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function $n(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=Hc(i.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Lr(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${Dc}${n}${o}`}function Io(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 l=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return l=l.replace(/0+$/,""),l?`${r.toString()}.${l}`:r.toString()}function Ar(e,t){return Io(e,t,6)}function oa(e){return Io(e,9,2)}function ra(e){return e.toLocaleString("en-US")}function Eo(e){return e===56||e===97}function Lo(e){return e.gasPrice??e.maxFeePerGas}function ia(e,t=!1){return t?Lo(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Ao(e,t=!1){if(t){let n=Lo(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 Po(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function aa(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(aa(n.cause,t+1)),o.join(`
6
- `).toLowerCase()}function Uc(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 Pr(e,t={},n="Failed to send transaction."){let o=aa(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.":Uc(e)||n}var $c=2000000000n,jc=1000000000n;async function Bo(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 Fo(e){return BigInt(e)}function Vc(e){return`0x${e.toString(16)}`}function qc(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Vc(e.value)),e.data&&(t.data=e.data),t}function Kc(e){return e===56||e===97}async function sa(e){try{let t=await Bo(e,"eth_gasPrice",[]);return{gasPrice:Fo(t)}}catch{return{gasPrice:$c}}}async function Qc(e,t){let n=jc;try{let o=await Bo(e,"eth_maxPriorityFeePerGas",[]);n=Fo(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Yc(e,t){if(t)return sa(e);let n;try{n=(await Bo(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Qc(e,Fo(n)):sa(e)}async function la(e,t){let n=Kc(t.chainId),o=qc(t),[r,i]=await Promise.all([Bo(e,"eth_estimateGas",[o]),Yc(e,n)]);return{gasLimit:Fo(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function ca(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 la(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 Zc=1500,Xc=120;function da(e){return!!(e.token||e.recipient||e.amount)}function Br({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},i=e.trim(),a=jt(t,n.quantity.decimals),l;return i?Mt(i)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in a?r.amount=a.error:(l=a.value,l>o&&(r.amount="Amount exceeds available balance.")),!en(n)&&!Mt(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:l,recipient:i&&Mt(i)?i:void 0}}function Fr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return en(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Un(e.address),data:Lr(n,o),value:0n,chainId:e.chainId,from:r}}function Jc(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var ed=e=>new Promise(t=>setTimeout(t,e));async function pa({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Zc,pollMaxAttempts:i=Xc}){let a=await e.sendTransaction(t);o(a);let{getTransactionReceipt:l}=e;if(!l)return"success";for(let d=0;d<i;d+=1){let c=await l({hash:a,chainId:n}).catch(()=>null);if(c)return Jc(c)?"reverted":"success";await ed(r)}return"timeout"}var fa=["token","recipient","amount","review"];function ua(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:i="recipient",token:a,tokens:l=[],onTokenChange:d,sendTransaction:c,getTransactionReceipt:f,estimateGas:g,getTokenPriceUsd:w,onSubmitted:h,onSuccess:x,onFailed:m,onExit:b,onOutlink:y}=e,R=O.useMemo(()=>ca({sendTransaction:c,getTransactionReceipt:f,estimateGas:g}),[c,f,g]),[u,N]=O.useState(a);O.useEffect(()=>{N(a)},[a.address,a.chainId]);let[k,T]=O.useState(i),[C,$]=O.useState(""),[D,z]=O.useState(""),[B,ie]=O.useState({}),[I,te]=O.useState("idle"),[H,Y]=O.useState(""),[ce,ve]=O.useState(""),[j,pe]=O.useState(null),[ue,V]=O.useState(!1),[De,F]=O.useState(""),ne=O.useRef(0),[q,ae]=O.useState(null),[be,dt]=O.useState(""),[ht,nt]=O.useState(()=>Ln(n)),Ht=O.useMemo(()=>Oe(t),[t]),{transactionUrl:ze,chainInfo:Ie}=No(Ht,u.chainId,H||void 0,!0),pt=Ie?.currency_symbol??"",Ge=Ie?.name??`Chain ID ${u.chainId}`,$e=O.useRef({nativeSymbol:pt||void 0,networkName:Ge,tokenSymbol:u.symbol});$e.current={nativeSymbol:pt||void 0,networkName:Ge,tokenSymbol:u.symbol};let Ee=O.useMemo(()=>BigInt(u.quantity.numeric||"0"),[u.quantity.numeric]),At=O.useMemo(()=>Jt(u.quantity.numeric,u.quantity.decimals),[u.quantity.numeric,u.quantity.decimals]),bt=w?.(u),Pt=O.useMemo(()=>{if(bt===void 0)return;let E=parseFloat(D.replace(/,/g,""));return Number.isFinite(E)?E*bt:0},[D,bt]);O.useEffect(()=>{z(""),ie({})},[u.address,u.chainId]),O.useEffect(()=>{ne.current+=1,pe(null),F(""),V(!1)},[u.address,u.chainId,C,D]),O.useEffect(()=>{nt(Ln(n))},[n]);let ot=O.useCallback(E=>{$(E),ie(oe=>({...oe,recipient:void 0}))},[]),Bt=O.useCallback(E=>{z(E),ie(oe=>({...oe,amount:void 0}))},[]),rt=O.useCallback(()=>{z(At.replace(/,/g,"")),ie(E=>({...E,amount:void 0}))},[At]),Le=O.useCallback(E=>{N(E),d?.(E),T("recipient")},[d]),it=O.useCallback(()=>T("token"),[]),ft=O.useCallback(()=>{T(E=>{if(E==="result")return"review";if(E===i)return b?.(),E;let oe=fa.indexOf(E);return oe<=0?(b?.(),E):fa[oe-1]})},[i,b]),Ke=O.useCallback(()=>{let{errors:E}=Br({recipient:C,amount:"1",token:u,balanceRaw:Ee});if(E.recipient){ie(oe=>({...oe,recipient:E.recipient}));return}ie(oe=>({...oe,recipient:void 0})),T("amount")},[C,u,Ee]),wt=O.useCallback(E=>{$(E),ie(oe=>({...oe,recipient:void 0})),T("amount")},[]),Te=O.useCallback(()=>{let E=Br({recipient:C,amount:D,token:u,balanceRaw:Ee});ie(E.errors),!(da(E.errors)||E.rawAmount===void 0||!E.recipient)&&(ae(E.rawAmount),dt(E.recipient),pe(null),F(""),te("idle"),T("review"))},[C,D,u,Ee]);O.useEffect(()=>{if(k!=="review"||!be||q===null||j!==null||ue||De||!R.canEstimateGas(Ie?.rpc))return;let E=++ne.current;V(!0),F(""),(async()=>{try{let oe=Fr({token:u,walletAddress:n,recipient:be,rawAmount:q}),Se=await R.estimateGas(oe,Ie?.rpc);if(ne.current!==E)return;pe(Se)}catch(oe){if(ne.current!==E)return;F(Pr(oe,$e.current,"Failed to estimate gas."))}finally{ne.current===E&&V(!1)}})()},[k,be,q,j,ue,De,R,Ie?.rpc,u,n]);let Fe=O.useMemo(()=>{if(!en(u)||!j||q===null)return!1;let E=Ao(j,Eo(u.chainId));return E===null?!1:q+E>Ee},[u,j,q,Ee]),Ft=O.useCallback(async()=>{if(!(!be||q===null)&&!Fe){ve(""),Y(""),te("submitting");try{let E="",oe=await pa({repository:R,args:Fr({token:u,walletAddress:n,recipient:be,rawAmount:q}),chainId:u.chainId,onSubmitted:Se=>{E=Se,Y(Se),te("confirming"),nt(Ir(n,be)),h?.({txHash:Se,chainId:u.chainId,amount:D,tokenSymbol:u.symbol,recipient:be})}});if(oe==="success")te("success"),E&&x?x?.(E):T("result");else if(oe==="reverted"){let Se="Transaction reverted on-chain.";te("error"),ve(Se),E&&m?m({txHash:E,chainId:u.chainId,message:Se}):T("result")}else{let Se="Transaction receipt was not found. Please check again later.";te("error"),ve(Se),E&&m?m({txHash:E,chainId:u.chainId,message:Se}):T("result")}}catch(E){te("error"),ve(Pr(E,{nativeSymbol:pt||void 0,networkName:Ge,tokenSymbol:u.symbol})),T("result")}}},[R,be,q,Fe,u,D,n,h,x,m,pt,Ge]),[xt,Qe]=O.useState(!1),ut=O.useRef(void 0);O.useEffect(()=>()=>clearTimeout(ut.current),[]);let vt=O.useCallback(async()=>{if(H)try{await navigator.clipboard.writeText(H),Qe(!0),clearTimeout(ut.current),ut.current=setTimeout(()=>Qe(!1),2e3)}catch{}},[H]),_e=O.useCallback(()=>{if(!ze||!H)return;let E=at=>{typeof window<"u"&&window.open(at,"_blank","noopener,noreferrer")};if(!y){E(ze);return}let oe=y(ze,{category:"send",origin:"send-transaction",payload:{chainId:u.chainId,txHash:H}});if(oe&&typeof oe.then=="function"){let at=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;oe.then(Ut=>{if(Ut===null){at?.close();return}let st=Ut??ze;if(at)try{at.location.href=st}catch{at.close(),E(st)}else E(st)});return}let Se=oe;Se!==null&&E(Se??ze)},[y,u.chainId,ze,H]),He=O.useCallback(()=>{ve(""),Y(""),te("idle"),pe(null),F(""),T("review")},[]);return{step:k,status:I,token:u,tokens:l.length>0?l:[u],recipient:C,amount:D,amountUsd:Pt,fieldErrors:B,error:ce,txHash:H,gasEstimate:j,gasLoading:ue,gasError:De,insufficientGas:Fe,reviewRawAmount:q,reviewRecipient:be,recentAddresses:ht,accounts:r,accountName:o,walletAddress:n,resolvedEnv:Ht,transactionUrl:ze,networkName:Ge,nativeSymbol:pt,nativeDecimals:Ie?.currency_decimals??u.quantity.decimals,balanceRaw:Ee,balanceText:At,priceUsd:bt,canSelectToken:(l.length>0?l:[u]).length>1,canSend:R.canSend,getTokenPriceUsd:w,setRecipient:ot,setAmount:Bt,setMax:rt,selectToken:Le,goToTokenSelect:it,selectRecipient:wt,submitRecipient:Ke,submitAmount:Te,confirmSend:Ft,retry:He,back:ft,hashCopied:xt,copyHash:vt,openTransaction:_e}}var St=G(require("react"),1);var Ot=require("react/jsx-runtime");function ma({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:i,token:a,setMax:l}=e,d=St.useRef(null),c=St.useCallback(()=>{requestAnimationFrame(()=>{let m=d.current;if(!m)return;let b=m.value.length;m.setSelectionRange(b,b)})},[]);St.useEffect(()=>{d.current?.focus(),c()},[c]),St.useEffect(()=>{t===""&&(w(!1),c())},[t,c]);let f=St.useMemo(()=>{let m=jt(t,a.quantity.decimals);return"value"in m&&m.value>i},[t,a.quantity.decimals,i]),[g,w]=St.useState(!1),h=!g&&t===""?"0.00":t,x=t.trim()===""||t.trim()==="0";return(0,Ot.jsx)("div",{className:"sf-body sf-amount",children:(0,Ot.jsxs)("div",{className:"sf-amount-center",children:[(0,Ot.jsx)("span",{className:"sf-amount-usd",children:o!==void 0?Po(o):"\xA0"}),(0,Ot.jsx)("div",{className:"sf-amount-input-wrap","data-over":f||void 0,"data-empty":x||void 0,onClick:()=>d.current?.focus(),children:(0,Ot.jsx)("input",{ref:d,className:"sf-amount-input",value:h,onChange:m=>{let b=m.target.value;if(g)n(b);else if(t===""){if(b.length<4)return;w(!0);let y=b.startsWith("0.00")?b.slice(4):b;n(y)}else w(!0),n(b)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),(0,Ot.jsxs)("div",{className:"sf-amount-balance",children:[(0,Ot.jsx)("span",{children:"Balance:"}),(0,Ot.jsxs)("button",{type:"button",className:"sf-amount-max",onClick:l,children:[r," ",a.symbol]})]})]})})}var Rt=G(require("react"),1);var nd=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function ha(e){return nd.has(e.toLowerCase())}var ga={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function jn(e,t){let n=Ne[e];if(t===n.cross)return ga.cross;if(t===n.bsc)return ga.bsc}var od={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function Vt(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:i="png"}=n,a=od[e],l=r?`&bg=${r}`:"";return`${a}/portrait/evm/${t}.${i}?size=${o}${l}`}var We=require("react/jsx-runtime");function ba({size:e=20,className:t}){return(0,We.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,We.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),(0,We.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function wa({size:e=20,className:t}){return(0,We.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,We.jsx)("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 xa({size:e=20,className:t}){return(0,We.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,We.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),(0,We.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function va({size:e=16,className:t}){return(0,We.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:(0,We.jsx)("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function ya({size:e=56,className:t}){return(0,We.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,We.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),(0,We.jsx)("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 ka({size:e=56,className:t}){return(0,We.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,We.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),(0,We.jsx)("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}var le=require("react/jsx-runtime");function Sa(e,t){return e.name||`Account ${(e.index??t)+1}`}function Ra(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Ca(e){return e.toLowerCase()}function Ta({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:i,walletAddress:a,resolvedEnv:l,selectRecipient:d}=e,c=Rt.useMemo(()=>i.filter(u=>u.address.toLowerCase()!==a.toLowerCase()),[i,a]),f=c.length>0,g=Rt.useMemo(()=>new Map(c.map((u,N)=>[Ca(u.address),{account:u,index:N}])),[c]),[w,h]=Rt.useState("recent"),x=Rt.useRef(null);Rt.useEffect(()=>{x.current?.focus()},[]);let m="1A1A2E",b=Rt.useCallback(async()=>{try{let u=await navigator.clipboard.readText();u&&n(u.trim())}catch{}},[n]),y=t.trim().length>0,R=Mt(t.trim());return(0,le.jsxs)("div",{className:"sf-recipient",children:[(0,le.jsxs)("div",{className:"sf-recipient-top",children:[(0,le.jsxs)("div",{className:"sf-address-field","data-filled":y||void 0,"data-invalid":o.recipient||void 0,children:[(0,le.jsx)("textarea",{ref:x,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?(0,le.jsx)("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:(0,le.jsx)(xa,{size:20})}):(0,le.jsx)("button",{type:"button",className:"sf-address-action",onClick:b,"aria-label":"Paste from clipboard",children:(0,le.jsx)(wa,{size:20})})]}),o.recipient&&(0,le.jsx)("p",{className:"sf-field-error",role:"alert",children:o.recipient}),(0,le.jsxs)("div",{className:"sf-tabs",role:"tablist",children:[(0,le.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":w==="recent"||void 0,"aria-selected":w==="recent",onClick:()=>h("recent"),children:"Recent"}),f&&(0,le.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":w==="account"||void 0,"aria-selected":w==="account",onClick:()=>h("account"),children:"My Account"})]})]}),(0,le.jsx)("div",{className:"sf-address-list",children:w==="account"&&f?c.map((u,N)=>{let k=Sa(u,N),T=Vt(l,u.address,{size:56,bg:m});return(0,le.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>d(u.address),children:[(0,le.jsxs)("span",{className:"sf-address-avatar",children:[T&&(0,le.jsx)("img",{src:T,alt:"",width:40,height:40,draggable:!1,onError:C=>{C.currentTarget.style.display="none"}}),(0,le.jsx)("span",{className:"sf-address-avatar-fallback",children:Ra(k)})]}),(0,le.jsxs)("span",{className:"sf-address-meta",children:[(0,le.jsx)("span",{className:"sf-address-name",children:k}),(0,le.jsx)("span",{className:"sf-address-value",children:lt(u.address)})]})]},u.address)}):r.length>0?r.map(u=>{let N=g.get(Ca(u.address)),k=N?Sa(N.account,N.index):lt(u.address),T=Vt(l,u.address,{size:56,bg:m});return(0,le.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>d(u.address),children:[(0,le.jsxs)("span",{className:"sf-address-avatar",children:[T&&(0,le.jsx)("img",{src:T,alt:"",width:40,height:40,draggable:!1,onError:C=>{C.currentTarget.style.display="none"}}),(0,le.jsx)("span",{className:"sf-address-avatar-fallback",children:Ra(k)})]}),(0,le.jsxs)("span",{className:"sf-address-meta",children:[(0,le.jsx)("span",{className:"sf-address-name",children:k}),(0,le.jsx)("span",{className:"sf-address-value",children:lt(u.address)})]})]},u.address)}):(0,le.jsx)("div",{className:"sf-empty",children:"No send history"})}),y&&!R&&!o.recipient&&(0,le.jsx)("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}var ye=require("react/jsx-runtime");function Ia({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:i,openTransaction:a}=e,l=t==="error",d=t==="success";return l?(0,ye.jsxs)("div",{className:"sf-body sf-result sf-result--error",children:[(0,ye.jsx)("span",{className:"sf-result-icon",children:(0,ye.jsx)(ka,{size:56})}),(0,ye.jsxs)("div",{className:"sf-result-copy",children:[(0,ye.jsx)("h3",{className:"sf-result-title",children:"Transaction Failed"}),(0,ye.jsx)("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&(0,ye.jsx)(Na,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]}):(0,ye.jsxs)("div",{className:"sf-body sf-result",children:[(0,ye.jsx)("span",{className:"sf-result-icon","data-pending":!d||void 0,children:d?(0,ye.jsx)(ya,{size:56}):(0,ye.jsx)("span",{className:"sf-result-spinner"})}),(0,ye.jsxs)("div",{className:"sf-result-copy",children:[(0,ye.jsx)("h3",{className:"sf-result-title",children:d?"Transaction Complete":"Transaction in Progress"}),(0,ye.jsx)("p",{className:"sf-result-desc",children:d?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&(0,ye.jsx)(Na,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]})}function Na({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return(0,ye.jsxs)("div",{className:"sf-result-hash-card",children:[(0,ye.jsx)("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),(0,ye.jsxs)("div",{className:"sf-result-hash-row",children:[(0,ye.jsx)("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:lt(e)}),(0,ye.jsx)("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?(0,ye.jsx)(ln,{size:16}):"Copy"})]})]})}var ee=require("react/jsx-runtime"),_o="\u2014";function Ea({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:i,walletAddress:a,networkName:l,nativeSymbol:d,nativeDecimals:c,gasEstimate:f,gasLoading:g,gasError:w,insufficientGas:h,error:x,resolvedEnv:m}=e,b=en(t),y=n!==null?Io(n,t.quantity.decimals):"",R=r?.trim()||`Account ${(i[0]?.index??0)+1}`,u=Vt(m,a,{size:56,bg:"1A1A2E"}),N=d||(b?t.symbol:""),k=Eo(t.chainId),T=f?ia(f,k):null,C=f?Ao(f,k):null,$=I=>I!==null&&N?`${Ar(I,c)} ${N}`:_o,D=I=>I!==void 0?`${oa(I)} Gwei`:_o,z=(()=>{if(!b||!f||C===null||n===null)return _o;let I=n+C;return`${Ar(I,c)} ${N||t.symbol}`})(),B=I=>g?"\u2026":I,ie=[{label:"Est. Tx Fee",value:B($(C))},...T==="dynamic"?[{label:"Max Priority Fee",value:B(D(f?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:B(D(f?.maxFeePerGas))}]:T==="legacy"?[{label:"Gas Price",value:B(D(f?Lo(f):void 0))}]:[],{label:"Gas Limit",value:B(f?ra(f.gasLimit):_o)}];return(0,ee.jsxs)("div",{className:"sf-body sf-review",children:[(0,ee.jsxs)("div",{className:"sf-review-amount",children:[(0,ee.jsx)("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:I=>{I.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,ee.jsxs)("span",{className:"sf-review-amount-value",children:[y,(0,ee.jsx)("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),(0,ee.jsxs)("div",{className:"sf-review-parties",children:[(0,ee.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,ee.jsx)("span",{className:"sf-review-party-label",children:"From"}),(0,ee.jsxs)("div",{className:"sf-review-party-head",children:[(0,ee.jsx)("span",{className:"sf-review-party-avatar",children:u&&(0,ee.jsx)("img",{src:u,alt:"",width:28,height:28,draggable:!1,onError:I=>{I.currentTarget.style.display="none"}})}),(0,ee.jsx)("span",{className:"sf-review-party-name",children:R})]}),(0,ee.jsx)("span",{className:"sf-review-party-addr",children:a})]}),(0,ee.jsx)("span",{className:"sf-review-arrow","aria-hidden":!0,children:(0,ee.jsx)(va,{size:16})}),(0,ee.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,ee.jsx)("span",{className:"sf-review-party-label",children:"To"}),(0,ee.jsx)("span",{className:"sf-review-party-addr",children:o})]})]}),(0,ee.jsxs)("section",{className:"sf-review-card",children:[(0,ee.jsx)("h3",{className:"sf-review-section-title",children:"Summary"}),(0,ee.jsxs)("div",{className:"sf-review-row",children:[(0,ee.jsx)("span",{className:"sf-review-row-label",children:"Network"}),(0,ee.jsx)("span",{className:"sf-review-row-value",children:l})]}),ie.map(I=>(0,ee.jsxs)("div",{className:"sf-review-row",children:[(0,ee.jsx)("span",{className:"sf-review-row-label",children:I.label}),(0,ee.jsx)("span",{className:"sf-review-row-value",children:I.value})]},I.label))]}),(0,ee.jsxs)("section",{className:"sf-review-card",children:[(0,ee.jsx)("h3",{className:"sf-review-section-title",children:"Total"}),(0,ee.jsxs)("div",{className:"sf-review-row",children:[(0,ee.jsx)("span",{className:"sf-review-row-label",children:"Total Amount"}),(0,ee.jsxs)("span",{className:"sf-review-row-value",children:[y," ",t.symbol]})]}),b&&(0,ee.jsxs)("div",{className:"sf-review-row",children:[(0,ee.jsx)("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),(0,ee.jsx)("span",{className:"sf-review-row-value",children:B(z)})]})]}),h&&!w&&!x&&(0,ee.jsxs)("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)&&(0,ee.jsx)("div",{className:"sf-message sf-message--error",role:"alert",children:w||x})]})}var Mo=G(require("react"),1);var Ue=require("react/jsx-runtime");function La({flow:e}){let[t,n]=Mo.useState(""),o=t.trim().toLowerCase(),r=Mo.useMemo(()=>o?e.tokens.filter(i=>i.symbol.toLowerCase().includes(o)||i.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return(0,Ue.jsxs)("div",{className:"sf-body sf-token-select",children:[(0,Ue.jsxs)("div",{className:"sf-search",children:[(0,Ue.jsx)(ba,{size:20}),(0,Ue.jsx)("input",{className:"sf-search-input",value:t,onChange:i=>n(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),(0,Ue.jsxs)("div",{className:"sf-token-list",children:[r.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,l=jn(e.resolvedEnv,i.chainId),d=e.getTokenPriceUsd?.(i);return(0,Ue.jsxs)("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),children:[(0,Ue.jsxs)("span",{className:"sf-token-left",children:[(0,Ue.jsxs)("span",{className:"sf-token-icon-wrap",children:[(0,Ue.jsx)("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"}}),l&&(0,Ue.jsx)("img",{className:"sf-token-chain-badge",src:l,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),(0,Ue.jsx)("span",{className:"sf-token-name",children:i.symbol})]}),(0,Ue.jsxs)("span",{className:"sf-token-right",children:[(0,Ue.jsx)("span",{className:"sf-token-balance",children:Jt(i.quantity.numeric,i.quantity.decimals)}),d!==void 0&&(0,Ue.jsx)("span",{className:"sf-token-price",children:Po(d)})]})]},a)}),r.length===0&&(0,Ue.jsx)("div",{className:"sf-empty",children:"No tokens found"})]})]})}Z(`.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
- `);var ke=require("react/jsx-runtime"),rd={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Vn({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...i}){let a=Aa.useCallback(y=>{o?.(y),n?.(y)},[n,o]),d=ua({...i,onSuccess:o||n?a:void 0,onExit:t}),{step:c,status:f}=d,g=Mt(d.recipient.trim()),w=jt(d.amount,d.token.quantity.decimals),h="value"in w&&w.value<=d.balanceRaw,x=f==="submitting"||f==="confirming",m=c!=="result",b=rd[c]??"";return(0,ke.jsxs)("div",{className:fe("sf-root",r),"data-step":c,children:[(0,ke.jsxs)("header",{className:"sf-header",children:[m?(0,ke.jsx)("button",{type:"button",className:"sf-header-btn",onClick:d.back,"aria-label":"Back",children:(0,ke.jsx)(cn,{size:24})}):(0,ke.jsx)("span",{className:"sf-header-btn","aria-hidden":!0}),(0,ke.jsx)("span",{className:"sf-header-title",children:b}),(0,ke.jsx)("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:(0,ke.jsx)(_t,{size:24})})]}),c==="token"&&(0,ke.jsx)(La,{flow:d}),c==="recipient"&&(0,ke.jsx)(Ta,{flow:d}),c==="amount"&&(0,ke.jsx)(ma,{flow:d}),c==="review"&&(0,ke.jsx)(Ea,{flow:d}),c==="result"&&(0,ke.jsx)(Ia,{flow:d}),(0,ke.jsxs)("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&(0,ke.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:d.submitRecipient,"data-disabled":!g||void 0,"aria-disabled":!g,children:"Next"}),c==="amount"&&(0,ke.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:d.submitAmount,"data-disabled":!h||void 0,"aria-disabled":!h,children:"Next"}),c==="review"&&(0,ke.jsxs)("div",{className:"sf-footer-row",children:[(0,ke.jsx)("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:d.back,disabled:x,children:"Cancel"}),(0,ke.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:d.confirmSend,disabled:x||!d.canSend||d.insufficientGas,children:x?"Sending...":"Send"})]}),c==="result"&&f==="success"&&(0,ke.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(d.txHash||void 0),children:"All done"}),c==="result"&&f==="error"&&(0,ke.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:d.retry,children:"Try Again"})]})]})}var Pa=G(require("@radix-ui/react-popover"),1),Ba=require("vaul");var fn=require("react/jsx-runtime");function Fa({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:i}=Zt(),a=n!=null,l=e??!0,d=a?n:(0,fn.jsxs)("button",{type:"button",className:fe("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[(0,fn.jsx)(Di,{size:o?14:16}),(0,fn.jsx)("span",{className:"wi-trigger-address",children:lt(i)})]});return o?(0,fn.jsx)(Ba.Drawer.Trigger,{asChild:l,children:d}):(0,fn.jsx)(Pa.Trigger,{asChild:l,children:d})}var W=G(require("react"),1),tr=G(require("@radix-ui/react-popover"),1),eo=require("vaul");var Bn=G(require("bignumber.js"),1);var _a=require("@tanstack/react-query"),Ma=require("react");var Oo="user-balance";async function id(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 qt(e,t,n=!0){let o=Ne[e],r=[o.cross,o.bsc],i=(0,_a.useQueries)({queries:r.map(c=>({queryKey:[Oo,e,t,c],queryFn:async({signal:f})=>id(await se("walletServer",e),c,t,f),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),a=i.some(c=>c.isLoading),l=i.some(c=>c.isError);return{tokens:(0,Ma.useMemo)(()=>{let c=[];for(let f of i)f.data&&c.push(...f.data);return c},[i]),isLoading:a,isError:l}}var Wo=require("@tanstack/react-query"),Oa=require("react");var ad="forge-holdings",sd="forge-token-image";async function ld(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 cd(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 Wa(e,t,n=!0){let{data:o,...r}=(0,Wo.useQuery)({queryKey:[ad,e,t],queryFn:async({signal:i})=>ld(await se("bondingCurve",e),t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:o??[],...r}}function Da(e,t,n=!0){let o=(0,Wo.useQueries)({queries:t.map(i=>({queryKey:[sd,e,i],queryFn:async({signal:a})=>cd(await se("bondingCurve",e),i,a),enabled:n,staleTime:1/0}))});return{imageMap:(0,Oa.useMemo)(()=>{let i=new Map;for(let a of o)a.data&&i.set(a.data.address,a.data.image_url);return i},[o])}}var za=require("@tanstack/react-query"),Ga=require("react");var Do="token-stats";function Ct(e,t){return`${e}:${t.toLowerCase()}`}function Kt(e,t=!0){let{data:n,...o}=(0,za.useQuery)({queryKey:[Do,e],queryFn:async({signal:i})=>{let a=await se("walletServer",e),l=await fetch(`${a}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token stats API error: ${d.code}`);return d},enabled:t,staleTime:3e4});return{statsMap:(0,Ga.useMemo)(()=>{let i=new Map;if(!n?.data)return i;for(let a of n.data){let l=Ct(a.chain_id,a.address);i.set(l,a)}return i},[n]),...o}}var Ha=require("@tanstack/react-query"),dd="crossd-apy",pd="https://crossd-dashboard-api.crossdefi.io/api/v1/overview";function Ua(){let{data:e,...t}=(0,Ha.useQuery)({queryKey:[dd],queryFn:async({signal:n})=>{let o=await fetch(pd,{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}}var $a=require("@tanstack/react-query"),ja=require("react");var fd="token-info";function _r(e,t){return`${t.toLowerCase()}_${e}`}function Va(e,t=!0){let{data:n,...o}=(0,$a.useQuery)({queryKey:[fd,e],queryFn:async({signal:i})=>{let a=await se("walletServer",e),l=await fetch(`${a}/v1/public/token/info`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:1/0});return{categoryMap:(0,ja.useMemo)(()=>{let i=new Map;if(!n?.data)return i;for(let a of n.data){let l=_r(a.chain_id,a.address);i.set(l,a.category)}return i},[n]),...o}}var qa=require("react"),zo=G(require("bignumber.js"),1);function Ka(e,t,n){let{tokens:o,isLoading:r}=qt(e,t,n),{statsMap:i}=Kt(e,n);return(0,qa.useMemo)(()=>{let a=new zo.default(0);for(let f of o){let g=i.get(Ct(f.chainId,f.address));if(!g)continue;let h=new zo.default(f.quantity.numeric).shiftedBy(-f.quantity.decimals).multipliedBy(new zo.default(g.price));h.isNaN()||(a=a.plus(h))}let l=a.toFixed(),{displayValue:d,isLowerBound:c}=Yi(l);return{totalUsd:l,displayValue:d,isLowerBound:c,isLoading:r}},[o,i,r])}var Al=require("qrcode.react");function Je(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,f=g=>{if(g===null){c?.close();return}let w=g??t;if(c)try{c.location.href=w}catch{c.close(),i(w)}else i(w)};r.then(f,g=>{console.error("[dapp-ui] onOutlink rejected:",g),c?.close()});return}let l=r;if(l===null)return;i(l??t)}var bn=G(require("react"),1),ol=require("vaul");var Go=require("react"),qn=(0,Go.createContext)(null);function qe(){let e=(0,Go.useContext)(qn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var Qa=require("vaul");var Mr=require("react/jsx-runtime");function Ya({asChild:e,children:t}){let{walletAddress:n}=qe(),o=t!=null,r=e??!0,i=o?t:(0,Mr.jsx)("button",{type:"button",children:lt(n)});return(0,Mr.jsx)(Qa.Drawer.Trigger,{asChild:r,children:i})}var Zn=require("vaul");var Ce=G(require("react"),1),tl=require("@tanstack/react-query");var Ho=require("react"),Or=(0,Ho.createContext)(null);function Za(){return(0,Ho.useContext)(Or)}var Ae=require("react/jsx-runtime");function Xa({size:e=22,className:t}){return(0,Ae.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Ae.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ja({size:e=22,className:t}){return(0,Ae.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,Ae.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,Ae.jsx)("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function es({size:e=16,className:t}){return(0,Ae.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,Ae.jsx)("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"}),(0,Ae.jsx)("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 ts({size:e=16,className:t}){return(0,Ae.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Ae.jsx)("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ns({size:e=48,className:t}){return(0,Ae.jsxs)("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,Ae.jsx)("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),(0,Ae.jsx)("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 Tt({size:e=12,className:t}){return(0,Ae.jsxs)("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:[(0,Ae.jsx)("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"}),(0,Ae.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,Ae.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var ct=G(require("bignumber.js"),1),ud=/^(\d{4}-\d{2}-\d{2})/;function os(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:i}of e.map(a=>({key:ud.exec(a.reference_date)?.[1],cumulative:a.cumulative_earned})).filter(a=>!!a.key&&a.cumulative!=null).sort((a,l)=>a.key<l.key?-1:a.key>l.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 Uo(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function rs(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}var md="0xe00e8bf3";function is(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`${md}${o}${r}`}function Wr(e){return!e||e<=0n?"0":new ct.default(e.toString()).shiftedBy(-9).toFormat(2,ct.default.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function as(e){return!e||e<=0n?"0":new ct.default(e.toString()).toFormat(0,ct.default.ROUND_DOWN)}function ss(e){if(!e||e<=0n)return"0";let t=new ct.default(e.toString()).shiftedBy(-18),n=t.isLessThan(1e-4)?7:4;return t.toFormat(n,ct.default.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Nt(e,t){let n=new ct.default(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,ct.default.ROUND_DOWN):n.toFormat(4,ct.default.ROUND_DOWN)}function Dr(e){return Nt(e,0)}function tn(e,t,n){let o=new ct.default(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let r=new ct.default(e||"0").shiftedBy(-t).times(o);return r.isFinite()?`$${r.toFormat(2,ct.default.ROUND_DOWN)}`:null}var Ts=G(require("react"),1);var ls=require("@tanstack/react-query"),zr=require("react");var gd="wp:reward-pools";function An(e,t=!0){let{data:n,...o}=(0,ls.useQuery)({queryKey:[gd,e],queryFn:async({signal:a})=>{let l=await se("gameReward",e),d=await fetch(`${l}/v1/pools`,{cache:"no-store",signal:a});if(!d.ok)throw new Error(`Failed to fetch pools: ${d.status}`);let c=await d.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),r=(0,zr.useMemo)(()=>n?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[n]),i=(0,zr.useMemo)(()=>n?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[n]);return{crossPools:r,gamePools:i,allPools:n?.data.pools??[],...o}}var cs=require("@tanstack/react-query"),ds=require("react");var hd="wp:user-deposits";function $o(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,cs.useQuery)({queryKey:[hd,e,t],queryFn:async({signal:l})=>{let d=await se("gameReward",e),c=await fetch(`${d}/v1/users/${t}/deposits`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let f=await c.json();if(f.code!==200)throw new Error(`Deposits API error: ${f.code}`);return f},enabled:o,staleTime:0});return{depositMap:(0,ds.useMemo)(()=>{let l=new Map;if(!r?.data.user_deposits)return l;for(let d of r.data.user_deposits)l.set(d.pool_address.toLowerCase(),d);return l},[r]),deposits:r?.data.user_deposits??[],...i}}var hs=require("@tanstack/react-query"),bs=require("react");var ps={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},fs={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var us={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var Gr={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},ms={dev:`${Gr.dev}/portfolio`,stage:`${Gr.stage}/portfolio`,production:`${Gr.production}/portfolio`};var gs={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Wt={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 bd="wp:token-info";function jo(e,t=!0){let n=Ne[e].cross,{data:o,...r}=(0,hs.useQuery)({queryKey:[bd,e],queryFn:async({signal:d})=>{let c=await se("walletServer",e),f=await fetch(`${c}/v1/public/token/info`,{cache:"no-store",signal:d});if(!f.ok)throw new Error(`Failed to fetch token info: ${f.status}`);let g=await f.json();if(g.code!==200)throw new Error(`Token info API error: ${g.code}`);return g},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=(0,bs.useMemo)(()=>{let d=new Map,c=new Map;if(!o?.data)return{byChainAddr:d,byChainSym:c};for(let f of o.data){let g=f.address.toLowerCase();d.set(`${f.chain_id}:${g}`,f),d.set(g,f);let w=f.symbol.replace(/^t/,"").toUpperCase(),h=`${f.chain_id}:${w}`;c.has(h)||c.set(h,f),c.has(w)||c.set(w,f)}return{byChainAddr:d,byChainSym:c}},[o]);return{getTokenImage:(d,c)=>{let f=d.toLowerCase(),g=i.get(`${n}:${f}`);if(g?.image)return g.image;let w=i.get(f);if(w?.image)return w.image;if(c){let h=c.replace(/^t/,"").toUpperCase(),x=a.get(`${n}:${h}`);if(x?.image)return x.image;let m=a.get(h);if(m?.image)return m.image}return""},...r}}var xs=require("@tanstack/react-query"),Qn=require("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 l=await a.json();if(l.error)throw new Error(`RPC ${t}: ${l.error.message}`);if(l.result===void 0)throw new Error(`RPC ${t}: empty result`);return l.result}function Sd(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function Kn(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function un(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([un(e,n,wd+Sd(t),o),un(e,n,xd,o),un(e,n,vd,o)]),l=Kn(r);if(l===void 0)return null;let d=Kn(a);return{balance:l,totalSupply:Kn(i),decimals:d!==void 0?Number(d):void 0}}async function Hr(e,t){let n=Ne[e].cross,o=await se("walletServer",e),r=await fetch(`${o}/v1/public/chain/info/${n}`,{cache:"no-store",signal:t});if(!r.ok)return;let i=await r.json();return("data"in i&&i.data!==void 0?Array.isArray(i.data)?i.data[0]:i.data:i)?.rpc||void 0}async function ws(e,t,n,o){if(!t||n.length===0)return{};let r;try{r=await Hr(e,o)}catch{r=void 0}if(!r)return{};let i=await Promise.all(n.map(async l=>[l.toLowerCase(),await Rd(r,t,l,o)])),a={};for(let[l,d]of i)d&&(a[l]=d);return a}var Cd="wp:withdraw-token-meta",Td="0xc89039c5",Nd="0x95d89b41",Id="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 Ld(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 Ad(e,t,n){if(t.length===0)return{};let o;try{o=await Hr(e,n)}catch{o=void 0}if(!o)return{};let r=await Promise.all(t.map(async a=>{let l=Ld(await un(o,a,Td,n));if(!l)return[a.toLowerCase(),null];let[d,c]=await Promise.all([un(o,l,Nd,n),un(o,l,Id,n)]),f=Ed(d),g=Kn(c);return f?[a.toLowerCase(),{tokenAddress:l,symbol:f,decimals:g!==void 0?Number(g):18}]:[a.toLowerCase(),null]})),i={};for(let[a,l]of r)l&&(i[a]=l);return i}function Vo(e,t,n=!0){let r=n&&!!t,{allPools:i,isLoading:a}=An(e,r),{deposits:l,isLoading:d}=$o(e,t,r),c=(0,Qn.useMemo)(()=>{let b=new Map;for(let y of i)b.set(y.pool_address.toLowerCase(),y);return b},[i]),f=(0,Qn.useMemo)(()=>l.filter(b=>{try{return BigInt(b.deposited_amount||"0")>0n}catch{return!1}}),[l]),g=(0,Qn.useMemo)(()=>f.map(b=>b.pool_address.toLowerCase()).filter(b=>!c.has(b)).sort(),[f,c]),{data:w,isLoading:h}=(0,xs.useQuery)({queryKey:[Cd,e,g],queryFn:({signal:b})=>Ad(e,g,b),enabled:r&&g.length>0,staleTime:1440*60*1e3});return{positions:(0,Qn.useMemo)(()=>{let b=[];for(let y of f){let R=y.pool_address.toLowerCase(),u=c.get(R);if(u){b.push({poolId:y.pool_id,poolAddress:y.pool_address,poolType:u.pool_type,tokenSymbol:u.deposit_token.symbol,tokenAddress:u.deposit_token.address,decimals:u.deposit_token.decimals,price:u.deposit_token.price,depositedRaw:y.deposited_amount});continue}let N=w?.[R];N&&b.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 b},[f,c,w]),isLoading:a||d||h}}var Ur=G(require("react"),1);var mn=require("react/jsx-runtime");function Dt({sectionKey:e,title:t,icon:n,iconFit:o="cover",isEmpty:r,loading:i=!1,children:a}){let l=Za();return Ur.useEffect(()=>{l?.report(e,{loading:i,empty:r})},[l,e,i,r]),Ur.useEffect(()=>()=>l?.unregister(e),[l,e]),r?null:(0,mn.jsxs)("div",{className:"wp-svc-card",children:[(0,mn.jsxs)("div",{className:"wp-svc-card-head",children:[(0,mn.jsx)("img",{className:"wp-svc-card-icon",src:n,alt:"",style:{objectFit:o}}),(0,mn.jsx)("span",{className:"wp-svc-card-title",children:t})]}),(0,mn.jsx)("div",{className:"wp-svc-items",children:a})]})}var we=G(require("react"),1);var S=require("react/jsx-runtime"),Pd=/^\d*\.?\d{0,2}$/,Bd=[100n,1000n,2000n],Fd=400;function _d(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":`${ss(e.gasLimit*n)} CROSS`}function $r(e,t,n){return n==="loading"?"Estimating...":n==="error"||n==="unavailable"?"-":`${e} ${t}`.trim()}function vs({position:e,size:t}){return e.icon?(0,S.jsx)("img",{src:e.icon,alt:"",width:t,height:t}):(0,S.jsx)("span",{children:e.tokenSymbol.slice(0,1)})}function qo({open:e,status:t,positions:n,initialPoolAddress:o,walletAddress:r,txHash:i,error:a,copied:l=!1,estimateWithdraw:d,onClose:c,onConfirm:f,onCopyHash:g}){let[w,h]=we.useState(void 0),[x,m]=we.useState(""),[b,y]=we.useState(null),[R,u]=we.useState("idle"),N=we.useRef(0),k=we.useRef(void 0),T=we.useRef(null);we.useEffect(()=>()=>clearTimeout(k.current),[]);let C=we.useMemo(()=>{let F=(w??o)?.toLowerCase();return n.find(ne=>ne.poolAddress.toLowerCase()===F)??n[0]??null},[n,w,o]),$=we.useMemo(()=>{try{return BigInt(C?.depositedRaw??"0")}catch{return 0n}},[C?.depositedRaw]),D=C?.decimals??18,z=we.useMemo(()=>{let F=jt(x,D);return"value"in F?F.value:null},[x,D]),B=z!==null&&z>$,ie=t==="confirm"&&!!C&&z!==null&&z>0n&&!B,I=we.useCallback(()=>{m(""),y(null),u(d?"idle":"unavailable"),N.current+=1,T.current=null},[]);we.useEffect(()=>{e&&(h(o),I())},[e]);let te=we.useCallback(F=>{t==="confirm"&&(h(F.poolAddress),I())},[t,I]);we.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(k.current);return}if(!d||!C){clearTimeout(k.current),u("unavailable");return}if(z===null||z<=0n||B){clearTimeout(k.current),N.current+=1,T.current=null,y(null),u("idle");return}let F=`${C.poolAddress.toLowerCase()}:${z.toString()}`;if(T.current===F)return;T.current=F,clearTimeout(k.current);let ne=N.current+1;N.current=ne,u("loading"),k.current=setTimeout(()=>{d(C,z).then(q=>{N.current===ne&&(y(q??null),u(q?"ready":"unavailable"))}).catch(()=>{N.current===ne&&(y(null),u("error"))})},Fd)},[e,t,z,B,d,C]);let H=we.useCallback(F=>{let ne=F.target.value.replace(/,/g,"");(ne===""||Pd.test(ne))&&m(ne)},[]),Y=we.useCallback(F=>{m($n(F.toString(),D))},[D]),ce=we.useCallback(F=>{let ne=10n**BigInt(D),ae=(z??0n)+F*ne;Y(ae>$?$:ae)},[z,D,$,Y]),ve=we.useCallback(()=>{Y($)},[$,Y]);if(!e||!C)return null;let j=t==="submitting",pe=Wr(b?.maxPriorityFeePerGas),ue=Wr(b?.maxFeePerGas??b?.gasPrice),V=as(b?.gasLimit),De=Nt(C.depositedRaw,D);return(0,S.jsx)("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:F=>{F.target===F.currentTarget&&!j&&c()},children:(0,S.jsxs)("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","data-status":t,"data-vaul-no-drag":!0,children:[(0,S.jsx)("div",{className:"wp-claim-grabber","aria-hidden":!0,children:(0,S.jsx)("span",{})}),(0,S.jsxs)("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:(0,S.jsx)(ns,{})}),(0,S.jsxs)("div",{className:"wp-claim-copy",children:[(0,S.jsx)("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),(0,S.jsx)("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),(0,S.jsx)("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:(0,S.jsxs)("div",{className:"wp-claim-list-item",children:[(0,S.jsx)("span",{children:"Tx Hash"}),(0,S.jsxs)("button",{type:"button",className:"wp-claim-hash",onClick:g,"aria-label":"Copy transaction hash",children:[(0,S.jsx)("strong",{children:rs(i)}),l?(0,S.jsx)(ts,{}):(0,S.jsx)(es,{})]})]})})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"wp-claim-heading",children:[(0,S.jsx)("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:t==="error"?"Withdraw Failed":"Withdraw"}),t==="error"&&(0,S.jsx)("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),n.length>1&&(0,S.jsx)("div",{className:"wp-withdraw-token-list",role:"listbox","aria-label":"Withdrawable tokens",children:n.map(F=>{let ne=F.poolAddress.toLowerCase()===C.poolAddress.toLowerCase();return(0,S.jsxs)("button",{type:"button",role:"option","aria-selected":ne,className:"wp-withdraw-token","data-selected":ne||void 0,disabled:j,onClick:()=>te(F),children:[(0,S.jsx)("span",{className:"wp-withdraw-token-icon","aria-hidden":!0,children:(0,S.jsx)(vs,{position:F,size:28})}),(0,S.jsx)("span",{className:"wp-withdraw-token-symbol",children:F.tokenSymbol}),(0,S.jsx)("span",{className:"wp-withdraw-token-amount",children:Nt(F.depositedRaw,F.decimals)})]},F.poolAddress)})}),(0,S.jsxs)("div",{className:"wp-claim-reward-card","aria-label":"Deposited balance",children:[(0,S.jsx)("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:(0,S.jsx)(vs,{position:C,size:28})}),(0,S.jsx)("strong",{className:"wp-claim-reward-symbol",children:C.tokenSymbol}),(0,S.jsx)("strong",{className:"wp-claim-reward-amount",children:De})]}),(0,S.jsxs)("div",{className:"wp-withdraw-amount-card",children:[(0,S.jsxs)("div",{className:"wp-withdraw-amount-row",children:[(0,S.jsx)("input",{className:"wp-withdraw-input",type:"text",inputMode:"decimal",autoComplete:"off",placeholder:"0",value:x,disabled:j,onChange:H,"aria-label":`Withdraw amount (${C.tokenSymbol})`,"aria-invalid":B||void 0}),(0,S.jsx)("span",{className:"wp-withdraw-input-symbol",children:C.tokenSymbol})]}),B&&(0,S.jsx)("p",{className:"wp-claim-error-message",children:"Amount exceeds deposited balance."}),(0,S.jsxs)("div",{className:"wp-withdraw-quick-row",role:"group","aria-label":"Quick amounts",children:[Bd.map(F=>(0,S.jsxs)("button",{type:"button",className:"wp-withdraw-quick",disabled:j,onClick:()=>ce(F),children:["+",F.toString()]},F.toString())),(0,S.jsx)("button",{type:"button",className:"wp-withdraw-quick",disabled:j,onClick:ve,children:"MAX"})]})]}),(0,S.jsxs)("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[(0,S.jsxs)("div",{className:"wp-claim-account-row",children:[(0,S.jsxs)("div",{className:"wp-claim-account",children:[(0,S.jsx)("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),(0,S.jsxs)("strong",{children:[C.tokenSymbol," Pool"]})]}),(0,S.jsx)("span",{children:Uo(r)})]}),(0,S.jsx)("span",{className:"wp-claim-divider","aria-hidden":!0}),(0,S.jsxs)("div",{className:"wp-claim-detail-list",children:[(0,S.jsxs)("div",{className:"wp-claim-detail-row",children:[(0,S.jsx)("span",{children:"Est. Tx Fee"}),(0,S.jsx)("strong",{children:_d(b,R)})]}),(0,S.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,S.jsx)("span",{children:"Priority Fee Per Gas"}),(0,S.jsx)("strong",{children:$r(pe,"Gwei",R)})]}),(0,S.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,S.jsx)("span",{children:"Max Fee Per Gas"}),(0,S.jsx)("strong",{children:$r(ue,"Gwei",R)})]}),(0,S.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,S.jsx)("span",{children:"Gas Limit"}),(0,S.jsx)("strong",{children:$r(V,"",R)})]})]})]})]}),(0,S.jsxs)("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&(0,S.jsx)("button",{type:"button",className:"wp-claim-secondary",onClick:c,children:t==="error"?"Close":"Cancel"}),(0,S.jsxs)("button",{type:"button",className:"wp-claim-primary",onClick:()=>{if(t==="success"){c();return}C&&z!==null&&z>0n&&!B&&f(C,z,b)},disabled:j||(t==="confirm"||t==="error")&&(z===null||z<=0n||B),children:[t==="success"&&"Done",t==="submitting"&&(0,S.jsx)("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),(0,S.jsx)("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:(0,S.jsx)("span",{})})]})})}var Pe=G(require("react"),1),Rs=require("@tanstack/react-query");var ys=require("@tanstack/react-query");var Md="wp:reward-factory-info";function ks(e,t=!0){let{data:n,...o}=(0,ys.useQuery)({queryKey:[Md,e],queryFn:async({signal:r})=>{let i=await se("gameReward",e),a=await fetch(`${i}/v1/factory/info`,{cache:"no-store",signal:r});if(!a.ok)throw new Error(`Factory info fetch failed: ${a.status}`);let l=await a.json();if(l.code!==200)throw new Error(`Factory info API error: ${l.code}`);return l},enabled:t,staleTime:0});return{factoryInfo:n?.data??null,routerAddress:n?.data.router_address??"",...o}}var Od="wp:";function Ss(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Ko(){let{env:e,walletAddress:t,sendTransaction:n,estimateGas:o}=qe(),r=!!t,i=!!n,a=(0,Rs.useQueryClient)(),{routerAddress:l}=ks(e,r&&i),d=Ss(l),[c,f]=Pe.useState(!1),[g,w]=Pe.useState(void 0),[h,x]=Pe.useState("confirm"),[m,b]=Pe.useState(),[y,R]=Pe.useState(""),[u,N]=Pe.useState(!1),k=Pe.useRef(void 0);Pe.useEffect(()=>()=>clearTimeout(k.current),[]);let T=Pe.useCallback((I,te)=>d?{to:d,value:0n,data:is(I,te),chainId:Ne[e].cross}:null,[e,d]),C=Pe.useCallback(()=>{a.invalidateQueries({predicate:I=>typeof I.queryKey[0]=="string"&&I.queryKey[0].startsWith(Od)})},[a]),$=Pe.useCallback(I=>{w(I),f(!0),x("confirm"),b(void 0),R(""),N(!1)},[]),D=Pe.useCallback(()=>{h!=="submitting"&&(f(!1),w(void 0),x("confirm"),b(void 0),R(""),N(!1),h==="success"&&C())},[h,C]),z=Pe.useCallback(async(I,te)=>{if(!o)return null;let H=T(I.poolId,te),Y=Ss(t);return!H||!Y?null:o({...H,from:Y})},[T,o,t]),B=Pe.useCallback(async()=>{if(!(!m||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(m),N(!0),clearTimeout(k.current),k.current=setTimeout(()=>N(!1),1400)}catch{N(!1)}},[m]),ie=Pe.useCallback(async(I,te,H)=>{if(!n){x("error"),R("Withdraw is not available for this wallet.");return}if(!d){x("error"),R("Withdraw contract address is not available.");return}try{x("submitting"),R("");let Y=T(I.poolId,te);if(!Y){x("error"),R("Withdraw contract address is not available.");return}let ce=await n({...Y,gas:H?.gasLimit&&H.gasLimit>0n?H.gasLimit:void 0,maxFeePerGas:H?.maxFeePerGas&&H.maxFeePerGas>0n?H.maxFeePerGas:void 0,maxPriorityFeePerGas:H?.maxPriorityFeePerGas&&H.maxPriorityFeePerGas>0n?H.maxPriorityFeePerGas:void 0});b(ce),x("success"),C()}catch(Y){x("error"),R(Y instanceof Error?Y.message:"Failed to request withdraw.")}},[T,C,d,n]);return{canWithdrawInline:i,isOpen:c,initialPoolAddress:g,status:h,txHash:m,error:y,copied:u,hasEstimator:!!o,openWithdraw:$,closeWithdraw:D,estimateWithdraw:z,confirmWithdraw:ie,copyHash:B}}var Qo=G(require("bignumber.js"),1),J=require("react/jsx-runtime"),Wd="CROSS Rewards";function Cs(e){return new Qo.default(e||"0").isGreaterThan(0)}function Ns(){let{env:e,walletAddress:t,onOutlink:n}=qe(),o=!!t,{allPools:r,isLoading:i}=An(e,o),{depositMap:a,isLoading:l}=$o(e,t,o),{getTokenImage:d}=jo(e,o),c=Ko(),{positions:f}=Vo(e,t,o&&c.canWithdrawInline),g=Ts.useMemo(()=>f.filter(m=>m.poolType==="CrossPool").map(m=>({...m,icon:d(m.tokenAddress,m.tokenSymbol)})),[f,d]),w=(m,b)=>`${ps[e]}/rewards/${m.pool_address}?action=${b}`,h=`${Wt[e]}/reward.png`,x=r.filter(m=>{let b=a.get(m.pool_address.toLowerCase()),y=b?.deposited_amount??"0",R=b?.claimable_reward??"0";return!(new Qo.default(y).isZero()&&new Qo.default(R).isZero())});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Dt,{sectionKey:"rewards",title:Wd,icon:h,isEmpty:x.length===0,loading:i||l,children:x.map(m=>{let b=a.get(m.pool_address.toLowerCase()),y=b?.deposited_amount??"0",R=b?.claimable_reward??"0",u=w(m,"withdraw"),N=w(m,"claim"),k=d(m.deposit_token.address,m.deposit_token.symbol),T=m.reward_tokens[0],C=T?d(T.address,T.symbol):"",$=m.reward_tokens.map(ce=>ce.symbol),D=$.length>0?`${m.deposit_token.symbol}-${$.join("/")}`:m.deposit_token.symbol,z=T?Nt(R,T.decimals):"0",B=T?.symbol??"Reward",ie=tn(y,m.deposit_token.decimals,m.deposit_token.price),I=T?tn(R,T.decimals,T.price):null,te=!!b&&Cs(R),H=!!b&&Cs(y),Y=c.canWithdrawInline&&g.some(ce=>ce.poolAddress.toLowerCase()===m.pool_address.toLowerCase());return(0,J.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,J.jsxs)("div",{className:"wp-item-body",children:[(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,J.jsxs)("div",{className:"wp-svc-token",children:[(0,J.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&(0,J.jsx)("img",{className:"wp-svc-token-icon",src:k,alt:""}),C&&(0,J.jsx)("img",{className:"wp-svc-token-icon",src:C,alt:""})]}),(0,J.jsx)("span",{children:D})]})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,J.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&(0,J.jsx)("img",{className:"wp-svc-token-icon",src:k,alt:""}),(0,J.jsxs)("div",{className:"wp-svc-amount",children:[(0,J.jsx)("span",{className:"wp-svc-amount-main",children:Nt(y,m.deposit_token.decimals)}),ie&&(0,J.jsx)("span",{className:"wp-item-usd",children:ie})]})]})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsxs)("span",{className:"wp-item-label",children:["Claimable (",B,")"]}),(0,J.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[C&&(0,J.jsx)("img",{className:"wp-svc-token-icon",src:C,alt:""}),(0,J.jsxs)("div",{className:"wp-svc-amount",children:[(0,J.jsx)("span",{className:"wp-svc-amount-main",children:z}),I&&(0,J.jsx)("span",{className:"wp-item-usd",children:I})]})]})]})]}),(0,J.jsxs)("div",{className:"wp-item-tags",children:[Y?(0,J.jsx)("button",{type:"button",className:"wp-tag wp-tag--muted","data-disabled":!H||void 0,"aria-disabled":!H||void 0,onClick:()=>{H&&c.openWithdraw(m.pool_address)},children:(0,J.jsx)("span",{className:"wp-tag-label",children:"Withdraw"})}):(0,J.jsxs)("a",{className:"wp-tag wp-tag--muted",href:u,target:"_blank",rel:"noopener noreferrer",onClick:ce=>Je(ce,u,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:b}},n),children:[(0,J.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,J.jsx)(Tt,{size:12,className:"wp-tag-icon"})]}),(0,J.jsxs)("a",{className:"wp-tag wp-tag--mint","data-disabled":!te||void 0,"aria-disabled":!te||void 0,href:te?N:void 0,target:te?"_blank":void 0,rel:te?"noopener noreferrer":void 0,onClick:ce=>{if(!te){ce.preventDefault();return}Je(ce,N,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:b}},n)},children:[(0,J.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,J.jsx)(Tt,{size:12,className:"wp-tag-icon"})]})]})]},m.pool_address)})}),(0,J.jsx)(qo,{open:c.isOpen,status:c.status,positions:g,initialPoolAddress:c.initialPoolAddress,walletAddress:t,txHash:c.txHash,error:c.error,copied:c.copied,estimateWithdraw:c.hasEstimator?c.estimateWithdraw:void 0,onClose:c.closeWithdraw,onConfirm:c.confirmWithdraw,onCopyHash:c.copyHash})]})}var Is=G(require("react"),1);var me=require("react/jsx-runtime"),Dd="Points";function Es(){let{env:e,walletAddress:t,onOutlink:n}=qe(),o=!!t,{getTokenImage:r}=jo(e,o),i=Ko(),{positions:a,isLoading:l}=Vo(e,t,o),d=Is.useMemo(()=>a.filter(g=>g.poolType!=="CrossPool").map(g=>({...g,icon:r(g.tokenAddress,g.tokenSymbol)})),[a,r]),c=`${Wt[e]}/point.png`,f=fs[e];return(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(Dt,{sectionKey:"points",title:Dd,icon:c,isEmpty:d.length===0,loading:l,children:d.map(g=>{let w=g.price?tn(g.depositedRaw,g.decimals,g.price):null;return(0,me.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,me.jsxs)("div",{className:"wp-item-body",children:[(0,me.jsxs)("div",{className:"wp-item-line",children:[(0,me.jsx)("span",{className:"wp-item-label",children:"Token"}),(0,me.jsxs)("div",{className:"wp-svc-token",children:[g.icon&&(0,me.jsx)("img",{className:"wp-svc-token-icon",src:g.icon,alt:""}),(0,me.jsx)("span",{children:g.tokenSymbol})]})]}),(0,me.jsxs)("div",{className:"wp-item-line",children:[(0,me.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,me.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[g.icon&&(0,me.jsx)("img",{className:"wp-svc-token-icon",src:g.icon,alt:""}),(0,me.jsxs)("div",{className:"wp-svc-amount",children:[(0,me.jsx)("span",{className:"wp-svc-amount-main",children:Nt(g.depositedRaw,g.decimals)}),w&&(0,me.jsx)("span",{className:"wp-item-usd",children:w})]})]})]})]}),(0,me.jsx)("div",{className:"wp-item-tags",children:i.canWithdrawInline?(0,me.jsx)("button",{type:"button",className:"wp-tag wp-tag--muted",onClick:()=>i.openWithdraw(g.poolAddress),children:(0,me.jsx)("span",{className:"wp-tag-label",children:"Withdraw"})}):(0,me.jsxs)("a",{className:"wp-tag wp-tag--muted",href:f,target:"_blank",rel:"noopener noreferrer",onClick:h=>Je(h,f,{category:"portfolio",origin:"portfolio-points",payload:{position:g}},n),children:[(0,me.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,me.jsx)(Tt,{size:12,className:"wp-tag-icon"})]})})]},g.poolAddress)})}),(0,me.jsx)(qo,{open:i.isOpen,status:i.status,positions:d,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})]})}var Vr=G(require("react"),1);var Ls=require("@tanstack/react-query");var zd="wp:stake-info";function As(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,Ls.useQuery)({queryKey:[zd,e,t],queryFn:async({signal:l})=>{let d=await se("posa",e),c=await fetch(`${d}/stake/${t}`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let f=await c.json();if(f.code!==0&&f.code!==200)throw new Error(`Stake info API error: ${f.code}`);return f},enabled:o,staleTime:0});return{stakeInfo:r?.data,...i}}var Ps=require("@tanstack/react-query");var Gd="wp:stake-rewards",Hd=31;function Bs(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,Ps.useQuery)({queryKey:[Gd,e,t],queryFn:async({signal:a})=>{let l=await se("posa",e),d=await fetch(`${l}/rewards/${t}?limit=${Hd}`,{cache:"no-store",signal:a});if(!d.ok)throw new Error(`Stake rewards fetch failed: ${d.status}`);let c=await d.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:o,staleTime:0});return{latestReward:r?.[0]??null,aprAccrued:os(r),...i}}var Fs=require("@tanstack/react-query"),Ud="wp:staking-onchain";function _s(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...i}=(0,Fs.useQuery)({queryKey:[Ud,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...i}}var jr=require("react"),Ws=G(require("bignumber.js"),1);function Ms(e){return e?.trim().toUpperCase()==="CROSS"}function Os(e){return new Ws.default(e||"0").isGreaterThan(0)}function Yo(e,t,n=!0){let{allPools:o}=An(e,n),r=(0,jr.useMemo)(()=>{for(let c of o)for(let f of[c.deposit_token,...c.reward_tokens])if(Ms(f?.symbol)&&Os(f.price))return f.price},[o]),i=n&&r===void 0,{tokens:a}=qt(e,t,i),{statsMap:l}=Kt(e,i),d=Ne[e].cross;return(0,jr.useMemo)(()=>{if(r)return r;let c=a.find(f=>f.chainId===d&&Ms(f.symbol));if(c){let f=l.get(Ct(c.chainId,c.address));if(f&&Os(f.price))return f.price}return"0"},[r,a,l,d])}var Qt=G(require("bignumber.js"),1),Re=require("react/jsx-runtime"),$d="CROSS Staking";function jd(e){if(!e)return"\u2014";let t=new Qt.default(e);return t.isFinite()?`${t.toFormat(2,Qt.default.ROUND_DOWN)}%`:"\u2014"}function Ds(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=qe(),r=!!t,{stakeInfo:i,isLoading:a}=As(e,t,r),{latestReward:l,aprAccrued:d,isLoading:c}=Bs(e,t,r),{onchain:f}=_s(t,o,r),g=Yo(e,t,r),w=`${Wt[e]}/cross-staking.png`,h=ms[e],x=i?.total_stake??"0",m=Vr.useMemo(()=>f?new Qt.default(f.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??i?.rewards_earned??"0",[f,l,i]),b=Vr.useMemo(()=>f?new Qt.default(f.stakedWei.toString()).shiftedBy(-18):new Qt.default(x),[f,x]),y=d!==void 0?new Qt.default(d):void 0,R=i?.days_since_first_stake,u=y!==void 0&&y.isFinite()&&b.isGreaterThan(0)&&R!==null&&R!==void 0?y.div(b).times(365).div(Math.max(1,R)).times(100):void 0,N=!(new Qt.default(x).isZero()&&new Qt.default(m).isZero()),k=tn(x,0,g),T=tn(m,0,g);return(0,Re.jsx)(Dt,{sectionKey:"staking",title:$d,icon:w,iconFit:"contain",isEmpty:!N,loading:a||c,children:(0,Re.jsxs)("article",{className:"wp-item","data-side":"stake",children:[(0,Re.jsxs)("div",{className:"wp-item-body",children:[(0,Re.jsxs)("div",{className:"wp-item-line",children:[(0,Re.jsx)("span",{className:"wp-item-label",children:"Staked"}),(0,Re.jsxs)("div",{className:"wp-svc-amount",children:[(0,Re.jsxs)("span",{className:"wp-svc-amount-main",children:[Dr(x)," CROSS"]}),k&&(0,Re.jsx)("span",{className:"wp-item-usd",children:k})]})]}),(0,Re.jsxs)("div",{className:"wp-item-line",children:[(0,Re.jsx)("span",{className:"wp-item-label",children:"Rewards Earned"}),(0,Re.jsxs)("div",{className:"wp-svc-amount",children:[(0,Re.jsxs)("span",{className:"wp-svc-amount-main",children:[Dr(m)," CROSS"]}),T&&(0,Re.jsx)("span",{className:"wp-item-usd",children:T})]})]}),(0,Re.jsxs)("div",{className:"wp-item-line",children:[(0,Re.jsx)("span",{className:"wp-item-label",children:"My APR"}),(0,Re.jsx)("span",{children:jd(u?.toString(10))})]})]}),(0,Re.jsx)("div",{className:"wp-item-tags",children:(0,Re.jsxs)("a",{className:"wp-tag wp-tag--mint",href:h,target:"_blank",rel:"noopener noreferrer",onClick:C=>Je(C,h,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:i}},n),children:[(0,Re.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,Re.jsx)(Tt,{size:12,className:"wp-tag-icon"})]})})]})})}var qr=G(require("react"),1);var zs=require("@tanstack/react-query");var Vd="wp:game-swap-pools";function Gs(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,zs.useQuery)({queryKey:[Vd,e,t],queryFn:async({signal:a})=>{let l=await se("gameSwap",e),d=await fetch(`${l}/addresses/${t}/portfolio`,{cache:"no-store",signal:a});if(!d.ok)throw new Error(`Game-swap portfolio fetch failed: ${d.status}`);return(await d.json()).pools??[]},enabled:o,staleTime:0});return{pools:r??[],...i}}var Hs=require("@tanstack/react-query");var qd="wp:game-swap-lp-balances";function Us(e,t,n,o){let r=[...n].map(d=>d.toLowerCase()).sort(),i=!!t&&r.length>0,{data:a,...l}=(0,Hs.useQuery)({queryKey:[qd,e,t,r,!!o],queryFn:async({signal:d})=>{let c=o?await o(r):await ws(e,t,r,d),f={};for(let[g,w]of Object.entries(c))f[g.toLowerCase()]=w;return f},enabled:i,staleTime:0});return{balances:a??{},...l}}var It=G(require("bignumber.js"),1),he=require("react/jsx-runtime"),Kd="Gametoken LP",js=18,Qd=new It.default("0.0001");function $s(e){return e?.trim().toUpperCase()==="CROSS"}function Yd(e){return e&&e>0?e:js}function Zd(e){let t=$s(e.token_a?.symbol)&&!$s(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=Yd(t?e.token_a?.decimals:e.token_b?.decimals),r=new It.default(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new It.default(0):r.times(2)}function Xd(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??js,i,a;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let l=new It.default(t.balance.toString()),d=new It.default(t.totalSupply.toString()),c=l.div(d);i=c.times(100);let f=c.times(Zd(e));if(f.isGreaterThan(0)){let g=new It.default(e.quote_usd??e.cross_usd??"0");a=g.isGreaterThan(0)?`$${f.times(g).toFormat(2,It.default.ROUND_DOWN)}`:`${f.toFormat(4,It.default.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:i,valueText:a}}function Vs(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=qe(),r=!!t,{pools:i,isLoading:a}=Gs(e,t,r),l=qr.useMemo(()=>i.map(x=>x.pair_address).filter(Boolean),[i]),{balances:d,isLoading:c}=Us(e,t,l,o),f=`${Wt[e]}/dex.png`,g=Object.keys(d).length>0,w=qr.useMemo(()=>{let x=i.map(m=>Xd(m,d[m.pair_address?.toLowerCase()]));return g?x.filter(m=>m.lpAmountRaw?new It.default(m.lpAmountRaw).shiftedBy(-m.lpDecimals).isGreaterThanOrEqualTo(Qd):!1):x},[i,d,g]),h=x=>{let m=x.token_a?.address??x.pair_address;return`${gs[e]}/tokens/${m}?trade=deposit`};return(0,he.jsx)(Dt,{sectionKey:"gameSwap",title:Kd,icon:f,iconFit:"contain",isEmpty:w.length===0,loading:a||c,children:w.map(x=>{let{pool:m}=x,b=h(m),y=`${x.tokenASymbol} / ${x.tokenBSymbol}`,R=m.token_a?.logo_url,u=m.token_b?.logo_url;return(0,he.jsxs)("article",{className:"wp-item","data-side":"game-swap",children:[(0,he.jsxs)("div",{className:"wp-item-body",children:[(0,he.jsxs)("div",{className:"wp-item-line",children:[(0,he.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,he.jsxs)("div",{className:"wp-svc-token",children:[(0,he.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[R&&(0,he.jsx)("img",{className:"wp-svc-token-icon",src:R,alt:""}),u&&(0,he.jsx)("img",{className:"wp-svc-token-icon",src:u,alt:""})]}),(0,he.jsx)("span",{children:y})]})]}),x.lpAmountRaw!==void 0&&(0,he.jsxs)("div",{className:"wp-item-line",children:[(0,he.jsx)("span",{className:"wp-item-label",children:"My LP"}),(0,he.jsxs)("span",{children:[Nt(x.lpAmountRaw,x.lpDecimals)," LP"]})]}),x.sharePercent!==void 0&&(0,he.jsxs)("div",{className:"wp-item-line",children:[(0,he.jsx)("span",{className:"wp-item-label",children:"Pool Share"}),(0,he.jsxs)("span",{children:[x.sharePercent.toFormat(2,It.default.ROUND_DOWN),"%"]})]}),x.valueText!==void 0&&(0,he.jsxs)("div",{className:"wp-item-line",children:[(0,he.jsx)("span",{className:"wp-item-label",children:"Value"}),(0,he.jsx)("span",{children:x.valueText})]})]}),(0,he.jsx)("div",{className:"wp-item-tags",children:(0,he.jsxs)("a",{className:"wp-tag wp-tag--mint",href:b,target:"_blank",rel:"noopener noreferrer",onClick:N=>Je(N,b,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:m}},n),children:[(0,he.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,he.jsx)(Tt,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}var Yt=G(require("bignumber.js"),1),Xs=require("react");var qs=require("@tanstack/react-query");var Jd="wp:forge-pools";function Ks(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,qs.useQuery)({queryKey:[Jd,e,t],queryFn:async()=>{let l=await se("bondingCurve",e),d=await fetch(`${l}/v1/users/${t}/pools`,{cache:"no-store"});if(!d.ok)throw new Error(`forge pools fetch failed: ${d.status}`);return(await d.json()).data?.items??[]},enabled:o,staleTime:0}),a=r??[];return{pools:a,isEmpty:a.length===0,...i}}var Qs=require("@tanstack/react-query"),Ys=require("react");var ep="wp:forge-token-detail";async function tp(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Zs(e,t,n=!0){let o=(0,Qs.useQueries)({queries:t.map(a=>({queryKey:[ep,e,a],queryFn:async()=>tp(await se("bondingCurve",e),a),enabled:n&&!!a,staleTime:3e4}))}),r=(0,Ys.useMemo)(()=>{let a=new Map;for(let l=0;l<o.length;l++){let d=o[l]?.data,c=t[l];d&&c&&a.set(c.toLowerCase(),d)}return a},[o,t]),i=o.some(a=>a.isLoading);return{detailMap:r,isLoading:i}}var xe=require("react/jsx-runtime"),np="Forge",Js=18,op="https://contents.crosstoken.io/wallet/token/images/FT.png";function rp(e){if(!e||e==="0")return"0";let t=new Yt.default(e).shiftedBy(-Js);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Yt.default.ROUND_DOWN):t.toFormat(4,Yt.default.ROUND_DOWN)}function ip(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 ap(e,t,n){let o=new Yt.default(n||"0");if(!o.isGreaterThan(0))return null;let r=new Yt.default(e.total_supply||"0"),i=new Yt.default(e.lp_balance||"0"),a=new Yt.default(t?.reserve_b||"0").shiftedBy(-Js);if(!r.isGreaterThan(0)||!i.isGreaterThan(0)||!a.isGreaterThan(0))return null;let l=a.times(2),c=i.div(r).times(l).times(o);return c.isFinite()?`$${c.toFormat(2,Yt.default.ROUND_DOWN)}`:null}function el(){let{env:e,walletAddress:t,onOutlink:n}=qe(),o=!!t,{pools:r,isEmpty:i,isLoading:a}=Ks(e,t,o),l=(0,Xs.useMemo)(()=>r.map(w=>w.token.address),[r]),{detailMap:d}=Zs(e,l,o&&l.length>0),c=Yo(e,t,o),f=w=>`${us[e]}/forge/token/${w.token.address}`,g=`${Wt[e]}/forge.png`;return(0,xe.jsx)(Dt,{sectionKey:"forge",title:np,icon:g,iconFit:"contain",isEmpty:i,loading:a,children:r.map(w=>{let h=d.get(w.token.address.toLowerCase()),x=h?.image_url||h?.image||w.token.image||op,m=h?.symbol||w.token.symbol,b=f(w),y=ap(w,h,c);return(0,xe.jsxs)("a",{className:"wp-item","data-side":"lp",href:b,target:"_blank",rel:"noopener noreferrer",onClick:R=>Je(R,b,{category:"portfolio",origin:"portfolio-forge",payload:{pool:w,tokenDetail:h}},n),children:[(0,xe.jsxs)("div",{className:"wp-item-body",children:[(0,xe.jsxs)("div",{className:"wp-item-line",children:[(0,xe.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,xe.jsxs)("div",{className:"wp-svc-token",children:[(0,xe.jsx)("img",{className:"wp-svc-token-icon",src:x,alt:""}),(0,xe.jsx)("span",{children:m}),h?.name&&(0,xe.jsx)("span",{className:"wp-token-subtle",children:h.name})]})]}),(0,xe.jsxs)("div",{className:"wp-item-line",children:[(0,xe.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,xe.jsx)("div",{className:"wp-svc-token wp-svc-token--amount",children:(0,xe.jsxs)("div",{className:"wp-svc-amount",children:[(0,xe.jsx)("span",{className:"wp-svc-amount-main",children:rp(w.lp_balance)}),y&&(0,xe.jsx)("span",{className:"wp-item-usd",children:y})]})})]}),(0,xe.jsxs)("div",{className:"wp-item-line",children:[(0,xe.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,xe.jsx)("span",{className:"wp-line-value",children:ip(w.pool_ownership)})]})]}),(0,xe.jsx)("div",{className:"wp-item-tags",children:(0,xe.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,xe.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,xe.jsx)(Tt,{size:12,className:"wp-tag-icon"})]})})]},w.pair_address)})})}var Yn=["rewards","points","staking","gameSwap","forge"];Z(`.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
- `);var K=require("react/jsx-runtime"),Kr=15,sp="wp:";function gn({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:i=!0,variant:a="embed",className:l,onOutlink:d,lpBalanceReader:c,stakingRewardsReader:f,sendTransaction:g,estimateGas:w,sections:h}){let x=Oe(e),m=Ce.useCallback(q=>!h||h.includes(q),[h]),b=!!n,y=(0,tl.useQueryClient)(),[R,u]=Ce.useState({}),N=Ce.useCallback((q,ae)=>{u(be=>{let dt=be[q];return dt&&dt.loading===ae.loading&&dt.empty===ae.empty?be:{...be,[q]:ae}})},[]),k=Ce.useCallback(q=>{u(ae=>{if(!(q in ae))return ae;let be={...ae};return delete be[q],be})},[]),T=Ce.useMemo(()=>({report:N,unregister:k}),[N,k]),[C,$]=Ce.useState(Kr),[D,z]=Ce.useState(!1),[B,ie]=Ce.useState(!1),I=Ce.useRef(void 0),te=Ce.useCallback(()=>{y.invalidateQueries({predicate:q=>typeof q.queryKey[0]=="string"&&q.queryKey[0].startsWith(sp)})},[y]),H=Ce.useCallback(()=>{te(),z(!0),setTimeout(()=>z(!1),600),$(Kr)},[te]);Ce.useEffect(()=>{if(!b)return;let q=setInterval(()=>{$(ae=>ae<=1?(H(),Kr):ae-1)},1e3);return()=>clearInterval(q)},[b,H]);let Y=Ce.useCallback(()=>{r?.()},[r]),ce=b?Vt(x,n,{size:64}):void 0,ve=Ce.useCallback(async()=>{if(!(B||!n))try{await navigator.clipboard.writeText(n),ie(!0),clearTimeout(I.current),I.current=setTimeout(()=>ie(!1),2e3)}catch{}},[n,B]);Ce.useEffect(()=>()=>clearTimeout(I.current),[]);let j=Ce.useMemo(()=>({env:x,theme:t,open:!0,walletAddress:n,close:Y,onOutlink:d,lpBalanceReader:c,stakingRewardsReader:f,sendTransaction:g,estimateGas:w}),[x,t,n,Y,d,c,f,g,w]),pe=Yn.filter(m),ue=pe.length>0&&pe.every(q=>{let ae=R[q];return!!ae&&!ae.loading}),V=ue&&pe.every(q=>R[q]?.empty),De=pe.some(q=>{let ae=R[q];return!!ae&&!ae.empty}),F=pe.length>0&&!ue&&!De,ne=(0,K.jsxs)(K.Fragment,{children:[i&&(0,K.jsxs)("div",{className:"wp-header",children:[(0,K.jsxs)("div",{className:"wp-header-account",children:[r&&(0,K.jsx)("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:r,children:(0,K.jsx)(Xa,{})}),(0,K.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:ce&&(0,K.jsx)("img",{src:ce,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&(0,K.jsxs)("div",{className:"wp-header-account-meta",children:[o&&(0,K.jsx)("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&(0,K.jsxs)("button",{type:"button",className:"wp-header-address-btn",onClick:ve,"aria-label":"Copy wallet address",children:[(0,K.jsx)("span",{className:"wp-header-address",children:Uo(n)}),(0,K.jsx)("span",{className:"wp-header-address-copy","data-copied":B,children:B?(0,K.jsx)(ln,{size:14}):(0,K.jsx)(Hn,{size:14})})]})]})]}),(0,K.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio",onClick:H,children:[(0,K.jsx)(Ja,{className:D?"wp-spin-once":void 0}),b&&(0,K.jsx)("span",{className:"wp-refresh-badge",children:C})]})]}),(0,K.jsx)("div",{className:"wp-body",children:(0,K.jsxs)("div",{className:"wp-body-inner","data-empty":V||void 0,children:[m("rewards")&&(0,K.jsx)(Ns,{}),m("points")&&(0,K.jsx)(Es,{}),m("staking")&&(0,K.jsx)(Ds,{}),m("gameSwap")&&(0,K.jsx)(Vs,{}),m("forge")&&(0,K.jsx)(el,{}),F&&(0,K.jsx)("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:(0,K.jsx)("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),V&&(0,K.jsxs)("div",{className:"wp-portfolio-empty",role:"status",children:[(0,K.jsx)("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:(0,K.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,K.jsx)("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),(0,K.jsx)("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),(0,K.jsx)("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),(0,K.jsx)("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),(0,K.jsx)("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across CROSS services will appear here."})]})]})})]});return(0,K.jsx)(qn.Provider,{value:j,children:(0,K.jsx)(Or.Provider,{value:T,children:a==="none"?ne:(0,K.jsx)("div",{className:fe(a==="fullscreen"?"wp-fullscreen":"wp-embed",l),"data-theme":t,children:ne})})})}var hn=require("react/jsx-runtime");function nl({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:l}=qe();return(0,hn.jsxs)(Zn.Drawer.Portal,{children:[(0,hn.jsx)(Zn.Drawer.Overlay,{className:"wp-overlay"}),(0,hn.jsxs)(Zn.Drawer.Content,{className:fe("wp-fullscreen",e),"data-theme":n,children:[(0,hn.jsx)(Zn.Drawer.Title,{className:"wp-sr-only",children:"Portfolio"}),(0,hn.jsx)(gn,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:l})]})]})}var Qr=require("react/jsx-runtime");function lp({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:l,sendTransaction:d,estimateGas:c,children:f}){let g=Oe(e),w=o!==void 0,[h,x]=bn.useState(!1),m=w?o:h,b=bn.useCallback(u=>{w||x(u),r?.(u)},[w,r]),y=bn.useCallback(()=>b(!1),[b]),R=bn.useMemo(()=>({env:g,theme:t,open:m,walletAddress:n,close:y,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:l,sendTransaction:d,estimateGas:c}),[g,t,m,n,y,i,a,l,d,c]);return(0,Qr.jsx)(qn.Provider,{value:R,children:(0,Qr.jsx)(ol.Drawer.Root,{direction:"bottom",open:m,onOpenChange:b,noBodyStyles:!0,children:f})})}var Yr=Object.assign(lp,{Trigger:Ya,Content:nl});var L=G(require("react"),1),wn=require("react-dom"),Lt=G(require("bignumber.js"),1);var et=require("react/jsx-runtime");function rl({size:e=20,className:t}){return(0,et.jsxs)("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:[(0,et.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),(0,et.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function il({size:e=16,className:t}){return(0,et.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,et.jsx)("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 al({size:e=16,className:t}){return(0,et.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,et.jsx)("path",{d:"M2.667 4h4M9.333 4h4M6.667 2.667v2.666M2.667 12h4M9.333 12h4M9.333 10.667v2.666M2.667 8h1.666M7 8h6.333M4.333 6.667v2.666",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function sl({size:e=20,className:t}){return(0,et.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,et.jsx)("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ll({size:e=16,className:t}){return(0,et.jsx)("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:(0,et.jsx)("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function cl({size:e=12,className:t}){return(0,et.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,et.jsx)("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"})})}var P=G(require("react"),1);var Zr=G(require("bignumber.js"),1);function dl(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function pl(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,Zr.default.ROUND_DOWN).toFixed()}function cp(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 dp(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new Zr.default(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:dl(t)&&dl(n)?e.lastChangedBy==="to"?{fromAmount:pl(r.multipliedBy(n).dividedBy(t))}:{toAmount:pl(r.multipliedBy(t).dividedBy(n))}:cp(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function fl({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):dp(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var ul=15,pp=18,bl="cross_bridge_terms_accepted",fp=3600*24*365;function up(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,ul);let r=t.slice(0,o).slice(0,ul),i=t.slice(o+1).slice(0,pp);return`${r}.${i}`}function mp(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${bl}=true`)}function gp(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${bl}=true`,"Path=/",`Max-Age=${fp}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function hp(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 ml(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function bp(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([ml(e.symbol),ml(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function Et(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Zo(e){return e[0]}function Xr(e,t,n,o){if(n&&!Et(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??Zo(e);let i=e.findIndex(l=>Et(l,t)),a=i>=0?e[i+1]:void 0;return a&&!Et(a,t)?a:e.find(l=>!Et(l,t))??t}function gl({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 Xo(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),...Xo(n.cause,t+1),...Xo(n.data,t+1),...Xo(n.error,t+1)]}function Jr(e){let t=Xo(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 hl(e,t){return Jr(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
9
- `)[0]?.trim()||t}function wl(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:i,approveBridge:a,history:l=[],initialSlippage:d="1",termsUrl:c=Nn,getQuote:f,submitBridge:g,onSubmitted:w,onSuccess:h,onFailed:x,onExit:m}=e,b=P.useMemo(()=>fl({getQuote:f,submitBridge:g}),[f,g]),[y,R]=P.useState("form"),[u,N]=P.useState(n??Zo(t)),[k,T]=P.useState(()=>Xr(t,n??Zo(t),o,r)),[C,$]=P.useState(""),[D,z]=P.useState(""),[B,ie]=P.useState("from"),[I,te]=P.useState(d),[H,Y]=P.useState(null),ce=P.useMemo(()=>bp(u,k),[u,k]),ve=P.useMemo(()=>ce?"1":I==="auto"?hp(H?.priceImpact):I,[ce,I,H?.priceImpact]),[j,pe]=P.useState(""),[ue,V]=P.useState("idle"),[De,F]=P.useState(""),[ne,q]=P.useState(null),[ae,be]=P.useState([]),[dt,ht]=P.useState(!1),[nt,Ht]=P.useState(mp),[ze,Ie]=P.useState(null),[pt,Ge]=P.useState(!1),[$e,Ee]=P.useState(null),[At,bt]=P.useState(null),[Pt,ot]=P.useState(!1),[Bt,rt]=P.useState(!1),Le=P.useRef(0),it=P.useRef(null),ft=P.useCallback(()=>{it.current&&(clearTimeout(it.current),it.current=null)},[]),Ke=P.useCallback(_=>{ft(),bt(_)},[ft]);P.useEffect(()=>ft,[ft]),P.useEffect(()=>{let _=t.find(Ye=>Et(Ye,u))??Zo(t),Me=_?r?.(_,t):void 0,Q=Me?.find(Ye=>Et(Ye,k))??(Me?void 0:t.find(Ye=>Et(Ye,k)))??Xr(t,_,void 0,r);N(_),T(Q)},[r,t,u,k]);let wt=P.useCallback((_,Me)=>{let Q=up(_);if(!Q){Le.current+=1,$(""),z(""),ie(Me),Y(null),pe(""),V("idle");return}Me==="from"?$(Q):z(Q),ie(Me),pe("")},[]),Te=P.useCallback(()=>{Le.current+=1,$(""),z(""),ie("from"),Y(null),pe(""),F(""),V("idle"),Ie(null),Ge(!1),Ee(null),ot(!1),Ke(null)},[Ke]),Fe=P.useCallback(_=>{Et(_,u)||(N(_),T(Xr(t,_,void 0,r)),Te())},[u,r,Te,t]),Ft=P.useCallback(_=>{Et(_,k)||Et(_,u)||(T(_),Te())},[u,Te,k]),xt=P.useMemo(()=>u?r?.(u,t)??t.filter(_=>!Et(_,u)):[],[u,r,t]),Qe=P.useCallback(()=>{u?.balance&&wt(u.balance,"from")},[u?.balance,wt]),ut=P.useCallback(()=>{!u||!k||(N(k),T(u),Te())},[u,Te,k]),vt=P.useCallback(()=>{Le.current+=1,$(""),z(""),ie("from"),Y(null),pe(""),F("")},[]);P.useEffect(()=>{if(!u||!k)return;if(!C&&!D){Y(null),pe(""),V(Q=>Q==="quoting"?"idle":Q);return}let _=++Le.current,Me=gl({fromToken:u,toToken:k,fromAmount:C,toAmount:D,lastChangedBy:B,slippage:I});V(Q=>Q==="submitting"?Q:b.canQuote?"quoting":"idle"),(async()=>{try{let Q=await b.getQuote(Me);if(Le.current!==_)return;Q.fromAmount!==void 0&&B==="to"&&$(Q.fromAmount),Q.toAmount!==void 0&&B==="from"&&z(Q.toAmount),Y(Q.summary??null),pe(Q.error??"")}catch(Q){if(Le.current!==_)return;pe(Q instanceof Error?Q.message:"Failed to quote bridge.")}finally{Le.current===_&&V(Q=>Q==="quoting"?"idle":Q)}})()},[C,u,B,b,I,D,k]);let _e=P.useCallback(()=>!u||!k?null:gl({fromToken:u,toToken:k,fromAmount:C,toAmount:D,lastChangedBy:B,slippage:ve}),[ve,C,u,B,D,k]),He=P.useCallback(async(_,Me)=>{F(""),ot(!1),Ge(!1),V("submitting");try{if(!Me?.skipApprovalCheck&&i){let Ye=await i(_);if(Ye){Ie(Ye),Ee(_),V("idle");return}}Ie(null),Ee(null),Ke("processing");let Q=await b.submitBridge(_);q(Q),V("success"),be(Ye=>[{id:Q.txHash,timestamp:new Date().toISOString(),txHash:Q.txHash,fromToken:Q.fromToken,toToken:Q.toToken,fromAmount:Q.fromAmount,toAmount:Q.toAmount,summary:H??void 0,status:"pending"},...Ye.filter(mt=>mt.txHash!==Q.txHash)]),vt(),rt(!0),Ke(null),ot(!0),w?.(Q),h?.(Q)}catch(Q){if(Ke(null),Jr(Q)){V("idle");return}let Ye=hl(Q,"Failed to submit bridge.");F(Ye),V("error"),x?.({message:Ye})}},[i,x,w,h,b,vt,Ke,H]),E=P.useCallback(async()=>{if(j)return;let _=_e();if(_){if(!nt){Ee(_),ht(!0);return}await He(_)}},[_e,j,He,nt]),oe=P.useCallback(async()=>{let _=$e??_e();_&&(gp(),Ht(!0),ht(!1),await He(_))},[_e,$e,He]),Se=P.useCallback(()=>{ht(!1),Ee(null)},[]),at=P.useCallback(async()=>{if(!(ue==="submitting"||!ze||!$e||!a)){F(""),V("submitting");try{await a($e,ze),Ie(null),V("idle"),Ge(!0)}catch(_){if(Jr(_)){V("idle");return}let Me=hl(_,"Failed to approve token.");F(Me),V("error"),x?.({message:Me})}}},[ze,a,x,$e,He,ue]),Ut=P.useCallback(()=>{ue!=="submitting"&&(Ie(null),Ge(!1),Ee(null),V("idle"))},[ue]),st=P.useCallback(async()=>{if(ue==="submitting")return;let _=$e??_e();if(!_){Ge(!1),F("Bridge input is no longer available. Please try again."),V("error");return}Ge(!1),await He(_,{skipApprovalCheck:!0})},[_e,$e,He,ue]),yn=P.useCallback(()=>{ot(!1)},[]),$t=P.useCallback(_=>{R(_),_==="history"&&rt(!1)},[]),kn=P.useCallback(()=>{if(y==="history"){$t("form");return}m?.()},[m,$t,y]),po=P.useMemo(()=>[...l,...ae.filter(_=>!l.some(Me=>Me.txHash===_.txHash))],[l,ae]);return{step:y,setStep:$t,status:ue,error:De,quoteError:j,fromToken:u,toToken:k,tokens:t,availableToTokens:xt,fromAmount:C,toAmount:D,lastChangedBy:B,slippage:I,effectiveSlippage:ve,slippageLocked:ce,setSlippage:te,summary:H,history:po,submitted:ne,canSubmit:b.canSubmit,termsOpen:dt,approvalInfo:ze,approvalSuccessOpen:pt,approveBridge:a,pendingSubmitInput:$e,submitToast:At,successDialogOpen:Pt,dismissSuccessDialog:yn,hasNewHistory:Bt,termsUrl:c,setFromToken:N,setToToken:T,selectFromToken:Fe,selectToToken:Ft,setAmount:wt,setMax:Qe,swapTokens:ut,submit:E,confirmTerms:oe,cancelTerms:Se,confirmApproval:at,cancelApproval:Ut,continueAfterApproval:st,back:kn}}Z(`.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
- `);var s=require("react/jsx-runtime"),Rl=L.createContext(void 0);function Pn(){return L.useContext(Rl)}function wp(e){let[t,n]=L.useState(void 0);return L.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 xl=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],xp=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function vp(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function vl(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 yp(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Cl(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function yl(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 kp(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 Sp(e,t){if(!t)return!1;let n=new Lt.default(e||"0"),o=new Lt.default(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function Rp(e){if(e.priceUsd===void 0)return null;let t=new Lt.default(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function Cp(e){if(e.priceUsd===void 0)return null;let t=new Lt.default(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,Lt.default.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),i=new Lt.default(o||"0").toFormat(0);return r?`${i}.${r}`:i}function Tp(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function Np(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 Ip(e){let t=new Lt.default(e||"0");return!t.isFinite()||t.isNaN()?e||"0":Tl(t)}function Ep(e,t){if(t?.priceUsd===void 0)return null;let n=new Lt.default(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function er(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function Lp(e,t){return t==="all"?!0:er(e)===t}function Ap(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function kl(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 Il(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":Nl(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function El(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Jo(e){return!e||e==="0"||Number(e)===0}function Pp(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 Bp(e){let t=e.fromToken,n=e.toToken,o=Il(t,n),r=e.fromAmount||"0",i=e.toAmount||"0",a=o!==void 0&&!El(o),l=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:a?[{label:"Route",value:t&&n?`${kl(t.chainId)} \u2192 ${kl(n.chainId)}`:"-"},{label:"Validator Fee",value:Jo(r)?"0":"Free",tone:Jo(r)?"default":"accent"},{label:"Network Fee",value:Jo(r)?"0":"Free",tone:Jo(r)?"default":"accent"}]:void 0,swapInfo:l?[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(0,s.jsx)("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?(0,s.jsx)("img",{src:n,alt:"",width:t,height:t,draggable:!1}):(0,s.jsx)("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function Sl({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:i,locked:a=!1}){return(0,s.jsxs)("section",{className:"bf-amount-panel",children:[(0,s.jsxs)("div",{className:"bf-amount-head",children:[(0,s.jsx)("span",{children:e}),(0,s.jsxs)("span",{className:"bf-balance",children:[Cl(t?.balance??"0")," ",t?.symbol??""]})]}),(0,s.jsxs)("div",{className:"bf-amount-main",children:[(0,s.jsxs)("label",{className:"bf-amount-input-wrap",children:[(0,s.jsxs)("span",{className:"bf-sr-only",children:[e," amount"]}),(0,s.jsx)("input",{type:"text",inputMode:"decimal",value:n,onChange:l=>r(l.target.value),placeholder:"0",className:"bf-amount-input"}),(0,s.jsx)("span",{className:"bf-amount-usd",children:o})]}),(0,s.jsxs)("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:[(0,s.jsx)(Xn,{token:t}),(0,s.jsx)("span",{children:t?.symbol??"Select"}),!a&&(0,s.jsx)(dn,{size:16})]})]})]})}function Fp({flow:e,side:t,onClose:n}){let o=L.useId(),[r,i]=L.useState(""),[a,l]=L.useState(null),d=Pn(),c=t==="from"?e.fromToken:e.toToken;L.useEffect(()=>{l(document.body)},[]),L.useEffect(()=>{let h=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n]);let f=L.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),g=L.useMemo(()=>{let h=r.trim().toLowerCase();return h?f.filter(x=>x.symbol.toLowerCase().includes(h)||x.name.toLowerCase().includes(h)):f},[r,f]),w=L.useCallback(h=>{t==="from"?e.selectFromToken(h):e.selectToToken(h),n()},[e,n,t]);return a?(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-token-picker-overlay","data-theme":d,role:"presentation",onMouseDown:h=>{h.target===h.currentTarget&&n()},children:(0,s.jsxs)("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[(0,s.jsx)("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),(0,s.jsxs)("header",{className:"bf-token-picker-head",children:[(0,s.jsx)("h3",{id:o,children:"Select a token"}),(0,s.jsx)("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:(0,s.jsx)(_t,{size:24})})]}),(0,s.jsxs)("label",{className:"bf-token-search",children:[(0,s.jsx)(rl,{size:20}),(0,s.jsx)("span",{className:"bf-sr-only",children:"Search tokens"}),(0,s.jsx)("input",{value:r,onChange:h=>i(h.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),(0,s.jsxs)("div",{className:"bf-token-list",children:[g.map(h=>{let x=Nl(h,c),m=x?Cp(h):Rp(h);return(0,s.jsxs)("button",{type:"button",className:"bf-token-row","data-selected":x?"true":"false",onClick:()=>w(h),children:[(0,s.jsxs)("span",{className:"bf-token-row-left",children:[(0,s.jsx)(Xn,{token:h,size:40}),(0,s.jsxs)("span",{className:"bf-token-meta",children:[(0,s.jsx)("span",{className:"bf-token-symbol",children:h.symbol}),!x&&(0,s.jsx)("span",{className:"bf-token-name",children:h.name})]})]}),(0,s.jsxs)("span",{className:"bf-token-row-right",children:[(0,s.jsxs)("span",{className:"bf-token-balance",children:[Cl(h.balance),x?null:` ${h.symbol}`]}),m&&(0,s.jsx)("span",{className:"bf-token-price",children:m})]})]},yp(h))}),g.length===0&&(0,s.jsx)("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a):null}function _p({flow:e,onClose:t}){let n=L.useId(),[o,r]=L.useState(null),i=xl.find(m=>m.value===e.slippage),[a,l]=L.useState(e.slippage&&!i?e.slippage:""),d=a.trim()!==""&&a.trim()!==".",c=d?Number(a):NaN,f=Number.isFinite(c)&&c>50,g=Number.isFinite(c)&&c>5&&!f,w=m=>{e.setSlippage(m),t()},h=()=>{!d||f||(e.setSlippage(vl(a)),t())};if(L.useEffect(()=>{r(document.body)},[]),L.useEffect(()=>{let m=b=>{b.key==="Escape"&&t()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t]),!o)return null;let x=Pn();return(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-slippage-overlay","data-theme":x,role:"presentation",onMouseDown:m=>{m.target===m.currentTarget&&t()},children:(0,s.jsxs)("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,s.jsxs)("header",{className:"bf-slippage-head",children:[(0,s.jsx)("h3",{id:n,children:"Slippage Settings"}),(0,s.jsx)("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:(0,s.jsx)(_t,{size:24})})]}),(0,s.jsxs)("div",{className:"bf-slippage-body",children:[(0,s.jsx)("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."}),(0,s.jsxs)("div",{className:"bf-slippage-controls",children:[(0,s.jsx)("div",{className:"bf-slippage-presets",children:xl.map(m=>(0,s.jsx)("button",{type:"button",className:"bf-slippage-preset","data-selected":!d&&e.slippage===m.value?"true":"false",onClick:()=>w(m.value),children:m.label},m.value))}),(0,s.jsxs)("label",{className:"bf-slippage-custom","data-selected":d?"true":"false",children:[(0,s.jsx)("span",{className:"bf-sr-only",children:"Custom slippage percent"}),(0,s.jsx)("input",{value:a,onChange:m=>{l(vl(m.target.value))},onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),h())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),(0,s.jsx)("span",{"aria-hidden":"true",children:"%"})]})]}),f?(0,s.jsx)("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):g?(0,s.jsx)("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,d&&(0,s.jsx)("button",{type:"button",className:"bf-slippage-apply",onClick:h,disabled:f,children:"Apply"})]})]})}),o)}function Mp({flow:e}){let t=L.useId(),[n,o]=L.useState(!1),[r,i]=L.useState(null),a=Pn();return L.useEffect(()=>{i(document.body)},[]),L.useEffect(()=>{let l=d=>{d.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!r||!e.termsOpen?null:(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:l=>{l.target===l.currentTarget&&e.cancelTerms()},children:(0,s.jsxs)("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,s.jsx)("h3",{id:t,children:"Agree to Terms of Service"}),(0,s.jsx)("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),(0,s.jsxs)("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[(0,s.jsx)("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,"aria-label":"Agree to Terms of Use",onClick:()=>o(l=>!l),children:(0,s.jsx)("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"})}),(0,s.jsxs)("div",{className:"bf-terms-copy",children:[(0,s.jsx)("span",{className:"bf-terms-label",children:"Agree to Terms of Use"}),e.termsUrl&&(0,s.jsx)("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),(0,s.jsx)("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),(0,s.jsx)("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function Op({value:e,disabled:t=!1}){let[n,o]=L.useState(!1);return(0,s.jsx)("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 Wp({flow:e,approval:t}){let n=L.useId(),[o,r]=L.useState(null),i=Pn();if(L.useEffect(()=>{r(document.body)},[]),L.useEffect(()=>{let d=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e]),!o)return null;let a=e.status==="submitting"||!e.approveBridge,l=e.status==="submitting";return(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",children:(0,s.jsxs)("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,s.jsxs)("h3",{id:n,children:["Approve ",t.token.symbol]}),(0,s.jsx)(Xn,{token:t.token,size:72}),(0,s.jsxs)("div",{className:"bf-approve-address-box",children:[(0,s.jsx)("span",{children:"Token Address"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:t.tokenAddress}),(0,s.jsx)(Op,{value:t.tokenAddress,disabled:l})]})]}),(0,s.jsxs)("div",{className:"bf-action-buttons",children:[(0,s.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),(0,s.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":l,children:[l&&(0,s.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,s.jsx)("span",{children:l?"Approving...":"Approve"})]})]})]})}),o)}function Dp({flow:e}){let t=L.useId(),[n,o]=L.useState(null),r=Pn();if(L.useEffect(()=>{o(document.body)},[]),L.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=l=>{l.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(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:(0,s.jsxs)("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,s.jsx)("h3",{id:t,children:"Approval Success"}),(0,s.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,s.jsxs)("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",(0,s.jsx)("br",{}),"Please continue to the next step."]}),(0,s.jsxs)("div",{className:"bf-action-buttons",children:[(0,s.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:i,children:"Cancel"}),(0,s.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:i,"aria-busy":i,children:[i&&(0,s.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,s.jsx)("span",{children:i?"Continuing...":"Continue"})]})]})]})}),n)}function zp({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,i]=L.useState(!1),a=L.useMemo(()=>{let c=new Lt.default(e||"0"),f=new Lt.default(t||"0");return!c.isFinite()||!f.isFinite()||c.lte(0)||f.lte(0)?null:r?c.dividedBy(f):f.dividedBy(c)},[e,r,t]);if(!a||!n||!o||n.symbol===o.symbol)return null;let l=r?o.symbol:n.symbol,d=r?n.symbol:o.symbol;return(0,s.jsxs)("button",{type:"button",className:"bf-exchange-rate",onClick:()=>i(c=>!c),children:[(0,s.jsxs)("span",{children:["1 ",l]}),(0,s.jsx)(cl,{size:12}),(0,s.jsxs)("span",{children:[Tl(a)," ",d]})]})}function Gp({flow:e}){return e.submitToast?(0,s.jsxs)("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[(0,s.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,s.jsx)("span",{className:"bf-status-spinner"})}),(0,s.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,s.jsx)("strong",{children:"Transaction Processing"}),(0,s.jsx)("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function Hp({message:e}){let[t,n]=L.useState(!1);return L.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:(0,s.jsxs)("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[(0,s.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,s.jsx)("span",{className:"bf-status-error-mark",children:"!"})}),(0,s.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,s.jsx)("strong",{children:"Error"}),(0,s.jsx)("span",{children:e})]})]})}function Up(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 $p({flow:e}){let t=L.useId(),[n,o]=L.useState(null),r=e.submitted,i=Pn();return L.useEffect(()=>{o(document.body)},[]),L.useEffect(()=>{if(!e.successDialogOpen)return;let a=l=>{l.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.successDialogOpen||!r?null:(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:(0,s.jsx)("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:(0,s.jsxs)("div",{className:"bf-success-body",children:[(0,s.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,s.jsxs)("div",{className:"bf-success-copy",children:[(0,s.jsx)("strong",{id:t,children:Up(r.pathType)}),(0,s.jsx)("span",{children:"Please check the results in the history."})]}),(0,s.jsx)("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,l)=>(0,s.jsxs)(L.Fragment,{children:[l>0&&(0,s.jsx)("span",{className:"bf-success-route-arrow",children:"\u2192"}),(0,s.jsx)(ei,{token:a,size:43})]},`${a.symbol}-${l}`))}),(0,s.jsx)("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(0,s.jsx)("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?(0,s.jsx)("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):(0,s.jsx)("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function jp({row:e}){return e.routeTokens&&e.routeTokens.length>0?(0,s.jsx)("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>(0,s.jsxs)(L.Fragment,{children:[n>0&&(0,s.jsx)("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),(0,s.jsx)(ei,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?(0,s.jsxs)("span",{className:"bf-info-value-token",children:[(0,s.jsx)(ei,{token:e.valueToken}),(0,s.jsx)("span",{children:e.value})]}):(0,s.jsx)(s.Fragment,{children:e.value})}function Ll({rows:e}){return!e||e.length===0?null:(0,s.jsx)("div",{className:"bf-info-rows",children:e.map((t,n)=>(0,s.jsxs)("div",{className:"bf-info-row",children:[(0,s.jsxs)("span",{className:"bf-info-label",children:[(0,s.jsx)("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),(0,s.jsx)("span",{children:t.label})]}),(0,s.jsx)("span",{className:"bf-info-value","data-tone":t.tone??"default",children:(0,s.jsx)(jp,{row:t})})]},`${t.label}-${t.value}`))})}function Vp(e,t,n){return e.pathType==="bridge"?"Bridge Info":El(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function qp({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return(0,s.jsx)(s.Fragment,{children:r.map(i=>{let a=i==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?(0,s.jsxs)("div",{className:"bf-info-section",children:[o&&(0,s.jsx)("h4",{children:i==="swap"?"Swap Info":"Bridge Info"}),(0,s.jsx)(Ll,{rows:a})]},i):null})})}function Kp({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=Vp(e,t,n),[i,a]=L.useState(!0),[l,d]=L.useState(!0);return(0,s.jsxs)("div",{className:"bf-details",children:[e.liquidity&&(0,s.jsxs)("section",{className:"bf-liquidity",children:[(0,s.jsxs)("div",{className:"bf-liquidity-head",children:[(0,s.jsx)("span",{children:e.liquidity.label??"Available Liquidity"}),(0,s.jsx)("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),(0,s.jsx)("div",{className:"bf-liquidity-track",children:(0,s.jsx)("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&(0,s.jsxs)("section",{className:"bf-detail-section bf-info-card","data-open":i?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-collapse-head","aria-expanded":i,onClick:()=>a(c=>!c),children:[(0,s.jsx)("h3",{children:r}),(0,s.jsx)(dn,{size:16,className:"bf-collapse-chevron"})]}),i&&(0,s.jsx)("div",{className:"bf-collapse-body",children:(0,s.jsx)(qp,{summary:e})})]}),o&&(0,s.jsxs)("section",{className:"bf-detail-section bf-tx-fee-section","data-open":l?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":l,onClick:()=>d(c=>!c),children:[(0,s.jsx)("h3",{children:"Est. Tx Fee"}),(0,s.jsxs)("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&(0,s.jsx)("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&(0,s.jsx)("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),(0,s.jsx)("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:kp(e.txFeeInfo?.estTxFee??"0")}),(0,s.jsx)(dn,{size:16,className:"bf-collapse-chevron"})]})]}),l&&(0,s.jsx)("div",{className:"bf-collapse-body",children:(0,s.jsx)(Ll,{rows:e.txFee})})]})]})}function Qp({item:e}){let t=er(e),n=Ep(e.fromAmount,e.fromToken);return(0,s.jsxs)("article",{className:"bf-history-item",children:[(0,s.jsxs)("div",{className:"bf-history-item-head",children:[(0,s.jsx)("span",{className:"bf-history-status","data-status":t,children:Ap(t)}),(0,s.jsx)("time",{className:"bf-history-time",dateTime:e.timestamp,children:Np(e.timestamp)})]}),(0,s.jsxs)("div",{className:"bf-history-item-body",children:[(0,s.jsxs)("strong",{className:"bf-history-amount",children:[Ip(e.fromAmount)," ",e.fromToken.symbol]}),(0,s.jsxs)("div",{className:"bf-history-meta",children:[(0,s.jsx)("span",{className:"bf-history-usd",children:n??Tp(e.txHash)}),(0,s.jsxs)("span",{className:"bf-history-route",children:[(0,s.jsxs)("span",{className:"bf-history-route-token",children:[(0,s.jsx)(Xn,{token:e.fromToken,size:16}),(0,s.jsx)("span",{children:e.fromToken.symbol})]}),(0,s.jsx)(ll,{size:16,className:"bf-history-route-arrow"}),(0,s.jsxs)("span",{className:"bf-history-route-token",children:[(0,s.jsx)(Xn,{token:e.toToken,size:16}),(0,s.jsx)("span",{children:e.toToken.symbol})]})]})]})]})]})}function Yp({flow:e}){let[t,n]=L.useState("all"),o=e.history.some(a=>er(a)==="pending"),r=e.history.filter(a=>Lp(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return(0,s.jsxs)("main",{className:"bf-history-body",children:[(0,s.jsx)("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:xp.map(a=>(0,s.jsxs)("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>n(a.value),children:[(0,s.jsx)("span",{children:a.label}),a.value==="pending"&&o&&(0,s.jsx)("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),r.length>0?(0,s.jsx)("div",{className:"bf-history-list",children:r.map(a=>(0,s.jsx)(Qp,{item:a},a.id||a.txHash))}):(0,s.jsx)("div",{className:"bf-empty",children:i})]})}function Zp({flow:e,env:t}){let[n,o]=L.useState(null),[r,i]=L.useState(!1),[a,l]=L.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??Bp(e):null,f=En("apps.json",t,u=>pn(u?.bridgePoweredBy?.url,t)),g=Pp(e.quoteError),w=Sp(e.fromAmount,e.fromToken),h=w?"Insufficient balance":g.from,x=e.quoteError&&!g.from&&!g.to?e.quoteError:"",m=e.error||x,b=e.history.some(u=>er(u)==="pending"),R=(c?.pathType??Il(e.fromToken,e.toToken))!=="bridge";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("main",{className:"bf-body",children:[(0,s.jsxs)("div",{className:"bf-toolbar",children:[(0,s.jsxs)("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[(0,s.jsx)(il,{}),(0,s.jsx)("span",{children:"History"}),(b||e.hasNewHistory)&&(0,s.jsx)("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),R&&(0,s.jsxs)("button",{type:"button",className:"bf-chip",onClick:()=>i(!0),disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[(0,s.jsx)(al,{}),(0,s.jsx)("span",{children:e.slippageLocked?"Auto 1%":vp(e.slippage,e.effectiveSlippage)})]})]}),(0,s.jsxs)("div",{className:"bf-swap-card","data-has-from-error":h?"true":"false",children:[(0,s.jsx)(Sl,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:yl(e.fromAmount,e.fromToken),onAmountChange:u=>e.setAmount(u,"from"),onTokenClick:()=>o("from")}),h&&(0,s.jsx)("div",{className:"bf-field-error",children:h}),(0,s.jsx)("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),l(u=>u+360)},style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:(0,s.jsx)(sl,{size:22})}),(0,s.jsx)(Sl,{label:"To",token:e.toToken,amount:e.toAmount,usd:yl(e.toAmount,e.toToken),onAmountChange:u=>e.setAmount(u,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),g.to&&(0,s.jsx)("div",{className:"bf-field-error",children:g.to})]}),(0,s.jsx)(zp,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&(0,s.jsx)(Kp,{summary:c})]}),(0,s.jsxs)("footer",{className:"bf-footer",children:[(0,s.jsx)("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError||w,children:e.status==="submitting"?"Processing...":"Next"}),f&&(0,s.jsxs)("a",{className:"bf-powered",href:f,target:"_blank",rel:"noreferrer",children:["Powered by ",(0,s.jsx)("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&(0,s.jsx)(Fp,{flow:e,side:n,onClose:()=>o(null)}),r&&(0,s.jsx)(_p,{flow:e,onClose:()=>i(!1)}),(0,s.jsx)(Mp,{flow:e}),e.approvalInfo&&(0,s.jsx)(Wp,{flow:e,approval:e.approvalInfo}),(0,s.jsx)(Dp,{flow:e}),(0,s.jsx)(Gp,{flow:e}),(0,s.jsx)(Hp,{message:e.submitToast?"":m}),(0,s.jsx)($p,{flow:e})]})}function Jn({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let i=L.useMemo(()=>Oe(n),[n]),a=wl({...r,onExit:t}),l=L.useRef(null),d=wp(l),c=a.step==="history"?"History":"Swap & Bridge";return(0,s.jsx)(Rl.Provider,{value:d,children:(0,s.jsxs)("div",{ref:l,className:fe("bf-root",o),"data-view":a.step,"data-status":a.status,children:[(0,s.jsxs)("header",{className:"bf-header",children:[(0,s.jsx)("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:(0,s.jsx)(cn,{size:24})}),(0,s.jsx)("span",{className:"bf-header-title",children:c}),(0,s.jsx)("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:(0,s.jsx)(_t,{size:24})})]}),a.step==="history"?(0,s.jsx)(Yp,{flow:a}):(0,s.jsx)(Zp,{flow:a,env:i})]})})}var p=require("react/jsx-runtime"),Xp="On-ramp is not available in your region.";function ti(e,t,n){let o=Ne[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 Jp(e){return parseInt(e.split(":")[1],10)}function ef(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function tf(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 Pl({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:i,isMobile:a,open:l,drawerDirection:d,modal:c,showBalance:f,showForgeToken:g,showGameToken:w,showQR:h,showBridge:x,qrLogoSrc:m,walletAddress:b,accountName:y,sendAccounts:R,profileImageUrl:u,preferredTokens:N,close:k,onSelectWallet:T,onCopyAddress:C,onBuy:$,onDisconnect:D,disconnectLabel:z,termsUrl:B,termsLabel:ie,privacyUrl:I,privacyLabel:te,portalStyle:H,navContent:Y,navPosition:ce,footerContent:ve,view:j,setView:pe,selectedSendToken:ue,setSelectedSendToken:V,showPortfolio:De,portfolioTitle:F,portfolioSections:ne,showTotalAssets:q,totalAssetsLabel:ae,sendTransaction:be,getTransactionReceipt:dt,estimateGas:ht,onOutlink:nt,lpBalanceReader:Ht,stakingRewardsReader:ze,bridgeTokens:Ie,bridgeHistory:pt,getBridgeQuote:Ge,getBridgeToTokens:$e,getBridgeApproval:Ee,approveBridge:At,submitBridge:bt,onReceive:Pt,onBridge:ot,onSend:Bt,onBuyDisabledMessage:rt,onBridgeDisabledMessage:Le,onSendDisabledMessage:it}=Zt(),[ft,Ke]=W.useState(null),wt=W.useRef(void 0),Te=W.useCallback(v=>{Ke(v),clearTimeout(wt.current),wt.current=setTimeout(()=>Ke(null),4e3)},[]);W.useEffect(()=>()=>clearTimeout(wt.current),[]);let Fe=!!rt,Ft=W.useCallback(()=>{if(Fe){Te(rt);return}let v=$?.();v&&typeof v.then=="function"&&v.catch(()=>{Te(rt??Xp)})},[Fe,rt,$,Te]),xt=!!Le,Qe=!!it,{tokens:ut,isLoading:vt}=qt(r,b,l&&f),{statsMap:_e}=Kt(r,f),{apyPercent:He}=Ua(),{categoryMap:E}=Va(r,f),oe=f&&q,{displayValue:Se,isLowerBound:at,isLoading:Ut}=Ka(r,b,l&&oe),[st,yn]=W.useState(!1),$t=W.useRef(null),[kn,po]=W.useState(0),{holdings:_,isLoading:Me}=Wa(r,b,l&&f&&g),Q=W.useMemo(()=>_.map(v=>v.token),[_]),{imageMap:Ye}=Da(r,Q,g&&_.length>0),mt=W.useMemo(()=>{let v=[],M=[],re=[],Xe=new Map((N??[]).map((de,je)=>[`${Jp(de.chainId)}:${de.address.toLowerCase()}`,je]));for(let de of ut){let je=ti(r,de.chainId,de.symbol)!==void 0,kt=`${de.chainId}:${de.address.toLowerCase()}`,rn=Xe.get(kt),hr=new Bn.default(de.quantity.numeric).shiftedBy(-de.quantity.decimals);if(je)v.push(de);else if(rn!==void 0)M.push(de);else if(hr.isGreaterThan(0)){if(!w&&E.get(_r(de.chainId,de.address))==="game")continue;re.push(de)}}return v.sort((de,je)=>{let kt=ti(r,de.chainId,de.symbol)??99,rn=ti(r,je.chainId,je.symbol)??99;return kt-rn}),M.sort((de,je)=>{let kt=Xe.get(`${de.chainId}:${de.address.toLowerCase()}`)??99,rn=Xe.get(`${je.chainId}:${je.address.toLowerCase()}`)??99;return kt-rn}),re.sort((de,je)=>{let kt=_e.get(Ct(de.chainId,de.address)),rn=_e.get(Ct(je.chainId,je.address)),hr=new Bn.default(de.quantity.numeric).shiftedBy(-de.quantity.decimals).multipliedBy(kt?.price??0);return new Bn.default(je.quantity.numeric).shiftedBy(-je.quantity.decimals).multipliedBy(rn?.price??0).minus(hr).toNumber()}),[...v,...M,...re]},[ut,r,_e,w,E,N]),li=W.useMemo(()=>{if(!g)return[];let v=new Set(ut.map(M=>M.address.toLowerCase()));return[..._].filter(M=>!v.has(M.token.toLowerCase())).sort((M,re)=>{let Xe=new Bn.default(M.value);return new Bn.default(re.value).minus(Xe).toNumber()})},[_,g,ut]),on=W.useRef(!1),[Ze,_n]=W.useState(null),Sn=W.useRef(void 0),ci=Ze?.chainId??ue?.chainId??mt[0]?.chainId??0,{transactionUrl:lr}=No(r,ci,Ze?.txHash,!!(Ze?.txHash&&ci)),yt=W.useCallback(v=>{on.current=!0,pe(v)},[pe]),[oc,cr]=W.useState("recipient"),fo=W.useCallback(()=>{V(null),cr("recipient"),yt("wallet")},[V,yt]),dr=W.useCallback((v,M="recipient")=>{if(Qe){Te(it);return}cr(M),V(v),yt("send")},[Qe,it,Te,V,yt]),pr=En("apps.json",r,v=>pn(v?.gametokenBridge,r)),rc=W.useCallback(()=>{if(xt){Te(Le);return}if(ot){ot();return}pr&&window.open(pr,"_blank","noopener,noreferrer")},[xt,Le,ot,pr,Te]),ic=W.useCallback(v=>{clearTimeout(Sn.current),V(null),yt("wallet"),_n({status:"pending",txHash:v.txHash,chainId:v.chainId,description:`${v.amount} ${v.tokenSymbol} to ${lt(v.recipient)}`})},[V,yt]),ac=W.useCallback(v=>{let M=ue?.chainId;V(null),yt("wallet"),!(!v||!M)&&(_n(re=>({status:"success",txHash:v,chainId:M,description:re?.txHash===v?re.description:"Tap to see your transaction"})),clearTimeout(Sn.current),Sn.current=setTimeout(()=>_n(null),5e3))},[ue?.chainId,V,yt]),sc=W.useCallback(v=>{let M=v.txHash;M&&(_n({status:"error",txHash:M,chainId:v.chainId,description:v.message}),clearTimeout(Sn.current),Sn.current=setTimeout(()=>_n(null),5e3))},[]),Mn=W.useMemo(()=>{if(Pt)return Pt;if(h)return()=>yt("qr")},[Pt,h,yt]),fr=W.useMemo(()=>{if(Bt)return Bt;if(mt.length===0)return;let v=mt[0];return()=>dr(v,"token")},[Bt,mt,dr]),lc=W.useCallback(()=>{if(Qe){Te(it);return}fr?.()},[Qe,it,fr,Te]);W.useEffect(()=>{l||(on.current=!1,cr("recipient"))},[l]);let di=W.useRef(null);W.useEffect(()=>{let v=di.current;if(!v||!a)return;let M=re=>{re.pointerType==="touch"&&re.stopPropagation()};return v.addEventListener("pointerdown",M),()=>v.removeEventListener("pointerdown",M)},[a]);let[Rn,pi]=W.useState(!1),ur=W.useRef(void 0),[On,Wn]=W.useState(!1);W.useEffect(()=>{if(!On)return;let v=()=>Wn(!1),M=Xe=>{Xe.key==="Escape"&&Wn(!1)},re=setTimeout(()=>{document.addEventListener("mousedown",v,!0),document.addEventListener("keydown",M,!0)},0);return()=>{clearTimeout(re),document.removeEventListener("mousedown",v,!0),document.removeEventListener("keydown",M,!0)}},[On]),W.useEffect(()=>{Wn(!1)},[b]),W.useEffect(()=>()=>clearTimeout(ur.current),[]),W.useEffect(()=>()=>clearTimeout(Sn.current),[]),W.useEffect(()=>{let v=$t.current;if(!v||ve===null){po(0);return}let M=()=>{po(v.offsetHeight)};if(M(),typeof ResizeObserver>"u")return;let re=new ResizeObserver(M);return re.observe(v),()=>re.disconnect()},[ve]);let fi=W.useCallback(async()=>{if(!Rn)try{await navigator.clipboard.writeText(b),pi(!0),clearTimeout(ur.current),ur.current=setTimeout(()=>pi(!1),2e3),C?.(b,!0)}catch{C?.(b,!1)}},[b,C,Rn]),uo=W.useCallback(v=>{v.currentTarget.setAttribute("data-loaded","true")},[]),ui=W.useMemo(()=>({background:tf(b)}),[b]),mo=W.useMemo(()=>u||Vt(r,b,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[u,r,b,i]),mr=W.useMemo(()=>ef(Se),[Se]),mi=B||I?(0,p.jsxs)("div",{className:"wi-legal-links",children:[B&&(0,p.jsx)("a",{className:"wi-legal-link",href:B,target:"_blank",rel:"noopener noreferrer",onClick:v=>Je(v,B,{category:"terms",origin:"terms"},nt),children:ie}),B&&I&&(0,p.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),I&&(0,p.jsx)("a",{className:"wi-legal-link",href:I,target:"_blank",rel:"noopener noreferrer",onClick:v=>Je(v,I,{category:"privacy",origin:"privacy"},nt),children:te})]}):null,gi=D?(0,p.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{D(),k()},children:[(0,p.jsx)(zi,{size:16}),(0,p.jsx)("span",{className:"wi-disconnect-label",children:z})]}):null,cc=f&&!Y?(0,p.jsxs)("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[(0,p.jsxs)("button",{type:"button",className:fe("wi-action-card",Fe&&"wi-action-card--dimmed"),onClick:Ft,disabled:!$&&!Fe,"aria-disabled":Fe||void 0,"aria-label":"Buy",children:[(0,p.jsx)(Vi,{size:20}),(0,p.jsx)("span",{children:"Buy"})]}),x?(0,p.jsxs)("button",{type:"button",className:fe("wi-action-card",xt&&"wi-action-card--dimmed"),onClick:rc,"aria-disabled":xt||void 0,"aria-label":"Bridge",children:[(0,p.jsx)(qi,{size:20}),(0,p.jsx)("span",{children:"Bridge"})]}):(0,p.jsxs)("button",{type:"button",className:"wi-action-card",onClick:Mn,disabled:!Mn,"aria-label":"Receive",children:[(0,p.jsx)(Co,{size:20}),(0,p.jsx)("span",{children:"Receive"})]}),(0,p.jsxs)("button",{type:"button",className:fe("wi-action-card",Qe&&"wi-action-card--dimmed"),onClick:lc,disabled:!Qe&&!fr,"aria-disabled":Qe||void 0,"aria-label":"Send",children:[(0,p.jsx)($i,{size:20}),(0,p.jsx)("span",{children:"Send"})]}),De?(0,p.jsxs)("button",{type:"button",className:"wi-action-card",onClick:()=>yt("portfolio"),"aria-label":"View portfolio",children:[(0,p.jsx)(ji,{size:20}),(0,p.jsx)("span",{children:"Portfolio"})]}):x?(0,p.jsxs)("button",{type:"button",className:"wi-action-card",onClick:Mn,disabled:!Mn,"aria-label":"Receive",children:[(0,p.jsx)(Co,{size:20}),(0,p.jsx)("span",{children:"Receive"})]}):null]}):null,dc=(0,p.jsxs)("div",{className:fe("wi-view-inner",on.current&&"wi-view-wallet"),children:[oe&&(0,p.jsxs)("div",{className:"wi-total-section",children:[(0,p.jsxs)("div",{className:"wi-total-head",children:[(0,p.jsx)("span",{className:"wi-total-label",children:ae}),(0,p.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:v=>{v.stopPropagation(),yn(M=>!M)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),yn(M=>!M))},"aria-label":st?"Show balance":"Hide balance",children:st?(0,p.jsx)(Hi,{}):(0,p.jsx)(Gi,{})})]}),(0,p.jsx)("div",{className:"wi-total-body",children:Ut?(0,p.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):(0,p.jsx)("div",{className:"wi-total-value","data-hidden":st||void 0,children:st?(0,p.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,p.jsxs)(p.Fragment,{children:[at&&(0,p.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,p.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,p.jsx)("span",{className:"wi-total-amount",children:mr.main}),mr.decimal&&(0,p.jsx)("span",{className:"wi-total-decimal",children:mr.decimal})]})})})]}),ce==="top"&&(Y?(0,p.jsx)("div",{className:"wi-nav-fixed",children:Y}):cc),f&&(0,p.jsx)("div",{ref:di,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,p.jsxs)("div",{className:"wi-token-list",children:[vt&&Array.from({length:5},(v,M)=>(0,p.jsxs)("div",{className:"wi-skeleton-item",children:[(0,p.jsxs)("div",{className:"wi-skeleton-left",children:[(0,p.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,p.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,p.jsxs)("div",{className:"wi-skeleton-right",children:[(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},M)),!vt&&mt.length===0&&!g&&(0,p.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),mt.map(v=>{let M=_e.get(Ct(v.chainId,v.address)),re=M?parseFloat(M.percent_change_24h):null,Xe=re!==null&&re>=0,de=jn(r,v.chainId),je=ha(v.address);return(0,p.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>dr(v),"aria-label":`Send ${v.symbol}`,children:[(0,p.jsxs)("div",{className:"wi-token-left",children:[(0,p.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,p.jsx)("img",{src:v.icon_url,alt:v.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:uo,onError:kt=>{kt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),de&&(0,p.jsx)("img",{src:de,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:kt=>{kt.currentTarget.style.display="none"}})]}),(0,p.jsxs)("div",{className:"wi-token-info",children:[(0,p.jsxs)("span",{className:"wi-token-name-row",children:[(0,p.jsx)("span",{className:"wi-token-name",children:v.symbol}),je&&He!==null&&(0,p.jsx)("span",{className:"wi-token-apy",children:`APY ${He>=0?"+":"-"}${(He>=0?Math.floor:Math.ceil)(Math.abs(He)*100)/100}%`})]}),M&&(0,p.jsxs)("div",{className:"wi-token-price-row",children:[(0,p.jsx)("span",{className:"wi-token-price",children:Rr(M.price)}),(0,p.jsx)("span",{className:"wi-token-change","data-positive":Xe,"data-zero":re===0||void 0,children:re!==null&&(re===0?"0%":`${Xe?"+":"-"}${(Xe?Math.floor:Math.ceil)(Math.abs(re)*100)/100}%`)})]})]})]}),(0,p.jsxs)("div",{className:"wi-token-right",children:[(0,p.jsx)("span",{className:"wi-token-balance",children:Jt(v.quantity.numeric,v.quantity.decimals)}),M&&(0,p.jsx)("span",{className:"wi-token-value",children:Qi(v.quantity.numeric,v.quantity.decimals,M.price)})]})]},`${v.address}-${v.chainId}`)}),g&&Me&&Array.from({length:3},(v,M)=>(0,p.jsxs)("div",{className:"wi-skeleton-item",children:[(0,p.jsxs)("div",{className:"wi-skeleton-left",children:[(0,p.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,p.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,p.jsxs)("div",{className:"wi-skeleton-right",children:[(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${M}`)),g&&!Me&&!vt&&mt.length===0&&li.length===0&&(0,p.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),g&&li.map(v=>{let M=Ye.get(v.token)||"",re=jn(r,Ne[r].cross);return(0,p.jsxs)("div",{className:"wi-token-item",children:[(0,p.jsxs)("div",{className:"wi-token-left",children:[(0,p.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,p.jsx)("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:uo,onError:Xe=>{Xe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),re&&(0,p.jsx)("img",{src:re,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Xe=>{Xe.currentTarget.style.display="none"}})]}),(0,p.jsxs)("div",{className:"wi-token-info",children:[(0,p.jsx)("span",{className:"wi-token-name",children:v.token_name}),(0,p.jsx)("div",{className:"wi-token-price-row",children:(0,p.jsxs)("span",{className:"wi-token-price",children:[Jt(v.current_price,18)," CROSS"]})})]})]}),(0,p.jsxs)("div",{className:"wi-token-right",children:[(0,p.jsx)("span",{className:"wi-token-balance",children:Jt(v.balance,18)}),(0,p.jsx)("span",{className:"wi-token-value",children:Rr(v.current_value_usd)})]})]},`forge-${v.token}`)})]})}),ce==="bottom"&&Y&&(0,p.jsx)("div",{className:"wi-nav-fixed",children:Y}),gi&&(0,p.jsx)("div",{className:"wi-wallet-disconnect-row",children:gi})]},"wallet"),pc=De?(0,p.jsx)("div",{className:fe("wi-view-inner wi-portfolio-body",on.current&&"wi-view-portfolio"),children:(0,p.jsx)(gn,{env:r,theme:i,walletAddress:b,showHeader:!1,onOutlink:nt,lpBalanceReader:Ht,stakingRewardsReader:ze,sendTransaction:be,estimateGas:ht,sections:ne})},"portfolio"):null,fc=ue?(0,p.jsx)("div",{className:fe("wi-view-inner wi-send-body",on.current&&"wi-view-send"),children:(0,p.jsx)(Vn,{env:r,theme:i,walletAddress:b,accountName:y,accounts:R,initialStep:oc,token:ue,tokens:mt,onTokenChange:V,sendTransaction:be,getTransactionReceipt:dt,estimateGas:ht,getTokenPriceUsd:v=>{let M=_e.get(Ct(v.chainId,v.address));if(!M?.price)return;let re=parseFloat(M.price);return Number.isFinite(re)?re:void 0},onClose:k,onBackToWallet:fo,onSubmitted:ic,onSuccess:ac,onFailed:sc,onOutlink:nt})},"send"):null,uc=W.useMemo(()=>Ie||mt.map(v=>{let M=_e.get(Ct(v.chainId,v.address)),re=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:$n(v.quantity.numeric,v.quantity.decimals),iconUrl:v.icon_url,priceUsd:Number.isFinite(re)?re:void 0}}),[Ie,_e,mt]),mc=(0,p.jsx)("div",{className:fe("wi-view-inner wi-bridge-body",on.current&&"wi-view-send"),children:(0,p.jsx)(Jn,{env:r,walletAddress:b,tokens:uc,history:pt,termsUrl:B,getQuote:Ge,getToTokens:$e,getApproval:Ee,approveBridge:At,submitBridge:bt,onClose:k,onBackToWallet:fo})},"bridge"),gr=!!T&&y?.trim().toLowerCase()!=="my wallet",hi=(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("span",{className:"wi-receive-avatar",children:[(0,p.jsx)("span",{className:"wi-avatar-fallback",style:ui}),mo&&(0,p.jsx)("img",{src:mo,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:uo,onError:v=>{v.currentTarget.style.display="none"}})]}),(0,p.jsx)("span",{className:"wi-receive-account-name",children:y??"Account 1"}),gr&&(0,p.jsx)("span",{className:"wi-receive-chevron","data-open":On,"aria-hidden":"true",children:(0,p.jsx)(dn,{size:16})})]}),gc=(0,p.jsxs)("div",{className:fe("wi-view-inner wi-qr-body",on.current&&"wi-view-qr"),children:[(0,p.jsxs)("div",{className:"wi-receive-section",children:[gr?(0,p.jsx)("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{Wn(!0),T?.()},"aria-label":"Switch account",children:hi}):(0,p.jsx)("div",{className:"wi-receive-account",children:hi}),(0,p.jsxs)("div",{className:"wi-qr-block",children:[(0,p.jsxs)("div",{className:"wi-qr-box",children:[(0,p.jsx)(Al.QRCodeSVG,{value:b,size:180,level:"H",marginSize:2,...m&&{imageSettings:{src:m,height:33,width:33,excavate:!0}}}),!m&&(0,p.jsx)("div",{className:"wi-qr-logo",children:(0,p.jsx)(Ui,{size:33})})]}),(0,p.jsx)("p",{className:"wi-qr-address",children:b})]}),(0,p.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:fi,children:[(0,p.jsx)("span",{className:"wi-qr-copy-icon",children:Rn?(0,p.jsx)(ln,{size:16}):(0,p.jsx)(Hn,{size:16})}),(0,p.jsx)("span",{className:"wi-qr-copy-text",children:Rn?"Copied!":"Copy address"})]})]}),mi&&(0,p.jsx)("div",{className:"wi-receive-footer",children:mi})]},"qr"),hc=j==="qr"||j==="portfolio"||j==="send"||j==="bridge",bi=ve!==null?(0,p.jsx)("div",{className:"wi-builtin-footer",children:ve}):null,wi=(0,p.jsxs)("div",{className:"wi-account-text",children:[gr?(0,p.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{Wn(!0),T?.()},"aria-label":"Switch account","aria-expanded":On,children:[(0,p.jsx)("span",{className:"wi-account-name",children:y??"Account 1"}),(0,p.jsx)("span",{className:"wi-account-switch","data-open":On,"aria-hidden":"true",children:(0,p.jsx)(dn,{size:20})})]}):(0,p.jsx)("div",{className:"wi-account-row",children:(0,p.jsx)("span",{className:"wi-account-name",children:y??"Account 1"})}),(0,p.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:fi,"aria-label":"Copy address",children:[(0,p.jsx)("span",{className:"wi-account-address",children:lt(b)}),(0,p.jsx)("span",{className:"wi-account-copy","data-copied":Rn,children:Rn?(0,p.jsx)(ln,{size:12}):(0,p.jsx)(Hn,{size:12})})]})]}),xi=(0,p.jsxs)(p.Fragment,{children:[o,j==="qr"?(0,p.jsx)("div",{className:"wi-sticky-header",children:(0,p.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,p.jsx)("button",{type:"button",className:"wi-header-back",onClick:fo,"aria-label":"Back",children:(0,p.jsx)(cn,{size:24})}),(0,p.jsx)("span",{className:"wi-receive-title",children:"Receive"}),(0,p.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,p.jsx)(_t,{size:24})})]})}):j==="send"||j==="bridge"?null:hc?(0,p.jsxs)("div",{className:"wi-sticky-header",children:[(0,p.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,p.jsx)("button",{type:"button",className:"wi-header-back",onClick:fo,"aria-label":"Back",children:(0,p.jsx)(cn,{size:24})}),(0,p.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:wi}),(0,p.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,p.jsx)(_t,{size:24})})]}),(0,p.jsx)("hr",{className:"wi-divider"})]}):(0,p.jsxs)("div",{className:"wi-sticky-header",children:[(0,p.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,p.jsxs)("div",{className:"wi-account-block",children:[(0,p.jsxs)("div",{className:"wi-avatar",children:[(0,p.jsx)("div",{className:"wi-avatar-fallback",style:ui}),mo&&(0,p.jsx)("img",{src:mo,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:uo,onError:v=>{v.currentTarget.style.display="none"}})]}),wi]}),(0,p.jsxs)("div",{className:"wi-header-actions",children:[h&&x&&(0,p.jsx)("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:Mn,"aria-label":"Show QR code",children:(0,p.jsx)(Co,{size:20})}),(0,p.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,p.jsx)(_t,{size:24})})]})]}),(0,p.jsx)("hr",{className:"wi-divider"})]}),(0,p.jsxs)("div",{className:"wi-view-container",children:[j==="wallet"&&dc,j==="qr"&&gc,j==="portfolio"&&pc,j==="send"&&fc,j==="bridge"&&mc]}),j==="wallet"&&ft&&(0,p.jsx)("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:ft}),j==="wallet"&&Ze&&(0,p.jsxs)("a",{className:"wi-send-toast",href:lr??"#",target:"_blank",rel:"noopener noreferrer",onClick:v=>{if(!lr){v.preventDefault();return}Je(v,lr,{category:"send",origin:"send-transaction",payload:{chainId:Ze.chainId,txHash:Ze.txHash}},nt)},children:[(0,p.jsx)("span",{className:"wi-send-toast-icon","data-status":Ze.status,"aria-hidden":!0,children:Ze.status==="pending"?(0,p.jsx)("span",{className:"wi-send-toast-spinner"}):Ze.status==="error"?(0,p.jsx)("span",{className:"wi-send-toast-error-dot"}):(0,p.jsx)(Ki,{size:20})}),(0,p.jsxs)("span",{className:"wi-send-toast-copy",children:[(0,p.jsx)("span",{className:"wi-send-toast-title",children:Ze.status==="pending"?"Sending...":Ze.status==="error"?"Send failed":"Send complete"}),(0,p.jsx)("span",{className:"wi-send-toast-desc",children:Ze.status==="pending"||Ze.status==="error"?Ze.description:"Tap to see your transaction"})]})]}),bi&&j!=="portfolio"&&j!=="send"&&(0,p.jsx)("div",{className:"wi-sticky-footer",children:(0,p.jsx)("div",{className:"wi-footer",ref:$t,children:bi})})]}),vi={...H,...kn>0?{"--wi-footer-height":`${kn}px`}:null};return a?(0,p.jsxs)(eo.Drawer.Portal,{children:[c&&(0,p.jsx)(eo.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,p.jsxs)(eo.Drawer.Content,{className:fe("wi-drawer-content",n),"data-theme":i,"data-vaul-no-drag":d==="left"||d==="right"?!0:void 0,style:vi,"data-direction":d,"data-no-balance":!f||void 0,"data-has-footer":kn>0||void 0,"data-view":j,children:[(0,p.jsx)(eo.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),xi]})]}):(0,p.jsxs)(p.Fragment,{children:[c&&l&&(0,p.jsx)("div",{className:"wi-drawer-overlay",onClick:k}),(0,p.jsx)(tr.Portal,{children:(0,p.jsx)(tr.Content,{align:e,sideOffset:t,className:fe("wi-popover-content",n),"data-theme":i,style:vi,"data-no-balance":!f||void 0,"data-has-footer":kn>0||void 0,"data-view":j,children:xi})})]})}var Bl=G(require("react"),1);function Fl({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=Zt();return Bl.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}var _l=G(require("react"),1);function Ml({children:e}){let{setFooterContent:t}=Zt();return _l.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}Z(`[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)}
5
+ `);Z("");var yo=require("react/jsx-runtime");function xr({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let i=Rn(`(max-width: ${n}px)`),[a,l]=Cn.useState(!1),d=Cn.useCallback(()=>l(!1),[]),c=Fe(e),f=Cn.useMemo(()=>({env:c,theme:t,isMobile:i,open:a,domain:o,close:d}),[c,t,i,a,o,d]);return(0,yo.jsx)(wr.Provider,{value:f,children:i?(0,yo.jsx)(Ci.Drawer.Root,{direction:"right",open:a,onOpenChange:l,noBodyStyles:!0,children:r},"drawer"):(0,yo.jsx)(Ri.Root,{open:a,onOpenChange:l,children:r},"popover")})}var Ei=G(require("@radix-ui/react-popover"),1),Li=require("vaul");var Ve=require("react/jsx-runtime");function Ti({size:e=18}){return(0,Ve.jsxs)("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ve.jsx)("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),(0,Ve.jsx)("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Ni(){return(0,Ve.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ve.jsx)("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ii(){return(0,Ve.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ve.jsx)("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Wn=require("react/jsx-runtime");function vr({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:i}=xo(),a=t!=null,l=e??!0,d=n?`al-trigger-btn ${n}`:"al-trigger-btn",c=a?t:(0,Wn.jsx)("button",{type:"button",className:d,"data-theme":i,style:o,children:(0,Wn.jsx)(Ti,{size:18})});return r?(0,Wn.jsx)(Li.Drawer.Trigger,{asChild:l,children:c}):(0,Wn.jsx)(Ei.Trigger,{asChild:l,children:c})}var sn=G(require("react"),1),ko=G(require("@radix-ui/react-popover"),1),an=require("vaul");var Bi=require("@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 Nc="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",Ic="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function ht(e,t){return`${e==="production"?Ic:Nc}/${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:ht(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:ht(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:ht(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:ht(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:ht(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:ht(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:ht(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:ht(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:ht(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:ht(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:ht(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:ht(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function Dn(e){let t=Fe(e);return(0,Bi.useQuery)({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 yr(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function _i(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function Mi(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=yr(e);return t==="comingSoon"?0:t==="ending"?2:1}function fe(...e){return e.filter(Boolean).join(" ")}var ge=require("react/jsx-runtime");function Ec(e){return e.id==="cross-staking"||e.type==="cross-staking"}function kr({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:i,domain:a,close:l}=xo(),{data:d}=Dn(o),c=sn.useMemo(()=>Mi(d?.items??[]),[d?.items]),f=8,g=sn.useRef(null),w=sn.useCallback(y=>{g.current={x:y.clientX,y:y.clientY}},[]),h=typeof window<"u"?window.location.pathname:"",x=sn.useCallback((y,R)=>{if(g.current){let k=y.clientX-g.current.x,T=y.clientY-g.current.y;if(g.current=null,Math.abs(k)>f||Math.abs(T)>f)return}let u=R.url[o]??R.url.production,N=Oi(u,a);if(!N)try{let k=new URL(u).pathname;if(h===k||h.startsWith(k+"/")){l();return}}catch{}N?window.open(u,"_blank","noopener,noreferrer"):window.location.href=u,l()},[o,a,l,h]),m=y=>{let R=y.url[o]??y.url.production,u=Oi(R,a),N=yr(y),k=N==="ending",T=_i(y.iconUrl,o),C=!1;if(!u)try{let $=new URL(R).pathname;C=h===$||h.startsWith($+"/")}catch{C=!1}return(0,ge.jsx)("button",{type:"button",className:"al-grid-item","data-active":C||void 0,"data-service-status":N,onPointerDown:w,onClick:$=>x($,y),children:(0,ge.jsxs)("div",{className:"al-grid-item-left",children:[(0,ge.jsxs)("div",{className:"al-grid-item-icon",children:[(0,ge.jsx)("img",{src:T,alt:y.label,width:24,height:24,loading:"lazy"}),y.isNew&&(0,ge.jsx)("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),(0,ge.jsxs)("span",{className:"al-grid-item-text",children:[(0,ge.jsx)("span",{className:"al-grid-item-label",children:y.label}),k&&(0,ge.jsx)("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),y.badge&&!Ec(y)&&(0,ge.jsx)("span",{className:"al-badge al-badge-list",children:y.badge})]})]})},y.id)},b=(0,ge.jsx)("div",{className:"al-menu","data-theme":r,children:(0,ge.jsx)("div",{className:"al-grid",children:c.map(m)})});return i?(0,ge.jsxs)(an.Drawer.Portal,{children:[(0,ge.jsx)(an.Drawer.Overlay,{className:"al-drawer-overlay"}),(0,ge.jsxs)(an.Drawer.Content,{className:fe("al-drawer-content",n),"data-theme":r,children:[(0,ge.jsxs)("div",{className:"al-drawer-header",children:[(0,ge.jsx)(an.Drawer.Close,{className:"al-drawer-close",children:(0,ge.jsx)(Ni,{})}),(0,ge.jsx)(an.Drawer.Title,{className:"al-drawer-title",children:"CROSS Services"}),(0,ge.jsx)(an.Drawer.Close,{className:"al-drawer-close",children:(0,ge.jsx)(Ii,{})})]}),(0,ge.jsx)("div",{className:"al-drawer-body",children:b})]})]}):(0,ge.jsx)(ko.Portal,{children:(0,ge.jsx)(ko.Content,{align:e,sideOffset:t,className:fe("al-popover-content",n),"data-theme":r,children:b})})}function Oi(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}var tt=G(require("react"),1),Ml=G(require("@radix-ui/react-popover"),1),Ol=require("vaul");var So=require("react"),Sr=(0,So.createContext)(null);function Yt(){let e=(0,So.useContext)(Sr);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}var Ro=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(Ro||{}),zn={crossx:{name:"CROSSx",iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};var La=G(require("react"),1);var X=require("react/jsx-runtime");function Wi({size:e=16,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),(0,X.jsx)("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Gn({size:e=16,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function ln({size:e=16,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Mt({size:e=24,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Di({size:e=20,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,X.jsx)("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Co({size:e=20,className:t}){return(0,X.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:(0,X.jsx)("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function cn({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function dn({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function zi({size:e=16,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,X.jsx)("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Gi({size:e=16,className:t}){return(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),(0,X.jsx)("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(0,X.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 42 42",fill:"none",className:t,children:(0,X.jsx)("path",{d:"M20.7314 2C31.0766 2 39.4628 10.3863 39.4629 20.7314C39.4629 31.0766 31.0766 39.4629 20.7314 39.4629C10.3863 39.4628 2 31.0766 2 20.7314C2.00007 10.3864 10.3864 2.00007 20.7314 2ZM20.5938 30.0586L21.1084 30.5732L21.623 30.0586V25.2471H21.1084C20.9344 25.2471 20.7626 25.235 20.5938 25.2158V30.0586ZM16.4834 24.6611L14.6514 26.4922L15.3799 27.2207L17.1797 25.4209L18.3193 24.2803C18.0487 24.0673 17.8025 23.8251 17.5869 23.5566L16.4834 24.6611ZM26.8691 27.2207L27.5967 26.4922L26.3516 25.2471H24.8955L26.8691 27.2207ZM11.2666 20.7314L11.7822 21.2471H16.624C16.6048 21.0781 16.5938 20.9065 16.5938 20.7324C16.5938 20.5585 16.6049 20.3866 16.624 20.2178H11.7812L11.2666 20.7314ZM20.5938 11.4053V16.2471C20.7626 16.2279 20.9345 16.2178 21.1084 16.2178H21.623V11.4053L21.1084 10.8906L20.5938 11.4053ZM14.6514 15.0029L16.4521 16.8027L17.5732 17.9238C17.7874 17.6546 18.0315 17.4104 18.3008 17.1963L15.3799 14.2754L14.6514 15.0029ZM25.0371 16.1074L24.9268 16.2178H26.3818L27.5957 15.0029L26.8682 14.2754L25.0371 16.1074Z",fill:"#019D92",stroke:"white",strokeWidth:4})})}function Ui({size:e=20,className:t}){return(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("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(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("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(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("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(0,X.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,X.jsx)("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(0,X.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,X.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),(0,X.jsx)("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}var M=G(require("react"),1);var Zt=G(require("bignumber.js"),1);function Lc(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 Xt(e,t){if(!e||e==="0")return"0.00";let n=new Zt.default(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,Zt.default.ROUND_DOWN)}function lt(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 Ki(e,t,n){let r=new Zt.default(e).shiftedBy(-t).multipliedBy(new Zt.default(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(Zt.default.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,Zt.default.ROUND_DOWN):r.decimalPlaces(4,Zt.default.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=Lc(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}}var Zi=require("react"),Xi=require("@tanstack/react-query");var Ie={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},Tn="https://terms.crosstoken.io/docs/cross-terms-of-use",To="https://terms.crosstoken.io/docs/nexus-privacy-policy";var Nn=G(require("react"),1),Ac={dev:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",stage:"https://stg-contents.crosstoken.io/frontend/common/app-launcher",production:"https://contents.crosstoken.io/frontend/common/app-launcher"},Pc=3e3;function pn(e,t){if(e!=null)return typeof e=="object"&&!Array.isArray(e)&&("dev"in e||"stage"in e||"production"in e)?e[t]:e}var Cr=new Map;function Yi(e,t){let n=`${Ac[t]}/${e}`,o=Cr.get(n);return o||(o=(async()=>{let r=new AbortController,i=setTimeout(()=>r.abort(),Pc);try{let a=await fetch(n,{cache:"no-store",signal:r.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(r=>(r===null&&Cr.delete(n),r)),Cr.set(n,o)),o}function Bc(e){return typeof e=="string"&&e.startsWith("https://")}async function se(e,t){let n=await Yi("endpoints.json",t),o=pn(n?.apis?.[e],t);if(!Bc(o))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return o}function In(e,t,n){let[o,r]=Nn.useState(void 0),i=Nn.useRef(n);return i.current=n,Nn.useEffect(()=>{let a=!0;return Yi(e,t).then(l=>{if(!a)return;let d=i.current(l);d!==void 0&&r(d)}),()=>{a=!1}},[e,t]),o}var Fc="send:chain-info";function _c(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 Tr(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===Ie[e].cross?Ji(t,o):n?.explorer_url?Tr(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):Oc(e,t,o)}function Ji(e,t){return Tr("https://explorer.onechain.nexus",String(e),"tx",t)}function Oc(e,t,n){let o=Ie[e];if(t===o.cross)return Ji(t,n);if(t===o.bsc)return Tr(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function No(e,t,n,o=!0){let r=(0,Xi.useQuery)({queryKey:[Fc,e,t],queryFn:async({signal:l})=>{let d=await se("walletServer",e),c=await fetch(`${d}/v1/public/chain/info/${t}`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let f=await c.json();if("code"in f&&f.code!==void 0&&f.code!==200)throw new Error(`Chain info API error: ${f.code}`);return _c(f)},enabled:o,staleTime:3e5}),i=r.data;return{transactionUrl:(0,Zi.useMemo)(()=>Mc(e,t,i,n),[t,i,e,n]),chainInfo:i,...r}}var ea="0x0000000000000000000000000000000000000001";var Wc="0xa9059cbb",Dc=/^0x[a-fA-F0-9]{40}$/,zc="nexus-cross:dapp-ui:send:recent:",ta=10;function Gc(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Hn(e){return e.toLowerCase()}function Ot(e){return Dc.test(e)}function Jt(e){return Hn(e.address)===ea}function Nr(e){return`${zc}${e.toLowerCase()}`}function En(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Nr(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&Ot(o.address)&&typeof o.updatedAt=="number").slice(0,ta):[]}catch{return[]}}function Ir(e,t){if(typeof window>"u")return[];let n=Hn(t),o=[{address:n,updatedAt:Date.now()},...En(e).filter(r=>r.address!==n)].slice(0,ta);try{window.localStorage.setItem(Nr(e),JSON.stringify(o))}catch{return En(e)}return o}function Er(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Nr(e))}catch{}}function $t(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"),l=a?BigInt(a):0n,d=10n**BigInt(t),c=i*d+l;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function Un(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=Gc(i.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Lr(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${Wc}${n}${o}`}function Io(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 l=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return l=l.replace(/0+$/,""),l?`${r.toString()}.${l}`:r.toString()}function Ar(e,t){return Io(e,t,6)}function na(e){return Io(e,9,2)}function oa(e){return e.toLocaleString("en-US")}function Eo(e){return e===56||e===97}function Lo(e){return e.gasPrice??e.maxFeePerGas}function ra(e,t=!1){return t?Lo(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Ao(e,t=!1){if(t){let n=Lo(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 Po(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function ia(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(ia(n.cause,t+1)),o.join(`
6
+ `).toLowerCase()}function Hc(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 Pr(e,t={},n="Failed to send transaction."){let o=ia(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.":Hc(e)||n}var Uc=2000000000n,$c=1000000000n;async function Bo(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 Fo(e){return BigInt(e)}function jc(e){return`0x${e.toString(16)}`}function Vc(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=jc(e.value)),e.data&&(t.data=e.data),t}function qc(e){return e===56||e===97}async function aa(e){try{let t=await Bo(e,"eth_gasPrice",[]);return{gasPrice:Fo(t)}}catch{return{gasPrice:Uc}}}async function Kc(e,t){let n=$c;try{let o=await Bo(e,"eth_maxPriorityFeePerGas",[]);n=Fo(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Qc(e,t){if(t)return aa(e);let n;try{n=(await Bo(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Kc(e,Fo(n)):aa(e)}async function sa(e,t){let n=qc(t.chainId),o=Vc(t),[r,i]=await Promise.all([Bo(e,"eth_estimateGas",[o]),Qc(e,n)]);return{gasLimit:Fo(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function la(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 sa(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 Yc=1500,Zc=120;function ca(e){return!!(e.token||e.recipient||e.amount)}function Br({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},i=e.trim(),a=$t(t,n.quantity.decimals),l;return i?Ot(i)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in a?r.amount=a.error:(l=a.value,l>o&&(r.amount="Amount exceeds available balance.")),!Jt(n)&&!Ot(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:l,recipient:i&&Ot(i)?i:void 0}}function Fr({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return Jt(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Hn(e.address),data:Lr(n,o),value:0n,chainId:e.chainId,from:r}}function Xc(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Jc=e=>new Promise(t=>setTimeout(t,e));async function da({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Yc,pollMaxAttempts:i=Zc}){let a=await e.sendTransaction(t);o(a);let{getTransactionReceipt:l}=e;if(!l)return"success";for(let d=0;d<i;d+=1){let c=await l({hash:a,chainId:n}).catch(()=>null);if(c)return Xc(c)?"reverted":"success";await Jc(r)}return"timeout"}var pa=["token","recipient","amount","review"];function fa(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:i="recipient",token:a,tokens:l=[],onTokenChange:d,sendTransaction:c,getTransactionReceipt:f,estimateGas:g,getTokenPriceUsd:w,onSubmitted:h,onSuccess:x,onFailed:m,onExit:b,onOutlink:y}=e,R=M.useMemo(()=>la({sendTransaction:c,getTransactionReceipt:f,estimateGas:g}),[c,f,g]),[u,N]=M.useState(a);M.useEffect(()=>{N(a)},[a.address,a.chainId]);let[k,T]=M.useState(i),[C,$]=M.useState(""),[D,z]=M.useState(""),[B,ie]=M.useState({}),[I,te]=M.useState("idle"),[H,Y]=M.useState(""),[ce,ye]=M.useState(""),[j,pe]=M.useState(null),[ue,V]=M.useState(!1),[Me,F]=M.useState(""),ne=M.useRef(0),[q,ae]=M.useState(null),[be,dt]=M.useState(""),[bt,nt]=M.useState(()=>En(n)),Ut=M.useMemo(()=>Fe(t),[t]),{transactionUrl:Oe,chainInfo:Ee}=No(Ut,u.chainId,H||void 0,!0),pt=Ee?.currency_symbol??"",We=Ee?.name??`Chain ID ${u.chainId}`,He=M.useRef({nativeSymbol:pt||void 0,networkName:We,tokenSymbol:u.symbol});He.current={nativeSymbol:pt||void 0,networkName:We,tokenSymbol:u.symbol};let Le=M.useMemo(()=>BigInt(u.quantity.numeric||"0"),[u.quantity.numeric]),Bt=M.useMemo(()=>Xt(u.quantity.numeric,u.quantity.decimals),[u.quantity.numeric,u.quantity.decimals]),wt=w?.(u),Ft=M.useMemo(()=>{if(wt===void 0)return;let E=parseFloat(D.replace(/,/g,""));return Number.isFinite(E)?E*wt:0},[D,wt]);M.useEffect(()=>{z(""),ie({})},[u.address,u.chainId]),M.useEffect(()=>{ne.current+=1,pe(null),F(""),V(!1)},[u.address,u.chainId,C,D]),M.useEffect(()=>{nt(En(n))},[n]);let it=M.useCallback(E=>{$(E),ie(oe=>({...oe,recipient:void 0}))},[]),xt=M.useCallback(E=>{z(E),ie(oe=>({...oe,amount:void 0}))},[]),ft=M.useCallback(()=>{z(Bt.replace(/,/g,"")),ie(E=>({...E,amount:void 0}))},[Bt]),Ce=M.useCallback(E=>{N(E),d?.(E),T("recipient")},[d]),_t=M.useCallback(()=>T("token"),[]),ut=M.useCallback(()=>{T(E=>{if(E==="result")return"review";if(E===i)return b?.(),E;let oe=pa.indexOf(E);return oe<=0?(b?.(),E):pa[oe-1]})},[i,b]),Ue=M.useCallback(()=>{let{errors:E}=Br({recipient:C,amount:"1",token:u,balanceRaw:Le});if(E.recipient){ie(oe=>({...oe,recipient:E.recipient}));return}ie(oe=>({...oe,recipient:void 0})),T("amount")},[C,u,Le]),De=M.useCallback(E=>{$(E),ie(oe=>({...oe,recipient:void 0})),T("amount")},[]),$e=M.useCallback(()=>{let E=Br({recipient:C,amount:D,token:u,balanceRaw:Le});ie(E.errors),!(ca(E.errors)||E.rawAmount===void 0||!E.recipient)&&(ae(E.rawAmount),dt(E.recipient),pe(null),F(""),te("idle"),T("review"))},[C,D,u,Le]);M.useEffect(()=>{if(k!=="review"||!be||q===null||j!==null||ue||Me||!R.canEstimateGas(Ee?.rpc))return;let E=++ne.current;V(!0),F(""),(async()=>{try{let oe=Fr({token:u,walletAddress:n,recipient:be,rawAmount:q}),Te=await R.estimateGas(oe,Ee?.rpc);if(ne.current!==E)return;pe(Te)}catch(oe){if(ne.current!==E)return;F(Pr(oe,He.current,"Failed to estimate gas."))}finally{ne.current===E&&V(!1)}})()},[k,be,q,j,ue,Me,R,Ee?.rpc,u,n]);let ot=M.useMemo(()=>{if(!Jt(u)||!j||q===null)return!1;let E=Ao(j,Eo(u.chainId));return E===null?!1:q+E>Le},[u,j,q,Le]),at=M.useCallback(async()=>{if(!(!be||q===null)&&!ot){ye(""),Y(""),te("submitting");try{let E="",oe=await da({repository:R,args:Fr({token:u,walletAddress:n,recipient:be,rawAmount:q}),chainId:u.chainId,onSubmitted:Te=>{E=Te,Y(Te),te("confirming"),nt(Ir(n,be)),h?.({txHash:Te,chainId:u.chainId,amount:D,tokenSymbol:u.symbol,recipient:be})}});if(oe==="success")te("success"),E&&x?x?.(E):T("result");else if(oe==="reverted"){let Te="Transaction reverted on-chain.";te("error"),ye(Te),E&&m?m({txHash:E,chainId:u.chainId,message:Te}):T("result")}else{let Te="Transaction receipt was not found. Please check again later.";te("error"),ye(Te),E&&m?m({txHash:E,chainId:u.chainId,message:Te}):T("result")}}catch(E){te("error"),ye(Pr(E,{nativeSymbol:pt||void 0,networkName:We,tokenSymbol:u.symbol})),T("result")}}},[R,be,q,ot,u,D,n,h,x,m,pt,We]),[rt,mt]=M.useState(!1),vt=M.useRef(void 0);M.useEffect(()=>()=>clearTimeout(vt.current),[]);let Ke=M.useCallback(async()=>{if(H)try{await navigator.clipboard.writeText(H),mt(!0),clearTimeout(vt.current),vt.current=setTimeout(()=>mt(!1),2e3)}catch{}},[H]),Qe=M.useCallback(()=>{if(!Oe||!H)return;let E=st=>{typeof window<"u"&&window.open(st,"_blank","noopener,noreferrer")};if(!y){E(Oe);return}let oe=y(Oe,{category:"send",origin:"send-transaction",payload:{chainId:u.chainId,txHash:H}});if(oe&&typeof oe.then=="function"){let st=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;oe.then(gt=>{if(gt===null){st?.close();return}let yt=gt??Oe;if(st)try{st.location.href=yt}catch{st.close(),E(yt)}else E(yt)});return}let Te=oe;Te!==null&&E(Te??Oe)},[y,u.chainId,Oe,H]),Ye=M.useCallback(()=>{ye(""),Y(""),te("idle"),pe(null),F(""),T("review")},[]);return{step:k,status:I,token:u,tokens:l.length>0?l:[u],recipient:C,amount:D,amountUsd:Ft,fieldErrors:B,error:ce,txHash:H,gasEstimate:j,gasLoading:ue,gasError:Me,insufficientGas:ot,reviewRawAmount:q,reviewRecipient:be,recentAddresses:bt,accounts:r,accountName:o,walletAddress:n,resolvedEnv:Ut,transactionUrl:Oe,networkName:We,nativeSymbol:pt,nativeDecimals:Ee?.currency_decimals??u.quantity.decimals,balanceRaw:Le,balanceText:Bt,priceUsd:wt,canSelectToken:(l.length>0?l:[u]).length>1,canSend:R.canSend,getTokenPriceUsd:w,setRecipient:it,setAmount:xt,setMax:ft,selectToken:Ce,goToTokenSelect:_t,selectRecipient:De,submitRecipient:Ue,submitAmount:$e,confirmSend:at,retry:Ye,back:ut,hashCopied:rt,copyHash:Ke,openTransaction:Qe}}var Ct=G(require("react"),1);var Wt=require("react/jsx-runtime");function ua({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:i,token:a,setMax:l}=e,d=Ct.useRef(null),c=Ct.useCallback(()=>{requestAnimationFrame(()=>{let m=d.current;if(!m)return;let b=m.value.length;m.setSelectionRange(b,b)})},[]);Ct.useEffect(()=>{d.current?.focus(),c()},[c]),Ct.useEffect(()=>{t===""&&(w(!1),c())},[t,c]);let f=Ct.useMemo(()=>{let m=$t(t,a.quantity.decimals);return"value"in m&&m.value>i},[t,a.quantity.decimals,i]),[g,w]=Ct.useState(!1),h=!g&&t===""?"0.00":t,x=t.trim()===""||t.trim()==="0";return(0,Wt.jsx)("div",{className:"sf-body sf-amount",children:(0,Wt.jsxs)("div",{className:"sf-amount-center",children:[(0,Wt.jsx)("span",{className:"sf-amount-usd",children:o!==void 0?Po(o):"\xA0"}),(0,Wt.jsx)("div",{className:"sf-amount-input-wrap","data-over":f||void 0,"data-empty":x||void 0,onClick:()=>d.current?.focus(),children:(0,Wt.jsx)("input",{ref:d,className:"sf-amount-input",value:h,onChange:m=>{let b=m.target.value;if(g)n(b);else if(t===""){if(b.length<4)return;w(!0);let y=b.startsWith("0.00")?b.slice(4):b;n(y)}else w(!0),n(b)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),(0,Wt.jsxs)("div",{className:"sf-amount-balance",children:[(0,Wt.jsx)("span",{children:"Balance:"}),(0,Wt.jsxs)("button",{type:"button",className:"sf-amount-max",onClick:l,children:[r," ",a.symbol]})]})]})})}var Tt=G(require("react"),1);var td=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function ga(e){return td.has(e.toLowerCase())}var ma={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function $n(e,t){let n=Ie[e];if(t===n.cross)return ma.cross;if(t===n.bsc)return ma.bsc}var nd={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function jt(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:i="png"}=n,a=nd[e],l=r?`&bg=${r}`:"";return`${a}/portrait/evm/${t}.${i}?size=${o}${l}`}var _e=require("react/jsx-runtime");function ha({size:e=20,className:t}){return(0,_e.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,_e.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),(0,_e.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function ba({size:e=20,className:t}){return(0,_e.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:(0,_e.jsx)("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 wa({size:e=20,className:t}){return(0,_e.jsxs)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[(0,_e.jsx)("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),(0,_e.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function xa({size:e=16,className:t}){return(0,_e.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:(0,_e.jsx)("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function va({size:e=56,className:t}){return(0,_e.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,_e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),(0,_e.jsx)("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 ya({size:e=56,className:t}){return(0,_e.jsxs)("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[(0,_e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),(0,_e.jsx)("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}var le=require("react/jsx-runtime");function ka(e,t){return e.name||`Account ${(e.index??t)+1}`}function Sa(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Ra(e){return e.toLowerCase()}function Ca({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:i,walletAddress:a,resolvedEnv:l,selectRecipient:d}=e,c=Tt.useMemo(()=>i.filter(u=>u.address.toLowerCase()!==a.toLowerCase()),[i,a]),f=c.length>0,g=Tt.useMemo(()=>new Map(c.map((u,N)=>[Ra(u.address),{account:u,index:N}])),[c]),[w,h]=Tt.useState("recent"),x=Tt.useRef(null);Tt.useEffect(()=>{x.current?.focus()},[]);let m="1A1A2E",b=Tt.useCallback(async()=>{try{let u=await navigator.clipboard.readText();u&&n(u.trim())}catch{}},[n]),y=t.trim().length>0,R=Ot(t.trim());return(0,le.jsxs)("div",{className:"sf-recipient",children:[(0,le.jsxs)("div",{className:"sf-recipient-top",children:[(0,le.jsxs)("div",{className:"sf-address-field","data-filled":y||void 0,"data-invalid":o.recipient||void 0,children:[(0,le.jsx)("textarea",{ref:x,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?(0,le.jsx)("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear",children:(0,le.jsx)(wa,{size:20})}):(0,le.jsx)("button",{type:"button",className:"sf-address-action",onClick:b,"aria-label":"Paste from clipboard",children:(0,le.jsx)(ba,{size:20})})]}),o.recipient&&(0,le.jsx)("p",{className:"sf-field-error",role:"alert",children:o.recipient}),(0,le.jsxs)("div",{className:"sf-tabs",role:"tablist",children:[(0,le.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":w==="recent"||void 0,"aria-selected":w==="recent",onClick:()=>h("recent"),children:"Recent"}),f&&(0,le.jsx)("button",{type:"button",role:"tab",className:"sf-tab","data-active":w==="account"||void 0,"aria-selected":w==="account",onClick:()=>h("account"),children:"My Account"})]})]}),(0,le.jsx)("div",{className:"sf-address-list",children:w==="account"&&f?c.map((u,N)=>{let k=ka(u,N),T=jt(l,u.address,{size:56,bg:m});return(0,le.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>d(u.address),children:[(0,le.jsxs)("span",{className:"sf-address-avatar",children:[T&&(0,le.jsx)("img",{src:T,alt:"",width:40,height:40,draggable:!1,onError:C=>{C.currentTarget.style.display="none"}}),(0,le.jsx)("span",{className:"sf-address-avatar-fallback",children:Sa(k)})]}),(0,le.jsxs)("span",{className:"sf-address-meta",children:[(0,le.jsx)("span",{className:"sf-address-name",children:k}),(0,le.jsx)("span",{className:"sf-address-value",children:lt(u.address)})]})]},u.address)}):r.length>0?r.map(u=>{let N=g.get(Ra(u.address)),k=N?ka(N.account,N.index):lt(u.address),T=jt(l,u.address,{size:56,bg:m});return(0,le.jsxs)("button",{type:"button",className:"sf-address-row",onClick:()=>d(u.address),children:[(0,le.jsxs)("span",{className:"sf-address-avatar",children:[T&&(0,le.jsx)("img",{src:T,alt:"",width:40,height:40,draggable:!1,onError:C=>{C.currentTarget.style.display="none"}}),(0,le.jsx)("span",{className:"sf-address-avatar-fallback",children:Sa(k)})]}),(0,le.jsxs)("span",{className:"sf-address-meta",children:[(0,le.jsx)("span",{className:"sf-address-name",children:k}),(0,le.jsx)("span",{className:"sf-address-value",children:lt(u.address)})]})]},u.address)}):(0,le.jsx)("div",{className:"sf-empty",children:"No send history"})}),y&&!R&&!o.recipient&&(0,le.jsx)("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}var ke=require("react/jsx-runtime");function Na({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:i,openTransaction:a}=e,l=t==="error",d=t==="success";return l?(0,ke.jsxs)("div",{className:"sf-body sf-result sf-result--error",children:[(0,ke.jsx)("span",{className:"sf-result-icon",children:(0,ke.jsx)(ya,{size:56})}),(0,ke.jsxs)("div",{className:"sf-result-copy",children:[(0,ke.jsx)("h3",{className:"sf-result-title",children:"Transaction Failed"}),(0,ke.jsx)("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&(0,ke.jsx)(Ta,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]}):(0,ke.jsxs)("div",{className:"sf-body sf-result",children:[(0,ke.jsx)("span",{className:"sf-result-icon","data-pending":!d||void 0,children:d?(0,ke.jsx)(va,{size:56}):(0,ke.jsx)("span",{className:"sf-result-spinner"})}),(0,ke.jsxs)("div",{className:"sf-result-copy",children:[(0,ke.jsx)("h3",{className:"sf-result-title",children:d?"Transaction Complete":"Transaction in Progress"}),(0,ke.jsx)("p",{className:"sf-result-desc",children:d?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&(0,ke.jsx)(Ta,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]})}function Ta({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return(0,ke.jsxs)("div",{className:"sf-result-hash-card",children:[(0,ke.jsx)("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),(0,ke.jsxs)("div",{className:"sf-result-hash-row",children:[(0,ke.jsx)("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer",children:lt(e)}),(0,ke.jsx)("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash",children:t?(0,ke.jsx)(ln,{size:16}):"Copy"})]})]})}var ee=require("react/jsx-runtime"),_o="\u2014";function Ia({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:i,walletAddress:a,networkName:l,nativeSymbol:d,nativeDecimals:c,gasEstimate:f,gasLoading:g,gasError:w,insufficientGas:h,error:x,resolvedEnv:m}=e,b=Jt(t),y=n!==null?Io(n,t.quantity.decimals):"",R=r?.trim()||`Account ${(i[0]?.index??0)+1}`,u=jt(m,a,{size:56,bg:"1A1A2E"}),N=d||(b?t.symbol:""),k=Eo(t.chainId),T=f?ra(f,k):null,C=f?Ao(f,k):null,$=I=>I!==null&&N?`${Ar(I,c)} ${N}`:_o,D=I=>I!==void 0?`${na(I)} Gwei`:_o,z=(()=>{if(!b||!f||C===null||n===null)return _o;let I=n+C;return`${Ar(I,c)} ${N||t.symbol}`})(),B=I=>g?"\u2026":I,ie=[{label:"Est. Tx Fee",value:B($(C))},...T==="dynamic"?[{label:"Max Priority Fee",value:B(D(f?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:B(D(f?.maxFeePerGas))}]:T==="legacy"?[{label:"Gas Price",value:B(D(f?Lo(f):void 0))}]:[],{label:"Gas Limit",value:B(f?oa(f.gasLimit):_o)}];return(0,ee.jsxs)("div",{className:"sf-body sf-review",children:[(0,ee.jsxs)("div",{className:"sf-review-amount",children:[(0,ee.jsx)("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:I=>{I.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),(0,ee.jsxs)("span",{className:"sf-review-amount-value",children:[y,(0,ee.jsx)("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),(0,ee.jsxs)("div",{className:"sf-review-parties",children:[(0,ee.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,ee.jsx)("span",{className:"sf-review-party-label",children:"From"}),(0,ee.jsxs)("div",{className:"sf-review-party-head",children:[(0,ee.jsx)("span",{className:"sf-review-party-avatar",children:u&&(0,ee.jsx)("img",{src:u,alt:"",width:28,height:28,draggable:!1,onError:I=>{I.currentTarget.style.display="none"}})}),(0,ee.jsx)("span",{className:"sf-review-party-name",children:R})]}),(0,ee.jsx)("span",{className:"sf-review-party-addr",children:a})]}),(0,ee.jsx)("span",{className:"sf-review-arrow","aria-hidden":!0,children:(0,ee.jsx)(xa,{size:16})}),(0,ee.jsxs)("div",{className:"sf-review-card sf-review-party",children:[(0,ee.jsx)("span",{className:"sf-review-party-label",children:"To"}),(0,ee.jsx)("span",{className:"sf-review-party-addr",children:o})]})]}),(0,ee.jsxs)("section",{className:"sf-review-card",children:[(0,ee.jsx)("h3",{className:"sf-review-section-title",children:"Summary"}),(0,ee.jsxs)("div",{className:"sf-review-row",children:[(0,ee.jsx)("span",{className:"sf-review-row-label",children:"Network"}),(0,ee.jsx)("span",{className:"sf-review-row-value",children:l})]}),ie.map(I=>(0,ee.jsxs)("div",{className:"sf-review-row",children:[(0,ee.jsx)("span",{className:"sf-review-row-label",children:I.label}),(0,ee.jsx)("span",{className:"sf-review-row-value",children:I.value})]},I.label))]}),(0,ee.jsxs)("section",{className:"sf-review-card",children:[(0,ee.jsx)("h3",{className:"sf-review-section-title",children:"Total"}),(0,ee.jsxs)("div",{className:"sf-review-row",children:[(0,ee.jsx)("span",{className:"sf-review-row-label",children:"Total Amount"}),(0,ee.jsxs)("span",{className:"sf-review-row-value",children:[y," ",t.symbol]})]}),b&&(0,ee.jsxs)("div",{className:"sf-review-row",children:[(0,ee.jsx)("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),(0,ee.jsx)("span",{className:"sf-review-row-value",children:B(z)})]})]}),h&&!w&&!x&&(0,ee.jsxs)("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)&&(0,ee.jsx)("div",{className:"sf-message sf-message--error",role:"alert",children:w||x})]})}var Mo=G(require("react"),1);var Ge=require("react/jsx-runtime");function Ea({flow:e}){let[t,n]=Mo.useState(""),o=t.trim().toLowerCase(),r=Mo.useMemo(()=>o?e.tokens.filter(i=>i.symbol.toLowerCase().includes(o)||i.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return(0,Ge.jsxs)("div",{className:"sf-body sf-token-select",children:[(0,Ge.jsxs)("div",{className:"sf-search",children:[(0,Ge.jsx)(ha,{size:20}),(0,Ge.jsx)("input",{className:"sf-search-input",value:t,onChange:i=>n(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),(0,Ge.jsxs)("div",{className:"sf-token-list",children:[r.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,l=$n(e.resolvedEnv,i.chainId),d=e.getTokenPriceUsd?.(i);return(0,Ge.jsxs)("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),children:[(0,Ge.jsxs)("span",{className:"sf-token-left",children:[(0,Ge.jsxs)("span",{className:"sf-token-icon-wrap",children:[(0,Ge.jsx)("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"}}),l&&(0,Ge.jsx)("img",{className:"sf-token-chain-badge",src:l,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),(0,Ge.jsx)("span",{className:"sf-token-name",children:i.symbol})]}),(0,Ge.jsxs)("span",{className:"sf-token-right",children:[(0,Ge.jsx)("span",{className:"sf-token-balance",children:Xt(i.quantity.numeric,i.quantity.decimals)}),d!==void 0&&(0,Ge.jsx)("span",{className:"sf-token-price",children:Po(d)})]})]},a)}),r.length===0&&(0,Ge.jsx)("div",{className:"sf-empty",children:"No tokens found"})]})]})}Z(`.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
+ `);var Se=require("react/jsx-runtime"),od={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function jn({onClose:e,onBackToWallet:t,onConfirmSuccess:n,onSuccess:o,className:r,...i}){let a=La.useCallback(y=>{o?.(y),n?.(y)},[n,o]),d=fa({...i,onSuccess:o||n?a:void 0,onExit:t}),{step:c,status:f}=d,g=Ot(d.recipient.trim()),w=$t(d.amount,d.token.quantity.decimals),h="value"in w&&w.value<=d.balanceRaw,x=f==="submitting"||f==="confirming",m=c!=="result",b=od[c]??"";return(0,Se.jsxs)("div",{className:fe("sf-root",r),"data-step":c,children:[(0,Se.jsxs)("header",{className:"sf-header",children:[m?(0,Se.jsx)("button",{type:"button",className:"sf-header-btn",onClick:d.back,"aria-label":"Back",children:(0,Se.jsx)(cn,{size:24})}):(0,Se.jsx)("span",{className:"sf-header-btn","aria-hidden":!0}),(0,Se.jsx)("span",{className:"sf-header-title",children:b}),(0,Se.jsx)("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close",children:(0,Se.jsx)(Mt,{size:24})})]}),c==="token"&&(0,Se.jsx)(Ea,{flow:d}),c==="recipient"&&(0,Se.jsx)(Ca,{flow:d}),c==="amount"&&(0,Se.jsx)(ua,{flow:d}),c==="review"&&(0,Se.jsx)(Ia,{flow:d}),c==="result"&&(0,Se.jsx)(Na,{flow:d}),(0,Se.jsxs)("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&(0,Se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:d.submitRecipient,"data-disabled":!g||void 0,"aria-disabled":!g,children:"Next"}),c==="amount"&&(0,Se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:d.submitAmount,"data-disabled":!h||void 0,"aria-disabled":!h,children:"Next"}),c==="review"&&(0,Se.jsxs)("div",{className:"sf-footer-row",children:[(0,Se.jsx)("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:d.back,disabled:x,children:"Cancel"}),(0,Se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:d.confirmSend,disabled:x||!d.canSend||d.insufficientGas,children:x?"Sending...":"Send"})]}),c==="result"&&f==="success"&&(0,Se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>n?.(d.txHash||void 0),children:"All done"}),c==="result"&&f==="error"&&(0,Se.jsx)("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:d.retry,children:"Try Again"})]})]})}var Aa=G(require("@radix-ui/react-popover"),1),Pa=require("vaul");var fn=require("react/jsx-runtime");function Ba({asChild:e,className:t,children:n}){let{isMobile:o,theme:r,walletAddress:i}=Yt(),a=n!=null,l=e??!0,d=a?n:(0,fn.jsxs)("button",{type:"button",className:fe("wi-trigger-btn",t),"data-theme":r,"data-mobile":o||void 0,children:[(0,fn.jsx)(Wi,{size:o?14:16}),(0,fn.jsx)("span",{className:"wi-trigger-address",children:lt(i)})]});return o?(0,fn.jsx)(Pa.Drawer.Trigger,{asChild:l,children:d}):(0,fn.jsx)(Aa.Trigger,{asChild:l,children:d})}var W=G(require("react"),1),tr=G(require("@radix-ui/react-popover"),1),Jn=require("vaul");var Pn=G(require("bignumber.js"),1);var Fa=require("@tanstack/react-query"),_a=require("react");var Oo="user-balance";async function rd(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 Vt(e,t,n=!0){let o=Ie[e],r=[o.cross,o.bsc],i=(0,Fa.useQueries)({queries:r.map(c=>({queryKey:[Oo,e,t,c],queryFn:async({signal:f})=>rd(await se("walletServer",e),c,t,f),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1}))}),a=i.some(c=>c.isLoading),l=i.some(c=>c.isError);return{tokens:(0,_a.useMemo)(()=>{let c=[];for(let f of i)f.data&&c.push(...f.data);return c},[i]),isLoading:a,isError:l}}var Wo=require("@tanstack/react-query"),Ma=require("react");var id="forge-holdings",ad="forge-token-image";async function sd(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 ld(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 Oa(e,t,n=!0){let{data:o,...r}=(0,Wo.useQuery)({queryKey:[id,e,t],queryFn:async({signal:i})=>sd(await se("bondingCurve",e),t,i),enabled:!!t&&n,staleTime:0,refetchInterval:n?5e3:!1});return{holdings:o??[],...r}}function Wa(e,t,n=!0){let o=(0,Wo.useQueries)({queries:t.map(i=>({queryKey:[ad,e,i],queryFn:async({signal:a})=>ld(await se("bondingCurve",e),i,a),enabled:n,staleTime:1/0}))});return{imageMap:(0,Ma.useMemo)(()=>{let i=new Map;for(let a of o)a.data&&i.set(a.data.address,a.data.image_url);return i},[o])}}var Da=require("@tanstack/react-query"),za=require("react");var Do="token-stats";function Nt(e,t){return`${e}:${t.toLowerCase()}`}function qt(e,t=!0){let{data:n,...o}=(0,Da.useQuery)({queryKey:[Do,e],queryFn:async({signal:i})=>{let a=await se("walletServer",e),l=await fetch(`${a}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token stats: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token stats API error: ${d.code}`);return d},enabled:t,staleTime:3e4});return{statsMap:(0,za.useMemo)(()=>{let i=new Map;if(!n?.data)return i;for(let a of n.data){let l=Nt(a.chain_id,a.address);i.set(l,a)}return i},[n]),...o}}var Ga=require("@tanstack/react-query"),cd="crossd-apy",dd="https://crossd-dashboard-api.crossdefi.io/api/v1/overview";function Ha(){let{data:e,...t}=(0,Ga.useQuery)({queryKey:[cd],queryFn:async({signal:n})=>{let o=await fetch(dd,{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}}var Ua=require("@tanstack/react-query"),$a=require("react");var pd="token-info";function _r(e,t){return`${t.toLowerCase()}_${e}`}function ja(e,t=!0){let{data:n,...o}=(0,Ua.useQuery)({queryKey:[pd,e],queryFn:async({signal:i})=>{let a=await se("walletServer",e),l=await fetch(`${a}/v1/public/token/info`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let d=await l.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:1/0});return{categoryMap:(0,$a.useMemo)(()=>{let i=new Map;if(!n?.data)return i;for(let a of n.data){let l=_r(a.chain_id,a.address);i.set(l,a.category)}return i},[n]),...o}}var Va=require("react"),zo=G(require("bignumber.js"),1);function qa(e,t,n){let{tokens:o,isLoading:r}=Vt(e,t,n),{statsMap:i}=qt(e,n);return(0,Va.useMemo)(()=>{let a=new zo.default(0);for(let f of o){let g=i.get(Nt(f.chainId,f.address));if(!g)continue;let h=new zo.default(f.quantity.numeric).shiftedBy(-f.quantity.decimals).multipliedBy(new zo.default(g.price));h.isNaN()||(a=a.plus(h))}let l=a.toFixed(),{displayValue:d,isLowerBound:c}=Qi(l);return{totalUsd:l,displayValue:d,isLowerBound:c,isLoading:r}},[o,i,r])}var Ll=require("qrcode.react");function Je(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,f=g=>{if(g===null){c?.close();return}let w=g??t;if(c)try{c.location.href=w}catch{c.close(),i(w)}else i(w)};r.then(f,g=>{console.error("[dapp-ui] onOutlink rejected:",g),c?.close()});return}let l=r;if(l===null)return;i(l??t)}var bn=G(require("react"),1),nl=require("vaul");var Go=require("react"),Vn=(0,Go.createContext)(null);function qe(){let e=(0,Go.useContext)(Vn);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}var Ka=require("vaul");var Mr=require("react/jsx-runtime");function Qa({asChild:e,children:t}){let{walletAddress:n}=qe(),o=t!=null,r=e??!0,i=o?t:(0,Mr.jsx)("button",{type:"button",children:lt(n)});return(0,Mr.jsx)(Ka.Drawer.Trigger,{asChild:r,children:i})}var Yn=require("vaul");var Ne=G(require("react"),1),el=require("@tanstack/react-query");var Ho=require("react"),Or=(0,Ho.createContext)(null);function Ya(){return(0,Ho.useContext)(Or)}var Ae=require("react/jsx-runtime");function Za({size:e=22,className:t}){return(0,Ae.jsx)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Ae.jsx)("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xa({size:e=22,className:t}){return(0,Ae.jsxs)("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,Ae.jsx)("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),(0,Ae.jsx)("path",{d:"M16.17 13.75a7.333 7.333 0 11-1.54-7.59L18.333 9.167",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ja({size:e=16,className:t}){return(0,Ae.jsxs)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,Ae.jsx)("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"}),(0,Ae.jsx)("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 es({size:e=16,className:t}){return(0,Ae.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,Ae.jsx)("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ts({size:e=48,className:t}){return(0,Ae.jsxs)("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,Ae.jsx)("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),(0,Ae.jsx)("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 It({size:e=12,className:t}){return(0,Ae.jsxs)("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:[(0,Ae.jsx)("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"}),(0,Ae.jsx)("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),(0,Ae.jsx)("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}var ct=G(require("bignumber.js"),1),fd=/^(\d{4}-\d{2}-\d{2})/;function ns(e){if(!e||e.length===0)return;let t=new Map,n;for(let{key:r,cumulative:i}of e.map(a=>({key:fd.exec(a.reference_date)?.[1],cumulative:a.cumulative_earned})).filter(a=>!!a.key&&a.cumulative!=null).sort((a,l)=>a.key<l.key?-1:a.key>l.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 Uo(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function os(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}var ud="0xe00e8bf3";function rs(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`${ud}${o}${r}`}function Wr(e){return!e||e<=0n?"0":new ct.default(e.toString()).shiftedBy(-9).toFormat(2,ct.default.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function is(e){return!e||e<=0n?"0":new ct.default(e.toString()).toFormat(0,ct.default.ROUND_DOWN)}function as(e){if(!e||e<=0n)return"0";let t=new ct.default(e.toString()).shiftedBy(-18),n=t.isLessThan(1e-4)?7:4;return t.toFormat(n,ct.default.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Et(e,t){let n=new ct.default(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,ct.default.ROUND_DOWN):n.toFormat(4,ct.default.ROUND_DOWN)}function Dr(e){return Et(e,0)}function en(e,t,n){let o=new ct.default(n||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let r=new ct.default(e||"0").shiftedBy(-t).times(o);return r.isFinite()?`$${r.toFormat(2,ct.default.ROUND_DOWN)}`:null}var Cs=G(require("react"),1);var ss=require("@tanstack/react-query"),zr=require("react");var md="wp:reward-pools";function Ln(e,t=!0){let{data:n,...o}=(0,ss.useQuery)({queryKey:[md,e],queryFn:async({signal:a})=>{let l=await se("gameReward",e),d=await fetch(`${l}/v1/pools`,{cache:"no-store",signal:a});if(!d.ok)throw new Error(`Failed to fetch pools: ${d.status}`);let c=await d.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),r=(0,zr.useMemo)(()=>n?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[n]),i=(0,zr.useMemo)(()=>n?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[n]);return{crossPools:r,gamePools:i,allPools:n?.data.pools??[],...o}}var ls=require("@tanstack/react-query"),cs=require("react");var gd="wp:user-deposits";function $o(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,ls.useQuery)({queryKey:[gd,e,t],queryFn:async({signal:l})=>{let d=await se("gameReward",e),c=await fetch(`${d}/v1/users/${t}/deposits`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let f=await c.json();if(f.code!==200)throw new Error(`Deposits API error: ${f.code}`);return f},enabled:o,staleTime:0});return{depositMap:(0,cs.useMemo)(()=>{let l=new Map;if(!r?.data.user_deposits)return l;for(let d of r.data.user_deposits)l.set(d.pool_address.toLowerCase(),d);return l},[r]),deposits:r?.data.user_deposits??[],...i}}var gs=require("@tanstack/react-query"),hs=require("react");var ds={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},ps={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var fs={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var Gr={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},us={dev:`${Gr.dev}/portfolio`,stage:`${Gr.stage}/portfolio`,production:`${Gr.production}/portfolio`};var ms={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Dt={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 hd="wp:token-info";function jo(e,t=!0){let n=Ie[e].cross,{data:o,...r}=(0,gs.useQuery)({queryKey:[hd,e],queryFn:async({signal:d})=>{let c=await se("walletServer",e),f=await fetch(`${c}/v1/public/token/info`,{cache:"no-store",signal:d});if(!f.ok)throw new Error(`Failed to fetch token info: ${f.status}`);let g=await f.json();if(g.code!==200)throw new Error(`Token info API error: ${g.code}`);return g},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=(0,hs.useMemo)(()=>{let d=new Map,c=new Map;if(!o?.data)return{byChainAddr:d,byChainSym:c};for(let f of o.data){let g=f.address.toLowerCase();d.set(`${f.chain_id}:${g}`,f),d.set(g,f);let w=f.symbol.replace(/^t/,"").toUpperCase(),h=`${f.chain_id}:${w}`;c.has(h)||c.set(h,f),c.has(w)||c.set(w,f)}return{byChainAddr:d,byChainSym:c}},[o]);return{getTokenImage:(d,c)=>{let f=d.toLowerCase(),g=i.get(`${n}:${f}`);if(g?.image)return g.image;let w=i.get(f);if(w?.image)return w.image;if(c){let h=c.replace(/^t/,"").toUpperCase(),x=a.get(`${n}:${h}`);if(x?.image)return x.image;let m=a.get(h);if(m?.image)return m.image}return""},...r}}var ws=require("@tanstack/react-query"),Kn=require("react");var bd="0x70a08231",wd="0x18160ddd",xd="0x313ce567",vd=8e3;async function yd(e,t,n,o){let r=new AbortController,i=setTimeout(()=>r.abort(),vd);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 l=await a.json();if(l.error)throw new Error(`RPC ${t}: ${l.error.message}`);if(l.result===void 0)throw new Error(`RPC ${t}: empty result`);return l.result}function kd(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function qn(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function un(e,t,n,o){try{return await yd(e,"eth_call",[{to:t,data:n},"latest"],o)}catch{return}}async function Sd(e,t,n,o){let[r,i,a]=await Promise.all([un(e,n,bd+kd(t),o),un(e,n,wd,o),un(e,n,xd,o)]),l=qn(r);if(l===void 0)return null;let d=qn(a);return{balance:l,totalSupply:qn(i),decimals:d!==void 0?Number(d):void 0}}async function Hr(e,t){let n=Ie[e].cross,o=await se("walletServer",e),r=await fetch(`${o}/v1/public/chain/info/${n}`,{cache:"no-store",signal:t});if(!r.ok)return;let i=await r.json();return("data"in i&&i.data!==void 0?Array.isArray(i.data)?i.data[0]:i.data:i)?.rpc||void 0}async function bs(e,t,n,o){if(!t||n.length===0)return{};let r;try{r=await Hr(e,o)}catch{r=void 0}if(!r)return{};let i=await Promise.all(n.map(async l=>[l.toLowerCase(),await Sd(r,t,l,o)])),a={};for(let[l,d]of i)d&&(a[l]=d);return a}var Rd="wp:withdraw-token-meta",Cd="0xc89039c5",Td="0x95d89b41",Nd="0x313ce567";function Id(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 Ed(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 Ld(e,t,n){if(t.length===0)return{};let o;try{o=await Hr(e,n)}catch{o=void 0}if(!o)return{};let r=await Promise.all(t.map(async a=>{let l=Ed(await un(o,a,Cd,n));if(!l)return[a.toLowerCase(),null];let[d,c]=await Promise.all([un(o,l,Td,n),un(o,l,Nd,n)]),f=Id(d),g=qn(c);return f?[a.toLowerCase(),{tokenAddress:l,symbol:f,decimals:g!==void 0?Number(g):18}]:[a.toLowerCase(),null]})),i={};for(let[a,l]of r)l&&(i[a]=l);return i}function Vo(e,t,n=!0){let r=n&&!!t,{allPools:i,isLoading:a}=Ln(e,r),{deposits:l,isLoading:d}=$o(e,t,r),c=(0,Kn.useMemo)(()=>{let b=new Map;for(let y of i)b.set(y.pool_address.toLowerCase(),y);return b},[i]),f=(0,Kn.useMemo)(()=>l.filter(b=>{try{return BigInt(b.deposited_amount||"0")>0n}catch{return!1}}),[l]),g=(0,Kn.useMemo)(()=>f.map(b=>b.pool_address.toLowerCase()).filter(b=>!c.has(b)).sort(),[f,c]),{data:w,isLoading:h}=(0,ws.useQuery)({queryKey:[Rd,e,g],queryFn:({signal:b})=>Ld(e,g,b),enabled:r&&g.length>0,staleTime:1440*60*1e3});return{positions:(0,Kn.useMemo)(()=>{let b=[];for(let y of f){let R=y.pool_address.toLowerCase(),u=c.get(R);if(u){b.push({poolId:y.pool_id,poolAddress:y.pool_address,poolType:u.pool_type,tokenSymbol:u.deposit_token.symbol,tokenAddress:u.deposit_token.address,decimals:u.deposit_token.decimals,price:u.deposit_token.price,depositedRaw:y.deposited_amount});continue}let N=w?.[R];N&&b.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 b},[f,c,w]),isLoading:a||d||h}}var Ur=G(require("react"),1);var mn=require("react/jsx-runtime");function zt({sectionKey:e,title:t,icon:n,iconFit:o="cover",isEmpty:r,loading:i=!1,children:a}){let l=Ya();return Ur.useEffect(()=>{l?.report(e,{loading:i,empty:r})},[l,e,i,r]),Ur.useEffect(()=>()=>l?.unregister(e),[l,e]),r?null:(0,mn.jsxs)("div",{className:"wp-svc-card",children:[(0,mn.jsxs)("div",{className:"wp-svc-card-head",children:[(0,mn.jsx)("img",{className:"wp-svc-card-icon",src:n,alt:"",style:{objectFit:o}}),(0,mn.jsx)("span",{className:"wp-svc-card-title",children:t})]}),(0,mn.jsx)("div",{className:"wp-svc-items",children:a})]})}var xe=G(require("react"),1);var S=require("react/jsx-runtime"),Ad=/^\d*\.?\d{0,2}$/,Pd=[100n,1000n,2000n],Bd=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":`${as(e.gasLimit*n)} CROSS`}function $r(e,t,n){return n==="loading"?"Estimating...":n==="error"||n==="unavailable"?"-":`${e} ${t}`.trim()}function xs({position:e,size:t}){return e.icon?(0,S.jsx)("img",{src:e.icon,alt:"",width:t,height:t}):(0,S.jsx)("span",{children:e.tokenSymbol.slice(0,1)})}function qo({open:e,status:t,positions:n,initialPoolAddress:o,walletAddress:r,txHash:i,error:a,copied:l=!1,estimateWithdraw:d,onClose:c,onConfirm:f,onCopyHash:g}){let[w,h]=xe.useState(void 0),[x,m]=xe.useState(""),[b,y]=xe.useState(null),[R,u]=xe.useState("idle"),N=xe.useRef(0),k=xe.useRef(void 0),T=xe.useRef(null);xe.useEffect(()=>()=>clearTimeout(k.current),[]);let C=xe.useMemo(()=>{let F=(w??o)?.toLowerCase();return n.find(ne=>ne.poolAddress.toLowerCase()===F)??n[0]??null},[n,w,o]),$=xe.useMemo(()=>{try{return BigInt(C?.depositedRaw??"0")}catch{return 0n}},[C?.depositedRaw]),D=C?.decimals??18,z=xe.useMemo(()=>{let F=$t(x,D);return"value"in F?F.value:null},[x,D]),B=z!==null&&z>$,ie=t==="confirm"&&!!C&&z!==null&&z>0n&&!B,I=xe.useCallback(()=>{m(""),y(null),u(d?"idle":"unavailable"),N.current+=1,T.current=null},[]);xe.useEffect(()=>{e&&(h(o),I())},[e]);let te=xe.useCallback(F=>{t==="confirm"&&(h(F.poolAddress),I())},[t,I]);xe.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(k.current);return}if(!d||!C){clearTimeout(k.current),u("unavailable");return}if(z===null||z<=0n||B){clearTimeout(k.current),N.current+=1,T.current=null,y(null),u("idle");return}let F=`${C.poolAddress.toLowerCase()}:${z.toString()}`;if(T.current===F)return;T.current=F,clearTimeout(k.current);let ne=N.current+1;N.current=ne,u("loading"),k.current=setTimeout(()=>{d(C,z).then(q=>{N.current===ne&&(y(q??null),u(q?"ready":"unavailable"))}).catch(()=>{N.current===ne&&(y(null),u("error"))})},Bd)},[e,t,z,B,d,C]);let H=xe.useCallback(F=>{let ne=F.target.value.replace(/,/g,"");(ne===""||Ad.test(ne))&&m(ne)},[]),Y=xe.useCallback(F=>{m(Un(F.toString(),D))},[D]),ce=xe.useCallback(F=>{let ne=10n**BigInt(D),ae=(z??0n)+F*ne;Y(ae>$?$:ae)},[z,D,$,Y]),ye=xe.useCallback(()=>{Y($)},[$,Y]);if(!e||!C)return null;let j=t==="submitting",pe=Wr(b?.maxPriorityFeePerGas),ue=Wr(b?.maxFeePerGas??b?.gasPrice),V=is(b?.gasLimit),Me=Et(C.depositedRaw,D);return(0,S.jsx)("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:F=>{F.target===F.currentTarget&&!j&&c()},children:(0,S.jsxs)("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","data-status":t,"data-vaul-no-drag":!0,children:[(0,S.jsx)("div",{className:"wp-claim-grabber","aria-hidden":!0,children:(0,S.jsx)("span",{})}),(0,S.jsxs)("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:(0,S.jsx)(ts,{})}),(0,S.jsxs)("div",{className:"wp-claim-copy",children:[(0,S.jsx)("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),(0,S.jsx)("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),(0,S.jsx)("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:(0,S.jsxs)("div",{className:"wp-claim-list-item",children:[(0,S.jsx)("span",{children:"Tx Hash"}),(0,S.jsxs)("button",{type:"button",className:"wp-claim-hash",onClick:g,"aria-label":"Copy transaction hash",children:[(0,S.jsx)("strong",{children:os(i)}),l?(0,S.jsx)(es,{}):(0,S.jsx)(Ja,{})]})]})})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"wp-claim-heading",children:[(0,S.jsx)("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:t==="error"?"Withdraw Failed":"Withdraw"}),t==="error"&&(0,S.jsx)("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),n.length>1&&(0,S.jsx)("div",{className:"wp-withdraw-token-list",role:"listbox","aria-label":"Withdrawable tokens",children:n.map(F=>{let ne=F.poolAddress.toLowerCase()===C.poolAddress.toLowerCase();return(0,S.jsxs)("button",{type:"button",role:"option","aria-selected":ne,className:"wp-withdraw-token","data-selected":ne||void 0,disabled:j,onClick:()=>te(F),children:[(0,S.jsx)("span",{className:"wp-withdraw-token-icon","aria-hidden":!0,children:(0,S.jsx)(xs,{position:F,size:28})}),(0,S.jsx)("span",{className:"wp-withdraw-token-symbol",children:F.tokenSymbol}),(0,S.jsx)("span",{className:"wp-withdraw-token-amount",children:Et(F.depositedRaw,F.decimals)})]},F.poolAddress)})}),(0,S.jsxs)("div",{className:"wp-claim-reward-card","aria-label":"Deposited balance",children:[(0,S.jsx)("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:(0,S.jsx)(xs,{position:C,size:28})}),(0,S.jsx)("strong",{className:"wp-claim-reward-symbol",children:C.tokenSymbol}),(0,S.jsx)("strong",{className:"wp-claim-reward-amount",children:Me})]}),(0,S.jsxs)("div",{className:"wp-withdraw-amount-card",children:[(0,S.jsxs)("div",{className:"wp-withdraw-amount-row",children:[(0,S.jsx)("input",{className:"wp-withdraw-input",type:"text",inputMode:"decimal",autoComplete:"off",placeholder:"0",value:x,disabled:j,onChange:H,"aria-label":`Withdraw amount (${C.tokenSymbol})`,"aria-invalid":B||void 0}),(0,S.jsx)("span",{className:"wp-withdraw-input-symbol",children:C.tokenSymbol})]}),B&&(0,S.jsx)("p",{className:"wp-claim-error-message",children:"Amount exceeds deposited balance."}),(0,S.jsxs)("div",{className:"wp-withdraw-quick-row",role:"group","aria-label":"Quick amounts",children:[Pd.map(F=>(0,S.jsxs)("button",{type:"button",className:"wp-withdraw-quick",disabled:j,onClick:()=>ce(F),children:["+",F.toString()]},F.toString())),(0,S.jsx)("button",{type:"button",className:"wp-withdraw-quick",disabled:j,onClick:ye,children:"MAX"})]})]}),(0,S.jsxs)("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[(0,S.jsxs)("div",{className:"wp-claim-account-row",children:[(0,S.jsxs)("div",{className:"wp-claim-account",children:[(0,S.jsx)("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),(0,S.jsxs)("strong",{children:[C.tokenSymbol," Pool"]})]}),(0,S.jsx)("span",{children:Uo(r)})]}),(0,S.jsx)("span",{className:"wp-claim-divider","aria-hidden":!0}),(0,S.jsxs)("div",{className:"wp-claim-detail-list",children:[(0,S.jsxs)("div",{className:"wp-claim-detail-row",children:[(0,S.jsx)("span",{children:"Est. Tx Fee"}),(0,S.jsx)("strong",{children:Fd(b,R)})]}),(0,S.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,S.jsx)("span",{children:"Priority Fee Per Gas"}),(0,S.jsx)("strong",{children:$r(pe,"Gwei",R)})]}),(0,S.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,S.jsx)("span",{children:"Max Fee Per Gas"}),(0,S.jsx)("strong",{children:$r(ue,"Gwei",R)})]}),(0,S.jsxs)("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[(0,S.jsx)("span",{children:"Gas Limit"}),(0,S.jsx)("strong",{children:$r(V,"",R)})]})]})]})]}),(0,S.jsxs)("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&(0,S.jsx)("button",{type:"button",className:"wp-claim-secondary",onClick:c,children:t==="error"?"Close":"Cancel"}),(0,S.jsxs)("button",{type:"button",className:"wp-claim-primary",onClick:()=>{if(t==="success"){c();return}C&&z!==null&&z>0n&&!B&&f(C,z,b)},disabled:j||(t==="confirm"||t==="error")&&(z===null||z<=0n||B),children:[t==="success"&&"Done",t==="submitting"&&(0,S.jsx)("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),(0,S.jsx)("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:(0,S.jsx)("span",{})})]})})}var Pe=G(require("react"),1),Ss=require("@tanstack/react-query");var vs=require("@tanstack/react-query");var _d="wp:reward-factory-info";function ys(e,t=!0){let{data:n,...o}=(0,vs.useQuery)({queryKey:[_d,e],queryFn:async({signal:r})=>{let i=await se("gameReward",e),a=await fetch(`${i}/v1/factory/info`,{cache:"no-store",signal:r});if(!a.ok)throw new Error(`Factory info fetch failed: ${a.status}`);let l=await a.json();if(l.code!==200)throw new Error(`Factory info API error: ${l.code}`);return l},enabled:t,staleTime:0});return{factoryInfo:n?.data??null,routerAddress:n?.data.router_address??"",...o}}var Md="wp:";function ks(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Ko(){let{env:e,walletAddress:t,sendTransaction:n,estimateGas:o}=qe(),r=!!t,i=!!n,a=(0,Ss.useQueryClient)(),{routerAddress:l}=ys(e,r&&i),d=ks(l),[c,f]=Pe.useState(!1),[g,w]=Pe.useState(void 0),[h,x]=Pe.useState("confirm"),[m,b]=Pe.useState(),[y,R]=Pe.useState(""),[u,N]=Pe.useState(!1),k=Pe.useRef(void 0);Pe.useEffect(()=>()=>clearTimeout(k.current),[]);let T=Pe.useCallback((I,te)=>d?{to:d,value:0n,data:rs(I,te),chainId:Ie[e].cross}:null,[e,d]),C=Pe.useCallback(()=>{a.invalidateQueries({predicate:I=>typeof I.queryKey[0]=="string"&&I.queryKey[0].startsWith(Md)})},[a]),$=Pe.useCallback(I=>{w(I),f(!0),x("confirm"),b(void 0),R(""),N(!1)},[]),D=Pe.useCallback(()=>{h!=="submitting"&&(f(!1),w(void 0),x("confirm"),b(void 0),R(""),N(!1),h==="success"&&C())},[h,C]),z=Pe.useCallback(async(I,te)=>{if(!o)return null;let H=T(I.poolId,te),Y=ks(t);return!H||!Y?null:o({...H,from:Y})},[T,o,t]),B=Pe.useCallback(async()=>{if(!(!m||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(m),N(!0),clearTimeout(k.current),k.current=setTimeout(()=>N(!1),1400)}catch{N(!1)}},[m]),ie=Pe.useCallback(async(I,te,H)=>{if(!n){x("error"),R("Withdraw is not available for this wallet.");return}if(!d){x("error"),R("Withdraw contract address is not available.");return}try{x("submitting"),R("");let Y=T(I.poolId,te);if(!Y){x("error"),R("Withdraw contract address is not available.");return}let ce=await n({...Y,gas:H?.gasLimit&&H.gasLimit>0n?H.gasLimit:void 0,maxFeePerGas:H?.maxFeePerGas&&H.maxFeePerGas>0n?H.maxFeePerGas:void 0,maxPriorityFeePerGas:H?.maxPriorityFeePerGas&&H.maxPriorityFeePerGas>0n?H.maxPriorityFeePerGas:void 0});b(ce),x("success"),C()}catch(Y){x("error"),R(Y instanceof Error?Y.message:"Failed to request withdraw.")}},[T,C,d,n]);return{canWithdrawInline:i,isOpen:c,initialPoolAddress:g,status:h,txHash:m,error:y,copied:u,hasEstimator:!!o,openWithdraw:$,closeWithdraw:D,estimateWithdraw:z,confirmWithdraw:ie,copyHash:B}}var Qo=G(require("bignumber.js"),1),J=require("react/jsx-runtime"),Od="CROSS Rewards";function Rs(e){return new Qo.default(e||"0").isGreaterThan(0)}function Ts(){let{env:e,walletAddress:t,onOutlink:n}=qe(),o=!!t,{allPools:r,isLoading:i}=Ln(e,o),{depositMap:a,isLoading:l}=$o(e,t,o),{getTokenImage:d}=jo(e,o),c=Ko(),{positions:f}=Vo(e,t,o&&c.canWithdrawInline),g=Cs.useMemo(()=>f.filter(m=>m.poolType==="CrossPool").map(m=>({...m,icon:d(m.tokenAddress,m.tokenSymbol)})),[f,d]),w=(m,b)=>`${ds[e]}/rewards/${m.pool_address}?action=${b}`,h=`${Dt[e]}/reward.png`,x=r.filter(m=>{let b=a.get(m.pool_address.toLowerCase()),y=b?.deposited_amount??"0",R=b?.claimable_reward??"0";return!(new Qo.default(y).isZero()&&new Qo.default(R).isZero())});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(zt,{sectionKey:"rewards",title:Od,icon:h,isEmpty:x.length===0,loading:i||l,children:x.map(m=>{let b=a.get(m.pool_address.toLowerCase()),y=b?.deposited_amount??"0",R=b?.claimable_reward??"0",u=w(m,"withdraw"),N=w(m,"claim"),k=d(m.deposit_token.address,m.deposit_token.symbol),T=m.reward_tokens[0],C=T?d(T.address,T.symbol):"",$=m.reward_tokens.map(ce=>ce.symbol),D=$.length>0?`${m.deposit_token.symbol}-${$.join("/")}`:m.deposit_token.symbol,z=T?Et(R,T.decimals):"0",B=T?.symbol??"Reward",ie=en(y,m.deposit_token.decimals,m.deposit_token.price),I=T?en(R,T.decimals,T.price):null,te=!!b&&Rs(R),H=!!b&&Rs(y),Y=c.canWithdrawInline&&g.some(ce=>ce.poolAddress.toLowerCase()===m.pool_address.toLowerCase());return(0,J.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,J.jsxs)("div",{className:"wp-item-body",children:[(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),(0,J.jsxs)("div",{className:"wp-svc-token",children:[(0,J.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&(0,J.jsx)("img",{className:"wp-svc-token-icon",src:k,alt:""}),C&&(0,J.jsx)("img",{className:"wp-svc-token-icon",src:C,alt:""})]}),(0,J.jsx)("span",{children:D})]})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,J.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&(0,J.jsx)("img",{className:"wp-svc-token-icon",src:k,alt:""}),(0,J.jsxs)("div",{className:"wp-svc-amount",children:[(0,J.jsx)("span",{className:"wp-svc-amount-main",children:Et(y,m.deposit_token.decimals)}),ie&&(0,J.jsx)("span",{className:"wp-item-usd",children:ie})]})]})]}),(0,J.jsxs)("div",{className:"wp-item-line",children:[(0,J.jsxs)("span",{className:"wp-item-label",children:["Claimable (",B,")"]}),(0,J.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[C&&(0,J.jsx)("img",{className:"wp-svc-token-icon",src:C,alt:""}),(0,J.jsxs)("div",{className:"wp-svc-amount",children:[(0,J.jsx)("span",{className:"wp-svc-amount-main",children:z}),I&&(0,J.jsx)("span",{className:"wp-item-usd",children:I})]})]})]})]}),(0,J.jsxs)("div",{className:"wp-item-tags",children:[Y?(0,J.jsx)("button",{type:"button",className:"wp-tag wp-tag--muted","data-disabled":!H||void 0,"aria-disabled":!H||void 0,onClick:()=>{H&&c.openWithdraw(m.pool_address)},children:(0,J.jsx)("span",{className:"wp-tag-label",children:"Withdraw"})}):(0,J.jsxs)("a",{className:"wp-tag wp-tag--muted",href:u,target:"_blank",rel:"noopener noreferrer",onClick:ce=>Je(ce,u,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:b}},n),children:[(0,J.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,J.jsx)(It,{size:12,className:"wp-tag-icon"})]}),(0,J.jsxs)("a",{className:"wp-tag wp-tag--mint","data-disabled":!te||void 0,"aria-disabled":!te||void 0,href:te?N:void 0,target:te?"_blank":void 0,rel:te?"noopener noreferrer":void 0,onClick:ce=>{if(!te){ce.preventDefault();return}Je(ce,N,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:m,userDeposit:b}},n)},children:[(0,J.jsx)("span",{className:"wp-tag-label",children:"Claim"}),(0,J.jsx)(It,{size:12,className:"wp-tag-icon"})]})]})]},m.pool_address)})}),(0,J.jsx)(qo,{open:c.isOpen,status:c.status,positions:g,initialPoolAddress:c.initialPoolAddress,walletAddress:t,txHash:c.txHash,error:c.error,copied:c.copied,estimateWithdraw:c.hasEstimator?c.estimateWithdraw:void 0,onClose:c.closeWithdraw,onConfirm:c.confirmWithdraw,onCopyHash:c.copyHash})]})}var Ns=G(require("react"),1);var me=require("react/jsx-runtime"),Wd="Points";function Is(){let{env:e,walletAddress:t,onOutlink:n}=qe(),o=!!t,{getTokenImage:r}=jo(e,o),i=Ko(),{positions:a,isLoading:l}=Vo(e,t,o),d=Ns.useMemo(()=>a.filter(g=>g.poolType!=="CrossPool").map(g=>({...g,icon:r(g.tokenAddress,g.tokenSymbol)})),[a,r]),c=`${Dt[e]}/point.png`,f=ps[e];return(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(zt,{sectionKey:"points",title:Wd,icon:c,isEmpty:d.length===0,loading:l,children:d.map(g=>{let w=g.price?en(g.depositedRaw,g.decimals,g.price):null;return(0,me.jsxs)("article",{className:"wp-item","data-side":"reward",children:[(0,me.jsxs)("div",{className:"wp-item-body",children:[(0,me.jsxs)("div",{className:"wp-item-line",children:[(0,me.jsx)("span",{className:"wp-item-label",children:"Token"}),(0,me.jsxs)("div",{className:"wp-svc-token",children:[g.icon&&(0,me.jsx)("img",{className:"wp-svc-token-icon",src:g.icon,alt:""}),(0,me.jsx)("span",{children:g.tokenSymbol})]})]}),(0,me.jsxs)("div",{className:"wp-item-line",children:[(0,me.jsx)("span",{className:"wp-item-label",children:"Deposited"}),(0,me.jsxs)("div",{className:"wp-svc-token wp-svc-token--amount",children:[g.icon&&(0,me.jsx)("img",{className:"wp-svc-token-icon",src:g.icon,alt:""}),(0,me.jsxs)("div",{className:"wp-svc-amount",children:[(0,me.jsx)("span",{className:"wp-svc-amount-main",children:Et(g.depositedRaw,g.decimals)}),w&&(0,me.jsx)("span",{className:"wp-item-usd",children:w})]})]})]})]}),(0,me.jsx)("div",{className:"wp-item-tags",children:i.canWithdrawInline?(0,me.jsx)("button",{type:"button",className:"wp-tag wp-tag--muted",onClick:()=>i.openWithdraw(g.poolAddress),children:(0,me.jsx)("span",{className:"wp-tag-label",children:"Withdraw"})}):(0,me.jsxs)("a",{className:"wp-tag wp-tag--muted",href:f,target:"_blank",rel:"noopener noreferrer",onClick:h=>Je(h,f,{category:"portfolio",origin:"portfolio-points",payload:{position:g}},n),children:[(0,me.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,me.jsx)(It,{size:12,className:"wp-tag-icon"})]})})]},g.poolAddress)})}),(0,me.jsx)(qo,{open:i.isOpen,status:i.status,positions:d,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})]})}var Vr=G(require("react"),1);var Es=require("@tanstack/react-query");var Dd="wp:stake-info";function Ls(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,Es.useQuery)({queryKey:[Dd,e,t],queryFn:async({signal:l})=>{let d=await se("posa",e),c=await fetch(`${d}/stake/${t}`,{cache:"no-store",signal:l});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let f=await c.json();if(f.code!==0&&f.code!==200)throw new Error(`Stake info API error: ${f.code}`);return f},enabled:o,staleTime:0});return{stakeInfo:r?.data,...i}}var As=require("@tanstack/react-query");var zd="wp:stake-rewards",Gd=31;function Ps(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,As.useQuery)({queryKey:[zd,e,t],queryFn:async({signal:a})=>{let l=await se("posa",e),d=await fetch(`${l}/rewards/${t}?limit=${Gd}`,{cache:"no-store",signal:a});if(!d.ok)throw new Error(`Stake rewards fetch failed: ${d.status}`);let c=await d.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:o,staleTime:0});return{latestReward:r?.[0]??null,aprAccrued:ns(r),...i}}var Bs=require("@tanstack/react-query"),Hd="wp:staking-onchain";function Fs(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...i}=(0,Bs.useQuery)({queryKey:[Hd,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...i}}var jr=require("react"),Os=G(require("bignumber.js"),1);function _s(e){return e?.trim().toUpperCase()==="CROSS"}function Ms(e){return new Os.default(e||"0").isGreaterThan(0)}function Yo(e,t,n=!0){let{allPools:o}=Ln(e,n),r=(0,jr.useMemo)(()=>{for(let c of o)for(let f of[c.deposit_token,...c.reward_tokens])if(_s(f?.symbol)&&Ms(f.price))return f.price},[o]),i=n&&r===void 0,{tokens:a}=Vt(e,t,i),{statsMap:l}=qt(e,i),d=Ie[e].cross;return(0,jr.useMemo)(()=>{if(r)return r;let c=a.find(f=>f.chainId===d&&_s(f.symbol));if(c){let f=l.get(Nt(c.chainId,c.address));if(f&&Ms(f.price))return f.price}return"0"},[r,a,l,d])}var Kt=G(require("bignumber.js"),1),Re=require("react/jsx-runtime"),Ud="CROSS Staking";function $d(e){if(!e)return"\u2014";let t=new Kt.default(e);return t.isFinite()?`${t.toFormat(2,Kt.default.ROUND_DOWN)}%`:"\u2014"}function Ws(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=qe(),r=!!t,{stakeInfo:i,isLoading:a}=Ls(e,t,r),{latestReward:l,aprAccrued:d,isLoading:c}=Ps(e,t,r),{onchain:f}=Fs(t,o,r),g=Yo(e,t,r),w=`${Dt[e]}/cross-staking.png`,h=us[e],x=i?.total_stake??"0",m=Vr.useMemo(()=>f?new Kt.default(f.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??i?.rewards_earned??"0",[f,l,i]),b=Vr.useMemo(()=>f?new Kt.default(f.stakedWei.toString()).shiftedBy(-18):new Kt.default(x),[f,x]),y=d!==void 0?new Kt.default(d):void 0,R=i?.days_since_first_stake,u=y!==void 0&&y.isFinite()&&b.isGreaterThan(0)&&R!==null&&R!==void 0?y.div(b).times(365).div(Math.max(1,R)).times(100):void 0,N=!(new Kt.default(x).isZero()&&new Kt.default(m).isZero()),k=en(x,0,g),T=en(m,0,g);return(0,Re.jsx)(zt,{sectionKey:"staking",title:Ud,icon:w,iconFit:"contain",isEmpty:!N,loading:a||c,children:(0,Re.jsxs)("article",{className:"wp-item","data-side":"stake",children:[(0,Re.jsxs)("div",{className:"wp-item-body",children:[(0,Re.jsxs)("div",{className:"wp-item-line",children:[(0,Re.jsx)("span",{className:"wp-item-label",children:"Staked"}),(0,Re.jsxs)("div",{className:"wp-svc-amount",children:[(0,Re.jsxs)("span",{className:"wp-svc-amount-main",children:[Dr(x)," CROSS"]}),k&&(0,Re.jsx)("span",{className:"wp-item-usd",children:k})]})]}),(0,Re.jsxs)("div",{className:"wp-item-line",children:[(0,Re.jsx)("span",{className:"wp-item-label",children:"Rewards Earned"}),(0,Re.jsxs)("div",{className:"wp-svc-amount",children:[(0,Re.jsxs)("span",{className:"wp-svc-amount-main",children:[Dr(m)," CROSS"]}),T&&(0,Re.jsx)("span",{className:"wp-item-usd",children:T})]})]}),(0,Re.jsxs)("div",{className:"wp-item-line",children:[(0,Re.jsx)("span",{className:"wp-item-label",children:"My APR"}),(0,Re.jsx)("span",{children:$d(u?.toString(10))})]})]}),(0,Re.jsx)("div",{className:"wp-item-tags",children:(0,Re.jsxs)("a",{className:"wp-tag wp-tag--mint",href:h,target:"_blank",rel:"noopener noreferrer",onClick:C=>Je(C,h,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:i}},n),children:[(0,Re.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,Re.jsx)(It,{size:12,className:"wp-tag-icon"})]})})]})})}var qr=G(require("react"),1);var Ds=require("@tanstack/react-query");var jd="wp:game-swap-pools";function zs(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,Ds.useQuery)({queryKey:[jd,e,t],queryFn:async({signal:a})=>{let l=await se("gameSwap",e),d=await fetch(`${l}/addresses/${t}/portfolio`,{cache:"no-store",signal:a});if(!d.ok)throw new Error(`Game-swap portfolio fetch failed: ${d.status}`);return(await d.json()).pools??[]},enabled:o,staleTime:0});return{pools:r??[],...i}}var Gs=require("@tanstack/react-query");var Vd="wp:game-swap-lp-balances";function Hs(e,t,n,o){let r=[...n].map(d=>d.toLowerCase()).sort(),i=!!t&&r.length>0,{data:a,...l}=(0,Gs.useQuery)({queryKey:[Vd,e,t,r,!!o],queryFn:async({signal:d})=>{let c=o?await o(r):await bs(e,t,r,d),f={};for(let[g,w]of Object.entries(c))f[g.toLowerCase()]=w;return f},enabled:i,staleTime:0});return{balances:a??{},...l}}var Lt=G(require("bignumber.js"),1),he=require("react/jsx-runtime"),qd="Gametoken LP",$s=18,Kd=new Lt.default("0.0001");function Us(e){return e?.trim().toUpperCase()==="CROSS"}function Qd(e){return e&&e>0?e:$s}function Yd(e){let t=Us(e.token_a?.symbol)&&!Us(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=Qd(t?e.token_a?.decimals:e.token_b?.decimals),r=new Lt.default(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new Lt.default(0):r.times(2)}function Zd(e,t){let n=e.token_a?.symbol?.trim()||"TOKEN",o=e.token_b?.symbol?.trim()||"CROSS",r=t?.decimals??$s,i,a;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let l=new Lt.default(t.balance.toString()),d=new Lt.default(t.totalSupply.toString()),c=l.div(d);i=c.times(100);let f=c.times(Yd(e));if(f.isGreaterThan(0)){let g=new Lt.default(e.quote_usd??e.cross_usd??"0");a=g.isGreaterThan(0)?`$${f.times(g).toFormat(2,Lt.default.ROUND_DOWN)}`:`${f.toFormat(4,Lt.default.ROUND_DOWN)} CROSS`}}return{pool:e,tokenASymbol:n,tokenBSymbol:o,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:r,sharePercent:i,valueText:a}}function js(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=qe(),r=!!t,{pools:i,isLoading:a}=zs(e,t,r),l=qr.useMemo(()=>i.map(x=>x.pair_address).filter(Boolean),[i]),{balances:d,isLoading:c}=Hs(e,t,l,o),f=`${Dt[e]}/dex.png`,g=Object.keys(d).length>0,w=qr.useMemo(()=>{let x=i.map(m=>Zd(m,d[m.pair_address?.toLowerCase()]));return g?x.filter(m=>m.lpAmountRaw?new Lt.default(m.lpAmountRaw).shiftedBy(-m.lpDecimals).isGreaterThanOrEqualTo(Kd):!1):x},[i,d,g]),h=x=>{let m=x.token_a?.address??x.pair_address;return`${ms[e]}/tokens/${m}?trade=deposit`};return(0,he.jsx)(zt,{sectionKey:"gameSwap",title:qd,icon:f,iconFit:"contain",isEmpty:w.length===0,loading:a||c,children:w.map(x=>{let{pool:m}=x,b=h(m),y=`${x.tokenASymbol} / ${x.tokenBSymbol}`,R=m.token_a?.logo_url,u=m.token_b?.logo_url;return(0,he.jsxs)("article",{className:"wp-item","data-side":"game-swap",children:[(0,he.jsxs)("div",{className:"wp-item-body",children:[(0,he.jsxs)("div",{className:"wp-item-line",children:[(0,he.jsx)("span",{className:"wp-item-label",children:"Pool"}),(0,he.jsxs)("div",{className:"wp-svc-token",children:[(0,he.jsxs)("span",{className:"wp-token-stack","aria-hidden":!0,children:[R&&(0,he.jsx)("img",{className:"wp-svc-token-icon",src:R,alt:""}),u&&(0,he.jsx)("img",{className:"wp-svc-token-icon",src:u,alt:""})]}),(0,he.jsx)("span",{children:y})]})]}),x.lpAmountRaw!==void 0&&(0,he.jsxs)("div",{className:"wp-item-line",children:[(0,he.jsx)("span",{className:"wp-item-label",children:"My LP"}),(0,he.jsxs)("span",{children:[Et(x.lpAmountRaw,x.lpDecimals)," LP"]})]}),x.sharePercent!==void 0&&(0,he.jsxs)("div",{className:"wp-item-line",children:[(0,he.jsx)("span",{className:"wp-item-label",children:"Pool Share"}),(0,he.jsxs)("span",{children:[x.sharePercent.toFormat(2,Lt.default.ROUND_DOWN),"%"]})]}),x.valueText!==void 0&&(0,he.jsxs)("div",{className:"wp-item-line",children:[(0,he.jsx)("span",{className:"wp-item-label",children:"Value"}),(0,he.jsx)("span",{children:x.valueText})]})]}),(0,he.jsx)("div",{className:"wp-item-tags",children:(0,he.jsxs)("a",{className:"wp-tag wp-tag--mint",href:b,target:"_blank",rel:"noopener noreferrer",onClick:N=>Je(N,b,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:m}},n),children:[(0,he.jsx)("span",{className:"wp-tag-label",children:"Manage"}),(0,he.jsx)(It,{size:12,className:"wp-tag-icon"})]})})]},m.pair_address)})})}var Qt=G(require("bignumber.js"),1),Zs=require("react");var Vs=require("@tanstack/react-query");var Xd="wp:forge-pools";function qs(e,t,n=!0){let o=n&&!!t,{data:r,...i}=(0,Vs.useQuery)({queryKey:[Xd,e,t],queryFn:async()=>{let l=await se("bondingCurve",e),d=await fetch(`${l}/v1/users/${t}/pools`,{cache:"no-store"});if(!d.ok)throw new Error(`forge pools fetch failed: ${d.status}`);return(await d.json()).data?.items??[]},enabled:o,staleTime:0}),a=r??[];return{pools:a,isEmpty:a.length===0,...i}}var Ks=require("@tanstack/react-query"),Qs=require("react");var Jd="wp:forge-token-detail";async function ep(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Ys(e,t,n=!0){let o=(0,Ks.useQueries)({queries:t.map(a=>({queryKey:[Jd,e,a],queryFn:async()=>ep(await se("bondingCurve",e),a),enabled:n&&!!a,staleTime:3e4}))}),r=(0,Qs.useMemo)(()=>{let a=new Map;for(let l=0;l<o.length;l++){let d=o[l]?.data,c=t[l];d&&c&&a.set(c.toLowerCase(),d)}return a},[o,t]),i=o.some(a=>a.isLoading);return{detailMap:r,isLoading:i}}var ve=require("react/jsx-runtime"),tp="Forge",Xs=18,np="https://contents.crosstoken.io/wallet/token/images/FT.png";function op(e){if(!e||e==="0")return"0";let t=new Qt.default(e).shiftedBy(-Xs);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Qt.default.ROUND_DOWN):t.toFormat(4,Qt.default.ROUND_DOWN)}function rp(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 ip(e,t,n){let o=new Qt.default(n||"0");if(!o.isGreaterThan(0))return null;let r=new Qt.default(e.total_supply||"0"),i=new Qt.default(e.lp_balance||"0"),a=new Qt.default(t?.reserve_b||"0").shiftedBy(-Xs);if(!r.isGreaterThan(0)||!i.isGreaterThan(0)||!a.isGreaterThan(0))return null;let l=a.times(2),c=i.div(r).times(l).times(o);return c.isFinite()?`$${c.toFormat(2,Qt.default.ROUND_DOWN)}`:null}function Js(){let{env:e,walletAddress:t,onOutlink:n}=qe(),o=!!t,{pools:r,isEmpty:i,isLoading:a}=qs(e,t,o),l=(0,Zs.useMemo)(()=>r.map(w=>w.token.address),[r]),{detailMap:d}=Ys(e,l,o&&l.length>0),c=Yo(e,t,o),f=w=>`${fs[e]}/forge/token/${w.token.address}`,g=`${Dt[e]}/forge.png`;return(0,ve.jsx)(zt,{sectionKey:"forge",title:tp,icon:g,iconFit:"contain",isEmpty:i,loading:a,children:r.map(w=>{let h=d.get(w.token.address.toLowerCase()),x=h?.image_url||h?.image||w.token.image||np,m=h?.symbol||w.token.symbol,b=f(w),y=ip(w,h,c);return(0,ve.jsxs)("a",{className:"wp-item","data-side":"lp",href:b,target:"_blank",rel:"noopener noreferrer",onClick:R=>Je(R,b,{category:"portfolio",origin:"portfolio-forge",payload:{pool:w,tokenDetail:h}},n),children:[(0,ve.jsxs)("div",{className:"wp-item-body",children:[(0,ve.jsxs)("div",{className:"wp-item-line",children:[(0,ve.jsx)("span",{className:"wp-item-label",children:"Asset"}),(0,ve.jsxs)("div",{className:"wp-svc-token",children:[(0,ve.jsx)("img",{className:"wp-svc-token-icon",src:x,alt:""}),(0,ve.jsx)("span",{children:m}),h?.name&&(0,ve.jsx)("span",{className:"wp-token-subtle",children:h.name})]})]}),(0,ve.jsxs)("div",{className:"wp-item-line",children:[(0,ve.jsx)("span",{className:"wp-item-label",children:"LP Balance"}),(0,ve.jsx)("div",{className:"wp-svc-token wp-svc-token--amount",children:(0,ve.jsxs)("div",{className:"wp-svc-amount",children:[(0,ve.jsx)("span",{className:"wp-svc-amount-main",children:op(w.lp_balance)}),y&&(0,ve.jsx)("span",{className:"wp-item-usd",children:y})]})})]}),(0,ve.jsxs)("div",{className:"wp-item-line",children:[(0,ve.jsx)("span",{className:"wp-item-label",children:"Ownership"}),(0,ve.jsx)("span",{className:"wp-line-value",children:rp(w.pool_ownership)})]})]}),(0,ve.jsx)("div",{className:"wp-item-tags",children:(0,ve.jsxs)("span",{className:"wp-tag wp-tag--muted",children:[(0,ve.jsx)("span",{className:"wp-tag-label",children:"Withdraw"}),(0,ve.jsx)(It,{size:12,className:"wp-tag-icon"})]})})]},w.pair_address)})})}var Qn=["rewards","points","staking","gameSwap","forge"];Z(`.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
+ `);var K=require("react/jsx-runtime"),Kr=15,ap="wp:";function gn({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:i=!0,variant:a="embed",className:l,onOutlink:d,lpBalanceReader:c,stakingRewardsReader:f,sendTransaction:g,estimateGas:w,sections:h}){let x=Fe(e),m=Ne.useCallback(q=>!h||h.includes(q),[h]),b=!!n,y=(0,el.useQueryClient)(),[R,u]=Ne.useState({}),N=Ne.useCallback((q,ae)=>{u(be=>{let dt=be[q];return dt&&dt.loading===ae.loading&&dt.empty===ae.empty?be:{...be,[q]:ae}})},[]),k=Ne.useCallback(q=>{u(ae=>{if(!(q in ae))return ae;let be={...ae};return delete be[q],be})},[]),T=Ne.useMemo(()=>({report:N,unregister:k}),[N,k]),[C,$]=Ne.useState(Kr),[D,z]=Ne.useState(!1),[B,ie]=Ne.useState(!1),I=Ne.useRef(void 0),te=Ne.useCallback(()=>{y.invalidateQueries({predicate:q=>typeof q.queryKey[0]=="string"&&q.queryKey[0].startsWith(ap)})},[y]),H=Ne.useCallback(()=>{te(),z(!0),setTimeout(()=>z(!1),600),$(Kr)},[te]);Ne.useEffect(()=>{if(!b)return;let q=setInterval(()=>{$(ae=>ae<=1?(H(),Kr):ae-1)},1e3);return()=>clearInterval(q)},[b,H]);let Y=Ne.useCallback(()=>{r?.()},[r]),ce=b?jt(x,n,{size:64}):void 0,ye=Ne.useCallback(async()=>{if(!(B||!n))try{await navigator.clipboard.writeText(n),ie(!0),clearTimeout(I.current),I.current=setTimeout(()=>ie(!1),2e3)}catch{}},[n,B]);Ne.useEffect(()=>()=>clearTimeout(I.current),[]);let j=Ne.useMemo(()=>({env:x,theme:t,open:!0,walletAddress:n,close:Y,onOutlink:d,lpBalanceReader:c,stakingRewardsReader:f,sendTransaction:g,estimateGas:w}),[x,t,n,Y,d,c,f,g,w]),pe=Qn.filter(m),ue=pe.length>0&&pe.every(q=>{let ae=R[q];return!!ae&&!ae.loading}),V=ue&&pe.every(q=>R[q]?.empty),Me=pe.some(q=>{let ae=R[q];return!!ae&&!ae.empty}),F=pe.length>0&&!ue&&!Me,ne=(0,K.jsxs)(K.Fragment,{children:[i&&(0,K.jsxs)("div",{className:"wp-header",children:[(0,K.jsxs)("div",{className:"wp-header-account",children:[r&&(0,K.jsx)("button",{type:"button",className:"wp-header-btn","aria-label":"Back",onClick:r,children:(0,K.jsx)(Za,{})}),(0,K.jsx)("span",{className:"wp-header-avatar","aria-hidden":!0,children:ce&&(0,K.jsx)("img",{src:ce,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&(0,K.jsxs)("div",{className:"wp-header-account-meta",children:[o&&(0,K.jsx)("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&(0,K.jsxs)("button",{type:"button",className:"wp-header-address-btn",onClick:ye,"aria-label":"Copy wallet address",children:[(0,K.jsx)("span",{className:"wp-header-address",children:Uo(n)}),(0,K.jsx)("span",{className:"wp-header-address-copy","data-copied":B,children:B?(0,K.jsx)(ln,{size:14}):(0,K.jsx)(Gn,{size:14})})]})]})]}),(0,K.jsxs)("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio",onClick:H,children:[(0,K.jsx)(Xa,{className:D?"wp-spin-once":void 0}),b&&(0,K.jsx)("span",{className:"wp-refresh-badge",children:C})]})]}),(0,K.jsx)("div",{className:"wp-body",children:(0,K.jsxs)("div",{className:"wp-body-inner","data-empty":V||void 0,children:[m("rewards")&&(0,K.jsx)(Ts,{}),m("points")&&(0,K.jsx)(Is,{}),m("staking")&&(0,K.jsx)(Ws,{}),m("gameSwap")&&(0,K.jsx)(js,{}),m("forge")&&(0,K.jsx)(Js,{}),F&&(0,K.jsx)("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:(0,K.jsx)("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),V&&(0,K.jsxs)("div",{className:"wp-portfolio-empty",role:"status",children:[(0,K.jsx)("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:(0,K.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,K.jsx)("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),(0,K.jsx)("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),(0,K.jsx)("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),(0,K.jsx)("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),(0,K.jsx)("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across CROSS services will appear here."})]})]})})]});return(0,K.jsx)(Vn.Provider,{value:j,children:(0,K.jsx)(Or.Provider,{value:T,children:a==="none"?ne:(0,K.jsx)("div",{className:fe(a==="fullscreen"?"wp-fullscreen":"wp-embed",l),"data-theme":t,children:ne})})})}var hn=require("react/jsx-runtime");function tl({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:l}=qe();return(0,hn.jsxs)(Yn.Drawer.Portal,{children:[(0,hn.jsx)(Yn.Drawer.Overlay,{className:"wp-overlay"}),(0,hn.jsxs)(Yn.Drawer.Content,{className:fe("wp-fullscreen",e),"data-theme":n,children:[(0,hn.jsx)(Yn.Drawer.Title,{className:"wp-sr-only",children:"Portfolio"}),(0,hn.jsx)(gn,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:l})]})]})}var Qr=require("react/jsx-runtime");function sp({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:l,sendTransaction:d,estimateGas:c,children:f}){let g=Fe(e),w=o!==void 0,[h,x]=bn.useState(!1),m=w?o:h,b=bn.useCallback(u=>{w||x(u),r?.(u)},[w,r]),y=bn.useCallback(()=>b(!1),[b]),R=bn.useMemo(()=>({env:g,theme:t,open:m,walletAddress:n,close:y,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:l,sendTransaction:d,estimateGas:c}),[g,t,m,n,y,i,a,l,d,c]);return(0,Qr.jsx)(Vn.Provider,{value:R,children:(0,Qr.jsx)(nl.Drawer.Root,{direction:"bottom",open:m,onOpenChange:b,noBodyStyles:!0,children:f})})}var Yr=Object.assign(sp,{Trigger:Qa,Content:tl});var L=G(require("react"),1),wn=require("react-dom"),Pt=G(require("bignumber.js"),1);var et=require("react/jsx-runtime");function ol({size:e=20,className:t}){return(0,et.jsxs)("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:[(0,et.jsx)("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),(0,et.jsx)("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function rl({size:e=16,className:t}){return(0,et.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,et.jsx)("path",{d:"M2.667 8a5.333 5.333 0 1 0 1.562-3.771L2.667 5.79M2.667 2.667v3.124h3.124M8 5.333V8l1.667 1",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function il({size:e=16,className:t}){return(0,et.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,et.jsx)("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 al({size:e=20,className:t}){return(0,et.jsx)("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,et.jsx)("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function sl({size:e=16,className:t}){return(0,et.jsx)("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:(0,et.jsx)("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function ll({size:e=12,className:t}){return(0,et.jsx)("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,et.jsx)("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"})})}var P=G(require("react"),1);var Zr=G(require("bignumber.js"),1);function cl(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function dl(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,Zr.default.ROUND_DOWN).toFixed()}function lp(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 cp(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new Zr.default(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:cl(t)&&cl(n)?e.lastChangedBy==="to"?{fromAmount:dl(r.multipliedBy(n).dividedBy(t))}:{toAmount:dl(r.multipliedBy(t).dividedBy(n))}:lp(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function pl({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):cp(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var fl=15,dp=18,hl="cross_bridge_terms_accepted",pp=3600*24*365;function fp(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,fl);let r=t.slice(0,o).slice(0,fl),i=t.slice(o+1).slice(0,dp);return`${r}.${i}`}function up(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${hl}=true`)}function mp(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${hl}=true`,"Path=/",`Max-Age=${pp}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function gp(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 ul(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function hp(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([ul(e.symbol),ul(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function At(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Zo(e){return e[0]}function Xr(e,t,n,o){if(n&&!At(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??Zo(e);let i=e.findIndex(l=>At(l,t)),a=i>=0?e[i+1]:void 0;return a&&!At(a,t)?a:e.find(l=>!At(l,t))??t}function ml({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 Xo(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),...Xo(n.cause,t+1),...Xo(n.data,t+1),...Xo(n.error,t+1)]}function Jr(e){let t=Xo(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 gl(e,t){return Jr(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
9
+ `)[0]?.trim()||t}function bl(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:i,approveBridge:a,history:l=[],initialSlippage:d="1",termsUrl:c=Tn,getQuote:f,submitBridge:g,onSubmitted:w,onSuccess:h,onFailed:x,onExit:m}=e,b=P.useMemo(()=>pl({getQuote:f,submitBridge:g}),[f,g]),[y,R]=P.useState("form"),[u,N]=P.useState(n??Zo(t)),[k,T]=P.useState(()=>Xr(t,n??Zo(t),o,r)),[C,$]=P.useState(""),[D,z]=P.useState(""),[B,ie]=P.useState("from"),[I,te]=P.useState(d),[H,Y]=P.useState(null),ce=P.useMemo(()=>hp(u,k),[u,k]),ye=P.useMemo(()=>ce?"1":I==="auto"?gp(H?.priceImpact):I,[ce,I,H?.priceImpact]),[j,pe]=P.useState(""),[ue,V]=P.useState("idle"),[Me,F]=P.useState(""),[ne,q]=P.useState(null),[ae,be]=P.useState([]),[dt,bt]=P.useState(!1),[nt,Ut]=P.useState(up),[Oe,Ee]=P.useState(null),[pt,We]=P.useState(!1),[He,Le]=P.useState(null),[Bt,wt]=P.useState(null),[Ft,it]=P.useState(!1),[xt,ft]=P.useState(!1),Ce=P.useRef(0),_t=P.useRef(null),ut=P.useCallback(()=>{_t.current&&(clearTimeout(_t.current),_t.current=null)},[]),Ue=P.useCallback(O=>{ut(),wt(O)},[ut]);P.useEffect(()=>ut,[ut]),P.useEffect(()=>{let O=t.find(we=>At(we,u))??Zo(t),ze=O?r?.(O,t):void 0,Q=ze?.find(we=>At(we,k))??(ze?void 0:t.find(we=>At(we,k)))??Xr(t,O,void 0,r);N(O),T(Q)},[r,t,u,k]);let De=P.useCallback((O,ze)=>{let Q=fp(O);if(!Q){Ce.current+=1,$(""),z(""),ie(ze),Y(null),pe(""),V("idle");return}ze==="from"?$(Q):z(Q),ie(ze),pe("")},[]),$e=P.useCallback(()=>{Ce.current+=1,$(""),z(""),ie("from"),Y(null),pe(""),F(""),V("idle"),Ee(null),We(!1),Le(null),it(!1),Ue(null)},[Ue]),ot=P.useCallback(O=>{At(O,u)||(N(O),T(Xr(t,O,void 0,r)),$e())},[u,r,$e,t]),at=P.useCallback(O=>{At(O,k)||At(O,u)||(T(O),$e())},[u,$e,k]),rt=P.useMemo(()=>u?r?.(u,t)??t.filter(O=>!At(O,u)):[],[u,r,t]),mt=P.useCallback(()=>{u?.balance&&De(u.balance,"from")},[u?.balance,De]),vt=P.useCallback(()=>{!u||!k||(N(k),T(u),$e())},[u,$e,k]),Ke=P.useCallback(()=>{Ce.current+=1,$(""),z(""),ie("from"),Y(null),pe(""),F("")},[]);P.useEffect(()=>{if(!u||!k)return;if(!C&&!D){Y(null),pe(""),V(Q=>Q==="quoting"?"idle":Q);return}let O=++Ce.current,ze=ml({fromToken:u,toToken:k,fromAmount:C,toAmount:D,lastChangedBy:B,slippage:I});V(Q=>Q==="submitting"?Q:b.canQuote?"quoting":"idle"),(async()=>{try{let Q=await b.getQuote(ze);if(Ce.current!==O)return;Q.fromAmount!==void 0&&B==="to"&&$(Q.fromAmount),Q.toAmount!==void 0&&B==="from"&&z(Q.toAmount),Y(Q.summary??null),pe(Q.error??"")}catch(Q){if(Ce.current!==O)return;pe(Q instanceof Error?Q.message:"Failed to quote bridge.")}finally{Ce.current===O&&V(Q=>Q==="quoting"?"idle":Q)}})()},[C,u,B,b,I,D,k]);let Qe=P.useCallback(()=>!u||!k?null:ml({fromToken:u,toToken:k,fromAmount:C,toAmount:D,lastChangedBy:B,slippage:ye}),[ye,C,u,B,D,k]),Ye=P.useCallback(async(O,ze)=>{F(""),it(!1),We(!1),V("submitting");try{if(!ze?.skipApprovalCheck&&i){let we=await i(O);if(we){Ee(we),Le(O),V("idle");return}}Ee(null),Le(null),Ue("processing");let Q=await b.submitBridge(O);q(Q),V("success"),be(we=>[{id:Q.txHash,timestamp:new Date().toISOString(),txHash:Q.txHash,fromToken:Q.fromToken,toToken:Q.toToken,fromAmount:Q.fromAmount,toAmount:Q.toAmount,summary:H??void 0,status:"pending"},...we.filter(po=>po.txHash!==Q.txHash)]),Ke(),ft(!0),Ue(null),it(!0),w?.(Q),h?.(Q)}catch(Q){if(Ue(null),Jr(Q)){V("idle");return}let we=gl(Q,"Failed to submit bridge.");F(we),V("error"),x?.({message:we})}},[i,x,w,h,b,Ke,Ue,H]),E=P.useCallback(async()=>{if(j)return;let O=Qe();if(O){if(!nt){Le(O),bt(!0);return}await Ye(O)}},[Qe,j,Ye,nt]),oe=P.useCallback(async()=>{let O=He??Qe();O&&(mp(),Ut(!0),bt(!1),await Ye(O))},[Qe,He,Ye]),Te=P.useCallback(()=>{bt(!1),Le(null)},[]),st=P.useCallback(async()=>{if(!(ue==="submitting"||!Oe||!He||!a)){F(""),V("submitting");try{await a(He,Oe),Ee(null),V("idle"),We(!0)}catch(O){if(Jr(O)){V("idle");return}let ze=gl(O,"Failed to approve token.");F(ze),V("error"),x?.({message:ze})}}},[Oe,a,x,He,Ye,ue]),gt=P.useCallback(()=>{ue!=="submitting"&&(Ee(null),We(!1),Le(null),V("idle"))},[ue]),yt=P.useCallback(async()=>{if(ue==="submitting")return;let O=He??Qe();if(!O){We(!1),F("Bridge input is no longer available. Please try again."),V("error");return}We(!1),await Ye(O,{skipApprovalCheck:!0})},[Qe,He,Ye,ue]),yn=P.useCallback(()=>{it(!1)},[]),kt=P.useCallback(O=>{R(O),O==="history"&&ft(!1)},[]),co=P.useCallback(()=>{if(y==="history"){kt("form");return}m?.()},[m,kt,y]),nn=P.useMemo(()=>[...l,...ae.filter(O=>!l.some(ze=>ze.txHash===O.txHash))],[l,ae]);return{step:y,setStep:kt,status:ue,error:Me,quoteError:j,fromToken:u,toToken:k,tokens:t,availableToTokens:rt,fromAmount:C,toAmount:D,lastChangedBy:B,slippage:I,effectiveSlippage:ye,slippageLocked:ce,setSlippage:te,summary:H,history:nn,submitted:ne,canSubmit:b.canSubmit,termsOpen:dt,approvalInfo:Oe,approvalSuccessOpen:pt,approveBridge:a,pendingSubmitInput:He,submitToast:Bt,successDialogOpen:Ft,dismissSuccessDialog:yn,hasNewHistory:xt,termsUrl:c,setFromToken:N,setToToken:T,selectFromToken:ot,selectToToken:at,setAmount:De,setMax:mt,swapTokens:vt,submit:E,confirmTerms:oe,cancelTerms:Te,confirmApproval:st,cancelApproval:gt,continueAfterApproval:yt,back:co}}Z(`.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
+ `);var s=require("react/jsx-runtime"),Sl=L.createContext(void 0);function An(){return L.useContext(Sl)}function bp(e){let[t,n]=L.useState(void 0);return L.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 wl=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],wp=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function xp(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function xl(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 vp(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Rl(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function vl(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 yp(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 kp(e,t){if(!t)return!1;let n=new Pt.default(e||"0"),o=new Pt.default(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function Sp(e){if(e.priceUsd===void 0)return null;let t=new Pt.default(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function Rp(e){if(e.priceUsd===void 0)return null;let t=new Pt.default(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function Cl(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,Pt.default.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),i=new Pt.default(o||"0").toFormat(0);return r?`${i}.${r}`:i}function Cp(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function Tp(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 Np(e){let t=new Pt.default(e||"0");return!t.isFinite()||t.isNaN()?e||"0":Cl(t)}function Ip(e,t){if(t?.priceUsd===void 0)return null;let n=new Pt.default(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function er(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function Ep(e,t){return t==="all"?!0:er(e)===t}function Lp(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function yl(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 Il(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Jo(e){return!e||e==="0"||Number(e)===0}function Ap(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 Pp(e){let t=e.fromToken,n=e.toToken,o=Nl(t,n),r=e.fromAmount||"0",i=e.toAmount||"0",a=o!==void 0&&!Il(o),l=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:a?[{label:"Route",value:t&&n?`${yl(t.chainId)} \u2192 ${yl(n.chainId)}`:"-"},{label:"Validator Fee",value:Jo(r)?"0":"Free",tone:Jo(r)?"default":"accent"},{label:"Network Fee",value:Jo(r)?"0":"Free",tone:Jo(r)?"default":"accent"}]:void 0,swapInfo:l?[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 Zn({token:e,size:t=20}){let n=e?.iconUrl;return(0,s.jsx)("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?(0,s.jsx)("img",{src:n,alt:"",width:t,height:t,draggable:!1}):(0,s.jsx)("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function kl({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:i,locked:a=!1}){return(0,s.jsxs)("section",{className:"bf-amount-panel",children:[(0,s.jsxs)("div",{className:"bf-amount-head",children:[(0,s.jsx)("span",{children:e}),(0,s.jsxs)("span",{className:"bf-balance",children:[Rl(t?.balance??"0")," ",t?.symbol??""]})]}),(0,s.jsxs)("div",{className:"bf-amount-main",children:[(0,s.jsxs)("label",{className:"bf-amount-input-wrap",children:[(0,s.jsxs)("span",{className:"bf-sr-only",children:[e," amount"]}),(0,s.jsx)("input",{type:"text",inputMode:"decimal",value:n,onChange:l=>r(l.target.value),placeholder:"0",className:"bf-amount-input"}),(0,s.jsx)("span",{className:"bf-amount-usd",children:o})]}),(0,s.jsxs)("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:[(0,s.jsx)(Zn,{token:t}),(0,s.jsx)("span",{children:t?.symbol??"Select"}),!a&&(0,s.jsx)(dn,{size:16})]})]})]})}function Bp({flow:e,side:t,onClose:n}){let o=L.useId(),[r,i]=L.useState(""),[a,l]=L.useState(null),d=An(),c=t==="from"?e.fromToken:e.toToken;L.useEffect(()=>{l(document.body)},[]),L.useEffect(()=>{let h=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n]);let f=L.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),g=L.useMemo(()=>{let h=r.trim().toLowerCase();return h?f.filter(x=>x.symbol.toLowerCase().includes(h)||x.name.toLowerCase().includes(h)):f},[r,f]),w=L.useCallback(h=>{t==="from"?e.selectFromToken(h):e.selectToToken(h),n()},[e,n,t]);return a?(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-token-picker-overlay","data-theme":d,role:"presentation",onMouseDown:h=>{h.target===h.currentTarget&&n()},children:(0,s.jsxs)("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[(0,s.jsx)("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),(0,s.jsxs)("header",{className:"bf-token-picker-head",children:[(0,s.jsx)("h3",{id:o,children:"Select a token"}),(0,s.jsx)("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:(0,s.jsx)(Mt,{size:24})})]}),(0,s.jsxs)("label",{className:"bf-token-search",children:[(0,s.jsx)(ol,{size:20}),(0,s.jsx)("span",{className:"bf-sr-only",children:"Search tokens"}),(0,s.jsx)("input",{value:r,onChange:h=>i(h.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),(0,s.jsxs)("div",{className:"bf-token-list",children:[g.map(h=>{let x=Tl(h,c),m=x?Rp(h):Sp(h);return(0,s.jsxs)("button",{type:"button",className:"bf-token-row","data-selected":x?"true":"false",onClick:()=>w(h),children:[(0,s.jsxs)("span",{className:"bf-token-row-left",children:[(0,s.jsx)(Zn,{token:h,size:40}),(0,s.jsxs)("span",{className:"bf-token-meta",children:[(0,s.jsx)("span",{className:"bf-token-symbol",children:h.symbol}),!x&&(0,s.jsx)("span",{className:"bf-token-name",children:h.name})]})]}),(0,s.jsxs)("span",{className:"bf-token-row-right",children:[(0,s.jsxs)("span",{className:"bf-token-balance",children:[Rl(h.balance),x?null:` ${h.symbol}`]}),m&&(0,s.jsx)("span",{className:"bf-token-price",children:m})]})]},vp(h))}),g.length===0&&(0,s.jsx)("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a):null}function Fp({flow:e,onClose:t}){let n=L.useId(),[o,r]=L.useState(null),i=wl.find(m=>m.value===e.slippage),[a,l]=L.useState(e.slippage&&!i?e.slippage:""),d=a.trim()!==""&&a.trim()!==".",c=d?Number(a):NaN,f=Number.isFinite(c)&&c>50,g=Number.isFinite(c)&&c>5&&!f,w=m=>{e.setSlippage(m),t()},h=()=>{!d||f||(e.setSlippage(xl(a)),t())};if(L.useEffect(()=>{r(document.body)},[]),L.useEffect(()=>{let m=b=>{b.key==="Escape"&&t()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t]),!o)return null;let x=An();return(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-slippage-overlay","data-theme":x,role:"presentation",onMouseDown:m=>{m.target===m.currentTarget&&t()},children:(0,s.jsxs)("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,s.jsxs)("header",{className:"bf-slippage-head",children:[(0,s.jsx)("h3",{id:n,children:"Slippage Settings"}),(0,s.jsx)("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:(0,s.jsx)(Mt,{size:24})})]}),(0,s.jsxs)("div",{className:"bf-slippage-body",children:[(0,s.jsx)("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."}),(0,s.jsxs)("div",{className:"bf-slippage-controls",children:[(0,s.jsx)("div",{className:"bf-slippage-presets",children:wl.map(m=>(0,s.jsx)("button",{type:"button",className:"bf-slippage-preset","data-selected":!d&&e.slippage===m.value?"true":"false",onClick:()=>w(m.value),children:m.label},m.value))}),(0,s.jsxs)("label",{className:"bf-slippage-custom","data-selected":d?"true":"false",children:[(0,s.jsx)("span",{className:"bf-sr-only",children:"Custom slippage percent"}),(0,s.jsx)("input",{value:a,onChange:m=>{l(xl(m.target.value))},onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),h())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),(0,s.jsx)("span",{"aria-hidden":"true",children:"%"})]})]}),f?(0,s.jsx)("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):g?(0,s.jsx)("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,d&&(0,s.jsx)("button",{type:"button",className:"bf-slippage-apply",onClick:h,disabled:f,children:"Apply"})]})]})}),o)}function _p({flow:e}){let t=L.useId(),[n,o]=L.useState(!1),[r,i]=L.useState(null),a=An();return L.useEffect(()=>{i(document.body)},[]),L.useEffect(()=>{let l=d=>{d.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!r||!e.termsOpen?null:(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:l=>{l.target===l.currentTarget&&e.cancelTerms()},children:(0,s.jsxs)("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,s.jsx)("h3",{id:t,children:"Agree to Terms of Service"}),(0,s.jsx)("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),(0,s.jsxs)("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[(0,s.jsx)("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,"aria-label":"Agree to Terms of Use",onClick:()=>o(l=>!l),children:(0,s.jsx)("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"})}),(0,s.jsxs)("div",{className:"bf-terms-copy",children:[(0,s.jsx)("span",{className:"bf-terms-label",children:"Agree to Terms of Use"}),e.termsUrl&&(0,s.jsx)("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),(0,s.jsx)("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),(0,s.jsx)("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,children:"Confirm"})]})}),r)}function Mp({value:e,disabled:t=!1}){let[n,o]=L.useState(!1);return(0,s.jsx)("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 Op({flow:e,approval:t}){let n=L.useId(),[o,r]=L.useState(null),i=An();if(L.useEffect(()=>{r(document.body)},[]),L.useEffect(()=>{let d=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e]),!o)return null;let a=e.status==="submitting"||!e.approveBridge,l=e.status==="submitting";return(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",children:(0,s.jsxs)("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[(0,s.jsxs)("h3",{id:n,children:["Approve ",t.token.symbol]}),(0,s.jsx)(Zn,{token:t.token,size:72}),(0,s.jsxs)("div",{className:"bf-approve-address-box",children:[(0,s.jsx)("span",{children:"Token Address"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:t.tokenAddress}),(0,s.jsx)(Mp,{value:t.tokenAddress,disabled:l})]})]}),(0,s.jsxs)("div",{className:"bf-action-buttons",children:[(0,s.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),(0,s.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":l,children:[l&&(0,s.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,s.jsx)("span",{children:l?"Approving...":"Approve"})]})]})]})}),o)}function Wp({flow:e}){let t=L.useId(),[n,o]=L.useState(null),r=An();if(L.useEffect(()=>{o(document.body)},[]),L.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=l=>{l.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(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:(0,s.jsxs)("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[(0,s.jsx)("h3",{id:t,children:"Approval Success"}),(0,s.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,s.jsxs)("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",(0,s.jsx)("br",{}),"Please continue to the next step."]}),(0,s.jsxs)("div",{className:"bf-action-buttons",children:[(0,s.jsx)("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:i,children:"Cancel"}),(0,s.jsxs)("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:i,"aria-busy":i,children:[i&&(0,s.jsx)("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),(0,s.jsx)("span",{children:i?"Continuing...":"Continue"})]})]})]})}),n)}function Dp({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,i]=L.useState(!1),a=L.useMemo(()=>{let c=new Pt.default(e||"0"),f=new Pt.default(t||"0");return!c.isFinite()||!f.isFinite()||c.lte(0)||f.lte(0)?null:r?c.dividedBy(f):f.dividedBy(c)},[e,r,t]);if(!a||!n||!o||n.symbol===o.symbol)return null;let l=r?o.symbol:n.symbol,d=r?n.symbol:o.symbol;return(0,s.jsxs)("button",{type:"button",className:"bf-exchange-rate",onClick:()=>i(c=>!c),children:[(0,s.jsxs)("span",{children:["1 ",l]}),(0,s.jsx)(ll,{size:12}),(0,s.jsxs)("span",{children:[Cl(a)," ",d]})]})}function zp({flow:e}){return e.submitToast?(0,s.jsxs)("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[(0,s.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,s.jsx)("span",{className:"bf-status-spinner"})}),(0,s.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,s.jsx)("strong",{children:"Transaction Processing"}),(0,s.jsx)("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function Gp({message:e}){let[t,n]=L.useState(!1);return L.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:(0,s.jsxs)("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[(0,s.jsx)("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:(0,s.jsx)("span",{className:"bf-status-error-mark",children:"!"})}),(0,s.jsxs)("span",{className:"bf-status-toast-copy",children:[(0,s.jsx)("strong",{children:"Error"}),(0,s.jsx)("span",{children:e})]})]})}function Hp(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 Up({flow:e}){let t=L.useId(),[n,o]=L.useState(null),r=e.submitted,i=An();return L.useEffect(()=>{o(document.body)},[]),L.useEffect(()=>{if(!e.successDialogOpen)return;let a=l=>{l.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.successDialogOpen||!r?null:(0,wn.createPortal)((0,s.jsx)("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:(0,s.jsx)("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:(0,s.jsxs)("div",{className:"bf-success-body",children:[(0,s.jsx)("span",{className:"bf-success-mark","aria-hidden":"true"}),(0,s.jsxs)("div",{className:"bf-success-copy",children:[(0,s.jsx)("strong",{id:t,children:Hp(r.pathType)}),(0,s.jsx)("span",{children:"Please check the results in the history."})]}),(0,s.jsx)("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,l)=>(0,s.jsxs)(L.Fragment,{children:[l>0&&(0,s.jsx)("span",{className:"bf-success-route-arrow",children:"\u2192"}),(0,s.jsx)(ei,{token:a,size:43})]},`${a.symbol}-${l}`))}),(0,s.jsx)("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(0,s.jsx)("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?(0,s.jsx)("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):(0,s.jsx)("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function $p({row:e}){return e.routeTokens&&e.routeTokens.length>0?(0,s.jsx)("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>(0,s.jsxs)(L.Fragment,{children:[n>0&&(0,s.jsx)("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),(0,s.jsx)(ei,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?(0,s.jsxs)("span",{className:"bf-info-value-token",children:[(0,s.jsx)(ei,{token:e.valueToken}),(0,s.jsx)("span",{children:e.value})]}):(0,s.jsx)(s.Fragment,{children:e.value})}function El({rows:e}){return!e||e.length===0?null:(0,s.jsx)("div",{className:"bf-info-rows",children:e.map((t,n)=>(0,s.jsxs)("div",{className:"bf-info-row",children:[(0,s.jsxs)("span",{className:"bf-info-label",children:[(0,s.jsx)("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),(0,s.jsx)("span",{children:t.label})]}),(0,s.jsx)("span",{className:"bf-info-value","data-tone":t.tone??"default",children:(0,s.jsx)($p,{row:t})})]},`${t.label}-${t.value}`))})}function jp(e,t,n){return e.pathType==="bridge"?"Bridge Info":Il(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function Vp({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return(0,s.jsx)(s.Fragment,{children:r.map(i=>{let a=i==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?(0,s.jsxs)("div",{className:"bf-info-section",children:[o&&(0,s.jsx)("h4",{children:i==="swap"?"Swap Info":"Bridge Info"}),(0,s.jsx)(El,{rows:a})]},i):null})})}function qp({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=jp(e,t,n),[i,a]=L.useState(!0),[l,d]=L.useState(!0);return(0,s.jsxs)("div",{className:"bf-details",children:[e.liquidity&&(0,s.jsxs)("section",{className:"bf-liquidity",children:[(0,s.jsxs)("div",{className:"bf-liquidity-head",children:[(0,s.jsx)("span",{children:e.liquidity.label??"Available Liquidity"}),(0,s.jsx)("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),(0,s.jsx)("div",{className:"bf-liquidity-track",children:(0,s.jsx)("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&(0,s.jsxs)("section",{className:"bf-detail-section bf-info-card","data-open":i?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-collapse-head","aria-expanded":i,onClick:()=>a(c=>!c),children:[(0,s.jsx)("h3",{children:r}),(0,s.jsx)(dn,{size:16,className:"bf-collapse-chevron"})]}),i&&(0,s.jsx)("div",{className:"bf-collapse-body",children:(0,s.jsx)(Vp,{summary:e})})]}),o&&(0,s.jsxs)("section",{className:"bf-detail-section bf-tx-fee-section","data-open":l?"true":"false",children:[(0,s.jsxs)("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":l,onClick:()=>d(c=>!c),children:[(0,s.jsx)("h3",{children:"Est. Tx Fee"}),(0,s.jsxs)("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&(0,s.jsx)("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&(0,s.jsx)("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),(0,s.jsx)("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:yp(e.txFeeInfo?.estTxFee??"0")}),(0,s.jsx)(dn,{size:16,className:"bf-collapse-chevron"})]})]}),l&&(0,s.jsx)("div",{className:"bf-collapse-body",children:(0,s.jsx)(El,{rows:e.txFee})})]})]})}function Kp({item:e}){let t=er(e),n=Ip(e.fromAmount,e.fromToken);return(0,s.jsxs)("article",{className:"bf-history-item",children:[(0,s.jsxs)("div",{className:"bf-history-item-head",children:[(0,s.jsx)("span",{className:"bf-history-status","data-status":t,children:Lp(t)}),(0,s.jsx)("time",{className:"bf-history-time",dateTime:e.timestamp,children:Tp(e.timestamp)})]}),(0,s.jsxs)("div",{className:"bf-history-item-body",children:[(0,s.jsxs)("strong",{className:"bf-history-amount",children:[Np(e.fromAmount)," ",e.fromToken.symbol]}),(0,s.jsxs)("div",{className:"bf-history-meta",children:[(0,s.jsx)("span",{className:"bf-history-usd",children:n??Cp(e.txHash)}),(0,s.jsxs)("span",{className:"bf-history-route",children:[(0,s.jsxs)("span",{className:"bf-history-route-token",children:[(0,s.jsx)(Zn,{token:e.fromToken,size:16}),(0,s.jsx)("span",{children:e.fromToken.symbol})]}),(0,s.jsx)(sl,{size:16,className:"bf-history-route-arrow"}),(0,s.jsxs)("span",{className:"bf-history-route-token",children:[(0,s.jsx)(Zn,{token:e.toToken,size:16}),(0,s.jsx)("span",{children:e.toToken.symbol})]})]})]})]})]})}function Qp({flow:e}){let[t,n]=L.useState("all"),o=e.history.some(a=>er(a)==="pending"),r=e.history.filter(a=>Ep(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return(0,s.jsxs)("main",{className:"bf-history-body",children:[(0,s.jsx)("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:wp.map(a=>(0,s.jsxs)("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>n(a.value),children:[(0,s.jsx)("span",{children:a.label}),a.value==="pending"&&o&&(0,s.jsx)("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),r.length>0?(0,s.jsx)("div",{className:"bf-history-list",children:r.map(a=>(0,s.jsx)(Kp,{item:a},a.id||a.txHash))}):(0,s.jsx)("div",{className:"bf-empty",children:i})]})}function Yp({flow:e,env:t}){let[n,o]=L.useState(null),[r,i]=L.useState(!1),[a,l]=L.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??Pp(e):null,f=In("apps.json",t,u=>pn(u?.bridgePoweredBy?.url,t)),g=Ap(e.quoteError),w=kp(e.fromAmount,e.fromToken),h=w?"Insufficient balance":g.from,x=e.quoteError&&!g.from&&!g.to?e.quoteError:"",m=e.error||x,b=e.history.some(u=>er(u)==="pending"),R=(c?.pathType??Nl(e.fromToken,e.toToken))!=="bridge";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("main",{className:"bf-body",children:[(0,s.jsxs)("div",{className:"bf-toolbar",children:[(0,s.jsxs)("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),children:[(0,s.jsx)(rl,{}),(0,s.jsx)("span",{children:"History"}),(b||e.hasNewHistory)&&(0,s.jsx)("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),R&&(0,s.jsxs)("button",{type:"button",className:"bf-chip",onClick:()=>i(!0),disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[(0,s.jsx)(il,{}),(0,s.jsx)("span",{children:e.slippageLocked?"Auto 1%":xp(e.slippage,e.effectiveSlippage)})]})]}),(0,s.jsxs)("div",{className:"bf-swap-card","data-has-from-error":h?"true":"false",children:[(0,s.jsx)(kl,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:vl(e.fromAmount,e.fromToken),onAmountChange:u=>e.setAmount(u,"from"),onTokenClick:()=>o("from")}),h&&(0,s.jsx)("div",{className:"bf-field-error",children:h}),(0,s.jsx)("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),l(u=>u+360)},style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:(0,s.jsx)(al,{size:22})}),(0,s.jsx)(kl,{label:"To",token:e.toToken,amount:e.toAmount,usd:vl(e.toAmount,e.toToken),onAmountChange:u=>e.setAmount(u,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),g.to&&(0,s.jsx)("div",{className:"bf-field-error",children:g.to})]}),(0,s.jsx)(Dp,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&(0,s.jsx)(qp,{summary:c})]}),(0,s.jsxs)("footer",{className:"bf-footer",children:[(0,s.jsx)("button",{type:"button",className:"bf-next",onClick:e.submit,disabled:e.status==="submitting"||!!e.quoteError||w,children:e.status==="submitting"?"Processing...":"Next"}),f&&(0,s.jsxs)("a",{className:"bf-powered",href:f,target:"_blank",rel:"noreferrer",children:["Powered by ",(0,s.jsx)("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&(0,s.jsx)(Bp,{flow:e,side:n,onClose:()=>o(null)}),r&&(0,s.jsx)(Fp,{flow:e,onClose:()=>i(!1)}),(0,s.jsx)(_p,{flow:e}),e.approvalInfo&&(0,s.jsx)(Op,{flow:e,approval:e.approvalInfo}),(0,s.jsx)(Wp,{flow:e}),(0,s.jsx)(zp,{flow:e}),(0,s.jsx)(Gp,{message:e.submitToast?"":m}),(0,s.jsx)(Up,{flow:e})]})}function Xn({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let i=L.useMemo(()=>Fe(n),[n]),a=bl({...r,onExit:t}),l=L.useRef(null),d=bp(l),c=a.step==="history"?"History":"Swap & Bridge";return(0,s.jsx)(Sl.Provider,{value:d,children:(0,s.jsxs)("div",{ref:l,className:fe("bf-root",o),"data-view":a.step,"data-status":a.status,children:[(0,s.jsxs)("header",{className:"bf-header",children:[(0,s.jsx)("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:(0,s.jsx)(cn,{size:24})}),(0,s.jsx)("span",{className:"bf-header-title",children:c}),(0,s.jsx)("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:(0,s.jsx)(Mt,{size:24})})]}),a.step==="history"?(0,s.jsx)(Qp,{flow:a}):(0,s.jsx)(Yp,{flow:a,env:i})]})})}var p=require("react/jsx-runtime"),Zp="On-ramp is not available in your region.";function ti(e,t,n){let o=Ie[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 Xp(e){return parseInt(e.split(":")[1],10)}function Jp(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function ef(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:l,drawerDirection:d,modal:c,showBalance:f,showForgeToken:g,showGameToken:w,showQR:h,showBridge:x,qrLogoSrc:m,walletAddress:b,accountName:y,sendAccounts:R,profileImageUrl:u,preferredTokens:N,close:k,onSelectWallet:T,onCopyAddress:C,onBuy:$,onDisconnect:D,disconnectLabel:z,termsUrl:B,termsLabel:ie,privacyUrl:I,privacyLabel:te,portalStyle:H,navContent:Y,navPosition:ce,footerContent:ye,view:j,setView:pe,selectedSendToken:ue,setSelectedSendToken:V,showPortfolio:Me,portfolioTitle:F,portfolioSections:ne,showTotalAssets:q,totalAssetsLabel:ae,sendTransaction:be,getTransactionReceipt:dt,estimateGas:bt,onOutlink:nt,lpBalanceReader:Ut,stakingRewardsReader:Oe,bridgeTokens:Ee,bridgeHistory:pt,getBridgeQuote:We,getBridgeToTokens:He,getBridgeApproval:Le,approveBridge:Bt,submitBridge:wt,onReceive:Ft,onSend:it,onBuyDisabledMessage:xt,onBridgeDisabledMessage:ft,onSendDisabledMessage:Ce}=Yt(),[_t,ut]=W.useState(null),Ue=W.useRef(void 0),De=W.useCallback(v=>{ut(v),clearTimeout(Ue.current),Ue.current=setTimeout(()=>ut(null),4e3)},[]);W.useEffect(()=>()=>clearTimeout(Ue.current),[]);let $e=!!xt,ot=W.useCallback(()=>{if($e){De(xt);return}let v=$?.();v&&typeof v.then=="function"&&v.catch(()=>{De(xt??Zp)})},[$e,xt,$,De]),at=!!ft,rt=!!Ce,{tokens:mt,isLoading:vt}=Vt(r,b,l&&f),{statsMap:Ke}=qt(r,f),{apyPercent:Qe}=Ha(),{categoryMap:Ye}=ja(r,f),E=f&&q,{displayValue:oe,isLowerBound:Te,isLoading:st}=qa(r,b,l&&E),[gt,yt]=W.useState(!1),yn=W.useRef(null),[kt,co]=W.useState(0),{holdings:nn,isLoading:O}=Oa(r,b,l&&f&&g),ze=W.useMemo(()=>nn.map(v=>v.token),[nn]),{imageMap:Q}=Wa(r,ze,g&&nn.length>0),we=W.useMemo(()=>{let v=[],_=[],re=[],Xe=new Map((N??[]).map((de,je)=>[`${Xp(de.chainId)}:${de.address.toLowerCase()}`,je]));for(let de of mt){let je=ti(r,de.chainId,de.symbol)!==void 0,Rt=`${de.chainId}:${de.address.toLowerCase()}`,rn=Xe.get(Rt),hr=new Pn.default(de.quantity.numeric).shiftedBy(-de.quantity.decimals);if(je)v.push(de);else if(rn!==void 0)_.push(de);else if(hr.isGreaterThan(0)){if(!w&&Ye.get(_r(de.chainId,de.address))==="game")continue;re.push(de)}}return v.sort((de,je)=>{let Rt=ti(r,de.chainId,de.symbol)??99,rn=ti(r,je.chainId,je.symbol)??99;return Rt-rn}),_.sort((de,je)=>{let Rt=Xe.get(`${de.chainId}:${de.address.toLowerCase()}`)??99,rn=Xe.get(`${je.chainId}:${je.address.toLowerCase()}`)??99;return Rt-rn}),re.sort((de,je)=>{let Rt=Ke.get(Nt(de.chainId,de.address)),rn=Ke.get(Nt(je.chainId,je.address)),hr=new Pn.default(de.quantity.numeric).shiftedBy(-de.quantity.decimals).multipliedBy(Rt?.price??0);return new Pn.default(je.quantity.numeric).shiftedBy(-je.quantity.decimals).multipliedBy(rn?.price??0).minus(hr).toNumber()}),[...v,..._,...re]},[mt,r,Ke,w,Ye,N]),po=W.useMemo(()=>{if(!g)return[];let v=new Set(mt.map(_=>_.address.toLowerCase()));return[...nn].filter(_=>!v.has(_.token.toLowerCase())).sort((_,re)=>{let Xe=new Pn.default(_.value);return new Pn.default(re.value).minus(Xe).toNumber()})},[nn,g,mt]),on=W.useRef(!1),[Ze,Fn]=W.useState(null),kn=W.useRef(void 0),li=Ze?.chainId??ue?.chainId??we[0]?.chainId??0,{transactionUrl:lr}=No(r,li,Ze?.txHash,!!(Ze?.txHash&&li)),St=W.useCallback(v=>{on.current=!0,pe(v)},[pe]),[nc,cr]=W.useState("recipient"),fo=W.useCallback(()=>{V(null),cr("recipient"),St("wallet")},[V,St]),dr=W.useCallback((v,_="recipient")=>{if(rt){De(Ce);return}cr(_),V(v),St("send")},[rt,Ce,De,V,St]),pr=In("apps.json",r,v=>pn(v?.gametokenBridge,r)),oc=W.useCallback(()=>{if(at){De(ft);return}pr&&window.open(pr,"_blank","noopener,noreferrer")},[at,ft,pr,De]),rc=W.useCallback(v=>{clearTimeout(kn.current),V(null),St("wallet"),Fn({status:"pending",txHash:v.txHash,chainId:v.chainId,description:`${v.amount} ${v.tokenSymbol} to ${lt(v.recipient)}`})},[V,St]),ic=W.useCallback(v=>{let _=ue?.chainId;V(null),St("wallet"),!(!v||!_)&&(Fn(re=>({status:"success",txHash:v,chainId:_,description:re?.txHash===v?re.description:"Tap to see your transaction"})),clearTimeout(kn.current),kn.current=setTimeout(()=>Fn(null),5e3))},[ue?.chainId,V,St]),ac=W.useCallback(v=>{let _=v.txHash;_&&(Fn({status:"error",txHash:_,chainId:v.chainId,description:v.message}),clearTimeout(kn.current),kn.current=setTimeout(()=>Fn(null),5e3))},[]),_n=W.useMemo(()=>{if(Ft)return Ft;if(h)return()=>St("qr")},[Ft,h,St]),fr=W.useMemo(()=>{if(it)return it;if(we.length===0)return;let v=we[0];return()=>dr(v,"token")},[it,we,dr]),sc=W.useCallback(()=>{if(rt){De(Ce);return}fr?.()},[rt,Ce,fr,De]);W.useEffect(()=>{l||(on.current=!1,cr("recipient"))},[l]);let ci=W.useRef(null);W.useEffect(()=>{let v=ci.current;if(!v||!a)return;let _=re=>{re.pointerType==="touch"&&re.stopPropagation()};return v.addEventListener("pointerdown",_),()=>v.removeEventListener("pointerdown",_)},[a]);let[Sn,di]=W.useState(!1),ur=W.useRef(void 0),[Mn,On]=W.useState(!1);W.useEffect(()=>{if(!Mn)return;let v=()=>On(!1),_=Xe=>{Xe.key==="Escape"&&On(!1)},re=setTimeout(()=>{document.addEventListener("mousedown",v,!0),document.addEventListener("keydown",_,!0)},0);return()=>{clearTimeout(re),document.removeEventListener("mousedown",v,!0),document.removeEventListener("keydown",_,!0)}},[Mn]),W.useEffect(()=>{On(!1)},[b]),W.useEffect(()=>()=>clearTimeout(ur.current),[]),W.useEffect(()=>()=>clearTimeout(kn.current),[]),W.useEffect(()=>{let v=yn.current;if(!v||ye===null){co(0);return}let _=()=>{co(v.offsetHeight)};if(_(),typeof ResizeObserver>"u")return;let re=new ResizeObserver(_);return re.observe(v),()=>re.disconnect()},[ye]);let pi=W.useCallback(async()=>{if(!Sn)try{await navigator.clipboard.writeText(b),di(!0),clearTimeout(ur.current),ur.current=setTimeout(()=>di(!1),2e3),C?.(b,!0)}catch{C?.(b,!1)}},[b,C,Sn]),uo=W.useCallback(v=>{v.currentTarget.setAttribute("data-loaded","true")},[]),fi=W.useMemo(()=>({background:ef(b)}),[b]),mo=W.useMemo(()=>u||jt(r,b,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[u,r,b,i]),mr=W.useMemo(()=>Jp(oe),[oe]),ui=B||I?(0,p.jsxs)("div",{className:"wi-legal-links",children:[B&&(0,p.jsx)("a",{className:"wi-legal-link",href:B,target:"_blank",rel:"noopener noreferrer",onClick:v=>Je(v,B,{category:"terms",origin:"terms"},nt),children:ie}),B&&I&&(0,p.jsx)("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),I&&(0,p.jsx)("a",{className:"wi-legal-link",href:I,target:"_blank",rel:"noopener noreferrer",onClick:v=>Je(v,I,{category:"privacy",origin:"privacy"},nt),children:te})]}):null,mi=D?(0,p.jsxs)("button",{type:"button",className:"wi-disconnect-btn",onClick:()=>{D(),k()},children:[(0,p.jsx)(Di,{size:16}),(0,p.jsx)("span",{className:"wi-disconnect-label",children:z})]}):null,lc=f&&!Y?(0,p.jsxs)("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[(0,p.jsxs)("button",{type:"button",className:fe("wi-action-card",$e&&"wi-action-card--dimmed"),onClick:ot,disabled:!$&&!$e,"aria-disabled":$e||void 0,"aria-label":"Buy",children:[(0,p.jsx)(ji,{size:20}),(0,p.jsx)("span",{children:"Buy"})]}),x?(0,p.jsxs)("button",{type:"button",className:fe("wi-action-card",at&&"wi-action-card--dimmed"),onClick:oc,"aria-disabled":at||void 0,"aria-label":"Bridge",children:[(0,p.jsx)(Vi,{size:20}),(0,p.jsx)("span",{children:"Bridge"})]}):(0,p.jsxs)("button",{type:"button",className:"wi-action-card",onClick:_n,disabled:!_n,"aria-label":"Receive",children:[(0,p.jsx)(Co,{size:20}),(0,p.jsx)("span",{children:"Receive"})]}),(0,p.jsxs)("button",{type:"button",className:fe("wi-action-card",rt&&"wi-action-card--dimmed"),onClick:sc,disabled:!rt&&!fr,"aria-disabled":rt||void 0,"aria-label":"Send",children:[(0,p.jsx)(Ui,{size:20}),(0,p.jsx)("span",{children:"Send"})]}),Me?(0,p.jsxs)("button",{type:"button",className:"wi-action-card",onClick:()=>St("portfolio"),"aria-label":"View portfolio",children:[(0,p.jsx)($i,{size:20}),(0,p.jsx)("span",{children:"Portfolio"})]}):x?(0,p.jsxs)("button",{type:"button",className:"wi-action-card",onClick:_n,disabled:!_n,"aria-label":"Receive",children:[(0,p.jsx)(Co,{size:20}),(0,p.jsx)("span",{children:"Receive"})]}):null]}):null,cc=(0,p.jsxs)("div",{className:fe("wi-view-inner",on.current&&"wi-view-wallet"),children:[E&&(0,p.jsxs)("div",{className:"wi-total-section",children:[(0,p.jsxs)("div",{className:"wi-total-head",children:[(0,p.jsx)("span",{className:"wi-total-label",children:ae}),(0,p.jsx)("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:v=>{v.stopPropagation(),yt(_=>!_)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),yt(_=>!_))},"aria-label":gt?"Show balance":"Hide balance",children:gt?(0,p.jsx)(Gi,{}):(0,p.jsx)(zi,{})})]}),(0,p.jsx)("div",{className:"wi-total-body",children:st?(0,p.jsx)("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):(0,p.jsx)("div",{className:"wi-total-value","data-hidden":gt||void 0,children:gt?(0,p.jsx)("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):(0,p.jsxs)(p.Fragment,{children:[Te&&(0,p.jsx)("span",{className:"wi-total-lte",children:"\u2264"}),(0,p.jsx)("span",{className:"wi-total-currency",children:"$"}),(0,p.jsx)("span",{className:"wi-total-amount",children:mr.main}),mr.decimal&&(0,p.jsx)("span",{className:"wi-total-decimal",children:mr.decimal})]})})})]}),ce==="top"&&(Y?(0,p.jsx)("div",{className:"wi-nav-fixed",children:Y}):lc),f&&(0,p.jsx)("div",{ref:ci,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:(0,p.jsxs)("div",{className:"wi-token-list",children:[vt&&Array.from({length:5},(v,_)=>(0,p.jsxs)("div",{className:"wi-skeleton-item",children:[(0,p.jsxs)("div",{className:"wi-skeleton-left",children:[(0,p.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,p.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,p.jsxs)("div",{className:"wi-skeleton-right",children:[(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},_)),!vt&&we.length===0&&!g&&(0,p.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),we.map(v=>{let _=Ke.get(Nt(v.chainId,v.address)),re=_?parseFloat(_.percent_change_24h):null,Xe=re!==null&&re>=0,de=$n(r,v.chainId),je=ga(v.address);return(0,p.jsxs)("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>dr(v),"aria-label":`Send ${v.symbol}`,children:[(0,p.jsxs)("div",{className:"wi-token-left",children:[(0,p.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,p.jsx)("img",{src:v.icon_url,alt:v.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:uo,onError:Rt=>{Rt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),de&&(0,p.jsx)("img",{src:de,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Rt=>{Rt.currentTarget.style.display="none"}})]}),(0,p.jsxs)("div",{className:"wi-token-info",children:[(0,p.jsxs)("span",{className:"wi-token-name-row",children:[(0,p.jsx)("span",{className:"wi-token-name",children:v.symbol}),je&&Qe!==null&&(0,p.jsx)("span",{className:"wi-token-apy",children:`APY ${Qe>=0?"+":"-"}${(Qe>=0?Math.floor:Math.ceil)(Math.abs(Qe)*100)/100}%`})]}),_&&(0,p.jsxs)("div",{className:"wi-token-price-row",children:[(0,p.jsx)("span",{className:"wi-token-price",children:Rr(_.price)}),(0,p.jsx)("span",{className:"wi-token-change","data-positive":Xe,"data-zero":re===0||void 0,children:re!==null&&(re===0?"0%":`${Xe?"+":"-"}${(Xe?Math.floor:Math.ceil)(Math.abs(re)*100)/100}%`)})]})]})]}),(0,p.jsxs)("div",{className:"wi-token-right",children:[(0,p.jsx)("span",{className:"wi-token-balance",children:Xt(v.quantity.numeric,v.quantity.decimals)}),_&&(0,p.jsx)("span",{className:"wi-token-value",children:Ki(v.quantity.numeric,v.quantity.decimals,_.price)})]})]},`${v.address}-${v.chainId}`)}),g&&O&&Array.from({length:3},(v,_)=>(0,p.jsxs)("div",{className:"wi-skeleton-item",children:[(0,p.jsxs)("div",{className:"wi-skeleton-left",children:[(0,p.jsx)("div",{className:"wi-skeleton-block wi-skeleton-icon"}),(0,p.jsxs)("div",{className:"wi-skeleton-lines",children:[(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),(0,p.jsxs)("div",{className:"wi-skeleton-right",children:[(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),(0,p.jsx)("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${_}`)),g&&!O&&!vt&&we.length===0&&po.length===0&&(0,p.jsx)("div",{className:"wi-empty",children:"No Tokens Found"}),g&&po.map(v=>{let _=Q.get(v.token)||"",re=$n(r,Ie[r].cross);return(0,p.jsxs)("div",{className:"wi-token-item",children:[(0,p.jsxs)("div",{className:"wi-token-left",children:[(0,p.jsxs)("div",{className:"wi-token-icon-wrap",children:[(0,p.jsx)("img",{src:_||"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:uo,onError:Xe=>{Xe.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),re&&(0,p.jsx)("img",{src:re,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Xe=>{Xe.currentTarget.style.display="none"}})]}),(0,p.jsxs)("div",{className:"wi-token-info",children:[(0,p.jsx)("span",{className:"wi-token-name",children:v.token_name}),(0,p.jsx)("div",{className:"wi-token-price-row",children:(0,p.jsxs)("span",{className:"wi-token-price",children:[Xt(v.current_price,18)," CROSS"]})})]})]}),(0,p.jsxs)("div",{className:"wi-token-right",children:[(0,p.jsx)("span",{className:"wi-token-balance",children:Xt(v.balance,18)}),(0,p.jsx)("span",{className:"wi-token-value",children:Rr(v.current_value_usd)})]})]},`forge-${v.token}`)})]})}),ce==="bottom"&&Y&&(0,p.jsx)("div",{className:"wi-nav-fixed",children:Y}),mi&&(0,p.jsx)("div",{className:"wi-wallet-disconnect-row",children:mi})]},"wallet"),dc=Me?(0,p.jsx)("div",{className:fe("wi-view-inner wi-portfolio-body",on.current&&"wi-view-portfolio"),children:(0,p.jsx)(gn,{env:r,theme:i,walletAddress:b,showHeader:!1,onOutlink:nt,lpBalanceReader:Ut,stakingRewardsReader:Oe,sendTransaction:be,estimateGas:bt,sections:ne})},"portfolio"):null,pc=ue?(0,p.jsx)("div",{className:fe("wi-view-inner wi-send-body",on.current&&"wi-view-send"),children:(0,p.jsx)(jn,{env:r,theme:i,walletAddress:b,accountName:y,accounts:R,initialStep:nc,token:ue,tokens:we,onTokenChange:V,sendTransaction:be,getTransactionReceipt:dt,estimateGas:bt,getTokenPriceUsd:v=>{let _=Ke.get(Nt(v.chainId,v.address));if(!_?.price)return;let re=parseFloat(_.price);return Number.isFinite(re)?re:void 0},onClose:k,onBackToWallet:fo,onSubmitted:rc,onSuccess:ic,onFailed:ac,onOutlink:nt})},"send"):null,fc=W.useMemo(()=>Ee||we.map(v=>{let _=Ke.get(Nt(v.chainId,v.address)),re=_?.price?parseFloat(_.price):void 0;return{name:v.name,symbol:v.symbol,chainId:v.chainId,address:v.address,decimals:v.quantity.decimals,balance:Un(v.quantity.numeric,v.quantity.decimals),iconUrl:v.icon_url,priceUsd:Number.isFinite(re)?re:void 0}}),[Ee,Ke,we]),uc=(0,p.jsx)("div",{className:fe("wi-view-inner wi-bridge-body",on.current&&"wi-view-send"),children:(0,p.jsx)(Xn,{env:r,walletAddress:b,tokens:fc,history:pt,termsUrl:B,getQuote:We,getToTokens:He,getApproval:Le,approveBridge:Bt,submitBridge:wt,onClose:k,onBackToWallet:fo})},"bridge"),gr=!!T&&y?.trim().toLowerCase()!=="my wallet",gi=(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("span",{className:"wi-receive-avatar",children:[(0,p.jsx)("span",{className:"wi-avatar-fallback",style:fi}),mo&&(0,p.jsx)("img",{src:mo,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:uo,onError:v=>{v.currentTarget.style.display="none"}})]}),(0,p.jsx)("span",{className:"wi-receive-account-name",children:y??"Account 1"}),gr&&(0,p.jsx)("span",{className:"wi-receive-chevron","data-open":Mn,"aria-hidden":"true",children:(0,p.jsx)(dn,{size:16})})]}),mc=(0,p.jsxs)("div",{className:fe("wi-view-inner wi-qr-body",on.current&&"wi-view-qr"),children:[(0,p.jsxs)("div",{className:"wi-receive-section",children:[gr?(0,p.jsx)("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{On(!0),T?.()},"aria-label":"Switch account",children:gi}):(0,p.jsx)("div",{className:"wi-receive-account",children:gi}),(0,p.jsxs)("div",{className:"wi-qr-block",children:[(0,p.jsxs)("div",{className:"wi-qr-box",children:[(0,p.jsx)(Ll.QRCodeSVG,{value:b,size:180,level:"H",marginSize:2,...m&&{imageSettings:{src:m,height:33,width:33,excavate:!0}}}),!m&&(0,p.jsx)("div",{className:"wi-qr-logo",children:(0,p.jsx)(Hi,{size:33})})]}),(0,p.jsx)("p",{className:"wi-qr-address",children:b})]}),(0,p.jsxs)("button",{type:"button",className:"wi-qr-copy-btn",onClick:pi,children:[(0,p.jsx)("span",{className:"wi-qr-copy-icon",children:Sn?(0,p.jsx)(ln,{size:16}):(0,p.jsx)(Gn,{size:16})}),(0,p.jsx)("span",{className:"wi-qr-copy-text",children:Sn?"Copied!":"Copy address"})]})]}),ui&&(0,p.jsx)("div",{className:"wi-receive-footer",children:ui})]},"qr"),gc=j==="qr"||j==="portfolio"||j==="send"||j==="bridge",hi=ye!==null?(0,p.jsx)("div",{className:"wi-builtin-footer",children:ye}):null,bi=(0,p.jsxs)("div",{className:"wi-account-text",children:[gr?(0,p.jsxs)("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{On(!0),T?.()},"aria-label":"Switch account","aria-expanded":Mn,children:[(0,p.jsx)("span",{className:"wi-account-name",children:y??"Account 1"}),(0,p.jsx)("span",{className:"wi-account-switch","data-open":Mn,"aria-hidden":"true",children:(0,p.jsx)(dn,{size:20})})]}):(0,p.jsx)("div",{className:"wi-account-row",children:(0,p.jsx)("span",{className:"wi-account-name",children:y??"Account 1"})}),(0,p.jsxs)("button",{type:"button",className:"wi-address-row-btn",onClick:pi,"aria-label":"Copy address",children:[(0,p.jsx)("span",{className:"wi-account-address",children:lt(b)}),(0,p.jsx)("span",{className:"wi-account-copy","data-copied":Sn,children:Sn?(0,p.jsx)(ln,{size:12}):(0,p.jsx)(Gn,{size:12})})]})]}),wi=(0,p.jsxs)(p.Fragment,{children:[o,j==="qr"?(0,p.jsx)("div",{className:"wi-sticky-header",children:(0,p.jsxs)("div",{className:"wi-header wi-header--receive",children:[(0,p.jsx)("button",{type:"button",className:"wi-header-back",onClick:fo,"aria-label":"Back",children:(0,p.jsx)(cn,{size:24})}),(0,p.jsx)("span",{className:"wi-receive-title",children:"Receive"}),(0,p.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,p.jsx)(Mt,{size:24})})]})}):j==="send"||j==="bridge"?null:gc?(0,p.jsxs)("div",{className:"wi-sticky-header",children:[(0,p.jsxs)("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[(0,p.jsx)("button",{type:"button",className:"wi-header-back",onClick:fo,"aria-label":"Back",children:(0,p.jsx)(cn,{size:24})}),(0,p.jsx)("div",{className:"wi-account-block wi-account-block--sub-account",children:bi}),(0,p.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,p.jsx)(Mt,{size:24})})]}),(0,p.jsx)("hr",{className:"wi-divider"})]}):(0,p.jsxs)("div",{className:"wi-sticky-header",children:[(0,p.jsxs)("div",{className:"wi-header wi-header--wallet",children:[(0,p.jsxs)("div",{className:"wi-account-block",children:[(0,p.jsxs)("div",{className:"wi-avatar",children:[(0,p.jsx)("div",{className:"wi-avatar-fallback",style:fi}),mo&&(0,p.jsx)("img",{src:mo,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:uo,onError:v=>{v.currentTarget.style.display="none"}})]}),bi]}),(0,p.jsxs)("div",{className:"wi-header-actions",children:[h&&x&&(0,p.jsx)("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:_n,"aria-label":"Show QR code",children:(0,p.jsx)(Co,{size:20})}),(0,p.jsx)("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:(0,p.jsx)(Mt,{size:24})})]})]}),(0,p.jsx)("hr",{className:"wi-divider"})]}),(0,p.jsxs)("div",{className:"wi-view-container",children:[j==="wallet"&&cc,j==="qr"&&mc,j==="portfolio"&&dc,j==="send"&&pc,j==="bridge"&&uc]}),j==="wallet"&&_t&&(0,p.jsx)("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:_t}),j==="wallet"&&Ze&&(0,p.jsxs)("a",{className:"wi-send-toast",href:lr??"#",target:"_blank",rel:"noopener noreferrer",onClick:v=>{if(!lr){v.preventDefault();return}Je(v,lr,{category:"send",origin:"send-transaction",payload:{chainId:Ze.chainId,txHash:Ze.txHash}},nt)},children:[(0,p.jsx)("span",{className:"wi-send-toast-icon","data-status":Ze.status,"aria-hidden":!0,children:Ze.status==="pending"?(0,p.jsx)("span",{className:"wi-send-toast-spinner"}):Ze.status==="error"?(0,p.jsx)("span",{className:"wi-send-toast-error-dot"}):(0,p.jsx)(qi,{size:20})}),(0,p.jsxs)("span",{className:"wi-send-toast-copy",children:[(0,p.jsx)("span",{className:"wi-send-toast-title",children:Ze.status==="pending"?"Sending...":Ze.status==="error"?"Send failed":"Send complete"}),(0,p.jsx)("span",{className:"wi-send-toast-desc",children:Ze.status==="pending"||Ze.status==="error"?Ze.description:"Tap to see your transaction"})]})]}),hi&&j!=="portfolio"&&j!=="send"&&(0,p.jsx)("div",{className:"wi-sticky-footer",children:(0,p.jsx)("div",{className:"wi-footer",ref:yn,children:hi})})]}),xi={...H,...kt>0?{"--wi-footer-height":`${kt}px`}:null};return a?(0,p.jsxs)(Jn.Drawer.Portal,{children:[c&&(0,p.jsx)(Jn.Drawer.Overlay,{className:"wi-drawer-overlay"}),(0,p.jsxs)(Jn.Drawer.Content,{className:fe("wi-drawer-content",n),"data-theme":i,"data-vaul-no-drag":d==="left"||d==="right"?!0:void 0,style:xi,"data-direction":d,"data-no-balance":!f||void 0,"data-has-footer":kt>0||void 0,"data-view":j,children:[(0,p.jsx)(Jn.Drawer.Title,{className:"wi-sr-only",children:"My Wallet"}),wi]})]}):(0,p.jsxs)(p.Fragment,{children:[c&&l&&(0,p.jsx)("div",{className:"wi-drawer-overlay",onClick:k}),(0,p.jsx)(tr.Portal,{children:(0,p.jsx)(tr.Content,{align:e,sideOffset:t,className:fe("wi-popover-content",n),"data-theme":i,style:xi,"data-no-balance":!f||void 0,"data-has-footer":kt>0||void 0,"data-view":j,children:wi})})]})}var Pl=G(require("react"),1);function Bl({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=Yt();return Pl.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}var Fl=G(require("react"),1);function _l({children:e}){let{setFooterContent:t}=Yt();return Fl.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}Z(`[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
11
  `);Z(`.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
12
  `);Z(`@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
13
  `);Z(`.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
14
  `);Z(`.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
- `);var nr=require("react/jsx-runtime");function nf({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:i=!1,showForgeToken:a=!1,showGameToken:l=!0,showQR:d=!0,showBridge:c=!0,qrLogoSrc:f,walletAddress:g,accountName:w,sendAccounts:h,profileImageUrl:x,connectorId:m,connectorName:b,connectorIconUrl:y,preferredTokens:R=[],onSelectWallet:u,onCopyAddress:N,onBuy:k,onBuyDisabledMessage:T,onBridgeDisabledMessage:C,onSendDisabledMessage:$,onDisconnect:D,disconnectLabel:z="Disconnect",termsUrl:B=Nn,termsLabel:ie="Terms of Service",privacyUrl:I=To,privacyLabel:te="Privacy Policy",open:H,onOpenChange:Y,showPortfolio:ce=!1,portfolioTitle:ve="My Portfolio",portfolioSections:j,showTotalAssets:pe=!0,totalAssetsLabel:ue="Total Assets USD",sendTransaction:V,getTransactionReceipt:De,estimateGas:F,onOutlink:ne,lpBalanceReader:q,stakingRewardsReader:ae,bridgeTokens:be,bridgeHistory:dt,getBridgeQuote:ht,getBridgeToTokens:nt,getBridgeApproval:Ht,approveBridge:ze,submitBridge:Ie,onReceive:pt,onBridge:Ge,onSend:$e,style:Ee,children:At}){let bt=Oe(e),Pt=m?Gn[m]:void 0,ot=b??Pt?.name,Bt=y??Pt?.iconUrl,rt=Cn(`(max-width: ${n}px)`),Le=o??(i?"right":"bottom"),it=Le==="left"||Le==="right",ft=r??!1,Ke=H!==void 0,[wt,Te]=tt.useState(!1),Fe=Ke?H:wt,Ft=tt.useCallback($t=>{Ke||Te($t),Y?.($t)},[Ke,Y]),xt=tt.useCallback(()=>Ft(!1),[Ft]),[Qe,ut]=tt.useState(null),[vt,_e]=tt.useState("top"),[He,E]=tt.useState(null),[oe,Se]=tt.useState("wallet"),[at,Ut]=tt.useState(null);tt.useEffect(()=>{Fe||(Se("wallet"),Ut(null))},[Fe]);let st=tt.useCallback(()=>{Er(g),D?.()},[D,g]),yn=tt.useMemo(()=>({env:bt,theme:t,isMobile:rt,open:Fe,drawerDirection:Le,modal:ft,showBalance:i,showForgeToken:a,showGameToken:l,showQR:d,showBridge:c,qrLogoSrc:f,walletAddress:g,accountName:w,sendAccounts:h,profileImageUrl:x,connectorName:ot,connectorIconUrl:Bt,preferredTokens:R,close:xt,onSelectWallet:u,onCopyAddress:N,onBuy:k,onBuyDisabledMessage:T,onBridgeDisabledMessage:C,onSendDisabledMessage:$,onDisconnect:D?st:void 0,disconnectLabel:z,termsUrl:B,termsLabel:ie,privacyUrl:I,privacyLabel:te,portalStyle:Ee,navContent:Qe,navPosition:vt,setNavContent:ut,setNavPosition:_e,footerContent:He,setFooterContent:E,view:oe,setView:Se,selectedSendToken:at,setSelectedSendToken:Ut,showPortfolio:ce,portfolioTitle:ve,portfolioSections:j,showTotalAssets:pe,totalAssetsLabel:ue,sendTransaction:V,getTransactionReceipt:De,estimateGas:F,onOutlink:ne,lpBalanceReader:q,stakingRewardsReader:ae,bridgeTokens:be,bridgeHistory:dt,getBridgeQuote:ht,getBridgeToTokens:nt,getBridgeApproval:Ht,approveBridge:ze,submitBridge:Ie,onReceive:pt,onBridge:Ge,onSend:$e}),[bt,t,rt,Fe,Le,ft,i,a,l,d,c,f,g,w,h,x,ot,Bt,R,xt,u,N,k,T,C,$,D,st,z,B,ie,I,te,Ee,Qe,vt,He,oe,at,ce,ve,j,pe,ue,V,De,F,ne,q,ae,be,dt,ht,nt,Ht,ze,Ie,pt,Ge,$e]);return(0,nr.jsx)(Sr.Provider,{value:yn,children:rt?(0,nr.jsx)(Wl.Drawer.Root,{direction:Le,open:Fe,onOpenChange:Ft,handleOnly:it,noBodyStyles:!0,repositionInputs:!1,children:At},"drawer"):(0,nr.jsx)(Ol.Root,{open:Fe,onOpenChange:Ft,children:At},"popover")})}var xn=Object.assign(nf,{Trigger:Fa,Content:Pl,Nav:Fl,Footer:Ml});var Gt=G(require("react"),1),Jl=G(require("@radix-ui/react-dialog"),1),ec=require("vaul");var or=require("react"),rr=(0,or.createContext)(null);function to(){let e=(0,or.useContext)(rr);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var vn=require("react");function no(){let[e,t]=(0,vn.useState)([]),[n,o]=(0,vn.useState)(!0);(0,vn.useEffect)(()=>{if(typeof window>"u"){o(!1);return}let i=[],a=d=>{let{info:c}=d.detail;c?.rdns&&!i.some(f=>f.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 l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(l)}},[]);let r=(0,vn.useCallback)(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:n}}var Dl=G(require("@radix-ui/react-dialog"),1),zl=require("vaul");var ni=require("react/jsx-runtime");function Gl({asChild:e,children:t}){let{isMobile:n}=to(),o=n?zl.Drawer.Trigger:Dl.Trigger;return(0,ni.jsx)(o,{asChild:e??t!=null,children:t??(0,ni.jsx)("button",{type:"button",children:"Connect Wallet"})})}var zt=G(require("@radix-ui/react-dialog"),1),oo=require("vaul");var U=require("react/jsx-runtime");function ir(){return(0,U.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,U.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,U.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function Hl(){return(0,U.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,U.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,U.jsx)("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),(0,U.jsx)("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),(0,U.jsx)("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),(0,U.jsx)("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),(0,U.jsx)("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),(0,U.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,U.jsx)("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),(0,U.jsx)("defs",{children:(0,U.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,U.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function Ul(){return(0,U.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,U.jsx)("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),(0,U.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,U.jsx)("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),(0,U.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,U.jsx)("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 $l(){return(0,U.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,U.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,U.jsx)("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),(0,U.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,U.jsx)("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function jl(){return(0,U.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,U.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,U.jsx)("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),(0,U.jsx)("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),(0,U.jsx)("defs",{children:(0,U.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,U.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function Vl(){return(0,U.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,U.jsx)("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"}),(0,U.jsx)("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"}),(0,U.jsx)("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"}),(0,U.jsx)("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 ql(){return(0,U.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)("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(0,U.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var ar={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:ir},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:ir,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:ir,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:Ul},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:$l,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:jl,badge:"For SHOP"}};function oi(e){return ar[e]}var sr={google:{id:"google",name:"Google",icon:Vl},apple:{id:"apple",name:"Apple",icon:ql}};function Ql(e){return sr[e]}var A=require("react/jsx-runtime");function of({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(0,A.jsxs)("button",{type:"button",className:fe("wcm-wallet-item",i&&"wcm-wallet-item--featured"),onClick:o,children:[(0,A.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,A.jsx)("div",{className:"wcm-wallet-icon",children:(0,A.jsx)(r,{})}),(0,A.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,A.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,A.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,A.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,A.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function rf({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return(0,A.jsxs)("button",{type:"button",className:"wcm-social-item","data-provider":e.id,onClick:t,"aria-label":o,children:[(0,A.jsx)("span",{className:"wcm-social-icon",children:(0,A.jsx)(n,{})}),(0,A.jsx)("span",{className:"wcm-social-name",children:o})]})}function Yl(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:i,isDetected:a,close:l,isMobile:d}=to(),c=t.filter(w=>{let h=oi(w).visibility;return!h||h==="always"?!0:h==="desktop-only"?!d:h==="mobile-only"?d:!0}),f=o.length>0,g=c.length>0;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"wcm-header",children:[(0,A.jsxs)("div",{className:"wcm-header-text",children:[(0,A.jsx)("h2",{className:"wcm-title",children:"CROSS Wallet"}),!d&&(0,A.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,A.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:l,"aria-label":"Close",children:(0,A.jsx)(Kl,{})})]}),(0,A.jsxs)("div",{className:"wcm-body",children:[f&&(0,A.jsxs)(A.Fragment,{children:[!d&&(0,A.jsxs)("div",{className:"wcm-section-header",children:[(0,A.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,A.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,A.jsx)("div",{className:"wcm-social-grid",children:o.map(w=>{let h=Ql(w);return(0,A.jsx)(rf,{social:h,onSignIn:()=>{n[w]?.(),l()}},w)})}),g&&(0,A.jsxs)("div",{className:"wcm-separator",children:[(0,A.jsx)("div",{className:"wcm-separator-line"}),(0,A.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,A.jsx)("div",{className:"wcm-separator-line"})]})]}),g&&(0,A.jsx)("div",{className:"wcm-wallet-list",children:c.map(w=>{let h=oi(w),x=h.rdns?a(h.rdns):!1;return(0,A.jsx)(of,{wallet:h,detected:x,onConnect:()=>{e[w]?.(),l()}},w)})}),(0,A.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,A.jsx)(Zl,{href:r,children:"Terms of Service"})," and consent to its ",(0,A.jsx)(Zl,{href:i,children:"Privacy Policy"}),"."]})]})]})}function Zl({href:e,children:t}){return e?(0,A.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):(0,A.jsx)("span",{className:"wcm-terms-link",children:t})}function Xl({className:e}){let{isMobile:t,theme:n,portalStyle:o}=to();return t?(0,A.jsxs)(oo.Drawer.Portal,{children:[(0,A.jsx)(oo.Drawer.Overlay,{className:"wcm-overlay"}),(0,A.jsxs)(oo.Drawer.Content,{className:fe("wcm-drawer-content",e),"data-theme":n,style:o,children:[(0,A.jsx)(oo.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,A.jsx)("div",{className:"wcm-drawer-handle"}),(0,A.jsx)("div",{className:"wcm-drawer-body",children:(0,A.jsx)(Yl,{})})]})]}):(0,A.jsxs)(zt.Portal,{children:[(0,A.jsx)(zt.Overlay,{className:"wcm-overlay"}),(0,A.jsxs)(zt.Content,{className:fe("wcm-dialog-content",e),"data-theme":n,style:o,children:[(0,A.jsx)(zt.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,A.jsx)(zt.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,A.jsx)("div",{className:"wcm-dialog-body",children:(0,A.jsx)(Yl,{})})]})]})}Z(`.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}
15
+ `);var nr=require("react/jsx-runtime");function tf({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:i=!1,showForgeToken:a=!1,showGameToken:l=!0,showQR:d=!0,showBridge:c=!0,qrLogoSrc:f,walletAddress:g,accountName:w,sendAccounts:h,profileImageUrl:x,connectorId:m,connectorName:b,connectorIconUrl:y,preferredTokens:R=[],onSelectWallet:u,onCopyAddress:N,onBuy:k,onBuyDisabledMessage:T,onBridgeDisabledMessage:C,onSendDisabledMessage:$,onDisconnect:D,disconnectLabel:z="Disconnect",termsUrl:B=Tn,termsLabel:ie="Terms of Service",privacyUrl:I=To,privacyLabel:te="Privacy Policy",open:H,onOpenChange:Y,showPortfolio:ce=!1,portfolioTitle:ye="My Portfolio",portfolioSections:j,showTotalAssets:pe=!0,totalAssetsLabel:ue="Total Assets USD",sendTransaction:V,getTransactionReceipt:Me,estimateGas:F,onOutlink:ne,lpBalanceReader:q,stakingRewardsReader:ae,bridgeTokens:be,bridgeHistory:dt,getBridgeQuote:bt,getBridgeToTokens:nt,getBridgeApproval:Ut,approveBridge:Oe,submitBridge:Ee,onReceive:pt,onBridge:We,onSend:He,style:Le,children:Bt}){let wt=Fe(e),Ft=m?zn[m]:void 0,it=b??Ft?.name,xt=y??Ft?.iconUrl,ft=Rn(`(max-width: ${n}px)`),Ce=o??(i?"right":"bottom"),_t=Ce==="left"||Ce==="right",ut=r??!1,Ue=H!==void 0,[De,$e]=tt.useState(!1),ot=Ue?H:De,at=tt.useCallback(kt=>{Ue||$e(kt),Y?.(kt)},[Ue,Y]),rt=tt.useCallback(()=>at(!1),[at]),[mt,vt]=tt.useState(null),[Ke,Qe]=tt.useState("top"),[Ye,E]=tt.useState(null),[oe,Te]=tt.useState("wallet"),[st,gt]=tt.useState(null);tt.useEffect(()=>{ot||(Te("wallet"),gt(null))},[ot]);let yt=tt.useCallback(()=>{Er(g),D?.()},[D,g]),yn=tt.useMemo(()=>({env:wt,theme:t,isMobile:ft,open:ot,drawerDirection:Ce,modal:ut,showBalance:i,showForgeToken:a,showGameToken:l,showQR:d,showBridge:c,qrLogoSrc:f,walletAddress:g,accountName:w,sendAccounts:h,profileImageUrl:x,connectorName:it,connectorIconUrl:xt,preferredTokens:R,close:rt,onSelectWallet:u,onCopyAddress:N,onBuy:k,onBuyDisabledMessage:T,onBridgeDisabledMessage:C,onSendDisabledMessage:$,onDisconnect:D?yt:void 0,disconnectLabel:z,termsUrl:B,termsLabel:ie,privacyUrl:I,privacyLabel:te,portalStyle:Le,navContent:mt,navPosition:Ke,setNavContent:vt,setNavPosition:Qe,footerContent:Ye,setFooterContent:E,view:oe,setView:Te,selectedSendToken:st,setSelectedSendToken:gt,showPortfolio:ce,portfolioTitle:ye,portfolioSections:j,showTotalAssets:pe,totalAssetsLabel:ue,sendTransaction:V,getTransactionReceipt:Me,estimateGas:F,onOutlink:ne,lpBalanceReader:q,stakingRewardsReader:ae,bridgeTokens:be,bridgeHistory:dt,getBridgeQuote:bt,getBridgeToTokens:nt,getBridgeApproval:Ut,approveBridge:Oe,submitBridge:Ee,onReceive:pt,onBridge:We,onSend:He}),[wt,t,ft,ot,Ce,ut,i,a,l,d,c,f,g,w,h,x,it,xt,R,rt,u,N,k,T,C,$,D,yt,z,B,ie,I,te,Le,mt,Ke,Ye,oe,st,ce,ye,j,pe,ue,V,Me,F,ne,q,ae,be,dt,bt,nt,Ut,Oe,Ee,pt,We,He]);return(0,nr.jsx)(Sr.Provider,{value:yn,children:ft?(0,nr.jsx)(Ol.Drawer.Root,{direction:Ce,open:ot,onOpenChange:at,handleOnly:_t,noBodyStyles:!0,repositionInputs:!1,children:Bt},"drawer"):(0,nr.jsx)(Ml.Root,{open:ot,onOpenChange:at,children:Bt},"popover")})}var xn=Object.assign(tf,{Trigger:Ba,Content:Al,Nav:Bl,Footer:_l});var Ht=G(require("react"),1),Xl=G(require("@radix-ui/react-dialog"),1),Jl=require("vaul");var or=require("react"),rr=(0,or.createContext)(null);function eo(){let e=(0,or.useContext)(rr);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}var vn=require("react");function to(){let[e,t]=(0,vn.useState)([]),[n,o]=(0,vn.useState)(!0);(0,vn.useEffect)(()=>{if(typeof window>"u"){o(!1);return}let i=[],a=d=>{let{info:c}=d.detail;c?.rdns&&!i.some(f=>f.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 l=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(l)}},[]);let r=(0,vn.useCallback)(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:n}}var Wl=G(require("@radix-ui/react-dialog"),1),Dl=require("vaul");var ni=require("react/jsx-runtime");function zl({asChild:e,children:t}){let{isMobile:n}=eo(),o=n?Dl.Drawer.Trigger:Wl.Trigger;return(0,ni.jsx)(o,{asChild:e??t!=null,children:t??(0,ni.jsx)("button",{type:"button",children:"Connect Wallet"})})}var Gt=G(require("@radix-ui/react-dialog"),1),no=require("vaul");var U=require("react/jsx-runtime");function ir(){return(0,U.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,U.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#00D5AA"}),(0,U.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z",fill:"black"})]})}function Gl(){return(0,U.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,U.jsxs)("g",{clipPath:"url(#clip0_1331_27065)",children:[(0,U.jsx)("path",{d:"M37.2488 38.4674L28.6626 35.8175L22.1876 39.8295L17.6699 39.8274L11.191 35.8175L2.60875 38.4674L-0.00195312 29.3328L2.60875 19.1947L-0.00195312 10.6234L2.60875 0L16.0192 8.30453H23.838L37.2488 0L39.8595 10.6234L37.2488 19.1947L39.8595 29.3328L37.2488 38.4674Z",fill:"#FF5C16"}),(0,U.jsx)("path",{d:"M2.60938 0L16.0201 8.31037L15.4868 14.0137L2.60938 0ZM11.1919 29.3366L17.0925 33.9956L11.1919 35.8175V29.3366ZM16.6209 21.6342L15.4868 14.0175L8.22768 19.1971L8.22374 19.195V19.1988L8.24628 24.5302L11.1899 21.6345L16.6209 21.6342ZM37.2477 0L23.837 8.31037L24.3685 14.0137L37.2477 0ZM28.6654 29.3366L22.7646 33.9956L28.6654 35.8175V29.3366ZM31.6313 19.1985V19.1947L31.6297 19.1968L24.3705 14.0175L23.2364 21.6342H28.6651L31.6108 24.5296L31.6313 19.1985Z",fill:"#FF5C16"}),(0,U.jsx)("path",{d:"M11.191 35.8175L2.60875 38.4674L-0.00195312 29.3366H11.191V35.8175ZM16.62 21.6321L18.2595 32.6435L15.9873 26.5208L8.24368 24.5296L11.189 21.6324H16.62V21.6321ZM28.6662 35.8175L37.2488 38.4674L39.8595 29.3366H28.6662V35.8175ZM23.2375 21.6321L21.598 32.6435L23.8699 26.5208L31.6138 24.5296L28.6665 21.6324H23.2375V21.6321Z",fill:"#E34807"}),(0,U.jsx)("path",{d:"M-0.00195312 29.3328L2.60875 19.1947H8.22284L8.2434 24.5278L15.9876 26.519L18.2595 32.6414L17.0916 33.9897L11.191 29.3307H-0.00195312V29.3328ZM39.8595 29.3328L37.2488 19.1947H31.6344L31.6138 24.5278L23.8702 26.519L21.598 32.6414L22.7657 33.9897L28.6665 29.3307H39.8595V29.3328ZM23.838 8.30444H16.0192L15.4882 14.0078L18.2597 32.6355H21.598L24.3713 14.0078L23.838 8.30444Z",fill:"#FF8D5D"}),(0,U.jsx)("path",{d:"M2.60875 0L-0.00195312 10.6234L2.60875 19.1947H8.22284L15.4859 14.0137L2.60875 0ZM14.9975 23.8438H12.4541L11.0693 25.2508L15.9893 26.515L14.9975 23.842V23.8438ZM37.2488 0L39.8595 10.6234L37.2488 19.1947H31.6344L24.3716 14.0137L37.2488 0ZM24.8637 23.8438H27.4107L28.7955 25.2526L23.8699 26.5191L24.8637 23.8418V23.8438ZM22.1857 36.1956L22.7659 33.9936L21.598 32.6453H18.2572L17.0896 33.9936L17.6696 36.1956",fill:"#661800"}),(0,U.jsx)("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),(0,U.jsx)("path",{d:"M11.1914 35.8131L17.672 39.8289V36.193L17.0917 33.9912L11.1914 35.8131ZM28.6649 35.8131L22.1841 39.8289V36.193L22.7644 33.9912L28.6649 35.8131Z",fill:"#E7EBF6"})]}),(0,U.jsx)("defs",{children:(0,U.jsx)("clipPath",{id:"clip0_1331_27065",children:(0,U.jsx)("rect",{width:"40",height:"40",fill:"white"})})})]})}function Hl(){return(0,U.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,U.jsx)("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),(0,U.jsx)("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),(0,U.jsx)("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),(0,U.jsx)("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),(0,U.jsx)("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 Ul(){return(0,U.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[(0,U.jsx)("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),(0,U.jsx)("path",{d:"M89.1233 136.695V59.7551H118.481V140.524L74.5862 184.774L30.4787 140.524V107.55H59.9073V136.695L74.5862 151.303L89.1233 136.695Z",fill:"white"}),(0,U.jsx)("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),(0,U.jsx)("path",{d:"M199.534 59.9334C202.562 60.0484 208.427 60.4824 212.031 63.6902C215.635 66.898 216.937 71.0498 216.937 73.1199V104.017L198.767 114.828L216.937 125.561V172.713C216.937 174.511 216.405 178.276 211.034 181.377C205.664 184.477 202.613 184.969 201.758 184.827H143.949C141.879 184.904 136.712 184.182 132.602 180.686C128.493 177.19 128.462 175.216 128.462 173.515V125.561L146.173 114.828L128.462 104.017V71.1268C128.462 69.721 130.109 65.7781 133.237 63.5701C137.147 60.8101 141.112 59.9334 144.409 59.9334H199.534ZM158.3 122.264V166.221H187.033V122.264H158.3ZM158.3 107.794H187.033V78.5272H158.3V107.794Z",fill:"white"})]})}function $l(){return(0,U.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,U.jsxs)("g",{clipPath:"url(#clip0_1185_7785)",children:[(0,U.jsx)("path",{d:"M14 28C21.75 28 28 21.75 28 14C28 6.25 21.75 0 14 0C6.25 0 0 6.25 0 14C0 21.75 6.25 28 14 28Z",fill:"#EB0029"}),(0,U.jsx)("path",{d:"M19.4975 8.36232L6 6L13.103 23L23 11.5311L19.4975 8.36232ZM19.2801 9.4034L21.3449 11.27L15.6975 12.2424L19.2801 9.4034ZM14.4714 12.0479L8.51876 7.35252L18.247 9.05524L14.4714 12.0479ZM14.0467 12.8782L13.0765 20.5098L7.84385 7.98492L14.0467 12.8782ZM14.9454 13.2835L21.1983 12.2064L14.026 20.518L14.9454 13.2835Z",fill:"white"})]}),(0,U.jsx)("defs",{children:(0,U.jsx)("clipPath",{id:"clip0_1185_7785",children:(0,U.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})}function jl(){return(0,U.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[(0,U.jsx)("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"}),(0,U.jsx)("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"}),(0,U.jsx)("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"}),(0,U.jsx)("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(0,U.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)("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 ql(){return(0,U.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,U.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var ar={cross_embedded:{id:"cross_embedded",name:"CROSSx with Social",description:"Sign in with Google or Apple",icon:ir},cross_wallet:{id:"cross_wallet",name:"CROSSx",description:"App approval is required",icon:ir,featured:!0},cross_extension:{id:"cross_extension",name:"CROSSx Extension",description:"Browser extension approval is required",icon:ir,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:Ul,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:$l,badge:"For SHOP"}};function oi(e){return ar[e]}var sr={google:{id:"google",name:"Google",icon:jl},apple:{id:"apple",name:"Apple",icon:Vl}};function Kl(e){return sr[e]}var A=require("react/jsx-runtime");function nf({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(0,A.jsxs)("button",{type:"button",className:fe("wcm-wallet-item",i&&"wcm-wallet-item--featured"),onClick:o,children:[(0,A.jsxs)("div",{className:"wcm-wallet-item-left",children:[(0,A.jsx)("div",{className:"wcm-wallet-icon",children:(0,A.jsx)(r,{})}),(0,A.jsxs)("div",{className:"wcm-wallet-name-row",children:[(0,A.jsx)("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&(0,A.jsx)("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?(0,A.jsx)("span",{className:"wcm-installed-label",children:"Installed"}):(0,A.jsx)("span",{className:"wcm-install-btn",children:"Install"}))]})}function of({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return(0,A.jsxs)("button",{type:"button",className:"wcm-social-item","data-provider":e.id,onClick:t,"aria-label":o,children:[(0,A.jsx)("span",{className:"wcm-social-icon",children:(0,A.jsx)(n,{})}),(0,A.jsx)("span",{className:"wcm-social-name",children:o})]})}function Ql(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:i,isDetected:a,close:l,isMobile:d}=eo(),c=t.filter(w=>{let h=oi(w).visibility;return!h||h==="always"?!0:h==="desktop-only"?!d:h==="mobile-only"?d:!0}),f=o.length>0,g=c.length>0;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"wcm-header",children:[(0,A.jsxs)("div",{className:"wcm-header-text",children:[(0,A.jsx)("h2",{className:"wcm-title",children:"CROSS Wallet"}),!d&&(0,A.jsx)("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),(0,A.jsx)("button",{type:"button",className:"wcm-close-btn",onClick:l,"aria-label":"Close",children:(0,A.jsx)(ql,{})})]}),(0,A.jsxs)("div",{className:"wcm-body",children:[f&&(0,A.jsxs)(A.Fragment,{children:[!d&&(0,A.jsxs)("div",{className:"wcm-section-header",children:[(0,A.jsx)("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),(0,A.jsx)("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),(0,A.jsx)("div",{className:"wcm-social-grid",children:o.map(w=>{let h=Kl(w);return(0,A.jsx)(of,{social:h,onSignIn:()=>{n[w]?.(),l()}},w)})}),g&&(0,A.jsxs)("div",{className:"wcm-separator",children:[(0,A.jsx)("div",{className:"wcm-separator-line"}),(0,A.jsx)("span",{className:"wcm-separator-text",children:"Other Wallets"}),(0,A.jsx)("div",{className:"wcm-separator-line"})]})]}),g&&(0,A.jsx)("div",{className:"wcm-wallet-list",children:c.map(w=>{let h=oi(w),x=h.rdns?a(h.rdns):!1;return(0,A.jsx)(nf,{wallet:h,detected:x,onConnect:()=>{e[w]?.(),l()}},w)})}),(0,A.jsxs)("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",(0,A.jsx)(Yl,{href:r,children:"Terms of Service"})," and consent to its ",(0,A.jsx)(Yl,{href:i,children:"Privacy Policy"}),"."]})]})]})}function Yl({href:e,children:t}){return e?(0,A.jsx)("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer",children:t}):(0,A.jsx)("span",{className:"wcm-terms-link",children:t})}function Zl({className:e}){let{isMobile:t,theme:n,portalStyle:o}=eo();return t?(0,A.jsxs)(no.Drawer.Portal,{children:[(0,A.jsx)(no.Drawer.Overlay,{className:"wcm-overlay"}),(0,A.jsxs)(no.Drawer.Content,{className:fe("wcm-drawer-content",e),"data-theme":n,style:o,children:[(0,A.jsx)(no.Drawer.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,A.jsx)("div",{className:"wcm-drawer-handle"}),(0,A.jsx)("div",{className:"wcm-drawer-body",children:(0,A.jsx)(Ql,{})})]})]}):(0,A.jsxs)(Gt.Portal,{children:[(0,A.jsx)(Gt.Overlay,{className:"wcm-overlay"}),(0,A.jsxs)(Gt.Content,{className:fe("wcm-dialog-content",e),"data-theme":n,style:o,children:[(0,A.jsx)(Gt.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),(0,A.jsx)(Gt.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),(0,A.jsx)("div",{className:"wcm-dialog-body",children:(0,A.jsx)(Ql,{})})]})]})}Z(`.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
16
  `);Z(`@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
- `);var Fn=require("react/jsx-runtime"),af={};function sf({wallets:e,socialProviders:t=af,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:i=768,drawerDirection:a="bottom",dialogWidth:l,drawerMaxWidth:d,drawerMinWidth:c,style:f,open:g,onOpenChange:w,children:h}){let x=Cn(`(max-width: ${i}px)`),[m,b]=Gt.useState(!1),y=g!==void 0,R=y?g:m,u=Gt.useCallback(B=>{y||b(B),w?.(B)},[y,w]),N=Gt.useCallback(()=>u(!1),[u]),{isDetected:k}=no(),T=Gt.useMemo(()=>Object.keys(e),[e]),C=Gt.useMemo(()=>Object.keys(t),[t]),$=Gt.useMemo(()=>{let B={};return l&&(B["--wcm-dialog-width"]=l),d&&(B["--wcm-drawer-max-width"]=d),c&&(B["--wcm-drawer-min-width"]=c),{...B,...f}},[l,d,c,f]),D=Gt.useMemo(()=>({theme:r,isMobile:x,open:R,setOpen:u,close:N,wallets:e,activeWalletIds:T,socialProviders:t,activeSocialIds:C,termsUrl:n??Nn,privacyUrl:o??To,isDetected:k,portalStyle:$}),[r,x,R,u,N,e,T,t,C,n,o,k,$]),z=(0,Fn.jsx)("div",{"data-theme":r,style:$,children:h});return x?(0,Fn.jsx)(rr.Provider,{value:D,children:(0,Fn.jsx)(ec.Drawer.Root,{direction:a,open:R,onOpenChange:u,noBodyStyles:!0,children:z},"drawer")}):(0,Fn.jsx)(rr.Provider,{value:D,children:(0,Fn.jsx)(Jl.Root,{open:R,onOpenChange:u,children:z})})}var ri=Object.assign(sf,{Trigger:Gl,Content:Xl});Z(`.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}
17
+ `);var Bn=require("react/jsx-runtime"),rf={};function af({wallets:e,socialProviders:t=rf,termsUrl:n,privacyUrl:o,theme:r="dark",mobileBreakpoint:i=768,drawerDirection:a="bottom",dialogWidth:l,drawerMaxWidth:d,drawerMinWidth:c,style:f,open:g,onOpenChange:w,children:h}){let x=Rn(`(max-width: ${i}px)`),[m,b]=Ht.useState(!1),y=g!==void 0,R=y?g:m,u=Ht.useCallback(B=>{y||b(B),w?.(B)},[y,w]),N=Ht.useCallback(()=>u(!1),[u]),{isDetected:k}=to(),T=Ht.useMemo(()=>Object.keys(e),[e]),C=Ht.useMemo(()=>Object.keys(t),[t]),$=Ht.useMemo(()=>{let B={};return l&&(B["--wcm-dialog-width"]=l),d&&(B["--wcm-drawer-max-width"]=d),c&&(B["--wcm-drawer-min-width"]=c),{...B,...f}},[l,d,c,f]),D=Ht.useMemo(()=>({theme:r,isMobile:x,open:R,setOpen:u,close:N,wallets:e,activeWalletIds:T,socialProviders:t,activeSocialIds:C,termsUrl:n??Tn,privacyUrl:o??To,isDetected:k,portalStyle:$}),[r,x,R,u,N,e,T,t,C,n,o,k,$]),z=(0,Bn.jsx)("div",{"data-theme":r,style:$,children:h});return x?(0,Bn.jsx)(rr.Provider,{value:D,children:(0,Bn.jsx)(Jl.Drawer.Root,{direction:a,open:R,onOpenChange:u,noBodyStyles:!0,children:z},"drawer")}):(0,Bn.jsx)(rr.Provider,{value:D,children:(0,Bn.jsx)(Xl.Root,{open:R,onOpenChange:u,children:z})})}var ri=Object.assign(af,{Trigger:zl,Content:Zl});Z(`.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
18
  `);Z(`.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 lf='<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>',cf='<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>',df='<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>',pf='<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>',ff='<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 io=ro(lf),ao=ro(cf),so=ro(df),lo=ro(pf),co=ro(ff);var Be=require("react/jsx-runtime");function ii({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:i,onConnect:a,onDisconnect:l,onCopy:d,onSelectWallet:c,onBuy:f,onBuyDisabledMessage:g,label:w="Connect Wallet",connectingLabel:h="Connecting...",disconnectLabel:x,className:m,theme:b="dark",env:y,showBalance:R=!0,showPortfolio:u,drawerDirection:N,modal:k,connectorId:T,style:C,walletInfoStyle:$,sendTransaction:D,getTransactionReceipt:z,estimateGas:B,onReceive:ie,onBridge:I,onSend:te,bridgeTokens:H,bridgeHistory:Y,getBridgeQuote:ce,getBridgeToTokens:ve,getBridgeApproval:j,approveBridge:pe,submitBridge:ue}){let V=m?`cb-button ${m}`:"cb-button",De=m?`cb-pill ${m}`:"cb-pill";if(e)return(0,Be.jsxs)("button",{type:"button",disabled:!0,className:V,style:C,"aria-busy":"true",children:[(0,Be.jsx)("span",{className:"cb-spinner","aria-hidden":"true"}),(0,Be.jsx)("span",{className:"cb-button-label",children:h})]});if(t){let F=o??hf(n),ne=n?mf[n]:void 0;return(0,Be.jsxs)(xn,{env:y,theme:b,drawerDirection:N,modal:k,showBalance:R,showPortfolio:u,walletAddress:t,accountName:r,sendAccounts:i,connectorId:T,onSelectWallet:c,onCopyAddress:d?(q,ae)=>{ae&&d()}:void 0,onDisconnect:l,disconnectLabel:x,style:$,sendTransaction:D,getTransactionReceipt:z,estimateGas:B,onReceive:ie,onBridge:I,onBuy:f,onBuyDisabledMessage:g,onSend:te,bridgeTokens:H,bridgeHistory:Y,getBridgeQuote:ce,getBridgeToTokens:ve,getBridgeApproval:j,approveBridge:pe,submitBridge:ue,children:[(0,Be.jsx)(xn.Trigger,{asChild:!0,children:(0,Be.jsxs)("button",{type:"button",className:De,style:C,"aria-label":`Connected with ${F}: ${tc(t)}`,children:[ne?(0,Be.jsx)("img",{src:ne,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):(0,Be.jsx)("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),(0,Be.jsx)("span",{className:"cb-pill-address",children:tc(t)})]})}),(0,Be.jsx)(xn.Content,{align:"end",sideOffset:8})]})}return(0,Be.jsxs)("button",{type:"button",onClick:a,className:V,style:C,"aria-label":typeof w=="string"?w:"Connect Wallet",children:[(0,Be.jsx)(uf,{}),(0,Be.jsx)("span",{className:"cb-button-label",children:w})]})}function uf(){return(0,Be.jsxs)("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,Be.jsx)("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"}),(0,Be.jsx)("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"}),(0,Be.jsx)("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var mf={google:lo,apple:co,cross:io,metamask:ao,binance:so},gf={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function hf(e){return e?gf[e]:"Wallet"}function tc(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var nc=G(require("react"),1);Z(`.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)}
19
+ `);var sf='<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>',lf='<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>',cf='<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>',pf='<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 oo(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var ro=oo(sf),io=oo(lf),ao=oo(cf),so=oo(df),lo=oo(pf);var Be=require("react/jsx-runtime");function ii({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:i,onConnect:a,onDisconnect:l,onCopy:d,onSelectWallet:c,onBuy:f,onBuyDisabledMessage:g,label:w="Connect Wallet",connectingLabel:h="Connecting...",disconnectLabel:x,className:m,theme:b="dark",env:y,showBalance:R=!0,showPortfolio:u,drawerDirection:N,modal:k,connectorId:T,style:C,walletInfoStyle:$,sendTransaction:D,getTransactionReceipt:z,estimateGas:B,onReceive:ie,onBridge:I,onSend:te,bridgeTokens:H,bridgeHistory:Y,getBridgeQuote:ce,getBridgeToTokens:ye,getBridgeApproval:j,approveBridge:pe,submitBridge:ue}){let V=m?`cb-button ${m}`:"cb-button",Me=m?`cb-pill ${m}`:"cb-pill";if(e)return(0,Be.jsxs)("button",{type:"button",disabled:!0,className:V,style:C,"aria-busy":"true",children:[(0,Be.jsx)("span",{className:"cb-spinner","aria-hidden":"true"}),(0,Be.jsx)("span",{className:"cb-button-label",children:h})]});if(t){let F=o??gf(n),ne=n?uf[n]:void 0;return(0,Be.jsxs)(xn,{env:y,theme:b,drawerDirection:N,modal:k,showBalance:R,showPortfolio:u,walletAddress:t,accountName:r,sendAccounts:i,connectorId:T,onSelectWallet:c,onCopyAddress:d?(q,ae)=>{ae&&d()}:void 0,onDisconnect:l,disconnectLabel:x,style:$,sendTransaction:D,getTransactionReceipt:z,estimateGas:B,onReceive:ie,onBridge:I,onBuy:f,onBuyDisabledMessage:g,onSend:te,bridgeTokens:H,bridgeHistory:Y,getBridgeQuote:ce,getBridgeToTokens:ye,getBridgeApproval:j,approveBridge:pe,submitBridge:ue,children:[(0,Be.jsx)(xn.Trigger,{asChild:!0,children:(0,Be.jsxs)("button",{type:"button",className:Me,style:C,"aria-label":`Connected with ${F}: ${ec(t)}`,children:[ne?(0,Be.jsx)("img",{src:ne,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):(0,Be.jsx)("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),(0,Be.jsx)("span",{className:"cb-pill-address",children:ec(t)})]})}),(0,Be.jsx)(xn.Content,{align:"end",sideOffset:8})]})}return(0,Be.jsxs)("button",{type:"button",onClick:a,className:V,style:C,"aria-label":typeof w=="string"?w:"Connect Wallet",children:[(0,Be.jsx)(ff,{}),(0,Be.jsx)("span",{className:"cb-button-label",children:w})]})}function ff(){return(0,Be.jsxs)("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,Be.jsx)("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"}),(0,Be.jsx)("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"}),(0,Be.jsx)("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var uf={google:so,apple:lo,cross:ro,metamask:io,binance:ao},mf={google:"Google",apple:"Apple",cross:"CROSSx",metamask:"MetaMask",binance:"Binance Wallet"};function gf(e){return e?mf[e]:"Wallet"}function ec(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}var tc=G(require("react"),1);Z(`.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
20
  `);Z(`.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
- `);var nn=require("react/jsx-runtime"),ai="https://www.onechain.nexus/skills";function si({label:e="Skills",href:t,onClick:n,className:o,style:r,theme:i,disabled:a=!1,isLoading:l=!1,loadingLabel:d="Loading...",openInNewTab:c=!1,type:f="button"}){let[g,w]=nc.useState(!1),h=Oe(),x=En("apps.json",h,k=>pn(k?.skills,h)),m=t??x,b=async k=>{if(m&&!n){c?window.open(m,"_blank","noopener,noreferrer"):window.location.href=m;return}if(n)try{w(!0),await n()}finally{w(!1)}},y=a||l||g,R=l||g,u=R?d:e,N=o?`sb-button ${o}`:"sb-button";return(0,nn.jsxs)("button",{type:f,onClick:b,disabled:y,className:N,"data-theme":i,style:r,"aria-busy":R,children:[R?(0,nn.jsx)("span",{className:"sb-spinner","aria-hidden":"true"}):(0,nn.jsx)(bf,{}),(0,nn.jsx)("span",{className:"sb-label",children:u})]})}function bf(){return(0,nn.jsx)("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,nn.jsx)("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"})})}bo({mode:"dapp-ui"});0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,BridgeFlow,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,DEFAULT_SKILLS_HREF,GOOGLE_ICON,METAMASK_ICON,PORTFOLIO_SECTIONS,SOCIAL_REGISTRY,SendFlow,SkillsButton,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,announceAppLauncherUsage,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});
21
+ `);var tn=require("react/jsx-runtime"),ai="https://www.onechain.nexus/skills";function si({label:e="Skills",href:t,onClick:n,className:o,style:r,theme:i,disabled:a=!1,isLoading:l=!1,loadingLabel:d="Loading...",openInNewTab:c=!1,type:f="button"}){let[g,w]=tc.useState(!1),h=Fe(),x=In("apps.json",h,k=>pn(k?.skills,h)),m=t??x,b=async k=>{if(m&&!n){c?window.open(m,"_blank","noopener,noreferrer"):window.location.href=m;return}if(n)try{w(!0),await n()}finally{w(!1)}},y=a||l||g,R=l||g,u=R?d:e,N=o?`sb-button ${o}`:"sb-button";return(0,tn.jsxs)("button",{type:f,onClick:b,disabled:y,className:N,"data-theme":i,style:r,"aria-busy":R,children:[R?(0,tn.jsx)("span",{className:"sb-spinner","aria-hidden":"true"}):(0,tn.jsx)(hf,{}),(0,tn.jsx)("span",{className:"sb-label",children:u})]})}function hf(){return(0,tn.jsx)("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,tn.jsx)("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"})})}bo({mode:"dapp-ui"});0&&(module.exports={APPLE_ICON,AppLauncher,AppLauncherContent,AppLauncherTrigger,BINANCE_ICON,BridgeFlow,CONNECTOR_REGISTRY,CROSSX_ICON,ConnectButton,ConnectorId,DEFAULT_SKILLS_HREF,GOOGLE_ICON,METAMASK_ICON,PORTFOLIO_SECTIONS,SOCIAL_REGISTRY,SendFlow,SkillsButton,TOKEN_STATS_QUERY_KEY,USER_BALANCE_QUERY_KEY,WALLET_REGISTRY,WalletConnectModal,WalletInfo,WalletPortfolio,WalletPortfolioBody,announceAppLauncherUsage,resolveEnvironment,useGlobalMenu,useTokenBalance,useTokenStats,useWalletDetect});