@nexus-cross/dapp-ui 1.3.10-beta.2 → 1.3.10-beta.4
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 +25 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +782 -11
- package/dist/index.d.ts +782 -11
- package/dist/index.js +25 -23
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
function
|
|
2
|
-
`);
|
|
3
|
-
`);
|
|
4
|
-
`);
|
|
5
|
-
`);te("");import{jsx as hi}from"react/jsx-runtime";function Fa({env:e,theme:t="dark",mobileBreakpoint:n=768,domain:o,children:r}){let i=to(`(max-width: ${n}px)`),[a,s]=no.useState(!1),l=no.useCallback(()=>s(!1),[]),c=Me(e),u=no.useMemo(()=>({env:c,theme:t,isMobile:i,open:a,domain:o,close:l}),[c,t,i,a,o,l]);return hi(gi.Provider,{value:u,children:i?hi(ap.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:r},"drawer"):hi(Aa.Root,{open:a,onOpenChange:s,children:r},"popover")})}import*as Oa from"@radix-ui/react-popover";import{Drawer as lp}from"vaul";import{jsx as Nt,jsxs as sp}from"react/jsx-runtime";function Ba({size:e=18}){return sp("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Nt("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),Nt("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Nt("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Nt("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Nt("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Nt("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),Nt("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Nt("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),Nt("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Ma(){return Nt("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Nt("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Da(){return Nt("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Nt("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as oo}from"react/jsx-runtime";function Wa({asChild:e,children:t,className:n,style:o}){let{isMobile:r,theme:i}=or(),a=t!=null,s=e??!0,l=n?`al-trigger-btn ${n}`:"al-trigger-btn",c=a?t:oo("button",{type:"button",className:l,"data-theme":i,"data-track":"open",style:o,children:oo(Ba,{size:18})});return r?oo(xe,{feature:"app_launcher",children:oo(lp.Trigger,{asChild:s,children:c})}):oo(xe,{feature:"app_launcher",children:oo(Oa.Trigger,{asChild:s,children:c})})}import*as On from"react";import*as ir from"@radix-ui/react-popover";import{Drawer as ro}from"vaul";import{useQuery as pp}from"@tanstack/react-query";var Ua={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 cp="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",dp="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Vt(e,t){return`${e==="production"?dp:cp}/${t}.png`}function Ga(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:Vt(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:Vt(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:Vt(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:Vt(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:Vt(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:Vt(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:Vt(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:Vt(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:Vt(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.onechain.nexus",stage:"https://stg-explorer.onechain.nexus",production:"https://explorer.onechain.nexus"},iconUrl:Vt(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:Vt(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function rr(e){let t=Me(e);return pp({queryKey:["global-menu",t],queryFn:async()=>{try{let n=await fetch(Ua[t],{cache:"no-store"});if(!n.ok)throw new Error(`Failed to fetch global menu: ${n.status}`);return n.json()}catch{return Ga(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function bi(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function $a(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function Ha(e){return[...e].sort((t,n)=>{let o=za(t)-za(n);return o!==0?o:t.order-n.order})}function za(e){let t=bi(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as De,jsxs as io}from"react/jsx-runtime";function up(e){return e.id==="cross-staking"||e.type==="cross-staking"}function Va({align:e="end",sideOffset:t=8,className:n}){let{env:o,theme:r,isMobile:i,domain:a,close:s}=or(),{data:l}=rr(o),c=On.useMemo(()=>Ha(l?.items??[]),[l?.items]),u=8,f=On.useRef(null),b=On.useCallback(g=>{f.current={x:g.clientX,y:g.clientY}},[]),d=typeof window<"u"?window.location.pathname:"",x=On.useCallback((g,v)=>{if(f.current){let k=g.clientX-f.current.x,C=g.clientY-f.current.y;if(f.current=null,Math.abs(k)>u||Math.abs(C)>u)return}let p=v.url[o]??v.url.production,R=ja(p,a);if(!R)try{let k=new URL(p).pathname;if(d===k||d.startsWith(k+"/")){s();return}}catch{}R?window.open(p,"_blank","noopener,noreferrer"):window.location.href=p,s()},[o,a,s,d]),h=g=>{let v=g.url[o]??g.url.production,p=ja(v,a),R=bi(g),k=R==="ending",C=$a(g.iconUrl,o),_=!1;if(!p)try{let T=new URL(v).pathname;_=d===T||d.startsWith(T+"/")}catch{_=!1}return De("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":g.id,"data-active":_||void 0,"data-service-status":R,onPointerDown:b,onClick:T=>x(T,g),children:io("div",{className:"al-grid-item-left",children:[io("div",{className:"al-grid-item-icon",children:[De("img",{src:C,alt:g.label,width:24,height:24,loading:"lazy"}),g.isNew&&De("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),io("span",{className:"al-grid-item-text",children:[De("span",{className:"al-grid-item-label",children:g.label}),k&&De("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),g.badge&&!up(g)&&De("span",{className:"al-badge al-badge-list",children:g.badge})]})]})},g.id)},w=De("div",{className:"al-menu","data-theme":r,children:De("div",{className:"al-grid",children:c.map(h)})});return i?De(xe,{feature:"app_launcher",children:io(ro.Portal,{children:[De(ro.Overlay,{className:"al-drawer-overlay"}),io(ro.Content,{className:ue("al-drawer-content",n),"data-theme":r,children:[io("div",{className:"al-drawer-header",children:[De(ro.Close,{className:"al-drawer-close","data-track":"close",children:De(Ma,{})}),De(ro.Title,{className:"al-drawer-title",children:"CROSS Services"}),De(ro.Close,{className:"al-drawer-close","data-track":"close",children:De(Da,{})})]}),De("div",{className:"al-drawer-body",children:w})]})]})}):De(xe,{feature:"app_launcher",children:De(ir.Portal,{children:De(ir.Content,{align:e,sideOffset:t,className:ue("al-popover-content",n),"data-theme":r,children:w})})})}function ja(e,t){try{let n=new URL(e).hostname;return typeof window>"u"?!0:n!==(t??window.location.hostname)}catch{return!1}}import*as Ze from"react";import*as $c from"@radix-ui/react-popover";import{Drawer as Pg}from"vaul";import{createContext as fp,useContext as mp}from"react";var wi=fp(null);function kn(){let e=mp(wi);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import{WALLET_LABELS as gp}from"@nexus-cross/crossx-design-system";var xi=(o=>(o.CROSSx="crossx",o.MetaMask="io.metamask",o.Binance="com.binance.wallet",o))(xi||{}),ar={crossx:{name:gp.default,iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};import*as Os from"react";import{jsx as fe,jsxs as To}from"react/jsx-runtime";function qa({size:e=16,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[fe("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"}),fe("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 Wn({size:e=16,className:t}){return fe("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("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 mn({size:e=16,className:t}){return fe("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function At({size:e=24,className:t}){return fe("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ka({size:e=20,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[fe("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"}),fe("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 sr({size:e=20,className:t}){return fe("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:fe("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 gn({size:e=20,className:t}){return fe("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Un({size:e=20,className:t}){return fe("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ya({size:e=16,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[fe("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"}),fe("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 Qa({size:e=16,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[fe("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"}),fe("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var hp='<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',bp=`data:image/svg+xml,${encodeURIComponent(hp)}`;function Za({size:e=42,className:t}){return fe("img",{src:bp,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function Xa({size:e=20,className:t}){return fe("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("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 Ja({size:e=20,className:t}){return fe("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("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 es({size:e=20,className:t}){return fe("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("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 ts({size:e=20,className:t}){return fe("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:fe("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 ns({size:e=20,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[fe("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),fe("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as j from"react";import Gn from"bignumber.js";function wp(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return t>0&&e.charCodeAt(t-1)===46&&t--,e.slice(0,t)}function Sn(e,t){if(!e||e==="0")return"0.00";let n=new Gn(e).shiftedBy(-t),o=n.isGreaterThanOrEqualTo(1)?2:4;return n.toFormat(o,Gn.ROUND_DOWN)}function tt(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function zn(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 lr(e,t,n){let r=new Gn(e).shiftedBy(-t).multipliedBy(new Gn(n));return r.isZero()||r.isNaN()?"$0.00":`$${(r.integerValue(Gn.ROUND_DOWN).isGreaterThanOrEqualTo(1)?r.decimalPlaces(2,Gn.ROUND_DOWN):r.decimalPlaces(4,Gn.ROUND_DOWN)).toFormat()}`}function os(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=wp(a.toFixed(18))}let[o="0",r=""]=n.split(".");if(Number(o)>=1){let a=r.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(o).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return r.length<4?{displayValue:`${o}.${r}`,isLowerBound:!1}:r.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${r.slice(0,4)}`,isLowerBound:!1}}import{useMemo as rs}from"react";import{useQuery as xp}from"@tanstack/react-query";var Ne={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},ao="https://terms.crosstoken.io/docs/cross-terms-of-use",cr="https://terms.crosstoken.io/docs/nexus-privacy-policy";var yp="send:chain-info";function vp(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 yi(e,...t){let n=e.replace(/\/+$/,""),o=t.map(r=>r.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[n,...o].join("/")}function is(e,t,n,o){if(o)return t===Ne[e].cross?as(t,o):n?.explorer_url?yi(n.explorer_url,n.explorer_postfix?.transaction??"tx",o):kp(e,t,o)}function as(e,t){return yi("https://explorer.onechain.nexus",String(e),"tx",t)}function kp(e,t,n){let o=Ne[e];if(t===o.cross)return as(t,n);if(t===o.bsc)return yi(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",n)}function No(e,t,n,o=!0){let r=xp({queryKey:[yp,e,t],queryFn:async({signal:s})=>{let l=await se("walletServer",e),c=await fetch(`${l}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let u=await c.json();if("code"in u&&u.code!==void 0&&u.code!==200)throw new Error(`Chain info API error: ${u.code}`);return vp(u)},enabled:o,staleTime:3e5}),i=r.data;return{transactionUrl:rs(()=>is(e,t,i,n),[t,i,e,n]),chainInfo:i,...r}}function ss(e,t,n=!0){let{chainInfo:o}=No(e,t,void 0,n);return{buildTxUrl:rs(()=>i=>is(e,t,o,i),[e,t,o]),chainInfo:o}}var ls="0x0000000000000000000000000000000000000001";var Sp="0xa9059cbb",Cp=/^0x[a-fA-F0-9]{40}$/,Rp="nexus-cross:dapp-ui:send:recent:",cs=10;function Tp(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Eo(e){return e.toLowerCase()}function tn(e){return Cp.test(e)}function Cn(e){return Eo(e.address)===ls}function vi(e){return`${Rp}${e.toLowerCase()}`}function so(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(vi(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>o!==null&&typeof o=="object"&&tn(o.address)&&typeof o.updatedAt=="number").slice(0,cs):[]}catch{return[]}}function ki(e,t){if(typeof window>"u")return[];let n=Eo(t),o=[{address:n,updatedAt:Date.now()},...so(e).filter(r=>r.address!==n)].slice(0,cs);try{window.localStorage.setItem(vi(e),JSON.stringify(o))}catch{return so(e)}return o}function Si(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(vi(e))}catch{}}function $n(e,t){let n=e.trim();if(!n)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(n))return{error:"Enter a valid amount."};let[o="0",r=""]=n.split(".");if(r.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(o||"0"),a=r.padEnd(t,"0"),s=a?BigInt(a):0n,l=10n**BigInt(t),c=i*l+s;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function lo(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=Tp(i.toString().padStart(t,"0"));return`${r.toString()}.${a}`}function Ci(e,t){let n=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${Sp}${n}${o}`}function dr(e,t,n=10){if(t<=0)return e.toString();let o=10n**BigInt(t),r=e/o,i=e%o;if(i===0n)return r.toString();let s=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(n,t)));return s=s.replace(/0+$/,""),s?`${r.toString()}.${s}`:r.toString()}function Ri(e,t){return dr(e,t,6)}function ds(e){return dr(e,9,2)}function ps(e){return e.toLocaleString("en-US")}function pr(e){return e===56||e===97}function ur(e){return e.gasPrice??e.maxFeePerGas}function us(e,t=!1){return t?ur(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function fr(e,t=!1){if(t){let n=ur(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 mr(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function fs(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(fs(n.cause,t+1)),o.join(`
|
|
6
|
-
`).toLowerCase()}function Np(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 Ti(e,t={},n="Failed to send transaction."){let o=fs(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.":Np(e)||n}var Ep=2000000000n,Ip=1000000000n;async function gr(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 hr(e){return BigInt(e)}function _p(e){return`0x${e.toString(16)}`}function Pp(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=_p(e.value)),e.data&&(t.data=e.data),t}function Lp(e){return e===56||e===97}async function ms(e){try{let t=await gr(e,"eth_gasPrice",[]);return{gasPrice:hr(t)}}catch{return{gasPrice:Ep}}}async function Ap(e,t){let n=Ip;try{let o=await gr(e,"eth_maxPriorityFeePerGas",[]);n=hr(o)}catch{}return{maxFeePerGas:t+n,maxPriorityFeePerGas:n}}async function Fp(e,t){if(t)return ms(e);let n;try{n=(await gr(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return n?Ap(e,hr(n)):ms(e)}async function gs(e,t){let n=Lp(t.chainId),o=Pp(t),[r,i]=await Promise.all([gr(e,"eth_estimateGas",[o]),Fp(e,n)]);return{gasLimit:hr(r),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function hs(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 gs(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 Bp=1500,Mp=120;function bs(e){return!!(e.token||e.recipient||e.amount)}function Ni({recipient:e,amount:t,token:n,balanceRaw:o}){let r={},i=e.trim(),a=$n(t,n.quantity.decimals),s;return i?tn(i)||(r.recipient="Enter a valid EVM recipient address."):r.recipient="Enter a recipient address.","error"in a?r.amount=a.error:(s=a.value,s>o&&(r.amount="Amount exceeds available balance.")),!Cn(n)&&!tn(n.address)&&(r.token="Token contract address is invalid."),{errors:r,rawAmount:r.amount?void 0:s,recipient:i&&tn(i)?i:void 0}}function Ei({token:e,walletAddress:t,recipient:n,rawAmount:o}){let r=t;return Cn(e)?{to:n,value:o,chainId:e.chainId,from:r}:{to:Eo(e.address),data:Ci(n,o),value:0n,chainId:e.chainId,from:r}}function Dp(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var Op=e=>new Promise(t=>setTimeout(t,e));async function ws({repository:e,args:t,chainId:n,onSubmitted:o,pollIntervalMs:r=Bp,pollMaxAttempts:i=Mp}){let a=await e.sendTransaction(t);o(a);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let l=0;l<i;l+=1){let c=await s({hash:a,chainId:n}).catch(()=>null);if(c)return Dp(c)?"reverted":"success";await Op(r)}return"timeout"}var xs=["token","recipient","amount","review"];function ys(e){let{env:t,walletAddress:n,accountName:o,accounts:r=[],initialStep:i="recipient",token:a,tokens:s=[],onTokenChange:l,sendTransaction:c,getTransactionReceipt:u,estimateGas:f,getTokenPriceUsd:b,onSubmitted:d,onSuccess:x,onFailed:h,onExit:w,onOutlink:g}=e,v=j.useMemo(()=>hs({sendTransaction:c,getTransactionReceipt:u,estimateGas:f}),[c,u,f]),[p,R]=j.useState(a);j.useEffect(()=>{R(a)},[a.address,a.chainId]);let[k,C]=j.useState(i),[_,T]=j.useState(""),[I,G]=j.useState(""),[F,$]=j.useState({}),[L,Y]=j.useState("idle"),[N,P]=j.useState(""),[ne,K]=j.useState(""),[B,ce]=j.useState(null),[re,H]=j.useState(!1),[D,Q]=j.useState(""),X=j.useRef(0),[me,ve]=j.useState(null),[J,be]=j.useState(""),[Le,Ue]=j.useState(()=>so(n)),it=j.useRef(new Set),ae=j.useCallback((A,ee)=>{it.current.has(A)||(it.current.add(A),Te("send",A,ee))},[]);j.useEffect(()=>{ae("opened"),i!=="token"&&ae("token_selected",{tags:{item_id:a.symbol}})},[ae,i,a.symbol]);let $e=j.useMemo(()=>Me(t),[t]),{transactionUrl:Xe,chainInfo:Ae}=No($e,p.chainId,N||void 0,!0),Je=So(p.chainId,$e),He=Je.nativeSymbol??Ae?.currency_symbol??"",_t=Je.name??Ae?.name??`Chain ID ${p.chainId}`,cn=j.useRef({nativeSymbol:He||void 0,networkName:_t,tokenSymbol:p.symbol});cn.current={nativeSymbol:He||void 0,networkName:_t,tokenSymbol:p.symbol};let ft=j.useMemo(()=>BigInt(p.quantity.numeric||"0"),[p.quantity.numeric]),xt=j.useMemo(()=>Sn(p.quantity.numeric,p.quantity.decimals),[p.quantity.numeric,p.quantity.decimals]),yt=b?.(p),Pt=j.useMemo(()=>{if(yt===void 0)return;let A=parseFloat(I.replace(/,/g,""));return Number.isFinite(A)?A*yt:0},[I,yt]);j.useEffect(()=>{G(""),$({})},[p.address,p.chainId]),j.useEffect(()=>{X.current+=1,ce(null),Q(""),H(!1)},[p.address,p.chainId,_,I]),j.useEffect(()=>{Ue(so(n))},[n]);let Fe=j.useCallback(A=>{T(A),$(ee=>({...ee,recipient:void 0}))},[]),$t=j.useCallback(A=>{G(A),$(ee=>({...ee,amount:void 0}))},[]),vt=j.useCallback(()=>{G(xt.replace(/,/g,"")),$(A=>({...A,amount:void 0}))},[xt]),kt=j.useCallback(A=>{R(A),l?.(A),ae("token_selected",{tags:{item_id:A.symbol}}),C("recipient")},[l,ae]),dn=j.useCallback(()=>C("token"),[]),Lt=j.useCallback(()=>{C(A=>{if(A==="result")return"review";if(A===i)return w?.(),A;let ee=xs.indexOf(A);return ee<=0?(w?.(),A):xs[ee-1]})},[i,w]),ke=j.useCallback(()=>{let{errors:A}=Ni({recipient:_,amount:"1",token:p,balanceRaw:ft});if(A.recipient){$(ee=>({...ee,recipient:A.recipient}));return}$(ee=>({...ee,recipient:void 0})),ae("recipient_entered"),C("amount")},[_,p,ft,ae]),je=j.useCallback(A=>{T(A),$(ee=>({...ee,recipient:void 0})),ae("recipient_entered"),C("amount")},[ae]),St=j.useCallback(()=>{let A=Ni({recipient:_,amount:I,token:p,balanceRaw:ft});$(A.errors),!(bs(A.errors)||A.rawAmount===void 0||!A.recipient)&&(ve(A.rawAmount),be(A.recipient),ce(null),Q(""),Y("idle"),ae("amount_entered"),C("review"))},[_,I,p,ft,ae]);j.useEffect(()=>{if(k!=="review"||!J||me===null||B!==null||re||D||!v.canEstimateGas(Ae?.rpc))return;let A=++X.current;H(!0),Q(""),(async()=>{try{let ee=Ei({token:p,walletAddress:n,recipient:J,rawAmount:me}),Ce=await v.estimateGas(ee,Ae?.rpc);if(X.current!==A)return;ce(Ce)}catch(ee){if(X.current!==A)return;Q(Ti(ee,cn.current,"Failed to estimate gas."))}finally{X.current===A&&H(!1)}})()},[k,J,me,B,re,D,v,Ae?.rpc,p,n]);let at=j.useMemo(()=>{if(!Cn(p)||!B||me===null)return!1;let A=fr(B,pr(p.chainId));return A===null?!1:me+A>ft},[p,B,me,ft]),Ge=j.useCallback(async()=>{if(!(!J||me===null)&&!at){K(""),P(""),Y("submitting"),ae("submitted");try{let A="",ee=await ws({repository:v,args:Ei({token:p,walletAddress:n,recipient:J,rawAmount:me}),chainId:p.chainId,onSubmitted:Ce=>{A=Ce,P(Ce),Y("confirming"),Ue(ki(n,J)),d?.({txHash:Ce,chainId:p.chainId,amount:I,tokenSymbol:p.symbol,recipient:J})}});if(ee==="success")Y("success"),ae("confirmed"),A&&x?x?.(A):C("result");else if(ee==="reverted"){let Ce="Transaction reverted on-chain.";Y("error"),K(Ce),ae("confirmed",{status:"failure",reason:Tt(new Error(Ce))}),A&&h?h({txHash:A,chainId:p.chainId,message:Ce}):C("result")}else{let Ce="Transaction receipt was not found. Please check again later.";Y("error"),K(Ce),ae("confirmed",{status:"failure",reason:"timeout"}),A&&h?h({txHash:A,chainId:p.chainId,message:Ce}):C("result")}}catch(A){Y("error"),ae("confirmed",{status:"failure",reason:Tt(A)}),K(Ti(A,{nativeSymbol:He||void 0,networkName:_t,tokenSymbol:p.symbol})),C("result")}}},[v,J,me,at,p,I,n,d,x,h,He,_t,ae]),[Ht,Zt]=j.useState(!1),Ve=j.useRef(void 0);j.useEffect(()=>()=>clearTimeout(Ve.current),[]);let Xt=j.useCallback(async()=>{if(N)try{await navigator.clipboard.writeText(N),Zt(!0),clearTimeout(Ve.current),Ve.current=setTimeout(()=>Zt(!1),2e3)}catch{}},[N]),pn=j.useCallback(()=>{if(!Xe||!N)return;let A=Ct=>{typeof window<"u"&&window.open(Ct,"_blank","noopener,noreferrer")};if(!g){A(Xe);return}let ee=g(Xe,{category:"send",origin:"send-transaction",payload:{chainId:p.chainId,txHash:N}});if(ee&&typeof ee.then=="function"){let Ct=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;ee.then(Rt=>{if(Rt===null){Ct?.close();return}let Jt=Rt??Xe;if(Ct)try{Ct.location.href=Jt}catch{Ct.close(),A(Jt)}else A(Jt)});return}let Ce=ee;Ce!==null&&A(Ce??Xe)},[g,p.chainId,Xe,N]),un=j.useCallback(()=>{K(""),P(""),Y("idle"),ce(null),Q(""),it.current.delete("submitted"),it.current.delete("confirmed"),C("review")},[]);return{step:k,status:L,token:p,tokens:s.length>0?s:[p],recipient:_,amount:I,amountUsd:Pt,fieldErrors:F,error:ne,txHash:N,gasEstimate:B,gasLoading:re,gasError:D,insufficientGas:at,reviewRawAmount:me,reviewRecipient:J,recentAddresses:Le,accounts:r,accountName:o,walletAddress:n,resolvedEnv:$e,transactionUrl:Xe,networkName:_t,nativeSymbol:He,nativeDecimals:Ae?.currency_decimals??p.quantity.decimals,balanceRaw:ft,balanceText:xt,priceUsd:yt,canSelectToken:(s.length>0?s:[p]).length>1,canSend:v.canSend,getTokenPriceUsd:b,setRecipient:Fe,setAmount:$t,setMax:vt,selectToken:kt,goToTokenSelect:dn,selectRecipient:je,submitRecipient:ke,submitAmount:St,confirmSend:Ge,retry:un,back:Lt,hashCopied:Ht,copyHash:Xt,openTransaction:pn}}import*as qt from"react";import{jsx as Io,jsxs as Ii}from"react/jsx-runtime";function vs({flow:e}){let{amount:t,setAmount:n,amountUsd:o,balanceText:r,balanceRaw:i,token:a,setMax:s}=e,l=qt.useRef(null),c=qt.useCallback(()=>{requestAnimationFrame(()=>{let h=l.current;if(!h)return;let w=h.value.length;h.setSelectionRange(w,w)})},[]);qt.useEffect(()=>{l.current?.focus(),c()},[c]),qt.useEffect(()=>{t===""&&(b(!1),c())},[t,c]);let u=qt.useMemo(()=>{let h=$n(t,a.quantity.decimals);return"value"in h&&h.value>i},[t,a.quantity.decimals,i]),[f,b]=qt.useState(!1),d=!f&&t===""?"0.00":t,x=t.trim()===""||t.trim()==="0";return Io("div",{className:"sf-body sf-amount",children:Ii("div",{className:"sf-amount-center",children:[Io("span",{className:"sf-amount-usd",children:o!==void 0?mr(o):"\xA0"}),Io("div",{className:"sf-amount-input-wrap","data-over":u||void 0,"data-empty":x||void 0,onClick:()=>l.current?.focus(),children:Io("input",{ref:l,className:"sf-amount-input",value:d,onChange:h=>{let w=h.target.value;if(f)n(w);else if(t===""){if(w.length<4)return;b(!0);let g=w.startsWith("0.00")?w.slice(4):w;n(g)}else b(!0),n(w)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),Ii("div",{className:"sf-amount-balance",children:[Io("span",{children:"Balance:"}),Ii("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[r," ",a.symbol]})]})]})})}import*as Kt from"react";var Up=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function Ss(e){return Up.has(e.toLowerCase())}var ks={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function _o(e,t){let n=Ne[e];if(t===n.cross)return ks.cross;if(t===n.bsc)return ks.bsc}var Gp={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function hn(e,t,n={}){if(!t||!t.startsWith("0x"))return;let{size:o=120,bg:r,format:i="png"}=n,a=Gp[e],s=r?`&bg=${r}`:"";return`${a}/portrait/evm/${t}.${i}?size=${o}${s}`}import{jsx as Ft,jsxs as br}from"react/jsx-runtime";function Cs({size:e=20,className:t}){return br("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Ft("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),Ft("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Rs({size:e=20,className:t}){return Ft("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:Ft("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 Ts({size:e=20,className:t}){return br("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[Ft("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),Ft("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Ns({size:e=16,className:t}){return Ft("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:Ft("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Es({size:e=56,className:t}){return br("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Ft("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),Ft("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 Is({size:e=56,className:t}){return br("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[Ft("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),Ft("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as Oe,jsxs as nn}from"react/jsx-runtime";function _s(e,t){return e.name||`Account ${(e.index??t)+1}`}function Ps(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Ls(e){return e.toLowerCase()}function As({flow:e}){let{recipient:t,setRecipient:n,fieldErrors:o,recentAddresses:r,accounts:i,walletAddress:a,resolvedEnv:s,selectRecipient:l}=e,c=Kt.useMemo(()=>i.filter(p=>p.address.toLowerCase()!==a.toLowerCase()),[i,a]),u=c.length>0,f=Kt.useMemo(()=>new Map(c.map((p,R)=>[Ls(p.address),{account:p,index:R}])),[c]),[b,d]=Kt.useState("recent"),x=Kt.useRef(null);Kt.useEffect(()=>{x.current?.focus()},[]);let h="1A1A2E",w=Kt.useCallback(async()=>{try{let p=await navigator.clipboard.readText();p&&n(p.trim())}catch{}},[n]),g=t.trim().length>0,v=tn(t.trim());return nn("div",{className:"sf-recipient",children:[nn("div",{className:"sf-recipient-top",children:[nn("div",{className:"sf-address-field","data-filled":g||void 0,"data-invalid":o.recipient||void 0,children:[Oe("textarea",{ref:x,className:"sf-address-input",value:t,onChange:p=>n(p.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:g?2:1}),g?Oe("button",{type:"button",className:"sf-address-action",onClick:()=>n(""),"aria-label":"Clear","data-track":"recipient_clear",children:Oe(Ts,{size:20})}):Oe("button",{type:"button",className:"sf-address-action",onClick:w,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:Oe(Rs,{size:20})})]}),o.recipient&&Oe("p",{className:"sf-field-error",role:"alert",children:o.recipient}),nn("div",{className:"sf-tabs",role:"tablist",children:[Oe("button",{type:"button",role:"tab",className:"sf-tab","data-active":b==="recent"||void 0,"aria-selected":b==="recent",onClick:()=>d("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),u&&Oe("button",{type:"button",role:"tab",className:"sf-tab","data-active":b==="account"||void 0,"aria-selected":b==="account",onClick:()=>d("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),Oe("div",{className:"sf-address-list",children:b==="account"&&u?c.map((p,R)=>{let k=_s(p,R),C=hn(s,p.address,{size:56,bg:h});return nn("button",{type:"button",className:"sf-address-row",onClick:()=>l(p.address),"data-track":"recipient_item",children:[nn("span",{className:"sf-address-avatar",children:[C&&Oe("img",{src:C,alt:"",width:40,height:40,draggable:!1,onError:_=>{_.currentTarget.style.display="none"}}),Oe("span",{className:"sf-address-avatar-fallback",children:Ps(k)})]}),nn("span",{className:"sf-address-meta",children:[Oe("span",{className:"sf-address-name",children:k}),Oe("span",{className:"sf-address-value",children:tt(p.address)})]})]},p.address)}):r.length>0?r.map(p=>{let R=f.get(Ls(p.address)),k=R?_s(R.account,R.index):tt(p.address),C=hn(s,p.address,{size:56,bg:h});return nn("button",{type:"button",className:"sf-address-row",onClick:()=>l(p.address),"data-track":"recipient_item",children:[nn("span",{className:"sf-address-avatar",children:[C&&Oe("img",{src:C,alt:"",width:40,height:40,draggable:!1,onError:_=>{_.currentTarget.style.display="none"}}),Oe("span",{className:"sf-address-avatar-fallback",children:Ps(k)})]}),nn("span",{className:"sf-address-meta",children:[Oe("span",{className:"sf-address-name",children:k}),Oe("span",{className:"sf-address-value",children:tt(p.address)})]})]},p.address)}):Oe("div",{className:"sf-empty",children:"No send history"})}),g&&!v&&!o.recipient&&Oe("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as ct,jsxs as co}from"react/jsx-runtime";function Bs({flow:e}){let{status:t,txHash:n,error:o,copyHash:r,hashCopied:i,openTransaction:a}=e,s=t==="error",l=t==="success";return s?co("div",{className:"sf-body sf-result sf-result--error",children:[ct("span",{className:"sf-result-icon",children:ct(Is,{size:56})}),co("div",{className:"sf-result-copy",children:[ct("h3",{className:"sf-result-title",children:"Transaction Failed"}),ct("p",{className:"sf-result-desc",children:o||"Something went wrong. Please try again."})]}),n&&ct(Fs,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]}):co("div",{className:"sf-body sf-result",children:[ct("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?ct(Es,{size:56}):ct("span",{className:"sf-result-spinner"})}),co("div",{className:"sf-result-copy",children:[ct("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),ct("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),n&&ct(Fs,{txHash:n,hashCopied:i,onCopy:r,onOpen:a})]})}function Fs({txHash:e,hashCopied:t,onCopy:n,onOpen:o}){return co("div",{className:"sf-result-hash-card",children:[ct("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),co("div",{className:"sf-result-hash-row",children:[ct("button",{type:"button",className:"sf-result-hash-link",onClick:o,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:tt(e)}),ct("button",{type:"button",className:"sf-result-copy-btn",onClick:n,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?ct(mn,{size:16}):"Copy"})]})]})}import{jsx as Ee,jsxs as dt}from"react/jsx-runtime";var wr="\u2014";function Ms({flow:e}){let{token:t,reviewRawAmount:n,reviewRecipient:o,accountName:r,accounts:i,walletAddress:a,networkName:s,nativeSymbol:l,nativeDecimals:c,gasEstimate:u,gasLoading:f,gasError:b,insufficientGas:d,error:x,resolvedEnv:h}=e,w=Cn(t),g=n!==null?dr(n,t.quantity.decimals):"",v=r?.trim()||`Account ${(i[0]?.index??0)+1}`,p=hn(h,a,{size:56,bg:"1A1A2E"}),R=l||(w?t.symbol:""),k=pr(t.chainId),C=u?us(u,k):null,_=u?fr(u,k):null,T=L=>L!==null&&R?`${Ri(L,c)} ${R}`:wr,I=L=>L!==void 0?`${ds(L)} Gwei`:wr,G=(()=>{if(!w||!u||_===null||n===null)return wr;let L=n+_;return`${Ri(L,c)} ${R||t.symbol}`})(),F=L=>f?"\u2026":L,$=[{label:"Est. Tx Fee",value:F(T(_))},...C==="dynamic"?[{label:"Max Priority Fee",value:F(I(u?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:F(I(u?.maxFeePerGas))}]:C==="legacy"?[{label:"Gas Price",value:F(I(u?ur(u):void 0))}]:[],{label:"Gas Limit",value:F(u?ps(u.gasLimit):wr)}];return dt("div",{className:"sf-body sf-review",children:[dt("div",{className:"sf-review-amount",children:[Ee("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:L=>{L.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),dt("span",{className:"sf-review-amount-value",children:[g,Ee("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),dt("div",{className:"sf-review-parties",children:[dt("div",{className:"sf-review-card sf-review-party",children:[Ee("span",{className:"sf-review-party-label",children:"From"}),dt("div",{className:"sf-review-party-head",children:[Ee("span",{className:"sf-review-party-avatar",children:p&&Ee("img",{src:p,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),Ee("span",{className:"sf-review-party-name",children:v})]}),Ee("span",{className:"sf-review-party-addr",children:a})]}),Ee("span",{className:"sf-review-arrow","aria-hidden":!0,children:Ee(Ns,{size:16})}),dt("div",{className:"sf-review-card sf-review-party",children:[Ee("span",{className:"sf-review-party-label",children:"To"}),Ee("span",{className:"sf-review-party-addr",children:o})]})]}),dt("section",{className:"sf-review-card",children:[Ee("h3",{className:"sf-review-section-title",children:"Summary"}),dt("div",{className:"sf-review-row",children:[Ee("span",{className:"sf-review-row-label",children:"Network"}),Ee("span",{className:"sf-review-row-value",children:s})]}),$.map(L=>dt("div",{className:"sf-review-row",children:[Ee("span",{className:"sf-review-row-label",children:L.label}),Ee("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),dt("section",{className:"sf-review-card",children:[Ee("h3",{className:"sf-review-section-title",children:"Total"}),dt("div",{className:"sf-review-row",children:[Ee("span",{className:"sf-review-row-label",children:"Total Amount"}),dt("span",{className:"sf-review-row-value",children:[g," ",t.symbol]})]}),w&&dt("div",{className:"sf-review-row",children:[Ee("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),Ee("span",{className:"sf-review-row-value",children:F(G)})]})]}),d&&!b&&!x&&dt("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",R||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(b||x)&&Ee("div",{className:"sf-message sf-message--error",role:"alert",children:b||x})]})}import*as xr from"react";import{jsx as Rn,jsxs as Hn}from"react/jsx-runtime";function Ds({flow:e}){let[t,n]=xr.useState(""),o=t.trim().toLowerCase(),r=xr.useMemo(()=>o?e.tokens.filter(i=>i.symbol.toLowerCase().includes(o)||i.name.toLowerCase().includes(o)):e.tokens,[e.tokens,o]);return Hn("div",{className:"sf-body sf-token-select",children:[Hn("div",{className:"sf-search",children:[Rn(Cs,{size:20}),Rn("input",{className:"sf-search-input",value:t,onChange:i=>n(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),Hn("div",{className:"sf-token-list",children:[r.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=_o(e.resolvedEnv,i.chainId),l=e.getTokenPriceUsd?.(i);return Hn("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),"data-track":"token_item","data-track-id":i.symbol,children:[Hn("span",{className:"sf-token-left",children:[Hn("span",{className:"sf-token-icon-wrap",children:[Rn("img",{className:"sf-token-icon",src:i.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),s&&Rn("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),Rn("span",{className:"sf-token-name",children:i.symbol})]}),Hn("span",{className:"sf-token-right",children:[Rn("span",{className:"sf-token-balance",children:Sn(i.quantity.numeric,i.quantity.decimals)}),l!==void 0&&Rn("span",{className:"sf-token-price",children:mr(l)})]})]},a)}),r.length===0&&Rn("div",{className:"sf-empty",children:"No tokens found"})]})]})}te(`.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){filter:brightness(1.05)}.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff;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-system-orange-default, #f0640d)}.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-system-orange-default, #f0640d)}.sf-address-field[data-filled]{border-color:var(--ds-system-orange-default, #f0640d)}.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-system-orange-high, #e56f00)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-system-orange-high, #e56f00)}.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-system-orange-default, #f0640d);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-system-orange-high, #e56f00)}.sf-result-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;padding:0 10px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));border-radius:8px;background:var(--ds-surface-default, #ffffff);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;color:var(--ds-content-high, rgba(0, 0, 0, .85))}
|
|
7
|
-
`);import{jsx as
|
|
8
|
-
`).map(i=>i.trim()).find(i=>i.length>0)||t}var pu="0xe00e8bf3";function Ks(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`${pu}${o}${r}`}function po(e){return!e||e<=0n?"0":new Mt(e.toString()).shiftedBy(-9).toFormat(2,Mt.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Rr(e){return!e||e<=0n?"0":new Mt(e.toString()).toFormat(0,Mt.ROUND_DOWN)}function Tr(e){if(!e||e<=0n)return"0";let t=new Mt(e.toString()).shiftedBy(-18),n=t.isLessThan(1e-4)?7:4;return t.toFormat(n,Mt.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function on(e,t){let n=new Mt(e).shiftedBy(-t);return!n.isFinite()||n.isZero()?"0":n.isGreaterThanOrEqualTo(1)?n.toFormat(2,Mt.ROUND_DOWN):n.toFormat(4,Mt.ROUND_DOWN)}function Fi(e){return on(e,0)}var Fo={rate:1,symbol:"$"};function jn(e,t=Fo){let n=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(n).toFormat(2,Mt.ROUND_DOWN)}`}function En(e,t,n,o=Fo){let r=new Mt(n||"0");if(!r.isFinite()||r.isLessThanOrEqualTo(0))return null;let i=new Mt(e||"0").shiftedBy(-t).times(r);return i.isFinite()?jn(i,o):null}var Bo=uu(null);function Ie(){let e=fu(Bo);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function Dt(){let{conversionRatio:e,currencySymbol:t}=Ie();return mu(()=>({rate:typeof e=="number"&&e>0?e:Fo.rate,symbol:t||Fo.symbol}),[e,t])}import{Drawer as gu}from"vaul";import{jsx as Ys}from"react/jsx-runtime";function Qs({asChild:e,children:t}){let{walletAddress:n}=Ie(),o=t!=null,r=e??!0,i=o?t:Ys("button",{type:"button",children:tt(n)});return Ys(gu.Trigger,{asChild:r,children:i})}import{Drawer as Dr}from"vaul";import*as Pe from"react";import{useQueryClient as om}from"@tanstack/react-query";import{createContext as hu,useContext as bu}from"react";var Bi=hu(null);function Zs(){return bu(Bi)}import{jsx as Et,jsxs as _r}from"react/jsx-runtime";function Xs({size:e=22,className:t}){return Et("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Et("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Js({size:e=22,className:t}){return _r("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Et("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),Et("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 Nr({size:e=16,className:t}){return _r("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Et("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"}),Et("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 Er({size:e=16,className:t}){return Et("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Et("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ir({size:e=48,className:t}){return _r("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Et("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),Et("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 _r("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:[Et("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"}),Et("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),Et("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import{useQuery as wu}from"@tanstack/react-query";import{useMemo as el}from"react";var xu="wp:reward-pools";function uo(e,t=!0){let{data:n,...o}=wu({queryKey:[xu,e],queryFn:async({signal:a})=>{let s=await se("gameReward",e),l=await fetch(`${s}/v1/pools`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),r=el(()=>n?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[n]),i=el(()=>n?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[n]);return{crossPools:r,gamePools:i,allPools:n?.data.pools??[],...o}}import{useQuery as yu}from"@tanstack/react-query";import{useMemo as vu}from"react";var ku="wp:user-deposits";function Pr(e,t,n=!0){let o=n&&!!t,{data:r,...i}=yu({queryKey:[ku,e,t],queryFn:async({signal:s})=>{let l=await se("gameReward",e),c=await fetch(`${l}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let u=await c.json();if(u.code!==200)throw new Error(`Deposits API error: ${u.code}`);return u},enabled:o,staleTime:0});return{depositMap:vu(()=>{let s=new Map;if(!r?.data.user_deposits)return s;for(let l of r.data.user_deposits)s.set(l.pool_address.toLowerCase(),l);return s},[r]),deposits:r?.data.user_deposits??[],...i}}import{useQuery as Su}from"@tanstack/react-query";import{useMemo as Cu}from"react";var tl={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},nl={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var ol={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var Mi={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},rl={dev:`${Mi.dev}/portfolio`,stage:`${Mi.stage}/portfolio`,production:`${Mi.production}/portfolio`};var il={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Ot={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"},Lr={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},al={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},sl={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},ll={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var Ru="wp:token-info",Tu="0x0000000000000000000000000000000000000001";function rn(e,t=!0){let n=Ne[e].cross,{data:o,...r}=Su({queryKey:[Ru,e],queryFn:async({signal:u})=>{let f=await se("walletServer",e),b=await fetch(`${f}/v1/public/token/info`,{cache:"no-store",signal:u});if(!b.ok)throw new Error(`Failed to fetch token info: ${b.status}`);let d=await b.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=Cu(()=>{let u=new Map,f=new Map;if(!o?.data)return{byChainAddr:u,byChainSym:f};for(let b of o.data){let d=b.address.toLowerCase();u.set(`${b.chain_id}:${d}`,b),u.set(d,b);let x=b.symbol.replace(/^t/,"").toUpperCase(),h=`${b.chain_id}:${x}`;f.has(h)||f.set(h,b),f.has(x)||f.set(x,b)}return{byChainAddr:u,byChainSym:f}},[o]);return{getTokenImage:(u,f,b)=>{let d=u.toLowerCase(),x=!!b?.chainOnly,h=i.get(`${n}:${d}`);if(h?.image)return h.image;if(!x){let w=i.get(d);if(w?.image)return w.image}if(f){let w=f.replace(/^t/,"").toUpperCase(),g=a.get(`${n}:${w}`);if(g?.image)return g.image;if(!x){let v=a.get(w);if(v?.image)return v.image}}return""},getTokenSymbol:(u,f,b)=>{let d=u.toLowerCase();return(i.get(`${n}:${d}`)??(b?.chainOnly?void 0:i.get(d)))?.symbol||f},getNativeToken:()=>i.get(`${n}:${Tu}`),...r}}import*as Oi from"react";import{jsx as Di,jsxs as cl}from"react/jsx-runtime";function Wt({sectionKey:e,title:t,icon:n,iconFit:o="cover",isEmpty:r,loading:i=!1,children:a}){let s=Zs();return Oi.useEffect(()=>{s?.report(e,{loading:i,empty:r})},[s,e,i,r]),Oi.useEffect(()=>()=>s?.unregister(e),[s,e]),r?null:cl("div",{className:"wp-svc-card",children:[cl("div",{className:"wp-svc-card-head",children:[Di("img",{className:"wp-svc-card-icon",src:n,alt:"",style:{objectFit:o}}),Di("span",{className:"wp-svc-card-title",children:t})]}),Di("div",{className:"wp-svc-items",children:a})]})}import Wi from"bignumber.js";import{jsx as nt,jsxs as pt}from"react/jsx-runtime";var Nu="ONErewards";function Eu(e){return new Wi(e||"0").isGreaterThan(0)}function dl(){let{env:e,walletAddress:t,onOutlink:n}=Ie(),o=Dt(),r=!!t,{allPools:i,isLoading:a}=uo(e,r),{depositMap:s,isLoading:l}=Pr(e,t,r),{getTokenImage:c}=rn(e,r),u=(d,x)=>`${tl[e]}/gametoken/tokens/${d.deposit_token.address}?mode=rewards${x==="withdraw"?"&trade=withdraw":""}`,f=`${Ot[e]}/reward.png`,b=i.filter(d=>{let x=s.get(d.pool_address.toLowerCase()),h=x?.deposited_amount??"0",w=x?.claimable_reward??"0";return!(new Wi(h).isZero()&&new Wi(w).isZero())});return nt(Wt,{sectionKey:"rewards",title:Nu,icon:f,isEmpty:b.length===0,loading:a||l,children:b.map(d=>{let x=s.get(d.pool_address.toLowerCase()),h=x?.deposited_amount??"0",w=x?.claimable_reward??"0",g=u(d,"withdraw"),v=u(d,"claim"),p=c(d.deposit_token.address,d.deposit_token.symbol),R=d.reward_tokens[0],k=R?c(R.address,R.symbol):"",C=d.reward_tokens.map(L=>L.symbol),_=C.length>0?`${d.deposit_token.symbol}-${C.join("/")}`:d.deposit_token.symbol,T=R?on(w,R.decimals):"0",I=R?.symbol??"Reward",G=En(h,d.deposit_token.decimals,d.deposit_token.price,o),F=R?En(w,R.decimals,R.price,o):null,$=!!x&&Eu(w);return pt("article",{className:"wp-item","data-side":"reward",children:[pt("div",{className:"wp-item-body",children:[pt("div",{className:"wp-item-line",children:[nt("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),pt("div",{className:"wp-svc-token",children:[pt("span",{className:"wp-token-stack","aria-hidden":!0,children:[p&&nt("img",{className:"wp-svc-token-icon",src:p,alt:""}),k&&nt("img",{className:"wp-svc-token-icon",src:k,alt:""})]}),nt("span",{children:_})]})]}),pt("div",{className:"wp-item-line",children:[nt("span",{className:"wp-item-label",children:"Deposited"}),pt("div",{className:"wp-svc-token wp-svc-token--amount",children:[p&&nt("img",{className:"wp-svc-token-icon",src:p,alt:""}),pt("div",{className:"wp-svc-amount",children:[nt("span",{className:"wp-svc-amount-main",children:on(h,d.deposit_token.decimals)}),G&&nt("span",{className:"wp-item-usd",children:G})]})]})]}),pt("div",{className:"wp-item-line",children:[pt("span",{className:"wp-item-label",children:["Claimable (",I,")"]}),pt("div",{className:"wp-svc-token wp-svc-token--amount",children:[k&&nt("img",{className:"wp-svc-token-icon",src:k,alt:""}),pt("div",{className:"wp-svc-amount",children:[nt("span",{className:"wp-svc-amount-main",children:T}),F&&nt("span",{className:"wp-item-usd",children:F})]})]})]})]}),pt("div",{className:"wp-item-tags",children:[pt("a",{className:"wp-tag wp-tag--muted",href:g,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>We(L,g,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:x}},n),children:[nt("span",{className:"wp-tag-label",children:"Withdraw"}),nt(It,{size:12,className:"wp-tag-icon"})]}),pt("a",{className:"wp-tag wp-tag--mint","data-disabled":!$||void 0,"aria-disabled":!$||void 0,href:$?v:void 0,target:$?"_blank":void 0,rel:$?"noopener noreferrer":void 0,onClick:L=>{if(!$){L.preventDefault();return}We(L,v,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:x}},n)},children:[nt("span",{className:"wp-tag-label",children:"Claim"}),nt(It,{size:12,className:"wp-tag-icon"})]})]})]},d.pool_address)})})}import*as wl from"react";import{useQuery as Mu}from"@tanstack/react-query";import{useMemo as Ar}from"react";var Iu="0x70a08231",_u="0x18160ddd",Pu="0x313ce567",Lu=8e3;async function Au(e,t,n,o){let r=new AbortController,i=setTimeout(()=>r.abort(),Lu);o&&o.addEventListener("abort",()=>r.abort(),{once:!0});let a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:n}),signal:r.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let s=await a.json();if(s.error)throw new Error(`RPC ${t}: ${s.error.message}`);if(s.result===void 0)throw new Error(`RPC ${t}: empty result`);return s.result}function Fu(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function Mo(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function bn(e,t,n,o,r){try{return await Au(e,"eth_call",[r?{from:r,to:t,data:n}:{to:t,data:n},"latest"],o)}catch{return}}async function Bu(e,t,n,o){let[r,i,a]=await Promise.all([bn(e,n,Iu+Fu(t),o),bn(e,n,_u,o),bn(e,n,Pu,o)]),s=Mo(r);if(s===void 0)return null;let l=Mo(a);return{balance:s,totalSupply:Mo(i),decimals:l!==void 0?Number(l):void 0}}async function Do(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 pl(e,t,n,o){if(!t||n.length===0)return{};let r;try{r=await Do(e,o)}catch{r=void 0}if(!r)return{};let i=await Promise.all(n.map(async s=>[s.toLowerCase(),await Bu(r,t,s,o)])),a={};for(let[s,l]of i)l&&(a[s]=l);return a}var Du="wp:withdraw-token-meta",Ou="0xc89039c5",Wu="0x95d89b41",Uu="0x313ce567";function Gu(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 zu(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 $u(e,t,n){if(t.length===0)return{};let o;try{o=await Do(e,n)}catch{o=void 0}if(!o)return{};let r=await Promise.all(t.map(async a=>{let s=zu(await bn(o,a,Ou,n));if(!s)return[a.toLowerCase(),null];let[l,c]=await Promise.all([bn(o,s,Wu,n),bn(o,s,Uu,n)]),u=Gu(l),f=Mo(c);return u?[a.toLowerCase(),{tokenAddress:s,symbol:u,decimals:f!==void 0?Number(f):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of r)s&&(i[a]=s);return i}function ul(e,t,n=!0){let r=n&&!!t,{allPools:i,isLoading:a}=uo(e,r),{deposits:s,isLoading:l}=Pr(e,t,r),c=Ar(()=>{let w=new Map;for(let g of i)w.set(g.pool_address.toLowerCase(),g);return w},[i]),u=Ar(()=>s.filter(w=>{try{return BigInt(w.deposited_amount||"0")>0n}catch{return!1}}),[s]),f=Ar(()=>u.map(w=>w.pool_address.toLowerCase()).filter(w=>!c.has(w)).sort(),[u,c]),{data:b,isLoading:d}=Mu({queryKey:[Du,e,f],queryFn:({signal:w})=>$u(e,f,w),enabled:r&&f.length>0,staleTime:1440*60*1e3});return{positions:Ar(()=>{let w=[];for(let g of u){let v=g.pool_address.toLowerCase(),p=c.get(v);if(p){w.push({poolId:g.pool_id,poolAddress:g.pool_address,poolType:p.pool_type,tokenSymbol:p.deposit_token.symbol,tokenAddress:p.deposit_token.address,decimals:p.deposit_token.decimals,price:p.deposit_token.price,depositedRaw:g.deposited_amount});continue}let R=b?.[v];R&&w.push({poolId:g.pool_id,poolAddress:g.pool_address,poolType:"Unknown",tokenSymbol:R.symbol,tokenAddress:R.tokenAddress,decimals:R.decimals,depositedRaw:g.deposited_amount})}return w},[u,c,b]),isLoading:a||l||d}}import*as Ke from"react";import{Fragment as fl,jsx as le,jsxs as Be}from"react/jsx-runtime";var Hu=400;function ju(e,t,n){if(t==="loading")return"Estimating...";if(!e||t==="error"||t==="unavailable")return"Wallet estimate";let o=e.maxFeePerGas??e.gasPrice;return!o||o<=0n||e.gasLimit<=0n?"Wallet estimate":`${Tr(e.gasLimit*o)} ${n??""}`.trim()}function Ui(e,t,n){return n==="loading"?"Estimating...":n==="error"||n==="unavailable"?"-":`${e} ${t}`.trim()}function Vu({position:e,size:t}){return e.icon?le("img",{src:e.icon,alt:"",width:t,height:t}):le("span",{children:e.tokenSymbol.slice(0,1)})}function ml({open:e,status:t,positions:n,initialPoolAddress:o,walletAddress:r,txHash:i,error:a,copied:s=!1,estimateWithdraw:l,onClose:c,onConfirm:u,onCopyHash:f,trackFunnel:b,nativeSymbol:d}){let[x,h]=Ke.useState(null),[w,g]=Ke.useState("idle"),v=Ke.useRef(0),p=Ke.useRef(void 0),R=Ke.useRef(null);Ke.useEffect(()=>()=>clearTimeout(p.current),[]);let k=Ke.useMemo(()=>{let Y=o?.toLowerCase();return n.find(N=>N.poolAddress.toLowerCase()===Y)??n[0]??null},[n,o]),C=Ke.useMemo(()=>{try{return BigInt(k?.depositedRaw??"0")}catch{return 0n}},[k?.depositedRaw]),_=k?.decimals??18;Ke.useEffect(()=>{!e||!k||b?.("position_selected")},[e,k,b]);let T=Ke.useCallback(()=>{h(null),g(l?"idle":"unavailable"),v.current+=1,R.current=null},[]);if(Ke.useEffect(()=>{e&&T()},[e,T]),Ke.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(p.current);return}if(!l||!k){clearTimeout(p.current),g("unavailable");return}if(C<=0n){clearTimeout(p.current),v.current+=1,R.current=null,h(null),g("idle");return}let Y=`${k.poolAddress.toLowerCase()}:${C.toString()}`;if(R.current===Y)return;R.current=Y,clearTimeout(p.current);let N=v.current+1;v.current=N,g("loading"),p.current=setTimeout(()=>{l(k,C).then(P=>{v.current===N&&(h(P??null),g(P?"ready":"unavailable"))}).catch(()=>{v.current===N&&(h(null),g("error"))})},Hu)},[e,t,C,l,k]),!e||!k)return null;let I=t==="submitting",G=po(x?.maxPriorityFeePerGas),F=po(x?.maxFeePerGas??x?.gasPrice),$=Rr(x?.gasLimit),L=on(k.depositedRaw,_);return le("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:Y=>{Y.target===Y.currentTarget&&!I&&c()},children:Be("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","aria-label":"Withdraw","data-status":t,"data-vaul-no-drag":!0,children:[le("div",{className:"wp-claim-grabber","aria-hidden":!0,children:le("span",{})}),Be("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?Be(fl,{children:[le("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:le(Ir,{})}),Be("div",{className:"wp-claim-copy",children:[le("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),le("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),le("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:Be("div",{className:"wp-claim-list-item",children:[le("span",{children:"Tx Hash"}),Be("button",{type:"button",className:"wp-claim-hash",onClick:f,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[le("strong",{children:Cr(i)}),s?le(Er,{}):le(Nr,{})]})]})})]}):Be(fl,{children:[t==="error"&&Be("div",{className:"wp-claim-heading",children:[le("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),le("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),Be("div",{className:"wp-claim-reward-card","data-fit":Lo(k.tokenSymbol,L),"aria-label":"Deposited balance",children:[le("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:le(Vu,{position:k,size:28})}),le("strong",{className:"wp-claim-reward-symbol",children:k.tokenSymbol}),le("strong",{className:"wp-claim-reward-amount",children:L})]}),Be("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[Be("div",{className:"wp-claim-account-row",children:[Be("div",{className:"wp-claim-account",children:[le("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),Be("strong",{children:[k.tokenSymbol," Pool"]})]}),le("span",{children:Sr(r)})]}),le("span",{className:"wp-claim-divider","aria-hidden":!0}),Be("div",{className:"wp-claim-detail-list",children:[Be("div",{className:"wp-claim-detail-row",children:[le("span",{children:"Est. Tx Fee"}),le("strong",{children:ju(x,w,d)})]}),Be("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[le("span",{children:"Priority Fee Per Gas"}),le("strong",{children:Ui(G,"Gwei",w)})]}),Be("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[le("span",{children:"Max Fee Per Gas"}),le("strong",{children:Ui(F,"Gwei",w)})]}),Be("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[le("span",{children:"Gas Limit"}),le("strong",{children:Ui($,"",w)})]})]})]})]}),Be("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&le("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:c,children:t==="error"?"Close":"Cancel"}),Be("button",{type:"button",className:"wp-claim-primary","data-track":"withdraw_confirm",onClick:()=>{if(t==="success"){c();return}k&&C>0n&&u(k,C,x)},disabled:I||(t==="confirm"||t==="error")&&C<=0n,children:[t==="success"&&"Done",t==="submitting"&&le("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),le("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:le("span",{})})]})})}import*as _e from"react";import{useQueryClient as Yu}from"@tanstack/react-query";import{useQuery as qu}from"@tanstack/react-query";var Ku="wp:reward-factory-info";function gl(e,t=!0){let{data:n,...o}=qu({queryKey:[Ku,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 s=await a.json();if(s.code!==200)throw new Error(`Factory info API error: ${s.code}`);return s},enabled:t,staleTime:0});return{factoryInfo:n?.data??null,routerAddress:n?.data.router_address??"",...o}}var Qu="wp:";function hl(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function bl(e){let{env:t,walletAddress:n,sendTransaction:o,estimateGas:r}=Ie(),i=!!n,a=!!o,s=Yu(),{routerAddress:l}=gl(t,i&&a),c=hl(l),[u,f]=_e.useState(!1),[b,d]=_e.useState(void 0),[x,h]=_e.useState("confirm"),[w,g]=_e.useState(),[v,p]=_e.useState(""),[R,k]=_e.useState(!1),C=_e.useRef(void 0);_e.useEffect(()=>()=>clearTimeout(C.current),[]);let _=_e.useRef(new Set),T=_e.useCallback((P,ne)=>{_.current.has(P)||(_.current.add(P),Te("withdraw",P,{...ne,tags:{section:e,...ne?.tags}}))},[e]),I=_e.useCallback((P,ne)=>c?{to:c,value:0n,data:Ks(P,ne),chainId:Ne[t].cross}:null,[t,c]),G=_e.useCallback(()=>{s.invalidateQueries({predicate:P=>typeof P.queryKey[0]=="string"&&P.queryKey[0].startsWith(Qu)})},[s]),F=_e.useCallback(P=>{d(P),f(!0),h("confirm"),g(void 0),p(""),k(!1),_.current=new Set,T("opened")},[T]),$=_e.useCallback(()=>{x!=="submitting"&&(f(!1),d(void 0),h("confirm"),g(void 0),p(""),k(!1),x==="success"&&G())},[x,G]),L=_e.useCallback(async(P,ne)=>{if(!r)return null;let K=I(P.poolId,ne),B=hl(n);return!K||!B?null:r({...K,from:B})},[I,r,n]),Y=_e.useCallback(async()=>{if(!(!w||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(w),k(!0),clearTimeout(C.current),C.current=setTimeout(()=>k(!1),1400)}catch{k(!1)}},[w]),N=_e.useCallback(async(P,ne,K)=>{if(!o){h("error"),p("Withdraw is not available for this wallet.");return}if(!c){h("error"),p("Withdraw contract address is not available.");return}try{h("submitting"),p("");let B=I(P.poolId,ne);if(!B){h("error"),p("Withdraw contract address is not available.");return}T("submitted");let ce=await o({...B,gas:K?.gasLimit&&K.gasLimit>0n?K.gasLimit:void 0,maxFeePerGas:K?.maxFeePerGas&&K.maxFeePerGas>0n?K.maxFeePerGas:void 0,maxPriorityFeePerGas:K?.maxPriorityFeePerGas&&K.maxPriorityFeePerGas>0n?K.maxPriorityFeePerGas:void 0});g(ce),h("success"),T("confirmed"),G()}catch(B){h("error"),p(Ao(B,"Failed to request withdraw.")),T("confirmed",{status:"failure",reason:Tt(B)})}},[I,G,c,o,T]);return{canWithdrawInline:a,isOpen:u,initialPoolAddress:b,status:x,txHash:w,error:v,copied:R,hasEstimator:!!r,openWithdraw:F,closeWithdraw:$,estimateWithdraw:L,confirmWithdraw:N,copyHash:Y,trackFunnelOnce:T}}import{Fragment as Xu,jsx as mt,jsxs as wn}from"react/jsx-runtime";var Zu="ONEpoints";function xl(){let{env:e,walletAddress:t,onOutlink:n}=Ie(),o=Dt(),r=!!t,{getTokenImage:i,getNativeToken:a}=rn(e,r),s=bl("points"),{positions:l,isLoading:c}=ul(e,t,r),u=wl.useMemo(()=>l.filter(d=>d.poolType!=="CrossPool").map(d=>({...d,icon:i(d.tokenAddress,d.tokenSymbol)})),[l,i]),f=`${Ot[e]}/point.png`,b=nl[e];return wn(Xu,{children:[mt(Wt,{sectionKey:"points",title:Zu,icon:f,isEmpty:u.length===0,loading:c,children:u.map(d=>{let x=d.price?En(d.depositedRaw,d.decimals,d.price,o):null;return wn("article",{className:"wp-item","data-side":"reward",children:[wn("div",{className:"wp-item-body",children:[wn("div",{className:"wp-item-line",children:[mt("span",{className:"wp-item-label",children:"Token"}),wn("div",{className:"wp-svc-token",children:[d.icon&&mt("img",{className:"wp-svc-token-icon",src:d.icon,alt:""}),mt("span",{children:d.tokenSymbol})]})]}),wn("div",{className:"wp-item-line",children:[mt("span",{className:"wp-item-label",children:"Deposited"}),wn("div",{className:"wp-svc-token wp-svc-token--amount",children:[d.icon&&mt("img",{className:"wp-svc-token-icon",src:d.icon,alt:""}),wn("div",{className:"wp-svc-amount",children:[mt("span",{className:"wp-svc-amount-main",children:on(d.depositedRaw,d.decimals)}),x&&mt("span",{className:"wp-item-usd",children:x})]})]})]})]}),mt("div",{className:"wp-item-tags",children:s.canWithdrawInline?mt("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(d.poolAddress),children:mt("span",{className:"wp-tag-label",children:"Withdraw"})}):wn("a",{className:"wp-tag wp-tag--muted",href:b,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:h=>We(h,b,{category:"portfolio",origin:"portfolio-points",payload:{position:d}},n),children:[mt("span",{className:"wp-tag-label",children:"Withdraw"}),mt(It,{size:12,className:"wp-tag-icon"})]})})]},d.poolAddress)})}),mt(ml,{open:s.isOpen,status:s.status,positions:u,initialPoolAddress:s.initialPoolAddress,walletAddress:t,txHash:s.txHash,error:s.error,copied:s.copied,estimateWithdraw:s.hasEstimator?s.estimateWithdraw:void 0,onClose:s.closeWithdraw,onConfirm:s.confirmWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce,nativeSymbol:a()?.symbol})]})}import*as Gi from"react";import{useQuery as Ju}from"@tanstack/react-query";var ef="wp:stake-info";function yl(e,t,n=!0){let o=n&&!!t,{data:r,...i}=Ju({queryKey:[ef,e,t],queryFn:async({signal:s})=>{let l=await se("posa",e),c=await fetch(`${l}/stake/${t}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let u=await c.json();if(u.code!==0&&u.code!==200)throw new Error(`Stake info API error: ${u.code}`);return u},enabled:o,staleTime:0});return{stakeInfo:r?.data,...i}}import{useQuery as tf}from"@tanstack/react-query";var nf="wp:stake-rewards",of=31;function vl(e,t,n=!0){let o=n&&!!t,{data:r,...i}=tf({queryKey:[nf,e,t],queryFn:async({signal:a})=>{let s=await se("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${of}`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Stake rewards fetch failed: ${l.status}`);let c=await l.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:o,staleTime:0});return{latestReward:r?.[0]??null,aprAccrued:qs(r),...i}}import{useQuery as rf}from"@tanstack/react-query";var af="wp:staking-onchain";function kl(e,t,n=!0){let o=n&&!!t&&!!e,{data:r,...i}=rf({queryKey:[af,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:o,staleTime:0});return{onchain:r,...i}}import{useMemo as Sl}from"react";import sf from"bignumber.js";function Cl(e){return e?.trim().toUpperCase()==="CROSS"}function Rl(e){return new sf(e||"0").isGreaterThan(0)}function Fr(e,t,n=!0){let{allPools:o}=uo(e,n),r=Sl(()=>{for(let c of o)for(let u of[c.deposit_token,...c.reward_tokens])if(Cl(u?.symbol)&&Rl(u.price))return u.price},[o]),i=n&&r===void 0,{tokens:a}=Tn(e,t,i),{statsMap:s}=Nn(e,i),l=Ne[e].cross;return Sl(()=>{if(r)return r;let c=a.find(u=>u.chainId===l&&Cl(u.symbol));if(c){let u=s.get(Bt(c.chainId,c.address));if(u&&Rl(u.price))return u.price}return"0"},[r,a,s,l])}import _n from"bignumber.js";import{jsx as Ut,jsxs as In}from"react/jsx-runtime";function lf(e){if(!e)return"\u2014";let t=new _n(e);return t.isFinite()?`${t.toFormat(2,_n.ROUND_DOWN)}%`:"\u2014"}function Tl(){let{env:e,walletAddress:t,onOutlink:n,stakingRewardsReader:o}=Ie(),r=Dt(),i=!!t,{stakeInfo:a,isLoading:s}=yl(e,t,i),{latestReward:l,aprAccrued:c,isLoading:u}=vl(e,t,i),{onchain:f}=kl(t,o,i),b=Fr(e,t,i),{getNativeToken:d}=rn(e,i),x=d()?.symbol,h="ONEstaking",w=`${Ot[e]}/cross-staking.png`,g=rl[e],v=a?.total_stake??"0",p=Gi.useMemo(()=>f?new _n(f.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??a?.rewards_earned??"0",[f,l,a]),R=Gi.useMemo(()=>f?new _n(f.stakedWei.toString()).shiftedBy(-18):new _n(v),[f,v]),k=c!==void 0?new _n(c):void 0,C=a?.days_since_first_stake,_=k!==void 0&&k.isFinite()&&R.isGreaterThan(0)&&C!==null&&C!==void 0?k.div(R).times(365).div(Math.max(1,C)).times(100):void 0,T=!(new _n(v).isZero()&&new _n(p).isZero()),I=En(v,0,b,r),G=En(p,0,b,r);return Ut(Wt,{sectionKey:"staking",title:h,icon:w,iconFit:"contain",isEmpty:!T,loading:s||u,children:In("article",{className:"wp-item","data-side":"stake",children:[In("div",{className:"wp-item-body",children:[In("div",{className:"wp-item-line",children:[Ut("span",{className:"wp-item-label",children:"Staked"}),In("div",{className:"wp-svc-amount",children:[Ut("span",{className:"wp-svc-amount-main",children:`${Fi(v)} ${x??""}`.trim()}),I&&Ut("span",{className:"wp-item-usd",children:I})]})]}),In("div",{className:"wp-item-line",children:[Ut("span",{className:"wp-item-label",children:"Rewards Earned"}),In("div",{className:"wp-svc-amount",children:[Ut("span",{className:"wp-svc-amount-main",children:`${Fi(p)} ${x??""}`.trim()}),G&&Ut("span",{className:"wp-item-usd",children:G})]})]}),In("div",{className:"wp-item-line",children:[Ut("span",{className:"wp-item-label",children:"My APR"}),Ut("span",{children:lf(_?.toString(10))})]})]}),Ut("div",{className:"wp-item-tags",children:In("a",{className:"wp-tag wp-tag--mint",href:g,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:F=>We(F,g,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a}},n),children:[Ut("span",{className:"wp-tag-label",children:"Manage"}),Ut(It,{size:12,className:"wp-tag-icon"})]})})]})})}import*as zi from"react";import{useQuery as cf}from"@tanstack/react-query";var df="wp:game-swap-pools";function Nl(e,t,n=!0){let o=n&&!!t,{data:r,...i}=cf({queryKey:[df,e,t],queryFn:async({signal:a})=>{let s=await se("gameSwap",e),l=await fetch(`${s}/addresses/${t}/portfolio`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Game-swap portfolio fetch failed: ${l.status}`);return(await l.json()).pools??[]},enabled:o,staleTime:0});return{pools:r??[],...i}}import{useQuery as pf}from"@tanstack/react-query";var uf="wp:game-swap-lp-balances";function El(e,t,n,o){let r=[...n].map(l=>l.toLowerCase()).sort(),i=!!t&&r.length>0,{data:a,...s}=pf({queryKey:[uf,e,t,r,!!o],queryFn:async({signal:l})=>{let c=o?await o(r):await pl(e,t,r,l),u={};for(let[f,b]of Object.entries(c))u[f.toLowerCase()]=b;return u},enabled:i,staleTime:0});return{balances:a??{},...s}}import xn from"bignumber.js";import{jsx as Gt,jsxs as Yt}from"react/jsx-runtime";var ff="Gametoken LP",_l=18,mf=new xn("0.0001");function Il(e){return e?.trim().toUpperCase()==="CROSS"}function gf(e){return e&&e>0?e:_l}function hf(e){let t=Il(e.token_a?.symbol)&&!Il(e.token_b?.symbol),n=t?e.reserve_a:e.reserve_b,o=gf(t?e.token_a?.decimals:e.token_b?.decimals),r=new xn(n||"0").shiftedBy(-o);return!r.isFinite()||r.isLessThanOrEqualTo(0)?new xn(0):r.times(2)}function bf(e,t,n,o){let r=e.token_a?.symbol?.trim()||"TOKEN",i=e.token_b?.symbol?.trim()||o||"?",a=t?.decimals??_l,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let c=new xn(t.balance.toString()),u=new xn(t.totalSupply.toString()),f=c.div(u);s=f.times(100);let b=f.times(hf(e));if(b.isGreaterThan(0)){let d=new xn(e.quote_usd??e.cross_usd??"0");l=d.isGreaterThan(0)?jn(b.times(d),n):`${b.toFormat(4,xn.ROUND_DOWN)} ${o??""}`.trim()}}return{pool:e,tokenASymbol:r,tokenBSymbol:i,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:a,sharePercent:s,valueText:l}}function Pl(){let{env:e,walletAddress:t,onOutlink:n,lpBalanceReader:o}=Ie(),r=Dt(),i=!!t,{pools:a,isLoading:s}=Nl(e,t,i),l=zi.useMemo(()=>a.map(g=>g.pair_address).filter(Boolean),[a]),{balances:c,isLoading:u}=El(e,t,l,o),{getNativeToken:f}=rn(e,i),b=f()?.symbol,d=`${Ot[e]}/game-token.png`,x=Object.keys(c).length>0,h=zi.useMemo(()=>{let g=a.map(v=>bf(v,c[v.pair_address?.toLowerCase()],r,b));return x?g.filter(v=>v.lpAmountRaw?new xn(v.lpAmountRaw).shiftedBy(-v.lpDecimals).isGreaterThanOrEqualTo(mf):!1):g},[a,c,x,r,b]),w=g=>{let v=g.token_a?.address??g.pair_address;return`${il[e]}/gametoken/tokens/${v}?trade=deposit`};return Gt(Wt,{sectionKey:"gameSwap",title:ff,icon:d,iconFit:"contain",isEmpty:h.length===0,loading:s||u,children:h.map(g=>{let{pool:v}=g,p=w(v),R=`${g.tokenASymbol} / ${g.tokenBSymbol}`,k=v.token_a?.logo_url,C=v.token_b?.logo_url;return Yt("article",{className:"wp-item","data-side":"game-swap",children:[Yt("div",{className:"wp-item-body",children:[Yt("div",{className:"wp-item-line",children:[Gt("span",{className:"wp-item-label",children:"Pool"}),Yt("div",{className:"wp-svc-token",children:[Yt("span",{className:"wp-token-stack","aria-hidden":!0,children:[k&&Gt("img",{className:"wp-svc-token-icon",src:k,alt:""}),C&&Gt("img",{className:"wp-svc-token-icon",src:C,alt:""})]}),Gt("span",{children:R})]})]}),g.lpAmountRaw!==void 0&&Yt("div",{className:"wp-item-line",children:[Gt("span",{className:"wp-item-label",children:"My LP"}),Yt("span",{children:[on(g.lpAmountRaw,g.lpDecimals)," LP"]})]}),g.sharePercent!==void 0&&Yt("div",{className:"wp-item-line",children:[Gt("span",{className:"wp-item-label",children:"Pool Share"}),Yt("span",{children:[g.sharePercent.toFormat(2,xn.ROUND_DOWN),"%"]})]}),g.valueText!==void 0&&Yt("div",{className:"wp-item-line",children:[Gt("span",{className:"wp-item-label",children:"Value"}),Gt("span",{children:g.valueText})]})]}),Gt("div",{className:"wp-item-tags",children:Yt("a",{className:"wp-tag wp-tag--mint",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":R,onClick:_=>We(_,p,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:v}},n),children:[Gt("span",{className:"wp-tag-label",children:"Manage"}),Gt(It,{size:12,className:"wp-tag-icon"})]})})]},v.pair_address)})})}import Vn from"bignumber.js";import{useMemo as Cf}from"react";import{useQuery as wf}from"@tanstack/react-query";var xf="wp:forge-pools";function Ll(e,t,n=!0){let o=n&&!!t,{data:r,...i}=wf({queryKey:[xf,e,t],queryFn:async()=>{let s=await se("bondingCurve",e),l=await fetch(`${s}/v1/users/${t}/pools`,{cache:"no-store"});if(!l.ok)throw new Error(`forge pools fetch failed: ${l.status}`);return(await l.json()).data?.items??[]},enabled:o,staleTime:0}),a=r??[];return{pools:a,isEmpty:a.length===0,...i}}import{useQueries as yf}from"@tanstack/react-query";import{useMemo as vf}from"react";var kf="wp:forge-token-detail";async function Sf(e,t){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return n.ok?(await n.json())?.data?.token??null:null}function Al(e,t,n=!0){let o=yf({queries:t.map(a=>({queryKey:[kf,e,a],queryFn:async()=>Sf(await se("bondingCurve",e),a),enabled:n&&!!a,staleTime:3e4}))}),r=vf(()=>{let a=new Map;for(let s=0;s<o.length;s++){let l=o[s]?.data,c=t[s];l&&c&&a.set(c.toLowerCase(),l)}return a},[o,t]),i=o.some(a=>a.isLoading);return{detailMap:r,isLoading:i}}import{jsx as gt,jsxs as Pn}from"react/jsx-runtime";var Rf="ONEforge",Fl=18,Tf="https://contents.crosstoken.io/wallet/token/images/FT.png";function Nf(e){if(!e||e==="0")return"0";let t=new Vn(e).shiftedBy(-Fl);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Vn.ROUND_DOWN):t.toFormat(4,Vn.ROUND_DOWN)}function Ef(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 If(e,t,n,o){let r=new Vn(n||"0");if(!r.isGreaterThan(0))return null;let i=new Vn(e.total_supply||"0"),a=new Vn(e.lp_balance||"0"),s=new Vn(t?.reserve_b||"0").shiftedBy(-Fl);if(!i.isGreaterThan(0)||!a.isGreaterThan(0)||!s.isGreaterThan(0))return null;let l=s.times(2),u=a.div(i).times(l).times(r);return u.isFinite()?jn(u,o):null}function Bl(){let{env:e,walletAddress:t,onOutlink:n}=Ie(),o=Dt(),r=!!t,{pools:i,isEmpty:a,isLoading:s}=Ll(e,t,r),l=Cf(()=>i.map(d=>d.token.address),[i]),{detailMap:c}=Al(e,l,r&&l.length>0),u=Fr(e,t,r),f=d=>`${ol[e]}/forge/token/${d.token.address}`,b=`${Ot[e]}/forge.png`;return gt(Wt,{sectionKey:"forge",title:Rf,icon:b,iconFit:"contain",isEmpty:a,loading:s,children:i.map(d=>{let x=c.get(d.token.address.toLowerCase()),h=x?.image_url||x?.image||d.token.image||Tf,w=x?.symbol||d.token.symbol,g=f(d),v=If(d,x,u,o);return Pn("a",{className:"wp-item","data-side":"lp",href:g,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":w,onClick:p=>We(p,g,{category:"portfolio",origin:"portfolio-forge",payload:{pool:d,tokenDetail:x}},n),children:[Pn("div",{className:"wp-item-body",children:[Pn("div",{className:"wp-item-line",children:[gt("span",{className:"wp-item-label",children:"Asset"}),Pn("div",{className:"wp-svc-token",children:[gt("img",{className:"wp-svc-token-icon",src:h,alt:""}),gt("span",{children:w}),x?.name&>("span",{className:"wp-token-subtle",children:x.name})]})]}),Pn("div",{className:"wp-item-line",children:[gt("span",{className:"wp-item-label",children:"LP Balance"}),gt("div",{className:"wp-svc-token wp-svc-token--amount",children:Pn("div",{className:"wp-svc-amount",children:[gt("span",{className:"wp-svc-amount-main",children:Nf(d.lp_balance)}),v&>("span",{className:"wp-item-usd",children:v})]})})]}),Pn("div",{className:"wp-item-line",children:[gt("span",{className:"wp-item-label",children:"Ownership"}),gt("span",{className:"wp-line-value",children:Ef(d.pool_ownership)})]})]}),gt("div",{className:"wp-item-tags",children:Pn("span",{className:"wp-tag wp-tag--muted",children:[gt("span",{className:"wp-tag-label",children:"Withdraw"}),gt(It,{size:12,className:"wp-tag-icon"})]})})]},d.pair_address)})})}import{useMemo as Kl}from"react";import em from"bignumber.js";import{useQuery as _f}from"@tanstack/react-query";var Pf="wp:crossd-positions";function Lf(e){let t=e??{};return(t.positions??t.data?.positions??[]).filter(o=>{if(!o?.token_id||!o.liquidity)return!1;try{return BigInt(o.liquidity)>0n}catch{return!1}})}function Ml(e,t,n=!0){let o=n&&!!t,{data:r,...i}=_f({queryKey:[Pf,e,t],queryFn:async()=>{let s=await fetch(`${Lr[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return Lf(await s.json())},enabled:o,staleTime:0}),a=r??[];return{positions:a,isEmpty:a.length===0,...i}}import{useQueries as Af}from"@tanstack/react-query";import{useMemo as Ff}from"react";var Bf="wp:crossd-position-details";function Mf(e){let t=e??{},n=t.data??t;return n?.token_id||n?.pool?n:null}function Dl(e,t,n=!0){let o=Af({queries:t.map(i=>({queryKey:[Bf,e,i],queryFn:async()=>{let a=await fetch(`${Lr[e]}/api/v1/positions/${i}`,{cache:"no-store"});if(!a.ok)throw new Error(`crossd position detail failed: ${a.status}`);return Mf(await a.json())},enabled:n&&!!i,staleTime:6e4}))});return{detailMap:Ff(()=>{let i=new Map;return o.forEach((a,s)=>{let l=a.data,c=t[s];l&&c&&i.set(c,l)}),i},[o,t])}}import*as yn from"react";import{Fragment as Wl,jsx as ie,jsxs as Ye}from"react/jsx-runtime";var Df=300*1e3,Ol="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Of(e,t,n){if(t)return"Estimating...";if(!e)return"Wallet estimate";let o=e.maxFeePerGas??e.gasPrice;return!o||o<=0n||e.gasLimit<=0n?"Wallet estimate":`${Tr(e.gasLimit*o)} ${n??""}`.trim()}function $i(e,t,n){return n?"Estimating...":`${e} ${t}`.trim()}function Ul({open:e,status:t,target:n,token0Icon:o,token1Icon:r,token0Symbol:i,token1Symbol:a,nativeSymbol:s,txHash:l,error:c,copied:u=!1,hasEstimator:f,prepareWithdraw:b,confirmWithdraw:d,onClose:x,onCopyHash:h,trackFunnel:w}){let[g,v]=yn.useState(null),[p,R]=yn.useState(null),k=yn.useRef(0);yn.useEffect(()=>{if(!e||!n)return;let X=++k.current;v(null),R(null),w?.("dialog_opened"),b().then(me=>{k.current===X&&(v(me),R(me?Date.now():null))})},[e,n]);let C=t==="submitting",_=t==="estimating"||t==="confirm"&&!g,T=yn.useCallback(async()=>{let X=g,me=!p||Date.now()-p>Df;if(!X||me){let ve=++k.current;if(X=await b(),k.current!==ve)return;v(X),R(X?Date.now():null)}X&&await d(X)},[g,p,b,d]);if(!e||!n)return null;let{position:I,detail:G}=n,F=G.pool?.token0,$=G.pool?.token1,L=i||F?.symbol||I.pool?.token0_symbol||"?",Y=a||$?.symbol||I.pool?.token1_symbol||"?",N=F?.decimals??18,P=$?.decimals??18,ne=o||F?.logo_url||Ol,K=r||$?.logo_url||Ol,B=`${L}/${Y}`,ce=g?lo(g.expectedAmount0.toString(),N):null,re=g?lo(g.expectedAmount1.toString(),P):null,H=po(g?.estimate?.maxPriorityFeePerGas),D=po(g?.estimate?.maxFeePerGas??g?.estimate?.gasPrice),Q=Rr(g?.estimate?.gasLimit);return ie("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:X=>{X.target===X.currentTarget&&!C&&x()},children:Ye("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-crossd-withdraw-title","aria-label":"Withdraw position","data-status":t,"data-vaul-no-drag":!0,children:[ie("div",{className:"wp-claim-grabber","aria-hidden":!0,children:ie("span",{})}),Ye("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?Ye(Wl,{children:[ie("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:ie(Ir,{})}),Ye("div",{className:"wp-claim-copy",children:[ie("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Ye("p",{className:"wp-claim-desc",children:["Your ",B," position withdrawal has been submitted. Balances will update shortly after the transaction settles."]})]}),ie("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:Ye("div",{className:"wp-claim-list-item",children:[ie("span",{children:"Tx Hash"}),Ye("button",{type:"button",className:"wp-claim-hash",onClick:h,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[ie("strong",{children:Cr(l)}),u?ie(Er,{}):ie(Nr,{})]})]})})]}):Ye(Wl,{children:[t==="error"&&Ye("div",{className:"wp-claim-heading",children:[ie("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),ie("p",{className:"wp-claim-error-message",children:c||"The withdraw request could not be completed."})]}),Ye("div",{className:"wp-claim-reward-card","data-fit":Lo(L,ce??""),"aria-label":`Expected ${L}`,children:[ie("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:ie("img",{src:ne,alt:"",width:28,height:28})}),ie("strong",{className:"wp-claim-reward-symbol",children:L}),ie("strong",{className:"wp-claim-reward-amount",children:ce??"Estimating..."})]}),Ye("div",{className:"wp-claim-reward-card","data-fit":Lo(Y,re??""),"aria-label":`Expected ${Y}`,children:[ie("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:ie("img",{src:K,alt:"",width:28,height:28})}),ie("strong",{className:"wp-claim-reward-symbol",children:Y}),ie("strong",{className:"wp-claim-reward-amount",children:re??"Estimating..."})]}),f&&ie("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:Ye("div",{className:"wp-claim-detail-list",children:[Ye("div",{className:"wp-claim-detail-row",children:[ie("span",{children:"Est. Tx Fee"}),ie("strong",{children:Of(g?.estimate,_,s)})]}),Ye("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[ie("span",{children:"Priority Fee Per Gas"}),ie("strong",{children:$i(H,"Gwei",_)})]}),Ye("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[ie("span",{children:"Max Fee Per Gas"}),ie("strong",{children:$i(D,"Gwei",_)})]}),Ye("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[ie("span",{children:"Gas Limit"}),ie("strong",{children:$i(Q,"",_)})]})]})})]}),Ye("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&ie("button",{type:"button",className:"wp-claim-secondary","data-track":"crossd_withdraw_cancel",onClick:x,children:t==="error"?"Close":"Cancel"}),ie("button",{type:"button",className:"wp-claim-primary","data-track":"crossd_withdraw_confirm",onClick:()=>{if(t==="success"){x();return}C||_||(w?.("confirm_clicked"),T())},disabled:C||_,children:t==="success"?"Done":C?ie("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}):_?ie("span",{className:"wp-claim-button-spinner","aria-label":"Estimating"}):t==="error"?"Retry":"Withdraw"})]})]}),ie("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:ie("span",{})})]})})}import*as Se from"react";import{useQueryClient as Qf}from"@tanstack/react-query";var Wf="0x0c49ccbe",Uf="0xfc6f7865",Gf="0x49404b7c",zf="0xdf2ab5bb",$f="0xac9650d8",Gl=(1n<<128n)-1n,$l=600n,Hf=99n,jf=100n;function Hi(e){return e*Hf/jf}function zl(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function ht(e,t){if(e<0n)throw new Error(`${t} must be non-negative`);let n=e.toString(16);if(n.length>64)throw new Error(`${t} exceeds uint256`);return n.padStart(64,"0")}function Br(e,t){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`${t} is not a valid address`);return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function ji(e){return Wf+ht(e.tokenId,"tokenId")+ht(e.liquidity,"liquidity")+ht(e.amount0Min,"amount0Min")+ht(e.amount1Min,"amount1Min")+ht(e.deadline,"deadline")}function Vf(e){return Uf+ht(e.tokenId,"tokenId")+Br(e.recipient,"recipient")+ht(e.amount0Max,"amount0Max")+ht(e.amount1Max,"amount1Max")}function qf(e,t){return Gf+ht(e,"amountMinimum")+Br(t,"recipient")}function Kf(e,t,n){return zf+Br(e,"token")+ht(t,"amountMinimum")+Br(n,"recipient")}function Yf(e){if(e.length===0)throw new Error("multicall requires at least one call");let t=e.map(r=>{let i=r.replace(/^0x/,"");if(i.length%2!==0||!/^[0-9a-fA-F]*$/.test(i))throw new Error("multicall element must be valid hex bytes");let a=i.length%64===0?i:i.padEnd(i.length+(64-i.length%64),"0");return ht(BigInt(i.length/2),"callLength")+a.toLowerCase()}),n=BigInt(e.length)*32n,o=[];for(let r of t)o.push(ht(n,"callOffset")),n+=BigInt(r.length/2);return $f+ht(0x20n,"arrayOffset")+ht(BigInt(e.length),"arrayLength")+o.join("")+t.join("")}function Hl(e){if(!e||e==="0x")return null;let t=e.replace(/^0x/,"");return t.length<128||!/^[0-9a-fA-F]+$/.test(t)?null:{amount0:BigInt(`0x${t.slice(0,64)}`),amount1:BigInt(`0x${t.slice(64,128)}`)}}function jl(e){let t=zl(e.token0,e.wcrossAddress),n=zl(e.token1,e.wcrossAddress),o=t||n,r=[ji({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),Vf({tokenId:e.tokenId,recipient:o?e.positionManagerAddress:e.owner,amount0Max:Gl,amount1Max:Gl})];return o&&(r.push(qf(0n,e.owner)),r.push(Kf(t?e.token1:e.token0,0n,e.owner))),Yf(r)}async function Vl(e,t,n){let o;try{o=await Do(e,n)}catch{o=void 0}if(!o)return null;let r=ji({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),i=await bn(o,t.positionManager,r,n,t.owner);return Hl(i)}var Zf="wp:",Xf=[1500,3e3,4500,6e3];function Jf(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function ql(){let{env:e,walletAddress:t,sendTransaction:n,estimateGas:o}=Ie(),r=!!n,i=Qf(),[a,s]=Se.useState(!1),[l,c]=Se.useState(null),[u,f]=Se.useState("confirm"),[b,d]=Se.useState(),[x,h]=Se.useState(""),[w,g]=Se.useState(!1),[v,p]=Se.useState(new Set),R=Se.useRef(void 0),k=Se.useRef([]),C=Se.useRef(0);Se.useEffect(()=>()=>{clearTimeout(R.current),k.current.forEach(clearTimeout)},[]);let _=Se.useRef(new Set),T=Se.useCallback((N,P)=>{_.current.has(N)||(_.current.add(N),Te("withdraw",N,{...P,tags:{section:"crossdPool",...P?.tags}}))},[]),I=Se.useCallback(()=>{let N=()=>i.invalidateQueries({predicate:P=>typeof P.queryKey[0]=="string"&&P.queryKey[0].startsWith(Zf)});N(),k.current.forEach(clearTimeout),k.current=Xf.map(P=>setTimeout(N,P))},[i]),G=Se.useCallback(N=>{C.current+=1,c(N),s(!0),f("confirm"),d(void 0),h(""),g(!1),_.current=new Set,T("opened")},[T]),F=Se.useCallback(()=>{u!=="submitting"&&(C.current+=1,s(!1),c(null),f("confirm"),d(void 0),h(""),g(!1))},[u]),$=Se.useCallback(async()=>{let N=C.current,P=Jf(t),ne=l?.position.token_id,K=l?.position.liquidity,B=l?.detail.pool?.token0?.address,ce=l?.detail.pool?.token1?.address;if(!P||!ne||!K||!B||!ce)return f("error"),h("Position data is incomplete. Please refresh and retry."),null;try{f("estimating"),h("");let re=BigInt(ne),H=BigInt(K),D=BigInt(Math.floor(Date.now()/1e3))+$l,Q=sl[e],X=await Vl(e,{owner:P,positionManager:Q,tokenId:re,liquidity:H,deadline:D});if(C.current!==N)return null;if(!X)return f("error"),h("Failed to estimate withdrawal amounts. Please retry."),null;let me=jl({tokenId:re,liquidity:H,amount0Min:Hi(X.amount0),amount1Min:Hi(X.amount1),deadline:D,owner:P,positionManagerAddress:Q,token0:B,token1:ce,wcrossAddress:ll[e]}),ve={to:Q,value:0n,data:me,chainId:Ne[e].cross},J=null;if(o){try{J=await o({...ve,from:P})}catch{J=null}if(C.current!==N)return null}return f("confirm"),{tx:ve,estimate:J,expectedAmount0:X.amount0,expectedAmount1:X.amount1}}catch(re){return C.current!==N||(f("error"),h(Ao(re,"Failed to prepare withdraw."))),null}},[e,o,l,t]),L=Se.useCallback(async N=>{if(!n){f("error"),h("Withdraw is not available for this wallet.");return}try{f("submitting"),h(""),T("submitted");let P=await n({...N.tx,gas:N.estimate?.gasLimit&&N.estimate.gasLimit>0n?N.estimate.gasLimit:void 0,maxFeePerGas:N.estimate?.maxFeePerGas&&N.estimate.maxFeePerGas>0n?N.estimate.maxFeePerGas:void 0,maxPriorityFeePerGas:N.estimate?.maxPriorityFeePerGas&&N.estimate.maxPriorityFeePerGas>0n?N.estimate.maxPriorityFeePerGas:void 0});d(P),f("success");let ne=l?.position.token_id;ne&&p(K=>{let B=new Set(K);return B.add(ne),B}),T("confirmed"),I()}catch(P){f("error"),h(Ao(P,"Failed to request withdraw.")),T("confirmed",{status:"failure",reason:Tt(P)})}},[I,n,l,T]),Y=Se.useCallback(async()=>{if(!(!b||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(b),g(!0),clearTimeout(R.current),R.current=setTimeout(()=>g(!1),1400)}catch{g(!1)}},[b]);return{canWithdrawInline:r,isOpen:a,target:l,withdrawnTokenIds:v,status:u,txHash:b,error:x,copied:w,hasEstimator:!!o,openWithdraw:G,closeWithdraw:F,prepareWithdraw:$,confirmWithdraw:L,copyHash:Y,trackFunnelOnce:T}}import{Fragment as nm,jsx as bt,jsxs as Ln}from"react/jsx-runtime";var tm="ONEusd Pool",Yl="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Ql(){let{env:e,walletAddress:t,onOutlink:n}=Ie(),o=Dt(),r=!!t,{positions:i,isLoading:a}=Ml(e,t,r),s=ql(),l=Kl(()=>i.filter(T=>!T.token_id||!s.withdrawnTokenIds.has(T.token_id)),[i,s.withdrawnTokenIds]),c=Kl(()=>l.map(T=>T.token_id).filter(T=>!!T),[l]),{detailMap:u}=Dl(e,c,r&&c.length>0),f=`${al[e]}/pool`,{getTokenImage:b,getTokenSymbol:d,getNativeToken:x}=rn(e,r),h=b("","ONEUSD",{chainOnly:!0})||`${Ot[e]}/crossd.png`,w={chainOnly:!0},g=(T,I)=>{let G=Ai(d(T?.address??"",T?.symbol??I,w));return G==="CROSS"?x()?.symbol??"?":G??"?"},v=(T,I)=>{let G=T?.symbol??I,F=Ai(G);return F==="CROSS"?x()?.image||Yl:b(T?.address??"",F,w)||T?.logo_url||Yl},p=s.target?.detail.pool,R=v(p?.token0,s.target?.position.pool?.token0_symbol),k=v(p?.token1,s.target?.position.pool?.token1_symbol),C=g(p?.token0,s.target?.position.pool?.token0_symbol),_=g(p?.token1,s.target?.position.pool?.token1_symbol);return Ln(nm,{children:[bt(Wt,{sectionKey:"crossdPool",title:tm,icon:h,iconFit:"contain",isEmpty:l.length===0,loading:a,children:l.map(T=>{let I=T.token_id?u.get(T.token_id):void 0,G=`${g(I?.pool?.token0,T.pool?.token0_symbol)}/${g(I?.pool?.token1,T.pool?.token1_symbol)}`,F=T.pool?.fee_tier_percentage,$=v(I?.pool?.token0,T.pool?.token0_symbol),L=v(I?.pool?.token1,T.pool?.token1_symbol),Y=jn(new em(T.position_value_usd??"0"),o),N=s.canWithdrawInline&&!!I?.pool?.token0?.address&&!!I?.pool?.token1?.address;return Ln("article",{className:"wp-item","data-side":"crossd",children:[Ln("div",{className:"wp-item-body",children:[Ln("div",{className:"wp-item-line",children:[bt("span",{className:"wp-item-label",children:"Pool"}),Ln("div",{className:"wp-svc-token",children:[Ln("span",{className:"wp-token-stack","aria-hidden":!0,children:[bt("img",{className:"wp-svc-token-icon",src:$,alt:""}),bt("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),bt("span",{children:G}),F&&bt("span",{className:"wp-token-subtle",children:F})]})]}),Ln("div",{className:"wp-item-line",children:[bt("span",{className:"wp-item-label",children:"Position Value"}),bt("span",{className:"wp-line-value",children:Y})]})]}),bt("div",{className:"wp-item-tags",children:N?bt("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"crossd_pool_withdraw_open","data-track-id":G,onClick:()=>{I&&s.openWithdraw({position:T,detail:I})},children:bt("span",{className:"wp-tag-label",children:"Withdraw"})}):Ln("a",{className:"wp-tag wp-tag--muted",href:f,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":G,onClick:P=>We(P,f,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:T,detail:I}},n),children:[bt("span",{className:"wp-tag-label",children:"Withdraw"}),bt(It,{size:12,className:"wp-tag-icon"})]})})]},T.token_id)})}),bt(Ul,{open:s.isOpen,status:s.status,target:s.target,token0Icon:R,token1Icon:k,token0Symbol:C,token1Symbol:_,nativeSymbol:x()?.symbol,txHash:s.txHash,error:s.error,copied:s.copied,hasEstimator:s.hasEstimator,prepareWithdraw:s.prepareWithdraw,confirmWithdraw:s.confirmWithdraw,onClose:s.closeWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce})]})}var Mr=["rewards","points","staking","gameSwap","forge","crossdPool"];te(`.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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-lowest, #2e2820);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--wp-claim-primary-text: #ffffff;--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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-low, #fff5ee);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--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-item[data-side=reward] .wp-svc-token-icon{border-radius:0;object-fit:contain}.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-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}}.wi-popover-content .wp-claim-sheet{min-height:min(600px,calc(100% - 24px))}.wi-popover-content .wp-claim-content{flex:1 1 auto}.wi-popover-content .wp-claim-actions{margin-top:auto}.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:6px;width:100%;min-height:60px;padding:16px 8px;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-reward-card[data-fit=sm] .wp-claim-reward-symbol{font-size:14px}.wp-claim-reward-card[data-fit=sm] .wp-claim-reward-amount{font-size:16px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-symbol{font-size:12px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-amount{font-size:13px}.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}
|
|
9
|
-
`);import{Fragment as im,jsx as ge,jsxs as vn}from"react/jsx-runtime";var Vi=15,rm="wp:";function fo({env:e,theme:t="light",walletAddress:n,walletName:o,onBack:r,showHeader:i=!0,variant:a="embed",className:s,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:u,sendTransaction:f,estimateGas:b,conversionRatio:d,currencySymbol:x,sections:h}){let w=Me(e),g=Pe.useCallback(J=>!h||h.includes(J),[h]),v=!!n,p=om(),[R,k]=Pe.useState({}),C=Pe.useCallback((J,be)=>{k(Le=>{let Ue=Le[J];return Ue&&Ue.loading===be.loading&&Ue.empty===be.empty?Le:{...Le,[J]:be}})},[]),_=Pe.useCallback(J=>{k(be=>{if(!(J in be))return be;let Le={...be};return delete Le[J],Le})},[]),T=Pe.useMemo(()=>({report:C,unregister:_}),[C,_]),[I,G]=Pe.useState(Vi),[F,$]=Pe.useState(!1),[L,Y]=Pe.useState(!1),N=Pe.useRef(void 0),P=Pe.useCallback(()=>{p.invalidateQueries({predicate:J=>typeof J.queryKey[0]=="string"&&J.queryKey[0].startsWith(rm)})},[p]),ne=Pe.useCallback(()=>{P(),$(!0),setTimeout(()=>$(!1),600),G(Vi)},[P]);Pe.useEffect(()=>{if(!v)return;let J=setInterval(()=>{G(be=>be<=1?(ne(),Vi):be-1)},1e3);return()=>clearInterval(J)},[v,ne]);let K=Pe.useCallback(()=>{r?.()},[r]),B=v?hn(w,n,{size:64}):void 0,ce=Pe.useCallback(async()=>{if(!(L||!n))try{await navigator.clipboard.writeText(n),Y(!0),clearTimeout(N.current),N.current=setTimeout(()=>Y(!1),2e3)}catch{}},[n,L]);Pe.useEffect(()=>()=>clearTimeout(N.current),[]);let re=Pe.useMemo(()=>({env:w,theme:t,open:!0,walletAddress:n,close:K,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:u,sendTransaction:f,estimateGas:b,conversionRatio:d,currencySymbol:x}),[w,t,n,K,l,c,u,f,b,d,x]),H=Mr.filter(g),D=H.length>0&&H.every(J=>{let be=R[J];return!!be&&!be.loading}),Q=D&&H.every(J=>R[J]?.empty),X=H.some(J=>{let be=R[J];return!!be&&!be.empty}),me=H.length>0&&!D&&!X,ve=vn(im,{children:[i&&vn("div",{className:"wp-header",children:[vn("div",{className:"wp-header-account",children:[r&&ge("button",{type:"button",className:"wp-header-btn","aria-label":"Back","data-track":"back",onClick:r,children:ge(Xs,{})}),ge("span",{className:"wp-header-avatar","aria-hidden":!0,children:B&&ge("img",{src:B,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(o||n)&&vn("div",{className:"wp-header-account-meta",children:[o&&ge("span",{className:"wp-header-wallet-name",title:o,children:o}),n&&vn("button",{type:"button",className:"wp-header-address-btn",onClick:ce,"aria-label":"Copy wallet address","data-track":"address_copy",children:[ge("span",{className:"wp-header-address",children:Sr(n)}),ge("span",{className:"wp-header-address-copy","data-copied":L,children:L?ge(mn,{size:14}):ge(Wn,{size:14})})]})]})]}),vn("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio","data-track":"refresh",onClick:ne,children:[ge(Js,{className:F?"wp-spin-once":void 0}),v&&ge("span",{className:"wp-refresh-badge",children:I})]})]}),ge("div",{className:"wp-body",children:vn("div",{className:"wp-body-inner","data-empty":Q||void 0,children:[g("rewards")&&ge(dl,{}),g("points")&&ge(xl,{}),g("staking")&&ge(Tl,{}),g("gameSwap")&&ge(Pl,{}),g("forge")&&ge(Bl,{}),g("crossdPool")&&ge(Ql,{}),me&&ge("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:ge("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),Q&&vn("div",{className:"wp-portfolio-empty",role:"status",children:[ge("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:vn("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[ge("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),ge("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),ge("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),ge("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),ge("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across ONE services will appear here."})]})]})})]});return ge(Bo.Provider,{value:re,children:ge(Bi.Provider,{value:T,children:ge(xe,{feature:"wallet_portfolio",children:a==="none"?ve:ge("div",{className:ue(a==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:ve})})})})}import{jsx as qi,jsxs as Zl}from"react/jsx-runtime";function Xl({className:e}){let{env:t,theme:n,walletAddress:o,close:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s}=Ie();return Zl(Dr.Portal,{children:[qi(Dr.Overlay,{className:"wp-overlay"}),Zl(Dr.Content,{className:ue("wp-fullscreen",e),"data-theme":n,children:[qi(Dr.Title,{className:"wp-sr-only",children:"Portfolio"}),qi(fo,{env:t,theme:n,walletAddress:o,onBack:r,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s})]})]})}import{jsx as Jl}from"react/jsx-runtime";function sm({env:e,theme:t="light",walletAddress:n,open:o,onOpenChange:r,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,conversionRatio:u,currencySymbol:f,children:b}){let d=Me(e),x=o!==void 0,[h,w]=qn.useState(!1),g=x?o:h,v=qn.useCallback(k=>{x||w(k),r?.(k)},[x,r]),p=qn.useCallback(()=>v(!1),[v]),R=qn.useMemo(()=>({env:d,theme:t,open:g,walletAddress:n,close:p,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,conversionRatio:u,currencySymbol:f}),[d,t,g,n,p,i,a,s,l,c,u,f]);return Jl(Bo.Provider,{value:R,children:Jl(am.Root,{direction:"bottom",open:g,onOpenChange:v,noBodyStyles:!0,children:b})})}var ec=Object.assign(sm,{Trigger:Qs,Content:Xl});import*as U from"react";import{createPortal as mo}from"react-dom";import an from"bignumber.js";import{jsx as zt,jsxs as lm}from"react/jsx-runtime";function tc({size:e=20,className:t}){return lm("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:[zt("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),zt("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function nc({size:e=16,className:t}){return zt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:zt("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 oc({size:e=16,className:t}){return zt("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:zt("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 rc({size:e=20,className:t}){return zt("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:zt("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ic({size:e=16,className:t}){return zt("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:zt("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function ac({size:e=12,className:t}){return zt("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:zt("path",{d:"M3.5 2 1.5 4l2 2M1.5 4h9M8.5 10l2-2-2-2M10.5 8h-9",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})})}import*as M from"react";import cc from"bignumber.js";function sc(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function lc(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,cc.ROUND_DOWN).toFixed()}function cm(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 dm(e){let t=e.fromToken.priceUsd,n=e.toToken.priceUsd,o=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,r=new cc(o||"0");return!r.isFinite()||r.isNaN()||r.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:sc(t)&&sc(n)?e.lastChangedBy==="to"?{fromAmount:lc(r.multipliedBy(n).dividedBy(t))}:{toAmount:lc(r.multipliedBy(t).dividedBy(n))}:cm(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function dc({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(n){return e?e(n):dm(n)},async submitBridge(n){if(!t)throw new Error("Bridge submit handler is not configured.");return t(n)}}}var pc=15,pm=18,gc="cross_bridge_terms_accepted",um=3600*24*365;function fm(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,pc);let r=t.slice(0,o).slice(0,pc),i=t.slice(o+1).slice(0,pm);return`${r}.${i}`}function mm(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${gc}=true`)}function gm(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${gc}=true`,"Path=/",`Max-Age=${um}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function hm(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 uc(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("CROSS")?t.slice(1):t}function bm(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let n=new Set([uc(e.symbol),uc(t.symbol)]);return n.has("CROSS")&&n.has("CROSSD")}function Qt(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Or(e){return e[0]}function Ki(e,t,n,o){if(n&&!Qt(n,t))return n;let r=t?o?.(t,e):void 0;if(r?.length)return r[0];if(!t)return e[1]??Or(e);let i=e.findIndex(s=>Qt(s,t)),a=i>=0?e[i+1]:void 0;return a&&!Qt(a,t)?a:e.find(s=>!Qt(s,t))??t}function fc({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 Wr(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),...Wr(n.cause,t+1),...Wr(n.data,t+1),...Wr(n.error,t+1)]}function Yi(e){let t=Wr(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 mc(e,t){return Yi(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
|
|
10
|
-
`)[0]?.trim()||t}function hc(e){let{tokens:t,initialFromToken:n,initialToToken:o,getToTokens:r,getApproval:i,approveBridge:a,history:s=[],initialSlippage:l="1",termsUrl:c=ao,getQuote:u,submitBridge:f,onSubmitted:b,onSuccess:d,onFailed:x,onExit:h}=e,w=M.useMemo(()=>dc({getQuote:u,submitBridge:f}),[u,f]),[g,v]=M.useState("form"),[p,R]=M.useState(n??Or(t)),[k,C]=M.useState(()=>Ki(t,n??Or(t),o,r)),[_,T]=M.useState(""),[I,G]=M.useState(""),[F,$]=M.useState("from"),[L,Y]=M.useState(l),[N,P]=M.useState(null),ne=M.useMemo(()=>bm(p,k),[p,k]),K=M.useMemo(()=>ne?"1":L==="auto"?hm(N?.priceImpact):L,[ne,L,N?.priceImpact]),[B,ce]=M.useState(""),[re,H]=M.useState("idle"),[D,Q]=M.useState(""),[X,me]=M.useState(null),[ve,J]=M.useState([]),[be,Le]=M.useState(!1),[Ue,it]=M.useState(mm),[ae,$e]=M.useState(null),[Xe,Ae]=M.useState(!1),[Je,He]=M.useState(null),[_t,cn]=M.useState(null),[ft,xt]=M.useState(!1),[yt,Pt]=M.useState(!1),Fe=M.useRef(0),$t=M.useRef(null),vt=M.useRef(!1),kt=M.useRef(!1),dn=M.useRef(!1),Lt=M.useRef(!1),ke=M.useRef(!1);M.useEffect(()=>{vt.current||(vt.current=!0,Te("bridge","opened"))},[]);let je=M.useCallback(()=>{$t.current&&(clearTimeout($t.current),$t.current=null)},[]),St=M.useCallback(q=>{je(),cn(q)},[je]);M.useEffect(()=>je,[je]),M.useEffect(()=>{let q=t.find(Re=>Qt(Re,p))??Or(t),we=q?r?.(q,t):void 0,Z=we?.find(Re=>Qt(Re,k))??(we?void 0:t.find(Re=>Qt(Re,k)))??Ki(t,q,void 0,r);R(q),C(Z)},[r,t,p,k]);let at=M.useCallback((q,we)=>{let Z=fm(q);if(!Z){Fe.current+=1,T(""),G(""),$(we),P(null),ce(""),H("idle");return}we==="from"?T(Z):G(Z),$(we),ce(""),!dn.current&&Number(Z)>0&&(dn.current=!0,Te("bridge","amount_entered"))},[]),Ge=M.useCallback(()=>{Fe.current+=1,T(""),G(""),$("from"),P(null),ce(""),Q(""),H("idle"),$e(null),Ae(!1),He(null),xt(!1),St(null)},[St]),Ht=M.useCallback(q=>{Qt(q,p)||(kt.current||(kt.current=!0,Te("bridge","token_selected",{tags:{item_id:`from:${q.symbol}`}})),R(q),C(Ki(t,q,void 0,r)),Ge())},[p,r,Ge,t]),Zt=M.useCallback(q=>{Qt(q,k)||Qt(q,p)||(kt.current||(kt.current=!0,Te("bridge","token_selected",{tags:{item_id:`to:${q.symbol}`}})),C(q),Ge())},[p,Ge,k]),Ve=M.useMemo(()=>p?r?.(p,t)??t.filter(q=>!Qt(q,p)):[],[p,r,t]),Xt=M.useCallback(()=>{p?.balance&&at(p.balance,"from")},[p?.balance,at]),pn=M.useCallback(()=>{!p||!k||(R(k),C(p),Ge())},[p,Ge,k]),un=M.useCallback(()=>{Fe.current+=1,T(""),G(""),$("from"),P(null),ce(""),Q("")},[]);M.useEffect(()=>{if(!p||!k)return;if(!_&&!I){P(null),ce(""),H(Z=>Z==="quoting"?"idle":Z);return}let q=++Fe.current,we=fc({fromToken:p,toToken:k,fromAmount:_,toAmount:I,lastChangedBy:F,slippage:L});H(Z=>Z==="submitting"?Z:w.canQuote?"quoting":"idle"),(async()=>{try{let Z=await w.getQuote(we);if(Fe.current!==q)return;Z.fromAmount!==void 0&&F==="to"&&T(Z.fromAmount),Z.toAmount!==void 0&&F==="from"&&G(Z.toAmount),P(Z.summary??null),ce(Z.error??"")}catch(Z){if(Fe.current!==q)return;ce(Z instanceof Error?Z.message:"Failed to quote bridge.")}finally{Fe.current===q&&H(Z=>Z==="quoting"?"idle":Z)}})()},[_,p,F,w,L,I,k]);let A=M.useCallback(()=>!p||!k?null:fc({fromToken:p,toToken:k,fromAmount:_,toAmount:I,lastChangedBy:F,slippage:K}),[K,_,p,F,I,k]),ee=M.useCallback(async(q,we)=>{Q(""),xt(!1),Ae(!1),H("submitting");try{if(!we?.skipApprovalCheck&&i){let Re=await i(q);if(Re){$e(Re),He(q),H("idle");return}}$e(null),He(null),St("processing");let Z=await w.submitBridge(q);me(Z),H("success"),J(Re=>[{id:Z.txHash,timestamp:new Date().toISOString(),txHash:Z.txHash,fromToken:Z.fromToken,toToken:Z.toToken,fromAmount:Z.fromAmount,toAmount:Z.toAmount,summary:N??void 0,status:"pending"},...Re.filter(qe=>qe.txHash!==Z.txHash)]),un(),Pt(!0),St(null),xt(!0),Te("bridge","confirmed"),Lt.current=!1,ke.current=!1,b?.(Z),d?.(Z)}catch(Z){if(St(null),Te("bridge","confirmed",{status:"failure",reason:Tt(Z)}),Lt.current=!1,ke.current=!1,Yi(Z)){H("idle");return}let Re=mc(Z,"Failed to submit bridge.");Q(Re),H("error"),x?.({message:Re})}},[i,x,b,d,w,un,St,N]),Ce=M.useCallback(async()=>{if(B)return;let q=A();if(q){if(Lt.current||(Lt.current=!0,Te("bridge","submitted")),!Ue){He(q),Le(!0);return}await ee(q)}},[A,B,ee,Ue]),Ct=M.useCallback(async()=>{let q=Je??A();q&&(gm(),it(!0),Le(!1),await ee(q))},[A,Je,ee]),Rt=M.useCallback(()=>{Le(!1),He(null)},[]),Jt=M.useCallback(async()=>{if(!(re==="submitting"||!ae||!Je||!a)){Q(""),H("submitting");try{await a(Je,ae),ke.current||(ke.current=!0,Te("bridge","approved")),$e(null),H("idle"),Ae(!0)}catch(q){if(Yi(q)){H("idle");return}let we=mc(q,"Failed to approve token.");Q(we),H("error"),x?.({message:we})}}},[ae,a,x,Je,ee,re]),An=M.useCallback(()=>{re!=="submitting"&&($e(null),Ae(!1),He(null),H("idle"))},[re]),Qn=M.useCallback(async()=>{if(re==="submitting")return;let q=Je??A();if(!q){Ae(!1),Q("Bridge input is no longer available. Please try again."),H("error");return}Ae(!1),await ee(q,{skipApprovalCheck:!0})},[A,Je,ee,re]),Ho=M.useCallback(()=>{xt(!1)},[]),fn=M.useCallback(q=>{v(q),q==="history"&&Pt(!1)},[]),jo=M.useCallback(()=>{if(g==="history"){fn("form");return}h?.()},[h,fn,g]),ni=M.useMemo(()=>[...s,...ve.filter(q=>!s.some(we=>we.txHash===q.txHash))],[s,ve]);return{step:g,setStep:fn,status:re,error:D,quoteError:B,fromToken:p,toToken:k,tokens:t,availableToTokens:Ve,fromAmount:_,toAmount:I,lastChangedBy:F,slippage:L,effectiveSlippage:K,slippageLocked:ne,setSlippage:Y,summary:N,history:ni,submitted:X,canSubmit:w.canSubmit,termsOpen:be,approvalInfo:ae,approvalSuccessOpen:Xe,approveBridge:a,pendingSubmitInput:Je,submitToast:_t,successDialogOpen:ft,dismissSuccessDialog:Ho,hasNewHistory:yt,termsUrl:c,setFromToken:R,setToToken:C,selectFromToken:Ht,selectToToken:Zt,setAmount:at,setMax:Xt,swapTokens:pn,submit:Ce,confirmTerms:Ct,cancelTerms:Rt,confirmApproval:Jt,cancelApproval:An,continueAfterApproval:Qn,back:jo}}te(`.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}
|
|
11
|
-
`);import{Fragment as Zi,jsx as m,jsxs as E}from"react/jsx-runtime";var kc=U.createContext(void 0);function go(){return U.useContext(kc)}function wm(e){let[t,n]=U.useState(void 0);return U.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 bc=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],xm=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function ym(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function wc(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 vm(e){return`${e.chainId}:${e.address.toLowerCase()}`}function Sc(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function xc(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 km(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 Sm(e,t){if(!t)return!1;let n=new an(e||"0"),o=new an(t.balance||"0");return!n.isFinite()||!o.isFinite()?!1:n.isGreaterThan(o)}function Cm(e){if(e.priceUsd===void 0)return null;let t=new an(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function Rm(e){if(e.priceUsd===void 0)return null;let t=new an(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function Cc(e){if(!e.isFinite()||e.isNaN())return"0";let n=e.decimalPlaces(6,an.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[o="0",r]=n.split("."),i=new an(o||"0").toFormat(0);return r?`${i}.${r}`:i}function Tm(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function Nm(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 Em(e){let t=new an(e||"0");return!t.isFinite()||t.isNaN()?e||"0":Cc(t)}function Im(e,t){if(t?.priceUsd===void 0)return null;let n=new an(e||"0").multipliedBy(t.priceUsd);return!n.isFinite()||n.isNaN()?null:`$${n.toFormat(2)}`}function Gr(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function _m(e,t){return t==="all"?!0:Gr(e)===t}function Pm(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function yc(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function Rc(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Tc(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":Rc(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function Nc(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Ur(e){return!e||e==="0"||Number(e)===0}function Lm(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 Am(e){let t=e.fromToken,n=e.toToken,o=Tc(t,n),r=e.fromAmount||"0",i=e.toAmount||"0",a=o!==void 0&&!Nc(o),s=o!==void 0&&o!=="bridge";return{pathType:o,bridgeInfo:a?[{label:"Route",value:t&&n?`${yc(t.chainId)} \u2192 ${yc(n.chainId)}`:"-"},{label:"Validator Fee",value:Ur(r)?"0":"Free",tone:Ur(r)?"default":"accent"},{label:"Network Fee",value:Ur(r)?"0":"Free",tone:Ur(r)?"default":"accent"}]:void 0,swapInfo:s?[t&&n?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:n.symbol,iconUrl:n.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:r,valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Swap Fee",value:"0",valueToken:t?{symbol:t.symbol,iconUrl:t.iconUrl}:void 0},{label:"Out Amount",value:i,valueToken:n?{symbol:n.symbol,iconUrl:n.iconUrl}:void 0}]:void 0,txFee:[{label:"Priority Fee Per Gas",value:"0 Gwei"},{label:"Max Fee Per Gas",value:"0 Gwei"},{label:"Gas Limit",value:"0"}],txFeeInfo:{estTxFee:"0",isDelegateFee:!1}}}function Oo({token:e,size:t=20}){let n=e?.iconUrl;return m("span",{className:"bf-token-icon","data-has-image":!!n?"true":"false",style:{width:t,height:t},children:n?m("img",{src:n,alt:"",width:t,height:t,draggable:!1}):m("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function vc({label:e,token:t,amount:n,usd:o,onAmountChange:r,onTokenClick:i,locked:a=!1}){return E("section",{className:"bf-amount-panel",children:[E("div",{className:"bf-amount-head",children:[m("span",{children:e}),E("span",{className:"bf-balance",children:[Sc(t?.balance??"0")," ",t?.symbol??""]})]}),E("div",{className:"bf-amount-main",children:[E("label",{className:"bf-amount-input-wrap",children:[E("span",{className:"bf-sr-only",children:[e," amount"]}),m("input",{type:"text",inputMode:"decimal",value:n,onChange:s=>r(s.target.value),placeholder:"0",className:"bf-amount-input"}),m("span",{className:"bf-amount-usd",children:o})]}),E("button",{type:"button",className:"bf-token-pill",onClick:a?void 0:i,disabled:!a&&!i,"data-locked":a?"true":void 0,"data-track":a?void 0:"token_select_open","data-track-id":e.toLowerCase(),"aria-label":`Select ${e.toLowerCase()} token`,children:[m(Oo,{token:t}),m("span",{children:t?.symbol??"Select"}),!a&&m(Un,{size:16})]})]})]})}function Fm({flow:e,side:t,onClose:n}){let o=U.useId(),[r,i]=U.useState(""),[a,s]=U.useState(null),l=go(),c=t==="from"?e.fromToken:e.toToken;U.useEffect(()=>{s(document.body)},[]),U.useEffect(()=>{let d=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[n]);let u=U.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),f=U.useMemo(()=>{let d=r.trim().toLowerCase();return d?u.filter(x=>x.symbol.toLowerCase().includes(d)||x.name.toLowerCase().includes(d)):u},[r,u]),b=U.useCallback(d=>{t==="from"?e.selectFromToken(d):e.selectToToken(d),n()},[e,n,t]);return a?mo(m("div",{className:"bf-token-picker-overlay","data-theme":l,role:"presentation",onMouseDown:d=>{d.target===d.currentTarget&&n()},children:E("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":o,children:[m("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),E("header",{className:"bf-token-picker-head",children:[m("h3",{id:o,children:"Select a token"}),m("button",{type:"button",className:"bf-token-picker-close",onClick:n,"aria-label":"Close token selector",children:m(At,{size:24})})]}),E("label",{className:"bf-token-search",children:[m(tc,{size:20}),m("span",{className:"bf-sr-only",children:"Search tokens"}),m("input",{value:r,onChange:d=>i(d.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),E("div",{className:"bf-token-list",children:[f.map(d=>{let x=Rc(d,c),h=x?Rm(d):Cm(d);return E("button",{type:"button",className:"bf-token-row","data-selected":x?"true":"false",onClick:()=>b(d),children:[E("span",{className:"bf-token-row-left",children:[m(Oo,{token:d,size:40}),E("span",{className:"bf-token-meta",children:[m("span",{className:"bf-token-symbol",children:d.symbol}),!x&&m("span",{className:"bf-token-name",children:d.name})]})]}),E("span",{className:"bf-token-row-right",children:[E("span",{className:"bf-token-balance",children:[Sc(d.balance),x?null:` ${d.symbol}`]}),h&&m("span",{className:"bf-token-price",children:h})]})]},vm(d))}),f.length===0&&m("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a):null}function Bm({flow:e,onClose:t}){let n=U.useId(),[o,r]=U.useState(null),i=bc.find(h=>h.value===e.slippage),[a,s]=U.useState(e.slippage&&!i?e.slippage:""),l=a.trim()!==""&&a.trim()!==".",c=l?Number(a):NaN,u=Number.isFinite(c)&&c>50,f=Number.isFinite(c)&&c>5&&!u,b=h=>{e.setSlippage(h),t()},d=()=>{!l||u||(e.setSlippage(wc(a)),t())};if(U.useEffect(()=>{r(document.body)},[]),U.useEffect(()=>{let h=w=>{w.key==="Escape"&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[t]),!o)return null;let x=go();return mo(m("div",{className:"bf-slippage-overlay","data-theme":x,role:"presentation",onMouseDown:h=>{h.target===h.currentTarget&&t()},children:E("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[E("header",{className:"bf-slippage-head",children:[m("h3",{id:n,children:"Slippage Settings"}),m("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:m(At,{size:24})})]}),E("div",{className:"bf-slippage-body",children:[m("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."}),E("div",{className:"bf-slippage-controls",children:[m("div",{className:"bf-slippage-presets",children:bc.map(h=>m("button",{type:"button",className:"bf-slippage-preset","data-selected":!l&&e.slippage===h.value?"true":"false",onClick:()=>b(h.value),children:h.label},h.value))}),E("label",{className:"bf-slippage-custom","data-selected":l?"true":"false",children:[m("span",{className:"bf-sr-only",children:"Custom slippage percent"}),m("input",{value:a,onChange:h=>{s(wc(h.target.value))},onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),d())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),m("span",{"aria-hidden":"true",children:"%"})]})]}),u?m("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):f?m("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,l&&m("button",{type:"button",className:"bf-slippage-apply",onClick:d,disabled:u,children:"Apply"})]})]})}),o)}function Mm({flow:e}){let t=U.useId(),[n,o]=U.useState(!1),[r,i]=U.useState(null),a=go();return U.useEffect(()=>{i(document.body)},[]),U.useEffect(()=>{let s=l=>{l.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!r||!e.termsOpen?null:mo(m("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:s=>{s.target===s.currentTarget&&e.cancelTerms()},children:E("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[m("h3",{id:t,children:"Agree to Terms of Service"}),m("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),E("div",{className:"bf-terms-check-row","data-checked":n?"true":"false",children:[m("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":n,"aria-label":"Agree to Terms of Use","data-track":"terms_check",onClick:()=>o(s=>!s),children:m("span",{className:"bf-terms-checkbox","data-checked":n?"true":"false","aria-hidden":"true"})}),E("div",{className:"bf-terms-copy",children:[m("span",{className:"bf-terms-label",children:"Agree to Terms of Use"}),e.termsUrl&&m("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),m("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),m("button",{type:"button",className:"bf-action-primary",disabled:!n||e.status==="submitting",onClick:e.confirmTerms,"data-track":"terms_confirm",children:"Confirm"})]})}),r)}function Dm({value:e,disabled:t=!1}){let[n,o]=U.useState(!1);return m("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 Om({flow:e,approval:t}){let n=U.useId(),[o,r]=U.useState(null),i=go();if(U.useEffect(()=>{r(document.body)},[]),U.useEffect(()=>{let l=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!o)return null;let a=e.status==="submitting"||!e.approveBridge,s=e.status==="submitting";return mo(m("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",children:E("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[E("h3",{id:n,children:["Approve ",t.token.symbol]}),m(Oo,{token:t.token,size:72}),E("div",{className:"bf-approve-address-box",children:[m("span",{children:"Token Address"}),E("div",{children:[m("strong",{children:t.tokenAddress}),m(Dm,{value:t.tokenAddress,disabled:s})]})]}),E("div",{className:"bf-action-buttons",children:[m("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),E("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":s,"data-track":"approve_confirm",children:[s&&m("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),m("span",{children:s?"Approving...":"Approve"})]})]})]})}),o)}function Wm({flow:e}){let t=U.useId(),[n,o]=U.useState(null),r=go();if(U.useEffect(()=>{o(document.body)},[]),U.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=s=>{s.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.approvalSuccessOpen)return null;let i=e.status==="submitting";return mo(m("div",{className:"bf-action-modal-overlay","data-theme":r,role:"presentation",children:E("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[m("h3",{id:t,children:"Approval Success"}),m("span",{className:"bf-success-mark","aria-hidden":"true"}),E("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",m("br",{}),"Please continue to the next step."]}),E("div",{className:"bf-action-buttons",children:[m("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:i,children:"Cancel"}),E("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:i,"aria-busy":i,children:[i&&m("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),m("span",{children:i?"Continuing...":"Continue"})]})]})]})}),n)}function Um({fromAmount:e,toAmount:t,fromToken:n,toToken:o}){let[r,i]=U.useState(!1),a=U.useMemo(()=>{let c=new an(e||"0"),u=new an(t||"0");return!c.isFinite()||!u.isFinite()||c.lte(0)||u.lte(0)?null:r?c.dividedBy(u):u.dividedBy(c)},[e,r,t]);if(!a||!n||!o||n.symbol===o.symbol)return null;let s=r?o.symbol:n.symbol,l=r?n.symbol:o.symbol;return E("button",{type:"button",className:"bf-exchange-rate",onClick:()=>i(c=>!c),"data-track":"rate_reverse",children:[E("span",{children:["1 ",s]}),m(ac,{size:12}),E("span",{children:[Cc(a)," ",l]})]})}function Gm({flow:e}){return e.submitToast?E("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[m("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:m("span",{className:"bf-status-spinner"})}),E("span",{className:"bf-status-toast-copy",children:[m("strong",{children:"Transaction Processing"}),m("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function zm({message:e}){let[t,n]=U.useState(!1);return U.useEffect(()=>{if(!e){n(!1);return}n(!0);let o=window.setTimeout(()=>{n(!1)},3500);return()=>window.clearTimeout(o)},[e]),!e||!t?null:E("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[m("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:m("span",{className:"bf-status-error-mark",children:"!"})}),E("span",{className:"bf-status-toast-copy",children:[m("strong",{children:"Error"}),m("span",{children:e})]})]})}function $m(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 Hm({flow:e}){let t=U.useId(),[n,o]=U.useState(null),r=e.submitted,i=go();return U.useEffect(()=>{o(document.body)},[]),U.useEffect(()=>{if(!e.successDialogOpen)return;let a=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!n||!e.successDialogOpen||!r?null:mo(m("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:m("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:E("div",{className:"bf-success-body",children:[m("span",{className:"bf-success-mark","aria-hidden":"true"}),E("div",{className:"bf-success-copy",children:[m("strong",{id:t,children:$m(r.pathType)}),m("span",{children:"Please check the results in the history."})]}),m("div",{className:"bf-success-route","aria-hidden":"true",children:(r.routeTokens&&r.routeTokens.length>0?r.routeTokens:[{symbol:r.fromToken.symbol,iconUrl:r.fromToken.iconUrl},{symbol:r.toToken.symbol,iconUrl:r.toToken.iconUrl}]).map((a,s)=>E(U.Fragment,{children:[s>0&&m("span",{className:"bf-success-route-arrow",children:"\u2192"}),m(Qi,{token:a,size:43})]},`${a.symbol}-${s}`))}),m("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,"data-track":"success_ok",children:"OK"})]})})}),n)}function Qi({token:e,size:t=16}){let n=!!e.iconUrl;return m("span",{className:"bf-token-icon","data-has-image":n?"true":"false",style:{width:t,height:t},children:e.iconUrl?m("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):m("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function jm({row:e}){return e.routeTokens&&e.routeTokens.length>0?m("span",{className:"bf-info-route",children:e.routeTokens.map((t,n)=>E(U.Fragment,{children:[n>0&&m("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),m(Qi,{token:t})]},`${t.symbol}-${n}`))}):e.valueToken?E("span",{className:"bf-info-value-token",children:[m(Qi,{token:e.valueToken}),m("span",{children:e.value})]}):m(Zi,{children:e.value})}function Ec({rows:e}){return!e||e.length===0?null:m("div",{className:"bf-info-rows",children:e.map((t,n)=>E("div",{className:"bf-info-row",children:[E("span",{className:"bf-info-label",children:[m("span",{className:"bf-tree-marker",children:n===e.length-1?"\u2514":"\u251C"}),m("span",{children:t.label})]}),m("span",{className:"bf-info-value","data-tone":t.tone??"default",children:m(jm,{row:t})})]},`${t.label}-${t.value}`))})}function Vm(e,t,n){return e.pathType==="bridge"?"Bridge Info":Nc(e.pathType)?"Swap Info":t&&n?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function qm({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=t&&n,r=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return m(Zi,{children:r.map(i=>{let a=i==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?E("div",{className:"bf-info-section",children:[o&&m("h4",{children:i==="swap"?"Swap Info":"Bridge Info"}),m(Ec,{rows:a})]},i):null})})}function Km({summary:e}){let t=!!e.bridgeInfo?.length,n=!!e.swapInfo?.length,o=!!e.txFee?.length,r=Vm(e,t,n),[i,a]=U.useState(!0),[s,l]=U.useState(!0);return E("div",{className:"bf-details",children:[e.liquidity&&E("section",{className:"bf-liquidity",children:[E("div",{className:"bf-liquidity-head",children:[m("span",{children:e.liquidity.label??"Available Liquidity"}),m("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),m("div",{className:"bf-liquidity-track",children:m("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||n)&&E("section",{className:"bf-detail-section bf-info-card","data-open":i?"true":"false",children:[E("button",{type:"button",className:"bf-collapse-head","aria-expanded":i,onClick:()=>a(c=>!c),"data-track":"details_toggle",children:[m("h3",{children:r}),m(Un,{size:16,className:"bf-collapse-chevron"})]}),i&&m("div",{className:"bf-collapse-body",children:m(qm,{summary:e})})]}),o&&E("section",{className:"bf-detail-section bf-tx-fee-section","data-open":s?"true":"false",children:[E("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":s,onClick:()=>l(c=>!c),"data-track":"details_toggle",children:[m("h3",{children:"Est. Tx Fee"}),E("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&m("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&m("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),m("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:km(e.txFeeInfo?.estTxFee??"0")}),m(Un,{size:16,className:"bf-collapse-chevron"})]})]}),s&&m("div",{className:"bf-collapse-body",children:m(Ec,{rows:e.txFee})})]})]})}function Ym({item:e}){let t=Gr(e),n=Im(e.fromAmount,e.fromToken);return E("article",{className:"bf-history-item",children:[E("div",{className:"bf-history-item-head",children:[m("span",{className:"bf-history-status","data-status":t,children:Pm(t)}),m("time",{className:"bf-history-time",dateTime:e.timestamp,children:Nm(e.timestamp)})]}),E("div",{className:"bf-history-item-body",children:[E("strong",{className:"bf-history-amount",children:[Em(e.fromAmount)," ",e.fromToken.symbol]}),E("div",{className:"bf-history-meta",children:[m("span",{className:"bf-history-usd",children:n??Tm(e.txHash)}),E("span",{className:"bf-history-route",children:[E("span",{className:"bf-history-route-token",children:[m(Oo,{token:e.fromToken,size:16}),m("span",{children:e.fromToken.symbol})]}),m(ic,{size:16,className:"bf-history-route-arrow"}),E("span",{className:"bf-history-route-token",children:[m(Oo,{token:e.toToken,size:16}),m("span",{children:e.toToken.symbol})]})]})]})]})]})}function Qm({flow:e}){let[t,n]=U.useState("all"),o=e.history.some(a=>Gr(a)==="pending"),r=e.history.filter(a=>_m(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return E("main",{className:"bf-history-body",children:[m("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:xm.map(a=>E("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>n(a.value),"data-track":"history_filter","data-track-id":a.value,children:[m("span",{children:a.label}),a.value==="pending"&&o&&m("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),r.length>0?m("div",{className:"bf-history-list",children:r.map(a=>m(Ym,{item:a},a.id||a.txHash))}):m("div",{className:"bf-empty",children:i})]})}function Zm({flow:e,env:t}){let[n,o]=U.useState(null),[r,i]=U.useState(!1),[a,s]=U.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??Am(e):null,u=Dn("apps.json",t,p=>Bn(p?.bridgePoweredBy?.url,t)),f=Lm(e.quoteError),b=Sm(e.fromAmount,e.fromToken),d=b?"Insufficient balance":f.from,x=e.quoteError&&!f.from&&!f.to?e.quoteError:"",h=e.error||x,w=e.history.some(p=>Gr(p)==="pending"),v=(c?.pathType??Tc(e.fromToken,e.toToken))!=="bridge";return E(Zi,{children:[E("main",{className:"bf-body",children:[E("div",{className:"bf-toolbar",children:[E("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),"data-track":"history_open",children:[m(nc,{}),m("span",{children:"History"}),(w||e.hasNewHistory)&&m("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),v&&E("button",{type:"button",className:"bf-chip",onClick:()=>i(!0),"data-track":"slippage_open",disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":r,children:[m(oc,{}),m("span",{children:e.slippageLocked?"Auto 1%":ym(e.slippage,e.effectiveSlippage)})]})]}),E("div",{className:"bf-swap-card","data-has-from-error":d?"true":"false",children:[m(vc,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:xc(e.fromAmount,e.fromToken),onAmountChange:p=>e.setAmount(p,"from"),onTokenClick:()=>o("from")}),d&&m("div",{className:"bf-field-error",children:d}),m("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),s(p=>p+360)},"data-track":"token_swap",style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:m(rc,{size:22})}),m(vc,{label:"To",token:e.toToken,amount:e.toAmount,usd:xc(e.toAmount,e.toToken),onAmountChange:p=>e.setAmount(p,"to"),onTokenClick:()=>o("to"),locked:e.availableToTokens.length<=1}),f.to&&m("div",{className:"bf-field-error",children:f.to})]}),m(Um,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&m(Km,{summary:c})]}),E("footer",{className:"bf-footer",children:[m("button",{type:"button",className:"bf-next",onClick:e.submit,"data-track":"next",disabled:e.status==="submitting"||!!e.quoteError||b,children:e.status==="submitting"?"Processing...":"Next"}),u&&E("a",{className:"bf-powered",href:u,target:"_blank",rel:"noreferrer",children:["Powered by ",m("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),n&&m(Fm,{flow:e,side:n,onClose:()=>o(null)}),r&&m(Bm,{flow:e,onClose:()=>i(!1)}),m(Mm,{flow:e}),e.approvalInfo&&m(Om,{flow:e,approval:e.approvalInfo}),m(Wm,{flow:e}),m(Gm,{flow:e}),m(zm,{message:e.submitToast?"":h}),m(Hm,{flow:e})]})}function zr({onClose:e,onBackToWallet:t,env:n,className:o,...r}){let i=U.useMemo(()=>Me(n),[n]),a=hc({...r,onExit:t}),s=U.useRef(null),l=wm(s),c=a.step==="history"?"History":"Swap & Bridge";return m(xe,{feature:"bridge",children:m(kc.Provider,{value:l,children:E("div",{ref:s,className:ue("bf-root",o),"data-view":a.step,"data-status":a.status,children:[E("header",{className:"bf-header",children:[m("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:m(gn,{size:24})}),m("span",{className:"bf-header-title",children:c}),m("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:m(At,{size:24})})]}),a.step==="history"?m(Qm,{flow:a}):m(Zm,{flow:a,env:i})]})})})}import*as ot from"react";import Ac from"bignumber.js";import{useInfiniteQuery as Xm}from"@tanstack/react-query";var Jm="token-history";function Ic(e,t,n,o,r=!0){return Xm({queryKey:[Jm,e,t,n.toLowerCase(),o.toLowerCase()],initialPageParam:void 0,queryFn:async({pageParam:i,signal:a})=>{let s=await se("walletServer",e),l=new URLSearchParams({chain_id:String(t),token:n,wallet:o}),c=i;c&&(l.set("last_timestamp",String(c.last_timestamp)),l.set("last_log_index",String(c.last_log_index)),l.set("last_tx_index",String(c.last_tx_index)));let u=await fetch(`${s}/v1/public/token/historical?${l}`,{cache:"no-store",signal:a});if(!u.ok)throw new Error(`Failed to fetch token history: ${u.status}`);let f=await u.json();if(f.code!==200)throw new Error(`Token history API error: ${f.code}`);return f.data??[]},getNextPageParam:i=>{if(!i||i.length===0)return;let a=i[i.length-1];return{last_timestamp:a.timestamp,last_log_index:a.log_index,last_tx_index:a.tx_index}},enabled:r&&!!o&&!!n&&t>0,staleTime:1e4})}import*as $r from"react";var Xi={chart:!1,balance:!0,overview:!1,social:!1,history:!0},eg=Object.keys(Xi),tg="apps.json";function _c(e){let[t,n]=$r.useState({visibility:Xi,isLoaded:!1});return $r.useEffect(()=>{let o=!0;return Mn(tg,e).then(r=>{if(!o)return;let i=r?.tokenDetail?.sections,a={...Xi};if(i)for(let s of eg){let l=i[s];typeof l=="boolean"&&(a[s]=l)}n({visibility:a,isLoaded:!0})}),()=>{o=!1}},[e]),t}import*as ut from"react";import{useQuery as ng,keepPreviousData as og}from"@tanstack/react-query";var rg="token-price-history";function Pc(e,t,n,o,r=!0){return ng({queryKey:[rg,e,t,n.toLowerCase(),o],queryFn:async({signal:i})=>{let a=await se("walletServer",e),s=new URLSearchParams({chain_id:String(t),token:n,interval:o}),l=await fetch(`${a}/v1/public/token/price/historical?${s}`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token price history: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Token price history API error: ${c.code}`);return c.data??[]},enabled:r&&!!n&&t>0,staleTime:3e4,placeholderData:og})}import{Fragment as fg,jsx as Qe,jsxs as ho}from"react/jsx-runtime";var ig="var(--ds-system-green-high, #00a869)",ag="var(--wi-error, #e70077)",Kn=150,Hr=3,Ji=18,sg=18,lg=[{key:"10m",label:"10m"},{key:"1h",label:"1H"},{key:"1d",label:"1D"},{key:"7d",label:"1W"},{key:"30d",label:"1M"},{key:"1y",label:"1Y"}],cg=new Set(["7d","30d","1y"]);function dg(){let e=ut.useRef(null),[t,n]=ut.useState(0);return ut.useEffect(()=>{let o=e.current;if(!o)return;let r=new ResizeObserver(i=>{n(i[0]?.contentRect.width??0)});return r.observe(o),n(o.clientWidth),()=>r.disconnect()},[]),[e,t]}function pg(e,t){let n=new Date(e*1e3),o=t?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{hour:"numeric",minute:"2-digit"};return new Intl.DateTimeFormat("en-US",o).format(n)}function ug(e,t){if(t<=0||e.length===0)return null;let n=e.length===1?[e[0],e[0]]:e,o=n.length,r=n[0],i=n[0],a=0,s=0;for(let v=1;v<o;v++)n[v]>r&&(r=n[v],a=v),n[v]<i&&(i=n[v],s=v);let l=r-i||1,c=Math.max(1,t-Hr*2),u=Kn-Ji-sg,f=v=>o===1?t/2:Hr+v/(o-1)*c,b=v=>Ji+(1-(v-i)/l)*u,d=n.map((v,p)=>({x:f(p),y:b(v)})),x=d.map((v,p)=>`${p===0?"M":"L"}${v.x.toFixed(2)},${v.y.toFixed(2)}`).join(" "),h=d[0],w=d[d.length-1],g=`${x} L${w.x.toFixed(2)},${Kn} L${h.x.toFixed(2)},${Kn} Z`;return{values:n,points:d,linePath:x,areaPath:g,maxIdx:a,minIdx:s}}function Lc({env:e,chainId:t,tokenAddress:n}){let[o,r]=ut.useState("1d"),[i,a]=ut.useState(null),s=ut.useId(),[l,c]=dg(),{data:u,isLoading:f,isError:b}=Pc(e,t,n,o,!0),d=ut.useMemo(()=>(u??[]).filter(P=>Number.isFinite(Number(P.price))).slice().sort((P,ne)=>P.updated_at-ne.updated_at),[u]),x=ut.useMemo(()=>d.map(N=>Number(N.price)),[d]),h=ut.useMemo(()=>ug(x,c),[x,c]);ut.useEffect(()=>{a(null)},[o]);let w=d.length>0,g=i!==null&&i<x.length?i:x.length-1,v=w?x[g]:0,p=w?x[0]:0,R=p!==0?(v-p)/p*100:0,k=R>=0,C=k?ig:ag,_=(k?"+":"-")+(Math.floor(Math.abs(R)*100)/100).toFixed(2)+"%",T=i!==null&&d[i]?pg(d[i].updated_at,cg.has(o)):"",I=N=>{if(!h||c<=0)return;let P=N.currentTarget.getBoundingClientRect(),ne=N.clientX-P.left;if(h.values.length<=1){a(0);return}let B=Math.max(1,c-Hr*2),ce=Math.min(1,Math.max(0,(ne-Hr)/B)),re=Math.round(ce*(d.length-1));a(Math.min(d.length-1,Math.max(0,re)))},G=()=>a(null);if(!f&&(b||!w))return null;let F=i!==null&&h&&h.points[i]?h.points[i]:null,$=h?.points[h.maxIdx],L=h?.points[h.minIdx],Y=N=>Math.min(Math.max(N,24),Math.max(24,c-24));return ho("section",{className:"wi-td-chart",children:[ho("div",{className:"wi-td-chart-panel",children:[Qe("span",{className:"wi-td-chart-price",children:w?zn(v):"\u2014"}),w&&ho("span",{className:"wi-td-chart-change","data-positive":k,children:[Qe("span",{children:_}),T&&Qe("span",{className:"wi-td-chart-when",children:T})]})]}),Qe("div",{ref:l,className:"wi-td-chart-plot",children:f&&!w?Qe("div",{className:"wi-skeleton-block wi-td-chart-skeleton"}):h&&c>0&&ho("svg",{className:"wi-td-chart-svg",width:c,height:Kn,role:"img","aria-label":"Price chart",children:[Qe("defs",{children:ho("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[Qe("stop",{offset:"0%",stopColor:C,stopOpacity:.28}),Qe("stop",{offset:"100%",stopColor:C,stopOpacity:0})]})}),Qe("path",{d:h.areaPath,fill:`url(#${s})`}),Qe("path",{d:h.linePath,fill:"none",stroke:C,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),$&&Qe("text",{className:"wi-td-chart-minmax",x:Y($.x),y:Math.max(11,$.y-7),textAnchor:"middle",children:zn(h.values[h.maxIdx])}),L&&h.minIdx!==h.maxIdx&&Qe("text",{className:"wi-td-chart-minmax",x:Y(L.x),y:Math.min(Kn-5,L.y+14),textAnchor:"middle",children:zn(h.values[h.minIdx])}),F&&ho(fg,{children:[Qe("line",{className:"wi-td-chart-cursor",x1:F.x,y1:Ji-6,x2:F.x,y2:Kn}),Qe("circle",{cx:F.x,cy:F.y,r:4,fill:C,stroke:"var(--wi-surface-bg, #121212)",strokeWidth:2})]}),Qe("rect",{x:0,y:0,width:c,height:Kn,fill:"transparent",style:{touchAction:"none"},onPointerMove:I,onPointerDown:I,onPointerLeave:G,onPointerCancel:G})]})}),Qe("div",{className:"wi-td-chart-tabs",role:"tablist",children:lg.map(N=>Qe("button",{type:"button",role:"tab","aria-selected":o===N.key,className:"wi-td-chart-tab","data-active":o===N.key||void 0,onClick:()=>r(N.key),"data-track":"token_detail_interval","data-track-id":N.key,children:N.label},N.key))})]})}import{Fragment as Mc,jsx as O,jsxs as ye}from"react/jsx-runtime";var mg="https://contents.crosstoken.io/wallet/token/images/FT.png",gg={receive:"Receive",send:"Send","bridge-in":"Bridge In","bridge-out":"Bridge Out"};function hg(e){if(!e)return"";let t=e<1e12?e*1e3:e,n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"just now";let o=Math.floor(n/60);if(o<60)return`${o}m`;let r=Math.floor(o/60);if(r<24)return`about ${r}h`;let i=Math.floor(r/24);if(i<30)return`${i}d`;let a=Math.floor(i/30);return a<12?`${a}mo`:`${Math.floor(a/12)}y`}function Fc(e){let[t,n]=e.split("."),o="";for(let r=0;r<t.length;r++){let i=t.length-r;r>0&&i%3===0&&(o+=","),o+=t[r]}return n?`${o}.${n}`:o}function Bc(e,t){let n=BigInt(e||"0");if(t<=2){let a=10n**BigInt(t),s=n/a,l=n%a*10n**BigInt(2-t);return`${s.toString()}.${l.toString().padStart(2,"0")}`}let o=n/10n**BigInt(t-2),r=o/100n,i=o%100n;return`${r.toString()}.${i.toString().padStart(2,"0")}`}function bg(e,t,n){let o=ot.useRef(null),r=ot.useRef(null),[i,a]=ot.useState(t);return ot.useLayoutEffect(()=>{let s=o.current,l=r.current;if(!s||!l)return;let c=()=>{let f=s.clientWidth;if(!f)return;let b=window.getComputedStyle(l),d=document.createElement("span");d.textContent=l.textContent,d.style.cssText=["position:absolute","left:-9999px","top:-9999px","visibility:hidden","white-space:nowrap",`font-family:${b.fontFamily}`,`font-weight:${b.fontWeight}`,`letter-spacing:${b.letterSpacing}`,`font-size:${t}px`].join(";"),document.body.appendChild(d);let x=d.offsetWidth;if(document.body.removeChild(d),x<=f){a(t);return}let h=Math.max(n,Math.floor(t*f/x));a(h)};c();let u=new ResizeObserver(c);return u.observe(s),()=>u.disconnect()},[e,t,n]),{containerRef:o,textRef:r,fontSize:i}}function wg(e){if(!e)return"-";let t=new Ac(e);return t.isNaN()?"-":t.decimalPlaces(4,Ac.ROUND_DOWN).toFormat()}function xg(){return ye("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[O("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.6"}),O("path",{d:"M3 12h18M12 3c2.5 2.5 3.8 5.8 3.8 9s-1.3 6.5-3.8 9c-2.5-2.5-3.8-5.8-3.8-9S9.5 5.5 12 3Z",stroke:"currentColor",strokeWidth:"1.6"})]})}function yg(){return O("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:O("path",{d:"M21.9 4.3 18.6 20c-.2 1-.9 1.3-1.8.8l-4.9-3.6-2.4 2.3c-.3.3-.5.5-1 .5l.3-4.9 9-8.1c.4-.3-.1-.5-.6-.2L6.2 13.2l-4.8-1.5c-1-.3-1-1 .2-1.5L20.6 3c.9-.3 1.6.2 1.3 1.3Z"})})}function vg(){return O("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:O("path",{d:"M18.9 2H22l-7.3 8.3L23.3 22h-6.8l-5.3-6.9L5.1 22H2l7.8-8.9L1 2h6.9l4.8 6.4L18.9 2Zm-1.2 18h1.9L7.2 4H5.2l12.5 16Z"})})}function kg(){return O("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:O("path",{d:"M6.9 6.5c0-.2-.1-.5-.3-.6L4.6 3.6V3.3h6.3l4.9 10.7 4.3-10.7H26v.3l-1.8 1.7c-.2.1-.2.3-.2.5v12.4c0 .2 0 .4.2.5l1.7 1.7v.3h-8.7v-.3l1.8-1.7c.2-.2.2-.2.2-.5V8.1l-5 12.6h-.7L7.9 8.1v8.5c0 .3.1.6.3.8l2.3 2.8v.3H4v-.3l2.3-2.8c.2-.2.3-.5.3-.8V6.5Z",transform:"scale(0.85)"})})}function Dc({env:e,isMobile:t,token:n,walletAddress:o,stat:r,tokenInfo:i,showBalance:a=!0,onBack:s,onClose:l,onSend:c,onOutlink:u}){let f=n.quantity.decimals,[b,d]=ot.useState(!1),{buildTxUrl:x,chainInfo:h}=ss(e,n.chainId,!0),{visibility:w}=_c(e),{data:g,isLoading:v,isError:p,fetchNextPage:R,hasNextPage:k,isFetchingNextPage:C,refetch:_}=Ic(e,n.chainId,n.address,o,!0),T=ot.useMemo(()=>g?.pages?g.pages.flat():[],[g]),I=ot.useRef(null);ot.useEffect(()=>{if(!t)return;let D=I.current;if(!D||!k)return;let Q=new IntersectionObserver(X=>{X[0]?.isIntersecting&&!C&&R()},{rootMargin:"120px"});return Q.observe(D),()=>Q.disconnect()},[t,k,C,R]);let G=ot.useCallback(()=>{navigator?.clipboard&&navigator.clipboard.writeText(n.address).then(()=>{d(!0),setTimeout(()=>d(!1),1500)}).catch(()=>{})},[n.address]),F=Fc(Bc(n.quantity.numeric,f)),$=r?.price?lr(n.quantity.numeric,f,r.price):null,L=a?F:"\u2022\u2022\u2022\u2022",{containerRef:Y,textRef:N,fontSize:P}=bg(L,30,14),K=So(n.chainId,e).name??h?.name??`Chain ${n.chainId}`,B=h?.explorer_url,ce=i?.deployed??!0,re=ot.useMemo(()=>{let D=[];return i?.info_url&&D.push({key:"web",label:"Website",url:i.info_url,icon:O(xg,{})}),i?.telegram_url&&D.push({key:"tg",label:"Telegram",url:i.telegram_url,icon:O(yg,{})}),i?.x_url&&D.push({key:"x",label:"X",url:i.x_url,icon:O(vg,{})}),i?.medium_url&&D.push({key:"medium",label:"Medium",url:i.medium_url,icon:O(kg,{})}),D},[i]),H=(D,Q,X,me)=>{We(D,Q,{category:"token-detail",origin:X,payload:{address:n.address,txHash:me}},u)};return ye(Mc,{children:[ye("div",{className:"wi-sticky-header",children:[ye("div",{className:"wi-header wi-header--receive",children:[O("button",{type:"button",className:"wi-header-back",onClick:s,"aria-label":"Back",children:O(gn,{size:24})}),ye("span",{className:"wi-td-header-title",children:[O("img",{src:n.icon_url,alt:"","aria-hidden":!0,className:"wi-td-header-icon",width:24,height:24,draggable:!1,onError:D=>{D.currentTarget.src=mg}}),O("span",{className:"wi-td-header-name",children:n.symbol})]}),O("button",{type:"button",className:"wi-header-action",onClick:l,"aria-label":"Close",children:O(At,{size:24})})]}),O("hr",{className:"wi-divider"})]}),ye("div",{className:"wi-td-scroll",children:[w.chart&&O(Lc,{env:e,chainId:n.chainId,tokenAddress:n.address}),w.balance&&ye("section",{className:"wi-td-balance-card",children:[ye("div",{className:"wi-td-balance-left",ref:Y,children:[O("span",{className:"wi-td-balance-label",children:"My Balance"}),O("span",{className:"wi-td-balance-amount",ref:N,style:{fontSize:P},children:L}),a&&$&&O("span",{className:"wi-td-balance-fiat",children:$})]}),O("button",{type:"button",className:"wi-td-send-btn",onClick:()=>c(n),"aria-label":`Send ${n.symbol}`,"data-track":"token_detail_send","data-track-id":n.symbol,children:O("span",{children:"Send"})})]}),w.overview&&ye("section",{className:"wi-td-section",children:[O("h3",{className:"wi-td-section-title",children:"Crypto Overview"}),ye("div",{className:"wi-td-rows",children:[ye("div",{className:"wi-td-row",children:[O("span",{className:"wi-td-row-label",children:"Network"}),B?ye("a",{className:"wi-td-row-value wi-td-row-link",href:B,target:"_blank",rel:"noopener noreferrer",onClick:D=>H(D,B,"token-network"),children:[O("span",{children:K}),O(Sg,{})]}):O("span",{className:"wi-td-row-value",children:K})]}),ye("div",{className:"wi-td-row",children:[O("span",{className:"wi-td-row-label",children:"Contract Address"}),ye("button",{type:"button",className:"wi-td-row-value wi-td-row-copy",onClick:G,"aria-label":"Copy contract address",children:[O("span",{children:tt(n.address)}),b?O(mn,{size:14}):O(Wn,{size:14})]})]}),ye("div",{className:"wi-td-row",children:[O("span",{className:"wi-td-row-label",children:"Decimals"}),O("span",{className:"wi-td-row-value",children:f})]}),ye("div",{className:"wi-td-row",children:[O("span",{className:"wi-td-row-label",children:"Total Supply"}),O("span",{className:"wi-td-row-value",children:wg(r?.circulating_supply)})]})]})]}),w.social&&re.length>0&&ye("section",{className:"wi-td-section",children:[O("h3",{className:"wi-td-section-title",children:"Social Media"}),O("div",{className:"wi-td-social-row",children:re.map(D=>O("a",{className:"wi-td-social-btn",href:D.url,target:"_blank",rel:"noopener noreferrer","aria-label":D.label,onClick:Q=>H(Q,D.url,"token-social"),children:D.icon},D.key))})]}),w.history&&ye("section",{className:"wi-td-section",children:[O("h3",{className:"wi-td-section-title",children:"Token History"}),v&&O("div",{className:"wi-td-history-list",children:Array.from({length:3},(D,Q)=>ye("div",{className:"wi-td-history-skeleton",children:[O("div",{className:"wi-skeleton-block",style:{width:90,height:14}}),O("div",{className:"wi-skeleton-block",style:{width:60,height:14}})]},`td-sk-${Q}`))}),!v&&p&&ye("div",{className:"wi-td-history-empty",children:[O("span",{children:"Failed to load history."}),O("button",{type:"button",className:"wi-td-retry-btn",onClick:()=>_(),children:"Retry"})]}),!v&&!p&&T.length===0&&O("div",{className:"wi-td-history-empty",children:O("span",{children:"No transactions found."})}),!v&&!p&&T.length>0&&ye("div",{className:"wi-td-history-list",children:[T.map((D,Q)=>{let X=D.to_alias?.toLowerCase().includes("bridge")??!1,me=D.from_alias?.toLowerCase().includes("bridge")??!1,ve=X?"bridge-out":me?"bridge-in":D.to?.toLowerCase()===o.toLowerCase()?"receive":"send",J=ve==="receive"||ve==="bridge-in",be=J?D.from:D.to,Le=Fc(Bc(D.amount,f)),Ue=x(D.tx),it=hg(D.timestamp),ae=ye(Mc,{children:[ye("div",{className:"wi-td-history-top",children:[O("span",{className:"wi-td-history-type","data-direction":ve,children:gg[ve]}),O("span",{className:"wi-td-history-counter",children:tt(be??"")})]}),ye("div",{className:"wi-td-history-bottom",children:[ye("span",{className:"wi-td-history-meta",children:[O("span",{className:"wi-td-history-status","data-status":D.status,children:D.status==="success"?"Success":"Failed"}),it&&O("span",{className:"wi-td-history-time",children:it})]}),ye("span",{className:"wi-td-history-amount",children:[J?"+":"-",Le," ",n.symbol]})]})]}),$e=`${D.tx}-${D.log_index}-${Q}`;return Ue?O("a",{className:"wi-td-history-item wi-td-history-item--link",href:Ue,target:"_blank",rel:"noopener noreferrer",onClick:Xe=>H(Xe,Ue,"token-tx",D.tx),children:ae},$e):O("div",{className:"wi-td-history-item",children:ae},$e)}),k&&(t?O("div",{ref:I,className:"wi-td-history-sentinel",children:C&&O("span",{className:"wi-td-history-loading",children:"Loading\u2026"})}):O("button",{type:"button",className:"wi-td-loadmore-btn",onClick:()=>R(),disabled:C,children:C?"Loading\u2026":"Load more"}))]})]})]})]})}function Sg(){return O("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:ue("wi-td-external-icon"),"aria-hidden":!0,children:O("path",{d:"M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}import{Fragment as ta,jsx as y,jsxs as W}from"react/jsx-runtime";var Rg="On-ramp is not available in your region.";function ea(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 Tg(e){return parseInt(e.split(":")[1],10)}function Ng(e){if(typeof window>"u"||!e?.length)return!1;let{origin:t,pathname:n}=window.location,o=t+n;return e.some(r=>o===r||o.startsWith(`${r}/`))}function Eg(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Ig(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 _g(e,t=.5){let n=z.useRef(null),o=z.useRef(null),[r,i]=z.useState(1);return z.useLayoutEffect(()=>{let a=n.current,s=o.current;if(!a||!s)return;let l=()=>{let u=a.clientWidth;if(!u)return;let f=s.cloneNode(!0);f.style.setProperty("--wi-total-scale","1"),f.style.position="absolute",f.style.left="-9999px",f.style.top="-9999px",f.style.visibility="hidden",f.style.maxWidth="none",f.style.width="max-content",a.appendChild(f);let b=f.offsetWidth;a.removeChild(f);let d=b>u?Math.max(t,u/b):1;i(d)};l();let c=new ResizeObserver(l);return c.observe(a),()=>c.disconnect()},[e,t]),{containerRef:n,valueRef:o,scale:r}}function Oc({align:e="end",sideOffset:t=12,className:n,children:o}){let{env:r,theme:i,isMobile:a,open:s,drawerDirection:l,modal:c,showBalance:u,showForgeToken:f,showGameToken:b,showQR:d,showBridge:x,qrLogoSrc:h,walletAddress:w,accountName:g,sendAccounts:v,profileImageUrl:p,preferredTokens:R,close:k,onSelectWallet:C,onCopyAddress:_,onBuy:T,onDisconnect:I,disconnectLabel:G,termsUrl:F,termsLabel:$,privacyUrl:L,privacyLabel:Y,portalStyle:N,navContent:P,navPosition:ne,footerContent:K,view:B,setView:ce,selectedSendToken:re,setSelectedSendToken:H,selectedDetailToken:D,setSelectedDetailToken:Q,showPortfolio:X,portfolioTitle:me,portfolioSections:ve,showTotalAssets:J,totalAssetsLabel:be,sendTransaction:Le,getTransactionReceipt:Ue,estimateGas:it,onOutlink:ae,lpBalanceReader:$e,stakingRewardsReader:Xe,bridgeTokens:Ae,bridgeHistory:Je,getBridgeQuote:He,getBridgeToTokens:_t,getBridgeApproval:cn,approveBridge:ft,submitBridge:xt,onReceive:yt,onSend:Pt,onBuyDisabledMessage:Fe,onBridgeDisabledMessage:$t,onSendDisabledMessage:vt}=kn(),[kt,dn]=z.useState(null),Lt=z.useRef(void 0),ke=z.useCallback(S=>{dn(S),clearTimeout(Lt.current),Lt.current=setTimeout(()=>dn(null),4e3)},[]);z.useEffect(()=>()=>clearTimeout(Lt.current),[]);let je=!!Fe,St=z.useCallback(()=>{if(je){ke(Fe);return}let S=T?.();S&&typeof S.then=="function"&&S.catch(()=>{ke(Fe??Rg)})},[je,Fe,T,ke]),at=!!$t,Ge=!!vt,{tokens:Ht,isLoading:Zt}=Tn(r,w,s&&u),{statsMap:Ve}=Nn(r,u),{aprPercent:Xt}=$s(),{categoryMap:pn,infoMap:un}=js(r,u),A=u&&J,{displayValue:ee,isLowerBound:Ce,isLoading:Ct}=Vs(r,w,s&&A),[Rt,Jt]=z.useState(!1),An=z.useRef(null),[Qn,Ho]=z.useState(0),{holdings:fn,isLoading:jo}=Gs(r,w,s&&u&&f),ni=z.useMemo(()=>fn.map(S=>S.token),[fn]),{imageMap:q}=zs(r,ni,f&&fn.length>0),we=z.useMemo(()=>{let S=[],V=[],pe=[],lt=new Map((R??[]).map((he,et)=>[`${Tg(he.chainId)}:${he.address.toLowerCase()}`,et]));for(let he of Ht){let et=ea(r,he.chainId,he.symbol)!==void 0,jt=`${he.chainId}:${he.address.toLowerCase()}`,Fn=lt.get(jt),ci=new Wo(he.quantity.numeric).shiftedBy(-he.quantity.decimals);if(et)S.push(he);else if(Fn!==void 0)V.push(he);else if(ci.isGreaterThan(0)){if(!b&&pn.get(Po(he.chainId,he.address))==="game")continue;pe.push(he)}}return S.sort((he,et)=>{let jt=ea(r,he.chainId,he.symbol)??99,Fn=ea(r,et.chainId,et.symbol)??99;return jt-Fn}),V.sort((he,et)=>{let jt=lt.get(`${he.chainId}:${he.address.toLowerCase()}`)??99,Fn=lt.get(`${et.chainId}:${et.address.toLowerCase()}`)??99;return jt-Fn}),pe.sort((he,et)=>{let jt=Ve.get(Bt(he.chainId,he.address)),Fn=Ve.get(Bt(et.chainId,et.address)),ci=new Wo(he.quantity.numeric).shiftedBy(-he.quantity.decimals).multipliedBy(jt?.price??0);return new Wo(et.quantity.numeric).shiftedBy(-et.quantity.decimals).multipliedBy(Fn?.price??0).minus(ci).toNumber()}),[...S,...V,...pe]},[Ht,r,Ve,b,pn,R]),Z=z.useMemo(()=>{if(!f)return[];let S=new Set(Ht.map(V=>V.address.toLowerCase()));return[...fn].filter(V=>!S.has(V.token.toLowerCase())).sort((V,pe)=>{let lt=new Wo(V.value);return new Wo(pe.value).minus(lt).toNumber()})},[fn,f,Ht]),Re=z.useRef(!1),[qe,xo]=z.useState(null),Zn=z.useRef(void 0),la=qe?.chainId??re?.chainId??we[0]?.chainId??0,{transactionUrl:oi}=No(r,la,qe?.txHash,!!(qe?.txHash&&la)),st=z.useCallback(S=>{Re.current=!0,ce(S)},[ce]),[md,ri]=z.useState("recipient"),Vo=z.useCallback(()=>{H(null),ri("recipient"),st("wallet")},[H,st]),qo=z.useCallback((S,V="recipient")=>{if(Ge){ke(vt);return}ri(V),H(S),st("send")},[Ge,vt,ke,H,st]),gd=z.useCallback(S=>{Q(S),st("token-detail")},[Q,st]),hd=z.useCallback(()=>{Q(null),st("wallet")},[Q,st]),bd=z.useCallback(S=>{qo(S,"recipient")},[qo]),Ko=Dn("apps.json",r,S=>Bn(S?.gametokenBridge,r)),ca=Dn("apps.json",r,S=>S?.gametokenSites),wd=z.useCallback(()=>{if(at){ke($t);return}if(Ko){if(Ng(ca)){window.location.assign(Ko);return}window.open(Ko,"_blank","noopener,noreferrer")}},[at,$t,Ko,ca,ke]),xd=z.useCallback(S=>{clearTimeout(Zn.current),H(null),st("wallet"),xo({status:"pending",txHash:S.txHash,chainId:S.chainId,description:`${S.amount} ${S.tokenSymbol} to ${tt(S.recipient)}`})},[H,st]),yd=z.useCallback(S=>{let V=re?.chainId;H(null),st("wallet"),!(!S||!V)&&(xo(pe=>({status:"success",txHash:S,chainId:V,description:pe?.txHash===S?pe.description:"Tap to see your transaction"})),clearTimeout(Zn.current),Zn.current=setTimeout(()=>xo(null),5e3))},[re?.chainId,H,st]),vd=z.useCallback(S=>{let V=S.txHash;V&&(xo({status:"error",txHash:V,chainId:S.chainId,description:S.message}),clearTimeout(Zn.current),Zn.current=setTimeout(()=>xo(null),5e3))},[]),yo=z.useMemo(()=>{if(yt)return yt;if(d)return()=>st("qr")},[yt,d,st]),ii=z.useMemo(()=>{if(Pt)return Pt;if(we.length===0)return;let S=we[0];return()=>qo(S,"token")},[Pt,we,qo]),kd=z.useCallback(()=>{if(Ge){ke(vt);return}ii?.()},[Ge,vt,ii,ke]);z.useEffect(()=>{s||(Re.current=!1,ri("recipient"))},[s]);let da=z.useRef(null);z.useEffect(()=>{let S=da.current;if(!S||!a)return;let V=pe=>{pe.pointerType==="touch"&&pe.stopPropagation()};return S.addEventListener("pointerdown",V),()=>S.removeEventListener("pointerdown",V)},[a]);let[Xn,pa]=z.useState(!1),ai=z.useRef(void 0),[vo,ko]=z.useState(!1);z.useEffect(()=>{if(!vo)return;let S=()=>ko(!1),V=lt=>{lt.key==="Escape"&&ko(!1)},pe=setTimeout(()=>{document.addEventListener("mousedown",S,!0),document.addEventListener("keydown",V,!0)},0);return()=>{clearTimeout(pe),document.removeEventListener("mousedown",S,!0),document.removeEventListener("keydown",V,!0)}},[vo]),z.useEffect(()=>{ko(!1)},[w]),z.useEffect(()=>()=>clearTimeout(ai.current),[]),z.useEffect(()=>()=>clearTimeout(Zn.current),[]),z.useEffect(()=>{let S=An.current;if(!S||K===null){Ho(0);return}let V=()=>{Ho(S.offsetHeight)};if(V(),typeof ResizeObserver>"u")return;let pe=new ResizeObserver(V);return pe.observe(S),()=>pe.disconnect()},[K]);let ua=z.useCallback(async()=>{if(!Xn)try{await navigator.clipboard.writeText(w),pa(!0),clearTimeout(ai.current),ai.current=setTimeout(()=>pa(!1),2e3),_?.(w,!0)}catch{_?.(w,!1)}},[w,_,Xn]),Yo=z.useCallback(S=>{S.currentTarget.setAttribute("data-loaded","true")},[]),fa=z.useMemo(()=>({background:Ig(w)}),[w]),Qo=z.useMemo(()=>p||hn(r,w,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[p,r,w,i]),si=z.useMemo(()=>Eg(ee),[ee]),{containerRef:Sd,valueRef:Cd,scale:Rd}=_g(Rt?"\u2022\u2022\u2022\u2022\u2022\u2022":ee),ma=F||L?W("div",{className:"wi-legal-links",children:[F&&y("a",{className:"wi-legal-link",href:F,target:"_blank",rel:"noopener noreferrer","data-track":"terms_link",onClick:S=>We(S,F,{category:"terms",origin:"terms"},ae),children:$}),F&&L&&y("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),L&&y("a",{className:"wi-legal-link",href:L,target:"_blank",rel:"noopener noreferrer","data-track":"privacy_link",onClick:S=>We(S,L,{category:"privacy",origin:"privacy"},ae),children:Y})]}):null,ga=I?W("button",{type:"button",className:"wi-disconnect-btn","data-track":"disconnect",onClick:()=>{I(),k()},children:[y(Ka,{size:16}),y("span",{className:"wi-disconnect-label",children:G})]}):null,Td=u&&!P?W("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[W("button",{type:"button",className:ue("wi-action-card",je&&"wi-action-card--dimmed"),onClick:St,disabled:!T&&!je,"aria-disabled":je||void 0,"aria-label":"Buy","data-track":"buy",children:[y(es,{size:20}),y("span",{children:"Buy"})]}),x?W("button",{type:"button",className:ue("wi-action-card",at&&"wi-action-card--dimmed"),onClick:wd,"aria-disabled":at||void 0,"aria-label":"Bridge","data-track":"bridge_open",children:[y(ts,{size:20}),y("span",{children:"Bridge"})]}):W("button",{type:"button",className:"wi-action-card",onClick:yo,disabled:!yo,"aria-label":"Receive","data-track":"receive",children:[y(sr,{size:20}),y("span",{children:"Receive"})]}),W("button",{type:"button",className:ue("wi-action-card",Ge&&"wi-action-card--dimmed"),onClick:kd,disabled:!Ge&&!ii,"aria-disabled":Ge||void 0,"aria-label":"Send","data-track":"send_open",children:[y(Xa,{size:20}),y("span",{children:"Send"})]}),X?W("button",{type:"button",className:"wi-action-card",onClick:()=>st("portfolio"),"aria-label":"View portfolio","data-track":"portfolio_open",children:[y(Ja,{size:20}),y("span",{children:"Portfolio"})]}):x?W("button",{type:"button",className:"wi-action-card",onClick:yo,disabled:!yo,"aria-label":"Receive","data-track":"receive",children:[y(sr,{size:20}),y("span",{children:"Receive"})]}):null]}):null,Nd=W("div",{className:ue("wi-view-inner",Re.current&&"wi-view-wallet"),children:[A&&W("div",{className:"wi-total-section",children:[W("div",{className:"wi-total-head",children:[y("span",{className:"wi-total-label",children:be}),y("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:S=>{S.stopPropagation(),Jt(V=>!V)},onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),S.stopPropagation(),Jt(V=>!V))},"aria-label":Rt?"Show balance":"Hide balance","data-track":"balance_toggle",children:Rt?y(Qa,{}):y(Ya,{})})]}),y("div",{className:"wi-total-body",ref:Sd,children:Ct?y("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):y("div",{className:"wi-total-value","data-hidden":Rt||void 0,ref:Cd,style:{"--wi-total-scale":Rd},children:Rt?y("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):W(ta,{children:[Ce&&y("span",{className:"wi-total-lte",children:"\u2264"}),y("span",{className:"wi-total-currency",children:"$"}),y("span",{className:"wi-total-amount",children:si.main}),si.decimal&&y("span",{className:"wi-total-decimal",children:si.decimal})]})})})]}),ne==="top"&&(P?y("div",{className:"wi-nav-fixed",children:P}):Td),u&&y("div",{ref:da,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:W("div",{className:"wi-token-list",children:[Zt&&Array.from({length:5},(S,V)=>W("div",{className:"wi-skeleton-item",children:[W("div",{className:"wi-skeleton-left",children:[y("div",{className:"wi-skeleton-block wi-skeleton-icon"}),W("div",{className:"wi-skeleton-lines",children:[y("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),y("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),W("div",{className:"wi-skeleton-right",children:[y("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),y("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},V)),!Zt&&we.length===0&&!f&&y("div",{className:"wi-empty",children:"No Tokens Found"}),we.map(S=>{let V=Ve.get(Bt(S.chainId,S.address)),pe=V?parseFloat(V.percent_change_24h):null,lt=pe!==null&&pe>=0,he=_o(r,S.chainId),et=Ss(S.address);return W("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>gd(S),"aria-label":`View ${S.symbol} detail`,"data-track":"token_detail","data-track-id":S.symbol,children:[W("div",{className:"wi-token-left",children:[W("div",{className:"wi-token-icon-wrap",children:[y("img",{src:S.icon_url,alt:S.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Yo,onError:jt=>{jt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),he&&y("img",{src:he,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:jt=>{jt.currentTarget.style.display="none"}})]}),W("div",{className:"wi-token-info",children:[W("span",{className:"wi-token-name-row",children:[y("span",{className:"wi-token-name",children:S.symbol}),et&&Xt!==null&&y("span",{className:"wi-token-apr",children:`APR ${Xt>=0?"+":"-"}${(Xt>=0?Math.floor:Math.ceil)(Math.abs(Xt)*100)/100}%`})]}),V&&W("div",{className:"wi-token-price-row",children:[y("span",{className:"wi-token-price",children:zn(V.price)}),y("span",{className:"wi-token-change","data-positive":lt,"data-zero":pe===0||void 0,children:pe!==null&&(pe===0?"0%":`${lt?"+":"-"}${(lt?Math.floor:Math.ceil)(Math.abs(pe)*100)/100}%`)})]})]})]}),W("div",{className:"wi-token-right",children:[y("span",{className:"wi-token-balance",children:Sn(S.quantity.numeric,S.quantity.decimals)}),V&&y("span",{className:"wi-token-value",children:lr(S.quantity.numeric,S.quantity.decimals,V.price)})]})]},`${S.address}-${S.chainId}`)}),f&&jo&&Array.from({length:3},(S,V)=>W("div",{className:"wi-skeleton-item",children:[W("div",{className:"wi-skeleton-left",children:[y("div",{className:"wi-skeleton-block wi-skeleton-icon"}),W("div",{className:"wi-skeleton-lines",children:[y("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),y("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),W("div",{className:"wi-skeleton-right",children:[y("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),y("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${V}`)),f&&!jo&&!Zt&&we.length===0&&Z.length===0&&y("div",{className:"wi-empty",children:"No Tokens Found"}),f&&Z.map(S=>{let V=q.get(S.token)||"",pe=_o(r,Ne[r].cross);return W("div",{className:"wi-token-item",children:[W("div",{className:"wi-token-left",children:[W("div",{className:"wi-token-icon-wrap",children:[y("img",{src:V||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:S.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:Yo,onError:lt=>{lt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),pe&&y("img",{src:pe,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:lt=>{lt.currentTarget.style.display="none"}})]}),W("div",{className:"wi-token-info",children:[y("span",{className:"wi-token-name",children:S.token_name}),y("div",{className:"wi-token-price-row",children:W("span",{className:"wi-token-price",children:[Sn(S.current_price,18)," CROSS"]})})]})]}),W("div",{className:"wi-token-right",children:[y("span",{className:"wi-token-balance",children:Sn(S.balance,18)}),y("span",{className:"wi-token-value",children:zn(S.current_value_usd)})]})]},`forge-${S.token}`)})]})}),ne==="bottom"&&P&&y("div",{className:"wi-nav-fixed",children:P}),ga&&y("div",{className:"wi-wallet-disconnect-row",children:ga})]},"wallet"),Ed=X?y("div",{className:ue("wi-view-inner wi-portfolio-body",Re.current&&"wi-view-portfolio"),children:y(fo,{env:r,theme:i,walletAddress:w,showHeader:!1,onOutlink:ae,lpBalanceReader:$e,stakingRewardsReader:Xe,sendTransaction:Le,estimateGas:it,sections:ve})},"portfolio"):null,Id=re?y("div",{className:ue("wi-view-inner wi-send-body",Re.current&&"wi-view-send"),children:y(vr,{env:r,theme:i,walletAddress:w,accountName:g,accounts:v,initialStep:md,token:re,tokens:we,onTokenChange:H,sendTransaction:Le,getTransactionReceipt:Ue,estimateGas:it,getTokenPriceUsd:S=>{let V=Ve.get(Bt(S.chainId,S.address));if(!V?.price)return;let pe=parseFloat(V.price);return Number.isFinite(pe)?pe:void 0},onClose:k,onBackToWallet:Vo,onSubmitted:xd,onSuccess:yd,onFailed:vd,onOutlink:ae})},"send"):null,_d=z.useMemo(()=>Ae||we.map(S=>{let V=Ve.get(Bt(S.chainId,S.address)),pe=V?.price?parseFloat(V.price):void 0;return{name:S.name,symbol:S.symbol,chainId:S.chainId,address:S.address,decimals:S.quantity.decimals,balance:lo(S.quantity.numeric,S.quantity.decimals),iconUrl:S.icon_url,priceUsd:Number.isFinite(pe)?pe:void 0}}),[Ae,Ve,we]),Pd=y("div",{className:ue("wi-view-inner wi-bridge-body",Re.current&&"wi-view-send"),children:y(zr,{env:r,walletAddress:w,tokens:_d,history:Je,termsUrl:F,getQuote:He,getToTokens:_t,getApproval:cn,approveBridge:ft,submitBridge:xt,onClose:k,onBackToWallet:Vo})},"bridge"),Ld=D?y("div",{className:ue("wi-view-inner wi-token-detail-body",Re.current&&"wi-view-send"),children:y(Dc,{env:r,isMobile:a,token:D,walletAddress:w,stat:Ve.get(Bt(D.chainId,D.address)),tokenInfo:un.get(Po(D.chainId,D.address)),showBalance:u,onBack:hd,onClose:k,onSend:bd,onOutlink:ae})},"token-detail"):null,li=!!C&&g?.trim().toLowerCase()!=="my wallet",ha=W(ta,{children:[W("span",{className:"wi-receive-avatar",children:[y("span",{className:"wi-avatar-fallback",style:fa}),Qo&&y("img",{src:Qo,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:Yo,onError:S=>{S.currentTarget.style.display="none"}})]}),y("span",{className:"wi-receive-account-name",children:g??"Account 1"}),li&&y("span",{className:"wi-receive-chevron","data-open":vo,"aria-hidden":"true",children:y(Un,{size:16})})]}),Ad=W("div",{className:ue("wi-view-inner wi-qr-body",Re.current&&"wi-view-qr"),children:[W("div",{className:"wi-receive-section",children:[li?y("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{ko(!0),C?.()},"aria-label":"Switch account",children:ha}):y("div",{className:"wi-receive-account",children:ha}),W("div",{className:"wi-qr-block",children:[W("div",{className:"wi-qr-box",children:[y(Cg,{value:w,size:180,level:"H",marginSize:2,...h&&{imageSettings:{src:h,height:33,width:33,excavate:!0}}}),!h&&y("div",{className:"wi-qr-logo",children:y(Za,{size:33})})]}),y("p",{className:"wi-qr-address",children:w})]}),W("button",{type:"button",className:"wi-qr-copy-btn",onClick:ua,"data-track":"address_copy",children:[y("span",{className:"wi-qr-copy-icon",children:Xn?y(mn,{size:16}):y(Wn,{size:16})}),y("span",{className:"wi-qr-copy-text",children:Xn?"Copied!":"Copy address"})]})]}),ma&&y("div",{className:"wi-receive-footer",children:ma})]},"qr"),Fd=B==="qr"||B==="portfolio"||B==="send"||B==="bridge",ba=K!==null?y("div",{className:"wi-builtin-footer",children:K}):null,wa=W("div",{className:"wi-account-text",children:[li?W("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{ko(!0),C?.()},"aria-label":"Switch account","aria-expanded":vo,children:[y("span",{className:"wi-account-name",children:g??"Account 1"}),y("span",{className:"wi-account-switch","data-open":vo,"aria-hidden":"true",children:y(Un,{size:20})})]}):y("div",{className:"wi-account-row",children:y("span",{className:"wi-account-name",children:g??"Account 1"})}),W("button",{type:"button",className:"wi-address-row-btn",onClick:ua,"aria-label":"Copy address","data-track":"address_copy",children:[y("span",{className:"wi-account-address",children:tt(w)}),y("span",{className:"wi-account-copy","data-copied":Xn,children:Xn?y(mn,{size:12}):y(Wn,{size:12})})]})]}),xa=W(ta,{children:[o,B==="qr"?y("div",{className:"wi-sticky-header",children:W("div",{className:"wi-header wi-header--receive",children:[y("button",{type:"button",className:"wi-header-back",onClick:Vo,"aria-label":"Back",children:y(gn,{size:24})}),y("span",{className:"wi-receive-title",children:"Receive"}),y("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:y(At,{size:24})})]})}):B==="send"||B==="bridge"||B==="token-detail"?null:Fd?W("div",{className:"wi-sticky-header",children:[W("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[y("button",{type:"button",className:"wi-header-back",onClick:Vo,"aria-label":"Back",children:y(gn,{size:24})}),y("div",{className:"wi-account-block wi-account-block--sub-account",children:wa}),y("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:y(At,{size:24})})]}),y("hr",{className:"wi-divider"})]}):W("div",{className:"wi-sticky-header",children:[W("div",{className:"wi-header wi-header--wallet",children:[W("div",{className:"wi-account-block",children:[W("div",{className:"wi-avatar",children:[y("div",{className:"wi-avatar-fallback",style:fa}),Qo&&y("img",{src:Qo,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:Yo,onError:S=>{S.currentTarget.style.display="none"}})]}),wa]}),W("div",{className:"wi-header-actions",children:[d&&x&&y("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:yo,"aria-label":"Show QR code","data-track":"receive",children:y(sr,{size:20})}),y("button",{type:"button",className:"wi-header-action",onClick:k,"aria-label":"Close",children:y(At,{size:24})})]})]}),y("hr",{className:"wi-divider"})]}),W("div",{className:"wi-view-container",children:[B==="wallet"&&Nd,B==="qr"&&Ad,B==="portfolio"&&Ed,B==="send"&&Id,B==="bridge"&&Pd,B==="token-detail"&&Ld]}),B==="wallet"&&kt&&y("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:kt}),B==="wallet"&&qe&&W("a",{className:"wi-send-toast",href:oi??"#",target:"_blank",rel:"noopener noreferrer",onClick:S=>{if(!oi){S.preventDefault();return}We(S,oi,{category:"send",origin:"send-transaction",payload:{chainId:qe.chainId,txHash:qe.txHash}},ae)},children:[y("span",{className:"wi-send-toast-icon","data-status":qe.status,"aria-hidden":!0,children:qe.status==="pending"?y("span",{className:"wi-send-toast-spinner"}):qe.status==="error"?y("span",{className:"wi-send-toast-error-dot"}):y(ns,{size:20})}),W("span",{className:"wi-send-toast-copy",children:[y("span",{className:"wi-send-toast-title",children:qe.status==="pending"?"Sending...":qe.status==="error"?"Send failed":"Send complete"}),y("span",{className:"wi-send-toast-desc",children:qe.status==="pending"||qe.status==="error"?qe.description:"Tap to see your transaction"})]})]}),ba&&B!=="portfolio"&&B!=="send"&&B!=="token-detail"&&y("div",{className:"wi-sticky-footer",children:y("div",{className:"wi-footer",ref:An,children:ba})})]}),ya={...N,...Qn>0?{"--wi-footer-height":`${Qn}px`}:null};return a?y(xe,{feature:"wallet_info",children:W(jr.Portal,{children:[c&&y(jr.Overlay,{className:"wi-drawer-overlay"}),W(jr.Content,{className:ue("wi-drawer-content",n),"data-theme":i,"data-vaul-no-drag":l==="left"||l==="right"?!0:void 0,style:ya,"data-direction":l,"data-no-balance":!u||void 0,"data-has-footer":Qn>0||void 0,"data-view":B,children:[y(jr.Title,{className:"wi-sr-only",children:"My Wallet"}),xa]})]})}):W(xe,{feature:"wallet_info",children:[c&&s&&y("div",{className:"wi-drawer-overlay",onClick:k}),y(Vr.Portal,{children:y(Vr.Content,{align:e,sideOffset:t,className:ue("wi-popover-content",n),"data-theme":i,style:ya,"data-no-balance":!u||void 0,"data-has-footer":Qn>0||void 0,"data-view":B,children:xa})})]})}import*as Wc from"react";function Uc({position:e="top",children:t}){let{setNavContent:n,setNavPosition:o}=kn();return Wc.useEffect(()=>(n(t),o(e),()=>n(null)),[t,e,n,o]),null}import*as Gc from"react";function zc({children:e}){let{setFooterContent:t}=kn();return Gc.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}te(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-system-orange-default, #f0640d);--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-system-orange-default, #f0640d);--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)}
|
|
12
|
-
`);
|
|
13
|
-
`);
|
|
14
|
-
`);te(`.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:min(680px,calc(100dvh - 32px));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(680px + 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:calc(36px * var(--wi-total-scale, 1));color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:calc(22px * var(--wi-total-scale, 1));color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:calc(32px * var(--wi-total-scale, 1));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-apr{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-system-orange-default, #f0640d)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(255,159,33,.22);border-top-color:var(--ds-system-orange-on-inverted, #ff9f21);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-system-orange-on-inverted, #ff9f21)}.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}
|
|
15
|
-
`);
|
|
16
|
-
`);
|
|
17
|
-
`);import{jsx as na}from"react/jsx-runtime";function Lg({env:e,theme:t="dark",mobileBreakpoint:n=768,drawerDirection:o,modal:r,showBalance:i=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:l=!0,showBridge:c=!0,qrLogoSrc:u,walletAddress:f,accountName:b,sendAccounts:d,profileImageUrl:x,connectorId:h,connectorName:w,connectorIconUrl:g,preferredTokens:v=[],onSelectWallet:p,onCopyAddress:R,onBuy:k,onBuyDisabledMessage:C,onBridgeDisabledMessage:_,onSendDisabledMessage:T,onDisconnect:I,disconnectLabel:G="Disconnect",termsUrl:F=ao,termsLabel:$="Terms of Service",privacyUrl:L=cr,privacyLabel:Y="Privacy Policy",open:N,onOpenChange:P,showPortfolio:ne=!1,portfolioTitle:K="My Portfolio",portfolioSections:B,showTotalAssets:ce=!0,totalAssetsLabel:re="Total Assets USD",sendTransaction:H,getTransactionReceipt:D,estimateGas:Q,onOutlink:X,lpBalanceReader:me,stakingRewardsReader:ve,bridgeTokens:J,bridgeHistory:be,getBridgeQuote:Le,getBridgeToTokens:Ue,getBridgeApproval:it,approveBridge:ae,submitBridge:$e,onReceive:Xe,onBridge:Ae,onSend:Je,style:He,children:_t}){let cn=Me(e),ft=h?ar[h]:void 0,xt=w??ft?.name,yt=g??ft?.iconUrl,Pt=to(`(max-width: ${n}px)`),Fe=o??(i?"right":"bottom"),$t=Fe==="left"||Fe==="right",vt=r??!1,kt=N!==void 0,[dn,Lt]=Ze.useState(!1),ke=kt?N:dn,je=Ze.useCallback(An=>{kt||Lt(An),P?.(An)},[kt,P]),St=Ze.useCallback(()=>je(!1),[je]),[at,Ge]=Ze.useState(null),[Ht,Zt]=Ze.useState("top"),[Ve,Xt]=Ze.useState(null),[pn,un]=Ze.useState("wallet"),[A,ee]=Ze.useState(null),[Ce,Ct]=Ze.useState(null);Ze.useEffect(()=>{ke||(un("wallet"),ee(null),Ct(null))},[ke]),Ze.useEffect(()=>{eo(f)},[f]);let Rt=Ze.useCallback(()=>{Si(f),I?.()},[I,f]),Jt=Ze.useMemo(()=>({env:cn,theme:t,isMobile:Pt,open:ke,drawerDirection:Fe,modal:vt,showBalance:i,showForgeToken:a,showGameToken:s,showQR:l,showBridge:c,qrLogoSrc:u,walletAddress:f,accountName:b,sendAccounts:d,profileImageUrl:x,connectorName:xt,connectorIconUrl:yt,preferredTokens:v,close:St,onSelectWallet:p,onCopyAddress:R,onBuy:k,onBuyDisabledMessage:C,onBridgeDisabledMessage:_,onSendDisabledMessage:T,onDisconnect:I?Rt:void 0,disconnectLabel:G,termsUrl:F,termsLabel:$,privacyUrl:L,privacyLabel:Y,portalStyle:He,navContent:at,navPosition:Ht,setNavContent:Ge,setNavPosition:Zt,footerContent:Ve,setFooterContent:Xt,view:pn,setView:un,selectedSendToken:A,setSelectedSendToken:ee,selectedDetailToken:Ce,setSelectedDetailToken:Ct,showPortfolio:ne,portfolioTitle:K,portfolioSections:B,showTotalAssets:ce,totalAssetsLabel:re,sendTransaction:H,getTransactionReceipt:D,estimateGas:Q,onOutlink:X,lpBalanceReader:me,stakingRewardsReader:ve,bridgeTokens:J,bridgeHistory:be,getBridgeQuote:Le,getBridgeToTokens:Ue,getBridgeApproval:it,approveBridge:ae,submitBridge:$e,onReceive:Xe,onBridge:Ae,onSend:Je}),[cn,t,Pt,ke,Fe,vt,i,a,s,l,c,u,f,b,d,x,xt,yt,v,St,p,R,k,C,_,T,I,Rt,G,F,$,L,Y,He,at,Ht,Ve,pn,A,Ce,ne,K,B,ce,re,H,D,Q,X,me,ve,J,be,Le,Ue,it,ae,$e,Xe,Ae,Je]);return na(wi.Provider,{value:Jt,children:Pt?na(Pg.Root,{direction:Fe,open:ke,onOpenChange:je,handleOnly:$t,noBodyStyles:!0,repositionInputs:!1,children:_t},"drawer"):na($c.Root,{open:ke,onOpenChange:je,children:_t},"popover")})}var bo=Object.assign(Lg,{Trigger:Us,Content:Oc,Nav:Uc,Footer:zc});import*as ln from"react";import*as ad from"@radix-ui/react-dialog";import{Drawer as Hg}from"vaul";import{createContext as Ag,useContext as Fg}from"react";var qr=Ag(null);function Uo(){let e=Fg(qr);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as Hc,useEffect as Bg,useCallback as Mg}from"react";function Kr(){let[e,t]=Hc([]),[n,o]=Hc(!0);Bg(()=>{if(typeof window>"u"){o(!1);return}let i=[],a=l=>{let{info:c}=l.detail;c?.rdns&&!i.some(u=>u.rdns===c.rdns)&&(i.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>o(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let r=Mg(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:r,isLoading:n}}import*as jc from"@radix-ui/react-dialog";import{Drawer as Dg}from"vaul";import{jsx as oa}from"react/jsx-runtime";function Vc({asChild:e,children:t}){let{isMobile:n}=Uo(),o=n?Dg.Trigger:jc.Trigger;return oa(xe,{feature:"wallet_connect",children:oa(o,{asChild:e??t!=null,children:t??oa("button",{type:"button","data-track":"open",children:"Connect Wallet"})})})}import{useEffect as Ug}from"react";import{WALLET_LABELS as Gg}from"@nexus-cross/crossx-design-system";import*as sn from"@radix-ui/react-dialog";import{Drawer as Qr}from"vaul";import{WALLET_LABELS as ra}from"@nexus-cross/crossx-design-system";import{jsx as de,jsxs as Yn}from"react/jsx-runtime";var Og='<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',Wg=`data:image/svg+xml,${encodeURIComponent(Og)}`;function Yr(){return de("img",{src:Wg,width:40,height:40,alt:"",style:{display:"block"}})}function qc(){return Yn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[Yn("g",{clipPath:"url(#clip0_1331_27065)",children:[de("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"}),de("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"}),de("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"}),de("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"}),de("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"}),de("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),de("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"})]}),de("defs",{children:de("clipPath",{id:"clip0_1331_27065",children:de("rect",{width:"40",height:"40",fill:"white"})})})]})}function Kc(){return Yn("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[de("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),de("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),de("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),de("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),de("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 Yc(){return Yn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[de("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),de("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"}),de("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),de("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 Qc(){return Yn("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Yn("g",{clipPath:"url(#clip0_1185_7785)",children:[de("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"}),de("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"})]}),de("defs",{children:de("clipPath",{id:"clip0_1185_7785",children:de("rect",{width:"28",height:"28",fill:"white"})})})]})}function Zc(){return Yn("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[de("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"}),de("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"}),de("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"}),de("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 Xc(){return de("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:de("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 Jc(){return de("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:de("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var ia={cross_embedded:{id:"cross_embedded",name:ra.social,description:"Sign in with Google or Apple",icon:Yr},cross_wallet:{id:"cross_wallet",name:ra.app,description:"App approval is required",icon:Yr,featured:!0},cross_extension:{id:"cross_extension",name:ra.extension,description:"Browser extension approval is required",icon:Yr,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:qc,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Kc},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Yc,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Qc,badge:"For SHOP"}};function aa(e){return ia[e]}var sa={google:{id:"google",name:"Google",icon:Zc},apple:{id:"apple",name:"Apple",icon:Xc}};function ed(e){return sa[e]}import{Fragment as rd,jsx as oe,jsxs as rt}from"react/jsx-runtime";function td(e,t){Te("connect","wallet_selected",{tags:{item_id:e}});let n=t?.();n instanceof Promise&&n.then(()=>Te("connect","connected"),o=>Te("connect","connected",{status:"failure",reason:Tt(o)}))}function zg({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 rt("button",{type:"button",className:ue("wcm-wallet-item",i&&"wcm-wallet-item--featured"),"data-track":"wallet_item_click","data-track-id":e.id,onClick:o,children:[rt("div",{className:"wcm-wallet-item-left",children:[oe("div",{className:"wcm-wallet-icon",children:oe(r,{})}),rt("div",{className:"wcm-wallet-name-row",children:[oe("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&oe("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?oe("span",{className:"wcm-installed-label",children:"Installed"}):oe("span",{className:"wcm-install-btn",children:"Install"}))]})}function $g({social:e,onSignIn:t}){let n=e.icon,o=`Sign in with ${e.name}`;return rt("button",{type:"button",className:"wcm-social-item","data-provider":e.id,"data-track":"social_provider_click","data-track-id":e.id,onClick:t,"aria-label":o,children:[oe("span",{className:"wcm-social-icon",children:oe(n,{})}),oe("span",{className:"wcm-social-name",children:o})]})}function nd(){let{wallets:e,activeWalletIds:t,socialProviders:n,activeSocialIds:o,termsUrl:r,privacyUrl:i,isDetected:a,close:s,isMobile:l}=Uo(),c=t.filter(b=>{let d=aa(b).visibility;return!d||d==="always"?!0:d==="desktop-only"?!l:d==="mobile-only"?l:!0}),u=o.length>0,f=c.length>0;return rt(rd,{children:[rt("div",{className:"wcm-header",children:[rt("div",{className:"wcm-header-text",children:[oe("h2",{className:"wcm-title",children:Gg.default}),!l&&oe("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),oe("button",{type:"button",className:"wcm-close-btn","data-track":"close",onClick:s,"aria-label":"Close",children:oe(Jc,{})})]}),rt("div",{className:"wcm-body",children:[u&&rt(rd,{children:[!l&&rt("div",{className:"wcm-section-header",children:[oe("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),oe("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),oe("div",{className:"wcm-social-grid",children:o.map(b=>{let d=ed(b);return oe($g,{social:d,onSignIn:()=>{td(b,n[b]),s()}},b)})}),f&&rt("div",{className:"wcm-separator",children:[oe("div",{className:"wcm-separator-line"}),oe("span",{className:"wcm-separator-text",children:"Other Wallets"}),oe("div",{className:"wcm-separator-line"})]})]}),f&&oe("div",{className:"wcm-wallet-list",children:c.map(b=>{let d=aa(b),x=d.rdns?a(d.rdns):!1;return oe(zg,{wallet:d,detected:x,onConnect:()=>{td(b,e[b]),s()}},b)})}),rt("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",oe(od,{href:r,track:"terms_link",children:"Terms of Service"})," ","and consent to its"," ",oe(od,{href:i,track:"privacy_link",children:"Privacy Policy"}),"."]})]})]})}function od({href:e,track:t,children:n}){return e?oe("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer","data-track":t,children:n}):oe("span",{className:"wcm-terms-link",children:n})}function id({className:e}){let{isMobile:t,theme:n,portalStyle:o,open:r}=Uo();return Ug(()=>{r&&Te("connect","opened")},[r]),t?oe(xe,{feature:"wallet_connect",children:rt(Qr.Portal,{children:[oe(Qr.Overlay,{className:"wcm-overlay"}),rt(Qr.Content,{className:ue("wcm-drawer-content",e),"data-theme":n,style:o,children:[oe(Qr.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),oe("div",{className:"wcm-drawer-handle"}),oe("div",{className:"wcm-drawer-body",children:oe(nd,{})})]})]})}):oe(xe,{feature:"wallet_connect",children:rt(sn.Portal,{children:[oe(sn.Overlay,{className:"wcm-overlay"}),rt(sn.Content,{className:ue("wcm-dialog-content",e),"data-theme":n,style:o,children:[oe(sn.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),oe(sn.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),oe("div",{className:"wcm-dialog-body",children:oe(nd,{})})]})]})})}te(`.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-system-orange-low, #fff5ee);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-orange-high, #e56f00);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:#ff8438;border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:#fff;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}
|
|
18
|
-
`);
|
|
19
|
-
`);import{jsx as
|
|
20
|
-
`);
|
|
21
|
-
`);var qg='<svg preserveAspectRatio="xMidYMid meet" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',Kg='<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>',Yg='<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>',Qg='<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>',Zg='<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 zo(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var Zr=zo(qg),Xr=zo(Kg),Jr=zo(Yg),ei=zo(Qg),ti=zo(Zg);import{jsx as wt,jsxs as $o}from"react/jsx-runtime";function dd({isConnecting:e,address:t,provider:n,providerName:o,accountName:r,sendAccounts:i,onConnect:a,onDisconnect:s,onCopy:l,onSelectWallet:c,onBuy:u,onBuyDisabledMessage:f,label:b="Connect Wallet",connectingLabel:d="Connecting...",disconnectLabel:x,className:h,theme:w="dark",env:g,showBalance:v=!0,showPortfolio:p,drawerDirection:R,modal:k,connectorId:C,style:_,walletInfoStyle:T,sendTransaction:I,getTransactionReceipt:G,estimateGas:F,onReceive:$,onBridge:L,onSend:Y,bridgeTokens:N,bridgeHistory:P,getBridgeQuote:ne,getBridgeToTokens:K,getBridgeApproval:B,approveBridge:ce,submitBridge:re}){let H=h?`cb-button ${h}`:"cb-button",D=h?`cb-pill ${h}`:"cb-pill";if(cd.useEffect(()=>{eo(t)},[t]),e)return $o("button",{type:"button",disabled:!0,className:H,style:_,"aria-busy":"true",children:[wt("span",{className:"cb-spinner","aria-hidden":"true"}),wt("span",{className:"cb-button-label",children:d})]});if(t){let Q=o??nh(n),X=n?eh[n]:void 0;return wt(xe,{feature:"connect_button",children:$o(bo,{env:g,theme:w,drawerDirection:R,modal:k,showBalance:v,showPortfolio:p,walletAddress:t,accountName:r,sendAccounts:i,connectorId:C,onSelectWallet:c,onCopyAddress:l?(me,ve)=>{ve&&l()}:void 0,onDisconnect:s,disconnectLabel:x,style:T,sendTransaction:I,getTransactionReceipt:G,estimateGas:F,onReceive:$,onBridge:L,onBuy:u,onBuyDisabledMessage:f,onSend:Y,bridgeTokens:N,bridgeHistory:P,getBridgeQuote:ne,getBridgeToTokens:K,getBridgeApproval:B,approveBridge:ce,submitBridge:re,children:[wt(bo.Trigger,{asChild:!0,children:$o("button",{type:"button",className:D,"data-track":"wallet_pill_open",style:_,"aria-label":`Connected with ${Q}: ${ld(t)}`,children:[X?wt("img",{src:X,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":n}):wt("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),wt("span",{className:"cb-pill-address",children:ld(t)})]})}),wt(bo.Content,{align:"end",sideOffset:8})]})})}return wt(xe,{feature:"connect_button",children:$o("button",{type:"button",onClick:a,className:H,"data-track":"connect_click",style:_,"aria-label":typeof b=="string"?b:"Connect Wallet",children:[wt(Jg,{}),wt("span",{className:"cb-button-label",children:b})]})})}function Jg(){return $o("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[wt("path",{d:"M3.75 5.25H14.25C15.0784 5.25 15.75 5.92157 15.75 6.75V13.5C15.75 14.3284 15.0784 15 14.25 15H3.75C2.92157 15 2.25 14.3284 2.25 13.5V4.5C2.25 3.67157 2.92157 3 3.75 3H13.5",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),wt("path",{d:"M12 9.75H15.75V12.75H12C11.1716 12.75 10.5 12.0784 10.5 11.25C10.5 10.4216 11.1716 9.75 12 9.75Z",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"}),wt("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var eh={google:ei,apple:ti,cross:Zr,metamask:Xr,binance:Jr},th={google:"Google",apple:"Apple",cross:Xg.default,metamask:"MetaMask",binance:"Binance Wallet"};function nh(e){return e?th[e]:"Wallet"}function ld(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}import*as pd from"react";te(`.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)}
|
|
22
|
-
`);
|
|
23
|
-
`);import{jsx as wo,jsxs as rh}from"react/jsx-runtime";var ud="https://www.onechain.nexus/skills";function fd({label:e="Skills",href:t,onClick:n,className:o,style:r,theme:i,disabled:a=!1,isLoading:s=!1,loadingLabel:l="Loading...",openInNewTab:c=!1,type:u="button"}){let[f,b]=pd.useState(!1),d=Me(),x=Dn("apps.json",d,k=>Bn(k?.skills,d)),h=t??x,w=async k=>{if(h&&!n){c?window.open(h,"_blank","noopener,noreferrer"):window.location.href=h;return}if(n)try{b(!0),await n()}finally{b(!1)}},g=a||s||f,v=s||f,p=v?l:e,R=o?`sb-button ${o}`:"sb-button";return wo(xe,{feature:"skills",children:rh("button",{type:u,onClick:w,disabled:g,className:R,"data-theme":i,"data-track":"click",style:r,"aria-busy":v,children:[v?wo("span",{className:"sb-spinner","aria-hidden":"true"}):wo(oh,{}),wo("span",{className:"sb-label",children:p})]})})}function oh(){return wo("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:wo("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"})})}pi({mode:"dapp-ui"});export{ti as APPLE_ICON,Fa as AppLauncher,Va as AppLauncherContent,Wa as AppLauncherTrigger,Jr as BINANCE_ICON,zr as BridgeFlow,Zo as CHAINS_CONFIG_FILE,ar as CONNECTOR_REGISTRY,Zr as CROSSX_ICON,dd as ConnectButton,xi as ConnectorId,ud as DEFAULT_SKILLS_HREF,tr as DappUiErrorBoundary,ei as GOOGLE_ICON,Xr as METAMASK_ICON,Mr as PORTFOLIO_SECTIONS,sa as SOCIAL_REGISTRY,vr as SendFlow,fd as SkillsButton,Pi as TOKEN_STATS_QUERY_KEY,_i as USER_BALANCE_QUERY_KEY,ia as WALLET_REGISTRY,sd as WalletConnectModal,bo as WalletInfo,ec as WalletPortfolio,fo as WalletPortfolioBody,pi as announceAppLauncherUsage,er as captureDappUiException,Wd as getChainDisplay,Jo as getDappUiSentryScope,Ro as initDappUiSentry,Tt as normalizeFailureReason,Me as resolveEnvironment,eo as setDappUiAnalyticsUser,nr as trackDappUiEvent,Te as trackDappUiFunnel,So as useChainDisplay,Ud as useChainsConfig,rr as useGlobalMenu,Tn as useTokenBalance,Nn as useTokenStats,Kr as useWalletDetect};
|
|
1
|
+
function bl(e){try{return import.meta.env?.[e]}catch{return}}function wl(e){if(!(typeof process>"u"))return process.env?.[e]}function Qe(e){if(e)return yl(e);let t=bl("VITE_CROSSX_ENVIRONMENT")??bl("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??wl("NEXT_PUBLIC_CROSSX_ENVIRONMENT")??wl("CROSSX_ENVIRONMENT");return yl(t)}function yl(e){switch(e?.toLowerCase()){case"dev":case"development":return"dev";case"stage":case"staging":case"stg":return"stage";default:return"production"}}import*as Wr from"react";var Ff={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"},Uf=3e3;function ar(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 Ua=new Map;function Mn(e,t){let r=`${Ff[t]}/${e}`,n=Ua.get(r);return n||(n=(async()=>{let o=new AbortController,i=setTimeout(()=>o.abort(),Uf);try{let a=await fetch(r,{cache:"no-store",signal:o.signal});return a.ok?await a.json():null}catch{return null}finally{clearTimeout(i)}})().then(o=>(o===null&&Ua.delete(r),o)),Ua.set(r,n)),n}function jf(e){return typeof e=="string"&&e.startsWith("https://")}async function we(e,t){let r=await Mn("endpoints.json",t),n=ar(r?.apis?.[e],t);if(!jf(n))throw new Error(`[remote-config] endpoints.json missing or invalid api base: ${e} (${t})`);return n}var li="chains.json";async function Wf(e,t){return(await Mn(li,t))?.chains?.[String(e)]??{}}function So(e,t){let[r,n]=Wr.useState({});return Wr.useEffect(()=>{if(e==null){n({});return}let o=!0;return Mn(li,t).then(i=>{o&&n(i?.chains?.[String(e)]??{})}),()=>{o=!1}},[e,t]),r}function _f(e){let[t,r]=Wr.useState({});return Wr.useEffect(()=>{let n=!0;return Mn(li,e).then(o=>{n&&r(o?.chains??{})}),()=>{n=!1}},[e]),t}function Er(e,t,r){let[n,o]=Wr.useState(void 0),i=Wr.useRef(r);return i.current=r,Wr.useEffect(()=>{let a=!0;return Mn(e,t).then(s=>{if(!a)return;let l=i.current(s);l!==void 0&&o(l)}),()=>{a=!1}},[e,t]),n}var Co="1.3.10-beta.4";var ci="__nexusCrossAppLauncherRuntime";function Gf(){if(typeof window>"u")return null;let e=window;return e[ci]??(e[ci]={mode:"dapp-ui"}),e[ci]}function Hf(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 r=e.connectKitVersion??"unknown";console.info(`[CROSSx App Launcher] connect-kit-react v${r} \uCD08\uAE30\uD654 \uC644\uB8CC (dapp-ui v${Co}, \uC0AC\uC6A9 \uBAA8\uB4DC: connect-kit)`)}else console.info(`[CROSSx App Launcher] dapp-ui v${Co} \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 ja(e){let t=Gf();t&&(e?.mode==="connect-kit-react"?t.mode="connect-kit-react":t.mode||(t.mode="dapp-ui"),e?.connectKitVersion&&(t.connectKitVersion=e.connectKitVersion),Hf(t))}import{BrowserClient as Qf,Scope as Vf,defaultStackParser as Yf,linkedErrorsIntegration as qf,makeFetchTransport as Kf}from"@sentry/react";var Zf="https://5c82aeb32da33b5a0a14b7c5393992ca@o4511668907081728.ingest.de.sentry.io/4511705324126289",Xf=`dapp-ui@${Co}`,Yn=null,xl=1;function vl(){return xl}function Jf(e){switch(e){case"dev":return"dev";case"stage":return"stg";default:return"prod"}}function No(e){if(Yn)return Yn;if(typeof window>"u")return null;let t=Jf(Qe(e?.environment));typeof e?.analyticsSampleRate=="number"&&(xl=Math.min(1,Math.max(0,e.analyticsSampleRate)));let r=new Qf({dsn:e?.dsn??Zf,transport:Kf,stackParser:Yf,integrations:[qf()],environment:t,release:Xf,enabled:e?.enabled??t==="prod"}),n=new Vf;return n.setClient(r),n.setTags({package:"dapp-ui",framework:"react",source:"dapp-ui"}),r.init(),Yn=n,Yn}function di(){return Yn}function pi(e,t){let r=Yn??No();if(r)return r.captureException(e,t?{captureContext:{extra:t}}:void 0)}import{Component as $f}from"react";var ui=class extends $f{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,n){pi(r,{componentStack:n.componentStack??void 0,boundary:this.props.name??"dapp-ui"})}render(){return this.state.hasError?this.props.fallback??null:this.props.children}};function xe(...e){return e.filter(Boolean).join(" ")}function kl(){return typeof window>"u"?!1:window.navigator.userAgent.includes("CROSSx")}var Rl="__nexus_dapp_ui_uid",Wa=null;function em(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join("")}function _a(){if(Wa)return Wa;let e=null;try{e=window.localStorage.getItem(Rl)}catch{}if(!e||!e.startsWith("anon_")){e=`anon_${em()}`;try{window.localStorage.setItem(Rl,e)}catch{}}return Wa=e,e}async function Sl(e){if(typeof crypto>"u"||!crypto.subtle)return null;try{let t=new TextEncoder().encode(e.trim().toLowerCase()),r=await crypto.subtle.digest("SHA-256",t);return`wallet_${Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("").slice(0,16)}`}catch{return null}}function tm(){let e=window.navigator.userAgent;return/ipad|tablet|(android(?!.*mobile))/i.test(e)?"tablet":/mobile|iphone|ipod|android/i.test(e)?"mobile":"desktop"}function Tl(){return{host:window.location.hostname,device_type:tm(),is_cross_inapp:String(kl())}}var Cl=!1;function Ga(){if(typeof window>"u")return null;let e=di()??No();return e?(Cl||(Cl=!0,e.setUser({id:_a()})),e):null}function Il(){return Math.random()>=vl()}var Nl=0;function qn(e){let t=Ga();if(!t)return;let r=++Nl;if(!e){t.setUser({id:_a()});return}Sl(e).then(n=>{n&&r===Nl&&t.setUser({id:n})})}function fi(e,t,r){let n=Ga();!n||Il()||n.captureMessage(`ui: ${e}_${t}`,"info",{captureContext:{tags:{...Tl(),feature:e,action:t,...r}}})}function Ce(e,t,r){let n=Ga();if(!n||Il())return;let o=r?.status??"success";n.captureMessage(`funnel: ${e}_${t}`,"info",{captureContext:{tags:{...Tl(),flow:e,funnel_step:`${e}_${t}`,funnel_status:o,...o==="failure"?{failure_reason:r?.reason??"unknown"}:{},...r?.tags}}})}function sr(e){let t=e,r=String((t&&typeof t=="object"&&"message"in t?t.message:e)??"").toLowerCase();return t?.code===4001||/reject|denied|declin|cancel/i.test(r)?"user-rejected":/insufficient (funds|gas|balance)|exceeds balance/i.test(r)?"insufficient-gas":/timeout|timed out|deadline/i.test(r)?"timeout":/revert|execution failed/i.test(r)?"contract-reverted":/network|fetch|connection|disconnected|offline/i.test(r)?"network":"unknown"}import{useCallback as rm}from"react";import{jsx as nm}from"react/jsx-runtime";function pe({feature:e,children:t}){let r=rm(n=>{let o=n.nativeEvent;if(o.__dappUiTracked)return;let a=n.target?.closest?.("[data-track]");if(!a)return;let s=a.getAttribute("data-track");if(!s)return;o.__dappUiTracked=!0;let l=a.getAttribute("data-track-id");fi(e,s,l?{item_id:l}:void 0)},[e]);return nm("div",{style:{display:"contents"},onClick:r,children:t})}import*as Zn from"react";import*as Ml from"@radix-ui/react-popover";import{Drawer as lm}from"vaul";import{createContext as om,useContext as im}from"react";var Ha=om(null);function mi(){let e=im(Ha);if(!e)throw new Error("AppLauncher compound components must be used within <AppLauncher>");return e}import{useState as am,useEffect as sm}from"react";function Kn(e){let[t,r]=am(!1);return sm(()=>{let n=window.matchMedia(e);r(n.matches);let o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[e]),t}function ie(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}ie(`[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
|
+
`);ie(`.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
|
+
`);ie(`@keyframes al-fade-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
|
|
4
|
+
`);ie(`.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
|
+
`);ie("");import{jsx as Qa}from"react/jsx-runtime";function El({env:e,theme:t="dark",mobileBreakpoint:r=768,domain:n,children:o}){let i=Kn(`(max-width: ${r}px)`),[a,s]=Zn.useState(!1),l=Zn.useCallback(()=>s(!1),[]),c=Qe(e),u=Zn.useMemo(()=>({env:c,theme:t,isMobile:i,open:a,domain:n,close:l}),[c,t,i,a,n,l]);return Qa(Ha.Provider,{value:u,children:i?Qa(lm.Root,{direction:"right",open:a,onOpenChange:s,noBodyStyles:!0,children:o},"drawer"):Qa(Ml.Root,{open:a,onOpenChange:s,children:o},"popover")})}import*as Pl from"@radix-ui/react-popover";import{Drawer as dm}from"vaul";import{jsx as lr,jsxs as cm}from"react/jsx-runtime";function Al({size:e=18}){return cm("svg",{className:"al-trigger-icon",width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[lr("rect",{width:"4",height:"4",rx:"2",fill:"currentColor"}),lr("rect",{x:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),lr("rect",{x:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),lr("rect",{y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),lr("rect",{x:"7",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),lr("rect",{x:"14",y:"7",width:"4",height:"4",rx:"2",fill:"currentColor"}),lr("rect",{y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),lr("rect",{x:"7",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"}),lr("rect",{x:"14",y:"14",width:"4",height:"4",rx:"2",fill:"currentColor"})]})}function Ll(){return lr("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:lr("path",{d:"M12 19L5 12M5 12L12 5M5 12H19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dl(){return lr("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:lr("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Xn}from"react/jsx-runtime";function Bl({asChild:e,children:t,className:r,style:n}){let{isMobile:o,theme:i}=mi(),a=t!=null,s=e??!0,l=r?`al-trigger-btn ${r}`:"al-trigger-btn",c=a?t:Xn("button",{type:"button",className:l,"data-theme":i,"data-track":"open",style:n,children:Xn(Al,{size:18})});return o?Xn(pe,{feature:"app_launcher",children:Xn(dm.Trigger,{asChild:s,children:c})}):Xn(pe,{feature:"app_launcher",children:Xn(Pl.Trigger,{asChild:s,children:c})})}import*as En from"react";import*as hi from"@radix-ui/react-popover";import{Drawer as Jn}from"vaul";import{useQuery as fm}from"@tanstack/react-query";var zl={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 pm="https://stg-contents.crosstoken.io/frontend/common/app-launcher/icons",um="https://contents.crosstoken.io/frontend/common/app-launcher/icons";function Ar(e,t){return`${e==="production"?um:pm}/${t}.png`}function Ol(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:Ar(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:Ar(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:Ar(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:Ar(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:Ar(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:Ar(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:Ar(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:Ar(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:Ar(t,"shop"),order:9e3,type:"shop",badge:null,isNew:!1,serviceStatus:"available"},{id:"explorer",label:"Explorer",description:"View transactions, blocks, and token data on the CROSS network.",url:{dev:"https://stg-explorer.onechain.nexus",stage:"https://stg-explorer.onechain.nexus",production:"https://explorer.onechain.nexus"},iconUrl:Ar(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:Ar(t,"wave"),order:11e4,type:"wave",badge:null,isNew:!1,serviceStatus:"available"}]}}function gi(e){let t=Qe(e);return fm({queryKey:["global-menu",t],queryFn:async()=>{try{let r=await fetch(zl[t],{cache:"no-store"});if(!r.ok)throw new Error(`Failed to fetch global menu: ${r.status}`);return r.json()}catch{return Ol(t)}},staleTime:300*1e3,gcTime:600*1e3,retry:!1,refetchOnMount:!0})}function Va(e){return e.serviceStatus==="ending"||e.serviceStatus==="comingSoon"?e.serviceStatus:"available"}function Ul(e,t){return typeof e=="string"?e:e[t]??e.production??e.stage??e.dev}function jl(e){return[...e].sort((t,r)=>{let n=Fl(t)-Fl(r);return n!==0?n:t.order-r.order})}function Fl(e){let t=Va(e);return t==="comingSoon"?0:t==="ending"?2:1}import{jsx as gt,jsxs as $n}from"react/jsx-runtime";function mm(e){return e.id==="cross-staking"||e.type==="cross-staking"}function _l({align:e="end",sideOffset:t=8,className:r}){let{env:n,theme:o,isMobile:i,domain:a,close:s}=mi(),{data:l}=gi(n),c=En.useMemo(()=>jl(l?.items??[]),[l?.items]),u=8,h=En.useRef(null),g=En.useCallback(b=>{h.current={x:b.clientX,y:b.clientY}},[]),d=typeof window<"u"?window.location.pathname:"",w=En.useCallback((b,y)=>{if(h.current){let v=b.clientX-h.current.x,R=b.clientY-h.current.y;if(h.current=null,Math.abs(v)>u||Math.abs(R)>u)return}let p=y.url[n]??y.url.production,x=Wl(p,a);if(!x)try{let v=new URL(p).pathname;if(d===v||d.startsWith(v+"/")){s();return}}catch{}x?window.open(p,"_blank","noopener,noreferrer"):window.location.href=p,s()},[n,a,s,d]),f=b=>{let y=b.url[n]??b.url.production,p=Wl(y,a),x=Va(b),v=x==="ending",R=Ul(b.iconUrl,n),T=!1;if(!p)try{let N=new URL(y).pathname;T=d===N||d.startsWith(N+"/")}catch{T=!1}return gt("button",{type:"button",className:"al-grid-item","data-track":"menu_item_click","data-track-id":b.id,"data-active":T||void 0,"data-service-status":x,onPointerDown:g,onClick:N=>w(N,b),children:$n("div",{className:"al-grid-item-left",children:[$n("div",{className:"al-grid-item-icon",children:[gt("img",{src:R,alt:b.label,width:24,height:24,loading:"lazy"}),b.isNew&>("span",{className:"al-status-ribbon al-status-ribbon-new",children:"N"})]}),$n("span",{className:"al-grid-item-text",children:[gt("span",{className:"al-grid-item-label",children:b.label}),v&>("span",{className:"al-grid-item-status-text",children:"(End Soon)"}),b.badge&&!mm(b)&>("span",{className:"al-badge al-badge-list",children:b.badge})]})]})},b.id)},m=gt("div",{className:"al-menu","data-theme":o,children:gt("div",{className:"al-grid",children:c.map(f)})});return i?gt(pe,{feature:"app_launcher",children:$n(Jn.Portal,{children:[gt(Jn.Overlay,{className:"al-drawer-overlay"}),$n(Jn.Content,{className:xe("al-drawer-content",r),"data-theme":o,children:[$n("div",{className:"al-drawer-header",children:[gt(Jn.Close,{className:"al-drawer-close","data-track":"close",children:gt(Ll,{})}),gt(Jn.Title,{className:"al-drawer-title",children:"CROSS Services"}),gt(Jn.Close,{className:"al-drawer-close","data-track":"close",children:gt(Dl,{})})]}),gt("div",{className:"al-drawer-body",children:m})]})]})}):gt(pe,{feature:"app_launcher",children:gt(hi.Portal,{children:gt(hi.Content,{align:e,sideOffset:t,className:xe("al-popover-content",r),"data-theme":o,children:m})})})}function Wl(e,t){try{let r=new URL(e).hostname;return typeof window>"u"?!0:r!==(t??window.location.hostname)}catch{return!1}}import*as Mt from"react";import*as Up from"@radix-ui/react-popover";import{Drawer as Db}from"vaul";import{createContext as gm,useContext as hm}from"react";var Ya=gm(null);function pn(){let e=hm(Ya);if(!e)throw new Error("WalletInfo compound components must be used within <WalletInfo>");return e}import{WALLET_LABELS as bm}from"@nexus-cross/crossx-design-system";var qa=(n=>(n.CROSSx="crossx",n.MetaMask="io.metamask",n.Binance="com.binance.wallet",n))(qa||{}),bi={crossx:{name:bm.default,iconUrl:"https://contents.crosstoken.io/wallet/token/images/tCROSS.svg"},"io.metamask":{name:"MetaMask",iconUrl:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg"},"com.binance.wallet":{name:"Binance Wallet",iconUrl:"https://public.bnbstatic.com/static/images/common/favicon.ico"}};import*as Pc from"react";import{jsx as Ne,jsxs as To}from"react/jsx-runtime";function Gl({size:e=16,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Ne("path",{d:"M12.6667 4.66667V2.66667C12.6667 2.48986 12.5964 2.32029 12.4714 2.19526C12.3464 2.07024 12.1768 2 12 2H3.33333C2.97971 2 2.64057 2.14048 2.39052 2.39052C2.14048 2.64057 2 2.97971 2 3.33333C2 3.68696 2.14048 4.02609 2.39052 4.27614C2.64057 4.52619 2.97971 4.66667 3.33333 4.66667H13.3333C13.5101 4.66667 13.6797 4.7369 13.8047 4.86193C13.9298 4.98695 14 5.15652 14 5.33333V8M14 8H12C11.6464 8 11.3072 8.14048 11.0572 8.39052C10.8071 8.64057 10.6667 8.97971 10.6667 9.33333C10.6667 9.68696 10.8071 10.0261 11.0572 10.2761C11.3072 10.5262 11.6464 10.6667 12 10.6667H14C14.1768 10.6667 14.3464 10.5964 14.4714 10.4714C14.5964 10.3464 14.6667 10.1768 14.6667 10V8.66667C14.6667 8.48986 14.5964 8.32029 14.4714 8.19526C14.3464 8.07024 14.1768 8 14 8Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),Ne("path",{d:"M2 3.33325V12.6666C2 13.0202 2.14048 13.3593 2.39052 13.6094C2.64057 13.8594 2.97971 13.9999 3.33333 13.9999H13.3333C13.5101 13.9999 13.6797 13.9297 13.8047 13.8047C13.9298 13.6796 14 13.5101 14 13.3333V10.6666",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})]})}function An({size:e=16,className:t}){return Ne("svg",{width:e,height:e,viewBox:"4 4 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M9.40284 17.0647H4.85156V4.84656H17.0697V9.39783H15.4407V6.47565H6.48066V15.4356H9.40284V17.0647ZM21.5192 12.5644H12.5592V21.5244H21.5192V12.5644ZM23.1483 10.9353V23.1535H10.9301V10.9353H23.1483Z",fill:"currentColor"})})}function Jr({size:e=16,className:t}){return Ne("svg",{width:e,height:e,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M11.6667 3.5L5.25 9.91667L2.33334 7",stroke:"currentColor",strokeWidth:1.16667,strokeLinecap:"round",strokeLinejoin:"round"})})}function fr({size:e=24,className:t}){return Ne("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Hl({size:e=20,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Ne("path",{d:"M7.5 17.5H4.167A1.667 1.667 0 012.5 15.833V4.167A1.667 1.667 0 014.167 2.5H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),Ne("path",{d:"M13.333 14.167L17.5 10l-4.167-4.167M17.5 10H7.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function wi({size:e=20,className:t}){return Ne("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:Ne("path",{d:"M7.91305 10.8327C8.60341 10.8327 9.16305 11.3924 9.16305 12.0827V16.2458C9.16305 16.9361 8.60341 17.4958 7.91305 17.4958H3.75C3.05964 17.4958 2.5 16.9361 2.5 16.2458L2.5 12.0827C2.5 11.3924 3.05964 10.8327 3.75 10.8327H7.91305ZM14.1685 17.4958H12.5027V15.83H14.1685V17.4958ZM17.5 17.4958H15.8342V15.83H17.5V17.4958ZM4.16576 12.4985V15.83H7.49729V12.4985H4.16576ZM12.5027 15.83H10.8369V14.1642H12.5027V15.83ZM15.8342 15.83H14.1685V14.1642H15.8342V15.83ZM14.1685 14.1642H12.5027V12.4985H14.1685V14.1642ZM17.5 14.1642H15.8342V12.4985H17.5V14.1642ZM12.5027 12.4985H10.8369V10.8327H12.5027V12.4985ZM15.8342 12.4985H14.1685V10.8327H15.8342V12.4985ZM7.91305 2.50391C8.60341 2.50391 9.16305 3.06355 9.16305 3.75391V7.91696C9.16305 8.60731 8.60341 9.16696 7.91305 9.16696H3.75C3.05964 9.16696 2.5 8.60731 2.5 7.91696L2.5 3.75391C2.5 3.06355 3.05964 2.50391 3.75 2.50391L7.91305 2.50391ZM16.2419 2.50391C16.9322 2.50391 17.4919 3.06355 17.4919 3.75391V7.91696C17.4919 8.60731 16.9322 9.16696 16.2419 9.16696H12.0788C11.3885 9.16696 10.8288 8.60731 10.8288 7.91696V3.75391C10.8288 3.06355 11.3885 2.50391 12.0788 2.50391L16.2419 2.50391ZM4.16576 4.16967L4.16576 7.50119L7.49729 7.50119L7.49729 4.16967L4.16576 4.16967ZM12.4946 4.16967V7.50119H15.8261V4.16967H12.4946Z",fill:"currentColor",fillOpacity:1})})}function $r({size:e=20,className:t}){return Ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:1.67,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ln({size:e=20,className:t}){return Ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M5 8L10 13L15 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ql({size:e=16,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Ne("path",{d:"M1.667 10S4.167 4.167 10 4.167 18.333 10 18.333 10 15.833 15.833 10 15.833 1.667 10 1.667 10z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),Ne("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Vl({size:e=16,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Ne("path",{d:"M14.95 14.95A8.283 8.283 0 0110 16.667c-5.833 0-8.333-5.833-8.333-5.833a15.238 15.238 0 014.183-4.884m3.267-1.55A7.55 7.55 0 0110 4.167c5.833 0 8.333 5.833 8.333 5.833a15.28 15.28 0 01-1.783 2.633M11.767 11.767a2.5 2.5 0 11-3.534-3.534",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),Ne("path",{d:"M1.667 1.667l16.666 16.666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]})}var wm='<svg width="100%" height="100%" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',ym=`data:image/svg+xml,${encodeURIComponent(wm)}`;function Yl({size:e=42,className:t}){return Ne("img",{src:ym,width:e,height:e,alt:"",className:t,style:{display:"block"}})}function ql({size:e=20,className:t}){return Ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M9.19133 10.8077C9.04905 10.6657 8.87947 10.554 8.69283 10.4792L2.78881 8.11167C2.71832 8.08338 2.65816 8.03421 2.61642 7.97075C2.57468 7.90729 2.55335 7.83258 2.5553 7.75665C2.55724 7.68072 2.58237 7.6072 2.6273 7.54596C2.67224 7.48472 2.73483 7.4387 2.80668 7.41406L16.9525 2.5747C17.0185 2.55087 17.0899 2.54632 17.1583 2.56159C17.2268 2.57685 17.2895 2.6113 17.3391 2.66089C17.3887 2.71049 17.4231 2.77319 17.4384 2.84165C17.4536 2.9101 17.4491 2.9815 17.4253 3.04746L12.5859 17.1933C12.5613 17.2651 12.5152 17.3277 12.454 17.3727C12.3928 17.4176 12.3192 17.4427 12.2433 17.4447C12.1674 17.4466 12.0927 17.4253 12.0292 17.3835C11.9658 17.3418 11.9166 17.2817 11.8883 17.2112L9.52073 11.3056C9.44567 11.1191 9.33362 10.9498 9.19133 10.8077ZM9.19133 10.8077L17.3367 2.66404",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function Kl({size:e=20,className:t}){return Ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M10.8333 14.1667V7.5M15 14.1667V4.16667M2.5 2.5V15.8333C2.5 16.2754 2.67559 16.6993 2.98816 17.0118C3.30072 17.3244 3.72464 17.5 4.16667 17.5H17.5M6.66667 14.1667V11.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function Zl({size:e=20,className:t}){return Ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M6.6665 9.99984H13.3332M9.99984 6.6665V13.3332M18.3332 9.99984C18.3332 14.6022 14.6022 18.3332 9.99984 18.3332C5.39746 18.3332 1.6665 14.6022 1.6665 9.99984C1.6665 5.39746 5.39746 1.6665 9.99984 1.6665C14.6022 1.6665 18.3332 5.39746 18.3332 9.99984Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xl({size:e=20,className:t}){return Ne("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:Ne("path",{d:"M6.667 2.5 3.333 5.833 6.667 9.167M3.333 5.833h13.334M13.333 17.5l3.334-3.333-3.334-3.334M16.667 14.167H3.333",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})}function Jl({size:e=20,className:t}){return To("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[Ne("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor"}),Ne("path",{d:"M6 10.2L8.6 12.8L14 7.2",stroke:"var(--ds-accent-primary-on, #ffffff)",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]})}import*as ee from"react";import Dn from"bignumber.js";function xm(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 un(e,t){if(!e||e==="0")return"0.00";let r=new Dn(e).shiftedBy(-t),n=r.isGreaterThanOrEqualTo(1)?2:4;return r.toFormat(n,Dn.ROUND_DOWN)}function Ft(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Pn(e){let t=typeof e=="string"?parseFloat(e):e;if(Number.isNaN(t)||t===0)return"$0.00";let r=t>=1?2:4,n=Math.pow(10,r);return`$${(Math.floor(t*n)/n).toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}function yi(e,t,r){let o=new Dn(e).shiftedBy(-t).multipliedBy(new Dn(r));return o.isZero()||o.isNaN()?"$0.00":`$${(o.integerValue(Dn.ROUND_DOWN).isGreaterThanOrEqualTo(1)?o.decimalPlaces(2,Dn.ROUND_DOWN):o.decimalPlaces(4,Dn.ROUND_DOWN)).toFormat()}`}function $l(e){if(e===""||e===null||e===void 0)return{displayValue:"0",isLowerBound:!1};let t=typeof e=="number"?e.toString():e;if(t==="0"||t==="0.0")return{displayValue:"0",isLowerBound:!1};let r=t;if(r.includes("e")||r.includes("E")){let a=Number(r);if(!Number.isFinite(a)||a===0)return{displayValue:"0",isLowerBound:!1};r=xm(a.toFixed(18))}let[n="0",o=""]=r.split(".");if(Number(n)>=1){let a=o.slice(0,2).padEnd(2,"0");return{displayValue:`${Number(n).toLocaleString("en-US")}.${a}`,isLowerBound:!1}}return o.length<4?{displayValue:`${n}.${o}`,isLowerBound:!1}:o.slice(0,4)==="0000"?{displayValue:"0.0001",isLowerBound:!0}:{displayValue:`0.${o.slice(0,4)}`,isLowerBound:!1}}import{useMemo as ec}from"react";import{useQuery as vm}from"@tanstack/react-query";var $e={dev:{cross:612044,bsc:97},stage:{cross:612044,bsc:97},production:{cross:612055,bsc:56}},eo="https://terms.onechain.nexus/docs/terms-july-23-2026",xi="https://terms.onechain.nexus/docs/pp-july-23-2026";var km="send:chain-info";function Rm(e){if("data"in e&&e.data!==void 0){let t=e.data;if(Array.isArray(t)){let r=t[0];if(!r)throw new Error("Chain info payload is empty.");return r}return t}return e}function Ka(e,...t){let r=e.replace(/\/+$/,""),n=t.map(o=>o.replace(/^\/+|\/+$/g,"")).filter(Boolean);return[r,...n].join("/")}function tc(e,t,r,n){if(n)return t===$e[e].cross?rc(t,n):r?.explorer_url?Ka(r.explorer_url,r.explorer_postfix?.transaction??"tx",n):Sm(e,t,n)}function rc(e,t){return Ka("https://explorer.onechain.nexus",String(e),"tx",t)}function Sm(e,t,r){let n=$e[e];if(t===n.cross)return rc(t,r);if(t===n.bsc)return Ka(e==="production"?"https://bscscan.com":"https://testnet.bscscan.com","tx",r)}function Io(e,t,r,n=!0){let o=vm({queryKey:[km,e,t],queryFn:async({signal:s})=>{let l=await we("walletServer",e),c=await fetch(`${l}/v1/public/chain/info/${t}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Failed to fetch chain info: ${c.status}`);let u=await c.json();if("code"in u&&u.code!==void 0&&u.code!==200)throw new Error(`Chain info API error: ${u.code}`);return Rm(u)},enabled:n,staleTime:3e5}),i=o.data;return{transactionUrl:ec(()=>tc(e,t,i,r),[t,i,e,r]),chainInfo:i,...o}}function nc(e,t,r=!0){let{chainInfo:n}=Io(e,t,void 0,r);return{buildTxUrl:ec(()=>i=>tc(e,t,n,i),[e,t,n]),chainInfo:n}}var oc="0x0000000000000000000000000000000000000001";var Cm="0xa9059cbb",Nm=/^0x[a-fA-F0-9]{40}$/,Tm="nexus-cross:dapp-ui:send:recent:",ic=10;function Im(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===48;)t--;return e.slice(0,t)}function Mo(e){return e.toLowerCase()}function _r(e){return Nm.test(e)}function fn(e){return Mo(e.address)===oc}function Za(e){return`${Tm}${e.toLowerCase()}`}function to(e){if(typeof window>"u")return[];try{let t=window.localStorage.getItem(Za(e));if(!t)return[];let r=JSON.parse(t);return Array.isArray(r)?r.filter(n=>n!==null&&typeof n=="object"&&_r(n.address)&&typeof n.updatedAt=="number").slice(0,ic):[]}catch{return[]}}function Xa(e,t){if(typeof window>"u")return[];let r=Mo(t),n=[{address:r,updatedAt:Date.now()},...to(e).filter(o=>o.address!==r)].slice(0,ic);try{window.localStorage.setItem(Za(e),JSON.stringify(n))}catch{return to(e)}return n}function Ja(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(Za(e))}catch{}}function Bn(e,t){let r=e.trim();if(!r)return{error:"Enter an amount."};if(!/^\d+(\.\d*)?$/.test(r))return{error:"Enter a valid amount."};let[n="0",o=""]=r.split(".");if(o.length>t)return{error:`Max ${t} decimal places.`};let i=BigInt(n||"0"),a=o.padEnd(t,"0"),s=a?BigInt(a):0n,l=10n**BigInt(t),c=i*l+s;return c<=0n?{error:"Amount must be greater than 0."}:{value:c}}function ro(e,t){let r=BigInt(e||"0"),n=10n**BigInt(t),o=r/n,i=r%n;if(i===0n)return o.toString();let a=Im(i.toString().padStart(t,"0"));return`${o.toString()}.${a}`}function $a(e,t){let r=e.replace(/^0x/,"").toLowerCase().padStart(64,"0"),n=t.toString(16).padStart(64,"0");return`${Cm}${r}${n}`}function vi(e,t,r=10){if(t<=0)return e.toString();let n=10n**BigInt(t),o=e/n,i=e%n;if(i===0n)return o.toString();let s=i.toString().padStart(t,"0").slice(0,Math.max(0,Math.min(r,t)));return s=s.replace(/0+$/,""),s?`${o.toString()}.${s}`:o.toString()}function es(e,t){return vi(e,t,6)}function ac(e){return vi(e,9,2)}function sc(e){return e.toLocaleString("en-US")}function ki(e){return e===56||e===97}function Ri(e){return e.gasPrice??e.maxFeePerGas}function lc(e,t=!1){return t?Ri(e)!==void 0?"legacy":null:e.maxFeePerGas!==void 0?"dynamic":e.gasPrice!==void 0?"legacy":null}function Si(e,t=!1){if(t){let r=Ri(e);return r!==void 0?e.gasLimit*r:null}return e.maxFeePerGas!==void 0?e.gasLimit*e.maxFeePerGas:e.gasPrice!==void 0?e.gasLimit*e.gasPrice:null}function Ci(e){return!Number.isFinite(e)||e<=0?"$0.00":`$${e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function cc(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 r=e,n=[];return typeof r.name=="string"&&n.push(r.name),typeof r.shortMessage=="string"&&n.push(r.shortMessage),typeof r.message=="string"&&n.push(r.message),typeof r.details=="string"&&n.push(r.details),r.cause!==void 0&&n.push(cc(r.cause,t+1)),n.join(`
|
|
6
|
+
`).toLowerCase()}function Mm(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 ts(e,t={},r="Failed to send transaction."){let n=cc(e);if(!n)return r;let o=t.nativeSymbol?.trim()||"gas token",i=t.networkName?.trim();if(n.includes("user rejected")||n.includes("userrejected")||n.includes("user denied")||n.includes("user cancelled")||n.includes("user canceled")||n.includes("action_rejected")||n.includes("rejected by user"))return"Transaction was cancelled.";if(n.includes("insufficientfunds")||n.includes("insufficient funds")||n.includes("exceeds the balance of the account")||n.includes("insufficient balance for transfer")){let a=i?` on ${i}`:"";return`Not enough ${o} to cover the gas fee.Please top up your ${o} balance and try again.`}return n.includes("transaction underpriced")||n.includes("replacement transaction underpriced")||n.includes("fee too low")?"Gas fee was too low for the network. Please try again.":n.includes("nonce too low")||n.includes("nonce has already been used")||n.includes("nonce too high")?"Pending transactions are out of order. Refresh the page and try again.":n.includes("execution reverted")||n.includes("contractfunctionrevertederror")||n.includes("contractfunctionexecutionerror")?"The transaction was rejected by the contract. The recipient or token may be invalid.":n.match(/chain \d+ is not configured/)?"This network is not registered in the app. Contact support.":n.includes("http request failed")||n.includes("failed to fetch")||n.includes("network request failed")||n.includes("timeout")||n.includes("econnreset")||n.includes("rpc error")||n.includes("429")?"Network connection failed. Check your internet and try again.":n.includes("estimategas")||n.includes("gas estimation failed")?"Could not estimate the gas fee. The recipient address or amount may be invalid.":Mm(e)||r}var Em=2000000000n,Am=1000000000n;async function Ni(e,t,r){let n=new AbortController,o=setTimeout(()=>n.abort(),8e3),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:r}),signal:n.signal}).finally(()=>clearTimeout(o));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 Ti(e){return BigInt(e)}function Lm(e){return`0x${e.toString(16)}`}function Dm(e){let t={to:e.to};return e.from&&(t.from=e.from),e.value!==void 0&&e.value>0n&&(t.value=Lm(e.value)),e.data&&(t.data=e.data),t}function Pm(e){return e===56||e===97}async function dc(e){try{let t=await Ni(e,"eth_gasPrice",[]);return{gasPrice:Ti(t)}}catch{return{gasPrice:Em}}}async function Bm(e,t){let r=Am;try{let n=await Ni(e,"eth_maxPriorityFeePerGas",[]);r=Ti(n)}catch{}return{maxFeePerGas:t+r,maxPriorityFeePerGas:r}}async function zm(e,t){if(t)return dc(e);let r;try{r=(await Ni(e,"eth_getBlockByNumber",["latest",!1]))?.baseFeePerGas}catch{}return r?Bm(e,Ti(r)):dc(e)}async function pc(e,t){let r=Pm(t.chainId),n=Dm(t),[o,i]=await Promise.all([Ni(e,"eth_estimateGas",[n]),zm(e,r)]);return{gasLimit:Ti(o),gasPrice:i.gasPrice,maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}}function uc(e){let{estimateGas:t,sendTransaction:r,getTransactionReceipt:n}=e;return{canSend:!!r,canEstimateGas(o){return!!t||!!o},async estimateGas(o,i){if(t)return t(o);if(i)return pc(i,o);throw new Error("Gas estimation is not available.")},async sendTransaction(o){if(!r)throw new Error("Sending is not available for this wallet.");return r(o)},getTransactionReceipt:n}}var Om=1500,Fm=120;function fc(e){return!!(e.token||e.recipient||e.amount)}function rs({recipient:e,amount:t,token:r,balanceRaw:n}){let o={},i=e.trim(),a=Bn(t,r.quantity.decimals),s;return i?_r(i)||(o.recipient="Enter a valid EVM recipient address."):o.recipient="Enter a recipient address.","error"in a?o.amount=a.error:(s=a.value,s>n&&(o.amount="Amount exceeds available balance.")),!fn(r)&&!_r(r.address)&&(o.token="Token contract address is invalid."),{errors:o,rawAmount:o.amount?void 0:s,recipient:i&&_r(i)?i:void 0}}function ns({token:e,walletAddress:t,recipient:r,rawAmount:n}){let o=t;return fn(e)?{to:r,value:n,chainId:e.chainId,from:o}:{to:Mo(e.address),data:$a(r,n),value:0n,chainId:e.chainId,from:o}}function Um(e){let{status:t}=e;return t==="reverted"||t==="0x0"||t===0||t===0n||t===!1}var jm=e=>new Promise(t=>setTimeout(t,e));async function mc({repository:e,args:t,chainId:r,onSubmitted:n,pollIntervalMs:o=Om,pollMaxAttempts:i=Fm}){let a=await e.sendTransaction(t);n(a);let{getTransactionReceipt:s}=e;if(!s)return"success";for(let l=0;l<i;l+=1){let c=await s({hash:a,chainId:r}).catch(()=>null);if(c)return Um(c)?"reverted":"success";await jm(o)}return"timeout"}var gc=["token","recipient","amount","review"];function hc(e){let{env:t,walletAddress:r,accountName:n,accounts:o=[],initialStep:i="recipient",token:a,tokens:s=[],onTokenChange:l,sendTransaction:c,getTransactionReceipt:u,estimateGas:h,getTokenPriceUsd:g,onSubmitted:d,onSuccess:w,onFailed:f,onExit:m,onOutlink:b}=e,y=ee.useMemo(()=>uc({sendTransaction:c,getTransactionReceipt:u,estimateGas:h}),[c,u,h]),[p,x]=ee.useState(a);ee.useEffect(()=>{x(a)},[a.address,a.chainId]);let[v,R]=ee.useState(i),[T,N]=ee.useState(""),[S,M]=ee.useState(""),[P,j]=ee.useState({}),[L,K]=ee.useState("idle"),[D,O]=ee.useState(""),[oe,G]=ee.useState(""),[W,le]=ee.useState(null),[Z,V]=ee.useState(!1),[U,te]=ee.useState(""),J=ee.useRef(0),[fe,ce]=ee.useState(null),[$,be]=ee.useState(""),[Ae,de]=ee.useState(()=>to(r)),Te=ee.useRef(new Set),ae=ee.useCallback((z,ne)=>{Te.current.has(z)||(Te.current.add(z),Ce("send",z,ne))},[]);ee.useEffect(()=>{ae("opened"),i!=="token"&&ae("token_selected",{tags:{item_id:a.symbol}})},[ae,i,a.symbol]);let We=ee.useMemo(()=>Qe(t),[t]),{transactionUrl:Ze,chainInfo:Le}=Io(We,p.chainId,D||void 0,!0),De=So(p.chainId,We),Se=De.nativeSymbol??Le?.currency_symbol??"",tt=De.name??Le?.name??`Chain ID ${p.chainId}`,Ge=ee.useRef({nativeSymbol:Se||void 0,networkName:tt,tokenSymbol:p.symbol});Ge.current={nativeSymbol:Se||void 0,networkName:tt,tokenSymbol:p.symbol};let Fe=ee.useMemo(()=>BigInt(p.quantity.numeric||"0"),[p.quantity.numeric]),wt=ee.useMemo(()=>un(p.quantity.numeric,p.quantity.decimals),[p.quantity.numeric,p.quantity.decimals]),lt=g?.(p),kt=ee.useMemo(()=>{if(lt===void 0)return;let z=parseFloat(S.replace(/,/g,""));return Number.isFinite(z)?z*lt:0},[S,lt]);ee.useEffect(()=>{M(""),j({})},[p.address,p.chainId]),ee.useEffect(()=>{J.current+=1,le(null),te(""),V(!1)},[p.address,p.chainId,T,S]),ee.useEffect(()=>{de(to(r))},[r]);let Pe=ee.useCallback(z=>{N(z),j(ne=>({...ne,recipient:void 0}))},[]),Rt=ee.useCallback(z=>{M(z),j(ne=>({...ne,amount:void 0}))},[]),ct=ee.useCallback(()=>{M(wt.replace(/,/g,"")),j(z=>({...z,amount:void 0}))},[wt]),dt=ee.useCallback(z=>{x(z),l?.(z),ae("token_selected",{tags:{item_id:z.symbol}}),R("recipient")},[l,ae]),Ht=ee.useCallback(()=>R("token"),[]),St=ee.useCallback(()=>{R(z=>{if(z==="result")return"review";if(z===i)return m?.(),z;let ne=gc.indexOf(z);return ne<=0?(m?.(),z):gc[ne-1]})},[i,m]),Be=ee.useCallback(()=>{let{errors:z}=rs({recipient:T,amount:"1",token:p,balanceRaw:Fe});if(z.recipient){j(ne=>({...ne,recipient:z.recipient}));return}j(ne=>({...ne,recipient:void 0})),ae("recipient_entered"),R("amount")},[T,p,Fe,ae]),Xe=ee.useCallback(z=>{N(z),j(ne=>({...ne,recipient:void 0})),ae("recipient_entered"),R("amount")},[ae]),Oe=ee.useCallback(()=>{let z=rs({recipient:T,amount:S,token:p,balanceRaw:Fe});j(z.errors),!(fc(z.errors)||z.rawAmount===void 0||!z.recipient)&&(ce(z.rawAmount),be(z.recipient),le(null),te(""),K("idle"),ae("amount_entered"),R("review"))},[T,S,p,Fe,ae]);ee.useEffect(()=>{if(v!=="review"||!$||fe===null||W!==null||Z||U||!y.canEstimateGas(Le?.rpc))return;let z=++J.current;V(!0),te(""),(async()=>{try{let ne=ns({token:p,walletAddress:r,recipient:$,rawAmount:fe}),Ue=await y.estimateGas(ne,Le?.rpc);if(J.current!==z)return;le(Ue)}catch(ne){if(J.current!==z)return;te(ts(ne,Ge.current,"Failed to estimate gas."))}finally{J.current===z&&V(!1)}})()},[v,$,fe,W,Z,U,y,Le?.rpc,p,r]);let He=ee.useMemo(()=>{if(!fn(p)||!W||fe===null)return!1;let z=Si(W,ki(p.chainId));return z===null?!1:fe+z>Fe},[p,W,fe,Fe]),Ye=ee.useCallback(async()=>{if(!(!$||fe===null)&&!He){G(""),O(""),K("submitting"),ae("submitted");try{let z="",ne=await mc({repository:y,args:ns({token:p,walletAddress:r,recipient:$,rawAmount:fe}),chainId:p.chainId,onSubmitted:Ue=>{z=Ue,O(Ue),K("confirming"),de(Xa(r,$)),d?.({txHash:Ue,chainId:p.chainId,amount:S,tokenSymbol:p.symbol,recipient:$})}});if(ne==="success")K("success"),ae("confirmed"),z&&w?w?.(z):R("result");else if(ne==="reverted"){let Ue="Transaction reverted on-chain.";K("error"),G(Ue),ae("confirmed",{status:"failure",reason:sr(new Error(Ue))}),z&&f?f({txHash:z,chainId:p.chainId,message:Ue}):R("result")}else{let Ue="Transaction receipt was not found. Please check again later.";K("error"),G(Ue),ae("confirmed",{status:"failure",reason:"timeout"}),z&&f?f({txHash:z,chainId:p.chainId,message:Ue}):R("result")}}catch(z){K("error"),ae("confirmed",{status:"failure",reason:sr(z)}),G(ts(z,{nativeSymbol:Se||void 0,networkName:tt,tokenSymbol:p.symbol})),R("result")}}},[y,$,fe,He,p,S,r,d,w,f,Se,tt,ae]),[Lt,Dt]=ee.useState(!1),qe=ee.useRef(void 0);ee.useEffect(()=>()=>clearTimeout(qe.current),[]);let Ct=ee.useCallback(async()=>{if(D)try{await navigator.clipboard.writeText(D),Dt(!0),clearTimeout(qe.current),qe.current=setTimeout(()=>Dt(!1),2e3)}catch{}},[D]),Pt=ee.useCallback(()=>{if(!Ze||!D)return;let z=pt=>{typeof window<"u"&&window.open(pt,"_blank","noopener,noreferrer")};if(!b){z(Ze);return}let ne=b(Ze,{category:"send",origin:"send-transaction",payload:{chainId:p.chainId,txHash:D}});if(ne&&typeof ne.then=="function"){let pt=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null;ne.then(Je=>{if(Je===null){pt?.close();return}let Bt=Je??Ze;if(pt)try{pt.location.href=Bt}catch{pt.close(),z(Bt)}else z(Bt)});return}let Ue=ne;Ue!==null&&z(Ue??Ze)},[b,p.chainId,Ze,D]),Qt=ee.useCallback(()=>{G(""),O(""),K("idle"),le(null),te(""),Te.current.delete("submitted"),Te.current.delete("confirmed"),R("review")},[]);return{step:v,status:L,token:p,tokens:s.length>0?s:[p],recipient:T,amount:S,amountUsd:kt,fieldErrors:P,error:oe,txHash:D,gasEstimate:W,gasLoading:Z,gasError:U,insufficientGas:He,reviewRawAmount:fe,reviewRecipient:$,recentAddresses:Ae,accounts:o,accountName:n,walletAddress:r,resolvedEnv:We,transactionUrl:Ze,networkName:tt,nativeSymbol:Se,nativeDecimals:Le?.currency_decimals??p.quantity.decimals,balanceRaw:Fe,balanceText:wt,priceUsd:lt,canSelectToken:(s.length>0?s:[p]).length>1,canSend:y.canSend,getTokenPriceUsd:g,setRecipient:Pe,setAmount:Rt,setMax:ct,selectToken:dt,goToTokenSelect:Ht,selectRecipient:Xe,submitRecipient:Be,submitAmount:Oe,confirmSend:Ye,retry:Qt,back:St,hashCopied:Lt,copyHash:Ct,openTransaction:Pt}}import*as Lr from"react";import{jsx as Eo,jsxs as os}from"react/jsx-runtime";function bc({flow:e}){let{amount:t,setAmount:r,amountUsd:n,balanceText:o,balanceRaw:i,token:a,setMax:s}=e,l=Lr.useRef(null),c=Lr.useCallback(()=>{requestAnimationFrame(()=>{let f=l.current;if(!f)return;let m=f.value.length;f.setSelectionRange(m,m)})},[]);Lr.useEffect(()=>{l.current?.focus(),c()},[c]),Lr.useEffect(()=>{t===""&&(g(!1),c())},[t,c]);let u=Lr.useMemo(()=>{let f=Bn(t,a.quantity.decimals);return"value"in f&&f.value>i},[t,a.quantity.decimals,i]),[h,g]=Lr.useState(!1),d=!h&&t===""?"0.00":t,w=t.trim()===""||t.trim()==="0";return Eo("div",{className:"sf-body sf-amount",children:os("div",{className:"sf-amount-center",children:[Eo("span",{className:"sf-amount-usd",children:n!==void 0?Ci(n):"\xA0"}),Eo("div",{className:"sf-amount-input-wrap","data-over":u||void 0,"data-empty":w||void 0,onClick:()=>l.current?.focus(),children:Eo("input",{ref:l,className:"sf-amount-input",value:d,onChange:f=>{let m=f.target.value;if(h)r(m);else if(t===""){if(m.length<4)return;g(!0);let b=m.startsWith("0.00")?m.slice(4):m;r(b)}else g(!0),r(m)},placeholder:"0.00",inputMode:"decimal",autoComplete:"off","aria-label":`Amount in ${a.symbol}`,size:1})}),os("div",{className:"sf-amount-balance",children:[Eo("span",{children:"Balance:"}),os("button",{type:"button",className:"sf-amount-max",onClick:s,"data-track":"amount_max",children:[o," ",a.symbol]})]})]})})}import*as Dr from"react";var _m=new Set(["0xff42c13d927a6b9265236619161accb227b6d452","0x9364ea6790f6e0ecfaa5164085f2a7de34ec55fb"].map(e=>e.toLowerCase()));function yc(e){return _m.has(e.toLowerCase())}var wc={cross:"https://contents.crosstoken.io/wallet/token/images/CROSS.svg",bsc:"https://contents.crosstoken.io/wallet/token/images/BSC.svg"};function Ao(e,t){let r=$e[e];if(t===r.cross)return wc.cross;if(t===r.bsc)return wc.bsc}var Gm={dev:"https://dev-portrait.crosstoken.io",stage:"https://dev-portrait.crosstoken.io",production:"https://portrait.crosstoken.io"};function en(e,t,r={}){if(!t||!t.startsWith("0x"))return;let{size:n=120,bg:o,format:i="png"}=r,a=Gm[e],s=o?`&bg=${o}`:"";return`${a}/portrait/evm/${t}.${i}?size=${n}${s}`}import{jsx as mr,jsxs as Ii}from"react/jsx-runtime";function xc({size:e=20,className:t}){return Ii("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[mr("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:"1.7"}),mr("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function vc({size:e=20,className:t}){return mr("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t,"aria-hidden":"true",children:mr("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 kc({size:e=20,className:t}){return Ii("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,"aria-hidden":"true",children:[mr("circle",{cx:"10",cy:"10",r:"10",fill:"currentColor",opacity:"0.12"}),mr("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})}function Rc({size:e=16,className:t}){return mr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,"aria-hidden":"true",children:mr("path",{d:"M8 3v10m0 0 4-4m-4 4-4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Sc({size:e=56,className:t}){return Ii("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[mr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-accent-primary-default, #00b4b7)"}),mr("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 Cc({size:e=56,className:t}){return Ii("svg",{width:e,height:e,viewBox:"0 0 56 56",fill:"none",className:t,"aria-hidden":"true",children:[mr("circle",{cx:"28",cy:"28",r:"28",fill:"var(--ds-system-red-default, #da0b2e)"}),mr("path",{d:"M20 20 36 36m0-16L20 36",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})]})}import{jsx as ht,jsxs as Gr}from"react/jsx-runtime";function Nc(e,t){return e.name||`Account ${(e.index??t)+1}`}function Tc(e){return e.trim().slice(0,1).toUpperCase()||"A"}function Ic(e){return e.toLowerCase()}function Mc({flow:e}){let{recipient:t,setRecipient:r,fieldErrors:n,recentAddresses:o,accounts:i,walletAddress:a,resolvedEnv:s,selectRecipient:l}=e,c=Dr.useMemo(()=>i.filter(p=>p.address.toLowerCase()!==a.toLowerCase()),[i,a]),u=c.length>0,h=Dr.useMemo(()=>new Map(c.map((p,x)=>[Ic(p.address),{account:p,index:x}])),[c]),[g,d]=Dr.useState("recent"),w=Dr.useRef(null);Dr.useEffect(()=>{w.current?.focus()},[]);let f="1A1A2E",m=Dr.useCallback(async()=>{try{let p=await navigator.clipboard.readText();p&&r(p.trim())}catch{}},[r]),b=t.trim().length>0,y=_r(t.trim());return Gr("div",{className:"sf-recipient",children:[Gr("div",{className:"sf-recipient-top",children:[Gr("div",{className:"sf-address-field","data-filled":b||void 0,"data-invalid":n.recipient||void 0,children:[ht("textarea",{ref:w,className:"sf-address-input",value:t,onChange:p=>r(p.target.value),placeholder:"Enter the recipient's address",autoComplete:"off",spellCheck:!1,"aria-label":"Recipient address",rows:b?2:1}),b?ht("button",{type:"button",className:"sf-address-action",onClick:()=>r(""),"aria-label":"Clear","data-track":"recipient_clear",children:ht(kc,{size:20})}):ht("button",{type:"button",className:"sf-address-action",onClick:m,"aria-label":"Paste from clipboard","data-track":"recipient_paste",children:ht(vc,{size:20})})]}),n.recipient&&ht("p",{className:"sf-field-error",role:"alert",children:n.recipient}),Gr("div",{className:"sf-tabs",role:"tablist",children:[ht("button",{type:"button",role:"tab",className:"sf-tab","data-active":g==="recent"||void 0,"aria-selected":g==="recent",onClick:()=>d("recent"),"data-track":"recipient_tab","data-track-id":"recent",children:"Recent"}),u&&ht("button",{type:"button",role:"tab",className:"sf-tab","data-active":g==="account"||void 0,"aria-selected":g==="account",onClick:()=>d("account"),"data-track":"recipient_tab","data-track-id":"account",children:"My Account"})]})]}),ht("div",{className:"sf-address-list",children:g==="account"&&u?c.map((p,x)=>{let v=Nc(p,x),R=en(s,p.address,{size:56,bg:f});return Gr("button",{type:"button",className:"sf-address-row",onClick:()=>l(p.address),"data-track":"recipient_item",children:[Gr("span",{className:"sf-address-avatar",children:[R&&ht("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:T=>{T.currentTarget.style.display="none"}}),ht("span",{className:"sf-address-avatar-fallback",children:Tc(v)})]}),Gr("span",{className:"sf-address-meta",children:[ht("span",{className:"sf-address-name",children:v}),ht("span",{className:"sf-address-value",children:Ft(p.address)})]})]},p.address)}):o.length>0?o.map(p=>{let x=h.get(Ic(p.address)),v=x?Nc(x.account,x.index):Ft(p.address),R=en(s,p.address,{size:56,bg:f});return Gr("button",{type:"button",className:"sf-address-row",onClick:()=>l(p.address),"data-track":"recipient_item",children:[Gr("span",{className:"sf-address-avatar",children:[R&&ht("img",{src:R,alt:"",width:40,height:40,draggable:!1,onError:T=>{T.currentTarget.style.display="none"}}),ht("span",{className:"sf-address-avatar-fallback",children:Tc(v)})]}),Gr("span",{className:"sf-address-meta",children:[ht("span",{className:"sf-address-name",children:v}),ht("span",{className:"sf-address-value",children:Ft(p.address)})]})]},p.address)}):ht("div",{className:"sf-empty",children:"No send history"})}),b&&!y&&!n.recipient&&ht("p",{className:"sf-field-error",role:"alert",children:"Enter a valid EVM recipient address."})]})}import{jsx as qt,jsxs as no}from"react/jsx-runtime";function Ac({flow:e}){let{status:t,txHash:r,error:n,copyHash:o,hashCopied:i,openTransaction:a}=e,s=t==="error",l=t==="success";return s?no("div",{className:"sf-body sf-result sf-result--error",children:[qt("span",{className:"sf-result-icon",children:qt(Cc,{size:56})}),no("div",{className:"sf-result-copy",children:[qt("h3",{className:"sf-result-title",children:"Transaction Failed"}),qt("p",{className:"sf-result-desc",children:n||"Something went wrong. Please try again."})]}),r&&qt(Ec,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]}):no("div",{className:"sf-body sf-result",children:[qt("span",{className:"sf-result-icon","data-pending":!l||void 0,children:l?qt(Sc,{size:56}):qt("span",{className:"sf-result-spinner"})}),no("div",{className:"sf-result-copy",children:[qt("h3",{className:"sf-result-title",children:l?"Transaction Complete":"Transaction in Progress"}),qt("p",{className:"sf-result-desc",children:l?"Your transfer was sent successfully.":"Transfer in progress. Waiting for confirmation."})]}),r&&qt(Ec,{txHash:r,hashCopied:i,onCopy:o,onOpen:a})]})}function Ec({txHash:e,hashCopied:t,onCopy:r,onOpen:n}){return no("div",{className:"sf-result-hash-card",children:[qt("span",{className:"sf-result-hash-label",children:"Transaction Hash"}),no("div",{className:"sf-result-hash-row",children:[qt("button",{type:"button",className:"sf-result-hash-link",onClick:n,"aria-label":"Open transaction in explorer","data-track":"tx_link_open",children:Ft(e)}),qt("button",{type:"button",className:"sf-result-copy-btn",onClick:r,"aria-label":"Copy transaction hash","data-track":"tx_hash_copy",children:t?qt(Jr,{size:16}):"Copy"})]})]})}import{jsx as rt,jsxs as Kt}from"react/jsx-runtime";var Mi="\u2014";function Lc({flow:e}){let{token:t,reviewRawAmount:r,reviewRecipient:n,accountName:o,accounts:i,walletAddress:a,networkName:s,nativeSymbol:l,nativeDecimals:c,gasEstimate:u,gasLoading:h,gasError:g,insufficientGas:d,error:w,resolvedEnv:f}=e,m=fn(t),b=r!==null?vi(r,t.quantity.decimals):"",y=o?.trim()||`Account ${(i[0]?.index??0)+1}`,p=en(f,a,{size:56,bg:"1A1A2E"}),x=l||(m?t.symbol:""),v=ki(t.chainId),R=u?lc(u,v):null,T=u?Si(u,v):null,N=L=>L!==null&&x?`${es(L,c)} ${x}`:Mi,S=L=>L!==void 0?`${ac(L)} Gwei`:Mi,M=(()=>{if(!m||!u||T===null||r===null)return Mi;let L=r+T;return`${es(L,c)} ${x||t.symbol}`})(),P=L=>h?"\u2026":L,j=[{label:"Est. Tx Fee",value:P(N(T))},...R==="dynamic"?[{label:"Max Priority Fee",value:P(S(u?.maxPriorityFeePerGas))},{label:"Max Gas Fee",value:P(S(u?.maxFeePerGas))}]:R==="legacy"?[{label:"Gas Price",value:P(S(u?Ri(u):void 0))}]:[],{label:"Gas Limit",value:P(u?sc(u.gasLimit):Mi)}];return Kt("div",{className:"sf-body sf-review",children:[Kt("div",{className:"sf-review-amount",children:[rt("img",{className:"sf-review-amount-icon",src:t.icon_url,alt:"",width:40,height:40,draggable:!1,onError:L=>{L.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Kt("span",{className:"sf-review-amount-value",children:[b,rt("span",{className:"sf-review-amount-symbol",children:t.symbol})]})]}),Kt("div",{className:"sf-review-parties",children:[Kt("div",{className:"sf-review-card sf-review-party",children:[rt("span",{className:"sf-review-party-label",children:"From"}),Kt("div",{className:"sf-review-party-head",children:[rt("span",{className:"sf-review-party-avatar",children:p&&rt("img",{src:p,alt:"",width:28,height:28,draggable:!1,onError:L=>{L.currentTarget.style.display="none"}})}),rt("span",{className:"sf-review-party-name",children:y})]}),rt("span",{className:"sf-review-party-addr",children:a})]}),rt("span",{className:"sf-review-arrow","aria-hidden":!0,children:rt(Rc,{size:16})}),Kt("div",{className:"sf-review-card sf-review-party",children:[rt("span",{className:"sf-review-party-label",children:"To"}),rt("span",{className:"sf-review-party-addr",children:n})]})]}),Kt("section",{className:"sf-review-card",children:[rt("h3",{className:"sf-review-section-title",children:"Summary"}),Kt("div",{className:"sf-review-row",children:[rt("span",{className:"sf-review-row-label",children:"Network"}),rt("span",{className:"sf-review-row-value",children:s})]}),j.map(L=>Kt("div",{className:"sf-review-row",children:[rt("span",{className:"sf-review-row-label",children:L.label}),rt("span",{className:"sf-review-row-value",children:L.value})]},L.label))]}),Kt("section",{className:"sf-review-card",children:[rt("h3",{className:"sf-review-section-title",children:"Total"}),Kt("div",{className:"sf-review-row",children:[rt("span",{className:"sf-review-row-label",children:"Total Amount"}),Kt("span",{className:"sf-review-row-value",children:[b," ",t.symbol]})]}),m&&Kt("div",{className:"sf-review-row",children:[rt("span",{className:"sf-review-row-label",children:"Max. Total Amount"}),rt("span",{className:"sf-review-row-value",children:P(M)})]})]}),d&&!g&&!w&&Kt("div",{className:"sf-message sf-message--error",role:"alert",children:["Not enough ",x||t.symbol," to cover the amount plus the network fee. Reduce the amount and try again."]}),(g||w)&&rt("div",{className:"sf-message sf-message--error",role:"alert",children:g||w})]})}import*as Ei from"react";import{jsx as mn,jsxs as zn}from"react/jsx-runtime";function Dc({flow:e}){let[t,r]=Ei.useState(""),n=t.trim().toLowerCase(),o=Ei.useMemo(()=>n?e.tokens.filter(i=>i.symbol.toLowerCase().includes(n)||i.name.toLowerCase().includes(n)):e.tokens,[e.tokens,n]);return zn("div",{className:"sf-body sf-token-select",children:[zn("div",{className:"sf-search",children:[mn(xc,{size:20}),mn("input",{className:"sf-search-input",value:t,onChange:i=>r(i.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1,"aria-label":"Search tokens"})]}),zn("div",{className:"sf-token-list",children:[o.map(i=>{let a=`${i.chainId}:${i.address.toLowerCase()}`,s=Ao(e.resolvedEnv,i.chainId),l=e.getTokenPriceUsd?.(i);return zn("button",{type:"button",className:"sf-token-row",onClick:()=>e.selectToken(i),"data-track":"token_item","data-track-id":i.symbol,children:[zn("span",{className:"sf-token-left",children:[zn("span",{className:"sf-token-icon-wrap",children:[mn("img",{className:"sf-token-icon",src:i.icon_url,alt:"",width:40,height:40,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),s&&mn("img",{className:"sf-token-chain-badge",src:s,alt:"","aria-hidden":!0,width:16,height:16,loading:"lazy",draggable:!1,onError:c=>{c.currentTarget.style.display="none"}})]}),mn("span",{className:"sf-token-name",children:i.symbol})]}),zn("span",{className:"sf-token-right",children:[mn("span",{className:"sf-token-balance",children:un(i.quantity.numeric,i.quantity.decimals)}),l!==void 0&&mn("span",{className:"sf-token-price",children:Ci(l)})]})]},a)}),o.length===0&&mn("div",{className:"sf-empty",children:"No tokens found"})]})]})}ie(`.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff}.sf-btn--primary:hover:not(:disabled):not([data-disabled]){filter:brightness(1.05)}.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-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));color:#fff;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-system-orange-default, #f0640d)}.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-system-orange-default, #f0640d)}.sf-address-field[data-filled]{border-color:var(--ds-system-orange-default, #f0640d)}.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-system-orange-high, #e56f00)}.sf-tab[data-active]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:9999px;background:var(--ds-system-orange-high, #e56f00)}.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-system-orange-default, #f0640d);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-system-orange-high, #e56f00)}.sf-result-copy-btn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:28px;padding:0 10px;border:1px solid var(--ds-border-default, rgba(0, 0, 0, .07));border-radius:8px;background:var(--ds-surface-default, #ffffff);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500;color:var(--ds-content-high, rgba(0, 0, 0, .85))}
|
|
7
|
+
`);import{jsx as yt,jsxs as Ai}from"react/jsx-runtime";var Hm={token:"Send",recipient:"Send",amount:"Send",review:"Sign Transaction",result:""};function Li({onClose:e,onBackToWallet:t,onConfirmSuccess:r,onSuccess:n,className:o,...i}){let a=Pc.useCallback(b=>{n?.(b),r?.(b)},[r,n]),l=hc({...i,onSuccess:n||r?a:void 0,onExit:t}),{step:c,status:u}=l,h=_r(l.recipient.trim()),g=Bn(l.amount,l.token.quantity.decimals),d="value"in g&&g.value<=l.balanceRaw,w=u==="submitting"||u==="confirming",f=c!=="result",m=Hm[c]??"";return yt(pe,{feature:"send",children:Ai("div",{className:xe("sf-root",o),"data-step":c,children:[Ai("header",{className:"sf-header",children:[f?yt("button",{type:"button",className:"sf-header-btn",onClick:l.back,"aria-label":"Back","data-track":"back",children:yt($r,{size:24})}):yt("span",{className:"sf-header-btn","aria-hidden":!0}),yt("span",{className:"sf-header-title",children:m}),yt("button",{type:"button",className:"sf-header-btn",onClick:e,"aria-label":"Close","data-track":"close",children:yt(fr,{size:24})})]}),c==="token"&&yt(Dc,{flow:l}),c==="recipient"&&yt(Mc,{flow:l}),c==="amount"&&yt(bc,{flow:l}),c==="review"&&yt(Lc,{flow:l}),c==="result"&&yt(Ac,{flow:l}),Ai("footer",{className:"sf-footer","data-step":c,children:[c==="recipient"&&yt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitRecipient,"data-disabled":!h||void 0,"aria-disabled":!h,"data-track":"recipient_next",children:"Next"}),c==="amount"&&yt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.submitAmount,"data-disabled":!d||void 0,"aria-disabled":!d,"data-track":"amount_next",children:"Next"}),c==="review"&&Ai("div",{className:"sf-footer-row",children:[yt("button",{type:"button",className:"sf-btn sf-btn--secondary",onClick:l.back,disabled:w,"data-track":"review_cancel",children:"Cancel"}),yt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.confirmSend,disabled:w||!l.canSend||l.insufficientGas,"data-track":"review_send",children:w?"Sending...":"Send"})]}),c==="result"&&u==="success"&&yt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:()=>r?.(l.txHash||void 0),"data-track":"result_ok",children:"All done"}),c==="result"&&u==="error"&&yt("button",{type:"button",className:"sf-btn sf-btn--primary",onClick:l.retry,"data-track":"result_retry",children:"Try Again"})]})]})})}import*as Bc from"@radix-ui/react-popover";import{Drawer as Qm}from"vaul";import{jsx as Di,jsxs as Vm}from"react/jsx-runtime";function zc({asChild:e,className:t,children:r}){let{isMobile:n,theme:o,walletAddress:i}=pn(),a=r!=null,s=e??!0,l=a?r:Vm("button",{type:"button",className:xe("wi-trigger-btn",t),"data-theme":o,"data-mobile":n||void 0,children:[Di(Gl,{size:n?14:16}),Di("span",{className:"wi-trigger-address",children:Ft(i)})]});return n?Di(Qm.Trigger,{asChild:s,children:l}):Di(Bc.Trigger,{asChild:s,children:l})}import*as X from"react";import*as na from"@radix-ui/react-popover";import{Drawer as ra}from"vaul";import jo from"bignumber.js";import{useQueries as Ym}from"@tanstack/react-query";import{useMemo as qm}from"react";var is="user-balance";async function Km(e,t,r,n){let o=new URLSearchParams({networkId:`eip155:${t}`,account:r}),i=await fetch(`${e}/v1/public/token/balance?${o}`,{cache:"no-store",signal:n});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 gn(e,t,r=!0){let n=$e[e],o=[n.cross,n.bsc],i=Ym({queries:o.map(c=>({queryKey:[is,e,t,c],queryFn:async({signal:u})=>Km(await we("walletServer",e),c,t,u),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1}))}),a=i.some(c=>c.isLoading),s=i.some(c=>c.isError);return{tokens:qm(()=>{let c=[];for(let u of i)u.data&&c.push(...u.data);return c},[i]),isLoading:a,isError:s}}import{useQuery as Zm,useQueries as Xm}from"@tanstack/react-query";import{useMemo as Jm}from"react";var $m="forge-holdings",eg="forge-token-image";async function tg(e,t,r){let n=await fetch(`${e}/v1/users/${t}/holdings`,{cache:"no-store",signal:r});if(!n.ok)throw new Error(`Failed to fetch forge holdings: ${n.status}`);let o=await n.json();if(!o.success)throw new Error("Forge holdings API error");return o.data.items}async function rg(e,t,r){let n=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store",signal:r});if(!n.ok)return{address:t,image_url:""};let o=await n.json();return o.success?{address:t,image_url:o.data.token.image_url}:{address:t,image_url:""}}function Oc(e,t,r=!0){let{data:n,...o}=Zm({queryKey:[$m,e,t],queryFn:async({signal:i})=>tg(await we("bondingCurve",e),t,i),enabled:!!t&&r,staleTime:0,refetchInterval:r?5e3:!1});return{holdings:n??[],...o}}function Fc(e,t,r=!0){let n=Xm({queries:t.map(i=>({queryKey:[eg,e,i],queryFn:async({signal:a})=>rg(await we("bondingCurve",e),i,a),enabled:r,staleTime:1/0}))});return{imageMap:Jm(()=>{let i=new Map;for(let a of n)a.data&&i.set(a.data.address,a.data.image_url);return i},[n])}}import{useQuery as ng}from"@tanstack/react-query";import{useMemo as og}from"react";var as="token-stats";function gr(e,t){return`${e}:${t.toLowerCase()}`}function hn(e,t=!0){let{data:r,...n}=ng({queryKey:[as,e],queryFn:async({signal:i})=>{let a=await we("walletServer",e),s=await fetch(`${a}/v1/public/token/stats`,{cache:"no-store",signal:i});if(!s.ok)throw new Error(`Failed to fetch token stats: ${s.status}`);let l=await s.json();if(l.code!==200)throw new Error(`Token stats API error: ${l.code}`);return l},enabled:t,staleTime:3e4});return{statsMap:og(()=>{let i=new Map;if(!r?.data)return i;for(let a of r.data){let s=gr(a.chain_id,a.address);i.set(s,a)}return i},[r]),...n}}import{useQuery as ig}from"@tanstack/react-query";var ag="crossd-apr",sg="https://crossd-dashboard-api.crossdefi.io/api/v1/overview";function Uc(){let{data:e,...t}=ig({queryKey:[ag],queryFn:async({signal:r})=>{let n=await fetch(sg,{cache:"no-store",signal:r});if(!n.ok)throw new Error(`Failed to fetch CROSSD overview: ${n.status}`);let o=await n.json();if(o.code!==200)throw new Error(`CROSSD overview API error: ${o.code}`);let i=parseFloat(o.data.est_last_epoch_apy);if(!Number.isFinite(i))throw new Error("CROSSD overview returned a non-numeric APR");return i*100},staleTime:6e4});return{aprPercent:e??null,...t}}import{useQuery as lg}from"@tanstack/react-query";import{useMemo as jc}from"react";var cg="token-info";function Lo(e,t){return`${t.toLowerCase()}_${e}`}function Wc(e,t=!0){let{data:r,...n}=lg({queryKey:[cg,e],queryFn:async({signal:a})=>{let s=await we("walletServer",e),l=await fetch(`${s}/v1/public/token/info`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch token info: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Token info API error: ${c.code}`);return c},enabled:t,staleTime:1/0}),o=jc(()=>{let a=new Map;if(!r?.data)return a;for(let s of r.data){let l=Lo(s.chain_id,s.address);a.set(l,s.category)}return a},[r]),i=jc(()=>{let a=new Map;if(!r?.data)return a;for(let s of r.data)a.set(Lo(s.chain_id,s.address),s);return a},[r]);return{categoryMap:o,infoMap:i,...n}}import{useMemo as dg}from"react";import ss from"bignumber.js";function _c(e,t,r){let{tokens:n,isLoading:o}=gn(e,t,r),{statsMap:i}=hn(e,r);return dg(()=>{let a=new ss(0);for(let u of n){let h=i.get(gr(u.chainId,u.address));if(!h)continue;let d=new ss(u.quantity.numeric).shiftedBy(-u.quantity.decimals).multipliedBy(new ss(h.price));d.isNaN()||(a=a.plus(d))}let s=a.toFixed(),{displayValue:l,isLowerBound:c}=$l(s);return{totalUsd:s,displayValue:l,isLowerBound:c,isLoading:o}},[n,i,o])}import{QRCodeSVG as Nb}from"qrcode.react";function bt(e,t,r,n){if(!n||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;e.preventDefault();let o;try{o=n(t,r)}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")(o)){let c=typeof window<"u"?window.open("","_blank","noopener,noreferrer"):null,u=h=>{if(h===null){c?.close();return}let g=h??t;if(c)try{c.location.href=g}catch{c.close(),i(g)}else i(g)};o.then(u,h=>{console.error("[dapp-ui] onOutlink rejected:",h),c?.close()});return}let s=o;if(s===null)return;i(s??t)}import*as Un from"react";import{Drawer as s0}from"vaul";import{createContext as mg,useContext as gg,useMemo as hg}from"react";import hr from"bignumber.js";var pg=/^(\d{4}-\d{2}-\d{2})/;function Gc(e){if(!e||e.length===0)return;let t=new Map,r;for(let{key:o,cumulative:i}of e.map(a=>({key:pg.exec(a.reference_date)?.[1],cumulative:a.cumulative_earned})).filter(a=>!!a.key&&a.cumulative!=null).sort((a,s)=>a.key<s.key?-1:a.key>s.key?1:0))t.set(o,i),r=o;if(r===void 0)return;let n=new Date().toISOString().slice(0,10);return t.get(n)??t.get(r)}function Pi(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Bi(e){return e.length<=13?e:`${e.slice(0,6)}...${e.slice(-4)}`}function Do(e,t){let r=e.length+t.length;if(r>32)return"xs";if(r>24)return"sm"}function ls(e){return e?.toUpperCase()==="WONE"?"ONE":e}var ug=["Request Arguments:","Details:","Docs:","Version:","Contract Call:"];function Po(e,t){console.error("[wallet-portfolio] withdraw failed:",e);let n=e instanceof Error?e.message:"";for(let i of ug){let a=n.indexOf(i);a>=0&&(n=n.slice(0,a))}return n.split(`
|
|
8
|
+
`).map(i=>i.trim()).find(i=>i.length>0)||t}var fg="0xe00e8bf3";function Hc(e,t){let r=typeof e=="bigint"?e:BigInt(e);if(r<0n)throw new Error("poolId must be non-negative");if(t<0n)throw new Error("amount must be non-negative");let n=r.toString(16).padStart(64,"0"),o=t.toString(16).padStart(64,"0");return`${fg}${n}${o}`}function oo(e){return!e||e<=0n?"0":new hr(e.toString()).shiftedBy(-9).toFormat(2,hr.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function zi(e){return!e||e<=0n?"0":new hr(e.toString()).toFormat(0,hr.ROUND_DOWN)}function Oi(e){if(!e||e<=0n)return"0";let t=new hr(e.toString()).shiftedBy(-18),r=t.isLessThan(1e-4)?7:4;return t.toFormat(r,hr.ROUND_DOWN).replace(/(\.\d*?[1-9])0+$/,"$1").replace(/\.0+$/,"")}function Hr(e,t){let r=new hr(e).shiftedBy(-t);return!r.isFinite()||r.isZero()?"0":r.isGreaterThanOrEqualTo(1)?r.toFormat(2,hr.ROUND_DOWN):r.toFormat(4,hr.ROUND_DOWN)}function cs(e){return Hr(e,0)}var Bo={rate:1,symbol:"$"};function On(e,t=Bo){let r=Number.isFinite(t.rate)&&t.rate>0?t.rate:1;return`${t.symbol||"$"}${e.times(r).toFormat(2,hr.ROUND_DOWN)}`}function bn(e,t,r,n=Bo){let o=new hr(r||"0");if(!o.isFinite()||o.isLessThanOrEqualTo(0))return null;let i=new hr(e||"0").shiftedBy(-t).times(o);return i.isFinite()?On(i,n):null}var zo=mg(null);function nt(){let e=gg(zo);if(!e)throw new Error("WalletPortfolio compound components must be used within <WalletPortfolio>");return e}function br(){let{conversionRatio:e,currencySymbol:t}=nt();return hg(()=>({rate:typeof e=="number"&&e>0?e:Bo.rate,symbol:t||Bo.symbol}),[e,t])}import{Drawer as bg}from"vaul";import{jsx as Qc}from"react/jsx-runtime";function Vc({asChild:e,children:t}){let{walletAddress:r}=nt(),n=t!=null,o=e??!0,i=n?t:Qc("button",{type:"button",children:Ft(r)});return Qc(bg.Trigger,{asChild:o,children:i})}import{Drawer as qi}from"vaul";import*as it from"react";import{useQueryClient as o0}from"@tanstack/react-query";import{createContext as wg,useContext as yg}from"react";var ds=wg(null);function Yc(){return yg(ds)}import{jsx as cr,jsxs as Wi}from"react/jsx-runtime";function qc({size:e=22,className:t}){return cr("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:cr("path",{d:"M14 4L7 11L14 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})}function Kc({size:e=22,className:t}){return Wi("svg",{width:e,height:e,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[cr("path",{d:"M18.333 3.667v5.5h-5.5",stroke:"currentColor",strokeWidth:1.833,strokeLinecap:"round",strokeLinejoin:"round"}),cr("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 Fi({size:e=16,className:t}){return Wi("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[cr("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"}),cr("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 Ui({size:e=16,className:t}){return cr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:cr("path",{d:"M13.333 4L6 11.333 2.667 8",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function ji({size:e=48,className:t}){return Wi("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[cr("circle",{cx:"24",cy:"24",r:"24",fill:"currentColor"}),cr("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 dr({size:e=12,className:t}){return Wi("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:[cr("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"}),cr("path",{d:"M7 1H11V5",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),cr("path",{d:"M11 1L6 6",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})]})}import{useQuery as xg}from"@tanstack/react-query";import{useMemo as Zc}from"react";var vg="wp:reward-pools";function io(e,t=!0){let{data:r,...n}=xg({queryKey:[vg,e],queryFn:async({signal:a})=>{let s=await we("gameReward",e),l=await fetch(`${s}/v1/pools`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Failed to fetch pools: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Pools API error: ${c.code}`);return c},enabled:t,staleTime:0}),o=Zc(()=>r?.data.pools.filter(a=>a.pool_type==="CrossPool")??[],[r]),i=Zc(()=>r?.data.pools.filter(a=>a.pool_type==="GamePool")??[],[r]);return{crossPools:o,gamePools:i,allPools:r?.data.pools??[],...n}}import{useQuery as kg}from"@tanstack/react-query";import{useMemo as Rg}from"react";var Sg="wp:user-deposits";function _i(e,t,r=!0){let n=r&&!!t,{data:o,...i}=kg({queryKey:[Sg,e,t],queryFn:async({signal:s})=>{let l=await we("gameReward",e),c=await fetch(`${l}/v1/users/${t}/deposits`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Deposits fetch failed: ${c.status}`);let u=await c.json();if(u.code!==200)throw new Error(`Deposits API error: ${u.code}`);return u},enabled:n,staleTime:0});return{depositMap:Rg(()=>{let s=new Map;if(!o?.data.user_deposits)return s;for(let l of o.data.user_deposits)s.set(l.pool_address.toLowerCase(),l);return s},[o]),deposits:o?.data.user_deposits??[],...i}}import{useQuery as Cg}from"@tanstack/react-query";import{useMemo as Ng}from"react";var Xc={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},Jc={dev:"https://stg.onechain.nexus/points",stage:"https://stg.onechain.nexus/points",production:"https://www.onechain.nexus/points"};var $c={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"};var ps={dev:"https://dev-stake.ogfcorp.com",stage:"https://stg-stake.ogfcorp.com",production:"https://stake.ogfcorp.com"},ed={dev:`${ps.dev}/portfolio`,stage:`${ps.stage}/portfolio`,production:`${ps.production}/portfolio`};var td={dev:"https://stg.onechain.nexus",stage:"https://stg.onechain.nexus",production:"https://onechain.nexus"},wr={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"},Gi={dev:"https://stg-swap-api.crossdefi.io",stage:"https://stg-swap-api.crossdefi.io",production:"https://swap-api.crossdefi.io"},rd={dev:"https://stg.crossdefi.io",stage:"https://stg.crossdefi.io",production:"https://www.crossdefi.io"},nd={dev:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",stage:"0x1Fa8C0bc5B754E82d55D60f0d6151903FD995b1B",production:"0xEFd871aF7D695A0c1709e46b565761F4cd1Ef5ba"},od={dev:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",stage:"0xda37a3B60E6b97E8CB44b460130d40331efc566b",production:"0x731a104a4461ae45bfef520468b43c262d35e682"};var Tg="wp:token-info",Ig="0x0000000000000000000000000000000000000001";function Qr(e,t=!0){let r=$e[e].cross,{data:n,...o}=Cg({queryKey:[Tg,e],queryFn:async({signal:u})=>{let h=await we("walletServer",e),g=await fetch(`${h}/v1/public/token/info`,{cache:"no-store",signal:u});if(!g.ok)throw new Error(`Failed to fetch token info: ${g.status}`);let d=await g.json();if(d.code!==200)throw new Error(`Token info API error: ${d.code}`);return d},enabled:t,staleTime:300*1e3}),{byChainAddr:i,byChainSym:a}=Ng(()=>{let u=new Map,h=new Map;if(!n?.data)return{byChainAddr:u,byChainSym:h};for(let g of n.data){let d=g.address.toLowerCase();u.set(`${g.chain_id}:${d}`,g),u.set(d,g);let w=g.symbol.replace(/^t/,"").toUpperCase(),f=`${g.chain_id}:${w}`;h.has(f)||h.set(f,g),h.has(w)||h.set(w,g)}return{byChainAddr:u,byChainSym:h}},[n]);return{getTokenImage:(u,h,g)=>{let d=u.toLowerCase(),w=!!g?.chainOnly,f=i.get(`${r}:${d}`);if(f?.image)return f.image;if(!w){let m=i.get(d);if(m?.image)return m.image}if(h){let m=h.replace(/^t/,"").toUpperCase(),b=a.get(`${r}:${m}`);if(b?.image)return b.image;if(!w){let y=a.get(m);if(y?.image)return y.image}}return""},getTokenSymbol:(u,h,g)=>{let d=u.toLowerCase();return(i.get(`${r}:${d}`)??(g?.chainOnly?void 0:i.get(d)))?.symbol||h},getNativeToken:()=>i.get(`${r}:${Ig}`),...o}}import*as fs from"react";import{jsx as us,jsxs as id}from"react/jsx-runtime";function yr({sectionKey:e,title:t,icon:r,iconFit:n="cover",isEmpty:o,loading:i=!1,children:a}){let s=Yc();return fs.useEffect(()=>{s?.report(e,{loading:i,empty:o})},[s,e,i,o]),fs.useEffect(()=>()=>s?.unregister(e),[s,e]),o?null:id("div",{className:"wp-svc-card",children:[id("div",{className:"wp-svc-card-head",children:[us("img",{className:"wp-svc-card-icon",src:r,alt:"",style:{objectFit:n}}),us("span",{className:"wp-svc-card-title",children:t})]}),us("div",{className:"wp-svc-items",children:a})]})}import ms from"bignumber.js";import{jsx as Ut,jsxs as Zt}from"react/jsx-runtime";var Mg="ONErewards";function Eg(e){return new ms(e||"0").isGreaterThan(0)}function ad(){let{env:e,walletAddress:t,onOutlink:r}=nt(),n=br(),o=!!t,{allPools:i,isLoading:a}=io(e,o),{depositMap:s,isLoading:l}=_i(e,t,o),{getTokenImage:c}=Qr(e,o),u=(d,w)=>`${Xc[e]}/gametoken/tokens/${d.deposit_token.address}?mode=rewards${w==="withdraw"?"&trade=withdraw":""}`,h=`${wr[e]}/reward.png`,g=i.filter(d=>{let w=s.get(d.pool_address.toLowerCase()),f=w?.deposited_amount??"0",m=w?.claimable_reward??"0";return!(new ms(f).isZero()&&new ms(m).isZero())});return Ut(yr,{sectionKey:"rewards",title:Mg,icon:h,isEmpty:g.length===0,loading:a||l,children:g.map(d=>{let w=s.get(d.pool_address.toLowerCase()),f=w?.deposited_amount??"0",m=w?.claimable_reward??"0",b=u(d,"withdraw"),y=u(d,"claim"),p=c(d.deposit_token.address,d.deposit_token.symbol),x=d.reward_tokens[0],v=x?c(x.address,x.symbol):"",R=d.reward_tokens.map(L=>L.symbol),T=R.length>0?`${d.deposit_token.symbol}-${R.join("/")}`:d.deposit_token.symbol,N=x?Hr(m,x.decimals):"0",S=x?.symbol??"Reward",M=bn(f,d.deposit_token.decimals,d.deposit_token.price,n),P=x?bn(m,x.decimals,x.price,n):null,j=!!w&&Eg(m);return Zt("article",{className:"wp-item","data-side":"reward",children:[Zt("div",{className:"wp-item-body",children:[Zt("div",{className:"wp-item-line",children:[Ut("span",{className:"wp-item-label",children:"Pool (Deposit - Earn)"}),Zt("div",{className:"wp-svc-token",children:[Zt("span",{className:"wp-token-stack","aria-hidden":!0,children:[p&&Ut("img",{className:"wp-svc-token-icon",src:p,alt:""}),v&&Ut("img",{className:"wp-svc-token-icon",src:v,alt:""})]}),Ut("span",{children:T})]})]}),Zt("div",{className:"wp-item-line",children:[Ut("span",{className:"wp-item-label",children:"Deposited"}),Zt("div",{className:"wp-svc-token wp-svc-token--amount",children:[p&&Ut("img",{className:"wp-svc-token-icon",src:p,alt:""}),Zt("div",{className:"wp-svc-amount",children:[Ut("span",{className:"wp-svc-amount-main",children:Hr(f,d.deposit_token.decimals)}),M&&Ut("span",{className:"wp-item-usd",children:M})]})]})]}),Zt("div",{className:"wp-item-line",children:[Zt("span",{className:"wp-item-label",children:["Claimable (",S,")"]}),Zt("div",{className:"wp-svc-token wp-svc-token--amount",children:[v&&Ut("img",{className:"wp-svc-token-icon",src:v,alt:""}),Zt("div",{className:"wp-svc-amount",children:[Ut("span",{className:"wp-svc-amount-main",children:N}),P&&Ut("span",{className:"wp-item-usd",children:P})]})]})]})]}),Zt("div",{className:"wp-item-tags",children:[Zt("a",{className:"wp-tag wp-tag--muted",href:b,target:"_blank",rel:"noopener noreferrer","data-track":"rewards_withdraw_open",onClick:L=>bt(L,b,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:w}},r),children:[Ut("span",{className:"wp-tag-label",children:"Withdraw"}),Ut(dr,{size:12,className:"wp-tag-icon"})]}),Zt("a",{className:"wp-tag wp-tag--mint","data-disabled":!j||void 0,"aria-disabled":!j||void 0,href:j?y:void 0,target:j?"_blank":void 0,rel:j?"noopener noreferrer":void 0,onClick:L=>{if(!j){L.preventDefault();return}bt(L,y,{category:"portfolio",origin:"portfolio-rewards",payload:{pool:d,userDeposit:w}},r)},children:[Ut("span",{className:"wp-tag-label",children:"Claim"}),Ut(dr,{size:12,className:"wp-tag-icon"})]})]})]},d.pool_address)})})}import*as md from"react";import{useQuery as Fg}from"@tanstack/react-query";import{useMemo as Hi}from"react";var Ag="0x70a08231",Lg="0x18160ddd",Dg="0x313ce567",Pg=8e3;async function Bg(e,t,r,n){let o=new AbortController,i=setTimeout(()=>o.abort(),Pg);n&&n.addEventListener("abort",()=>o.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:r}),signal:o.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw new Error(`RPC ${t} HTTP ${a.status}`);let s=await a.json();if(s.error)throw new Error(`RPC ${t}: ${s.error.message}`);if(s.result===void 0)throw new Error(`RPC ${t}: empty result`);return s.result}function zg(e){return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function Oo(e){if(!(!e||e==="0x"))try{return BigInt(e)}catch{return}}async function tn(e,t,r,n,o){try{return await Bg(e,"eth_call",[o?{from:o,to:t,data:r}:{to:t,data:r},"latest"],n)}catch{return}}async function Og(e,t,r,n){let[o,i,a]=await Promise.all([tn(e,r,Ag+zg(t),n),tn(e,r,Lg,n),tn(e,r,Dg,n)]),s=Oo(o);if(s===void 0)return null;let l=Oo(a);return{balance:s,totalSupply:Oo(i),decimals:l!==void 0?Number(l):void 0}}async function Fo(e,t){let r=$e[e].cross,n=await we("walletServer",e),o=await fetch(`${n}/v1/public/chain/info/${r}`,{cache:"no-store",signal:t});if(!o.ok)return;let i=await o.json();return("data"in i&&i.data!==void 0?Array.isArray(i.data)?i.data[0]:i.data:i)?.rpc||void 0}async function sd(e,t,r,n){if(!t||r.length===0)return{};let o;try{o=await Fo(e,n)}catch{o=void 0}if(!o)return{};let i=await Promise.all(r.map(async s=>[s.toLowerCase(),await Og(o,t,s,n)])),a={};for(let[s,l]of i)l&&(a[s]=l);return a}var Ug="wp:withdraw-token-meta",jg="0xc89039c5",Wg="0x95d89b41",_g="0x313ce567";function Gg(e){if(!(!e||e==="0x"))try{let t=e.replace(/^0x/,""),r=Number(BigInt("0x"+t.slice(64,128)));if(!Number.isFinite(r)||r<=0||r>64)return;let n=t.slice(128,128+r*2),o="";for(let i=0;i<n.length;i+=2)o+=String.fromCharCode(parseInt(n.slice(i,i+2),16));return o||void 0}catch{return}}function Hg(e){if(!e||e==="0x")return;let r="0x"+e.replace(/^0x/,"").padStart(64,"0").slice(24,64);return/^0x[a-f0-9]{40}$/.test(r)&&r!=="0x0000000000000000000000000000000000000000"?r:void 0}async function Qg(e,t,r){if(t.length===0)return{};let n;try{n=await Fo(e,r)}catch{n=void 0}if(!n)return{};let o=await Promise.all(t.map(async a=>{let s=Hg(await tn(n,a,jg,r));if(!s)return[a.toLowerCase(),null];let[l,c]=await Promise.all([tn(n,s,Wg,r),tn(n,s,_g,r)]),u=Gg(l),h=Oo(c);return u?[a.toLowerCase(),{tokenAddress:s,symbol:u,decimals:h!==void 0?Number(h):18}]:[a.toLowerCase(),null]})),i={};for(let[a,s]of o)s&&(i[a]=s);return i}function ld(e,t,r=!0){let o=r&&!!t,{allPools:i,isLoading:a}=io(e,o),{deposits:s,isLoading:l}=_i(e,t,o),c=Hi(()=>{let m=new Map;for(let b of i)m.set(b.pool_address.toLowerCase(),b);return m},[i]),u=Hi(()=>s.filter(m=>{try{return BigInt(m.deposited_amount||"0")>0n}catch{return!1}}),[s]),h=Hi(()=>u.map(m=>m.pool_address.toLowerCase()).filter(m=>!c.has(m)).sort(),[u,c]),{data:g,isLoading:d}=Fg({queryKey:[Ug,e,h],queryFn:({signal:m})=>Qg(e,h,m),enabled:o&&h.length>0,staleTime:1440*60*1e3});return{positions:Hi(()=>{let m=[];for(let b of u){let y=b.pool_address.toLowerCase(),p=c.get(y);if(p){m.push({poolId:b.pool_id,poolAddress:b.pool_address,poolType:p.pool_type,tokenSymbol:p.deposit_token.symbol,tokenAddress:p.deposit_token.address,decimals:p.deposit_token.decimals,price:p.deposit_token.price,depositedRaw:b.deposited_amount});continue}let x=g?.[y];x&&m.push({poolId:b.pool_id,poolAddress:b.pool_address,poolType:"Unknown",tokenSymbol:x.symbol,tokenAddress:x.tokenAddress,decimals:x.decimals,depositedRaw:b.deposited_amount})}return m},[u,c,g]),isLoading:a||l||d}}import*as Nt from"react";import{Fragment as cd,jsx as ye,jsxs as ft}from"react/jsx-runtime";var Vg=400;function Yg(e,t,r){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":`${Oi(e.gasLimit*n)} ${r??""}`.trim()}function gs(e,t,r){return r==="loading"?"Estimating...":r==="error"||r==="unavailable"?"-":`${e} ${t}`.trim()}function qg({position:e,size:t}){return e.icon?ye("img",{src:e.icon,alt:"",width:t,height:t}):ye("span",{children:e.tokenSymbol.slice(0,1)})}function dd({open:e,status:t,positions:r,initialPoolAddress:n,walletAddress:o,txHash:i,error:a,copied:s=!1,estimateWithdraw:l,onClose:c,onConfirm:u,onCopyHash:h,trackFunnel:g,nativeSymbol:d}){let[w,f]=Nt.useState(null),[m,b]=Nt.useState("idle"),y=Nt.useRef(0),p=Nt.useRef(void 0),x=Nt.useRef(null);Nt.useEffect(()=>()=>clearTimeout(p.current),[]);let v=Nt.useMemo(()=>{let K=n?.toLowerCase();return r.find(D=>D.poolAddress.toLowerCase()===K)??r[0]??null},[r,n]),R=Nt.useMemo(()=>{try{return BigInt(v?.depositedRaw??"0")}catch{return 0n}},[v?.depositedRaw]),T=v?.decimals??18;Nt.useEffect(()=>{!e||!v||g?.("position_selected")},[e,v,g]);let N=Nt.useCallback(()=>{f(null),b(l?"idle":"unavailable"),y.current+=1,x.current=null},[]);if(Nt.useEffect(()=>{e&&N()},[e,N]),Nt.useEffect(()=>{if(!e||t!=="confirm"){clearTimeout(p.current);return}if(!l||!v){clearTimeout(p.current),b("unavailable");return}if(R<=0n){clearTimeout(p.current),y.current+=1,x.current=null,f(null),b("idle");return}let K=`${v.poolAddress.toLowerCase()}:${R.toString()}`;if(x.current===K)return;x.current=K,clearTimeout(p.current);let D=y.current+1;y.current=D,b("loading"),p.current=setTimeout(()=>{l(v,R).then(O=>{y.current===D&&(f(O??null),b(O?"ready":"unavailable"))}).catch(()=>{y.current===D&&(f(null),b("error"))})},Vg)},[e,t,R,l,v]),!e||!v)return null;let S=t==="submitting",M=oo(w?.maxPriorityFeePerGas),P=oo(w?.maxFeePerGas??w?.gasPrice),j=zi(w?.gasLimit),L=Hr(v.depositedRaw,T);return ye("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:K=>{K.target===K.currentTarget&&!S&&c()},children:ft("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-withdraw-title","aria-label":"Withdraw","data-status":t,"data-vaul-no-drag":!0,children:[ye("div",{className:"wp-claim-grabber","aria-hidden":!0,children:ye("span",{})}),ft("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&i?ft(cd,{children:[ye("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:ye(ji,{})}),ft("div",{className:"wp-claim-copy",children:[ye("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),ye("p",{className:"wp-claim-desc",children:"Your withdrawal request has been submitted. Balances will update shortly after the transaction settles."})]}),ye("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:ft("div",{className:"wp-claim-list-item",children:[ye("span",{children:"Tx Hash"}),ft("button",{type:"button",className:"wp-claim-hash",onClick:h,"aria-label":"Copy transaction hash","data-track":"withdraw_hash_copy",children:[ye("strong",{children:Bi(i)}),s?ye(Ui,{}):ye(Fi,{})]})]})})]}):ft(cd,{children:[t==="error"&&ft("div",{className:"wp-claim-heading",children:[ye("h3",{id:"wp-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),ye("p",{className:"wp-claim-error-message",children:a||"The withdraw request could not be completed."})]}),ft("div",{className:"wp-claim-reward-card","data-fit":Do(v.tokenSymbol,L),"aria-label":"Deposited balance",children:[ye("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:ye(qg,{position:v,size:28})}),ye("strong",{className:"wp-claim-reward-symbol",children:v.tokenSymbol}),ye("strong",{className:"wp-claim-reward-amount",children:L})]}),ft("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:[ft("div",{className:"wp-claim-account-row",children:[ft("div",{className:"wp-claim-account",children:[ye("span",{className:"wp-claim-account-avatar","aria-hidden":!0}),ft("strong",{children:[v.tokenSymbol," Pool"]})]}),ye("span",{children:Pi(o)})]}),ye("span",{className:"wp-claim-divider","aria-hidden":!0}),ft("div",{className:"wp-claim-detail-list",children:[ft("div",{className:"wp-claim-detail-row",children:[ye("span",{children:"Est. Tx Fee"}),ye("strong",{children:Yg(w,m,d)})]}),ft("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[ye("span",{children:"Priority Fee Per Gas"}),ye("strong",{children:gs(M,"Gwei",m)})]}),ft("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[ye("span",{children:"Max Fee Per Gas"}),ye("strong",{children:gs(P,"Gwei",m)})]}),ft("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[ye("span",{children:"Gas Limit"}),ye("strong",{children:gs(j,"",m)})]})]})]})]}),ft("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&ye("button",{type:"button",className:"wp-claim-secondary","data-track":"withdraw_cancel",onClick:c,children:t==="error"?"Close":"Cancel"}),ft("button",{type:"button",className:"wp-claim-primary","data-track":"withdraw_confirm",onClick:()=>{if(t==="success"){c();return}v&&R>0n&&u(v,R,w)},disabled:S||(t==="confirm"||t==="error")&&R<=0n,children:[t==="success"&&"Done",t==="submitting"&&ye("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}),t==="error"&&"Try Again",t==="confirm"&&"Withdraw Now"]})]})]}),ye("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:ye("span",{})})]})})}import*as ot from"react";import{useQueryClient as Xg}from"@tanstack/react-query";import{useQuery as Kg}from"@tanstack/react-query";var Zg="wp:reward-factory-info";function pd(e,t=!0){let{data:r,...n}=Kg({queryKey:[Zg,e],queryFn:async({signal:o})=>{let i=await we("gameReward",e),a=await fetch(`${i}/v1/factory/info`,{cache:"no-store",signal:o});if(!a.ok)throw new Error(`Factory info fetch failed: ${a.status}`);let s=await a.json();if(s.code!==200)throw new Error(`Factory info API error: ${s.code}`);return s},enabled:t,staleTime:0});return{factoryInfo:r?.data??null,routerAddress:r?.data.router_address??"",...n}}var Jg="wp:";function ud(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function fd(e){let{env:t,walletAddress:r,sendTransaction:n,estimateGas:o}=nt(),i=!!r,a=!!n,s=Xg(),{routerAddress:l}=pd(t,i&&a),c=ud(l),[u,h]=ot.useState(!1),[g,d]=ot.useState(void 0),[w,f]=ot.useState("confirm"),[m,b]=ot.useState(),[y,p]=ot.useState(""),[x,v]=ot.useState(!1),R=ot.useRef(void 0);ot.useEffect(()=>()=>clearTimeout(R.current),[]);let T=ot.useRef(new Set),N=ot.useCallback((O,oe)=>{T.current.has(O)||(T.current.add(O),Ce("withdraw",O,{...oe,tags:{section:e,...oe?.tags}}))},[e]),S=ot.useCallback((O,oe)=>c?{to:c,value:0n,data:Hc(O,oe),chainId:$e[t].cross}:null,[t,c]),M=ot.useCallback(()=>{s.invalidateQueries({predicate:O=>typeof O.queryKey[0]=="string"&&O.queryKey[0].startsWith(Jg)})},[s]),P=ot.useCallback(O=>{d(O),h(!0),f("confirm"),b(void 0),p(""),v(!1),T.current=new Set,N("opened")},[N]),j=ot.useCallback(()=>{w!=="submitting"&&(h(!1),d(void 0),f("confirm"),b(void 0),p(""),v(!1),w==="success"&&M())},[w,M]),L=ot.useCallback(async(O,oe)=>{if(!o)return null;let G=S(O.poolId,oe),W=ud(r);return!G||!W?null:o({...G,from:W})},[S,o,r]),K=ot.useCallback(async()=>{if(!(!m||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(m),v(!0),clearTimeout(R.current),R.current=setTimeout(()=>v(!1),1400)}catch{v(!1)}},[m]),D=ot.useCallback(async(O,oe,G)=>{if(!n){f("error"),p("Withdraw is not available for this wallet.");return}if(!c){f("error"),p("Withdraw contract address is not available.");return}try{f("submitting"),p("");let W=S(O.poolId,oe);if(!W){f("error"),p("Withdraw contract address is not available.");return}N("submitted");let le=await n({...W,gas:G?.gasLimit&&G.gasLimit>0n?G.gasLimit:void 0,maxFeePerGas:G?.maxFeePerGas&&G.maxFeePerGas>0n?G.maxFeePerGas:void 0,maxPriorityFeePerGas:G?.maxPriorityFeePerGas&&G.maxPriorityFeePerGas>0n?G.maxPriorityFeePerGas:void 0});b(le),f("success"),N("confirmed"),M()}catch(W){f("error"),p(Po(W,"Failed to request withdraw.")),N("confirmed",{status:"failure",reason:sr(W)})}},[S,M,c,n,N]);return{canWithdrawInline:a,isOpen:u,initialPoolAddress:g,status:w,txHash:m,error:y,copied:x,hasEstimator:!!o,openWithdraw:P,closeWithdraw:j,estimateWithdraw:L,confirmWithdraw:D,copyHash:K,trackFunnelOnce:N}}import{Fragment as eh,jsx as Jt,jsxs as rn}from"react/jsx-runtime";var $g="ONEpoints";function gd(){let{env:e,walletAddress:t,onOutlink:r}=nt(),n=br(),o=!!t,{getTokenImage:i,getNativeToken:a}=Qr(e,o),s=fd("points"),{positions:l,isLoading:c}=ld(e,t,o),u=md.useMemo(()=>l.filter(d=>d.poolType!=="CrossPool").map(d=>({...d,icon:i(d.tokenAddress,d.tokenSymbol)})),[l,i]),h=`${wr[e]}/point.png`,g=Jc[e];return rn(eh,{children:[Jt(yr,{sectionKey:"points",title:$g,icon:h,isEmpty:u.length===0,loading:c,children:u.map(d=>{let w=d.price?bn(d.depositedRaw,d.decimals,d.price,n):null;return rn("article",{className:"wp-item","data-side":"reward",children:[rn("div",{className:"wp-item-body",children:[rn("div",{className:"wp-item-line",children:[Jt("span",{className:"wp-item-label",children:"Token"}),rn("div",{className:"wp-svc-token",children:[d.icon&&Jt("img",{className:"wp-svc-token-icon",src:d.icon,alt:""}),Jt("span",{children:d.tokenSymbol})]})]}),rn("div",{className:"wp-item-line",children:[Jt("span",{className:"wp-item-label",children:"Deposited"}),rn("div",{className:"wp-svc-token wp-svc-token--amount",children:[d.icon&&Jt("img",{className:"wp-svc-token-icon",src:d.icon,alt:""}),rn("div",{className:"wp-svc-amount",children:[Jt("span",{className:"wp-svc-amount-main",children:Hr(d.depositedRaw,d.decimals)}),w&&Jt("span",{className:"wp-item-usd",children:w})]})]})]})]}),Jt("div",{className:"wp-item-tags",children:s.canWithdrawInline?Jt("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"points_withdraw_open",onClick:()=>s.openWithdraw(d.poolAddress),children:Jt("span",{className:"wp-tag-label",children:"Withdraw"})}):rn("a",{className:"wp-tag wp-tag--muted",href:g,target:"_blank",rel:"noopener noreferrer","data-track":"points_withdraw_open",onClick:f=>bt(f,g,{category:"portfolio",origin:"portfolio-points",payload:{position:d}},r),children:[Jt("span",{className:"wp-tag-label",children:"Withdraw"}),Jt(dr,{size:12,className:"wp-tag-icon"})]})})]},d.poolAddress)})}),Jt(dd,{open:s.isOpen,status:s.status,positions:u,initialPoolAddress:s.initialPoolAddress,walletAddress:t,txHash:s.txHash,error:s.error,copied:s.copied,estimateWithdraw:s.hasEstimator?s.estimateWithdraw:void 0,onClose:s.closeWithdraw,onConfirm:s.confirmWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce,nativeSymbol:a()?.symbol})]})}import*as hs from"react";import{useQuery as th}from"@tanstack/react-query";var rh="wp:stake-info";function hd(e,t,r=!0){let n=r&&!!t,{data:o,...i}=th({queryKey:[rh,e,t],queryFn:async({signal:s})=>{let l=await we("posa",e),c=await fetch(`${l}/stake/${t}`,{cache:"no-store",signal:s});if(!c.ok)throw new Error(`Stake info fetch failed: ${c.status}`);let u=await c.json();if(u.code!==0&&u.code!==200)throw new Error(`Stake info API error: ${u.code}`);return u},enabled:n,staleTime:0});return{stakeInfo:o?.data,...i}}import{useQuery as nh}from"@tanstack/react-query";var oh="wp:stake-rewards",ih=31;function bd(e,t,r=!0){let n=r&&!!t,{data:o,...i}=nh({queryKey:[oh,e,t],queryFn:async({signal:a})=>{let s=await we("posa",e),l=await fetch(`${s}/rewards/${t}?limit=${ih}`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Stake rewards fetch failed: ${l.status}`);let c=await l.json();if(c.code!==0&&c.code!==200)throw new Error(`Stake rewards API error: ${c.code}`);return c.data?.data??[]},enabled:n,staleTime:0});return{latestReward:o?.[0]??null,aprAccrued:Gc(o),...i}}import{useQuery as ah}from"@tanstack/react-query";var sh="wp:staking-onchain";function wd(e,t,r=!0){let n=r&&!!t&&!!e,{data:o,...i}=ah({queryKey:[sh,e],queryFn:async()=>{if(!t)throw new Error("stakingRewardsReader not provided");return t(e)},enabled:n,staleTime:0});return{onchain:o,...i}}import{useMemo as yd}from"react";import lh from"bignumber.js";function xd(e){return e?.trim().toUpperCase()==="ONE"}function vd(e){return new lh(e||"0").isGreaterThan(0)}function Qi(e,t,r=!0){let{allPools:n}=io(e,r),o=yd(()=>{for(let c of n)for(let u of[c.deposit_token,...c.reward_tokens])if(xd(u?.symbol)&&vd(u.price))return u.price},[n]),i=r&&o===void 0,{tokens:a}=gn(e,t,i),{statsMap:s}=hn(e,i),l=$e[e].cross;return yd(()=>{if(o)return o;let c=a.find(u=>u.chainId===l&&xd(u.symbol));if(c){let u=s.get(gr(c.chainId,c.address));if(u&&vd(u.price))return u.price}return"0"},[o,a,s,l])}import yn from"bignumber.js";import{jsx as xr,jsxs as wn}from"react/jsx-runtime";function ch(e){if(!e)return"\u2014";let t=new yn(e);return t.isFinite()?`${t.toFormat(2,yn.ROUND_DOWN)}%`:"\u2014"}function kd(){let{env:e,walletAddress:t,onOutlink:r,stakingRewardsReader:n}=nt(),o=br(),i=!!t,{stakeInfo:a,isLoading:s}=hd(e,t,i),{latestReward:l,aprAccrued:c,isLoading:u}=bd(e,t,i),{onchain:h}=wd(t,n,i),g=Qi(e,t,i),{getNativeToken:d}=Qr(e,i),w=d()?.symbol,f="ONEstaking",m=`${wr[e]}/cross-staking.png`,b=ed[e],y=a?.total_stake??"0",p=hs.useMemo(()=>h?new yn(h.earnedWei.toString()).shiftedBy(-18).toString(10):l?.cumulative_earned??a?.rewards_earned??"0",[h,l,a]),x=hs.useMemo(()=>h?new yn(h.stakedWei.toString()).shiftedBy(-18):new yn(y),[h,y]),v=c!==void 0?new yn(c):void 0,R=a?.days_since_first_stake,T=v!==void 0&&v.isFinite()&&x.isGreaterThan(0)&&R!==null&&R!==void 0?v.div(x).times(365).div(Math.max(1,R)).times(100):void 0,N=!(new yn(y).isZero()&&new yn(p).isZero()),S=bn(y,0,g,o),M=bn(p,0,g,o);return xr(yr,{sectionKey:"staking",title:f,icon:m,iconFit:"contain",isEmpty:!N,loading:s||u,children:wn("article",{className:"wp-item","data-side":"stake",children:[wn("div",{className:"wp-item-body",children:[wn("div",{className:"wp-item-line",children:[xr("span",{className:"wp-item-label",children:"Staked"}),wn("div",{className:"wp-svc-amount",children:[xr("span",{className:"wp-svc-amount-main",children:`${cs(y)} ${w??""}`.trim()}),S&&xr("span",{className:"wp-item-usd",children:S})]})]}),wn("div",{className:"wp-item-line",children:[xr("span",{className:"wp-item-label",children:"Rewards Earned"}),wn("div",{className:"wp-svc-amount",children:[xr("span",{className:"wp-svc-amount-main",children:`${cs(p)} ${w??""}`.trim()}),M&&xr("span",{className:"wp-item-usd",children:M})]})]}),wn("div",{className:"wp-item-line",children:[xr("span",{className:"wp-item-label",children:"My APR"}),xr("span",{children:ch(T?.toString(10))})]})]}),xr("div",{className:"wp-item-tags",children:wn("a",{className:"wp-tag wp-tag--mint",href:b,target:"_blank",rel:"noopener noreferrer","data-track":"stake_outlink",onClick:P=>bt(P,b,{category:"portfolio",origin:"portfolio-stake",payload:{stakeInfo:a}},r),children:[xr("span",{className:"wp-tag-label",children:"Manage"}),xr(dr,{size:12,className:"wp-tag-icon"})]})})]})})}import*as bs from"react";import{useQuery as dh}from"@tanstack/react-query";var ph="wp:game-swap-pools";function Rd(e,t,r=!0){let n=r&&!!t,{data:o,...i}=dh({queryKey:[ph,e,t],queryFn:async({signal:a})=>{let s=await we("gameSwap",e),l=await fetch(`${s}/addresses/${t}/portfolio`,{cache:"no-store",signal:a});if(!l.ok)throw new Error(`Game-swap portfolio fetch failed: ${l.status}`);return(await l.json()).pools??[]},enabled:n,staleTime:0});return{pools:o??[],...i}}import{useQuery as uh}from"@tanstack/react-query";var fh="wp:game-swap-lp-balances";function Sd(e,t,r,n){let o=[...r].map(l=>l.toLowerCase()).sort(),i=!!t&&o.length>0,{data:a,...s}=uh({queryKey:[fh,e,t,o,!!n],queryFn:async({signal:l})=>{let c=n?await n(o):await sd(e,t,o,l),u={};for(let[h,g]of Object.entries(c))u[h.toLowerCase()]=g;return u},enabled:i,staleTime:0});return{balances:a??{},...s}}import nn from"bignumber.js";import{jsx as vr,jsxs as Pr}from"react/jsx-runtime";var mh="Gametoken LP",Nd=18,gh=new nn("0.0001");function Cd(e){return e?.trim().toUpperCase()==="ONE"}function hh(e){return e&&e>0?e:Nd}function bh(e){let t=Cd(e.token_a?.symbol)&&!Cd(e.token_b?.symbol),r=t?e.reserve_a:e.reserve_b,n=hh(t?e.token_a?.decimals:e.token_b?.decimals),o=new nn(r||"0").shiftedBy(-n);return!o.isFinite()||o.isLessThanOrEqualTo(0)?new nn(0):o.times(2)}function wh(e,t,r,n){let o=e.token_a?.symbol?.trim()||"TOKEN",i=e.token_b?.symbol?.trim()||n||"?",a=t?.decimals??Nd,s,l;if(t&&t.totalSupply&&t.totalSupply>BigInt(0)){let c=new nn(t.balance.toString()),u=new nn(t.totalSupply.toString()),h=c.div(u);s=h.times(100);let g=h.times(bh(e));if(g.isGreaterThan(0)){let d=new nn(e.quote_usd??e.cross_usd??"0");l=d.isGreaterThan(0)?On(g.times(d),r):`${g.toFormat(4,nn.ROUND_DOWN)} ${n??""}`.trim()}}return{pool:e,tokenASymbol:o,tokenBSymbol:i,info:t,lpAmountRaw:t?.balance.toString(),lpDecimals:a,sharePercent:s,valueText:l}}function Td(){let{env:e,walletAddress:t,onOutlink:r,lpBalanceReader:n}=nt(),o=br(),i=!!t,{pools:a,isLoading:s}=Rd(e,t,i),l=bs.useMemo(()=>a.map(b=>b.pair_address).filter(Boolean),[a]),{balances:c,isLoading:u}=Sd(e,t,l,n),{getNativeToken:h}=Qr(e,i),g=h()?.symbol,d=`${wr[e]}/game-token.png`,w=Object.keys(c).length>0,f=bs.useMemo(()=>{let b=a.map(y=>wh(y,c[y.pair_address?.toLowerCase()],o,g));return w?b.filter(y=>y.lpAmountRaw?new nn(y.lpAmountRaw).shiftedBy(-y.lpDecimals).isGreaterThanOrEqualTo(gh):!1):b},[a,c,w,o,g]),m=b=>{let y=b.token_a?.address??b.pair_address;return`${td[e]}/gametoken/tokens/${y}?trade=deposit`};return vr(yr,{sectionKey:"gameSwap",title:mh,icon:d,iconFit:"contain",isEmpty:f.length===0,loading:s||u,children:f.map(b=>{let{pool:y}=b,p=m(y),x=`${b.tokenASymbol} / ${b.tokenBSymbol}`,v=y.token_a?.logo_url,R=y.token_b?.logo_url;return Pr("article",{className:"wp-item","data-side":"game-swap",children:[Pr("div",{className:"wp-item-body",children:[Pr("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Pool"}),Pr("div",{className:"wp-svc-token",children:[Pr("span",{className:"wp-token-stack","aria-hidden":!0,children:[v&&vr("img",{className:"wp-svc-token-icon",src:v,alt:""}),R&&vr("img",{className:"wp-svc-token-icon",src:R,alt:""})]}),vr("span",{children:x})]})]}),b.lpAmountRaw!==void 0&&Pr("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"My LP"}),Pr("span",{children:[Hr(b.lpAmountRaw,b.lpDecimals)," LP"]})]}),b.sharePercent!==void 0&&Pr("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Pool Share"}),Pr("span",{children:[b.sharePercent.toFormat(2,nn.ROUND_DOWN),"%"]})]}),b.valueText!==void 0&&Pr("div",{className:"wp-item-line",children:[vr("span",{className:"wp-item-label",children:"Value"}),vr("span",{children:b.valueText})]})]}),vr("div",{className:"wp-item-tags",children:Pr("a",{className:"wp-tag wp-tag--mint",href:p,target:"_blank",rel:"noopener noreferrer","data-track":"gameswap_outlink","data-track-id":x,onClick:T=>bt(T,p,{category:"portfolio",origin:"portfolio-game-swap",payload:{pool:y}},r),children:[vr("span",{className:"wp-tag-label",children:"Manage"}),vr(dr,{size:12,className:"wp-tag-icon"})]})})]},y.pair_address)})})}import Fn from"bignumber.js";import{useMemo as Ch}from"react";import{useQuery as yh}from"@tanstack/react-query";var xh="wp:forge-pools";function Id(e,t,r=!0){let n=r&&!!t,{data:o,...i}=yh({queryKey:[xh,e,t],queryFn:async()=>{let s=await we("bondingCurve",e),l=await fetch(`${s}/v1/users/${t}/pools`,{cache:"no-store"});if(!l.ok)throw new Error(`forge pools fetch failed: ${l.status}`);return(await l.json()).data?.items??[]},enabled:n,staleTime:0}),a=o??[];return{pools:a,isEmpty:a.length===0,...i}}import{useQueries as vh}from"@tanstack/react-query";import{useMemo as kh}from"react";var Rh="wp:forge-token-detail";async function Sh(e,t){let r=await fetch(`${e}/v1/tokens/${t}`,{cache:"no-store"});return r.ok?(await r.json())?.data?.token??null:null}function Md(e,t,r=!0){let n=vh({queries:t.map(a=>({queryKey:[Rh,e,a],queryFn:async()=>Sh(await we("bondingCurve",e),a),enabled:r&&!!a,staleTime:3e4}))}),o=kh(()=>{let a=new Map;for(let s=0;s<n.length;s++){let l=n[s]?.data,c=t[s];l&&c&&a.set(c.toLowerCase(),l)}return a},[n,t]),i=n.some(a=>a.isLoading);return{detailMap:o,isLoading:i}}import{jsx as $t,jsxs as xn}from"react/jsx-runtime";var Nh="ONEforge",Ed=18,Th="https://contents.crosstoken.io/wallet/token/images/FT.png";function Ih(e){if(!e||e==="0")return"0";let t=new Fn(e).shiftedBy(-Ed);return t.isZero()?"0":t.isGreaterThanOrEqualTo(1)?t.toFormat(2,Fn.ROUND_DOWN):t.toFormat(4,Fn.ROUND_DOWN)}function Mh(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 Eh(e,t,r,n){let o=new Fn(r||"0");if(!o.isGreaterThan(0))return null;let i=new Fn(e.total_supply||"0"),a=new Fn(e.lp_balance||"0"),s=new Fn(t?.reserve_b||"0").shiftedBy(-Ed);if(!i.isGreaterThan(0)||!a.isGreaterThan(0)||!s.isGreaterThan(0))return null;let l=s.times(2),u=a.div(i).times(l).times(o);return u.isFinite()?On(u,n):null}function Ad(){let{env:e,walletAddress:t,onOutlink:r}=nt(),n=br(),o=!!t,{pools:i,isEmpty:a,isLoading:s}=Id(e,t,o),l=Ch(()=>i.map(d=>d.token.address),[i]),{detailMap:c}=Md(e,l,o&&l.length>0),u=Qi(e,t,o),h=d=>`${$c[e]}/forge/token/${d.token.address}`,g=`${wr[e]}/forge.png`;return $t(yr,{sectionKey:"forge",title:Nh,icon:g,iconFit:"contain",isEmpty:a,loading:s,children:i.map(d=>{let w=c.get(d.token.address.toLowerCase()),f=w?.image_url||w?.image||d.token.image||Th,m=w?.symbol||d.token.symbol,b=h(d),y=Eh(d,w,u,n);return xn("a",{className:"wp-item","data-side":"lp",href:b,target:"_blank",rel:"noopener noreferrer","data-track":"forge_outlink","data-track-id":m,onClick:p=>bt(p,b,{category:"portfolio",origin:"portfolio-forge",payload:{pool:d,tokenDetail:w}},r),children:[xn("div",{className:"wp-item-body",children:[xn("div",{className:"wp-item-line",children:[$t("span",{className:"wp-item-label",children:"Asset"}),xn("div",{className:"wp-svc-token",children:[$t("img",{className:"wp-svc-token-icon",src:f,alt:""}),$t("span",{children:m}),w?.name&&$t("span",{className:"wp-token-subtle",children:w.name})]})]}),xn("div",{className:"wp-item-line",children:[$t("span",{className:"wp-item-label",children:"LP Balance"}),$t("div",{className:"wp-svc-token wp-svc-token--amount",children:xn("div",{className:"wp-svc-amount",children:[$t("span",{className:"wp-svc-amount-main",children:Ih(d.lp_balance)}),y&&$t("span",{className:"wp-item-usd",children:y})]})})]}),xn("div",{className:"wp-item-line",children:[$t("span",{className:"wp-item-label",children:"Ownership"}),$t("span",{className:"wp-line-value",children:Mh(d.pool_ownership)})]})]}),$t("div",{className:"wp-item-tags",children:xn("span",{className:"wp-tag wp-tag--muted",children:[$t("span",{className:"wp-tag-label",children:"Withdraw"}),$t(dr,{size:12,className:"wp-tag-icon"})]})})]},d.pair_address)})})}import{useMemo as Hd}from"react";import t0 from"bignumber.js";import{useQuery as Ah}from"@tanstack/react-query";var Lh="wp:crossd-positions";function Dh(e){let t=e??{};return(t.positions??t.data?.positions??[]).filter(n=>{if(!n?.token_id||!n.liquidity)return!1;try{return BigInt(n.liquidity)>0n}catch{return!1}})}function Ld(e,t,r=!0){let n=r&&!!t,{data:o,...i}=Ah({queryKey:[Lh,e,t],queryFn:async()=>{let s=await fetch(`${Gi[e]}/api/v1/positions?owner=${t}`,{cache:"no-store"});if(!s.ok)throw new Error(`crossd positions fetch failed: ${s.status}`);return Dh(await s.json())},enabled:n,staleTime:0}),a=o??[];return{positions:a,isEmpty:a.length===0,...i}}import{useQueries as Ph}from"@tanstack/react-query";import{useMemo as Bh}from"react";var zh="wp:crossd-position-details";function Oh(e){let t=e??{},r=t.data??t;return r?.token_id||r?.pool?r:null}function Dd(e,t,r=!0){let n=Ph({queries:t.map(i=>({queryKey:[zh,e,i],queryFn:async()=>{let a=await fetch(`${Gi[e]}/api/v1/positions/${i}`,{cache:"no-store"});if(!a.ok)throw new Error(`crossd position detail failed: ${a.status}`);return Oh(await a.json())},enabled:r&&!!i,staleTime:6e4}))});return{detailMap:Bh(()=>{let i=new Map;return n.forEach((a,s)=>{let l=a.data,c=t[s];l&&c&&i.set(c,l)}),i},[n,t])}}import*as on from"react";import{Fragment as Bd,jsx as me,jsxs as Tt}from"react/jsx-runtime";var Fh=300*1e3,Pd="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Uh(e,t,r){if(t)return"Estimating...";if(!e)return"Wallet estimate";let n=e.maxFeePerGas??e.gasPrice;return!n||n<=0n||e.gasLimit<=0n?"Wallet estimate":`${Oi(e.gasLimit*n)} ${r??""}`.trim()}function ws(e,t,r){return r?"Estimating...":`${e} ${t}`.trim()}function zd({open:e,status:t,target:r,token0Icon:n,token1Icon:o,token0Symbol:i,token1Symbol:a,nativeSymbol:s,txHash:l,error:c,copied:u=!1,hasEstimator:h,prepareWithdraw:g,confirmWithdraw:d,onClose:w,onCopyHash:f,trackFunnel:m}){let[b,y]=on.useState(null),[p,x]=on.useState(null),v=on.useRef(0);on.useEffect(()=>{if(!e||!r)return;let J=++v.current;y(null),x(null),m?.("dialog_opened"),g().then(fe=>{v.current===J&&(y(fe),x(fe?Date.now():null))})},[e,r]);let R=t==="submitting",T=t==="estimating"||t==="confirm"&&!b,N=on.useCallback(async()=>{let J=b,fe=!p||Date.now()-p>Fh;if(!J||fe){let ce=++v.current;if(J=await g(),v.current!==ce)return;y(J),x(J?Date.now():null)}J&&await d(J)},[b,p,g,d]);if(!e||!r)return null;let{position:S,detail:M}=r,P=M.pool?.token0,j=M.pool?.token1,L=i||P?.symbol||S.pool?.token0_symbol||"?",K=a||j?.symbol||S.pool?.token1_symbol||"?",D=P?.decimals??18,O=j?.decimals??18,oe=n||P?.logo_url||Pd,G=o||j?.logo_url||Pd,W=`${L}/${K}`,le=b?ro(b.expectedAmount0.toString(),D):null,Z=b?ro(b.expectedAmount1.toString(),O):null,V=oo(b?.estimate?.maxPriorityFeePerGas),U=oo(b?.estimate?.maxFeePerGas??b?.estimate?.gasPrice),te=zi(b?.estimate?.gasLimit);return me("div",{className:"wp-claim-overlay",role:"presentation",onMouseDown:J=>{J.target===J.currentTarget&&!R&&w()},children:Tt("section",{className:"wp-claim-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"wp-crossd-withdraw-title","aria-label":"Withdraw position","data-status":t,"data-vaul-no-drag":!0,children:[me("div",{className:"wp-claim-grabber","aria-hidden":!0,children:me("span",{})}),Tt("div",{className:"wp-claim-content wp-withdraw-content",children:[t==="success"&&l?Tt(Bd,{children:[me("span",{className:"wp-claim-icon wp-claim-icon--success","aria-hidden":!0,children:me(ji,{})}),Tt("div",{className:"wp-claim-copy",children:[me("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Submitted!"}),Tt("p",{className:"wp-claim-desc",children:["Your ",W," position withdrawal has been submitted. Balances will update shortly after the transaction settles."]})]}),me("div",{className:"wp-claim-list","aria-label":"Withdraw transaction",children:Tt("div",{className:"wp-claim-list-item",children:[me("span",{children:"Tx Hash"}),Tt("button",{type:"button",className:"wp-claim-hash",onClick:f,"aria-label":"Copy transaction hash","data-track":"crossd_withdraw_hash_copy",children:[me("strong",{children:Bi(l)}),u?me(Ui,{}):me(Fi,{})]})]})})]}):Tt(Bd,{children:[t==="error"&&Tt("div",{className:"wp-claim-heading",children:[me("h3",{id:"wp-crossd-withdraw-title",className:"wp-claim-title",children:"Withdraw Failed"}),me("p",{className:"wp-claim-error-message",children:c||"The withdraw request could not be completed."})]}),Tt("div",{className:"wp-claim-reward-card","data-fit":Do(L,le??""),"aria-label":`Expected ${L}`,children:[me("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:me("img",{src:oe,alt:"",width:28,height:28})}),me("strong",{className:"wp-claim-reward-symbol",children:L}),me("strong",{className:"wp-claim-reward-amount",children:le??"Estimating..."})]}),Tt("div",{className:"wp-claim-reward-card","data-fit":Do(K,Z??""),"aria-label":`Expected ${K}`,children:[me("span",{className:"wp-claim-reward-token","aria-hidden":!0,children:me("img",{src:G,alt:"",width:28,height:28})}),me("strong",{className:"wp-claim-reward-symbol",children:K}),me("strong",{className:"wp-claim-reward-amount",children:Z??"Estimating..."})]}),h&&me("div",{className:"wp-claim-account-card","aria-label":"Withdraw gas fee",children:Tt("div",{className:"wp-claim-detail-list",children:[Tt("div",{className:"wp-claim-detail-row",children:[me("span",{children:"Est. Tx Fee"}),me("strong",{children:Uh(b?.estimate,T,s)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[me("span",{children:"Priority Fee Per Gas"}),me("strong",{children:ws(V,"Gwei",T)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[me("span",{children:"Max Fee Per Gas"}),me("strong",{children:ws(U,"Gwei",T)})]}),Tt("div",{className:"wp-claim-detail-row wp-claim-detail-row--sub",children:[me("span",{children:"Gas Limit"}),me("strong",{children:ws(te,"",T)})]})]})})]}),Tt("div",{className:"wp-claim-actions","data-count":t==="confirm"||t==="error"?2:1,children:[(t==="confirm"||t==="error")&&me("button",{type:"button",className:"wp-claim-secondary","data-track":"crossd_withdraw_cancel",onClick:w,children:t==="error"?"Close":"Cancel"}),me("button",{type:"button",className:"wp-claim-primary","data-track":"crossd_withdraw_confirm",onClick:()=>{if(t==="success"){w();return}R||T||(m?.("confirm_clicked"),N())},disabled:R||T,children:t==="success"?"Done":R?me("span",{className:"wp-claim-button-spinner","aria-label":"Waiting"}):T?me("span",{className:"wp-claim-button-spinner","aria-label":"Estimating"}):t==="error"?"Retry":"Withdraw"})]})]}),me("div",{className:"wp-claim-home-indicator","aria-hidden":!0,children:me("span",{})})]})})}import*as Ke from"react";import{useQueryClient as Xh}from"@tanstack/react-query";var jh="0x0c49ccbe",Wh="0xfc6f7865",_h="0x49404b7c",Gh="0xdf2ab5bb",Hh="0xac9650d8",Od=(1n<<128n)-1n,Ud=600n,Qh=99n,Vh=100n;function ys(e){return e*Qh/Vh}function Fd(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()}function er(e,t){if(e<0n)throw new Error(`${t} must be non-negative`);let r=e.toString(16);if(r.length>64)throw new Error(`${t} exceeds uint256`);return r.padStart(64,"0")}function Vi(e,t){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`${t} is not a valid address`);return e.toLowerCase().replace(/^0x/,"").padStart(64,"0")}function xs(e){return jh+er(e.tokenId,"tokenId")+er(e.liquidity,"liquidity")+er(e.amount0Min,"amount0Min")+er(e.amount1Min,"amount1Min")+er(e.deadline,"deadline")}function Yh(e){return Wh+er(e.tokenId,"tokenId")+Vi(e.recipient,"recipient")+er(e.amount0Max,"amount0Max")+er(e.amount1Max,"amount1Max")}function qh(e,t){return _h+er(e,"amountMinimum")+Vi(t,"recipient")}function Kh(e,t,r){return Gh+Vi(e,"token")+er(t,"amountMinimum")+Vi(r,"recipient")}function Zh(e){if(e.length===0)throw new Error("multicall requires at least one call");let t=e.map(o=>{let i=o.replace(/^0x/,"");if(i.length%2!==0||!/^[0-9a-fA-F]*$/.test(i))throw new Error("multicall element must be valid hex bytes");let a=i.length%64===0?i:i.padEnd(i.length+(64-i.length%64),"0");return er(BigInt(i.length/2),"callLength")+a.toLowerCase()}),r=BigInt(e.length)*32n,n=[];for(let o of t)n.push(er(r,"callOffset")),r+=BigInt(o.length/2);return Hh+er(0x20n,"arrayOffset")+er(BigInt(e.length),"arrayLength")+n.join("")+t.join("")}function jd(e){if(!e||e==="0x")return null;let t=e.replace(/^0x/,"");return t.length<128||!/^[0-9a-fA-F]+$/.test(t)?null:{amount0:BigInt(`0x${t.slice(0,64)}`),amount1:BigInt(`0x${t.slice(64,128)}`)}}function Wd(e){let t=Fd(e.token0,e.wcrossAddress),r=Fd(e.token1,e.wcrossAddress),n=t||r,o=[xs({tokenId:e.tokenId,liquidity:e.liquidity,amount0Min:e.amount0Min,amount1Min:e.amount1Min,deadline:e.deadline}),Yh({tokenId:e.tokenId,recipient:n?e.positionManagerAddress:e.owner,amount0Max:Od,amount1Max:Od})];return n&&(o.push(qh(0n,e.owner)),o.push(Kh(t?e.token1:e.token0,0n,e.owner))),Zh(o)}async function _d(e,t,r){let n;try{n=await Fo(e,r)}catch{n=void 0}if(!n)return null;let o=xs({tokenId:t.tokenId,liquidity:t.liquidity,amount0Min:0n,amount1Min:0n,deadline:t.deadline}),i=await tn(n,t.positionManager,o,r,t.owner);return jd(i)}var Jh="wp:",$h=[1500,3e3,4500,6e3];function e0(e){return/^0x[a-fA-F0-9]{40}$/.test(e)?e:null}function Gd(){let{env:e,walletAddress:t,sendTransaction:r,estimateGas:n}=nt(),o=!!r,i=Xh(),[a,s]=Ke.useState(!1),[l,c]=Ke.useState(null),[u,h]=Ke.useState("confirm"),[g,d]=Ke.useState(),[w,f]=Ke.useState(""),[m,b]=Ke.useState(!1),[y,p]=Ke.useState(new Set),x=Ke.useRef(void 0),v=Ke.useRef([]),R=Ke.useRef(0);Ke.useEffect(()=>()=>{clearTimeout(x.current),v.current.forEach(clearTimeout)},[]);let T=Ke.useRef(new Set),N=Ke.useCallback((D,O)=>{T.current.has(D)||(T.current.add(D),Ce("withdraw",D,{...O,tags:{section:"crossdPool",...O?.tags}}))},[]),S=Ke.useCallback(()=>{let D=()=>i.invalidateQueries({predicate:O=>typeof O.queryKey[0]=="string"&&O.queryKey[0].startsWith(Jh)});D(),v.current.forEach(clearTimeout),v.current=$h.map(O=>setTimeout(D,O))},[i]),M=Ke.useCallback(D=>{R.current+=1,c(D),s(!0),h("confirm"),d(void 0),f(""),b(!1),T.current=new Set,N("opened")},[N]),P=Ke.useCallback(()=>{u!=="submitting"&&(R.current+=1,s(!1),c(null),h("confirm"),d(void 0),f(""),b(!1))},[u]),j=Ke.useCallback(async()=>{let D=R.current,O=e0(t),oe=l?.position.token_id,G=l?.position.liquidity,W=l?.detail.pool?.token0?.address,le=l?.detail.pool?.token1?.address;if(!O||!oe||!G||!W||!le)return h("error"),f("Position data is incomplete. Please refresh and retry."),null;try{h("estimating"),f("");let Z=BigInt(oe),V=BigInt(G),U=BigInt(Math.floor(Date.now()/1e3))+Ud,te=nd[e],J=await _d(e,{owner:O,positionManager:te,tokenId:Z,liquidity:V,deadline:U});if(R.current!==D)return null;if(!J)return h("error"),f("Failed to estimate withdrawal amounts. Please retry."),null;let fe=Wd({tokenId:Z,liquidity:V,amount0Min:ys(J.amount0),amount1Min:ys(J.amount1),deadline:U,owner:O,positionManagerAddress:te,token0:W,token1:le,wcrossAddress:od[e]}),ce={to:te,value:0n,data:fe,chainId:$e[e].cross},$=null;if(n){try{$=await n({...ce,from:O})}catch{$=null}if(R.current!==D)return null}return h("confirm"),{tx:ce,estimate:$,expectedAmount0:J.amount0,expectedAmount1:J.amount1}}catch(Z){return R.current!==D||(h("error"),f(Po(Z,"Failed to prepare withdraw."))),null}},[e,n,l,t]),L=Ke.useCallback(async D=>{if(!r){h("error"),f("Withdraw is not available for this wallet.");return}try{h("submitting"),f(""),N("submitted");let O=await r({...D.tx,gas:D.estimate?.gasLimit&&D.estimate.gasLimit>0n?D.estimate.gasLimit:void 0,maxFeePerGas:D.estimate?.maxFeePerGas&&D.estimate.maxFeePerGas>0n?D.estimate.maxFeePerGas:void 0,maxPriorityFeePerGas:D.estimate?.maxPriorityFeePerGas&&D.estimate.maxPriorityFeePerGas>0n?D.estimate.maxPriorityFeePerGas:void 0});d(O),h("success");let oe=l?.position.token_id;oe&&p(G=>{let W=new Set(G);return W.add(oe),W}),N("confirmed"),S()}catch(O){h("error"),f(Po(O,"Failed to request withdraw.")),N("confirmed",{status:"failure",reason:sr(O)})}},[S,r,l,N]),K=Ke.useCallback(async()=>{if(!(!g||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(g),b(!0),clearTimeout(x.current),x.current=setTimeout(()=>b(!1),1400)}catch{b(!1)}},[g]);return{canWithdrawInline:o,isOpen:a,target:l,withdrawnTokenIds:y,status:u,txHash:g,error:w,copied:m,hasEstimator:!!n,openWithdraw:M,closeWithdraw:P,prepareWithdraw:j,confirmWithdraw:L,copyHash:K,trackFunnelOnce:N}}import{Fragment as n0,jsx as tr,jsxs as vn}from"react/jsx-runtime";var r0="ONEusd Pool",Qd="https://contents.crosstoken.io/wallet/token/images/Cross.svg";function Vd(){let{env:e,walletAddress:t,onOutlink:r}=nt(),n=br(),o=!!t,{positions:i,isLoading:a}=Ld(e,t,o),s=Gd(),l=Hd(()=>i.filter(N=>!N.token_id||!s.withdrawnTokenIds.has(N.token_id)),[i,s.withdrawnTokenIds]),c=Hd(()=>l.map(N=>N.token_id).filter(N=>!!N),[l]),{detailMap:u}=Dd(e,c,o&&c.length>0),h=`${rd[e]}/pool`,{getTokenImage:g,getTokenSymbol:d,getNativeToken:w}=Qr(e,o),f=g("","ONEUSD",{chainOnly:!0})||`${wr[e]}/crossd.png`,m={chainOnly:!0},b=(N,S)=>{let M=ls(d(N?.address??"",N?.symbol??S,m));return M==="ONE"?w()?.symbol??"?":M??"?"},y=(N,S)=>{let M=N?.symbol??S,P=ls(M);return P==="ONE"?w()?.image||Qd:g(N?.address??"",P,m)||N?.logo_url||Qd},p=s.target?.detail.pool,x=y(p?.token0,s.target?.position.pool?.token0_symbol),v=y(p?.token1,s.target?.position.pool?.token1_symbol),R=b(p?.token0,s.target?.position.pool?.token0_symbol),T=b(p?.token1,s.target?.position.pool?.token1_symbol);return vn(n0,{children:[tr(yr,{sectionKey:"crossdPool",title:r0,icon:f,iconFit:"contain",isEmpty:l.length===0,loading:a,children:l.map(N=>{let S=N.token_id?u.get(N.token_id):void 0,M=`${b(S?.pool?.token0,N.pool?.token0_symbol)}/${b(S?.pool?.token1,N.pool?.token1_symbol)}`,P=N.pool?.fee_tier_percentage,j=y(S?.pool?.token0,N.pool?.token0_symbol),L=y(S?.pool?.token1,N.pool?.token1_symbol),K=On(new t0(N.position_value_usd??"0"),n),D=s.canWithdrawInline&&!!S?.pool?.token0?.address&&!!S?.pool?.token1?.address;return vn("article",{className:"wp-item","data-side":"crossd",children:[vn("div",{className:"wp-item-body",children:[vn("div",{className:"wp-item-line",children:[tr("span",{className:"wp-item-label",children:"Pool"}),vn("div",{className:"wp-svc-token",children:[vn("span",{className:"wp-token-stack","aria-hidden":!0,children:[tr("img",{className:"wp-svc-token-icon",src:j,alt:""}),tr("img",{className:"wp-svc-token-icon",src:L,alt:""})]}),tr("span",{children:M}),P&&tr("span",{className:"wp-token-subtle",children:P})]})]}),vn("div",{className:"wp-item-line",children:[tr("span",{className:"wp-item-label",children:"Position Value"}),tr("span",{className:"wp-line-value",children:K})]})]}),tr("div",{className:"wp-item-tags",children:D?tr("button",{type:"button",className:"wp-tag wp-tag--muted","data-track":"crossd_pool_withdraw_open","data-track-id":M,onClick:()=>{S&&s.openWithdraw({position:N,detail:S})},children:tr("span",{className:"wp-tag-label",children:"Withdraw"})}):vn("a",{className:"wp-tag wp-tag--muted",href:h,target:"_blank",rel:"noopener noreferrer","data-track":"crossd_pool_outlink","data-track-id":M,onClick:O=>bt(O,h,{category:"portfolio",origin:"portfolio-crossd-pool",payload:{position:N,detail:S}},r),children:[tr("span",{className:"wp-tag-label",children:"Withdraw"}),tr(dr,{size:12,className:"wp-tag-icon"})]})})]},N.token_id)})}),tr(zd,{open:s.isOpen,status:s.status,target:s.target,token0Icon:x,token1Icon:v,token0Symbol:R,token1Symbol:T,nativeSymbol:w()?.symbol,txHash:s.txHash,error:s.error,copied:s.copied,hasEstimator:s.hasEstimator,prepareWithdraw:s.prepareWithdraw,confirmWithdraw:s.confirmWithdraw,onClose:s.closeWithdraw,onCopyHash:s.copyHash,trackFunnel:s.trackFunnelOnce})]})}var Yi=["rewards","points","staking","gameSwap","forge","crossdPool"];ie(`.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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-lowest, #2e2820);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--wp-claim-primary-text: #ffffff;--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-system-orange-default, #f0640d);--wp-green: var(--ds-accent-primary-default, #00a0a2);--wp-accent-soft: var(--ds-system-orange-low, #fff5ee);--wp-red: var(--ds-system-red-default, #e70077);--wp-blue: #0488fc;--wp-purple: #7346f3;--wp-orange: #ff9d00;--wp-claim-primary: #ed0a72;--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-item[data-side=reward] .wp-svc-token-icon{border-radius:0;object-fit:contain}.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-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}}.wi-popover-content .wp-claim-sheet{min-height:min(600px,calc(100% - 24px))}.wi-popover-content .wp-claim-content{flex:1 1 auto}.wi-popover-content .wp-claim-actions{margin-top:auto}.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:6px;width:100%;min-height:60px;padding:16px 8px;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-reward-card[data-fit=sm] .wp-claim-reward-symbol{font-size:14px}.wp-claim-reward-card[data-fit=sm] .wp-claim-reward-amount{font-size:16px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-symbol{font-size:12px}.wp-claim-reward-card[data-fit=xs] .wp-claim-reward-amount{font-size:13px}.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}
|
|
9
|
+
`);import{Fragment as a0,jsx as Me,jsxs as an}from"react/jsx-runtime";var vs=15,i0="wp:";function ao({env:e,theme:t="light",walletAddress:r,walletName:n,onBack:o,showHeader:i=!0,variant:a="embed",className:s,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:u,sendTransaction:h,estimateGas:g,conversionRatio:d,currencySymbol:w,sections:f}){let m=Qe(e),b=it.useCallback($=>!f||f.includes($),[f]),y=!!r,p=o0(),[x,v]=it.useState({}),R=it.useCallback(($,be)=>{v(Ae=>{let de=Ae[$];return de&&de.loading===be.loading&&de.empty===be.empty?Ae:{...Ae,[$]:be}})},[]),T=it.useCallback($=>{v(be=>{if(!($ in be))return be;let Ae={...be};return delete Ae[$],Ae})},[]),N=it.useMemo(()=>({report:R,unregister:T}),[R,T]),[S,M]=it.useState(vs),[P,j]=it.useState(!1),[L,K]=it.useState(!1),D=it.useRef(void 0),O=it.useCallback(()=>{p.invalidateQueries({predicate:$=>typeof $.queryKey[0]=="string"&&$.queryKey[0].startsWith(i0)})},[p]),oe=it.useCallback(()=>{O(),j(!0),setTimeout(()=>j(!1),600),M(vs)},[O]);it.useEffect(()=>{if(!y)return;let $=setInterval(()=>{M(be=>be<=1?(oe(),vs):be-1)},1e3);return()=>clearInterval($)},[y,oe]);let G=it.useCallback(()=>{o?.()},[o]),W=y?en(m,r,{size:64}):void 0,le=it.useCallback(async()=>{if(!(L||!r))try{await navigator.clipboard.writeText(r),K(!0),clearTimeout(D.current),D.current=setTimeout(()=>K(!1),2e3)}catch{}},[r,L]);it.useEffect(()=>()=>clearTimeout(D.current),[]);let Z=it.useMemo(()=>({env:m,theme:t,open:!0,walletAddress:r,close:G,onOutlink:l,lpBalanceReader:c,stakingRewardsReader:u,sendTransaction:h,estimateGas:g,conversionRatio:d,currencySymbol:w}),[m,t,r,G,l,c,u,h,g,d,w]),V=Yi.filter(b),U=V.length>0&&V.every($=>{let be=x[$];return!!be&&!be.loading}),te=U&&V.every($=>x[$]?.empty),J=V.some($=>{let be=x[$];return!!be&&!be.empty}),fe=V.length>0&&!U&&!J,ce=an(a0,{children:[i&&an("div",{className:"wp-header",children:[an("div",{className:"wp-header-account",children:[o&&Me("button",{type:"button",className:"wp-header-btn","aria-label":"Back","data-track":"back",onClick:o,children:Me(qc,{})}),Me("span",{className:"wp-header-avatar","aria-hidden":!0,children:W&&Me("img",{src:W,alt:"",className:"wp-header-avatar-img",draggable:!1})}),(n||r)&&an("div",{className:"wp-header-account-meta",children:[n&&Me("span",{className:"wp-header-wallet-name",title:n,children:n}),r&&an("button",{type:"button",className:"wp-header-address-btn",onClick:le,"aria-label":"Copy wallet address","data-track":"address_copy",children:[Me("span",{className:"wp-header-address",children:Pi(r)}),Me("span",{className:"wp-header-address-copy","data-copied":L,children:L?Me(Jr,{size:14}):Me(An,{size:14})})]})]})]}),an("button",{type:"button",className:"wp-header-btn wp-refresh-btn","aria-label":"Refresh portfolio","data-track":"refresh",onClick:oe,children:[Me(Kc,{className:P?"wp-spin-once":void 0}),y&&Me("span",{className:"wp-refresh-badge",children:S})]})]}),Me("div",{className:"wp-body",children:an("div",{className:"wp-body-inner","data-empty":te||void 0,children:[b("rewards")&&Me(ad,{}),b("points")&&Me(gd,{}),b("staking")&&Me(kd,{}),b("gameSwap")&&Me(Td,{}),b("forge")&&Me(Ad,{}),b("crossdPool")&&Me(Vd,{}),fe&&Me("div",{className:"wp-portfolio-loading",role:"status","aria-label":"Loading portfolio",children:Me("span",{className:"wp-portfolio-spinner","aria-hidden":!0})}),te&&an("div",{className:"wp-portfolio-empty",role:"status",children:[Me("span",{className:"wp-portfolio-empty-icon","aria-hidden":!0,children:an("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[Me("path",{d:"M20 7H5a2 2 0 0 1-2-2 2 2 0 0 1 2-2h13v4"}),Me("path",{d:"M3 5v13a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1"}),Me("circle",{cx:"16.5",cy:"13.5",r:"1",fill:"currentColor",stroke:"none"})]})}),Me("p",{className:"wp-portfolio-empty-title",children:"No assets yet"}),Me("p",{className:"wp-portfolio-empty-desc",children:"Assets you hold across ONE services will appear here."})]})]})})]});return Me(zo.Provider,{value:Z,children:Me(ds.Provider,{value:N,children:Me(pe,{feature:"wallet_portfolio",children:a==="none"?ce:Me("div",{className:xe(a==="fullscreen"?"wp-fullscreen":"wp-embed",s),"data-theme":t,children:ce})})})})}import{jsx as ks,jsxs as Yd}from"react/jsx-runtime";function qd({className:e}){let{env:t,theme:r,walletAddress:n,close:o,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s}=nt();return Yd(qi.Portal,{children:[ks(qi.Overlay,{className:"wp-overlay"}),Yd(qi.Content,{className:xe("wp-fullscreen",e),"data-theme":r,children:[ks(qi.Title,{className:"wp-sr-only",children:"Portfolio"}),ks(ao,{env:t,theme:r,walletAddress:n,onBack:o,variant:"none",onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s})]})]})}import{jsx as Kd}from"react/jsx-runtime";function l0({env:e,theme:t="light",walletAddress:r,open:n,onOpenChange:o,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,conversionRatio:u,currencySymbol:h,children:g}){let d=Qe(e),w=n!==void 0,[f,m]=Un.useState(!1),b=w?n:f,y=Un.useCallback(v=>{w||m(v),o?.(v)},[w,o]),p=Un.useCallback(()=>y(!1),[y]),x=Un.useMemo(()=>({env:d,theme:t,open:b,walletAddress:r,close:p,onOutlink:i,lpBalanceReader:a,stakingRewardsReader:s,sendTransaction:l,estimateGas:c,conversionRatio:u,currencySymbol:h}),[d,t,b,r,p,i,a,s,l,c,u,h]);return Kd(zo.Provider,{value:x,children:Kd(s0.Root,{direction:"bottom",open:b,onOpenChange:y,noBodyStyles:!0,children:g})})}var Zd=Object.assign(l0,{Trigger:Vc,Content:qd});import*as Y from"react";import{createPortal as so}from"react-dom";import Vr from"bignumber.js";import{jsx as kr,jsxs as c0}from"react/jsx-runtime";function Xd({size:e=20,className:t}){return c0("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:[kr("circle",{cx:"9",cy:"9",r:"6",stroke:"currentColor",strokeWidth:1.7}),kr("path",{d:"m17 17-3.2-3.2",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round"})]})}function Jd({size:e=16,className:t}){return kr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:kr("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 $d({size:e=16,className:t}){return kr("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:kr("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 ep({size:e=20,className:t}){return kr("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:kr("path",{d:"M10 4.167v11.666M4.167 10 10 15.833 15.833 10",stroke:"currentColor",strokeWidth:1.667,strokeLinecap:"round",strokeLinejoin:"round"})})}function tp({size:e=16,className:t}){return kr("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:kr("path",{d:"M3.333 8h9.334M8.667 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.333,strokeLinecap:"round",strokeLinejoin:"round"})})}function rp({size:e=12,className:t}){return kr("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:kr("path",{d:"M3.5 2 1.5 4l2 2M1.5 4h9M8.5 10l2-2-2-2M10.5 8h-9",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})})}import*as _ from"react";import ip from"bignumber.js";function np(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function op(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"":e.decimalPlaces(6,ip.ROUND_DOWN).toFixed()}function d0(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 p0(e){let t=e.fromToken.priceUsd,r=e.toToken.priceUsd,n=e.lastChangedBy==="to"?e.toAmount:e.fromAmount,o=new ip(n||"0");return!o.isFinite()||o.isNaN()||o.lte(0)?{fromAmount:e.fromAmount,toAmount:e.toAmount}:np(t)&&np(r)?e.lastChangedBy==="to"?{fromAmount:op(o.multipliedBy(r).dividedBy(t))}:{toAmount:op(o.multipliedBy(t).dividedBy(r))}:d0(e)?e.lastChangedBy==="to"?{fromAmount:e.toAmount}:{toAmount:e.fromAmount}:{fromAmount:e.lastChangedBy==="to"?"":e.fromAmount,toAmount:e.lastChangedBy==="from"?"":e.toAmount}}function ap({getQuote:e,submitBridge:t}){return{canQuote:!!e,canSubmit:!!t,async getQuote(r){return e?e(r):p0(r)},async submitBridge(r){if(!t)throw new Error("Bridge submit handler is not configured.");return t(r)}}}var sp=15,u0=18,pp="cross_bridge_terms_accepted",f0=3600*24*365;function m0(e){let t=e.replace(/[^\d.]/g,""),r=t.indexOf(".");r!==-1&&(t=t.slice(0,r+1)+t.slice(r+1).replace(/\./g,""));let n=t.indexOf(".");if(n===-1)return t.slice(0,sp);let o=t.slice(0,n).slice(0,sp),i=t.slice(n+1).slice(0,u0);return`${o}.${i}`}function g0(){return typeof document>"u"?!1:document.cookie.split(";").map(e=>e.trim()).some(e=>e===`${pp}=true`)}function h0(){if(typeof document>"u")return;let e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=[`${pp}=true`,"Path=/",`Max-Age=${f0}`,"SameSite=Lax",e].filter(Boolean).join("; ")}function b0(e){let t=Number(e??"0");if(!Number.isFinite(t)||t<.1)return"1";let r=n=>Math.floor(n*100)/100;if(t<3){let n=r(t*3);return String(n<1?1:n)}return"10"}function lp(e){let t=e.toUpperCase();return t.startsWith("T")&&t.slice(1).startsWith("ONE")?t.slice(1):t}function w0(e,t){if(!e||!t||e.chainId!==t.chainId)return!1;let r=new Set([lp(e.symbol),lp(t.symbol)]);return r.has("ONE")&&r.has("ONEUSD")}function Br(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function Ki(e){return e[0]}function Rs(e,t,r,n){if(r&&!Br(r,t))return r;let o=t?n?.(t,e):void 0;if(o?.length)return o[0];if(!t)return e[1]??Ki(e);let i=e.findIndex(s=>Br(s,t)),a=i>=0?e[i+1]:void 0;return a&&!Br(a,t)?a:e.find(s=>!Br(s,t))??t}function cp({fromToken:e,toToken:t,fromAmount:r,toAmount:n,lastChangedBy:o,slippage:i}){return{fromToken:e,toToken:t,fromAmount:r,toAmount:n,lastChangedBy:o,slippage:i}}function Zi(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 r=e;return[...[e instanceof Error?e.name:r.name,e instanceof Error?e.message:r.message,r.shortMessage,r.details,r.code].filter(o=>typeof o=="string"||typeof o=="number").map(String),...Zi(r.cause,t+1),...Zi(r.data,t+1),...Zi(r.error,t+1)]}function Ss(e){let t=Zi(e).join(" ").toLowerCase(),r=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")||r}function dp(e,t){return Ss(e)?"Transaction request was rejected.":(e instanceof Error?e.message:typeof e=="string"?e:"").split(`
|
|
10
|
+
`)[0]?.trim()||t}function up(e){let{tokens:t,initialFromToken:r,initialToToken:n,getToTokens:o,getApproval:i,approveBridge:a,history:s=[],initialSlippage:l="1",termsUrl:c=eo,getQuote:u,submitBridge:h,onSubmitted:g,onSuccess:d,onFailed:w,onExit:f}=e,m=_.useMemo(()=>ap({getQuote:u,submitBridge:h}),[u,h]),[b,y]=_.useState("form"),[p,x]=_.useState(r??Ki(t)),[v,R]=_.useState(()=>Rs(t,r??Ki(t),n,o)),[T,N]=_.useState(""),[S,M]=_.useState(""),[P,j]=_.useState("from"),[L,K]=_.useState(l),[D,O]=_.useState(null),oe=_.useMemo(()=>w0(p,v),[p,v]),G=_.useMemo(()=>oe?"1":L==="auto"?b0(D?.priceImpact):L,[oe,L,D?.priceImpact]),[W,le]=_.useState(""),[Z,V]=_.useState("idle"),[U,te]=_.useState(""),[J,fe]=_.useState(null),[ce,$]=_.useState([]),[be,Ae]=_.useState(!1),[de,Te]=_.useState(g0),[ae,We]=_.useState(null),[Ze,Le]=_.useState(!1),[De,Se]=_.useState(null),[tt,Ge]=_.useState(null),[Fe,wt]=_.useState(!1),[lt,kt]=_.useState(!1),Pe=_.useRef(0),Rt=_.useRef(null),ct=_.useRef(!1),dt=_.useRef(!1),Ht=_.useRef(!1),St=_.useRef(!1),Be=_.useRef(!1);_.useEffect(()=>{ct.current||(ct.current=!0,Ce("bridge","opened"))},[]);let Xe=_.useCallback(()=>{Rt.current&&(clearTimeout(Rt.current),Rt.current=null)},[]),Oe=_.useCallback(A=>{Xe(),Ge(A)},[Xe]);_.useEffect(()=>Xe,[Xe]),_.useEffect(()=>{let A=t.find(se=>Br(se,p))??Ki(t),E=A?o?.(A,t):void 0,B=E?.find(se=>Br(se,v))??(E?void 0:t.find(se=>Br(se,v)))??Rs(t,A,void 0,o);x(A),R(B)},[o,t,p,v]);let He=_.useCallback((A,E)=>{let B=m0(A);if(!B){Pe.current+=1,N(""),M(""),j(E),O(null),le(""),V("idle");return}E==="from"?N(B):M(B),j(E),le(""),!Ht.current&&Number(B)>0&&(Ht.current=!0,Ce("bridge","amount_entered"))},[]),Ye=_.useCallback(()=>{Pe.current+=1,N(""),M(""),j("from"),O(null),le(""),te(""),V("idle"),We(null),Le(!1),Se(null),wt(!1),Oe(null)},[Oe]),Lt=_.useCallback(A=>{Br(A,p)||(dt.current||(dt.current=!0,Ce("bridge","token_selected",{tags:{item_id:`from:${A.symbol}`}})),x(A),R(Rs(t,A,void 0,o)),Ye())},[p,o,Ye,t]),Dt=_.useCallback(A=>{Br(A,v)||Br(A,p)||(dt.current||(dt.current=!0,Ce("bridge","token_selected",{tags:{item_id:`to:${A.symbol}`}})),R(A),Ye())},[p,Ye,v]),qe=_.useMemo(()=>p?o?.(p,t)??t.filter(A=>!Br(A,p)):[],[p,o,t]),Ct=_.useCallback(()=>{p?.balance&&He(p.balance,"from")},[p?.balance,He]),Pt=_.useCallback(()=>{!p||!v||(x(v),R(p),Ye())},[p,Ye,v]),Qt=_.useCallback(()=>{Pe.current+=1,N(""),M(""),j("from"),O(null),le(""),te("")},[]);_.useEffect(()=>{if(!p||!v)return;if(!T&&!S){O(null),le(""),V(B=>B==="quoting"?"idle":B);return}let A=++Pe.current,E=cp({fromToken:p,toToken:v,fromAmount:T,toAmount:S,lastChangedBy:P,slippage:L});V(B=>B==="submitting"?B:m.canQuote?"quoting":"idle"),(async()=>{try{let B=await m.getQuote(E);if(Pe.current!==A)return;B.fromAmount!==void 0&&P==="to"&&N(B.fromAmount),B.toAmount!==void 0&&P==="from"&&M(B.toAmount),O(B.summary??null),le(B.error??"")}catch(B){if(Pe.current!==A)return;le(B instanceof Error?B.message:"Failed to quote bridge.")}finally{Pe.current===A&&V(B=>B==="quoting"?"idle":B)}})()},[T,p,P,m,L,S,v]);let z=_.useCallback(()=>!p||!v?null:cp({fromToken:p,toToken:v,fromAmount:T,toAmount:S,lastChangedBy:P,slippage:G}),[G,T,p,P,S,v]),ne=_.useCallback(async(A,E)=>{te(""),wt(!1),Le(!1),V("submitting");try{if(!E?.skipApprovalCheck&&i){let se=await i(A);if(se){We(se),Se(A),V("idle");return}}We(null),Se(null),Oe("processing");let B=await m.submitBridge(A);fe(B),V("success"),$(se=>[{id:B.txHash,timestamp:new Date().toISOString(),txHash:B.txHash,fromToken:B.fromToken,toToken:B.toToken,fromAmount:B.fromAmount,toAmount:B.toAmount,summary:D??void 0,status:"pending"},...se.filter(Ie=>Ie.txHash!==B.txHash)]),Qt(),kt(!0),Oe(null),wt(!0),Ce("bridge","confirmed"),St.current=!1,Be.current=!1,g?.(B),d?.(B)}catch(B){if(Oe(null),Ce("bridge","confirmed",{status:"failure",reason:sr(B)}),St.current=!1,Be.current=!1,Ss(B)){V("idle");return}let se=dp(B,"Failed to submit bridge.");te(se),V("error"),w?.({message:se})}},[i,w,g,d,m,Qt,Oe,D]),Ue=_.useCallback(async()=>{if(W)return;let A=z();if(A){if(St.current||(St.current=!0,Ce("bridge","submitted")),!de){Se(A),Ae(!0);return}await ne(A)}},[z,W,ne,de]),pt=_.useCallback(async()=>{let A=De??z();A&&(h0(),Te(!0),Ae(!1),await ne(A))},[z,De,ne]),Je=_.useCallback(()=>{Ae(!1),Se(null)},[]),Bt=_.useCallback(async()=>{if(!(Z==="submitting"||!ae||!De||!a)){te(""),V("submitting");try{await a(De,ae),Be.current||(Be.current=!0,Ce("bridge","approved")),We(null),V("idle"),Le(!0)}catch(A){if(Ss(A)){V("idle");return}let E=dp(A,"Failed to approve token.");te(E),V("error"),w?.({message:E})}}},[ae,a,w,De,ne,Z]),zt=_.useCallback(()=>{Z!=="submitting"&&(We(null),Le(!1),Se(null),V("idle"))},[Z]),jr=_.useCallback(async()=>{if(Z==="submitting")return;let A=De??z();if(!A){Le(!1),te("Bridge input is no longer available. Please try again."),V("error");return}Le(!1),await ne(A,{skipApprovalCheck:!0})},[z,De,ne,Z]),cn=_.useCallback(()=>{wt(!1)},[]),ir=_.useCallback(A=>{y(A),A==="history"&&kt(!1)},[]),dn=_.useCallback(()=>{if(b==="history"){ir("form");return}f?.()},[f,ir,b]),Tn=_.useMemo(()=>[...s,...ce.filter(A=>!s.some(E=>E.txHash===A.txHash))],[s,ce]);return{step:b,setStep:ir,status:Z,error:U,quoteError:W,fromToken:p,toToken:v,tokens:t,availableToTokens:qe,fromAmount:T,toAmount:S,lastChangedBy:P,slippage:L,effectiveSlippage:G,slippageLocked:oe,setSlippage:K,summary:D,history:Tn,submitted:J,canSubmit:m.canSubmit,termsOpen:be,approvalInfo:ae,approvalSuccessOpen:Ze,approveBridge:a,pendingSubmitInput:De,submitToast:tt,successDialogOpen:Fe,dismissSuccessDialog:cn,hasNewHistory:lt,termsUrl:c,setFromToken:x,setToToken:R,selectFromToken:Lt,selectToToken:Dt,setAmount:He,setMax:Ct,swapTokens:Pt,submit:Ue,confirmTerms:pt,cancelTerms:Je,confirmApproval:Bt,cancelApproval:zt,continueAfterApproval:jr,back:dn}}ie(`.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}
|
|
11
|
+
`);import{Fragment as Ns,jsx as k,jsxs as F}from"react/jsx-runtime";var wp=Y.createContext(void 0);function lo(){return Y.useContext(wp)}function y0(e){let[t,r]=Y.useState(void 0);return Y.useEffect(()=>{let n=e.current;if(!n)return;let o=()=>{let a=n.closest("[data-theme]");r(a?.getAttribute("data-theme")??void 0)};o();let i=new MutationObserver(o);return i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:["data-theme"]}),()=>i.disconnect()},[e]),t}var fp=[{value:"0.1",label:"0.1%"},{value:"0.5",label:"0.5%"},{value:"1",label:"1%"},{value:"5",label:"5%"}],x0=[{value:"all",label:"ALL"},{value:"completed",label:"Completed"},{value:"pending",label:"Pending"}];function v0(e,t){return e==="auto"?t?`Auto ${t}%`:"Auto":e?`${e}%`:"1%"}function mp(e){let t=e.replace(/[^\d.]/g,""),[r="",...n]=t.split("."),o=n.join("");return n.length===0?r:`${r}.${o.slice(0,2)}`}function k0(e){return`${e.chainId}:${e.address.toLowerCase()}`}function yp(e){let t=Number(e);return Number.isFinite(t)?t.toLocaleString("en-US",{maximumFractionDigits:t>=1?2:6}):e||"0"}function gp(e,t){let r=Number(e||"0"),n=t?.priceUsd??0;return`\u2248 $${(Number.isFinite(r)?r*n:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} USD`}function R0(e,t=6){if(!e)return e;let[r,n=""]=e.split(".");if(!n)return r;let o=n.slice(0,t).replace(/0+$/,"");return o?`${r}.${o}`:r}function S0(e,t){if(!t)return!1;let r=new Vr(e||"0"),n=new Vr(t.balance||"0");return!r.isFinite()||!n.isFinite()?!1:r.isGreaterThan(n)}function C0(e){if(e.priceUsd===void 0)return null;let t=new Vr(e.balance||"0");return t.isFinite()?`\u2248 $${t.multipliedBy(e.priceUsd).toFormat(2)} USD`:null}function N0(e){if(e.priceUsd===void 0)return null;let t=new Vr(e.priceUsd);return t.isFinite()?`$${t.toFormat(t.isLessThan(1)?4:2)}`:null}function xp(e){if(!e.isFinite()||e.isNaN())return"0";let r=e.decimalPlaces(6,Vr.ROUND_DOWN).toFixed(6).replace(/\.?0+$/,""),[n="0",o]=r.split("."),i=new Vr(n||"0").toFormat(0);return o?`${i}.${o}`:i}function T0(e){return e.length<=14?e:`${e.slice(0,6)}...${e.slice(-6)}`}function I0(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let r=n=>n.toString().padStart(2,"0");return[`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}`,`${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}`].join(" ")}function M0(e){let t=new Vr(e||"0");return!t.isFinite()||t.isNaN()?e||"0":xp(t)}function E0(e,t){if(t?.priceUsd===void 0)return null;let r=new Vr(e||"0").multipliedBy(t.priceUsd);return!r.isFinite()||r.isNaN()?null:`$${r.toFormat(2)}`}function Ji(e){return e.status==="success"?"completed":e.status==="failed"?"failed":"pending"}function A0(e,t){return t==="all"?!0:Ji(e)===t}function L0(e){return e==="completed"?"Completed":e==="failed"?"Failed":"Pending"}function hp(e){return e===56||e===97?"BSC":e===612044||e===5555?"CROSS":`Chain ${e}`}function vp(e,t){return!!e&&!!t&&e.chainId===t.chainId&&e.address.toLowerCase()===t.address.toLowerCase()}function kp(e,t){if(!(!e||!t))return e.chainId===t.chainId?"swap":vp(e,t)||e.symbol.toLowerCase()===t.symbol.toLowerCase()?"bridge":"swap-bridge"}function Rp(e){return e==="swap"||e==="deposit-swap"||e==="swap-withdraw"}function Xi(e){return!e||e==="0"||Number(e)===0}function D0(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 P0(e){let t=e.fromToken,r=e.toToken,n=kp(t,r),o=e.fromAmount||"0",i=e.toAmount||"0",a=n!==void 0&&!Rp(n),s=n!==void 0&&n!=="bridge";return{pathType:n,bridgeInfo:a?[{label:"Route",value:t&&r?`${hp(t.chainId)} \u2192 ${hp(r.chainId)}`:"-"},{label:"Validator Fee",value:Xi(o)?"0":"Free",tone:Xi(o)?"default":"accent"},{label:"Network Fee",value:Xi(o)?"0":"Free",tone:Xi(o)?"default":"accent"}]:void 0,swapInfo:s?[t&&r?{label:"Route",value:"",routeTokens:[{symbol:t.symbol,iconUrl:t.iconUrl},{symbol:r.symbol,iconUrl:r.iconUrl}]}:{label:"Route",value:"-"},{label:"Price Impact",value:"0%"},{label:"In Amount",value:o,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:r?{symbol:r.symbol,iconUrl:r.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 Uo({token:e,size:t=20}){let r=e?.iconUrl;return k("span",{className:"bf-token-icon","data-has-image":!!r?"true":"false",style:{width:t,height:t},children:r?k("img",{src:r,alt:"",width:t,height:t,draggable:!1}):k("span",{className:"bf-token-fallback",children:e?.symbol?.slice(0,1)??"?"})})}function bp({label:e,token:t,amount:r,usd:n,onAmountChange:o,onTokenClick:i,locked:a=!1}){return F("section",{className:"bf-amount-panel",children:[F("div",{className:"bf-amount-head",children:[k("span",{children:e}),F("span",{className:"bf-balance",children:[yp(t?.balance??"0")," ",t?.symbol??""]})]}),F("div",{className:"bf-amount-main",children:[F("label",{className:"bf-amount-input-wrap",children:[F("span",{className:"bf-sr-only",children:[e," amount"]}),k("input",{type:"text",inputMode:"decimal",value:r,onChange:s=>o(s.target.value),placeholder:"0",className:"bf-amount-input"}),k("span",{className:"bf-amount-usd",children:n})]}),F("button",{type:"button",className:"bf-token-pill",onClick:a?void 0:i,disabled:!a&&!i,"data-locked":a?"true":void 0,"data-track":a?void 0:"token_select_open","data-track-id":e.toLowerCase(),"aria-label":`Select ${e.toLowerCase()} token`,children:[k(Uo,{token:t}),k("span",{children:t?.symbol??"Select"}),!a&&k(Ln,{size:16})]})]})]})}function B0({flow:e,side:t,onClose:r}){let n=Y.useId(),[o,i]=Y.useState(""),[a,s]=Y.useState(null),l=lo(),c=t==="from"?e.fromToken:e.toToken;Y.useEffect(()=>{s(document.body)},[]),Y.useEffect(()=>{let d=w=>{w.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r]);let u=Y.useMemo(()=>t==="from"?e.tokens:e.availableToTokens,[e.availableToTokens,e.tokens,t]),h=Y.useMemo(()=>{let d=o.trim().toLowerCase();return d?u.filter(w=>w.symbol.toLowerCase().includes(d)||w.name.toLowerCase().includes(d)):u},[o,u]),g=Y.useCallback(d=>{t==="from"?e.selectFromToken(d):e.selectToToken(d),r()},[e,r,t]);return a?so(k("div",{className:"bf-token-picker-overlay","data-theme":l,role:"presentation",onMouseDown:d=>{d.target===d.currentTarget&&r()},children:F("section",{className:"bf-token-picker",role:"dialog","aria-modal":"true","aria-labelledby":n,children:[k("span",{className:"bf-token-picker-handle","aria-hidden":"true"}),F("header",{className:"bf-token-picker-head",children:[k("h3",{id:n,children:"Select a token"}),k("button",{type:"button",className:"bf-token-picker-close",onClick:r,"aria-label":"Close token selector",children:k(fr,{size:24})})]}),F("label",{className:"bf-token-search",children:[k(Xd,{size:20}),k("span",{className:"bf-sr-only",children:"Search tokens"}),k("input",{value:o,onChange:d=>i(d.target.value),placeholder:"Search Tokens",autoComplete:"off",spellCheck:!1})]}),F("div",{className:"bf-token-list",children:[h.map(d=>{let w=vp(d,c),f=w?N0(d):C0(d);return F("button",{type:"button",className:"bf-token-row","data-selected":w?"true":"false",onClick:()=>g(d),children:[F("span",{className:"bf-token-row-left",children:[k(Uo,{token:d,size:40}),F("span",{className:"bf-token-meta",children:[k("span",{className:"bf-token-symbol",children:d.symbol}),!w&&k("span",{className:"bf-token-name",children:d.name})]})]}),F("span",{className:"bf-token-row-right",children:[F("span",{className:"bf-token-balance",children:[yp(d.balance),w?null:` ${d.symbol}`]}),f&&k("span",{className:"bf-token-price",children:f})]})]},k0(d))}),h.length===0&&k("div",{className:"bf-token-empty",children:"No tokens found"})]})]})}),a):null}function z0({flow:e,onClose:t}){let r=Y.useId(),[n,o]=Y.useState(null),i=fp.find(f=>f.value===e.slippage),[a,s]=Y.useState(e.slippage&&!i?e.slippage:""),l=a.trim()!==""&&a.trim()!==".",c=l?Number(a):NaN,u=Number.isFinite(c)&&c>50,h=Number.isFinite(c)&&c>5&&!u,g=f=>{e.setSlippage(f),t()},d=()=>{!l||u||(e.setSlippage(mp(a)),t())};if(Y.useEffect(()=>{o(document.body)},[]),Y.useEffect(()=>{let f=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[t]),!n)return null;let w=lo();return so(k("div",{className:"bf-slippage-overlay","data-theme":w,role:"presentation",onMouseDown:f=>{f.target===f.currentTarget&&t()},children:F("section",{className:"bf-slippage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[F("header",{className:"bf-slippage-head",children:[k("h3",{id:r,children:"Slippage Settings"}),k("button",{type:"button",className:"bf-slippage-close",onClick:t,"aria-label":"Close slippage settings",children:k(fr,{size:24})})]}),F("div",{className:"bf-slippage-body",children:[k("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."}),F("div",{className:"bf-slippage-controls",children:[k("div",{className:"bf-slippage-presets",children:fp.map(f=>k("button",{type:"button",className:"bf-slippage-preset","data-selected":!l&&e.slippage===f.value?"true":"false",onClick:()=>g(f.value),children:f.label},f.value))}),F("label",{className:"bf-slippage-custom","data-selected":l?"true":"false",children:[k("span",{className:"bf-sr-only",children:"Custom slippage percent"}),k("input",{value:a,onChange:f=>{s(mp(f.target.value))},onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),d())},inputMode:"decimal",placeholder:"Enter custom slippage",autoComplete:"off",spellCheck:!1}),k("span",{"aria-hidden":"true",children:"%"})]})]}),u?k("p",{className:"bf-slippage-message","data-variant":"error",children:"Slippage cannot exceed 50%."}):h?k("p",{className:"bf-slippage-message","data-variant":"warning",children:"Your transaction may be frontrun due to high slippage."}):null,l&&k("button",{type:"button",className:"bf-slippage-apply",onClick:d,disabled:u,children:"Apply"})]})]})}),n)}function O0({flow:e}){let t=Y.useId(),[r,n]=Y.useState(!1),[o,i]=Y.useState(null),a=lo();return Y.useEffect(()=>{i(document.body)},[]),Y.useEffect(()=>{let s=l=>{l.key==="Escape"&&e.cancelTerms()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),!o||!e.termsOpen?null:so(k("div",{className:"bf-action-modal-overlay","data-theme":a,role:"presentation",onPointerDown:s=>{s.target===s.currentTarget&&e.cancelTerms()},children:F("section",{className:"bf-action-modal bf-terms-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[k("h3",{id:t,children:"Agree to Terms of Service"}),k("p",{className:"bf-action-modal-desc",children:"Please make sure to review the Terms of Service before using CROSSD."}),F("div",{className:"bf-terms-check-row","data-checked":r?"true":"false",children:[k("button",{type:"button",className:"bf-terms-check-button",role:"checkbox","aria-checked":r,"aria-label":"Agree to Terms of Use","data-track":"terms_check",onClick:()=>n(s=>!s),children:k("span",{className:"bf-terms-checkbox","data-checked":r?"true":"false","aria-hidden":"true"})}),F("div",{className:"bf-terms-copy",children:[k("span",{className:"bf-terms-label",children:"Agree to Terms of Use"}),e.termsUrl&&k("a",{href:e.termsUrl,target:"_blank",rel:"noreferrer",children:"Terms of Service"})]})]}),k("p",{className:"bf-terms-privacy",children:"I have read and acknowledged the Privacy Policy to use CROSSD"}),k("button",{type:"button",className:"bf-action-primary",disabled:!r||e.status==="submitting",onClick:e.confirmTerms,"data-track":"terms_confirm",children:"Confirm"})]})}),o)}function F0({value:e,disabled:t=!1}){let[r,n]=Y.useState(!1);return k("button",{type:"button",className:"bf-copy-button","aria-label":"Copy token address",disabled:t,onClick:()=>{t||navigator.clipboard?.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)})},children:r?"OK":"Copy"})}function U0({flow:e,approval:t}){let r=Y.useId(),[n,o]=Y.useState(null),i=lo();if(Y.useEffect(()=>{o(document.body)},[]),Y.useEffect(()=>{let l=c=>{e.status!=="submitting"&&c.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[e]),!n)return null;let a=e.status==="submitting"||!e.approveBridge,s=e.status==="submitting";return so(k("div",{className:"bf-action-modal-overlay","data-theme":i,role:"presentation",children:F("section",{className:"bf-action-modal bf-approve-modal",role:"dialog","aria-modal":"true","aria-labelledby":r,children:[F("h3",{id:r,children:["Approve ",t.token.symbol]}),k(Uo,{token:t.token,size:72}),F("div",{className:"bf-approve-address-box",children:[k("span",{children:"Token Address"}),F("div",{children:[k("strong",{children:t.tokenAddress}),k(F0,{value:t.tokenAddress,disabled:s})]})]}),F("div",{className:"bf-action-buttons",children:[k("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:e.status==="submitting",children:"Cancel"}),F("button",{type:"button",className:"bf-action-primary",onClick:e.confirmApproval,disabled:a,"aria-busy":s,"data-track":"approve_confirm",children:[s&&k("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),k("span",{children:s?"Approving...":"Approve"})]})]})]})}),n)}function j0({flow:e}){let t=Y.useId(),[r,n]=Y.useState(null),o=lo();if(Y.useEffect(()=>{n(document.body)},[]),Y.useEffect(()=>{if(!e.approvalSuccessOpen)return;let a=s=>{s.key==="Escape"&&e.cancelApproval()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!r||!e.approvalSuccessOpen)return null;let i=e.status==="submitting";return so(k("div",{className:"bf-action-modal-overlay","data-theme":o,role:"presentation",children:F("section",{className:"bf-action-modal bf-approval-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:[k("h3",{id:t,children:"Approval Success"}),k("span",{className:"bf-success-mark","aria-hidden":"true"}),F("p",{className:"bf-action-modal-desc",children:["Token approval confirmed successfully.",k("br",{}),"Please continue to the next step."]}),F("div",{className:"bf-action-buttons",children:[k("button",{type:"button",className:"bf-action-secondary",onClick:e.cancelApproval,disabled:i,children:"Cancel"}),F("button",{type:"button",className:"bf-action-primary",onClick:e.continueAfterApproval,disabled:i,"aria-busy":i,children:[i&&k("span",{className:"bf-action-button-spinner","aria-hidden":"true"}),k("span",{children:i?"Continuing...":"Continue"})]})]})]})}),r)}function W0({fromAmount:e,toAmount:t,fromToken:r,toToken:n}){let[o,i]=Y.useState(!1),a=Y.useMemo(()=>{let c=new Vr(e||"0"),u=new Vr(t||"0");return!c.isFinite()||!u.isFinite()||c.lte(0)||u.lte(0)?null:o?c.dividedBy(u):u.dividedBy(c)},[e,o,t]);if(!a||!r||!n||r.symbol===n.symbol)return null;let s=o?n.symbol:r.symbol,l=o?r.symbol:n.symbol;return F("button",{type:"button",className:"bf-exchange-rate",onClick:()=>i(c=>!c),"data-track":"rate_reverse",children:[F("span",{children:["1 ",s]}),k(rp,{size:12}),F("span",{children:[xp(a)," ",l]})]})}function _0({flow:e}){return e.submitToast?F("div",{className:"bf-status-toast","data-variant":"processing",role:"status","aria-live":"polite",children:[k("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:k("span",{className:"bf-status-spinner"})}),F("span",{className:"bf-status-toast-copy",children:[k("strong",{children:"Transaction Processing"}),k("span",{children:"Your transaction is being processed on the blockchain"})]})]}):null}function G0({message:e}){let[t,r]=Y.useState(!1);return Y.useEffect(()=>{if(!e){r(!1);return}r(!0);let n=window.setTimeout(()=>{r(!1)},3500);return()=>window.clearTimeout(n)},[e]),!e||!t?null:F("div",{className:"bf-status-toast","data-variant":"error",role:"alert","aria-live":"assertive",children:[k("span",{className:"bf-status-toast-icon","aria-hidden":"true",children:k("span",{className:"bf-status-error-mark",children:"!"})}),F("span",{className:"bf-status-toast-copy",children:[k("strong",{children:"Error"}),k("span",{children:e})]})]})}function H0(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 Q0({flow:e}){let t=Y.useId(),[r,n]=Y.useState(null),o=e.submitted,i=lo();return Y.useEffect(()=>{n(document.body)},[]),Y.useEffect(()=>{if(!e.successDialogOpen)return;let a=s=>{s.key==="Escape"&&e.dismissSuccessDialog()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),!r||!e.successDialogOpen||!o?null:so(k("div",{className:"bf-success-overlay","data-theme":i,role:"presentation",children:k("section",{className:"bf-success-modal",role:"dialog","aria-modal":"true","aria-labelledby":t,children:F("div",{className:"bf-success-body",children:[k("span",{className:"bf-success-mark","aria-hidden":"true"}),F("div",{className:"bf-success-copy",children:[k("strong",{id:t,children:H0(o.pathType)}),k("span",{children:"Please check the results in the history."})]}),k("div",{className:"bf-success-route","aria-hidden":"true",children:(o.routeTokens&&o.routeTokens.length>0?o.routeTokens:[{symbol:o.fromToken.symbol,iconUrl:o.fromToken.iconUrl},{symbol:o.toToken.symbol,iconUrl:o.toToken.iconUrl}]).map((a,s)=>F(Y.Fragment,{children:[s>0&&k("span",{className:"bf-success-route-arrow",children:"\u2192"}),k(Cs,{token:a,size:43})]},`${a.symbol}-${s}`))}),k("button",{type:"button",className:"bf-success-ok",onClick:e.dismissSuccessDialog,"data-track":"success_ok",children:"OK"})]})})}),r)}function Cs({token:e,size:t=16}){let r=!!e.iconUrl;return k("span",{className:"bf-token-icon","data-has-image":r?"true":"false",style:{width:t,height:t},children:e.iconUrl?k("img",{src:e.iconUrl,alt:"",width:t,height:t,draggable:!1}):k("span",{className:"bf-token-fallback",children:e.symbol?.slice(0,1)??"?"})})}function V0({row:e}){return e.routeTokens&&e.routeTokens.length>0?k("span",{className:"bf-info-route",children:e.routeTokens.map((t,r)=>F(Y.Fragment,{children:[r>0&&k("span",{className:"bf-info-route-arrow","aria-hidden":"true",children:"\u2192"}),k(Cs,{token:t})]},`${t.symbol}-${r}`))}):e.valueToken?F("span",{className:"bf-info-value-token",children:[k(Cs,{token:e.valueToken}),k("span",{children:e.value})]}):k(Ns,{children:e.value})}function Sp({rows:e}){return!e||e.length===0?null:k("div",{className:"bf-info-rows",children:e.map((t,r)=>F("div",{className:"bf-info-row",children:[F("span",{className:"bf-info-label",children:[k("span",{className:"bf-tree-marker",children:r===e.length-1?"\u2514":"\u251C"}),k("span",{children:t.label})]}),k("span",{className:"bf-info-value","data-tone":t.tone??"default",children:k(V0,{row:t})})]},`${t.label}-${t.value}`))})}function Y0(e,t,r){return e.pathType==="bridge"?"Bridge Info":Rp(e.pathType)?"Swap Info":t&&r?"Swap & Bridge Info":t?"Bridge Info":"Swap Info"}function q0({summary:e}){let t=!!e.bridgeInfo?.length,r=!!e.swapInfo?.length,n=t&&r,o=e.pathType==="bridge-swap"?["bridge","swap"]:["swap","bridge"];return k(Ns,{children:o.map(i=>{let a=i==="swap"?e.swapInfo:e.bridgeInfo;return a?.length?F("div",{className:"bf-info-section",children:[n&&k("h4",{children:i==="swap"?"Swap Info":"Bridge Info"}),k(Sp,{rows:a})]},i):null})})}function K0({summary:e}){let t=!!e.bridgeInfo?.length,r=!!e.swapInfo?.length,n=!!e.txFee?.length,o=Y0(e,t,r),[i,a]=Y.useState(!0),[s,l]=Y.useState(!0);return F("div",{className:"bf-details",children:[e.liquidity&&F("section",{className:"bf-liquidity",children:[F("div",{className:"bf-liquidity-head",children:[k("span",{children:e.liquidity.label??"Available Liquidity"}),k("span",{className:"bf-liquidity-status","data-status":e.liquidity.status,children:e.liquidity.status??"Normal"})]}),k("div",{className:"bf-liquidity-track",children:k("span",{style:{width:`${e.liquidity.percentage??50}%`}})})]}),(t||r)&&F("section",{className:"bf-detail-section bf-info-card","data-open":i?"true":"false",children:[F("button",{type:"button",className:"bf-collapse-head","aria-expanded":i,onClick:()=>a(c=>!c),"data-track":"details_toggle",children:[k("h3",{children:o}),k(Ln,{size:16,className:"bf-collapse-chevron"})]}),i&&k("div",{className:"bf-collapse-body",children:k(q0,{summary:e})})]}),n&&F("section",{className:"bf-detail-section bf-tx-fee-section","data-open":s?"true":"false",children:[F("button",{type:"button",className:"bf-collapse-head bf-tx-fee-head","aria-expanded":s,onClick:()=>l(c=>!c),"data-track":"details_toggle",children:[k("h3",{children:"Est. Tx Fee"}),F("div",{className:"bf-tx-fee-total",children:[e.txFeeInfo?.isDelegateFee&&k("span",{className:"bf-fee-delegated",children:"Fee Delegated"}),e.txFeeInfo?.tokenIconUrl&&k("img",{className:"bf-tx-fee-token",src:e.txFeeInfo.tokenIconUrl,alt:e.txFeeInfo.tokenSymbol??"",width:16,height:16,draggable:!1}),k("span",{"data-delegated":e.txFeeInfo?.isDelegateFee&&Number(e.txFeeInfo?.estTxFee)>0?"true":void 0,children:R0(e.txFeeInfo?.estTxFee??"0")}),k(Ln,{size:16,className:"bf-collapse-chevron"})]})]}),s&&k("div",{className:"bf-collapse-body",children:k(Sp,{rows:e.txFee})})]})]})}function Z0({item:e}){let t=Ji(e),r=E0(e.fromAmount,e.fromToken);return F("article",{className:"bf-history-item",children:[F("div",{className:"bf-history-item-head",children:[k("span",{className:"bf-history-status","data-status":t,children:L0(t)}),k("time",{className:"bf-history-time",dateTime:e.timestamp,children:I0(e.timestamp)})]}),F("div",{className:"bf-history-item-body",children:[F("strong",{className:"bf-history-amount",children:[M0(e.fromAmount)," ",e.fromToken.symbol]}),F("div",{className:"bf-history-meta",children:[k("span",{className:"bf-history-usd",children:r??T0(e.txHash)}),F("span",{className:"bf-history-route",children:[F("span",{className:"bf-history-route-token",children:[k(Uo,{token:e.fromToken,size:16}),k("span",{children:e.fromToken.symbol})]}),k(tp,{size:16,className:"bf-history-route-arrow"}),F("span",{className:"bf-history-route-token",children:[k(Uo,{token:e.toToken,size:16}),k("span",{children:e.toToken.symbol})]})]})]})]})]})}function X0({flow:e}){let[t,r]=Y.useState("all"),n=e.history.some(a=>Ji(a)==="pending"),o=e.history.filter(a=>A0(a,t)),i=t==="all"?"No bridge history yet.":`No ${t} bridge history.`;return F("main",{className:"bf-history-body",children:[k("nav",{className:"bf-history-tabs","aria-label":"Bridge history filters",children:x0.map(a=>F("button",{type:"button",className:"bf-history-tab","data-active":t===a.value?"true":"false",onClick:()=>r(a.value),"data-track":"history_filter","data-track-id":a.value,children:[k("span",{children:a.label}),a.value==="pending"&&n&&k("span",{className:"bf-history-tab-dot","aria-hidden":"true"})]},a.value))}),o.length>0?k("div",{className:"bf-history-list",children:o.map(a=>k(Z0,{item:a},a.id||a.txHash))}):k("div",{className:"bf-empty",children:i})]})}function J0({flow:e,env:t}){let[r,n]=Y.useState(null),[o,i]=Y.useState(!1),[a,s]=Y.useState(0),c=!!(e.fromAmount.trim()||e.toAmount.trim())?e.summary??P0(e):null,u=Er("apps.json",t,p=>ar(p?.bridgePoweredBy?.url,t)),h=D0(e.quoteError),g=S0(e.fromAmount,e.fromToken),d=g?"Insufficient balance":h.from,w=e.quoteError&&!h.from&&!h.to?e.quoteError:"",f=e.error||w,m=e.history.some(p=>Ji(p)==="pending"),y=(c?.pathType??kp(e.fromToken,e.toToken))!=="bridge";return F(Ns,{children:[F("main",{className:"bf-body",children:[F("div",{className:"bf-toolbar",children:[F("button",{type:"button",className:"bf-chip bf-chip-history",onClick:()=>e.setStep("history"),"data-track":"history_open",children:[k(Jd,{}),k("span",{children:"History"}),(m||e.hasNewHistory)&&k("span",{className:"bf-chip-dot","aria-hidden":"true"})]}),y&&F("button",{type:"button",className:"bf-chip",onClick:()=>i(!0),"data-track":"slippage_open",disabled:e.slippageLocked,"aria-haspopup":"dialog","aria-expanded":o,children:[k($d,{}),k("span",{children:e.slippageLocked?"Auto 1%":v0(e.slippage,e.effectiveSlippage)})]})]}),F("div",{className:"bf-swap-card","data-has-from-error":d?"true":"false",children:[k(bp,{label:"From",token:e.fromToken,amount:e.fromAmount,usd:gp(e.fromAmount,e.fromToken),onAmountChange:p=>e.setAmount(p,"from"),onTokenClick:()=>n("from")}),d&&k("div",{className:"bf-field-error",children:d}),k("button",{type:"button",className:"bf-swap-toggle",onClick:()=>{e.swapTokens(),s(p=>p+360)},"data-track":"token_swap",style:{transform:`translateX(-50%) rotate(${a}deg)`,transition:"transform 0.2s ease"},children:k(ep,{size:22})}),k(bp,{label:"To",token:e.toToken,amount:e.toAmount,usd:gp(e.toAmount,e.toToken),onAmountChange:p=>e.setAmount(p,"to"),onTokenClick:()=>n("to"),locked:e.availableToTokens.length<=1}),h.to&&k("div",{className:"bf-field-error",children:h.to})]}),k(W0,{fromAmount:e.fromAmount,toAmount:e.toAmount,fromToken:e.fromToken,toToken:e.toToken}),c&&k(K0,{summary:c})]}),F("footer",{className:"bf-footer",children:[k("button",{type:"button",className:"bf-next",onClick:e.submit,"data-track":"next",disabled:e.status==="submitting"||!!e.quoteError||g,children:e.status==="submitting"?"Processing...":"Next"}),u&&F("a",{className:"bf-powered",href:u,target:"_blank",rel:"noreferrer",children:["Powered by ",k("span",{className:"bf-powered-brand",children:"CROSS DeFi"})]})]}),r&&k(B0,{flow:e,side:r,onClose:()=>n(null)}),o&&k(z0,{flow:e,onClose:()=>i(!1)}),k(O0,{flow:e}),e.approvalInfo&&k(U0,{flow:e,approval:e.approvalInfo}),k(j0,{flow:e}),k(_0,{flow:e}),k(G0,{message:e.submitToast?"":f}),k(Q0,{flow:e})]})}function $i({onClose:e,onBackToWallet:t,env:r,className:n,...o}){let i=Y.useMemo(()=>Qe(r),[r]),a=up({...o,onExit:t}),s=Y.useRef(null),l=y0(s),c=a.step==="history"?"History":"Swap & Bridge";return k(pe,{feature:"bridge",children:k(wp.Provider,{value:l,children:F("div",{ref:s,className:xe("bf-root",n),"data-view":a.step,"data-status":a.status,children:[F("header",{className:"bf-header",children:[k("button",{type:"button",className:"bf-header-btn",onClick:a.back,"aria-label":"Back",children:k($r,{size:24})}),k("span",{className:"bf-header-title",children:c}),k("button",{type:"button",className:"bf-header-btn",onClick:e,"aria-label":"Close",children:k(fr,{size:24})})]}),a.step==="history"?k(X0,{flow:a}):k(J0,{flow:a,env:i})]})})})}import*as jt from"react";import Mp from"bignumber.js";import{useInfiniteQuery as $0}from"@tanstack/react-query";var eb="token-history";function Cp(e,t,r,n,o=!0){return $0({queryKey:[eb,e,t,r.toLowerCase(),n.toLowerCase()],initialPageParam:void 0,queryFn:async({pageParam:i,signal:a})=>{let s=await we("walletServer",e),l=new URLSearchParams({chain_id:String(t),token:r,wallet:n}),c=i;c&&(l.set("last_timestamp",String(c.last_timestamp)),l.set("last_log_index",String(c.last_log_index)),l.set("last_tx_index",String(c.last_tx_index)));let u=await fetch(`${s}/v1/public/token/historical?${l}`,{cache:"no-store",signal:a});if(!u.ok)throw new Error(`Failed to fetch token history: ${u.status}`);let h=await u.json();if(h.code!==200)throw new Error(`Token history API error: ${h.code}`);return h.data??[]},getNextPageParam:i=>{if(!i||i.length===0)return;let a=i[i.length-1];return{last_timestamp:a.timestamp,last_log_index:a.log_index,last_tx_index:a.tx_index}},enabled:o&&!!n&&!!r&&t>0,staleTime:1e4})}import*as ea from"react";var Ts={chart:!1,balance:!0,overview:!1,social:!1,history:!0},tb=Object.keys(Ts),rb="apps.json";function Np(e){let[t,r]=ea.useState({visibility:Ts,isLoaded:!1});return ea.useEffect(()=>{let n=!0;return Mn(rb,e).then(o=>{if(!n)return;let i=o?.tokenDetail?.sections,a={...Ts};if(i)for(let s of tb){let l=i[s];typeof l=="boolean"&&(a[s]=l)}r({visibility:a,isLoaded:!0})}),()=>{n=!1}},[e]),t}import*as Xt from"react";import{useQuery as nb,keepPreviousData as ob}from"@tanstack/react-query";var ib="token-price-history";function Tp(e,t,r,n,o=!0){return nb({queryKey:[ib,e,t,r.toLowerCase(),n],queryFn:async({signal:i})=>{let a=await we("walletServer",e),s=new URLSearchParams({chain_id:String(t),token:r,interval:n}),l=await fetch(`${a}/v1/public/token/price/historical?${s}`,{cache:"no-store",signal:i});if(!l.ok)throw new Error(`Failed to fetch token price history: ${l.status}`);let c=await l.json();if(c.code!==200)throw new Error(`Token price history API error: ${c.code}`);return c.data??[]},enabled:o&&!!r&&t>0,staleTime:3e4,placeholderData:ob})}import{Fragment as mb,jsx as It,jsxs as co}from"react/jsx-runtime";var ab="var(--ds-system-green-high, #00a869)",sb="var(--wi-error, #e70077)",jn=150,ta=3,Is=18,lb=18,cb=[{key:"10m",label:"10m"},{key:"1h",label:"1H"},{key:"1d",label:"1D"},{key:"7d",label:"1W"},{key:"30d",label:"1M"},{key:"1y",label:"1Y"}],db=new Set(["7d","30d","1y"]);function pb(){let e=Xt.useRef(null),[t,r]=Xt.useState(0);return Xt.useEffect(()=>{let n=e.current;if(!n)return;let o=new ResizeObserver(i=>{r(i[0]?.contentRect.width??0)});return o.observe(n),r(n.clientWidth),()=>o.disconnect()},[]),[e,t]}function ub(e,t){let r=new Date(e*1e3),n=t?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{hour:"numeric",minute:"2-digit"};return new Intl.DateTimeFormat("en-US",n).format(r)}function fb(e,t){if(t<=0||e.length===0)return null;let r=e.length===1?[e[0],e[0]]:e,n=r.length,o=r[0],i=r[0],a=0,s=0;for(let y=1;y<n;y++)r[y]>o&&(o=r[y],a=y),r[y]<i&&(i=r[y],s=y);let l=o-i||1,c=Math.max(1,t-ta*2),u=jn-Is-lb,h=y=>n===1?t/2:ta+y/(n-1)*c,g=y=>Is+(1-(y-i)/l)*u,d=r.map((y,p)=>({x:h(p),y:g(y)})),w=d.map((y,p)=>`${p===0?"M":"L"}${y.x.toFixed(2)},${y.y.toFixed(2)}`).join(" "),f=d[0],m=d[d.length-1],b=`${w} L${m.x.toFixed(2)},${jn} L${f.x.toFixed(2)},${jn} Z`;return{values:r,points:d,linePath:w,areaPath:b,maxIdx:a,minIdx:s}}function Ip({env:e,chainId:t,tokenAddress:r}){let[n,o]=Xt.useState("1d"),[i,a]=Xt.useState(null),s=Xt.useId(),[l,c]=pb(),{data:u,isLoading:h,isError:g}=Tp(e,t,r,n,!0),d=Xt.useMemo(()=>(u??[]).filter(O=>Number.isFinite(Number(O.price))).slice().sort((O,oe)=>O.updated_at-oe.updated_at),[u]),w=Xt.useMemo(()=>d.map(D=>Number(D.price)),[d]),f=Xt.useMemo(()=>fb(w,c),[w,c]);Xt.useEffect(()=>{a(null)},[n]);let m=d.length>0,b=i!==null&&i<w.length?i:w.length-1,y=m?w[b]:0,p=m?w[0]:0,x=p!==0?(y-p)/p*100:0,v=x>=0,R=v?ab:sb,T=(v?"+":"-")+(Math.floor(Math.abs(x)*100)/100).toFixed(2)+"%",N=i!==null&&d[i]?ub(d[i].updated_at,db.has(n)):"",S=D=>{if(!f||c<=0)return;let O=D.currentTarget.getBoundingClientRect(),oe=D.clientX-O.left;if(f.values.length<=1){a(0);return}let W=Math.max(1,c-ta*2),le=Math.min(1,Math.max(0,(oe-ta)/W)),Z=Math.round(le*(d.length-1));a(Math.min(d.length-1,Math.max(0,Z)))},M=()=>a(null);if(!h&&(g||!m))return null;let P=i!==null&&f&&f.points[i]?f.points[i]:null,j=f?.points[f.maxIdx],L=f?.points[f.minIdx],K=D=>Math.min(Math.max(D,24),Math.max(24,c-24));return co("section",{className:"wi-td-chart",children:[co("div",{className:"wi-td-chart-panel",children:[It("span",{className:"wi-td-chart-price",children:m?Pn(y):"\u2014"}),m&&co("span",{className:"wi-td-chart-change","data-positive":v,children:[It("span",{children:T}),N&&It("span",{className:"wi-td-chart-when",children:N})]})]}),It("div",{ref:l,className:"wi-td-chart-plot",children:h&&!m?It("div",{className:"wi-skeleton-block wi-td-chart-skeleton"}):f&&c>0&&co("svg",{className:"wi-td-chart-svg",width:c,height:jn,role:"img","aria-label":"Price chart",children:[It("defs",{children:co("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[It("stop",{offset:"0%",stopColor:R,stopOpacity:.28}),It("stop",{offset:"100%",stopColor:R,stopOpacity:0})]})}),It("path",{d:f.areaPath,fill:`url(#${s})`}),It("path",{d:f.linePath,fill:"none",stroke:R,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),j&&It("text",{className:"wi-td-chart-minmax",x:K(j.x),y:Math.max(11,j.y-7),textAnchor:"middle",children:Pn(f.values[f.maxIdx])}),L&&f.minIdx!==f.maxIdx&&It("text",{className:"wi-td-chart-minmax",x:K(L.x),y:Math.min(jn-5,L.y+14),textAnchor:"middle",children:Pn(f.values[f.minIdx])}),P&&co(mb,{children:[It("line",{className:"wi-td-chart-cursor",x1:P.x,y1:Is-6,x2:P.x,y2:jn}),It("circle",{cx:P.x,cy:P.y,r:4,fill:R,stroke:"var(--wi-surface-bg, #121212)",strokeWidth:2})]}),It("rect",{x:0,y:0,width:c,height:jn,fill:"transparent",style:{touchAction:"none"},onPointerMove:S,onPointerDown:S,onPointerLeave:M,onPointerCancel:M})]})}),It("div",{className:"wi-td-chart-tabs",role:"tablist",children:cb.map(D=>It("button",{type:"button",role:"tab","aria-selected":n===D.key,className:"wi-td-chart-tab","data-active":n===D.key||void 0,onClick:()=>o(D.key),"data-track":"token_detail_interval","data-track-id":D.key,children:D.label},D.key))})]})}import{Fragment as Lp,jsx as H,jsxs as _e}from"react/jsx-runtime";var gb="https://contents.crosstoken.io/wallet/token/images/FT.png",hb={receive:"Receive",send:"Send","bridge-in":"Bridge In","bridge-out":"Bridge Out"};function bb(e){return e.length>24?"xs":e.length>18?"sm":"md"}function wb(e){if(!e)return"";let t=e<1e12?e*1e3:e,r=Math.max(0,Math.floor((Date.now()-t)/1e3));if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m`;let o=Math.floor(n/60);if(o<24)return`about ${o}h`;let i=Math.floor(o/24);if(i<30)return`${i}d`;let a=Math.floor(i/30);return a<12?`${a}mo`:`${Math.floor(a/12)}y`}function Ep(e){let[t,r]=e.split("."),n="";for(let o=0;o<t.length;o++){let i=t.length-o;o>0&&i%3===0&&(n+=","),n+=t[o]}return r?`${n}.${r}`:n}function Ap(e,t){let r=BigInt(e||"0");if(t<=2){let a=10n**BigInt(t),s=r/a,l=r%a*10n**BigInt(2-t);return`${s.toString()}.${l.toString().padStart(2,"0")}`}let n=r/10n**BigInt(t-2),o=n/100n,i=n%100n;return`${o.toString()}.${i.toString().padStart(2,"0")}`}function yb(e,t,r){let n=jt.useRef(null),o=jt.useRef(null),[i,a]=jt.useState(t);return jt.useLayoutEffect(()=>{let s=n.current,l=o.current;if(!s||!l)return;let c=()=>{let h=s.clientWidth;if(!h)return;let g=window.getComputedStyle(l),d=document.createElement("span");d.textContent=l.textContent,d.style.cssText=["position:absolute","left:-9999px","top:-9999px","visibility:hidden","white-space:nowrap",`font-family:${g.fontFamily}`,`font-weight:${g.fontWeight}`,`letter-spacing:${g.letterSpacing}`,`font-size:${t}px`].join(";"),document.body.appendChild(d);let w=d.offsetWidth;if(document.body.removeChild(d),w<=h){a(t);return}let f=Math.max(r,Math.floor(t*h/w));a(f)};c();let u=new ResizeObserver(c);return u.observe(s),()=>u.disconnect()},[e,t,r]),{containerRef:n,textRef:o,fontSize:i}}function xb(e){if(!e)return"-";let t=new Mp(e);return t.isNaN()?"-":t.decimalPlaces(4,Mp.ROUND_DOWN).toFormat()}function vb(){return _e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[H("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.6"}),H("path",{d:"M3 12h18M12 3c2.5 2.5 3.8 5.8 3.8 9s-1.3 6.5-3.8 9c-2.5-2.5-3.8-5.8-3.8-9S9.5 5.5 12 3Z",stroke:"currentColor",strokeWidth:"1.6"})]})}function kb(){return H("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:H("path",{d:"M21.9 4.3 18.6 20c-.2 1-.9 1.3-1.8.8l-4.9-3.6-2.4 2.3c-.3.3-.5.5-1 .5l.3-4.9 9-8.1c.4-.3-.1-.5-.6-.2L6.2 13.2l-4.8-1.5c-1-.3-1-1 .2-1.5L20.6 3c.9-.3 1.6.2 1.3 1.3Z"})})}function Rb(){return H("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:H("path",{d:"M18.9 2H22l-7.3 8.3L23.3 22h-6.8l-5.3-6.9L5.1 22H2l7.8-8.9L1 2h6.9l4.8 6.4L18.9 2Zm-1.2 18h1.9L7.2 4H5.2l12.5 16Z"})})}function Sb(){return H("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:H("path",{d:"M6.9 6.5c0-.2-.1-.5-.3-.6L4.6 3.6V3.3h6.3l4.9 10.7 4.3-10.7H26v.3l-1.8 1.7c-.2.1-.2.3-.2.5v12.4c0 .2 0 .4.2.5l1.7 1.7v.3h-8.7v-.3l1.8-1.7c.2-.2.2-.2.2-.5V8.1l-5 12.6h-.7L7.9 8.1v8.5c0 .3.1.6.3.8l2.3 2.8v.3H4v-.3l2.3-2.8c.2-.2.3-.5.3-.8V6.5Z",transform:"scale(0.85)"})})}function Dp({env:e,isMobile:t,token:r,walletAddress:n,stat:o,tokenInfo:i,showBalance:a=!0,onBack:s,onClose:l,onSend:c,onOutlink:u}){let h=r.quantity.decimals,[g,d]=jt.useState(!1),{buildTxUrl:w,chainInfo:f}=nc(e,r.chainId,!0),{visibility:m}=Np(e),{data:b,isLoading:y,isError:p,fetchNextPage:x,hasNextPage:v,isFetchingNextPage:R,refetch:T}=Cp(e,r.chainId,r.address,n,!0),N=jt.useMemo(()=>b?.pages?b.pages.flat():[],[b]),S=jt.useRef(null);jt.useEffect(()=>{if(!t)return;let U=S.current;if(!U||!v)return;let te=new IntersectionObserver(J=>{J[0]?.isIntersecting&&!R&&x()},{rootMargin:"120px"});return te.observe(U),()=>te.disconnect()},[t,v,R,x]);let M=jt.useCallback(()=>{navigator?.clipboard&&navigator.clipboard.writeText(r.address).then(()=>{d(!0),setTimeout(()=>d(!1),1500)}).catch(()=>{})},[r.address]),P=Ep(Ap(r.quantity.numeric,h)),j=o?.price?yi(r.quantity.numeric,h,o.price):null,L=a?P:"\u2022\u2022\u2022\u2022",{containerRef:K,textRef:D,fontSize:O}=yb(L,30,14),G=So(r.chainId,e).name??f?.name??`Chain ${r.chainId}`,W=f?.explorer_url,le=i?.deployed??!0,Z=jt.useMemo(()=>{let U=[];return i?.info_url&&U.push({key:"web",label:"Website",url:i.info_url,icon:H(vb,{})}),i?.telegram_url&&U.push({key:"tg",label:"Telegram",url:i.telegram_url,icon:H(kb,{})}),i?.x_url&&U.push({key:"x",label:"X",url:i.x_url,icon:H(Rb,{})}),i?.medium_url&&U.push({key:"medium",label:"Medium",url:i.medium_url,icon:H(Sb,{})}),U},[i]),V=(U,te,J,fe)=>{bt(U,te,{category:"token-detail",origin:J,payload:{address:r.address,txHash:fe}},u)};return _e(Lp,{children:[_e("div",{className:"wi-sticky-header",children:[_e("div",{className:"wi-header wi-header--receive",children:[H("button",{type:"button",className:"wi-header-back",onClick:s,"aria-label":"Back",children:H($r,{size:24})}),_e("span",{className:"wi-td-header-title",children:[H("img",{src:r.icon_url,alt:"","aria-hidden":!0,className:"wi-td-header-icon",width:24,height:24,draggable:!1,onError:U=>{U.currentTarget.src=gb}}),H("span",{className:"wi-td-header-name",children:r.symbol})]}),H("button",{type:"button",className:"wi-header-action",onClick:l,"aria-label":"Close",children:H(fr,{size:24})})]}),H("hr",{className:"wi-divider"})]}),_e("div",{className:"wi-td-scroll",children:[m.chart&&H(Ip,{env:e,chainId:r.chainId,tokenAddress:r.address}),m.balance&&_e("section",{className:"wi-td-balance-card",children:[_e("div",{className:"wi-td-balance-left",ref:K,children:[H("span",{className:"wi-td-balance-label",children:"My Balance"}),H("span",{className:"wi-td-balance-amount",ref:D,style:{fontSize:O},children:L}),a&&j&&H("span",{className:"wi-td-balance-fiat",children:j})]}),H("button",{type:"button",className:"wi-td-send-btn",onClick:()=>c(r),"aria-label":`Send ${r.symbol}`,"data-track":"token_detail_send","data-track-id":r.symbol,children:H("span",{children:"Send"})})]}),m.overview&&_e("section",{className:"wi-td-section",children:[H("h3",{className:"wi-td-section-title",children:"Crypto Overview"}),_e("div",{className:"wi-td-rows",children:[_e("div",{className:"wi-td-row",children:[H("span",{className:"wi-td-row-label",children:"Network"}),W?_e("a",{className:"wi-td-row-value wi-td-row-link",href:W,target:"_blank",rel:"noopener noreferrer",onClick:U=>V(U,W,"token-network"),children:[H("span",{children:G}),H(Cb,{})]}):H("span",{className:"wi-td-row-value",children:G})]}),_e("div",{className:"wi-td-row",children:[H("span",{className:"wi-td-row-label",children:"Contract Address"}),_e("button",{type:"button",className:"wi-td-row-value wi-td-row-copy",onClick:M,"aria-label":"Copy contract address",children:[H("span",{children:Ft(r.address)}),g?H(Jr,{size:14}):H(An,{size:14})]})]}),_e("div",{className:"wi-td-row",children:[H("span",{className:"wi-td-row-label",children:"Decimals"}),H("span",{className:"wi-td-row-value",children:h})]}),_e("div",{className:"wi-td-row",children:[H("span",{className:"wi-td-row-label",children:"Total Supply"}),H("span",{className:"wi-td-row-value",children:xb(o?.circulating_supply)})]})]})]}),m.social&&Z.length>0&&_e("section",{className:"wi-td-section",children:[H("h3",{className:"wi-td-section-title",children:"Social Media"}),H("div",{className:"wi-td-social-row",children:Z.map(U=>H("a",{className:"wi-td-social-btn",href:U.url,target:"_blank",rel:"noopener noreferrer","aria-label":U.label,onClick:te=>V(te,U.url,"token-social"),children:U.icon},U.key))})]}),m.history&&_e("section",{className:"wi-td-section",children:[H("h3",{className:"wi-td-section-title",children:"Token History"}),y&&H("div",{className:"wi-td-history-list",children:Array.from({length:3},(U,te)=>_e("div",{className:"wi-td-history-skeleton",children:[H("div",{className:"wi-skeleton-block",style:{width:90,height:14}}),H("div",{className:"wi-skeleton-block",style:{width:60,height:14}})]},`td-sk-${te}`))}),!y&&p&&_e("div",{className:"wi-td-history-empty",children:[H("span",{children:"Failed to load history."}),H("button",{type:"button",className:"wi-td-retry-btn",onClick:()=>T(),children:"Retry"})]}),!y&&!p&&N.length===0&&H("div",{className:"wi-td-history-empty",children:H("span",{children:"No transactions found."})}),!y&&!p&&N.length>0&&_e("div",{className:"wi-td-history-list",children:[N.map((U,te)=>{let J=U.to_alias?.toLowerCase().includes("bridge")??!1,fe=U.from_alias?.toLowerCase().includes("bridge")??!1,ce=J?"bridge-out":fe?"bridge-in":U.to?.toLowerCase()===n.toLowerCase()?"receive":"send",$=ce==="receive"||ce==="bridge-in",be=$?U.from:U.to,Ae=Ep(Ap(U.amount,h)),de=w(U.tx),Te=wb(U.timestamp),ae=_e(Lp,{children:[_e("div",{className:"wi-td-history-top",children:[H("span",{className:"wi-td-history-type","data-direction":ce,children:hb[ce]}),H("span",{className:"wi-td-history-counter",children:Ft(be??"")})]}),_e("div",{className:"wi-td-history-bottom",children:[_e("span",{className:"wi-td-history-meta",children:[H("span",{className:"wi-td-history-status","data-status":U.status,children:U.status==="success"?"Success":"Failed"}),Te&&H("span",{className:"wi-td-history-time",children:Te})]}),_e("span",{className:"wi-td-history-amount","data-size":bb(`${$?"+":"-"}${Ae} ${r.symbol}`),children:[$?"+":"-",Ae," ",r.symbol]})]})]}),We=`${U.tx}-${U.log_index}-${te}`;return de?H("a",{className:"wi-td-history-item wi-td-history-item--link",href:de,target:"_blank",rel:"noopener noreferrer",onClick:Ze=>V(Ze,de,"token-tx",U.tx),children:ae},We):H("div",{className:"wi-td-history-item",children:ae},We)}),v&&(t?H("div",{ref:S,className:"wi-td-history-sentinel",children:R&&H("span",{className:"wi-td-history-loading",children:"Loading\u2026"})}):H("button",{type:"button",className:"wi-td-loadmore-btn",onClick:()=>x(),disabled:R,children:R?"Loading\u2026":"Load more"}))]})]})]})]})}function Cb(){return H("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:xe("wi-td-external-icon"),"aria-hidden":!0,children:H("path",{d:"M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}import{Fragment as Es,jsx as C,jsxs as Q}from"react/jsx-runtime";var Tb="On-ramp is not available in your region.";function Ms(e,t,r){let n=$e[e],o=r.toUpperCase();if(t===n.cross&&o.includes("ONEUSD"))return 0;if(t===n.cross&&o==="ONE")return 1;if(t===n.bsc&&o==="ONE")return 2}function Ib(e){return parseInt(e.split(":")[1],10)}function Mb(e){if(typeof window>"u"||!e?.length)return!1;let{origin:t,pathname:r}=window.location,n=t+r;return e.some(o=>n===o||n.startsWith(`${o}/`))}function Eb(e){let t=e.lastIndexOf(".");return t===-1?{main:e,decimal:""}:{main:e.slice(0,t),decimal:e.slice(t)}}function Ab(e){let t=e.toLowerCase().replace(/^0x/,""),r=t.length>=8?t.slice(0,8):t.padEnd(8,"0"),n=parseInt(r.slice(0,4),16)%360,o=(n+60+parseInt(r.slice(4,8),16)%120)%360;return`linear-gradient(135deg, hsl(${n} 85% 65%), hsl(${o} 80% 55%))`}function Lb(e,t=.5){let r=X.useRef(null),n=X.useRef(null),[o,i]=X.useState(1);return X.useLayoutEffect(()=>{let a=r.current,s=n.current;if(!a||!s)return;let l=()=>{let u=a.clientWidth;if(!u)return;let h=s.cloneNode(!0);h.style.setProperty("--wi-total-scale","1"),h.style.position="absolute",h.style.left="-9999px",h.style.top="-9999px",h.style.visibility="hidden",h.style.maxWidth="none",h.style.width="max-content",a.appendChild(h);let g=h.offsetWidth;a.removeChild(h);let d=g>u?Math.max(t,u/g):1;i(d)};l();let c=new ResizeObserver(l);return c.observe(a),()=>c.disconnect()},[e,t]),{containerRef:r,valueRef:n,scale:o}}function Pp({align:e="end",sideOffset:t=12,className:r,children:n}){let{env:o,theme:i,isMobile:a,open:s,drawerDirection:l,modal:c,showBalance:u,showForgeToken:h,showGameToken:g,showQR:d,showBridge:w,qrLogoSrc:f,walletAddress:m,accountName:b,sendAccounts:y,profileImageUrl:p,preferredTokens:x,close:v,onSelectWallet:R,onCopyAddress:T,onBuy:N,onDisconnect:S,disconnectLabel:M,termsUrl:P,termsLabel:j,privacyUrl:L,privacyLabel:K,portalStyle:D,navContent:O,navPosition:oe,footerContent:G,view:W,setView:le,selectedSendToken:Z,setSelectedSendToken:V,selectedDetailToken:U,setSelectedDetailToken:te,showPortfolio:J,portfolioTitle:fe,portfolioSections:ce,showTotalAssets:$,totalAssetsLabel:be,sendTransaction:Ae,getTransactionReceipt:de,estimateGas:Te,onOutlink:ae,lpBalanceReader:We,stakingRewardsReader:Ze,bridgeTokens:Le,bridgeHistory:De,getBridgeQuote:Se,getBridgeToTokens:tt,getBridgeApproval:Ge,approveBridge:Fe,submitBridge:wt,onReceive:lt,onSend:kt,onBuyDisabledMessage:Pe,onBridgeDisabledMessage:Rt,onSendDisabledMessage:ct}=pn(),[dt,Ht]=X.useState(null),St=X.useRef(void 0),Be=X.useCallback(I=>{Ht(I),clearTimeout(St.current),St.current=setTimeout(()=>Ht(null),4e3)},[]);X.useEffect(()=>()=>clearTimeout(St.current),[]);let Xe=!!Pe,Oe=X.useCallback(()=>{if(Xe){Be(Pe);return}let I=N?.();I&&typeof I.then=="function"&&I.catch(()=>{Be(Pe??Tb)})},[Xe,Pe,N,Be]),He=!!Rt,Ye=!!ct,{tokens:Lt,isLoading:Dt}=gn(o,m,s&&u),{statsMap:qe}=hn(o,u),{aprPercent:Ct}=Uc(),{categoryMap:Pt,infoMap:Qt}=Wc(o,u),z=u&&$,{displayValue:ne,isLowerBound:Ue,isLoading:pt}=_c(o,m,s&&z),[Je,Bt]=X.useState(!1),zt=X.useRef(null),[jr,cn]=X.useState(0),{holdings:ir,isLoading:dn}=Oc(o,m,s&&u&&h),Tn=X.useMemo(()=>ir.map(I=>I.token),[ir]),{imageMap:A}=Fc(o,Tn,h&&ir.length>0),E=X.useMemo(()=>{let I=[],re=[],Re=[],Yt=new Map((x??[]).map((ze,Ot)=>[`${Ib(ze.chainId)}:${ze.address.toLowerCase()}`,Ot]));for(let ze of Lt){let Ot=Ms(o,ze.chainId,ze.symbol)!==void 0,Mr=`${ze.chainId}:${ze.address.toLowerCase()}`,In=Yt.get(Mr),Fa=new jo(ze.quantity.numeric).shiftedBy(-ze.quantity.decimals);if(Ot)I.push(ze);else if(In!==void 0)re.push(ze);else if(Fa.isGreaterThan(0)){if(!g&&Pt.get(Lo(ze.chainId,ze.address))==="game")continue;Re.push(ze)}}return I.sort((ze,Ot)=>{let Mr=Ms(o,ze.chainId,ze.symbol)??99,In=Ms(o,Ot.chainId,Ot.symbol)??99;return Mr-In}),re.sort((ze,Ot)=>{let Mr=Yt.get(`${ze.chainId}:${ze.address.toLowerCase()}`)??99,In=Yt.get(`${Ot.chainId}:${Ot.address.toLowerCase()}`)??99;return Mr-In}),Re.sort((ze,Ot)=>{let Mr=qe.get(gr(ze.chainId,ze.address)),In=qe.get(gr(Ot.chainId,Ot.address)),Fa=new jo(ze.quantity.numeric).shiftedBy(-ze.quantity.decimals).multipliedBy(Mr?.price??0);return new jo(Ot.quantity.numeric).shiftedBy(-Ot.quantity.decimals).multipliedBy(In?.price??0).minus(Fa).toNumber()}),[...I,...re,...Re]},[Lt,o,qe,g,Pt,x]),B=X.useMemo(()=>{if(!h)return[];let I=new Set(Lt.map(re=>re.address.toLowerCase()));return[...ir].filter(re=>!I.has(re.token.toLowerCase())).sort((re,Re)=>{let Yt=new jo(re.value);return new jo(Re.value).minus(Yt).toNumber()})},[ir,h,Lt]),se=X.useRef(!1),[Ie,ut]=X.useState(null),Ir=X.useRef(void 0),xo=Ie?.chainId??Z?.chainId??E[0]?.chainId??0,{transactionUrl:La}=Io(o,xo,Ie?.txHash,!!(Ie?.txHash&&xo)),Vt=X.useCallback(I=>{se.current=!0,le(I)},[le]),[hf,Da]=X.useState("recipient"),ni=X.useCallback(()=>{V(null),Da("recipient"),Vt("wallet")},[V,Vt]),oi=X.useCallback((I,re="recipient")=>{if(Ye){Be(ct);return}Da(re),V(I),Vt("send")},[Ye,ct,Be,V,Vt]),bf=X.useCallback(I=>{te(I),Vt("token-detail")},[te,Vt]),wf=X.useCallback(()=>{te(null),Vt("wallet")},[te,Vt]),yf=X.useCallback(I=>{oi(I,"recipient")},[oi]),ii=Er("apps.json",o,I=>ar(I?.gametokenBridge,o)),il=Er("apps.json",o,I=>I?.gametokenSites),xf=X.useCallback(()=>{if(He){Be(Rt);return}if(ii){if(Mb(il)){window.location.assign(ii);return}window.open(ii,"_blank","noopener,noreferrer")}},[He,Rt,ii,il,Be]),vf=X.useCallback(I=>{clearTimeout(Ir.current),V(null),Vt("wallet"),ut({status:"pending",txHash:I.txHash,chainId:I.chainId,description:`${I.amount} ${I.tokenSymbol} to ${Ft(I.recipient)}`})},[V,Vt]),kf=X.useCallback(I=>{let re=Z?.chainId;V(null),Vt("wallet"),!(!I||!re)&&(ut(Re=>({status:"success",txHash:I,chainId:re,description:Re?.txHash===I?Re.description:"Tap to see your transaction"})),clearTimeout(Ir.current),Ir.current=setTimeout(()=>ut(null),5e3))},[Z?.chainId,V,Vt]),Rf=X.useCallback(I=>{let re=I.txHash;re&&(ut({status:"error",txHash:re,chainId:I.chainId,description:I.message}),clearTimeout(Ir.current),Ir.current=setTimeout(()=>ut(null),5e3))},[]),vo=X.useMemo(()=>{if(lt)return lt;if(d)return()=>Vt("qr")},[lt,d,Vt]),Pa=X.useMemo(()=>{if(kt)return kt;if(E.length===0)return;let I=E[0];return()=>oi(I,"token")},[kt,E,oi]),Sf=X.useCallback(()=>{if(Ye){Be(ct);return}Pa?.()},[Ye,ct,Pa,Be]);X.useEffect(()=>{s||(se.current=!1,Da("recipient"))},[s]);let al=X.useRef(null);X.useEffect(()=>{let I=al.current;if(!I||!a)return;let re=Re=>{Re.pointerType==="touch"&&Re.stopPropagation()};return I.addEventListener("pointerdown",re),()=>I.removeEventListener("pointerdown",re)},[a]);let[Vn,sl]=X.useState(!1),Ba=X.useRef(void 0),[ko,Ro]=X.useState(!1);X.useEffect(()=>{if(!ko)return;let I=()=>Ro(!1),re=Yt=>{Yt.key==="Escape"&&Ro(!1)},Re=setTimeout(()=>{document.addEventListener("mousedown",I,!0),document.addEventListener("keydown",re,!0)},0);return()=>{clearTimeout(Re),document.removeEventListener("mousedown",I,!0),document.removeEventListener("keydown",re,!0)}},[ko]),X.useEffect(()=>{Ro(!1)},[m]),X.useEffect(()=>()=>clearTimeout(Ba.current),[]),X.useEffect(()=>()=>clearTimeout(Ir.current),[]),X.useEffect(()=>{let I=zt.current;if(!I||G===null){cn(0);return}let re=()=>{cn(I.offsetHeight)};if(re(),typeof ResizeObserver>"u")return;let Re=new ResizeObserver(re);return Re.observe(I),()=>Re.disconnect()},[G]);let ll=X.useCallback(async()=>{if(!Vn)try{await navigator.clipboard.writeText(m),sl(!0),clearTimeout(Ba.current),Ba.current=setTimeout(()=>sl(!1),2e3),T?.(m,!0)}catch{T?.(m,!1)}},[m,T,Vn]),ai=X.useCallback(I=>{I.currentTarget.setAttribute("data-loaded","true")},[]),cl=X.useMemo(()=>({background:Ab(m)}),[m]),si=X.useMemo(()=>p||en(o,m,{size:120,bg:i==="dark"?"1A1A2E":"F3F6F8"}),[p,o,m,i]),za=X.useMemo(()=>Eb(ne),[ne]),{containerRef:Cf,valueRef:Nf,scale:Tf}=Lb(Je?"\u2022\u2022\u2022\u2022\u2022\u2022":ne),dl=P||L?Q("div",{className:"wi-legal-links",children:[P&&C("a",{className:"wi-legal-link",href:P,target:"_blank",rel:"noopener noreferrer","data-track":"terms_link",onClick:I=>bt(I,P,{category:"terms",origin:"terms"},ae),children:j}),P&&L&&C("span",{className:"wi-legal-sep","aria-hidden":!0,children:"\xB7"}),L&&C("a",{className:"wi-legal-link",href:L,target:"_blank",rel:"noopener noreferrer","data-track":"privacy_link",onClick:I=>bt(I,L,{category:"privacy",origin:"privacy"},ae),children:K})]}):null,pl=S?Q("button",{type:"button",className:"wi-disconnect-btn","data-track":"disconnect",onClick:()=>{S(),v()},children:[C(Hl,{size:16}),C("span",{className:"wi-disconnect-label",children:M})]}):null,If=u&&!O?Q("div",{className:"wi-action-row","aria-label":"Wallet actions",children:[Q("button",{type:"button",className:xe("wi-action-card",Xe&&"wi-action-card--dimmed"),onClick:Oe,disabled:!N&&!Xe,"aria-disabled":Xe||void 0,"aria-label":"Buy","data-track":"buy",children:[C(Zl,{size:20}),C("span",{children:"Buy"})]}),w?Q("button",{type:"button",className:xe("wi-action-card",He&&"wi-action-card--dimmed"),onClick:xf,"aria-disabled":He||void 0,"aria-label":"Bridge","data-track":"bridge_open",children:[C(Xl,{size:20}),C("span",{children:"Bridge"})]}):Q("button",{type:"button",className:"wi-action-card",onClick:vo,disabled:!vo,"aria-label":"Receive","data-track":"receive",children:[C(wi,{size:20}),C("span",{children:"Receive"})]}),Q("button",{type:"button",className:xe("wi-action-card",Ye&&"wi-action-card--dimmed"),onClick:Sf,disabled:!Ye&&!Pa,"aria-disabled":Ye||void 0,"aria-label":"Send","data-track":"send_open",children:[C(ql,{size:20}),C("span",{children:"Send"})]}),J?Q("button",{type:"button",className:"wi-action-card",onClick:()=>Vt("portfolio"),"aria-label":"View portfolio","data-track":"portfolio_open",children:[C(Kl,{size:20}),C("span",{children:"Portfolio"})]}):w?Q("button",{type:"button",className:"wi-action-card",onClick:vo,disabled:!vo,"aria-label":"Receive","data-track":"receive",children:[C(wi,{size:20}),C("span",{children:"Receive"})]}):null]}):null,Mf=Q("div",{className:xe("wi-view-inner",se.current&&"wi-view-wallet"),children:[z&&Q("div",{className:"wi-total-section",children:[Q("div",{className:"wi-total-head",children:[C("span",{className:"wi-total-label",children:be}),C("span",{role:"button",tabIndex:0,className:"wi-total-eye",onClick:I=>{I.stopPropagation(),Bt(re=>!re)},onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),I.stopPropagation(),Bt(re=>!re))},"aria-label":Je?"Show balance":"Hide balance","data-track":"balance_toggle",children:Je?C(Vl,{}):C(Ql,{})})]}),C("div",{className:"wi-total-body",ref:Cf,children:pt?C("div",{className:"wi-skeleton-block wi-total-skeleton",style:{width:160,height:42}}):C("div",{className:"wi-total-value","data-hidden":Je||void 0,ref:Nf,style:{"--wi-total-scale":Tf},children:Je?C("span",{className:"wi-total-mask",children:"\u2022\u2022\u2022\u2022\u2022\u2022"}):Q(Es,{children:[Ue&&C("span",{className:"wi-total-lte",children:"\u2264"}),C("span",{className:"wi-total-currency",children:"$"}),C("span",{className:"wi-total-amount",children:za.main}),za.decimal&&C("span",{className:"wi-total-decimal",children:za.decimal})]})})})]}),oe==="top"&&(O?C("div",{className:"wi-nav-fixed",children:O}):If),u&&C("div",{ref:al,className:"wi-scrollable-body","data-vaul-no-drag":!0,children:Q("div",{className:"wi-token-list",children:[Dt&&Array.from({length:5},(I,re)=>Q("div",{className:"wi-skeleton-item",children:[Q("div",{className:"wi-skeleton-left",children:[C("div",{className:"wi-skeleton-block wi-skeleton-icon"}),Q("div",{className:"wi-skeleton-lines",children:[C("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),C("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),Q("div",{className:"wi-skeleton-right",children:[C("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),C("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},re)),!Dt&&E.length===0&&!h&&C("div",{className:"wi-empty",children:"No Tokens Found"}),E.map(I=>{let re=qe.get(gr(I.chainId,I.address)),Re=re?parseFloat(re.percent_change_24h):null,Yt=Re!==null&&Re>=0,ze=Ao(o,I.chainId),Ot=yc(I.address);return Q("button",{type:"button",className:"wi-token-item wi-token-item--button",onClick:()=>bf(I),"aria-label":`View ${I.symbol} detail`,"data-track":"token_detail","data-track-id":I.symbol,children:[Q("div",{className:"wi-token-left",children:[Q("div",{className:"wi-token-icon-wrap",children:[C("img",{src:I.icon_url,alt:I.symbol,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:ai,onError:Mr=>{Mr.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),ze&&C("img",{src:ze,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Mr=>{Mr.currentTarget.style.display="none"}})]}),Q("div",{className:"wi-token-info",children:[Q("span",{className:"wi-token-name-row",children:[C("span",{className:"wi-token-name",children:I.symbol}),Ot&&Ct!==null&&C("span",{className:"wi-token-apr",children:`APR ${Ct>=0?"+":"-"}${(Ct>=0?Math.floor:Math.ceil)(Math.abs(Ct)*100)/100}%`})]}),re&&Q("div",{className:"wi-token-price-row",children:[C("span",{className:"wi-token-price",children:Pn(re.price)}),C("span",{className:"wi-token-change","data-positive":Yt,"data-zero":Re===0||void 0,children:Re!==null&&(Re===0?"0%":`${Yt?"+":"-"}${(Yt?Math.floor:Math.ceil)(Math.abs(Re)*100)/100}%`)})]})]})]}),Q("div",{className:"wi-token-right",children:[C("span",{className:"wi-token-balance",children:un(I.quantity.numeric,I.quantity.decimals)}),re&&C("span",{className:"wi-token-value",children:yi(I.quantity.numeric,I.quantity.decimals,re.price)})]})]},`${I.address}-${I.chainId}`)}),h&&dn&&Array.from({length:3},(I,re)=>Q("div",{className:"wi-skeleton-item",children:[Q("div",{className:"wi-skeleton-left",children:[C("div",{className:"wi-skeleton-block wi-skeleton-icon"}),Q("div",{className:"wi-skeleton-lines",children:[C("div",{className:"wi-skeleton-block",style:{width:64,height:14}}),C("div",{className:"wi-skeleton-block",style:{width:80,height:12}})]})]}),Q("div",{className:"wi-skeleton-right",children:[C("div",{className:"wi-skeleton-block",style:{width:72,height:14}}),C("div",{className:"wi-skeleton-block",style:{width:48,height:12}})]})]},`forge-sk-${re}`)),h&&!dn&&!Dt&&E.length===0&&B.length===0&&C("div",{className:"wi-empty",children:"No Tokens Found"}),h&&B.map(I=>{let re=A.get(I.token)||"",Re=Ao(o,$e[o].cross);return Q("div",{className:"wi-token-item",children:[Q("div",{className:"wi-token-left",children:[Q("div",{className:"wi-token-icon-wrap",children:[C("img",{src:re||"https://contents.crosstoken.io/wallet/token/images/FT.png",alt:I.token_name,className:"wi-token-icon",width:32,height:32,loading:"lazy",draggable:!1,onLoad:ai,onError:Yt=>{Yt.currentTarget.src="https://contents.crosstoken.io/wallet/token/images/FT.png"}}),Re&&C("img",{src:Re,alt:"","aria-hidden":!0,className:"wi-token-chain-badge",width:14,height:14,loading:"lazy",draggable:!1,onError:Yt=>{Yt.currentTarget.style.display="none"}})]}),Q("div",{className:"wi-token-info",children:[C("span",{className:"wi-token-name",children:I.token_name}),C("div",{className:"wi-token-price-row",children:Q("span",{className:"wi-token-price",children:[un(I.current_price,18)," CROSS"]})})]})]}),Q("div",{className:"wi-token-right",children:[C("span",{className:"wi-token-balance",children:un(I.balance,18)}),C("span",{className:"wi-token-value",children:Pn(I.current_value_usd)})]})]},`forge-${I.token}`)})]})}),oe==="bottom"&&O&&C("div",{className:"wi-nav-fixed",children:O}),pl&&C("div",{className:"wi-wallet-disconnect-row",children:pl})]},"wallet"),Ef=J?C("div",{className:xe("wi-view-inner wi-portfolio-body",se.current&&"wi-view-portfolio"),children:C(ao,{env:o,theme:i,walletAddress:m,showHeader:!1,onOutlink:ae,lpBalanceReader:We,stakingRewardsReader:Ze,sendTransaction:Ae,estimateGas:Te,sections:ce})},"portfolio"):null,Af=Z?C("div",{className:xe("wi-view-inner wi-send-body",se.current&&"wi-view-send"),children:C(Li,{env:o,theme:i,walletAddress:m,accountName:b,accounts:y,initialStep:hf,token:Z,tokens:E,onTokenChange:V,sendTransaction:Ae,getTransactionReceipt:de,estimateGas:Te,getTokenPriceUsd:I=>{let re=qe.get(gr(I.chainId,I.address));if(!re?.price)return;let Re=parseFloat(re.price);return Number.isFinite(Re)?Re:void 0},onClose:v,onBackToWallet:ni,onSubmitted:vf,onSuccess:kf,onFailed:Rf,onOutlink:ae})},"send"):null,Lf=X.useMemo(()=>Le||E.map(I=>{let re=qe.get(gr(I.chainId,I.address)),Re=re?.price?parseFloat(re.price):void 0;return{name:I.name,symbol:I.symbol,chainId:I.chainId,address:I.address,decimals:I.quantity.decimals,balance:ro(I.quantity.numeric,I.quantity.decimals),iconUrl:I.icon_url,priceUsd:Number.isFinite(Re)?Re:void 0}}),[Le,qe,E]),Df=C("div",{className:xe("wi-view-inner wi-bridge-body",se.current&&"wi-view-send"),children:C($i,{env:o,walletAddress:m,tokens:Lf,history:De,termsUrl:P,getQuote:Se,getToTokens:tt,getApproval:Ge,approveBridge:Fe,submitBridge:wt,onClose:v,onBackToWallet:ni})},"bridge"),Pf=U?C("div",{className:xe("wi-view-inner wi-token-detail-body",se.current&&"wi-view-send"),children:C(Dp,{env:o,isMobile:a,token:U,walletAddress:m,stat:qe.get(gr(U.chainId,U.address)),tokenInfo:Qt.get(Lo(U.chainId,U.address)),showBalance:u,onBack:wf,onClose:v,onSend:yf,onOutlink:ae})},"token-detail"):null,Oa=!!R&&b?.trim().toLowerCase()!=="my wallet",ul=Q(Es,{children:[Q("span",{className:"wi-receive-avatar",children:[C("span",{className:"wi-avatar-fallback",style:cl}),si&&C("img",{src:si,alt:"",className:"wi-avatar-img",width:24,height:24,draggable:!1,onLoad:ai,onError:I=>{I.currentTarget.style.display="none"}})]}),C("span",{className:"wi-receive-account-name",children:b??"Account 1"}),Oa&&C("span",{className:"wi-receive-chevron","data-open":ko,"aria-hidden":"true",children:C(Ln,{size:16})})]}),Bf=Q("div",{className:xe("wi-view-inner wi-qr-body",se.current&&"wi-view-qr"),children:[Q("div",{className:"wi-receive-section",children:[Oa?C("button",{type:"button",className:"wi-receive-account wi-receive-account--btn",onClick:()=>{Ro(!0),R?.()},"aria-label":"Switch account",children:ul}):C("div",{className:"wi-receive-account",children:ul}),Q("div",{className:"wi-qr-block",children:[Q("div",{className:"wi-qr-box",children:[C(Nb,{value:m,size:180,level:"H",marginSize:2,...f&&{imageSettings:{src:f,height:33,width:33,excavate:!0}}}),!f&&C("div",{className:"wi-qr-logo",children:C(Yl,{size:33})})]}),C("p",{className:"wi-qr-address",children:m})]}),Q("button",{type:"button",className:"wi-qr-copy-btn",onClick:ll,"data-track":"address_copy",children:[C("span",{className:"wi-qr-copy-icon",children:Vn?C(Jr,{size:16}):C(An,{size:16})}),C("span",{className:"wi-qr-copy-text",children:Vn?"Copied!":"Copy address"})]})]}),dl&&C("div",{className:"wi-receive-footer",children:dl})]},"qr"),zf=W==="qr"||W==="portfolio"||W==="send"||W==="bridge",fl=G!==null?C("div",{className:"wi-builtin-footer",children:G}):null,ml=Q("div",{className:"wi-account-text",children:[Oa?Q("button",{type:"button",className:"wi-account-row wi-account-row--btn",onClick:()=>{Ro(!0),R?.()},"aria-label":"Switch account","aria-expanded":ko,children:[C("span",{className:"wi-account-name",children:b??"Account 1"}),C("span",{className:"wi-account-switch","data-open":ko,"aria-hidden":"true",children:C(Ln,{size:20})})]}):C("div",{className:"wi-account-row",children:C("span",{className:"wi-account-name",children:b??"Account 1"})}),Q("button",{type:"button",className:"wi-address-row-btn",onClick:ll,"aria-label":"Copy address","data-track":"address_copy",children:[C("span",{className:"wi-account-address",children:Ft(m)}),C("span",{className:"wi-account-copy","data-copied":Vn,children:Vn?C(Jr,{size:12}):C(An,{size:12})})]})]}),gl=Q(Es,{children:[n,W==="qr"?C("div",{className:"wi-sticky-header",children:Q("div",{className:"wi-header wi-header--receive",children:[C("button",{type:"button",className:"wi-header-back",onClick:ni,"aria-label":"Back",children:C($r,{size:24})}),C("span",{className:"wi-receive-title",children:"Receive"}),C("button",{type:"button",className:"wi-header-action",onClick:v,"aria-label":"Close",children:C(fr,{size:24})})]})}):W==="send"||W==="bridge"||W==="token-detail"?null:zf?Q("div",{className:"wi-sticky-header",children:[Q("div",{className:"wi-header wi-header--wallet wi-header--sub-account",children:[C("button",{type:"button",className:"wi-header-back",onClick:ni,"aria-label":"Back",children:C($r,{size:24})}),C("div",{className:"wi-account-block wi-account-block--sub-account",children:ml}),C("button",{type:"button",className:"wi-header-action",onClick:v,"aria-label":"Close",children:C(fr,{size:24})})]}),C("hr",{className:"wi-divider"})]}):Q("div",{className:"wi-sticky-header",children:[Q("div",{className:"wi-header wi-header--wallet",children:[Q("div",{className:"wi-account-block",children:[Q("div",{className:"wi-avatar",children:[C("div",{className:"wi-avatar-fallback",style:cl}),si&&C("img",{src:si,alt:"",className:"wi-avatar-img",width:28,height:28,draggable:!1,onLoad:ai,onError:I=>{I.currentTarget.style.display="none"}})]}),ml]}),Q("div",{className:"wi-header-actions",children:[d&&w&&C("button",{type:"button",className:"wi-header-action wi-header-action--qr",onClick:vo,"aria-label":"Show QR code","data-track":"receive",children:C(wi,{size:20})}),C("button",{type:"button",className:"wi-header-action",onClick:v,"aria-label":"Close",children:C(fr,{size:24})})]})]}),C("hr",{className:"wi-divider"})]}),Q("div",{className:"wi-view-container",children:[W==="wallet"&&Mf,W==="qr"&&Bf,W==="portfolio"&&Ef,W==="send"&&Af,W==="bridge"&&Df,W==="token-detail"&&Pf]}),W==="wallet"&&dt&&C("div",{className:"wi-action-toast",role:"status","aria-live":"polite",children:dt}),W==="wallet"&&Ie&&Q("a",{className:"wi-send-toast",href:La??"#",target:"_blank",rel:"noopener noreferrer",onClick:I=>{if(!La){I.preventDefault();return}bt(I,La,{category:"send",origin:"send-transaction",payload:{chainId:Ie.chainId,txHash:Ie.txHash}},ae)},children:[C("span",{className:"wi-send-toast-icon","data-status":Ie.status,"aria-hidden":!0,children:Ie.status==="pending"?C("span",{className:"wi-send-toast-spinner"}):Ie.status==="error"?C("span",{className:"wi-send-toast-error-dot"}):C(Jl,{size:20})}),Q("span",{className:"wi-send-toast-copy",children:[C("span",{className:"wi-send-toast-title",children:Ie.status==="pending"?"Sending...":Ie.status==="error"?"Send failed":"Send complete"}),C("span",{className:"wi-send-toast-desc",children:Ie.status==="pending"||Ie.status==="error"?Ie.description:"Tap to see your transaction"})]})]}),fl&&W!=="portfolio"&&W!=="send"&&W!=="token-detail"&&C("div",{className:"wi-sticky-footer",children:C("div",{className:"wi-footer",ref:zt,children:fl})})]}),hl={...D,...jr>0?{"--wi-footer-height":`${jr}px`}:null};return a?C(pe,{feature:"wallet_info",children:Q(ra.Portal,{children:[c&&C(ra.Overlay,{className:"wi-drawer-overlay"}),Q(ra.Content,{className:xe("wi-drawer-content",r),"data-theme":i,"data-vaul-no-drag":l==="left"||l==="right"?!0:void 0,style:hl,"data-direction":l,"data-no-balance":!u||void 0,"data-has-footer":jr>0||void 0,"data-view":W,children:[C(ra.Title,{className:"wi-sr-only",children:"My Wallet"}),gl]})]})}):Q(pe,{feature:"wallet_info",children:[c&&s&&C("div",{className:"wi-drawer-overlay",onClick:v}),C(na.Portal,{children:C(na.Content,{align:e,sideOffset:t,className:xe("wi-popover-content",r),"data-theme":i,style:hl,"data-no-balance":!u||void 0,"data-has-footer":jr>0||void 0,"data-view":W,children:gl})})]})}import*as Bp from"react";function zp({position:e="top",children:t}){let{setNavContent:r,setNavPosition:n}=pn();return Bp.useEffect(()=>(r(t),n(e),()=>r(null)),[t,e,r,n]),null}import*as Op from"react";function Fp({children:e}){let{setFooterContent:t}=pn();return Op.useEffect(()=>(t(e),()=>t(null)),[e,t]),null}ie(`[data-theme=dark].wi-popover-content,[data-theme=dark].wi-drawer-content{--wi-primary: var(--ds-system-orange-default, #f0640d);--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-system-orange-default, #f0640d);--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)}
|
|
12
|
+
`);ie(`.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}
|
|
13
|
+
`);ie(`@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}}
|
|
14
|
+
`);ie(`.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:min(680px,calc(100dvh - 32px));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(680px + 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:calc(36px * var(--wi-total-scale, 1));color:var(--ds-content-highest, #000000)}.wi-total-lte{margin-right:2px;font-weight:500;font-size:calc(22px * var(--wi-total-scale, 1));color:var(--wi-texticon-secondary)}.wi-total-mask{letter-spacing:2px;font-size:calc(32px * var(--wi-total-scale, 1));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-apr{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-system-orange-default, #f0640d)}.wi-send-toast-spinner{width:18px;height:18px;border:2px solid rgba(255,159,33,.22);border-top-color:var(--ds-system-orange-on-inverted, #ff9f21);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-system-orange-on-inverted, #ff9f21)}.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}
|
|
15
|
+
`);ie(`.wi-td-header-title{position:absolute;left:50%;transform:translate(-50%);display:inline-flex;align-items:center;gap:8px;pointer-events:none}.wi-td-header-icon{width:24px;height:24px;object-fit:contain;flex-shrink:0}.wi-td-header-name{font-family:inherit;font-size:18px;font-weight:600;line-height:1.5;letter-spacing:-.01em;color:var(--wi-texticon-primary, #ffffff)}.wi-td-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;display:flex;flex-direction:column;gap:24px;padding:20px 24px 24px;background:transparent;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}[data-theme=light] .wi-td-scroll{scrollbar-color:rgba(0,0,0,.12) transparent}.wi-td-scroll::-webkit-scrollbar{width:4px}.wi-td-scroll::-webkit-scrollbar-track{background:transparent}.wi-td-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:4px}.wi-td-scroll::-webkit-scrollbar-thumb:hover{background:#ffffff40}[data-theme=light] .wi-td-scroll::-webkit-scrollbar-thumb{background:#0000001f}[data-theme=light] .wi-td-scroll::-webkit-scrollbar-thumb:hover{background:#0003}.wi-td-chart{display:flex;flex-direction:column;gap:14px}.wi-td-chart-panel{display:flex;flex-direction:column;gap:4px}.wi-td-chart-price{font-size:26px;font-weight:700;line-height:1.15;color:var(--wi-texticon-primary, #ffffff)}.wi-td-chart-change{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--ds-system-green-high, #00a869)}.wi-td-chart-change[data-positive=false]{color:var(--wi-error, #e70077)}.wi-td-chart-when{font-weight:400;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-chart-plot{position:relative;width:100%;height:150px}.wi-td-chart-svg{display:block;width:100%;height:150px;overflow:visible;touch-action:none}.wi-td-chart-minmax{fill:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));font-size:11px;font-family:inherit}.wi-td-chart-cursor{stroke:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));stroke-width:1;stroke-dasharray:3 3}.wi-td-chart-skeleton{width:100%;height:150px;border-radius:12px}.wi-td-chart-tabs{display:flex;gap:6px;justify-content:space-between}.wi-td-chart-tab{flex:1;padding:7px 0;border:none;border-radius:8px;background:transparent;cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));transition:background .15s ease,color .15s ease}.wi-td-chart-tab[data-active]{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1));color:var(--wi-texticon-primary, #ffffff)}.wi-td-chart-tab:hover:not([data-active]){color:var(--wi-texticon-primary, #ffffff)}.wi-td-balance-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px;border-radius:16px;background:var(--wi-surface-default, rgba(255, 255, 255, .05))}.wi-td-balance-left{display:flex;flex-direction:column;gap:4px;flex:1 1 0;min-width:0}.wi-td-balance-label{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff)}.wi-td-balance-amount{font-size:30px;font-weight:700;line-height:1.15;color:var(--wi-texticon-primary, #ffffff);white-space:nowrap;max-width:100%}.wi-td-balance-fiat{font-size:14px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-send-btn{display:inline-flex;align-items:center;gap:6px;flex-shrink:0;padding:12px 22px;border:none;border-radius:999px;cursor:pointer;font-family:inherit;font-size:15px;font-weight:600;color:var(--wi-on-primary, #ffffff);background:var(--wi-primary, #019d92);transition:filter .15s ease}.wi-td-send-btn:hover{filter:brightness(1.06)}.wi-td-send-btn:active{filter:brightness(.94)}.wi-td-section{display:flex;flex-direction:column;gap:14px}.wi-td-section-title{margin:0;font-size:18px;font-weight:700;letter-spacing:-.01em;color:var(--wi-texticon-primary, #ffffff)}.wi-td-rows{display:flex;flex-direction:column;gap:12px}.wi-td-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.wi-td-row-label{font-size:15px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-row-value{font-size:15px;font-weight:500;color:var(--wi-texticon-primary, #ffffff);text-align:right;word-break:break-all}.wi-td-row-link,.wi-td-row-copy{display:inline-flex;align-items:center;gap:6px;border:none;background:transparent;padding:0;cursor:pointer;font-family:inherit;text-decoration:none}.wi-td-row-link:hover,.wi-td-row-copy:hover{opacity:.8}.wi-td-external-icon{color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));flex-shrink:0}.wi-td-row-copy svg{color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));flex-shrink:0}.wi-td-social-row{display:flex;flex-wrap:wrap;gap:10px}.wi-td-social-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;color:var(--wi-texticon-primary, #ffffff);background:var(--wi-surface-default, rgba(255, 255, 255, .05));text-decoration:none;transition:background .15s ease}.wi-td-social-btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-list{display:flex;flex-direction:column;gap:10px}.wi-td-history-item{display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05));text-decoration:none}.wi-td-history-item--link{cursor:pointer;transition:background .15s ease}.wi-td-history-item--link:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-top,.wi-td-history-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}.wi-td-history-type{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff)}.wi-td-history-type[data-direction=receive],.wi-td-history-type[data-direction=bridge-in]{color:var(--ds-system-green-high, #00a869)}.wi-td-history-counter{font-size:14px;color:var(--wi-primary, #f0640d);font-variant-numeric:tabular-nums}.wi-td-history-meta{display:inline-flex;align-items:center;gap:8px;min-width:0}.wi-td-history-status{font-size:14px;font-weight:500}.wi-td-history-status[data-status=success]{color:var(--ds-system-green-high, #00a869)}.wi-td-history-status[data-status=fail]{color:var(--wi-error, #e70077)}.wi-td-history-time{font-size:14px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-history-amount{font-size:15px;font-weight:600;color:var(--wi-texticon-primary, #ffffff);text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.wi-td-history-amount[data-size=sm]{font-size:13px}.wi-td-history-amount[data-size=xs]{font-size:11px;white-space:normal;word-break:break-all}.wi-td-history-skeleton{display:flex;align-items:center;justify-content:space-between;padding:16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05))}.wi-td-history-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:28px 16px;border-radius:12px;background:var(--wi-surface-default, rgba(255, 255, 255, .05));color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5));font-size:14px;text-align:center}.wi-td-retry-btn{padding:8px 18px;border:1px solid var(--wi-border-subtle, rgba(255, 255, 255, .1));border-radius:999px;background:transparent;color:var(--wi-texticon-primary, #ffffff);font-family:inherit;font-size:13px;font-weight:600;cursor:pointer}.wi-td-retry-btn:hover{background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-history-sentinel{display:flex;align-items:center;justify-content:center;min-height:32px}.wi-td-history-loading{font-size:13px;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}.wi-td-loadmore-btn{align-self:center;margin-top:2px;padding:10px 24px;border:1px solid var(--wi-border-subtle, rgba(255, 255, 255, .1));border-radius:999px;background:transparent;color:var(--wi-texticon-primary, #ffffff);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:background .15s ease}.wi-td-loadmore-btn:hover:not(:disabled){background:var(--wi-surface-subtle, rgba(255, 255, 255, .1))}.wi-td-loadmore-btn:disabled{cursor:default;color:var(--wi-texticon-tertiary, rgba(255, 255, 255, .5))}
|
|
16
|
+
`);ie(`.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}
|
|
17
|
+
`);import{jsx as As}from"react/jsx-runtime";function Pb({env:e,theme:t="dark",mobileBreakpoint:r=768,drawerDirection:n,modal:o,showBalance:i=!1,showForgeToken:a=!1,showGameToken:s=!0,showQR:l=!0,showBridge:c=!0,qrLogoSrc:u,walletAddress:h,accountName:g,sendAccounts:d,profileImageUrl:w,connectorId:f,connectorName:m,connectorIconUrl:b,preferredTokens:y=[],onSelectWallet:p,onCopyAddress:x,onBuy:v,onBuyDisabledMessage:R,onBridgeDisabledMessage:T,onSendDisabledMessage:N,onDisconnect:S,disconnectLabel:M="Disconnect",termsUrl:P=eo,termsLabel:j="Terms of Service",privacyUrl:L=xi,privacyLabel:K="Privacy Policy",open:D,onOpenChange:O,showPortfolio:oe=!1,portfolioTitle:G="My Portfolio",portfolioSections:W,showTotalAssets:le=!0,totalAssetsLabel:Z="Total Assets USD",sendTransaction:V,getTransactionReceipt:U,estimateGas:te,onOutlink:J,lpBalanceReader:fe,stakingRewardsReader:ce,bridgeTokens:$,bridgeHistory:be,getBridgeQuote:Ae,getBridgeToTokens:de,getBridgeApproval:Te,approveBridge:ae,submitBridge:We,onReceive:Ze,onBridge:Le,onSend:De,style:Se,children:tt}){let Ge=Qe(e),Fe=f?bi[f]:void 0,wt=m??Fe?.name,lt=b??Fe?.iconUrl,kt=Kn(`(max-width: ${r}px)`),Pe=n??(i?"right":"bottom"),Rt=Pe==="left"||Pe==="right",ct=o??!1,dt=D!==void 0,[Ht,St]=Mt.useState(!1),Be=dt?D:Ht,Xe=Mt.useCallback(zt=>{dt||St(zt),O?.(zt)},[dt,O]),Oe=Mt.useCallback(()=>Xe(!1),[Xe]),[He,Ye]=Mt.useState(null),[Lt,Dt]=Mt.useState("top"),[qe,Ct]=Mt.useState(null),[Pt,Qt]=Mt.useState("wallet"),[z,ne]=Mt.useState(null),[Ue,pt]=Mt.useState(null);Mt.useEffect(()=>{Be||(Qt("wallet"),ne(null),pt(null))},[Be]),Mt.useEffect(()=>{qn(h)},[h]);let Je=Mt.useCallback(()=>{Ja(h),S?.()},[S,h]),Bt=Mt.useMemo(()=>({env:Ge,theme:t,isMobile:kt,open:Be,drawerDirection:Pe,modal:ct,showBalance:i,showForgeToken:a,showGameToken:s,showQR:l,showBridge:c,qrLogoSrc:u,walletAddress:h,accountName:g,sendAccounts:d,profileImageUrl:w,connectorName:wt,connectorIconUrl:lt,preferredTokens:y,close:Oe,onSelectWallet:p,onCopyAddress:x,onBuy:v,onBuyDisabledMessage:R,onBridgeDisabledMessage:T,onSendDisabledMessage:N,onDisconnect:S?Je:void 0,disconnectLabel:M,termsUrl:P,termsLabel:j,privacyUrl:L,privacyLabel:K,portalStyle:Se,navContent:He,navPosition:Lt,setNavContent:Ye,setNavPosition:Dt,footerContent:qe,setFooterContent:Ct,view:Pt,setView:Qt,selectedSendToken:z,setSelectedSendToken:ne,selectedDetailToken:Ue,setSelectedDetailToken:pt,showPortfolio:oe,portfolioTitle:G,portfolioSections:W,showTotalAssets:le,totalAssetsLabel:Z,sendTransaction:V,getTransactionReceipt:U,estimateGas:te,onOutlink:J,lpBalanceReader:fe,stakingRewardsReader:ce,bridgeTokens:$,bridgeHistory:be,getBridgeQuote:Ae,getBridgeToTokens:de,getBridgeApproval:Te,approveBridge:ae,submitBridge:We,onReceive:Ze,onBridge:Le,onSend:De}),[Ge,t,kt,Be,Pe,ct,i,a,s,l,c,u,h,g,d,w,wt,lt,y,Oe,p,x,v,R,T,N,S,Je,M,P,j,L,K,Se,He,Lt,qe,Pt,z,Ue,oe,G,W,le,Z,V,U,te,J,fe,ce,$,be,Ae,de,Te,ae,We,Ze,Le,De]);return As(Ya.Provider,{value:Bt,children:kt?As(Db.Root,{direction:Pe,open:Be,onOpenChange:Xe,handleOnly:Rt,noBodyStyles:!0,repositionInputs:!1,children:tt},"drawer"):As(Up.Root,{open:Be,onOpenChange:Xe,children:tt},"popover")})}var po=Object.assign(Pb,{Trigger:zc,Content:Pp,Nav:zp,Footer:Fp});import*as qr from"react";import*as ru from"@radix-ui/react-dialog";import{Drawer as Vb}from"vaul";import{createContext as Bb,useContext as zb}from"react";var oa=Bb(null);function Wo(){let e=zb(oa);if(!e)throw new Error("WalletConnectModal compound components must be used within <WalletConnectModal>");return e}import{useState as jp,useEffect as Ob,useCallback as Fb}from"react";function ia(){let[e,t]=jp([]),[r,n]=jp(!0);Ob(()=>{if(typeof window>"u"){n(!1);return}let i=[],a=l=>{let{info:c}=l.detail;c?.rdns&&!i.some(u=>u.rdns===c.rdns)&&(i.push({rdns:c.rdns,name:c.name,icon:c.icon}),t([...i]))};window.addEventListener("eip6963:announceProvider",a),window.addEventListener("eip6963:crossAnnounceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider")),window.dispatchEvent(new Event("eip6963:crossRequestProvider"));let s=setTimeout(()=>n(!1),500);return()=>{window.removeEventListener("eip6963:announceProvider",a),window.removeEventListener("eip6963:crossAnnounceProvider",a),clearTimeout(s)}},[]);let o=Fb(i=>e.some(a=>a.rdns===i),[e]);return{wallets:e,isDetected:o,isLoading:r}}import*as Wp from"@radix-ui/react-dialog";import{Drawer as Ub}from"vaul";import{jsx as Ls}from"react/jsx-runtime";function _p({asChild:e,children:t}){let{isMobile:r}=Wo(),n=r?Ub.Trigger:Wp.Trigger;return Ls(pe,{feature:"wallet_connect",children:Ls(n,{asChild:e??t!=null,children:t??Ls("button",{type:"button","data-track":"open",children:"Connect Wallet"})})})}import{useEffect as _b}from"react";import{WALLET_LABELS as Gb}from"@nexus-cross/crossx-design-system";import*as Yr from"@radix-ui/react-dialog";import{Drawer as sa}from"vaul";import{WALLET_LABELS as Ds}from"@nexus-cross/crossx-design-system";import{jsx as ve,jsxs as Wn}from"react/jsx-runtime";var jb='<svg width="100%" height="100%" viewBox="0 0 640 640" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_75048_28969)"><rect width="640" height="640" rx="100" fill="white"/><path d="M640.092 -0.18042H0.0917969V639.82H640.092V-0.18042Z" fill="#CE3E35"/><path d="M43.6074 104.484C43.6074 71.3473 70.4703 44.4844 103.607 44.4844H536.393C569.53 44.4844 596.393 71.3473 596.393 104.484V346.514H43.6074V104.484Z" fill="white"/><g filter="url(#filter0_d_75048_28969)"><path d="M639.908 639.822H0.0917969V158.676C0.0917969 136.585 18.0004 118.676 40.0918 118.676H218.544C237.426 118.676 252.868 132.846 264.251 147.912C277.196 165.045 297.355 176.058 319.999 176.058C342.644 176.058 362.803 165.045 375.748 147.912C387.131 132.846 402.573 118.676 421.455 118.676H599.908C622 118.676 639.908 136.585 639.908 158.676V639.822Z" fill="url(#paint0_linear_75048_28969)"/></g><path d="M223.621 639.503H639.909V181.499L223.621 448.166V639.503Z" fill="url(#paint1_linear_75048_28969)"/><path d="M223.645 639.819H0.0917969V212.869L223.645 449.197V639.819Z" fill="url(#paint2_linear_75048_28969)"/><g filter="url(#filter1_d_75048_28969)"><path d="M317.103 250.341L228.024 301.829C212.311 310.864 206.867 331.162 215.899 346.881C224.93 362.6 245.221 368.046 260.933 359.01L336.28 315.444L300.401 353.936V504.934C300.401 523.129 315.247 537.981 333.434 537.981C351.621 537.981 366.468 523.129 366.468 504.934V278.932C366.468 272.62 364.489 266.431 362.014 262.347C352.735 246.752 332.692 241.182 316.979 250.217L317.103 250.341Z" fill="white"/></g></g><defs><filter id="filter0_d_75048_28969" x="-19.9082" y="93.6763" width="679.816" height="561.146" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="-5"/><feGaussianBlur stdDeviation="10"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0.892803 0 0 0 0 0.220099 0 0 0 0 0.293135 0 0 0 0.5 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_75048_28969"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_75048_28969" result="shape"/></filter><filter id="filter1_d_75048_28969" x="190.367" y="224.71" width="211.348" height="348.518" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.03953" dy="7.03953"/><feGaussianBlur stdDeviation="14.1039"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_75048_28969"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_75048_28969" result="shape"/></filter><linearGradient id="paint0_linear_75048_28969" x1="-74.0158" y1="54.6376" x2="542.251" y2="802.323" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_75048_28969" x1="159.749" y1="206.729" x2="471.286" y2="474.513" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_75048_28969" x1="399.134" y1="82.7297" x2="104.683" y2="466.123" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_75048_28969"><rect width="640" height="640" rx="100" fill="white"/></clipPath></defs></svg>',Wb=`data:image/svg+xml,${encodeURIComponent(jb)}`;function aa(){return ve("img",{src:Wb,width:40,height:40,alt:"",style:{display:"block"}})}function Gp(){return Wn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[Wn("g",{clipPath:"url(#clip0_1331_27065)",children:[ve("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"}),ve("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"}),ve("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"}),ve("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"}),ve("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"}),ve("path",{d:"M22.1857 36.1951V39.831H17.6699V36.1951H22.1857Z",fill:"#C0C4CD"}),ve("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"})]}),ve("defs",{children:ve("clipPath",{id:"clip0_1331_27065",children:ve("rect",{width:"40",height:"40",fill:"white"})})})]})}function Hp(){return Wn("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ve("path",{d:"M12.23 16.81L20 9.04L27.77 16.81L32.29 12.29L20 0L7.71 12.29L12.23 16.81Z",fill:"#F3BA2F"}),ve("path",{d:"M9.04 20L4.52 15.48L0 20L4.52 24.52L9.04 20Z",fill:"#F3BA2F"}),ve("path",{d:"M12.23 23.19L20 30.96L27.77 23.19L32.29 27.71L20 40L7.71 27.71L12.23 23.19Z",fill:"#F3BA2F"}),ve("path",{d:"M35.48 24.52L40 20L35.48 15.48L30.96 20L35.48 24.52Z",fill:"#F3BA2F"}),ve("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 Qp(){return Wn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"247",height:"246",viewBox:"0 0 247 246",fill:"none",children:[ve("rect",{width:"247.005",height:"245.105",rx:"36",fill:"#121212"}),ve("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"}),ve("path",{d:"M59.8364 99.8915V59.7551H12.0414L30.4787 77.8377V99.8915H59.8364Z",fill:"#2FD7FF"}),ve("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 Vp(){return Wn("svg",{width:"40",height:"40",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Wn("g",{clipPath:"url(#clip0_1185_7785)",children:[ve("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"}),ve("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"})]}),ve("defs",{children:ve("clipPath",{id:"clip0_1185_7785",children:ve("rect",{width:"28",height:"28",fill:"white"})})})]})}function Yp(){return Wn("svg",{width:"40",height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[ve("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"}),ve("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"}),ve("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"}),ve("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 qp(){return ve("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:ve("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 Kp(){return ve("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ve("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ps={cross_embedded:{id:"cross_embedded",name:Ds.social,description:"Sign in with Google or Apple",icon:aa},cross_wallet:{id:"cross_wallet",name:Ds.app,description:"App approval is required",icon:aa,featured:!0},cross_extension:{id:"cross_extension",name:Ds.extension,description:"Browser extension approval is required",icon:aa,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:Gp,rdns:"io.metamask"},binance:{id:"binance",name:"Binance",description:"Mobile app only \u2014 Add CROSS network first",icon:Hp},verse8:{id:"verse8",name:"Verse8 Wallet",description:"Optimized for Forge and Verse8 ecosystem",icon:Qp,badge:"For Forge"},tron:{id:"tron",name:"Tron Wallet",description:"Dedicated for Tron-based transactions and assets",icon:Vp,badge:"For SHOP"}};function Bs(e){return Ps[e]}var zs={google:{id:"google",name:"Google",icon:Yp},apple:{id:"apple",name:"Apple",icon:qp}};function Zp(e){return zs[e]}import{Fragment as eu,jsx as ue,jsxs as Wt}from"react/jsx-runtime";function Xp(e,t){Ce("connect","wallet_selected",{tags:{item_id:e}});let r=t?.();r instanceof Promise&&r.then(()=>Ce("connect","connected"),n=>Ce("connect","connected",{status:"failure",reason:sr(n)}))}function Hb({wallet:e,detected:t,onConnect:r}){let n=()=>{if(e.installUrl&&!t){window.open(e.installUrl,"_blank","noopener,noreferrer");return}r()},o=e.icon,i=e.featured===!0;return Wt("button",{type:"button",className:xe("wcm-wallet-item",i&&"wcm-wallet-item--featured"),"data-track":"wallet_item_click","data-track-id":e.id,onClick:n,children:[Wt("div",{className:"wcm-wallet-item-left",children:[ue("div",{className:"wcm-wallet-icon",children:ue(o,{})}),Wt("div",{className:"wcm-wallet-name-row",children:[ue("span",{className:"wcm-wallet-name",children:e.name}),e.badge&&ue("span",{className:"wcm-wallet-badge",children:e.badge})]})]}),e.installUrl&&(t?ue("span",{className:"wcm-installed-label",children:"Installed"}):ue("span",{className:"wcm-install-btn",children:"Install"}))]})}function Qb({social:e,onSignIn:t}){let r=e.icon,n=`Sign in with ${e.name}`;return Wt("button",{type:"button",className:"wcm-social-item","data-provider":e.id,"data-track":"social_provider_click","data-track-id":e.id,onClick:t,"aria-label":n,children:[ue("span",{className:"wcm-social-icon",children:ue(r,{})}),ue("span",{className:"wcm-social-name",children:n})]})}function Jp(){let{wallets:e,activeWalletIds:t,socialProviders:r,activeSocialIds:n,termsUrl:o,privacyUrl:i,isDetected:a,close:s,isMobile:l}=Wo(),c=t.filter(g=>{let d=Bs(g).visibility;return!d||d==="always"?!0:d==="desktop-only"?!l:d==="mobile-only"?l:!0}),u=n.length>0,h=c.length>0;return Wt(eu,{children:[Wt("div",{className:"wcm-header",children:[Wt("div",{className:"wcm-header-text",children:[ue("h2",{className:"wcm-title",children:Gb.default}),!l&&ue("p",{className:"wcm-subtitle",children:"Sign in instantly with your social account"})]}),ue("button",{type:"button",className:"wcm-close-btn","data-track":"close",onClick:s,"aria-label":"Close",children:ue(Kp,{})})]}),Wt("div",{className:"wcm-body",children:[u&&Wt(eu,{children:[!l&&Wt("div",{className:"wcm-section-header",children:[ue("span",{className:"wcm-section-title",children:"Social Account Wallet Connect"}),ue("span",{className:"wcm-recommended-badge",children:"Recommended"})]}),ue("div",{className:"wcm-social-grid",children:n.map(g=>{let d=Zp(g);return ue(Qb,{social:d,onSignIn:()=>{Xp(g,r[g]),s()}},g)})}),h&&Wt("div",{className:"wcm-separator",children:[ue("div",{className:"wcm-separator-line"}),ue("span",{className:"wcm-separator-text",children:"Other Wallets"}),ue("div",{className:"wcm-separator-line"})]})]}),h&&ue("div",{className:"wcm-wallet-list",children:c.map(g=>{let d=Bs(g),w=d.rdns?a(d.rdns):!1;return ue(Hb,{wallet:d,detected:w,onConnect:()=>{Xp(g,e[g]),s()}},g)})}),Wt("p",{className:"wcm-terms",children:["By continuing, you agree to NEXUS"," ",ue($p,{href:o,track:"terms_link",children:"Terms of Service"})," ","and consent to its"," ",ue($p,{href:i,track:"privacy_link",children:"Privacy Policy"}),"."]})]})]})}function $p({href:e,track:t,children:r}){return e?ue("a",{className:"wcm-terms-link",href:e,target:"_blank",rel:"noopener noreferrer","data-track":t,children:r}):ue("span",{className:"wcm-terms-link",children:r})}function tu({className:e}){let{isMobile:t,theme:r,portalStyle:n,open:o}=Wo();return _b(()=>{o&&Ce("connect","opened")},[o]),t?ue(pe,{feature:"wallet_connect",children:Wt(sa.Portal,{children:[ue(sa.Overlay,{className:"wcm-overlay"}),Wt(sa.Content,{className:xe("wcm-drawer-content",e),"data-theme":r,style:n,children:[ue(sa.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),ue("div",{className:"wcm-drawer-handle"}),ue("div",{className:"wcm-drawer-body",children:ue(Jp,{})})]})]})}):ue(pe,{feature:"wallet_connect",children:Wt(Yr.Portal,{children:[ue(Yr.Overlay,{className:"wcm-overlay"}),Wt(Yr.Content,{className:xe("wcm-dialog-content",e),"data-theme":r,style:n,children:[ue(Yr.Title,{className:"wcm-sr-only",children:"Connect Wallet"}),ue(Yr.Description,{className:"wcm-sr-only",children:"Sign in with a social provider or pick a wallet to connect."}),ue("div",{className:"wcm-dialog-body",children:ue(Jp,{})})]})]})})}ie(`.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-system-orange-low, #fff5ee);border-radius:9999px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:var(--ds-system-orange-high, #e56f00);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:#ff8438;border-radius:6px;font-family:Inter,sans-serif;font-weight:500;font-size:12px;line-height:1;letter-spacing:0;color:#fff;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-content-high, rgba(0, 0, 0, .85));text-decoration:underline;text-underline-position:from-font}.wcm-terms-link:hover{color:var(--ds-content-high, rgba(0, 0, 0, .85));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}
|
|
18
|
+
`);ie(`@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)}}
|
|
19
|
+
`);import{jsx as _o}from"react/jsx-runtime";var Yb={};function qb({wallets:e,socialProviders:t=Yb,termsUrl:r,privacyUrl:n,theme:o="dark",mobileBreakpoint:i=768,drawerDirection:a="bottom",dialogWidth:s,drawerMaxWidth:l,drawerMinWidth:c,style:u,open:h,onOpenChange:g,children:d}){let w=Kn(`(max-width: ${i}px)`),[f,m]=qr.useState(!1),b=h!==void 0,y=b?h:f,p=qr.useCallback(P=>{b||m(P),g?.(P)},[b,g]),x=qr.useCallback(()=>p(!1),[p]),{isDetected:v}=ia(),R=qr.useMemo(()=>Object.keys(e),[e]),T=qr.useMemo(()=>Object.keys(t),[t]),N=qr.useMemo(()=>{let P={};return s&&(P["--wcm-dialog-width"]=s),l&&(P["--wcm-drawer-max-width"]=l),c&&(P["--wcm-drawer-min-width"]=c),{...P,...u}},[s,l,c,u]),S=qr.useMemo(()=>({theme:o,isMobile:w,open:y,setOpen:p,close:x,wallets:e,activeWalletIds:R,socialProviders:t,activeSocialIds:T,termsUrl:r??eo,privacyUrl:n??xi,isDetected:v,portalStyle:N}),[o,w,y,p,x,e,R,t,T,r,n,v,N]),M=_o("div",{"data-theme":o,style:N,children:d});return w?_o(oa.Provider,{value:S,children:_o(Vb.Root,{direction:a,open:y,onOpenChange:p,noBodyStyles:!0,children:M},"drawer")}):_o(oa.Provider,{value:S,children:_o(ru.Root,{open:y,onOpenChange:p,children:M})})}var nu=Object.assign(qb,{Trigger:_p,Content:tu});import{WALLET_LABELS as ew}from"@nexus-cross/crossx-design-system";import*as iu from"react";ie(`.cb-button{--cb-bg: var(--ds-accent-gradient, linear-gradient(196deg, #ff2589 16%, #ff823d 84%));--cb-bg-hover: var(--cb-bg);--cb-color: #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}
|
|
20
|
+
`);ie(`.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)}}
|
|
21
|
+
`);var Kb='<svg preserveAspectRatio="xMidYMid meet" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_72837_24069)"><mask id="mask0_72837_24069" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M50 0C10.5289 0 0 10.5289 0 50C0 89.4711 10.5289 100 50 100C89.4711 100 100 89.4711 100 50C100 10.5289 89.4711 0 50 0Z" fill="white"/></mask><g mask="url(#mask0_72837_24069)"><path d="M99.9501 0.0499268H0V100H99.9501V0.0499268Z" fill="url(#paint0_linear_72837_24069)"/><path d="M34.9302 100H99.9751V19.0619L34.9302 60.7286V100Z" fill="url(#paint1_linear_72837_24069)"/><path d="M34.9301 100H0V23.8024L34.9301 60.7285V100Z" fill="url(#paint2_linear_72837_24069)"/></g><g filter="url(#filter0_d_72837_24069)"><path d="M49.9503 21.4821L31.9862 31.8613C28.8176 33.6827 27.7198 37.7745 29.5411 40.9432C31.3625 44.1118 35.4543 45.2096 38.623 43.3883L53.8176 34.6058L46.582 42.3653V72.8044C46.582 76.4721 49.576 79.4661 53.2437 79.4661C56.9114 79.4661 59.9054 76.4721 59.9054 72.8044V27.2455C59.9054 25.9731 59.5062 24.7256 59.0072 23.9022C57.1359 20.7585 53.094 19.6358 49.9254 21.4571L49.9503 21.4821Z" fill="white"/></g></g><defs><filter id="filter0_d_72837_24069" x="7.4286" y="-0.650014" width="87.831" height="115.47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="7.06088" dy="7.06088"/><feGaussianBlur stdDeviation="14.1467"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_72837_24069"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_72837_24069" result="shape"/></filter><linearGradient id="paint0_linear_72837_24069" x1="-11.5768" y1="-12.001" x2="106.562" y2="106.986" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_72837_24069" x1="24.9501" y1="23.004" x2="73.6278" y2="64.8453" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_72837_24069" x1="62.3503" y1="3.46804" x2="16.3423" y2="63.3732" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_72837_24069"><rect width="100" height="100" fill="white"/></clipPath></defs></svg>',Zb='<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>',Xb='<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>',Jb='<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>',$b='<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 Go(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var la=Go(Kb),ca=Go(Zb),da=Go(Xb),pa=Go(Jb),ua=Go($b);import{jsx as rr,jsxs as Ho}from"react/jsx-runtime";function au({isConnecting:e,address:t,provider:r,providerName:n,accountName:o,sendAccounts:i,onConnect:a,onDisconnect:s,onCopy:l,onSelectWallet:c,onBuy:u,onBuyDisabledMessage:h,label:g="Connect Wallet",connectingLabel:d="Connecting...",disconnectLabel:w,className:f,theme:m="dark",env:b,showBalance:y=!0,showPortfolio:p,drawerDirection:x,modal:v,connectorId:R,style:T,walletInfoStyle:N,sendTransaction:S,getTransactionReceipt:M,estimateGas:P,onReceive:j,onBridge:L,onSend:K,bridgeTokens:D,bridgeHistory:O,getBridgeQuote:oe,getBridgeToTokens:G,getBridgeApproval:W,approveBridge:le,submitBridge:Z}){let V=f?`cb-button ${f}`:"cb-button",U=f?`cb-pill ${f}`:"cb-pill";if(iu.useEffect(()=>{qn(t)},[t]),e)return Ho("button",{type:"button",disabled:!0,className:V,style:T,"aria-busy":"true",children:[rr("span",{className:"cb-spinner","aria-hidden":"true"}),rr("span",{className:"cb-button-label",children:d})]});if(t){let te=n??ow(r),J=r?rw[r]:void 0;return rr(pe,{feature:"connect_button",children:Ho(po,{env:b,theme:m,drawerDirection:x,modal:v,showBalance:y,showPortfolio:p,walletAddress:t,accountName:o,sendAccounts:i,connectorId:R,onSelectWallet:c,onCopyAddress:l?(fe,ce)=>{ce&&l()}:void 0,onDisconnect:s,disconnectLabel:w,style:N,sendTransaction:S,getTransactionReceipt:M,estimateGas:P,onReceive:j,onBridge:L,onBuy:u,onBuyDisabledMessage:h,onSend:K,bridgeTokens:D,bridgeHistory:O,getBridgeQuote:oe,getBridgeToTokens:G,getBridgeApproval:W,approveBridge:le,submitBridge:Z,children:[rr(po.Trigger,{asChild:!0,children:Ho("button",{type:"button",className:U,"data-track":"wallet_pill_open",style:T,"aria-label":`Connected with ${te}: ${ou(t)}`,children:[J?rr("img",{src:J,alt:"",width:18,height:18,className:"cb-pill-icon","data-provider":r}):rr("span",{className:"cb-pill-icon-placeholder","aria-hidden":"true"}),rr("span",{className:"cb-pill-address",children:ou(t)})]})}),rr(po.Content,{align:"end",sideOffset:8})]})})}return rr(pe,{feature:"connect_button",children:Ho("button",{type:"button",onClick:a,className:V,"data-track":"connect_click",style:T,"aria-label":typeof g=="string"?g:"Connect Wallet",children:[rr(tw,{}),rr("span",{className:"cb-button-label",children:g})]})})}function tw(){return Ho("svg",{className:"cb-button-icon",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[rr("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"}),rr("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"}),rr("path",{d:"M12.75 11.25H12.7575",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var rw={google:pa,apple:ua,cross:la,metamask:ca,binance:da},nw={google:"Google",apple:"Apple",cross:ew.default,metamask:"MetaMask",binance:"Binance Wallet"};function ow(e){return e?nw[e]:"Wallet"}function ou(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}import*as su from"react";ie(`.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)}
|
|
22
|
+
`);ie(`.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)}}
|
|
23
|
+
`);import{jsx as uo,jsxs as aw}from"react/jsx-runtime";var lu="https://www.onechain.nexus/skills";function cu({label:e="Skills",href:t,onClick:r,className:n,style:o,theme:i,disabled:a=!1,isLoading:s=!1,loadingLabel:l="Loading...",openInNewTab:c=!1,type:u="button"}){let[h,g]=su.useState(!1),d=Qe(),w=Er("apps.json",d,v=>ar(v?.skills,d)),f=t??w,m=async v=>{if(f&&!r){c?window.open(f,"_blank","noopener,noreferrer"):window.location.href=f;return}if(r)try{g(!0),await r()}finally{g(!1)}},b=a||s||h,y=s||h,p=y?l:e,x=n?`sb-button ${n}`:"sb-button";return uo(pe,{feature:"skills",children:aw("button",{type:u,onClick:m,disabled:b,className:x,"data-theme":i,"data-track":"click",style:o,"aria-busy":y,children:[y?uo("span",{className:"sb-spinner","aria-hidden":"true"}):uo(iw,{}),uo("span",{className:"sb-label",children:p})]})})}function iw(){return uo("svg",{className:"sb-button-icon",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:uo("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"})})}import*as Na from"react";import{createContext as sw,useContext as lw}from"react";var Os=sw(null);function Qo(){let e=lw(Os);if(!e)throw new Error("RelayDeposit compound components must be used within <RelayDeposit>");return e}import*as Uu from"react";import{createContext as cw,useContext as dw}from"react";var fa=cw(null);function zr(){let e=dw(fa);if(!e)throw new Error("ResponsiveShell compound components must be used within <ResponsiveShell>");return e}import{createContext as pw,useContext as uw,useLayoutEffect as fw,useState as mw}from"react";function du(){let e=null,t=new Set;return{getSnapshot:()=>e,publish(r){if(r!==e){e=r;for(let n of[...t])n()}},subscribe(r){return t.add(r),()=>{t.delete(r)}}}}var Fs=pw(null);function gw(){let e=uw(Fs);if(!e)throw new Error("RelayDeposit compound components must be used within <RelayDeposit>");return e}function pu(){let e=gw(),[t,r]=mw(e.getSnapshot);return fw(()=>(r(e.getSnapshot()),e.subscribe(()=>r(e.getSnapshot()))),[e]),t}import{useEffect as Pw,useState as Cu}from"react";var Vo="0x0000000000000000000000000000000000000000",hw=/^0x[0-9a-fA-F]{40}$/;function xt(e){return hw.test(e)}function et(e,t){let r=e<0n,o=(r?-e:e).toString().padStart(t+1,"0"),i=t===0?o:o.slice(0,-t),a=t===0?"":o.slice(-t).replace(/0+$/,""),s=a?`${i}.${a}`:i;return r?`-${s}`:s}function ma(e,t){let r=e.match(/^(-?)(\d+)(?:\.(\d+))?$/);if(!r)throw new Error(`parseUnits: invalid decimal string "${e}"`);let[,n,o,i=""]=r;if(i.length>t)throw new Error(`parseUnits: too many decimal places for ${t} decimals`);let a=BigInt(o+i.padEnd(t,"0"));return n==="-"?-a:a}import{useCallback as qo,useEffect as ww,useMemo as hu,useRef as bu,useState as Yo}from"react";var sn=class extends Error{constructor(t,r,n){super(r),this.name="RelayApiError",this.status=t,this.body=n}};function nr(e){let t=e.baseUrl.replace(/\/+$/,"");async function r(n,o){let i={...o?.headers};o?.body!=null&&(i["Content-Type"]="application/json");let a;try{a=await fetch(`${t}${n}`,{...o,headers:i})}catch(l){throw new sn(0,`network error calling ${n}: ${l.message}`)}let s=await a.text();if(!a.ok){let l=`request to ${n} failed with status ${a.status}`,c;try{c=JSON.parse(s);let u=c;u?.error&&(l=u.error)}catch{c=s||void 0}throw new sn(a.status,l,c)}try{return JSON.parse(s)}catch{throw new sn(a.status,`expected a JSON response from ${n} but got ${s?"a non-JSON body":"an empty body"}`,s||void 0)}}return{getConfig(){return r("/v1/config").then(n=>({...n,targets:n.targets??[]}))},getQuote(n){return r("/v1/quote",{method:"POST",body:JSON.stringify(n)})},getDepositAddress(n,o){let i=new URLSearchParams({user:n.user,originChainId:String(n.originChainId),originCurrency:n.originCurrency});return o&&i.set("target",o),r(`/v1/deposit-address?${i.toString()}`)},getOrder(n){return r(`/v1/orders/${encodeURIComponent(n)}`)},listOrders(n){let o=new URLSearchParams({user:n});return r(`/v1/orders?${o.toString()}`).then(i=>i.orders??[])},ordersStreamUrl(n){return`${t}/v1/orders/stream?user=${encodeURIComponent(n)}`},getRecovery(n){let o=new URLSearchParams({user:n.user});return n.target&&o.set("target",n.target),r(`/v1/recovery?${o.toString()}`)}}}var uu=[{type:"function",name:"deploy",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"version",type:"uint256"}],outputs:[{name:"",type:"address"}]}],Us=[{type:"function",name:"execute",stateMutability:"nonpayable",inputs:[],outputs:[]},{type:"function",name:"sweepToUser",stateMutability:"nonpayable",inputs:[{name:"tokenAddr",type:"address"}],outputs:[]}],js=[{type:"function",name:"computeAddress",stateMutability:"view",inputs:[{name:"recipient",type:"address"},{name:"version",type:"uint256"}],outputs:[{name:"",type:"address"}]}];var _n=["0x486BEEc35A9a9915213Ea02AD3709738335F7702","0x3438735303911aBe113AdF14b18eE730cC24893b","0xA3B548Ab23043e6B24A087515fe1306379683533","0x44317d07378390543d99Ee76374E86C1Ef6cF832"];function ga(e,t){return!e||!t?!1:e.toLowerCase()===t.toLowerCase()}function bw(e,t){return t.some(r=>ga(r,e))}function ha(e){if(!e||e.length===0)return _n;let t=new Set(_n.map(n=>n.toLowerCase())),r=[..._n];for(let n of e){if(typeof n!="string"||!xt(n))continue;let o=n.toLowerCase();t.has(o)||(t.add(o),r.push(n))}return r}async function fu(e,t,{factory:r,forwarder:n,recipient:o,version:i,trusted:a=_n}){if(!r||!n||!o||i===void 0)return{ok:!1,reason:"address verification is missing inputs (factory/forwarder/recipient/version)"};if(!bw(r,a))return{ok:!1,reason:`factory ${r} is not a recognized deposit-address factory -- refusing to sign against it`};if(!e)return{ok:!1,reason:"no chain connection available to verify the forwarder address"};let s;try{s=await e({chainId:t,address:r,abi:js,functionName:"computeAddress",args:[o,BigInt(i)]})}catch(l){return{ok:!1,reason:`could not verify the forwarder address on-chain: ${l instanceof Error?l.message:String(l)}`}}return ga(s,n)?{ok:!0}:{ok:!1,reason:`forwarder address mismatch: the API returned ${n}, but factory ${r} derives ${s} for this account -- refusing to sign`}}async function mu(e,t,{forwarder:r,recipient:n,version:o,trusted:i=_n}){if(!r||!n||o===void 0)return{ok:!1,reason:"address verification is missing inputs (forwarder/recipient/version)"};if(!e)return{ok:!1,reason:"no BSC chain connection available to verify the deposit forwarder -- add BNB Smart Chain (chain 56) to your wagmi config"};let a=await Promise.all(i.map(async s=>{try{return await e({chainId:t,address:s,abi:js,functionName:"computeAddress",args:[n,BigInt(o)]})}catch{return}}));return a.some(s=>ga(s,r))?{ok:!0}:a.every(s=>s===void 0)?{ok:!1,reason:"could not reach any deposit-address factory on BSC to verify the forwarder"}:{ok:!1,reason:`forwarder address mismatch: ${r} is not the address any known factory derives for this account -- refusing to deposit`}}function gu(e,t){return ga(e,t)}var kn=56,Ws={step:"idle"};function yw(e){return e.tokens?.find(t=>t.recoverable)?.address??e.token}function _s(e={}){let t=bu(e);t.current=e;let r=e.wallet,n=r?.walletChainId,o=e.recipient,i=o&&xt(o)?o:void 0,[a,s]=Yo({}),l=qo((g,d)=>{s(w=>({...w,[g.toLowerCase()]:d}))},[]),c=qo(g=>g?a[g.toLowerCase()]??Ws:Ws,[a]),u=hu(()=>Object.values(a).some(g=>g.step==="switching"||g.step==="deploying"||g.step==="recovering"),[a]);return{recover:qo(async(g,d,w)=>{if(!i||!g?.forwarder)return;let f=g.forwarder;l(f,{step:"switching"});try{if(n!==kn){if(!r?.switchChain)throw new Error("wallet cannot switch chains");await r.switchChain(kn)}if(!r?.writeContract||!r?.readContract||!r?.waitForReceipt)throw new Error("wallet is missing contract capabilities required for recovery");let m=await fu(r.readContract,kn,{factory:g.factory,forwarder:g.forwarder,recipient:i,version:g.version,trusted:t.current.trustedFactories});if(!m.ok)throw new Error(`address verification failed: ${m.reason}`);let b;if(!g.isDeployed){if(l(f,{step:"deploying"}),b=await r.writeContract({address:g.factory,abi:uu,functionName:"deploy",args:[i,BigInt(g.version)],chainId:kn}),l(f,{step:"deploying",deployTxHash:b}),(await r.waitForReceipt({chainId:kn,hash:b})).status==="reverted")throw new Error(`forwarder deploy reverted on-chain (tx ${b})`);t.current.onChanged?.()}l(f,{step:"recovering",deployTxHash:b});let y=d==="execute"?await r.writeContract({address:g.forwarder,abi:Us,functionName:"execute",args:[],chainId:kn}):await r.writeContract({address:g.forwarder,abi:Us,functionName:"sweepToUser",args:[w??yw(g)],chainId:kn});if(l(f,{step:"recovering",deployTxHash:b,actionTxHash:y}),(await r.waitForReceipt({chainId:kn,hash:y})).status==="reverted")throw new Error(`recovery transaction reverted on-chain (tx ${y})`);l(f,{step:"done",deployTxHash:b,actionTxHash:y}),t.current.onChanged?.()}catch(m){let b=m instanceof Error?m:new Error(String(m));s(y=>{let p=f.toLowerCase();return{...y,[p]:{...y[p]??Ws,step:"error",error:b.message}}}),t.current.onError?.(b)}},[i,n,r,l]),stateFor:c,busy:u}}function wu(e={}){let t=bu(e);t.current=e;let r=hu(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useRecovery: either `client` or `apiBaseUrl` must be provided");return nr({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.recipient,o=n&&xt(n)?n:void 0,[i,a]=Yo(),[s,l]=Yo(!1),[c,u]=Yo(),[h,g]=Yo(0),d=e.target,w=e.enabled??!0;ww(()=>{if(!o||!w){a(void 0),u(void 0),l(!1);return}let p=!1;return l(!0),r.getRecovery({user:o,target:d}).then(x=>{p||(a(x),u(void 0))}).catch(x=>{if(p)return;let v=x instanceof Error?x:new Error(String(x));a(void 0),u(v),t.current.onError?.(v),v instanceof sn&&v.status===401&&t.current.onUnauthorized?.()}).finally(()=>{p||l(!1)}),()=>{p=!0}},[r,o,h,d,w]);let f=qo(()=>g(p=>p+1),[]),m=_s({recipient:e.recipient,wallet:e.wallet,trustedFactories:e.trustedFactories,onError:e.onError,onChanged:f}),b=qo(async(p,x)=>{i&&await m.recover(i,p,x)},[m,i]),y=m.stateFor(i?.forwarder);return{info:i,loading:s,error:c,refresh:f,recover:b,recoveryState:y}}var xw="BSC_FUNDED";function yu(e){if(!e)return 0n;try{let t=BigInt(e);return t>0n?t:0n}catch{return 0n}}function vw(e,t){return e.target||t}function fo(e,t=[]){let r=e.find(o=>o.isDefault)?.symbol,n=new Map;for(let o of e){if(!o.info?.forwarder)continue;let i=o.info.forwarder.toLowerCase(),a=n.get(i);if(a){a.targets.push(o.symbol);continue}n.set(i,{forwarder:o.info.forwarder,targets:[o.symbol],info:o.info,deposits:[],depositsTotal:0n})}for(let o of n.values()){let i=new Set(o.targets);for(let a of t){if(a.status!==xw)continue;let s=vw(a,r);if(!(!s||!i.has(s)))for(let l of a.deposits??[])o.deposits.push({amount:l.amount,originChainId:l.originChainId,originTxHash:l.originTxHash,txHash:l.txHash,blockNumber:l.blockNumber}),o.depositsTotal+=yu(l.amount)}o.deposits.sort((a,s)=>a.blockNumber-s.blockNumber)}return[...n.values()]}function xu(e){return e.filter(t=>(t.info.tokens??[]).some(r=>r.recoverable)?!0:yu(t.info.balance)>0n&&t.info.suggestedAction!=="none")}function ba(e){return e.reduce((t,r)=>t+(r.info.tokens??[]).filter(n=>n.recoverable).length,0)}var vu={1:{base:"https://etherscan.io",name:"Etherscan",kind:"evm"},56:{base:"https://bscscan.com",name:"BscScan",kind:"evm"},137:{base:"https://polygonscan.com",name:"PolygonScan",kind:"evm"},8453:{base:"https://basescan.org",name:"BaseScan",kind:"evm"},42161:{base:"https://arbiscan.io",name:"Arbiscan",kind:"evm"},612055:{base:"https://scan.crosstoken.io",name:"ONEchain Scan",kind:"evm"},792703809:{base:"https://solscan.io",name:"Solscan",kind:"svm"}};function ku(e,t){let r=vu[e];if(!(!r||!t))return{url:`${r.base}/token/${t}`,name:r.name}}var kw={1:"Ethereum",56:"BNB Smart Chain",137:"Polygon",8453:"Base",42161:"Arbitrum",612055:"ONEchain",792703809:"Solana"};function Ko(e){return kw[e]??`Chain ${e}`}function wa(e,t){let r=vu[e];if(!(!r||!t))return{url:`${r.base}/tx/${t}`,name:r.name}}import{useId as Rn}from"react";var Rw="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTQwIDU0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzc0MDAwXzM4NTkwKSI+CjxtYXNrIGlkPSJtYXNrMF83NDAwMF8zODU5MCIgc3R5bGU9Im1hc2stdHlwZTpsdW1pbmFuY2UiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSI1NDAiIGhlaWdodD0iNTQwIj4KPHBhdGggZD0iTTI3MCAwQzU2Ljg1NjMgMCAwIDU2Ljg1NjMgMCAyNzBDMCA0ODMuMTQ0IDU2Ljg1NjMgNTQwIDI3MCA1NDBDNDgzLjE0NCA1NDAgNTQwIDQ4My4xNDQgNTQwIDI3MEM1NDAgNTYuODU2MyA0ODMuMTQ0IDAgMjcwIDBaIiBmaWxsPSJ3aGl0ZSIvPgo8L21hc2s+CjxnIG1hc2s9InVybCgjbWFzazBfNzQwMDBfMzg1OTApIj4KPHBhdGggZD0iTTUzOS43MzEgMC4yNzA1MDhIMFY1NDAuMDAxSDUzOS43MzFWMC4yNzA1MDhaIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNzQwMDBfMzg1OTApIi8+CjxwYXRoIGQ9Ik0xODguNjIzIDU0MC4wMDFINTM5Ljg2NVYxMDIuOTM2TDE4OC42MjMgMzI3LjkzNlY1NDAuMDAxWiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzc0MDAwXzM4NTkwKSIvPgo8cGF0aCBkPSJNMTg4LjYyMyA1NDAuMDAySDBWMTI4LjUzNUwxODguNjIzIDMyNy45MzZWNTQwLjAwMloiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl83NDAwMF8zODU5MCkiLz4KPC9nPgo8cGF0aCBkPSJNMTQ3Ljg4NCA0MDMuNDkzQzEzOC4wMjUgNDAzLjQ5MyAxMjkuMjk2IDQwMS40MzkgMTIxLjY5NiAzOTcuMzMxQzExNC4wOTYgMzkzLjEyIDEwOC4xNCAzODcuMzY5IDEwMy44MjYgMzgwLjA3N0M5OS42MTU1IDM3Mi43ODYgOTcuNTEwMiAzNjQuNTcgOTcuNTEwMiAzNTUuNDI5VjI5OC44NjZDOTcuNTEwMiAyOTYuNDk5IDk5LjQyOSAyOTQuNTggMTAxLjc5NiAyOTQuNThIMTEzLjQwNUMxMTUuNzcyIDI5NC41OCAxMTcuNjkxIDI5Ni40OTkgMTE3LjY5MSAyOTguODY2VjM1NC41MDVDMTE3LjY5MSAzNjAuMzU5IDExOS4wMjYgMzY1LjU5NyAxMjEuNjk2IDM3MC4yMThDMTI0LjM2NiAzNzQuNzM3IDEyOC4wMTIgMzc4LjMzMSAxMzIuNjM0IDM4MS4wMDJDMTM3LjI1NSAzODMuNTY5IDE0Mi4zMzkgMzg0Ljg1MyAxNDcuODg0IDM4NC44NTNDMTUzLjg0MSAzODQuODUzIDE1OS4xODEgMzgzLjU2OSAxNjMuOTA2IDM4MS4wMDJDMTY4LjYzIDM3OC4zMzEgMTcyLjMyNyAzNzQuNzM3IDE3NC45OTcgMzcwLjIxOEMxNzcuNjY3IDM2NS41OTcgMTc5LjAwMiAzNjAuMzU5IDE3OS4wMDIgMzU0LjUwNVYyOTguODY2QzE3OS4wMDIgMjk2LjQ5OSAxODAuOTIxIDI5NC41OCAxODMuMjg4IDI5NC41OEgxOTQuMTI3QzE5Ni40OTQgMjk0LjU4IDE5OC40MTMgMjk2LjQ5OSAxOTguNDEzIDI5OC44NjZWMzU1LjQyOUMxOTguNDEzIDM2NC41NyAxOTYuMjU2IDM3Mi43ODYgMTkxLjk0MyAzODAuMDc3QzE4Ny43MzIgMzg3LjM2OSAxODEuODI3IDM5My4xMiAxNzQuMjI3IDM5Ny4zMzFDMTY2LjczIDQwMS40MzkgMTU3Ljk0OSA0MDMuNDkzIDE0Ny44ODQgNDAzLjQ5M1oiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0yNjcuNjU3IDQwNC4xMDlDMjYwLjM2NSA0MDQuMTA5IDI1My42MzggNDAzLjMzOSAyNDcuNDc2IDQwMS43OThDMjQxLjQxNyA0MDAuMTU1IDIzNS44NzEgMzk3Ljg0NCAyMzAuODM5IDM5NC44NjZDMjI2Ljg3MiAzOTIuNDY5IDIyMy4yMDQgMzg5LjU3NCAyMTkuODM2IDM4Ni4xNzlDMjE4LjM5OCAzODQuNzMxIDIxOC4zMjEgMzgyLjQ0OSAyMTkuNTUgMzgwLjgyMUwyMjYuMTg2IDM3Mi4wM0MyMjcuODAzIDM2OS44ODggMjMwLjk2MyAzNjkuNzUxIDIzMi44ODMgMzcxLjYyNkMyMzcuOTUzIDM3Ni41NzYgMjQzLjAyMyAzODAuMjE1IDI0OC4wOTIgMzgyLjU0MkMyNTQuNDYgMzg1LjMxNSAyNjEuMjg5IDM4Ni43MDIgMjY4LjU4MSAzODYuNzAyQzI3Mi43OTIgMzg2LjcwMiAyNzYuNzQ2IDM4Ni4xODggMjgwLjQ0MyAzODUuMTYxQzI4NC4yNDMgMzg0LjAzMSAyODcuMzI0IDM4Mi40MzkgMjg5LjY4NiAzODAuMzg1QzI5Mi4xNTEgMzc4LjIyOSAyOTMuMzgzIDM3NS42MSAyOTMuMzgzIDM3Mi41MjlDMjkzLjM4MyAzNzAuNDc1IDI5Mi43NjcgMzY4LjcyOSAyOTEuNTM0IDM2Ny4yOTFDMjkwLjQwNSAzNjUuNzUxIDI4OC44MTMgMzY0LjQ2NyAyODYuNzU5IDM2My40NEMyODQuODA4IDM2Mi4zMSAyODIuNTQ4IDM2MS4zODYgMjc5Ljk4MSAzNjAuNjY3QzI3Ny40MTMgMzU5Ljk0OCAyNzQuNzQzIDM1OS4zMzIgMjcxLjk3IDM1OC44MTlDMjY5LjE5NyAzNTguMzA1IDI2Ni40MjQgMzU3Ljg0MyAyNjMuNjUxIDM1Ny40MzJDMjU3LjE4MSAzNTYuNDA1IDI1MS40MyAzNTUuMDcgMjQ2LjM5OCAzNTMuNDI3QzI0MS4zNjUgMzUxLjY4MSAyMzcuMTAzIDM0OS40NzMgMjMzLjYxMiAzNDYuODAzQzIzMC4xMiAzNDQuMTMyIDIyNy40NSAzNDEgMjI1LjYwMSAzMzcuNDA2QzIyMy44NTUgMzMzLjgxMSAyMjIuOTgyIDMyOS42NTIgMjIyLjk4MiAzMjQuOTI4QzIyMi45ODIgMzE5Ljk5OCAyMjQuMTEyIDMxNS41ODIgMjI2LjM3MSAzMTEuNjc5QzIyOC42MzEgMzA3LjY3NCAyMzEuODE0IDMwNC4yODUgMjM1LjkyMiAzMDEuNTEyQzI0MC4wMyAyOTguNzM5IDI0NC43NTUgMjk2LjYzNCAyNTAuMDk1IDI5NS4xOTZDMjU1LjUzOCAyOTMuNjU2IDI2MS40NDMgMjkyLjg4NSAyNjcuODExIDI5Mi44ODVDMjc0LjU4OSAyOTIuODg1IDI4MC43IDI5My42MDQgMjg2LjE0MyAyOTUuMDQyQzI5MS42ODggMjk2LjQ4IDI5Ni41NjcgMjk4LjU4NSAzMDAuNzc3IDMwMS4zNThDMzAzLjkzOCAzMDMuMzYzIDMwNi43MjMgMzA1LjY4NiAzMDkuMTMyIDMwOC4zMjdDMzEwLjUyMiAzMDkuODUyIDMxMC40IDMxMi4xNjkgMzA5LjAxMSAzMTMuNjk2TDMwMi4yNDEgMzIxLjEzNUMzMDAuNDkgMzIzLjA1OCAyOTcuNDUzIDMyMi45NzMgMjk1LjU0OCAzMjEuMjAzQzI5My44MzkgMzE5LjYxNCAyOTEuOTg3IDMxOC4xODYgMjg5Ljk5NCAzMTYuOTE3QzI4Ni43MDcgMzE0Ljc2IDI4My4xNjQgMzEzLjE2OCAyNzkuMzY0IDMxMi4xNDFDMjc1LjU2NSAzMTEuMDEyIDI3MS41NTkgMzEwLjQ0NyAyNjcuMzQ5IDMxMC40NDdDMjYyLjgzIDMxMC40NDcgMjU4LjgyNCAzMTAuOTYgMjU1LjMzMyAzMTEuOTg3QzI1MS44NDEgMzEzLjAxNCAyNDkuMDY4IDMxNC41MDQgMjQ3LjAxNCAzMTYuNDU1QzI0NC45NiAzMTguNDA2IDI0My45MzMgMzIwLjc2OCAyNDMuOTMzIDMyMy41NDFDMjQzLjkzMyAzMjUuODAxIDI0NC42MDEgMzI3LjgwMyAyNDUuOTM2IDMyOS41NDlDMjQ3LjI3MSAzMzEuMTkyIDI0OS4xMTkgMzMyLjYzIDI1MS40ODEgMzMzLjg2MkMyNTMuOTQ2IDMzNC45OTIgMjU2LjgyMiAzMzUuOTY4IDI2MC4xMDggMzM2Ljc4OUMyNjMuMzk1IDMzNy41MDggMjY2Ljk4OSAzMzguMTc2IDI3MC44OTIgMzM4Ljc5MkMyNzYuODQ4IDMzOS43MTYgMjgyLjQ0NSAzNDAuODk3IDI4Ny42ODMgMzQyLjMzNUMyOTIuOTIxIDM0My43NzMgMjk3LjU0MiAzNDUuNjczIDMwMS41NDggMzQ4LjAzNUMzMDUuNTUzIDM1MC4yOTQgMzA4LjYzNCAzNTMuMTcgMzEwLjc5MSAzNTYuNjYyQzMxMy4wNSAzNjAuMDUxIDMxNC4xOCAzNjQuMzEzIDMxNC4xOCAzNjkuNDQ4QzMxNC4xOCAzNzYuNTM0IDMxMi4yMjggMzgyLjY5NiAzMDguMzI2IDM4Ny45MzRDMzA0LjQyMyAzOTMuMDY5IDI5OC45OCAzOTcuMDc0IDI5MS45OTYgMzk5Ljk1QzI4NS4xMTYgNDAyLjcyMyAyNzcuMDAyIDQwNC4xMDkgMjY3LjY1NyA0MDQuMTA5WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTM0Mi43NjkgNDAyLjU2OUMzNDAuNDAyIDQwMi41NjkgMzM4LjQ4MyA0MDAuNjUgMzM4LjQ4MyAzOTguMjgzVjI5OS4wMkMzMzguNDgzIDI5Ni42NTMgMzQwLjQwMiAyOTQuNzM0IDM0Mi43NjkgMjk0LjczNEgzODUuMzM1QzM5NC4zNzIgMjk0LjczNCA0MDIuNDM0IDI5Ni4xMiA0MDkuNTIxIDI5OC44OTNDNDE2LjYwNyAzMDEuNTYzIDQyMi42MTUgMzA1LjM2MyA0MjcuNTQ0IDMxMC4yOTNDNDMyLjQ3NCAzMTUuMjIyIDQzNi4xNzEgMzIwLjk3NCA0MzguNjM2IDMyNy41NDZDNDQxLjIwMyAzMzQuMDE3IDQ0Mi40ODcgMzQxLjA1MSA0NDIuNDg3IDM0OC42NTFDNDQyLjQ4NyAzNTYuMzU0IDQ0MS4yMDMgMzYzLjQ5MSA0MzguNjM2IDM3MC4wNjRDNDM2LjE3MSAzNzYuNTM0IDQzMi40NzQgMzgyLjIzNCA0MjcuNTQ0IDM4Ny4xNjRDNDIyLjYxNSAzOTEuOTkxIDQxNi42MDcgMzk1Ljc5IDQwOS41MjEgMzk4LjU2M0M0MDIuNDM0IDQwMS4yMzQgMzk0LjM3MiA0MDIuNTY5IDM4NS4zMzUgNDAyLjU2OUgzNDIuNzY5Wk0zNTguNTEgMzg0LjY2M0MzNTguNTEgMzg1LjI2OCAzNTcuNjk4IDM4NS40NjggMzU3LjQxNiAzODQuOTMzQzM1Ny4yMTMgMzg0LjU0NyAzNTcuNDkzIDM4NC4wODMgMzU3LjkzIDM4NC4wODNIMzg0LjU2NEMzOTAuODI5IDM4NC4wODMgMzk2LjI3MiAzODMuMjEgNDAwLjg5NCAzODEuNDY0QzQwNS42MTggMzc5LjYxNSA0MDkuNTIxIDM3Ny4wOTkgNDEyLjYwMiAzNzMuOTE1QzQxNS42ODMgMzcwLjczMiA0MTcuOTQyIDM2Ny4wMzUgNDE5LjM4IDM2Mi44MjRDNDIwLjkyIDM1OC41MSA0MjEuNjkgMzUzLjc4NiA0MjEuNjkgMzQ4LjY1MUM0MjEuNjkgMzQzLjYxOSA0MjAuOTIgMzM4Ljk5NyA0MTkuMzggMzM0Ljc4N0M0MTcuOTQyIDMzMC40NzMgNDE1LjYzMSAzMjYuNzI1IDQxMi40NDcgMzIzLjU0MUM0MDkuMzY3IDMyMC4yNTUgNDA1LjUxNSAzMTcuNzM5IDQwMC44OTQgMzE1Ljk5M0MzOTYuMjcyIDMxNC4xNDQgMzkwLjgyOSAzMTMuMjIgMzg0LjU2NCAzMTMuMjJIMzU3Ljg0N0MzNTcuMjk5IDMxMy4yMiAzNTYuOTg4IDMxMi41OTEgMzU3LjMyMSAzMTIuMTU1QzM1Ny43MDYgMzExLjY1MiAzNTguNTEgMzExLjkyNCAzNTguNTEgMzEyLjU1N1YzODQuNjYzWiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTI1NS4wNiA4NS4zNzAxTDIwNS4zODkgMTE0LjA2OUMxOTYuNjI4IDExOS4xMDUgMTkzLjU5MiAxMzAuNDE5IDE5OC42MjggMTM5LjE4QzIwMy42NjQgMTQ3Ljk0MiAyMTQuOTc4IDE1MC45NzcgMjIzLjc0IDE0NS45NDFMMjY1Ljc1MyAxMjEuNjU3TDI0NS43NDcgMTQzLjExM1YyMjcuMjc3QzI0NS43NDcgMjM3LjQxOCAyNTQuMDI1IDI0NS42OTcgMjY0LjE2NiAyNDUuNjk3QzI3NC4zMDcgMjQ1LjY5NyAyODIuNTg2IDIzNy40MTggMjgyLjU4NiAyMjcuMjc3VjEwMS4zMDZDMjgyLjU4NiA5Ny43ODc4IDI4MS40ODIgOTQuMzM4NSAyODAuMTAyIDkyLjA2MTlDMjc0LjkyOCA4My4zNjk1IDI2My43NTIgODAuMjY1IDI1NC45OTEgODUuMzAxMUwyNTUuMDYgODUuMzcwMVoiIGZpbGw9IndoaXRlIi8+CjwvZz4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl83NDAwMF8zODU5MCIgeDE9Ii02Mi41MTUiIHkxPSItNjQuODA0MyIgeDI9IjU3NS40MzQiIHkyPSI1NzcuNzI2IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGMzc1MkQiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRUMxMjcyIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQxX2xpbmVhcl83NDAwMF8zODU5MCIgeDE9IjEzNC43MzEiIHkxPSIxMjQuMjIzIiB4Mj0iMzk3LjU5IiB5Mj0iMzUwLjE2NiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwLjUiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl83NDAwMF8zODU5MCIgeDE9IjMzNi42OTIiIHkxPSIxOC43Mjk1IiB4Mj0iODguMjQ4NSIgeTI9IjM0Mi4yMTgiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0id2hpdGUiIHN0b3Atb3BhY2l0eT0iMC41Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0id2hpdGUiIHN0b3Atb3BhY2l0eT0iMCIvPgo8L2xpbmVhckdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzc0MDAwXzM4NTkwIj4KPHJlY3Qgd2lkdGg9IjU0MCIgaGVpZ2h0PSI1NDAiIHJ4PSIyNzAiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==",Sw="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAwIiBoZWlnaHQ9IjMwMCIgdmlld0JveD0iMCAwIDMwMCAzMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xNTAgMzAwQzIzMi44NDMgMzAwIDMwMCAyMzIuODQzIDMwMCAxNTBDMzAwIDY3LjE1NzMgMjMyLjg0MyAwIDE1MCAwQzY3LjE1NzMgMCAwIDY3LjE1NzMgMCAxNTBDMCAyMzIuODQzIDY3LjE1NzMgMzAwIDE1MCAzMDBaIiBmaWxsPSJibGFjayIvPgo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNTAsMTUwKSBzY2FsZSgwLjg1KSB0cmFuc2xhdGUoLTE1MCwtMTUwKSI+CjxwYXRoIGQ9Ik0xNjYuOTkzIDM2LjMyMFY1OS41ODVIMjAwLjM3OEwyMjIuNjgwIDgxLjg4N1YxMDcuNzc1SDE5MC4xMzJWOTIuMTMySDEwOS44NjlWMTMzLjcyNkgxOTMuMzE3TDIyMi42ODAgMTYzLjA4N0wyMjIuNjgxIDIwNi42MzZWMjE3LjkzOEwyMDEuNDM2IDIzOS4xODNIMTY4Ljg1OFYyNjMuNjgwSDE0MC4yNDFWMjM5LjE4M0g5OC41NjRMNzcuMzIwIDIxNy45MzlWMTkxLjM3M0gxMDkuODY5VjIwNi42MzZIMTkwLjEzMlYxNjYuMjc0SDEwMS44NTRMNzcuMzIwIDE0MS43NDBWODEuODg3TDk5LjYyMiA1OS41ODVIMTQwLjI0MVYzNi4zMjBIMTY2Ljk5M1oiIGZpbGw9IiNGQjg1MjQiLz4KPC9nPgo8L3N2Zz4K",Cw="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgAElEQVR42u29CUCb55kn/rbT2clOu93OtJlOmjquHQLBYM6QttPZdpt2esx02v92O52dTo/ZHtNsw32jEx+J49hO4jgx6P4kgQEfYHyBbWxsDMY2NjaHwYAxmNPcp0DSd+j/Hp+EwNjxwSHBqz5RhRCy9L3v733u3wMc9LawN2HmgQBvDgcPRRB4eBPQ/zsEYc7LLZx9eHqyZ3y4rq/jfNvNE41VeTUXPrp0YlNpbmSR7l8P7/7hwR2v5b71zX1bv5q9OdysDDMpg4zyIJMi0KTYgCXQhH6ETwYb5WFmZbg5/ev7tnwzb9v3D7zz88O73ziukZ3Jfv/i0azq0qMNV87eqbve29Y1OjA4NT5ht/L3fwEef14s8H/oI5JvMucL0tsC3QC9BAsLQQQ2Dt2x6AEHH+NNPLOBJ23TvRPDt/q7Sltqcq6f233xSGyR/ieHdn3dvGmtPgVo4oE6BmRGAlU00MQBXeLn9SlrDKlrDWnrmLT1jMTXKPUxSn2x+M0W8qQPEsk6RgL/ZI0hDf450CUBLX5bVRR6W3Uc0CeFm5Q/zHvnD8cyt5cdyqo+W9x8rfbe3Y7xoRGrhXc7JgQESfSFbPDLcAiddghMus4UhJ6qAhEC7SwvcDO7lHMIEzbrnZH+q10teXUVO8sP//Fo5t9lbwGGZISKvVEgIwpoEp7Vp0CABTCyEJMC6rEIqO7MymCs4jYYZf5I5Phe5vdo4voT+OfwTeBbhcF3NimhwAfBJvmLBsmz+lSgTUSwhJhXR0PAB5uU/164Z+u5A+bq0gttDS1DvSNTFrsTkyIg0ekiCFQhUhB6EPawqQn/c+k7VhAGpydu3msvunV1R/nhPxzN2JC9CajjsRaKgfv+RUMaNB0JKpBtaZJDnARAzDAEQkTLoce+j4y6h4uv21v5GuUEpcSIDcHIjDAqQg1yH4PkGR08HWJBZhS8/4xJ9ouC3VvP5RXUVlzvvtM7MWblefdvjk1WCkgKwqX19jioDZBCcDh9PMH1u1Grpb6/82jjlbdK8/750C6k6zKjgSoWWoN+jDQM4y0c67cNCGNyjAfpfQiR+YkIlPotEAI/TqS+jGjcQmQGGWVhGJahJkWAUfY5iElVHFDBsyPutf1vp5407q8pu9pzZ9Ay7rJakdMr3qAxgK8PRiZygCk+KQgX1tqE5z7L8nbsG5Enp1m2Y3TwXGvdB5XH/vXwbsCkYvMyFnpiUNcRRbfRpPAXkTaj4jxZ3A8FqC1DiMY2yp8zpCLfMiMSaBP++eDObecPFt2quj3Ua7HZXfaqDTvCGI7kRv1HCsIF0oA4XMgJTmPMYre1DPUcrr+UVmLeuG8zst9U0Z/VJAUaZXC/wl0LLUx/jwfbY2lLeL8B+5ZESX5Jm4qUvCr6vxulfzqh2XfjfG1v+4jVIrjCUxiKvEA1IQXhE0FOEG1PBzKvcFaB/MrGca1DfQV1F6OL9H/NSLCDF+/LSMLQvkR+3Rx9soJAiC1nRvqyQeqDfyR6HkqAQQIVI4q7GpJ+eXiPpurUtd62Udu0W7DKPb9BbxSEHwdAMTuGz3EWeX4YewLfMTIAnb2Ek8wXjBK04bSJAYyM6AR/o9zlU61I+M3Rh76zXFn0YCNWjxCWn4NuMLw4uqTfHv4o+0bprf4uCytaqviScsSaoPqRgvBhcU47TvAJnLhJBqcmL7Y1vHXuQHCWEm0vTXyAURpuUhA3z4/KbLUPbQGS//ikJhGoo/6MSU0oNhQ1VnWOD3NYLcLzzYbhSOM1FITz3OD+QPEWUfUJLQO95uul/1KwG2hiocsHzbBwZ4jFXS1QmRtoxZclkOhGRoZqD1SRr+Vu+/DisevddyY5OzFSSWyZ7rrVDkIU7cQOIDY/xQ0xYbNd6mzeUpr710YpVH2f1yWHoUCLMgDanLPsTIrAB9mrUqeZOmOprkM2fDTQJ0Ye1xQ3V/dNjbtsD1YQE40CBeEqvCGvj8OmEY7C9E2OHWm88ttjGSgKr4qFGi/crMSxFumKdvMW0Xt0Pd5gkuMCIDmqWNBG/2D/O1nXS9tG+jmc6YFLwHKzkq4UhKtCC7I49OLAvknH2FBWzbl/OrADZER+UpsUjBwbpb9RTtXdgkuoESlGlG9URfubFbsuFt7s72KxGYJCNhy/OjXiqgMhaWjADxytw33qK8V/n7UZqKPX6lLDzekbTUqo9HxQOJ5iZjE8Rpm/QRaI0xv+jBTleJi0recP1Pa02/CikO4NCsKVhzoHiYmLhVX4BuG359JxX6McZEb56CVwT2zAWT5fRgp3CQXMotbiEKcxANfHBRplqCZOl5Bekn2j546oFXGSiNSmChSEKyL354Auhx37H1DuDg9mXC7+MvRP9kb54Ty7P3X5lk/8cQNkMDwNUd9WkrI0t8apFW0ca7dzrnQRBaH3hkAdLvU3MDHGVJ/dmJUO4UeOYWR5MhKKBA+AokyEYmYsMCRtLzvUNHyP1C3ZkKfIUxB6Ge5cPbSuaNuIdaqg4dL39m8HmZHrGWR8+hP4MVJXKwMVT0gwhhkRPwBQRX/BLIPuesf4kGjNYLuUdztbKQg9Ougi1p3h3AM8R8vaG35ZuAdkRL6AQi8o7InCA8ysOiwKA8+CokkRwKA87as5Ww82VI5apxzYomE5F+eGQEHoqSBETe28HWWd0MHZNNClPJsDtHGf1iVD7RdoUtCN7i3xm0BGHm5KX8ukgYzoXx3Ze6mjGcVsBOjec3aeX2GO4ooCIdR+drxUA5aJrOrS540S6O6H4FJPH5MMGp80BuNFOPTXS0mvxn9VJwFN7NYLB++MDsBVZjHhDQWhx3mBpLkb53z58raGHxe8B42ZANzPTlocsP0ppwj0os4pVzJjI64Lh45iSHb6wfqKEfu0Q0w4YZoD7zdNvR6E0D+w474j+LhrfOid8nyo/b6sSY4wp1O9t5JaNOB5+rJeAjKjIk9o6/s6SNWvbUX0RQEv14HICcQBGL7kTu23c94E6phXjIiQk8Jv5YVtAk3ycHM6UCcAQ0r29dIJm5X4IN5e7OaVIBTEWCjhOHN0jQ29df4A0MSsMaRBF4Lu15XdooGYIFGdTfQfj2XW3rtLDmNXLZRAQbjYtS/I9sAZCFLfBN3zsrsN38zbBpcEKsANJtLk7spAUFlpOPTH6+tnQgEboIEqMTWn9sIk7t9nUVofpTAc3taO4U0g5AQxCcGxqAFiZMryUeUJoI1bq08lCpCm3VeVoxgCVSIDVeIbccX61pE+5JWwdpYliUSegnARYzAsPuaga/7vR/aAjChUBAwVIKYhoiBcbRFUf6MsAnmJcV/N3lR6u4YVSKWblxV+ewMIBZEBzc6jHC3E4aFbl/8bIwHaJLgATuxJXzbQKtBVCsWQrPS1hjToknxw+fjQ1KQDbxWHW5kbBeFTVqI5oKUPTQyWY+GPw1OWbRWHgTo6gJEGO0Og3kKqS2XxcBhIvMTMqN8fy7g92ItcRI7F/G685ycSPR2EAgIhLgQVHI1DPb86/AE88CJw+x8FHpU5ucRXoWmqSnjJrChra3DgnWPjvcAw9XhNyKNKNGhXnGmre8GMAmJhJgWeDUZ3HpV5oAjtIx+DBHqJphul0xzn4Bw8z1MQPqkf6Ez+THGc+cY5oInzYSTBZqU7zS4VKvenMTaYFKg1URW1pTSPuIgiI7+nKkXgmTYovGRW7ASOQiewPB9kRIWiNKCCmqBUHqn42yh/FbqIGdG/Ldx7Z7QfZS/sHM/xFISPURDDsiyuBR3+wwkV2BsVZlZStk8qj9etz8gistKBJv7vcrZe676Ds/keWmgKPBCBpBitsa/zJwd3wosIvW1aAUPlcRFIaLvCTcoXdCnAkFzSWiOI08x5CsJ5bM+ZXDwvsvFe6mzyy07/lC4RXkQf2gxB5fGTFuSBD2YB9zdIgCb2QF0Fh7cZy3MeNTgRLD8GnRYCy/E2loOqsKS1Fh5dvrq0MJNiPTVBqTy1ixjEyEMRoVu0+urJaddUYQrC+6OhpN7v+K0qoEvwN0iDMALhA7qNqDyNBDCIzTnAKHvFiEZr7SovQKOFUR0y5yFNFx4AQjxVmVil++ouAHV0MIOGbPngdnhqiFJZiGCpjDDrvWJUAHVUemnuhM3mcHhKChEsuwa0sihqBY107bUS0pEU6MZDQUFIZQFLanBVDUpdpJZkIRI3wWHHcfjVDEKBDMW18ryu6iQ8osJMIgIp9qgsUiof+jgROIWYcso4ap8mwxJXLwhxcS2qStNcLgaZUVAHEvP9ZYOUGA9UqCwCeZTUxyhDOFQhHI5YCW0Ut7pAKJAeeVSTzdsE/qMrxdBdjnDOhMAZHlqYRmUR8xaIJoORolR+ZlTCKWbEhsiF0YjEZUrlL48mtHO8zY7K0gzXzkAEhpiVAbQvnspSApKB+lD6NXM6yIhKOW0as1p5RBrGrRpNiK1weObsry2HCAwlM8mwkUA3B5WlpI2CXg9qzFdFK8/ss9hd8VJhhYNQcNLwFDZeBproUFTNgI4lPzQZl+4MKksoDKKNglB81QTt0shtZYcmoXEmLAM/DVhKX5DFQz3gw5MtN4AmLoyRBxjlNA9BZdmzF19DcZqoPZdO2AQUrmeXth9/6UAITxgrzslc7GwChuRAvdQPGqI0CkrFI6pq5GFZSqCOMl4v5VETD7eUeYulAyGhyq7r6/yKSfqSLm0DapCXvayXUDVIZXmdQ19smgYa5a8wCqCOKW686sDU0isFhHhch+CsD7o7OvD9vLc/Z0iBrqAfI3PO6KT7gMqy9j0ZxPyhv1EexMiAIfFCRyMJ0ghLwiQMFjsMw+OpHQ7eMTA9+ZvCj4A2IcKo9HXCjyKQiueIj1EaZJK/aEh9wSSv7btLcmkst+j+4SKDEFqhLPJ0pzhWdmYf1PXh4qwyuuRUPDGbv94ohWbaM9rk7x/c0Ts+IiBWb26xcxaLbY4KNsRL7lBfOwVUUeFm5csGikAqHtxvwcjWm1A/PlDFRZ3Uj1utOGXBex8IofmJp4vzNh4Rk59orgaq2DA8rRo7wXS9qXguCP0YqY9JFmFKBxnR71cexcw05L/F4vReFBAKIgJxOLSnHTBpAQbpBhNNx1PxJsFTLiKP3LriQEYpa1+0CReLowkdAsehpHzvxOhPDr37GU3Sxiw6NpCKV4VMGcSbGGyQASb1enebYzGTh4tkjiL1Pc2xqWeygToOBWNofTYVbzNNfRnpRrPyC5rkfz6ws2t8BPPqszOdQJ4PQnifU1MGMtHcCBqJoeKlOPQxylCQRh2bdjoLKhXBSeW9sJYpWCQEVnW1AH1SMC3LpuL9eQvcaRG1v/YCmgJM5jwtaHHpAoOQ0Dnemxz7wcGdz2qTA1FElFqhVLzcPzQi5jGgSxKdQ44TFrTjacFASM4IQRBYnt96/gBQxUQg3l6KQCpeb5RCRbLRpPi0Nvnn+bt7p8YdKAO3kHMtwAIqQTtrh5/sWGMVyIyKwOOTfGmTBJWVYpSGm5UgM3p3RaFN4Fk0td3zNCFxBVsGe17IkgcwEjrEk8rKU4nhJgXQxJ65XeNYUM5S8NRW6MzNYrcnnjQAbXyISenUgRSHVFaOBBrlzzFpr+W81TE2hI0/wSNAiMvTBJZFp0J+/UXEm2ZO96FWKJUVapSGZaUDdcym0jw7qWZbiLEW4OnNUFJHcKu/ew3Kb0pINIkuGJUVCUIfk+xVBhql0SXNN1A5G+LCeNr+36cFISvwAidMsrak0yagjgszkjlKVBNSWbGywSRfp0/9Zt62zvEhxJyEGg6XE4QCKeQ51nQVqKPJLEE/1C5IQUjliSrFjB7d6eYrbm9ZmEkJMmPerSiEfhj/1In7pwIhGT7cPTr09Zyt6wxpOCLqudcOfjx3CTDKiPgb0WP4DHzg/iv4I3nG9VvygPyKvJK8xv0Z9xeQ17uEvNL9nckD54tn/YnrZa5/3fUnc97Z/cPP+WCu3855N9cndL3M/a9cf+h6setjz/kA7t/d/RPOefH99+6f3PX+G3Dkw08sM5Z6+HmBBh5q46/cbRb5k4Qnryd9ShAib/C9ikLoqkaYlB584aTQTfUxSOBJsY6RrGek8H4tI1lHxTOErMWLhrSvGKUv6yXeoLelwSblJ3RJvzyyZ2TaImCFJLhNvF0iEDprRG8DXQJ0BT3WinjJhAjt1htlX8/Z/P2ct77rlH/Y9yYVz5Hv5Lz53bxt38zest7kHcYz9LxeNaYDVWRuTRlShjg682RTuMGTJQdRETkvjNmsfziSAbSJwSaFx7I2+RulqPBPn1TR3jBhtQxOjg1Pjg9R8TCB6zJitVy/1+5vVmDiM0/XhOhDmuRogpg5/fZwn5OdTVg6EJKu+SM3L5N4jCcb8RCEwdB81yXc6ut00Jtn3zpGBgNNXgFC0TPEEZroty8ctGNWwaUDIYcpDHsnx76X9/YLuhTMW+G5EVEXCOt628WGY4HePO5GvJs7w31eBEIioZiq9GpnyxPXsj0WCEWYEy5t7dXTQAXVoMIJP08HYT0B4TLNoKO3jw3ywfu2kX6vAyH0xYA24fUTGovN5gqRCosBQudhJXB4EzcN9HyBkQQwLvomqfeAkKc73gNvxJATQch4Ewh9Sfe9KqakBRV2s9jWYnHQZBFAiEnUUHpe4N8+fxCawmHeQF0xF4Q8BSEF4YKnKxR/oU/6t8O7R6YsLIIIcXkWXBOi7Yv6qODj2t52oE8ONsj9vaFQm4KQgnDxu37l4eZ0sDcyv6ES7TGOhwbjoxN3P4YmRGqW5a08v6k0F6jigr2EuoKCkIJwaQpK1+hTv3tge+/kmIOHOOQeXRU+BghZ1g4fVHffAbrEUO9h8qUgpCBcIs8Qtd5H5daVI8+QYx99nz06CFFMxsbz6aU5QB0bYlJSENIbBeH93RU/OLijzzKGx24vtCbkcajnavdtYEgKxVMlKAjpjYJwHh6avZEFdRWPtdM+BoS4OFzMptoEXn42B82aF0tkKAjpjYJwLv/FF/Wp/3QAK0M0lIXHQ52Epwahs5qh9h4Oinobny8FIQXhkipDkxJkRObfRGFSO6ad+Fi27o83RwWHiMLt5QVAFfMKo/AuNlEKQgrCpRNGuiFL+TlD6r8W7B6etmCGUp5/WhDyTi7Dod4v4GIir7s6FIQUhMtQQKOOOdFS7XAQEPJPZ47yPGtHgz61V06CjCjv8gYpCCkIl4uuG2gTXz+unsRDDZ8WhBxWpb0To9/OfXM9I9nglYMEKAgpCJe8tQLhMP5q120MIu7pNCGm3D9cXwkyo8K9c8gZBSEF4dKHZ0KgRaqJe+vcfpYw8z4xCHFywjFqnfrN4T1/pk4MFofOU3OU3igIP3bXIVljlLYO3vvYXfcwEJKUf0VHE9DGhZgVXns5KAgpCJeFqxvlKphrZ54KhBCF0K/cfG4/VKyhXjtpkIKQgnB5Evcm+bP6lJ8cendoaoLYlY8NQtL8emek/yv7lP7oosipJqQ3CsLHyhmG4Wbf0rY6EVDCI4NQQLlBgXBYHKyvAJmREUbFSyYZBSG9URA+HvOFGYIwTn52n43nIKDQhF/hETUhSdDzjjH79H8czXhGl7xhhkiGgpDeKAgfQwKM0q8YZa3DYnjmUUHIC9AVRDu1ursV6BNDjQo/RubPyHwpCOmNgvCxwjOMJAIqQ3V0Xm053nvcvFMrwLyXg+VQfnDv5SKQGRVmVnovAikIKQiXkXtGrJ7RJP32WMaEzSrgropH1ISIVW3QMv7PB3Z8UZ+ywST38owNBSEF4bJWzxgRAXxd312Hky3/40FIqmwutjcCTUyYSeHtl4CCkIJw+Tt91VH6a6cftP3mDcwgFO64gBqXvLFim4KQgtCjSrqDTYpndMm/yN89Om1xzMcLDO67FiibgSju97+9Rp8a6OW2KAUhBaEnlLAhlm5dfHV367w7EMynBR0V7Q1AE+u9VTIUhBSEHjc3JiPqQSVs82lCh2NP5VGQGRPmnW0TFIQUhJ5Xwqb4c03Sb47unbBaHfeVsIH7L8Sw1fKT/He/qE/xN8ooCOmNgvDp69eQRcrIgSHlZn/n/ZsQuOtA8rvq3jagR7yGPivlKswBIXJ7iQiOmcfuPwpuws++592ev1+Ehz455z0RM+WTj3d98u0uOh64LINMeeYfWYTZj+dcH2H2l73/V8ID3lAQOTXb0Gg0+crThL6MBA+NicqvRWyIHIerQvl5QCiQJEbW9VKgjoowKr2xe/CBINQm1PUgELI86bL0AHHehKWd1ia4nbmP8VEX+WqQxNidFQtCNDQGqONTThqtCIG40XcOCAWSRhQcFrvtjeNqoEmAG9erC2Xu04SJTX1dHmuKLfU/6KlGaefY0Ir0CXGPr9yHSQvZt/nu6KArAjpXE7KoTsZxe7jPxyQPMEhJ28TKAGEQLlk43VzdOTJwe7Cndai3dbAX3ZMHrsfuP855gfuP9z8/7+M5zwzNfZM76EFP+3CfjWOX2PuCB3HX6ODMpZj3anzsF7z/4gzNvkrzfeu5F2fm+Z67I30V7Y0bzIhTc4WBcIaSFHU21TsQJSk/F4S8c/5uSUsNyHSNoV8533+9UbqWkaw1pK7B8rzzwTLKeibtE7rk7+RuG5gcczy06XOh1SCaKfLGCR1QxfoZJWs84FIQWadPXcdIVtLGm9trj0G4+9IxZIoie1S4D4QcorN4r6JwxSQnXF+erKv/Ygjz5H8bbJTBbffdvO0DlqUFocDbeC7uhB6oE0JNirlfh1nEr/ywN2FkgYYVqADdBRVz65P/7+EPR23TDmdYzg2EeLDoiNXyy8I98HVB3l8os3Q4fFIJNMqgZv4OBOHk+NJqQghCPq5IDzSJYXNAuKzih9gb5CsYhP64vRAwqU2DPQ63ye0iCMkk+lsD3fAVQYxsZR1I0jnlCx4iG0zy5/QYhJbxpTdHkSbUJASjdm2ZR4nfipYwTM59qvm6e0fFjCaE96ebrwMVdAgVfiv9WnjIOLsv6tOWQxPOAiFdiKWsX0N8pJkxey4ewXOWOBKodqYoeAE+8cHFQgjCELowSwzCpdaEjjmakK7FkoEw0KwE2qTfH80ctU05BDFFDFxZownW9voJDdDGb6QLQ0FIZbEoZ9D9i1nK9pE+l1sIXI/aRwZeykp/2SDxpxeLgpDKoinDUKMCaOMq2hpcRaQzIKzqanGS/NKLRUFIZbFAiFL2e6OyqkuxG+gEITFM8+rKEa0TXRUKQiqLmS3DRaSxitIcVDQj+oSojB3hceeFfByVUfqt0JIFCkIKQk9ImAWa5J/XJ//40K7hKQtJTABSxT9us/7u6N5PapM2mBT+DAUhBSGVxQIhuuCM5AWTvG2kDy4Gy/OAZAx7xoc37tvsY0jzXwUJUwpCCsLltUhDEP9azIX2BlLJDUh85hoi206CitKf2qIUhFQWudE+AlVyRx6qr5gFwuNNVSAzOsycfn+dFxUKQioLC0LS07SrvJA0TgDS0cxcKwEZb0SY0n2pQ0hBSGWxu8zRRPvEN05oLaxNEATgEHirwMvO5gJ1XAhuaqbXaFWBkC7E0gv0+57Xp/50/47B6QkxTzhqm/rVkT2f1iVvpEuyyG0cvjN9VWju6jKBEBVwxxahfsJgcejdHKFLtgRsF9INJtntwV4RhIOTYz/IeWudPm2DSU4v0JL1N0IQPi/2Ey5DU28M6idMwHXCUiI+WGY3tlNALpaEIos07kpniwjC5oGeZ5m0QKOMVo0uLNL8nPvb1be6AVuh0BqBKijcnO7PSH8IbZIl1IQCLpWCIEwoMjyjS/561uYwkzLMpIB7AgIy0KSAHw+JuBlmvgJd0IXdG2hKTGZUScsNEYQVnU1AGx9GbdHHrwP0JblXp48XiEQBARaCdrYyHCLNpAhDz6BtDTf0WkPas7qUT+iSoV8OtAkgI/Ilk6KfaMIl4lxDHArTHPergj1g929BZizYGwVUsUAdBxXjM7qkZ3XJa/QpPgZJAINclxD0FZSvou+ihF8qWMQqAqr/7CZpuh8eC4SYGD8y63qpCMLi5mrcy6ukl/L+K+AjqgIRcgRsQQhmijAz3JrpERBvRgW0I9Yzks/qU57RJAJ1PNrWGVEgMxKoo4A2FuiTPsekBpuUr+1764cHdvxrwe4/HFOlnDK+WZqnvVI8bp1aShpC1EzK8adabmRVl5qunv7o4pG3zx2QnDb/6YT2l4f3/Ojgzu/kvg1Rt84oBYZkoImFBzZQRaL7zBj01XSJf2lIWcOkBRiloRiiERiiYRiiEJ8BOAr/UCdTSkGIunvVse+cO8TxAgJh3o0yuF1WGMPaUyg3mTNwIgs0ykONCmSwmZXEbAtkpGv0qUCXhLYjUiNvoN2piwdM2lezN//vg7v+4+jexFPMjrJ8/dWSA3UVRU1Xz7XWXe5sqe/v7Bgd6JscHZyaGLVaxu3WKdbOYq4fXlhmHlC7IExxrMVmG7VODU5P9lvGuseGmoZ6qrtbz7c3wDO6oL4SInb3hUJJSdYfj2X+n0PvfSPnzf8OUapLgMc3yHgD3WvioHr/W10KtLFDjXICyzCsP6F14CeGG0T7lm4zlKXQxCeeQlzAAG6ADy4egRcxbBVrQl9nzIoYYBhyCG/QekR2I9QG6mi0z7Rx/9Uo/cH+d/7fkQxZSfYHlcf215WX3q650tlc39fROTY0Yp2asNmmOTv7UEJfxPouEBZ8AdfuLgPw3CnAZ5jAhRlu9nmw6nBM86zFbhuZnuqZGGkc7K7qailrrSu8Wam6XJxemhd5QvvTQ+++ZEZJMJAZjZUnBGcCmrHHyMKwGwyvbRBil1rtIcCNOFX4H0c+mmBtwMbzkrM5QIWThKtM4xHbEn7xCLOSkHr8lS4FGgkIb6oYoE/+xr43//OY6s1zBzRVJ082V1d3327q7743OTbJ2qwcyz8gAUCmK0CTj+Wc+5sT71jnfufxY44MMeeF5QChMINDxELPc6ozKREAACAASURBVCx5KLAzn3Pm43Oc+LlxbOe+d8O5RwtnH5ieaB26V9PbXtpWZ75eurMsP7ZY/w8H3/kzJg2oY4AKw1KXCH1O6CeHY/siCLuXcxzLFb8VEc2XIfX7B7b3TY6BKc4OnQEIyhWbt4X+CSN1rjE0MqWBOFgC7aUgRva32hR4ACH/TRMPj/Cf5b+/pTTXdO1MaWtd80B378TIpN3GP8CzEpzbd2anOkcrsE7BrxBYF/LI0B1hdiiUF5aSmN41+WceZPKur+X6Um7fyPkbzg2frPNHx7zodDjgadVnGWsbunelozm3pgzC8j+PZIRlbQbaJHTYqWM+rU32Z1CrK5SN0Go1ycli+Yu+5YoFoQ8jCc5OvzsyAMZt078o2P0pXdJKzdT74nEcG3XQUVGEZ6UHG+XPQnWHjKVI6Mj9+OCu9NLcrJqyivaGu8N9wxaL/T7r0Gk5Yl4egQwXwk9ivYE4sjiXlhMeMnoNlaqw/BTLWljbhN06PD0JXa+24T4ryy7hOAoBflQ7x9f23b3affvmvbvNgz13RweheocOITQ1oXNo44m+e1BYB2l4KHb0lbk5xiy5Qhi2Arke9+vMMZu1a3zoWvedQ/WVuy4U/Lrgg+dNcmTwZ0b/uSYp0IBKKxErMQQkZt9ckVoR+T6M7C+Z1Ma+TjAwNf69vO3P6VNXXqbe1zmpOBx3KkNdh7wUfRJUd++U5Z9orLrV1zU8bYGesZsqcPAYUXYRYWg/Ca4MG4Ei+dV8YIOvmeI5CLCRqYne8eHGgS7oNZW21h6/dXXfjfMfXjrx1oVDyadNrx9X/6pgz/8+sCt83+b/eeCdviVMUQhY8cKD4HdHM0Dmn55jJGuNshBz+nfy3v6X/Pf/cCwTWo/pZ3Pfryg0XS05Un/pVPP1i+2NtX0dd0cHBqYgUC0W1j7XfBZmkh9EcYqAdP6Sx78iNq0w2weGxw8Ef+vgvbO3azKvFP/u6EdfMUlRMFYdBx3ycJMixKzcgHXjCszXo2FhcdU9d0DH6GBY9iZfVEQjX0n+HvQ0IPag8YmszczIF7MUCSeZ/fUVtffujk5bWLeNADeF3WlZQaOLE+6fXYZH6d13okNLdWBqon10AF7HU83VeXUX9l46ITu773fHMn58cMc3szevhY6QLhH5QpnOED/KyMVD4/8TuqQvGtI+p095LXfboGUp84To+0Jdl1jMwI+BonGMZB2TBk/hv9Ano6ivBudXkKUQDTIiSTgKGFLDzMp/zH37lwUfJBUb3r1wOOt66fGGKxfv3moZ7O1HWtTCznMqubmdhN8PXWVkn3Nu/qg7lidtttbBvqKmq5tL876V8yZWjzHrEBqVxF1aSTnJMMRzEV3RcQs0DfY8b5QGrIhyGZLQgwYn/Hqf1SXDDfQVkzztlPH4raq2oT6L2zAq53Q+cngjAnISqOBmHJ5ZkIA7Z2h6sn2kr6an7URTleFayfayQ68fU/3PvG1fhqaUPhFH6v+ENo0mDm7l5w2p0OIPYGShJnmEWQkFBSFw+MeV795oVqzRS7675LWjPCH/xbWjhAafVMkEovynPJikQE3oA0fgND0KFDsrDTBQE1B8Ze8b6F4b9xdM2iu5W391eI/yzL69l4sO1V+83Nl8e7Cnd3LU3cQgVoaA4IdI+Dk3v1NwhojcjQsI6d6x4bN3aneUHfpa3ls4BZIQbIIrqwwwoOTtCgBhOGbjPt1yHdTea4ebJpiRrwAEBhlRqBPFx9Wx/3p4d05NWcvQPddWcKk1d50jns4EdfzMkTzNc70TI3V9d0uab+iqTkEL7ReFe/yyNyHNpsL+JIryJa0xpEJli9Niigi8X+EHCMIbeoPbuTYv2buHMHD7zpMmnSkG8p0pOEY1d/CruSXoFQSf642Sz0IVSvQnQmb8F0zSHx7YmVps3FN5LL/h0rXu1vaR/gmb1R2UEIgsi3xL9y8uOESDHxqu5Gn4+57xkaLma38q0gI9xH8sPNowE9KKAKEquuBmJbjadRsYEry6Zo3MdUB1QJpEqIjgGV/WdnNo2iK4YY/lOZcrIzizZO5GJsThyLSlsa+rFDonl07EFxu+v387dCCxRRQFUf1pXbKvXhJsgP+QmIneiCstA4xyf2cM9rFi697byuTL4IT7zAgnpEiDsbbHdiO6IF/UpwJVPAo74zx+SHb6749mbC8vON5QdaP7zr2JEStnn11Lx7vcbzyojywc57JyLXYb/ENogKAigcwYaGJsFFtAvHXTYk0Ya7pxDly62wS0sV44f8JVSgbPRYWPQQI1+x+Pq6GFPUlWF+GMwxamwDpNTWJrukKRcNkHpidq7rUX1lduKd3/8/x3/5JJxVVacN/EP2dIC8SnPinICsKQw5dPQjai/+yU4+pp6nWrmHV/IHU9T0zcjbiGNhzXG0HjHB2RqhgcG0v8Qe62pJNM9vVzFzubuseHZ8XGhBl3kXM+RsMzMRrhfzf7u7ac2w+0CZ/WJ4eZ09FEUQYdgj5udbxe00ihiv3oSjGoaG+A2zfCy8plxJP4ZT2m69AmhGelH2u8MmKfJtCyQ9/fDWl2nrez4ioiwn+btWWo93jT1bfOH/zhwR3AkELcmy/pkgPx+YSLrRSBzhrlRUofr4bOevfq9o0meYiZVJkq1kI9qUlA9W7q2FdytiSWGHPqyqFnNDg14dKNUAmybqFUASdX4H/wsU3goef58yO7IarD8VeACHzZ4F0glIbgKfa7LhaCc7drgTrKu0CISeOkEIGItUoVE1uku42Z/eEpynKc69TEDsaMBzhhs9X3dWRVl75+QvNlkwwHAGO+qE+Bfk6EUfmKUblBjL8tUXHjKqS3mBkUiX3LCJyBWKdPwyFZMXu0t/JYZUdTnxsaXYtIMkM8TsvCH4csk7sq0AijYIPsJZPXRU1FEG4rLwAlzTcgCF8xepk5Co89/B1i00tzh7ECtKP0MSe69W5pYhvPtQz05tWU/d/jGagtAFVpJAQgsh0UV8A5KEIFiTwcyjGzZFvQh5ykBqk/jmORJAS0MFFGRx3744M7VZeLa7rbJu02t2JXjqQ6oLAs5+CgShT21ZQBdVwwDvN6FwhRDbcqfktpHjh2qwpkRnpXYIb4gXAPpZ7OGseLRMqgsQvosItVVI5xq7W8rUFydt9fQ4dEFQl0iaQ7jiwYwZ7/TFHbUhszq5zoyd2ZdCdfCcOtYZ/Xp6CQmC7hD0cyjjZc6Z0YJR/dji0dnLkVayng08YbpdAg8roOBMyHn6AszQWHGy6TZkLv4sl51pD6vf3be+DaCA5XpRg8KO24rHrUOl3cdO13hz9CkQB1XJBRFmFO97RsL2Vbewg4iW5ER60uCToOr+VsM18v7ZwYQauMEhvcjHoUhCmWk5zJdjYhSL0JhJoEeWkOKKivhEdOhPeAEFEDoHGn0UebqkhqweU7cDjFXtN95/eoJiv6U7qkcJwcd5JNULY1b6I8JF2dQdh4WWtIhQv6rZy3ipqrrUgXCi5Xn8U1GPX9XYBJC/Seqi+xpVAdLy0xg8M3L0EQepEmhHt3PSP5Zu5bPaNDcC04bJngBiIBun850EPQJQBtYgQOx/kxM9aOp+GQgvBRojgEioG48GitLhVkvLHpXN4IGaXCi5Vw0Fec5rjkk0agicdnrncow43EpTplBIXQHM3wJm4L8tFji/RWjnXVnhGLtLDxCsj4Uxiqm1H6eqT2oyB8ggCGi84HQvHr5k1g7+vbL+QTfSi2VmHr1Fx9FqijvIggYiPWhLKSLHD05hWo6MPN6d4CQhySiVOe2WfDhcAcds0hBK0CH3NCCzSJEVmbfLyhD42C8AlMuCDUeSj/glHWPT5MksACrjqEj/NvViKWFnGUgxdER4OMMghC5blccKLpGppC4T2aEFOIJ8QV6adnNKEYDj11uwZkRr2sl0SY0/2pJlxBIPR1Lj108sGHf3y38qiNY+1iBZRAYgG6q6dRiNHsNY7VRrNCBOFpuHFVkV7kE/ob5b4Gydf3bekcHSKhUYEwRAiC3SEUNV1bb5IDVUyQEVfcG+WiX8HQwIw3gRBnj5DABwHY/HnFiLJqQBefcbUYJQ95B0dah/EhbLHbEKe4NsFbCkpxmk0JQbil7AAoa60Dmijvio5G4OhofuMlFBzjZoqwOawPW4f7tl8oALgKlIRSg5yMCRSEXgJClLN9CTdYwbUONMgQLao2NqpYf627lcezpV2Xi8MboKa3Ha54kFdFR3HtaNyO8gJcO4ryhN6UrIdr8zwj+XbOW3dHBkmUbKY9F5XfO+y8UN/Xuafy2Kv7NqF6KHXCBlwUGiKm6T3CUp07i0JY/lYmD+jGRmXxGzHhXbBR9ueIhybqrxmJtCT7YvstC2snSSneLS/FoznTtviTBmdo1KsKTlSxcJeCyq5moPGyLgqXKo8u1o/ap8RoNQYhi2NlZJHgUx1jg0caryQU6T9plAAN6o3wYySuxgi3NgipKxC3ZFRfiG9Ln/qaaxbF/dw29z3mFwSCwkxT75KDUPqgCm9SK4P0nlGGGRNRKemvj3xoulF6a6jHRhaUsNpg/hHx8MU+iOpyMXRAQo1exoKB6y5jNFUnwdXuO0CfGOpttaM+jCQMVW/HppZk9U9NwO0p8gsK7g3b4qadsttv9XcfrC1POWkMQboxmrTkBonqURko9iiJJWyoR86w6KoSzccypH1z/7Y+yxhqGhA5B8VIA4f5lFxcg042N5FR6kFin02FxhMSKs5Jryh2s3NWlo0t0kEPKngpA/rMDPGPv/MKhOIK3jBG/leaZNwWHPU3JtmfjqmYa2du9N4Zs0678UsRZjeBXB+WZVGTIceieIwmPhStoJf1FmJ6i5icunJQ19cBmJRAo9zr6C3E0hlV3C8Of3CrvwuXrWG2T4F39e/ivcs5nOxhUxzbMTpYertm98Ujvy7Yg/xGDQakOgGieiPpGTcidlo/JywXb49CCxmC8LXcbb2YY4ZfQiZ8u+DAmjB+Ceq8XNeQ+HiI886cDrEXwEif0SUj3h1EYZ7w00O7tp4/cPxW1a2BnnHWxrtTFDubfTkX4SL2A+9Njm0tzYP7eKNZ4c94H7E3AqEq+sitKtA63OdvRiHEDd4FQrHwGjVDAG3SC0ZpXl35wLSF7GaWdeOwEEQqJ/Sk05/nUX3pVNNgz8nm6x9cPPLH4yo/czqih4EOpCb2GW2Sr0GCem3M6cST3DjT0StzG03xlN8CFfTAt009bdpeduj9i0cyK4s0VaeM1WdzasoK6i4evXn5ZHP1mZYbpXdqK9oarnQ0Xbl7q7r7dm3vndqeB0jvnevdt6s6m6FUtjeUtd08c6cGvsnxxqqCm5f215abq8/qqk59VHn8O/vffp5J27Aofp1obIvDp8RhMooAg/RvtcmIWzkzEl7kvzHKflnwwdvnD+bXV9bfuzs4OcG60Z9Cq8BJNzzD5Yb4aXBzjIWzn7tT96MD24E2Fhqx0GzBcVS5F2rC6PN36kHnxMjf5Wxda/C24YROOon1uCUEPoZewS8K95TcqZ2w2dxMGN5FU0joZThszLizg8JFnrDb2kb6r95tgtt054X83xzdG5iVjuibRG6LuE/rkhFptBEF6yAywzAxZpDbcCLSce82Dm0OXKVz1ILLHYI/Iv41kfabSBQOJkVj7v0owpCLqPjhGaHG99r4hwl5mesBKmGPmXlzRPqG3hyuuP98Ttoj1JHJ3Ma8SEkffRAekhPspJ8JxSOfP29IRSWEajysQhv3gkn6/+W/t+VsblZ16YU79beH741YLbzbKjipJKEtg8gQnPRPqL+ec/Ih2Dm+urs16ZQRLsrn9Snhbj7tEneiLQwINXFVXS1gcHryRwd3fU6fHOi1lIe+2LQLNys/pU8BmbG/PboXnv1k6B+BIut0t2aN6XMj5HM31TjBMWGd7h0fqe6+c7ypSn2lOLXE/Iv83X+ftRlRzoggiUF9qLrE5w2peGiMPMw5BS0UbUFlsFGBuWewo+IaUcS4Q1TqTnNA1IXIy2YSJWxG0PxAIsFIvXyMuF4chnnTwkwz7ymKWXk/qe5MrSY0MZi505Scmg31GaGOMMxgD794ECN7UZ+G+gA1Cdi2fAOhDhG6y396cFf8SUNG5fHC+sqLdxvvjgyMTlnsHH8/HbiTXn8WFziLedl45+snbdbKzmZpSRaeFYUm+QXiXlDv5UaCljncQohpbcJu/fXRvfCHIC/nHYXrEYymjig/ibhMon50cKfm2un6/s5Ju01koeXFAQzzxiEJ0xAJe7hHIXns/Y9ZpzrHh290t5W21ByoLd9dUZh8kvnV4T3fzN2GeIe0caLKQlorDm6RT+mSnjOk4tIkMfZAVMQrxhnzLBhTDLp42fwfbN3dz4D2WDJvlNJFoOZkOpSLTIfkOHCSqSFyHaMcWpJrdamfJ0hDRnusqFGhfmZSw/dt+XnB7ugi/bayg1k3SqGFf7mjuW24b2h60mK3z43NYi+dtCDNSY26n4wuLhKIw7aRgcL6S7+Hu1SLTIaN2Mr1dqo1f9zL+rxR0jzQA6ZZNhpPTg71/oEw0CD0Qc0vKNiN2L4yowGTFnlCe6C+ommwe9zZo+12Aru1xBDv0VkTTFwSQvYu8py4bRibQ5ji7OM2a/fEcONAZ3XX7XOtdXm15R9dOv7muTyIz98V7vn+ge0boE3LSIAuGSETQTRSnO5EBs5oEAvwZ/UpiKTUkObHSAKgXUcE77Mwp4Tfr8owTu4X8Xmz+yvFN8FcVXLy/mgqMyPxZSRrDKmofVabONskxpMVkUkciyZGMGlfMcm/lbft3wp2JxbpN5fm7r54JLum7HRLzdWOlvq+u3fHBqFhOcWxrPAQ9l9CdyD2xc8zZWA276iF4zqGB4qbqhVnc17MQkNt/1ybGGJWBuOqkhXAOwoti7VM2t/lbO4eGwJwk72JQ0whKwGEuFMeP0B5J5TwleMdFv0XhtT/d0ytu3bqavft/smxWXTRwsyQE45EAkSdSbSjc4CRMENcSoabzTtAAvFbC/yEzdo3OdY+0n+rv6vuXvulu03QQj5UX2G4dmZv5Yl3LxyGWznppPEPx1T/lr/7xwd2fCP3zbDszX4mNJwAEU9Bu1eXiFEajwezYacOPiDuIokoiqzeTiFs2WQgmRqDnHiDmhjRRYRvCN/WkPJfjJIvmWUbstNfzdnyz/vf+fmh935/NCO22AC3+86y/I8qj2uunsqtuVDUdLW8vaGm+05jf9ed4b7eiVGINBs8m4QHDJESCOgEkdhXwOqM9L7zZFAVuY4O11Aq97gLMTpGpiw3+zsP1JWnnjL5QewhxzjOD4fBN5oVYixgRTD/wgPxs7rkn+W/B78ygNdAjXKdK3A+IXEYSLRATAFnIFa11w68ozyzb39NGfT64N6ycHbejZ1acKakSFKK5R+06Ryu0QszBNKC8CijXQjxKdzQ49ZpuLMHpsa7x4a7Roc6RgbujPS1DPbCfV/X036ls6Wis6mivQGq2dPN1dDMO3Gr6mjDlWONV440XC6orzhUV+4S+GNhw2X4q+MNSIqbr5+6faP0dm1ZWwN8kytdLRBON+91NA/23Bnqg+5Z5+gQPIMHLGPQaBy3W61Ij/GPMKMNfz3nNBzRqhQe+LUF8QhDL7dj48Kd6xUPVOMGpiZqe9uP3araXl7ws8O7gSEJkwjHQdOAkCl7fi3+E7fVv35CA00qNKn3cP1FeI6u4HHZJGi5EQ+phN7wGn0asg/RIOuE7+Vug9a4purk+du1Df1dg1OTk9zcWWgz1pJr2okgPDyrh3el4Np/HO8C9oxphp1U3uEJN3FUhKjp5yb9hXmYyx9wKAmu2aeCE59zyn8g6katlpbhexfbG8zXSyUl5p8d2oUsdkT3GvNX2mQ0txBjL2CF7saZmjV1nKIkG9pNCISlqJEiZmXPrPcVe0OlZPQNcbTghViDZvEmEFftOUby44M7404atJeLjzZeudTV0jU2BBXFNMc+aMe5JjfNiKgNsedD1IaoOZxKFkOPEwc7uU+eESNDHKYL4ARx9J8onOA2AtHpX/Ek4yLMjNDgZgYmumpu7p/16TbxBg+7IUM4BJficnpvwgzyBHH6KfniLu+Od7fR7z+YIJhHrVMo1NzTVtxcba4ulZ7J/umh96CTiexkZF3HP6tLCXIjNXf1u/jrpSt4N4bhJgTVpROcw4FAeK27FehRTNlv5YLw/kJhstgBxpmEMjx6n4X+GJnDjtjZkl41p/80//2002Z15YmCuvLytgbo43VPDA9NTU7ZWf4hQzjdxvRyLAq1szNAmDXyiSXDeoUHzdicEzx0CA+uL3W4jyN7yLvx4rgy0Zrknf9zwRLf7DhDYHebE+qyA+63WuETVp6HpjU071uH7l3uaC5suMRUndpamvvLIx/9j31bgD7ZmaKM+5wu2R9RTqJMCSFZnp2EXA07EBd7ZbxxpP6ig4CwbaTf3wwtb6n/6rgED6nzIPF6gkn4eJ1RCncMimqgyEcUis4bUkKyN/3LofcSTzLvlBdorpwsqL9Y3nYTejW3B3u7xoYHp1GcUNRUD5+XS3j6WUyWuoS2pzMNzrlrYOf8MuHBTizSz1aOG7ZauiHShvtu9ndW3W061lhluH72/YtHUkuyfpW/+9WcragYUBfvjBXFflKbtJaRYPY0BebdkgfOzMeWrtr9RsjKzrfViyAcnp74yYEdawxpgatGGT5SJodB7aQ4F69wZc+DGJmvHs0VRMhUuYUidQmfMcm+kfsWxGdskW7T2Zxd5Yc1V0/tr6s43Xyjqv3WjZ7Whv5OuHc7IVCnJibtNhvHQUPXSviklxCGvJOSB/5nd6BCMPgZpu2sxW6DAOudHG0d7W8c7Krpbbva2XK+te5wwyVT9dn3KwqhWksq1v+68MMf7t+OOqeh1aCJc1bhwIsQ+wl98no0EE4a6jQvQ7CF6T+rMlm6arE3OzAjB/qkG73tCITwVLTYbK8fVwNdYrA3j7lZvPo455mNr4wJ9QGSGWzOIWHpIahKRg433zom7Ysko62Omxm1iRJuMdDg/zMmJTBL8a3ct358YOevCz5845g6skj35vmDw7jkdem6CXHoBWqw3RWF75YfTi/NhVr9jROa3xV+9L8OvfudvG0hWemfYSSoak8TI9qQyD6PReNWNfGf0ic/jwfCBTtd6zCxNQw1T88eCOeqcVu6BjFvSRL6MJL/kbW5ZwIx5QDSe7ez4jDcKGHew1TlUbR8c2q7NopzNt2T7BCx6Ffw0sMd/HmoQ7RJZIjvBnN6/+SSTupFTb0c95vDH4IPfo9wBdGFEpIJ8PN8Vpf8nCF1vVGyAR/V7l+BZAuCsQvnqpj1Xd1W5dPwrD2rT/lF/u5x6xRPQAgXBtF1ZkZGmJUzRz6VBW5mFWudXTNx4baGmPz+gR2DliUfEspxicWGT+hTvmbeRKAV7JptigE2p7bbl+qxBd0MZIhD4injFGeHzgEgBMalrXVAHUs0IT3YlmYlUGe9gXTWL8e4bERvEQ+PZB83jl0/qtaWhNYk3JwOMqJ010oE1CTJAeKjtwz2fMKQFkBt9yXnmHltucZl46be0JkoAMXekkUZUMcP9LSLmq45cO8rIK5Iv2X8W/vfXsuk+VMQrny2NcFLyX9XRhDhZQPqrQGGpOqeO5gtTgA4myVMcWxSscEZIKUXi1IeUlnEJqZ1hrTwnC29ZMgU9AlJCYSDlHFnRHnXjDQKQgpCr8t4BaJ5b4m/P5oxwdpEEJLiDXhf1FxNCEj96ZWiIKSyqFWj6phdFYW8sykFECzC+8b+TmBApbQUhBSEVBYvKo4L1iLzGy+79B8QnAxkfZaxHxzY8SVtygZ6pSgIqSxewRojJ9QyLv0HXFW9LM/LTpmBKi4YzbWhAWsKQiqLEpVZy0i+lbutB0dlBJc56kJkdnUpUEeH0QpSCkIqi9hQH5eMamU4V73wLBBe62gBOkQmRy8WBSGVRXMIo5hrJYSMcxYIyc+d48Pf2rd1ndcRAVMQUhB6iSDCX11cVWcL6SmbBULcY4pGNcTjSYshVBlSEFJZjA4mg+TVfZs7x4bmASHvnLZprj4LVFHhtKeJgpDKAmcIMbmTNj6xmLFCh9CN8ha46gnJxNOrXS1AE081IQUhlQVP0+MhYtG5188Tnn/XegM32jvE3zMwOf6Dg++8oEulbiEFIZUFRKAfGjqCMoQ1PShDaGNnWF6B20wcRPhj53hlaS5QxYXS5aEgpLJQIEQlo/K/1SX/+ODOwakJQgbpmANCaInyrEDI4YtuXQWaqAixwZdeQQpCKk/rDfob5a8wCqCJeedCPiGP5NyW290cFchk8NaRvr/BtEUBDO0tpCCksiAglJG67TOttaLr50aICdxZDzj8K9ecJrpCFIRUFsohXM9IQvZt7hx3JieE+TShKzwD7/Nqy0AmskjpFaQgpPL0mjAUFcrESUrM2Nicu9Dzg7Cxv+svDCm0p4mCkMqCgBBPnogsbLzigtjDQEhGgEzabH86JtIB04tIQUjlKRcaRUfNiraRvnkJZsF8c7IQUvddP+ecl0ZLZygIqTxNoYwSqOJSSsxWjnXMN6BkXhCi3dA40IUa7Y00ZU9BSOWpQIgLZaKKblXNa4s+AIR4BtY0a4tC1JQJ1CKlIKTy5KtslPkYpcHZm7tHhwRnz+DHgxB6hRwei3n4ZiXIjAo3pdN1oiCk8ritg2QYTohZCTSxb587gKfgzT/teH5NaMfF3O0j/S/t2+SH8/30slIQUnksEPrgB68YFUAde/ZOHUIWx8+7ymDeWQVkDrOd5zef3w/fIpRapBSEVB5T/BmZn0n+JV3Kjw7uRIO3BDTVfN7RW8DxgHHsxIM8194ANHEhlIyUgpDK40sY7l3SVZ1CMyfwUOR513heECJlSAaTD0xP/K9D7/43QwrtbKIgpPK4gtgNDSl1fZ2uVsFHBqErQIOnnyZjqQAAFS9JREFUpmXhXntcwkYThhSEVB5VQpE3GB9/iplC6cGHLe7Hg7B16N5aoySAkVGLlIKQyqMLSg+qo0/drnlQevBRQOjAjiFn5/mtpbkgMyaEjhClIKTyaBJokj+rT/nJwV1DuIXXLTMhPB4IiTcJ7690tQBtXLgThHTZKAipPLx3iVTJ5F4/hyYQPlQNfjwIcYehMM7Z/t8JDVyzDSI5N1WGFIRUHohA5Lgx0g1mRetwH7zchELtyUEo4OQG4rxougZUMYQhnzqHFIRUHghCRhJmhmow5r3yw3YMH44XngqEWBGi7TEwPfGT/Pee1SYH0mWjIKTyUNlokgMmtb6vQ7RFhacDoXtz04G6CrD3jQiTkmpCCkIq88rLBmmIOR1kxmwqzWX5R13QRwIhie30TY59J/fN5/SpgbSUlIKQyoMS9IhcNL66q9V95MsCgNDVZGi+Xgoyo2mnLwUhlQcgUAmvaspps5VlXeN3Fw6EAu/gHd3jw9/IefNFPR7bxEiR0EtPQUjFGRdFQ5c0sRWdTY+SmXhsEEIUsiypYisVq9gYqS8FIQUhFTEoKg3G816Sipkp1o4aJhbWJ8RuoYOQ5/dMDH89Z+uLhjQanqEgpOLqHhTr1DRxl7qanaMmFhyEJF2B045ZNeehZxhGPUMKQiqiIYrHnmli006bpzmWEMQ8MgYf3Rx1C5Pemxz77oF31urpQF8KQiq4f5d0LemTr/e2Ox5AJLNgIHTlDA/fvATUaJYoLWGjIFztwkjxnInYbecOsLgf/nFXBDz+EiJ1ODJl+fcjH3xOlxxElSEF4apXg1CeYyS3BrqeQA0+CQjRP4PDpOfb6iH6oSnsy0hfNtDWCgrCVYY9Bt37GGURUA1mRGVWncRDPrknWJEnASGHC0qtLJd8ykgWEn4UfwO1SykIV1c4FLVKmOTPMWnfzn2ra2KE/7jm3QXVhLyDxWHS2nvtwJAcjCxSuR9DF4aCcHVFROH9q+Z0oIo8cvMyar7FcdGl0oRksDZmj9pbeRxkRIeZlXQtKQhXWzwmEGXnE397NGPUNo1ZQnn+idYQPNkqusKkvRMj38l7G2pkOrWCgnC1+YSoSE0Xd7W71UWm9mQ38DTLSdzQU83XgSqGVnVTEK4qWzQMGqIZMe9fLET9to+Vm19YEKIADc9bOXvKKRNQIY5gikMKwlWyduuYtK/mvdk1MUJ6359mRcBTrijLo9ExjYM9/wWZyChCQxeVgnAlB0UZNGSC0Bkeb75GuiWecuWezhzFfYY2/CGya8+jMfdG5UwAlwoF4YqzQvHsawVQxUpKslCZKLyxyw1CEimFCztqt/7xhApoE0NoLRsF4Uquj5H7G6Trs5SISQ1fSYfwtAv3lD4htIZR2pDjUISmtq8DmFJD9FI/GimlIFyhTYMReMbLkVtX4JWc5uwoKiIIy6kJ0cZBDfcCJutG+fuc2jJS2O1jlPrjll+6xhSE3m+FyvHQTzzxMzNWcnbfNMchenoe7X7e4VhWEM4yTVGy0mK3xRWj1Q01KiAOX6a1bI8CwskxxyymdApCj+OtgCCE67Wekby6b0vbyMCTFWovOgjhh7LbkVF6e6B3fZbCl5EEMlQNPg4Il0QT4ulcAgXhY5eJokJtBciMLmlFA15sHL+Ay7VwmhAP92XxsPvi5mqQERlO5/s+Aghfy3tbBCFx8Rdf4D9k47m4Ij1QUxA+EgjRbAnMJrrzYiGKRHK8nfdIELrS9xCOrEN4+0IBUMdE0DKaB0ugSf6cPvW1/W/3T40Te14QNdUiCu80R+MhCDXxwWYayv54EIaYFM9ok/6lYPfA9KToOCyo1QIW3N4h3mr/1MTP8t9/RpccTMtoHuJsGKQhWembz+1/7+KRXRWFSyY7zud/L3fbGj1l63qknESQQQYMKYTW/smalZYYhKSMBn3Q+nt3v8hI/HHPFV3L+crwURHweqMUqOOAKhoaDkskmdHQslpjSHOGHOhaPEzCUUQ06sjNSuIKLkb8bFFAiJInOHN4rLEKqIhRSgf9zteQxkghDqFNGG4SJQyJYlEF/ishZjJQhCLwYavjg1xBJciI3n4h345ScBxOw3kJCAk5Igf9V4fwYeVReJB8zZTuQ5eWileBMMSk/KQ28d8KPxycmnCgihSeX5w00uJoQnHSNnIOx6zTr59QA20CbvylRy8V70AgGgGoS9uQnU4Gfdqepml3mcxRMteQt0OjVHB0jAz+fd625/QpG3GQhkKRiocjENrqoYwM6BIutjfC/WzloBYUqSS8BoSEF1HAzqGdRZnDq92twJAUZMD8cHSCBRXP9dLRg1eMqEB0f32FgFoUOJKTWBR3cBFB6IZGVM6G9eGJxiqgiQ0zKfwpJRQVj+1UYqSvmpQgM/q9i0dwnxKEIL/YtUxgkTHo4J03+ANTfRbsjYygziEVj5SXDbhJIjMmsZgZtU6zHM/aOW4REoNLqwlxeQGpN+cFVC311oV8eMx8zZzuSxssqHhWt640zKwE6oR/L/igDxcSQvixKNfm5ZrQ/YbUOi/AAyb+tBGo4sLNSh+cKKNQpLLMfqAJTxc0K5/VJr92YHvb2OAiVcYsPwh5NGYUJS0GLJO/PvohyIyNwG2HdB9QWWYQGmXBRsVaQ+qXTfKb/WiehN1mX8BOJY8CITRHeRQsFRydY0M/ObgTaBNfMVL/kMpypwQZ6A1KAJN6qbMFFV1ynH0hSCs8EYQC8Q4dAovZStuG+76T9/YzmqQwkwL1/qK8BUUjlSVt1fXFDWVBRhnUB+faGoiqEBkr+JUIwln+Ia4sbRzq/Wr25i9pk0NMyvVGCkIqS5yRlwYxEIFyoIk7hVt1eY5bMpKR5QchPGnsrMgN9WKW8gVNCmpso0l8KkslPkZpoFG+0YQQeKzpKlIMdm4pgzHLDUIBBX9RGtSOimlu3Gv/slnxZR3CoS8mV6XxUiqLnY2AVmgoRKAq+mjDFewH8nZ2seqzPRSEhNVIwD1P8Imae+1+WcpndSkhWB/60xQilcUEYRAjI1bokcYrgrPWWXA4HMuDwWUyR2fsUodYXFrTdzcoZ8sXNMkh5nTkH9LSNioLb4KiFkqIwABGBjTxJ5oQib2d5YVlUoCeA0KUxLfb7PDxzcGur+e8+Rl1Yjjl8KayOOHQjSaFv0ECdInFzddRcTbL2ll+uTG43CDEvFAC7tXCdInD9/7x4A6gjg8X60ulL5no7qHyVOLv9ANDTIp1ulTApF7A2QjOrap5VYPQ/Ubyh13jw78q/BCoYiNwfSndQ1QWQAcyiDz7c7rkF7OUVztwRl7gPWfnexAIUV0bjpfemxx7o0gHMqIIYyKFIpWnzEZEGJVAm/Ba3raa/k6EQDu77H6gp4JQEFiOt7EoVDxondpauh8zCCs3mOS0tI3Kk4r0a2iWYOyvjuxpHx2ElqfdztlJny4F4YOUIcrjQ7uUd1g4TlVVDNRRwYx8I21BpPKY2CO5rgjUnRQdf8owODmO/UCOxCAEBwXhx9a18aiPy8bzBfWVQJ+4Tp8WZqZ8bVQeIxkIDahgowyoonZdLJywWnlBDDp44M0jQYhKagQbJk2E59Xlu7dCsjcBHUpdUH1I5VGcwBCzEh7cQBeXV1tOCJps0ARleU/Sf54NQndSDELm3Tp07+eFe0BmTERWOiURpvJAweXHr5rTgSZ+Y/am8vYGxHLkugkUhE/aAWXFmZwBy8Tmsv0gMyrYIBepE8WCb6obqYi5eH+jPByRxET9+uhHTUO9mC902cqyVw4IcQ8ibkEUHNM8n1t7ARiSntUnu7L5dPNRISdysFkZAJ3AzKhd5YeHLRa4eWx2jmcFjwqEeiUIsT+NbnbnkVbV1fIPB98B6jhoddDsBRVfhswPVH5amwQMKfk3K204+mnjWELmwHm6sef55iiua+MI+ypmIkdVNRMjkjPZICMSnnx4LrfYdUHT+qvL+ES0FKgpKQw6gaqYnx16v7bvLk50oQObjBHEXPAUhAufS0RH2yRr31d3ATBpf64hUVMUE6MgXD1pQAhCePiGmRQ++jRogu4oLyCZQGwuCd61pb0PhGQOKRkLUNPT/m+Fe4A6JtikCDLSKYiri50JUWWr4gKz0081X5/GJpI3ItBLQUiqvQXWjq77iNWScaUYaBI+r02OQD1Q1Chd+RJmUiJ+tMzI1NPm1tF+BD+Wt3Gcl25mbwUhGfHOi+efo7Kz+UeHdkGzJNSEEhh0m65IJxB6HAFGGUpCaOJ9zIr8m5csdjuO3iEXkPfWrey9IJxxEVFG34F7L/ZWHgfaBKBJJDl9GjhdOR4gZh6C8FurS4UKMOV01u2hPrjoduyaePseXgEgFOx4cAeOozqqu1t/X/gRyIj0ZyRh1DpdKTowBE0UV4DM6G/mbC26ddXC2lAakEVzA3leoCBc9igNwh6LOfZJjduodSq7pszHJAOZMXDlglAukUCRKkYvi774MagOG00L1CUBddw7Fwq6xofJ0YsaksjgMoGC0OOS+6Jx0jzQoyzNAbr4Z7RJEab0AEZGmTK8h5BCSiqEof25jpEATfQfjuy90tXCYbzxHtYNSEE4f6UbyenDo7KsveH/HPkAZEStZVLhigYYaYWNN7QCmuQhZkUQIwOq6K/u21xQf3HUZhWTUysLfisWhMRGtXHieEdonR6sr3gldyv0KAKMUugo+lPT1IMl2KQIhe6fKg4waXsuHe8YH0LajxOsdruwEhG4ckFIKr9JDgOvXPf48N6q4ueNUqCK8cd2jp84kIAGUZfb+GQIG5oMeu84/ZAAtAmy0tyG/i7eFQDnl3RCCwXhgnuJgo1HcxHhIjYP33u3ovDzhjSgjg3EOV/aDLXsst4k22hSoOCnJhFo42JOGaD7Z8VWDKndX/FbdOWDEE+7Elhc1YuT/A54xG4rO/QJQypQxQai8l/CJUXxsOTBT2x8hkD4qeOBJuZPRbqLHU1THEv8eRL75ASBgtD7MQg9RE4cO8ehLAaCIlzam/2dEIrQ8QDqGD9GEo58RVp9umixlrnPyKEZEoqHIgFdQlyxvqKtwcLh8hc0m4XFEVDUS7ry9eBqACGZPEP+zxm2EccPwOP2Zn/Xu+WFgWYlUEW9qE8NMykCTQropfgYJa5MMUXRQoBQ6osuKeo8QmFqgxRoYoEhOfW0uaLj1iTWfqhbDc/ndAgOwbGKbsCxKm84fIqT+7hN8e5Iv/5ayTdy3wSZkXBnhGEbiQ6HWkDLE1oZIcjxU76gg15A1FqjfNeFw7U97VM8iz0G5Lev4NALBeH8NiqL46cc6tnniZ7smRgpbLj8m4IPgDoWmkmkVhg6jRRFTyMBOACGLE9tAlBH/VPudt21ktvDfaTcjEMD4hEXKMutzBwgBeFDQqYOQr5FppO7R+HGrVPldxs3nctba5SCzKjP6pJDsQODE/2u6SIUXQ8Jt8hx1Ys82KR4xah43pAK1NFAlxh5XFvUdLV/cozYmgKmLMELgO54HL6mIFxV9qjoIgqzkxkuKMJzuXXwXk5N2b8f/gBo44A6Zh2TBqGIc/1yWon6oFJP6E4HY7MTTSBTxwFVzHf3b8+8VFRzr30SV12Leb/7Go9WKwBXMwgfAk9B7NwnP45aLVfuNu0uL/wW9BjVUdBM9WWk4RiN1FJ1ZRqggQBdvgh4TfD8TaCKXGuUSUqyT7Xc6B0fcV5YMevA001GQfiIyUUxtYiNJHjXOz56prVmc2luePZmeMCDzJg1hlQcwhHR6Lv6sLfBJIZb/KHproEuX/RnjJL4In1+XUXrUB9JuGM+dXQxBY7UvWDTc1VrPgrCR7ZXydAQ3Co1oxhtPN8xNlTUfH1rae63972J4uwZMX+rS8Y2WHqws6nf1yh92SBxGmlezY8qneH2xAKVXiBWeqEmxfNMGlDFgszoL5kV0cX6/JuVLUP33M1Oloz4ETDlGU4+4IpCsZaQ3igIH8tEFa1Uzhk9sAn8vYmRi20NOyoO//TQu0CfCDKhsRqPZtcwSDlsNCtQ9h+3hHtpshEfJQh1UDZi4L3CKOA3Alr8ZfUJ38/dtuVs7vHmq3eG+6ZZzpn+EYjXJ1CkURAujpkqZjV4J60QPNUHpiZqu9tyay8knTb93b6tcHdCpwio45/XpwbjyCo0WeEm3uBNHX0QddDUVELgQfW+DgJPk4iCnJrYwKxNfzym0l09famjuXdyzOa0ORHFASbbta7eXAMF4VIoRJzYICVwuBiO42exy05zbO/E6KWOpqzrpQknmX/MeRvoEpDSgD6kNtGHkRAPKgzvbOhJuhIexNJ7aJ2X6ImRlz3WCADf2W/r/Iek7lOQoXcXBP1bszLcDD+eIsAo/YQuGeVL4Wmijft29pbXj6nVV4rL2urbRwZcBicOI6MUH8eJzh6PyZqpDqQgXOTcxhzXkZSnin7PzG2KY/smx270tB1ruPzehcP/WZgRYU4H2nigikaijn9Wm+zPSIOQqlSEo92PYjwbzXKIhwCsi5yemNOxZAjfkTuQZjDsx0jnMCORZxBJGSPxZUSrkoAtFA9OiUDHgQLqavjPQaWNIivQwVNFAXXMV4yyXx7es+lc7oG68iudLT1jQ+7AE2PI2EZ3rwgUH1AAUhAuL0Lx7sQZR7dBXPBni912Z6T/WvftoltXP6w8lnaS+ZdD730F9e/Eo31PtKUm7pPapDWGND9GAsEZitWmS1CW0qhAgh/D3wZjCcL3oeh59Fv4PHoBVmjoD7FyCxXBJn1Rn/ZZqOLgP5oZDTKi0L02/rNm2Y8OvBNXpN95oSC/7mJVR/Pt4Xtj1mlOmB2mEpxhFoozCkJv8R55PJ2ZdY5GcP+tnecGJyfujPRd72071Vxtvl66u+KIpCTrN0c+/N7+7f5mBWBSkSmrjsEQjcSAicIqNIZU1SEgqd0E/RiHDcgY9DKIrr1RYC/5wxigiweGxPUm2d/nvfXz/Pehqbyz/DBzreToraorXS23B3uh0p7i7O7kLbwgmposYlXieZreoyD0SgdScJC5JLgmi+hH3ulFCvdrURvPj1unB6bGOseHmgZ6rnbdLr1Td/xW1aG68uzqUt2V4r0Xj+4oL9hUmisryU45aYwv0scXG6BAJZZUbJSWZMNfvVOW/0FFoe5ycVb12f21ZYWNl0+11lzqamno7+oYHYJgG7VaoO/Kz/+Zic8rDtTkXXV91MujIFyhKBWcG1ycJPso2TMOd2DZeM7Kc9DtdAnEFXwGwph9lDFEgjveaDphmW//PyJLm4RHDYZ1AAAAAElFTkSuQmCC",Nw="data:image/png;base64,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";function Ru(e){switch(e.toUpperCase()){case"ONEUSD":return Rw;case"PONEUSD":return Sw;case"USDT":return Cw;case"USDC":return Nw;default:return}}import{jsx as q,jsxs as Et}from"react/jsx-runtime";function Su(e){let t=e.trim();return t?t.slice(0,2).toUpperCase():"?"}function Tw({size:e,bg:t,fg:r="#ffffff",children:n}){return Et("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",style:{display:"block",flex:"none",borderRadius:"50%"},children:[q("circle",{cx:"12",cy:"12",r:"12",fill:t}),q("g",{fill:r,stroke:r,children:n})]})}function Gs({size:e,bg:t,fg:r="#ffffff",text:n}){return q(Tw,{size:e,bg:t,fg:r,children:q("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontSize:"10",fontWeight:700,fontFamily:"inherit",stroke:"none",fill:r,children:n})})}function mo({size:e,viewBox:t="0 0 24 24",children:r}){return q("svg",{width:e,height:e,viewBox:t,"aria-hidden":"true",focusable:"false",style:{display:"block",flex:"none",borderRadius:"50%"},children:r})}function Iw({size:e}){let t=Rn();return Et(mo,{size:e,children:[Et("g",{clipPath:`url(#${t})`,children:[q("path",{fill:"#000",d:"M24 0H0v24h24z"}),q("path",{fill:"#8FFCF3",d:"M12 4v5.912l5 2.237z"}),q("path",{fill:"#CABCF8",d:"m12 4-5 8.148 5-2.235z"}),q("path",{fill:"#CBA7F5",d:"M12 15.98V20l5-6.92z"}),q("path",{fill:"#74A0F3",d:"M12 20v-4.02l-5-2.9z"}),q("path",{fill:"#CBA7F5",d:"m12 15.049 5-2.9-5-2.236z"}),q("path",{fill:"#74A0F3",d:"m7 12.149 5 2.9V9.913z"}),q("path",{fill:"#202699",fillRule:"evenodd",clipRule:"evenodd",d:"m12 15.048-5-2.9L12 4l5 8.148zm-4.67-3.136 4.588-7.475v5.435zm-.068.204 4.656-2.068v4.768zm4.816-2.068v4.768l4.653-2.7zm0-.176 4.588 2.04-4.588-7.475z"}),q("path",{fill:"#202699",fillRule:"evenodd",clipRule:"evenodd",d:"m12 15.917-5-2.84L12 20l5-6.924zm-4.44-2.341 4.36 2.48v3.56zm4.519 2.48v3.56l4.36-6.04z"})]}),q("defs",{children:q("clipPath",{id:t,children:q("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function Mw({size:e}){let t=Rn();return Et(mo,{size:e,children:[Et("g",{clipPath:`url(#${t})`,children:[q("path",{fill:"#F0B90B",d:"M24 0H0v24h24z"}),q("path",{fill:"#fff",d:"M7.635 6.449 12 4l4.364 2.449-1.6.907L12 5.809 9.24 7.356zm8.73 3.093-1.6-.906L12 10.182 9.24 8.636l-1.605.906v1.81l2.756 1.546v3.089l1.609.906 1.604-.906v-3.09l2.76-1.546zm0 4.903V12.63l-1.6.907v1.809zm1.141.64-2.76 1.542v1.813l4.365-2.453v-4.898l-1.605.902zm-1.604-7.09 1.6.907v1.81l1.609-.903V7.996l-1.605-.907L15.902 8zm-5.511 9.29v1.808L12 20l1.604-.907V17.29l-1.604.9-1.605-.907zM7.635 14.44l1.6.907v-1.81l-1.6-.906v1.813zm2.756-6.444L12 8.902l1.604-.906L12 7.089 10.395 8zm-3.898.906 1.605-.906-1.6-.907L4.888 8v1.813l1.605.903zm0 3.09-1.604-.903v4.898l4.364 2.453v-1.818L6.498 15.08v-3.093z"})]}),q("defs",{children:q("clipPath",{id:t,children:q("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function Ew({size:e}){let t=Rn();return Et(mo,{size:e,viewBox:"0 0 111 111",children:[Et("g",{clipPath:`url(#${t})`,children:[q("path",{fill:"#fff",d:"M0 0h111v111H0z"}),q("path",{fill:"#0052FF",d:"M54.921 110.034C85.359 110.034 110.034 85.402 110.034 55.017C110.034 24.6319 85.359 0 54.921 0C26.0432 0 2.35281 22.1714 0 50.3923H72.8467V59.6416H0C2.35281 87.8625 26.0432 110.034 54.921 110.034Z"})]}),q("defs",{children:q("clipPath",{id:t,children:q("path",{fill:"#fff",d:"M0 0h111v111H0z"})})})]})}function Aw({size:e}){let t=Rn();return Et(mo,{size:e,children:[Et("g",{clipPath:`url(#${t})`,children:[q("path",{fill:"#213147",d:"M24 0H0v24h24z"}),q("path",{fill:"#fff",d:"m13.203 13.216-.787 2.124a.27.27 0 0 0 0 .183l1.354 3.655 1.565-.89-1.879-5.072c-.042-.117-.21-.117-.253 0m1.577-3.573a.135.135 0 0 0-.253 0l-.787 2.124a.27.27 0 0 0 0 .183l2.217 5.985 1.565-.89z"}),q("path",{fill:"#fff",d:"M11.999 4.991a.24.24 0 0 1 .111.03l5.969 3.393a.22.22 0 0 1 .112.19v6.787a.22.22 0 0 1-.112.19l-5.969 3.395a.2.2 0 0 1-.111.029.24.24 0 0 1-.113-.03l-5.968-3.39a.22.22 0 0 1-.112-.19v-6.79a.22.22 0 0 1 .112-.19l5.969-3.393a.23.23 0 0 1 .111-.03m0-.991c-.213 0-.426.054-.616.163L5.416 7.556a1.21 1.21 0 0 0-.616 1.05v6.787c0 .433.234.834.616 1.05l5.968 3.394a1.25 1.25 0 0 0 1.232 0l5.968-3.394a1.21 1.21 0 0 0 .616-1.05V8.606a1.21 1.21 0 0 0-.616-1.05l-5.97-3.393A1.24 1.24 0 0 0 11.998 4"}),q("path",{fill:"#fff",d:"m8.052 17.943.55-1.482 1.105.905-1.034.93zm3.445-9.823H9.984a.27.27 0 0 0-.254.175l-3.243 8.757 1.565.89L11.623 8.3a.132.132 0 0 0-.127-.179"}),q("path",{fill:"#fff",d:"M14.144 8.12h-1.513a.27.27 0 0 0-.253.175l-3.704 10 1.565.89 4.032-10.886a.133.133 0 0 0-.127-.179"})]}),q("defs",{children:q("clipPath",{id:t,children:q("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]})}function Lw({size:e}){let t=Rn(),r=Rn();return Et(mo,{size:e,children:[Et("g",{clipPath:`url(#${t})`,children:[q("path",{fill:`url(#${r})`,d:"M24 0H0v24h24z"}),q("path",{fill:"#fff",d:"m15.88 14.86 3.794-2.165a.64.64 0 0 0 .326-.558v-4.33a.64.64 0 0 0-.326-.556L15.88 5.086a.66.66 0 0 0-.65 0L11.432 7.25a.64.64 0 0 0-.325.557v7.737l-2.662 1.517-2.661-1.517v-3.036l2.661-1.517 1.755 1.001V9.958l-1.43-.816a.66.66 0 0 0-.65 0l-3.796 2.165a.64.64 0 0 0-.325.557v4.33c0 .229.124.442.325.557l3.796 2.165c.2.114.45.114.65 0l3.796-2.165a.64.64 0 0 0 .325-.557V8.455l.048-.026 2.613-1.49 2.661 1.516v3.036l-2.661 1.517-1.753-.999v2.037l1.427.814a.66.66 0 0 0 .651 0z"})]}),Et("defs",{children:[Et("linearGradient",{id:r,x1:"3.948",x2:"19.217",y1:"16.617",y2:"7.645",gradientUnits:"userSpaceOnUse",children:[q("stop",{stopColor:"#A726C1"}),q("stop",{offset:".88",stopColor:"#803BDF"}),q("stop",{offset:"1",stopColor:"#7B3FE4"})]}),q("clipPath",{id:t,children:q("path",{fill:"#fff",d:"M0 0h24v24H0z"})})]})]})}function Dw({size:e}){let t=Rn(),r=Rn();return Et(mo,{size:e,children:[Et("g",{clipPath:`url(#${t})`,children:[q("path",{fill:`url(#${r})`,d:"M24 0H0v24h24z"}),q("path",{fill:"#fff",d:"M17.7 8.358a.55.55 0 0 1-.365.145H4.515c-.455 0-.684-.52-.37-.825l2.106-2.03a.54.54 0 0 1 .364-.15h12.87c.46 0 .685.524.365.83zm0 10.005c-.1.09-.23.14-.365.14H4.515c-.455 0-.684-.516-.37-.82l2.106-2.036a.53.53 0 0 1 .364-.145h12.87c.46 0 .685.52.365.825zm0-7.72a.55.55 0 0 0-.365-.14H4.515c-.455 0-.684.515-.37.82l2.106 2.035c.1.091.23.143.364.144h12.87c.46 0 .685-.52.365-.824z"})]}),Et("defs",{children:[Et("linearGradient",{id:r,x1:"4.001",x2:"20.408",y1:"50.258",y2:"50.108",gradientUnits:"userSpaceOnUse",children:[q("stop",{stopColor:"#599DB0"}),q("stop",{offset:"1",stopColor:"#47F8C3"})]}),q("clipPath",{id:t,children:q("path",{fill:"#fff",d:"M0 0h24v24H0z"})})]})]})}function go({chainId:e,chainName:t,size:r=20}){switch(e){case 1:return q(Iw,{size:r});case 56:return q(Mw,{size:r});case 8453:return q(Ew,{size:r});case 42161:return q(Aw,{size:r});case 137:return q(Lw,{size:r});case 792703809:return q(Dw,{size:r});case 612055:return q(Gs,{size:r,bg:"#0b1f3a",text:"CR"});default:return q(Gs,{size:r,bg:"#676b7a",text:Su(t??String(e))})}}function Kr({symbol:e,logoUrl:t,size:r=20}){let n=t&&t.trim().length>0?t.trim():Ru(e);return n?q("img",{src:n,alt:"","aria-hidden":"true",width:r,height:r,style:{display:"block",flex:"none",borderRadius:"50%",objectFit:"cover"}}):q(Gs,{size:r,bg:"#676b7a",text:Su(e)})}ie(`.rd-root{--rd-bg: var(--ds-bg-dim, #f7f8fb);--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-text-muted: var(--ds-content-medium, #676b7a);--rd-accent: var(--ds-system-orange-default, #5b5bf6);--rd-accent-contrast: var(--ds-system-orange-on, #ffffff);--rd-success: var(--ds-system-green-default, #1e9e6a);--rd-success-bg: var(--ds-system-green-low, #e6f7f0);--rd-warning: #b8860b;--rd-warning-bg: #fdf3d9;--rd-danger: var(--ds-system-red-default, #d1394a);--rd-danger-bg: var(--ds-system-red-low, #fbe8ea);--rd-radius: 14px;--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06));--rd-on-accent: #ffffff;width:100%;max-width:640px;box-sizing:border-box;margin:0 auto;display:flex;flex-direction:column;gap:1.25rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--rd-bg);color:var(--rd-text);-webkit-font-smoothing:antialiased;color-scheme:light dark}.rd-root[data-theme=dark]{color-scheme:dark;--rd-bg: var(--ds-bg-default, #0f1117);--rd-surface: var(--ds-surface-default, #171923);--rd-surface-alt: var(--ds-surface-medium, #1e212c);--rd-border: var(--ds-border-default, #2a2d3a);--rd-text: var(--ds-content-highest, #eef0f6);--rd-text-muted: var(--ds-content-medium, #9498a8);--rd-accent: var(--ds-system-orange-default, #8181ff);--rd-accent-contrast: var(--ds-system-orange-on, #0f1117);--rd-success: var(--ds-system-green-default, #3fd68f);--rd-success-bg: var(--ds-system-green-low, #123626);--rd-warning: #e0b23c;--rd-warning-bg: #3a2f10;--rd-danger: var(--ds-system-red-default, #ff6b7a);--rd-danger-bg: var(--ds-system-red-low, #3a1418);--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35))}.rd-root[data-theme=light]{color-scheme:light;--rd-bg: var(--ds-bg-dim, #f7f8fb);--rd-surface: var(--ds-surface-default, #ffffff);--rd-surface-alt: var(--ds-surface-medium, #f0f1f6);--rd-border: var(--ds-border-default, #e2e4ec);--rd-text: var(--ds-content-highest, #14161f);--rd-text-muted: var(--ds-content-medium, #676b7a);--rd-accent: var(--ds-system-orange-default, #5b5bf6);--rd-accent-contrast: var(--ds-system-orange-on, #ffffff);--rd-success: var(--ds-system-green-default, #1e9e6a);--rd-success-bg: var(--ds-system-green-low, #e6f7f0);--rd-warning: #b8860b;--rd-warning-bg: #fdf3d9;--rd-danger: var(--ds-system-red-default, #d1394a);--rd-danger-bg: var(--ds-system-red-low, #fbe8ea);--rd-radius: 14px;--rd-shadow: var(--ds-shadow-modal, 0 1px 2px rgba(20, 22, 31, .04), 0 8px 24px rgba(20, 22, 31, .06))}.rd-root *{box-sizing:border-box}.rd-card{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:var(--rd-radius);box-shadow:var(--rd-shadow);padding:1.25rem;display:flex;flex-direction:column;gap:.9rem}.rd-card-header{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.rd-card-title{font-size:1rem;font-weight:650;margin:0}.rd-card-hint{font-size:.8rem;color:var(--rd-text-muted)}.rd-token-address{display:flex;flex-direction:column;gap:.1rem}.rd-token-address-addr{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.78rem;color:var(--rd-text);overflow-wrap:anywhere;user-select:all}.rd-token-address-meta{font-size:.72rem;color:var(--rd-text-muted)}.rd-field{display:flex;flex-direction:column;gap:.35rem}.rd-field-label{font-size:.69rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-root .rd-field-label-row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.rd-root .rd-token-explorer-link{font-size:.75rem;font-weight:500;color:var(--rd-accent);text-decoration:none;white-space:nowrap}.rd-root .rd-token-explorer-link:hover{text-decoration:underline}.rd-field-row{display:grid;grid-template-columns:1fr 1fr;gap:.625rem}.rd-root select,.rd-root input[type=text],.rd-root input[type=number]{width:100%;padding:.6rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:16px;font-family:inherit}.rd-root select:focus,.rd-root input:focus{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-dropdown{position:relative;min-width:0}.rd-root .rd-dropdown-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.55rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:.9rem;font-family:inherit;font-weight:600;text-align:left;cursor:pointer}.rd-root .rd-static-target{display:flex;align-items:center;gap:.55rem;padding:.55rem .7rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt);color:var(--rd-text);font-size:.9rem;font-weight:600;min-width:0;overflow-wrap:anywhere}.rd-root .rd-dropdown-trigger:disabled{cursor:not-allowed}.rd-dropdown-trigger:focus,.rd-dropdown-trigger:focus-visible{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-dropdown-trigger-content{display:flex;align-items:center;gap:.55rem;min-width:0}.rd-dropdown-trigger-label{display:flex;flex-direction:column;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.rd-dropdown-trigger-sub{font-size:.66rem;font-weight:500;line-height:1.3;color:var(--rd-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-dropdown-chevron{flex:none;color:var(--rd-text-muted);font-size:.7rem;line-height:1}.rd-dropdown-listbox{position:absolute;z-index:20;top:calc(100% + .3rem);left:0;right:0;margin:0;padding:.3rem;list-style:none;max-height:15rem;overflow-y:auto;background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:10px;box-shadow:var(--rd-shadow)}.rd-dropdown-option{display:flex;align-items:center;gap:.55rem;padding:.5rem .6rem;border-radius:8px;font-size:.9rem;color:var(--rd-text);cursor:pointer}.rd-dropdown-option-active{background:var(--rd-surface-alt)}.rd-dropdown-option-selected{font-weight:650}.rd-dropdown-option-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-dropdown-option-check{flex:none;color:var(--rd-accent);font-size:.8rem}.rd-amount-input{display:flex;align-items:baseline;gap:.5rem;padding:.6rem .75rem;border-radius:12px;border:1px solid var(--rd-border);background:var(--rd-surface-alt)}.rd-amount-input:focus-within{outline:2px solid var(--rd-accent);outline-offset:1px}.rd-amount-input[data-rd-invalid]{border-color:var(--rd-danger)}.rd-root .rd-amount-input input[type=text]{flex:1 1 auto;width:auto;min-width:0;padding:0;border:0;border-radius:0;background:none;font-size:22px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2}.rd-root .rd-amount-input input[type=text]:focus{outline:none}.rd-amount-input-suffix{flex:none;font-size:.8rem;font-weight:700;color:var(--rd-text-muted);pointer-events:none}.rd-root .rd-amount-input-max{flex:none;padding:0;font-size:.69rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-accent);background:transparent;border:0;border-radius:0;cursor:pointer;line-height:1}.rd-amount-input-max:hover:not(:disabled){text-decoration:underline}.rd-amount-input-max:disabled{opacity:.5;cursor:not-allowed}.rd-amount-meta{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;font-size:.75rem;color:var(--rd-text-muted);padding:0 .15rem;font-variant-numeric:tabular-nums}.rd-root button{font-family:inherit;font-size:.95rem;font-weight:650;border-radius:10px;border:1px solid transparent;padding:.7rem 1.1rem;cursor:pointer;transition:opacity .12s ease,transform .12s ease}.rd-root button:active:not(:disabled){transform:translateY(1px)}.rd-root button:disabled{cursor:not-allowed;opacity:.55}.rd-button-primary{background:var(--rd-accent);color:var(--rd-accent-contrast)}.rd-button-secondary{background:var(--rd-surface-alt);color:var(--rd-text);border-color:var(--rd-border)}.rd-button-block{width:100%}.rd-callout{border-radius:10px;padding:.65rem .85rem;font-size:.85rem;line-height:1.4}.rd-callout-warning{background:var(--rd-warning-bg);color:var(--rd-warning)}.rd-callout-danger{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-callout-success{background:var(--rd-success-bg);color:var(--rd-success)}.rd-callout-muted{background:var(--rd-surface-alt);color:var(--rd-text-muted)}.rd-quote-summary{display:flex;align-items:center;justify-content:center;gap:.5rem;flex-wrap:wrap;width:fit-content;max-width:100%;margin:0 auto;padding:.4rem .85rem;border-radius:999px;background:var(--rd-surface);border:1px solid var(--rd-border);font-size:.8rem;color:var(--rd-text-muted);font-variant-numeric:tabular-nums;text-align:center}.rd-quote-summary-arrow{color:var(--rd-accent);font-weight:800}.rd-quote-summary strong{color:var(--rd-text);font-weight:700;font-variant-numeric:tabular-nums}.rd-quote-strip{display:flex;align-items:center;justify-content:space-between;gap:.625rem;padding:.7rem .85rem;border-radius:14px;background:color-mix(in srgb,var(--rd-accent) 10%,var(--rd-surface));border:1px solid color-mix(in srgb,var(--rd-accent) 35%,transparent)}.rd-quote-strip-side{display:flex;flex-direction:column;min-width:0;gap:.1rem;font-size:.9rem;font-weight:700;color:var(--rd-text);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.rd-quote-strip-end{text-align:right;align-items:flex-end}.rd-quote-strip-side small{font-size:.69rem;font-weight:600;color:var(--rd-text-muted);letter-spacing:.02em}.rd-quote-strip-arrow{flex:none;color:var(--rd-accent);font-weight:800}.rd-quote-strip-hint{font-size:.72rem;line-height:1.45;color:var(--rd-text-muted);padding:0 .15rem}.rd-deposit-address{display:flex;align-items:center;gap:.5rem;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:.55rem .7rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;color:var(--rd-text-muted);word-break:break-all}.rd-address-full{flex:1;min-width:0;color:var(--rd-text);font-weight:600}.rd-root .rd-address-copy{flex:none;margin-left:auto;padding:.35rem .6rem;border-radius:8px;border:0;background:var(--rd-accent);color:var(--rd-accent-contrast);font-family:inherit;font-size:.69rem;font-weight:800;letter-spacing:.03em;line-height:1}.rd-deposit-qr{position:relative;display:grid;place-items:center;width:172px;height:172px;background:#fff;border-radius:16px;margin:0 auto}.rd-deposit-qr-badge{position:absolute;inset:0;margin:auto;width:36px;height:36px;display:grid;place-items:center;background:#fff;border-radius:50%;pointer-events:none}.rd-address-warning{display:flex;align-items:flex-start;gap:.5rem;border:1px solid color-mix(in srgb,var(--rd-warning) 35%,transparent);font-size:.78rem}.rd-address-details{font-size:.75rem;color:var(--rd-text-muted);line-height:1.5}.rd-address-details>summary{cursor:pointer;font-size:.72rem;font-weight:700;letter-spacing:.02em;color:var(--rd-text-muted);padding:.15rem;list-style:none}.rd-address-details>summary::marker,.rd-address-details>summary::-webkit-details-marker{display:none}.rd-address-details>summary:after{content:" \\25be"}.rd-address-details[open]>summary:after{content:" \\25b4"}.rd-address-details>p{margin:.35rem 0 0;padding:.6rem .75rem;border-radius:10px;background:var(--rd-surface-alt)}.rd-deposit-divider{display:flex;align-items:center;gap:.6rem;color:var(--rd-text-muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.04em}.rd-deposit-divider:before,.rd-deposit-divider:after{content:"";flex:1;height:1px;background:var(--rd-border)}.rd-stepper{display:flex;flex-direction:column;gap:0}.rd-stepper-item{display:flex;gap:.75rem;position:relative;padding-bottom:1.25rem}.rd-stepper-item:last-child{padding-bottom:0}.rd-stepper-rail{display:flex;flex-direction:column;align-items:center}.rd-stepper-dot{width:22px;height:22px;border-radius:50%;border:2px solid var(--rd-border);background:var(--rd-surface);display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:700;flex:none;color:var(--rd-text-muted)}.rd-stepper-item-done .rd-stepper-dot{background:var(--rd-success);border-color:var(--rd-success);color:var(--rd-on-accent)}.rd-stepper-item-active .rd-stepper-dot{border-color:var(--rd-accent);color:var(--rd-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--rd-accent) 20%,transparent)}.rd-stepper-line{flex:1;width:2px;background:var(--rd-border);margin:2px 0}.rd-stepper-item-done .rd-stepper-line{background:var(--rd-success)}.rd-stepper-body{padding-top:1px}.rd-stepper-label{font-weight:600;font-size:.9rem}.rd-stepper-item-pending .rd-stepper-label{color:var(--rd-text-muted)}.rd-stepper-meta{margin-top:.25rem;font-size:.78rem;color:var(--rd-text-muted);display:flex;flex-direction:column;gap:.15rem}.rd-stepper-meta a{color:var(--rd-accent);text-decoration:none}.rd-stepper-meta a:hover{text-decoration:underline}.rd-status-pill{display:inline-flex;align-items:center;gap:.35rem;font-size:.75rem;font-weight:650;padding:.2rem .55rem;border-radius:999px;background:var(--rd-surface-alt);color:var(--rd-text-muted);width:fit-content}.rd-status-pill-success{background:var(--rd-success-bg);color:var(--rd-success)}.rd-status-pill-failure{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-spinner{display:inline-block;width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:rd-spin .7s linear infinite;vertical-align:-.15em}@keyframes rd-spin{to{transform:rotate(360deg)}}.rd-muted{color:var(--rd-text-muted)}.rd-settings-row{display:flex;justify-content:flex-end}.rd-root .rd-icon-button{position:relative;display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border-radius:50%;border:1px solid var(--rd-border);background:var(--rd-surface);color:var(--rd-text-muted)}.rd-root .rd-icon-button:hover:not(:disabled){color:var(--rd-text);background:var(--rd-surface-alt)}.rd-recovery-badge{position:absolute;top:-.3rem;right:-.3rem;display:flex;align-items:center;justify-content:center;min-width:1.05rem;height:1.05rem;padding:0 .25rem;border-radius:999px;background:var(--rd-danger, #d1394a);color:#fff;font-size:.65rem;font-weight:700;line-height:1;border:2px solid var(--rd-surface, #ffffff)}.rd-recover-group{display:flex;flex-direction:column;gap:.75rem}.rd-recover-group+.rd-recover-group{border-top:1px solid var(--rd-border);padding-top:1rem;margin-top:.5rem}.rd-recover-group-label{margin:0;font-size:.8rem;color:var(--rd-text-muted)}.rd-recover-made-of{display:flex;flex-direction:column;gap:.4rem;padding:.65rem .8rem;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:10px}.rd-recover-made-of-label{font-size:.72rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-token-list{display:flex;flex-direction:column;gap:.5rem}.rd-token-row{display:flex;align-items:center;gap:10px;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:12px 14px}.rd-token-row-info{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.rd-token-row-symbol{font-weight:700}.rd-token-row-amount{font-variant-numeric:tabular-nums;font-size:14px;font-weight:700;color:var(--rd-text);white-space:nowrap}.rd-token-row-status{font-size:11.5px;line-height:1.45;color:var(--rd-text-muted)}.rd-token-row-warn{font-size:11.5px;line-height:1.45;color:var(--rd-warning)}.rd-token-row-warn b{font-weight:750;font-variant-numeric:tabular-nums}.rd-token-row-step{font-size:11.5px;line-height:1.45;font-weight:650;color:var(--rd-accent)}.rd-root .rd-token-row-action{flex:none;width:auto;padding:9px 16px;font-size:13px;font-weight:700}.rd-token-row-spinner{flex:none;font-size:18px;color:var(--rd-accent)}.rd-recover-sum{display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:16px 14px}.rd-recover-sum-label{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--rd-text-muted)}.rd-recover-sum-value{font-size:28px;font-weight:800;line-height:1.15;font-variant-numeric:tabular-nums;color:var(--rd-text)}.rd-recover-sum-unit{margin-left:1px;font-size:15px;font-weight:700;color:var(--rd-text-muted)}.rd-recover-sum-empty{font-size:17px;font-weight:700;color:var(--rd-text-muted)}.rd-recover-foot{text-align:center;font-size:11.5px;line-height:1.45;color:var(--rd-text-muted)}.rd-footer-note{text-align:center;font-size:.75rem;color:var(--rd-text-muted);padding:1rem 0 2rem}.rd-history-table{display:flex;flex-direction:column;gap:.6rem;font-size:.875rem}.rd-history-group{background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;overflow:hidden}.rd-history-row-button{width:100%;display:flex;flex-direction:column;gap:.55rem;padding:.8rem .9rem;background:none;border:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.rd-history-row-button:hover{background:color-mix(in srgb,var(--rd-border) 30%,transparent)}.rd-history-row-button:focus-visible{outline:2px solid var(--rd-accent);outline-offset:-2px}.rd-history-card-top{display:flex;align-items:center;gap:.5rem;min-width:0}.rd-history-card-top>.rd-status-pill{margin-left:auto;flex:none}.rd-history-asset{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rd-history-card-amounts{display:flex;align-items:baseline;gap:.5rem;flex-wrap:wrap}.rd-history-num{font-variant-numeric:tabular-nums;font-size:.875rem;font-weight:700;white-space:nowrap}.rd-history-card-arrow{color:var(--rd-text-muted);font-size:.85rem;flex:none}.rd-history-received{color:var(--rd-success)}.rd-history-received-estimate{color:var(--rd-text-muted);font-weight:600}.rd-history-card-foot{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.rd-history-date{color:var(--rd-text-muted);font-size:.78rem;font-variant-numeric:tabular-nums}.rd-history-chevron{color:var(--rd-text-muted);text-align:center}.rd-history-detail{display:flex;flex-direction:column;gap:.375rem;padding:.65rem .9rem .8rem;border-top:1px solid var(--rd-border)}.rd-history-step{display:grid;grid-template-columns:.5rem auto 1fr auto auto;gap:.5rem;align-items:center}.rd-history-step-dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--rd-border)}.rd-history-step-dot-done{background:var(--rd-success)}.rd-history-step-label{font-weight:600}.rd-history-step-chain{color:var(--rd-text-muted)}.rd-history-step-amount{font-variant-numeric:tabular-nums;color:var(--rd-text-muted)}.rd-history-step-tx{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.rd-history-step-shared{margin-left:.4rem;color:var(--rd-text-muted);font-size:.72rem}.rd-complete{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.65rem;padding:1.75rem 1.25rem 1.5rem}.rd-complete-icon{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:var(--rd-success-bg);color:var(--rd-success)}.rd-complete-icon-fail{background:var(--rd-danger-bg);color:var(--rd-danger)}.rd-complete-icon-wait{background:var(--rd-surface-alt);color:var(--rd-text-muted)}.rd-complete-spinner{width:22px;height:22px}.rd-complete-title{margin:0;font-size:1.15rem;font-weight:700}.rd-complete-amount{font-variant-numeric:tabular-nums;font-size:1.35rem;font-weight:700;color:var(--rd-success)}.rd-complete-sub{margin:0;max-width:26rem;color:var(--rd-text-muted);font-size:.85rem;line-height:1.5}.rd-complete-actions{display:flex;flex-direction:column;align-items:center;gap:.5rem;margin-top:.5rem;width:100%}.rd-complete-actions .rd-button-primary{min-width:12rem}.rd-skeleton{border-radius:10px;background:linear-gradient(90deg,var(--rd-surface-alt) 25%,color-mix(in srgb,var(--rd-surface-alt) 55%,var(--rd-surface)) 42%,var(--rd-surface-alt) 60%);background-size:220% 100%;animation:rd-skeleton-wave 1.4s ease-in-out infinite}@keyframes rd-skeleton-wave{0%{background-position:130% 0}to{background-position:-90% 0}}@media(prefers-reduced-motion:reduce){.rd-skeleton{animation:none}}.rd-skeleton-form,.rd-skeleton-address{display:flex;flex-direction:column;gap:.85rem}.rd-skeleton-address{align-items:center}.rd-skeleton-line{height:.9rem;width:40%}.rd-skeleton-field{height:48px}.rd-skeleton-notice{height:96px}.rd-skeleton-cta{height:48px}.rd-skeleton-qr{width:172px;height:172px;border-radius:16px}.rd-skeleton-chip{height:44px;width:100%}.rd-wizard{flex:1 1 auto;min-height:0;overflow-y:auto;padding:1rem 1.25rem 1.25rem;max-width:none;gap:.85rem}.rd-stack{display:flex;flex-direction:column;gap:.75rem}.rd-flow{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap;background:var(--rd-surface-alt);border:1px solid var(--rd-border);border-radius:12px;padding:.7rem .85rem;font-size:.85rem}.rd-flow-pair{display:inline-flex;align-items:center;gap:.4rem;min-width:0}.rd-flow-badge{position:relative;display:inline-grid;flex:none}.rd-flow-badge-sub{position:absolute;right:-5px;bottom:-4px;display:inline-grid;border-radius:50%;border:2px solid var(--rd-surface-alt)}.rd-flow-name b{font-weight:700}.rd-flow-name small{color:var(--rd-text-muted)}.rd-flow-arrow{color:var(--rd-text-muted);flex:none}.rd-flow-to{width:100%;display:flex;align-items:center;gap:.35rem;color:var(--rd-text-muted);font-size:.78rem}.rd-flow-to code{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:6px;padding:0 .35rem;font-size:.75rem}.rd-live{border:1px dashed var(--rd-border);border-radius:12px;padding:.85rem .95rem;display:flex;flex-direction:column;gap:.45rem}.rd-live-head{display:flex;align-items:center;gap:.55rem;font-weight:650;font-size:.9rem}.rd-live-pulse{width:10px;height:10px;border-radius:50%;background:var(--rd-accent);position:relative;flex:none}.rd-live-pulse:after{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid var(--rd-accent);opacity:.5;animation:rd-live-pulse 1.6s ease-out infinite}@keyframes rd-live-pulse{0%{transform:scale(.5);opacity:.7}to{transform:scale(1.4);opacity:0}}@media(prefers-reduced-motion:reduce){.rd-live-pulse:after{animation:none}}.rd-live-sub{margin:0;color:var(--rd-text-muted);font-size:.8rem;line-height:1.5}.rd-live-sub b{color:var(--rd-text);font-weight:650}.rd-step-nav{display:flex;gap:.75rem}.rd-step-nav>button{flex:1 1 auto;border-radius:14px;padding:.85rem 1.1rem;font-size:.95rem;font-weight:800}.rd-wizard-header{display:flex;align-items:center;gap:.5rem;margin-bottom:0}.rd-back-arrow{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:none;border-radius:8px;background:transparent;color:var(--rd-text);cursor:pointer}.rd-back-arrow svg{width:20px;height:20px;flex-shrink:0}.rd-back-arrow:hover:not(:disabled){background:var(--rd-surface-alt)}.rd-back-arrow:disabled{opacity:.4;cursor:not-allowed}.rd-wizard-heading{font-size:1rem;font-weight:700;color:var(--rd-text);margin:0}.rd-wizard-actions{margin-left:auto;display:flex;align-items:center;gap:.25rem}.rd-min-notice{background:var(--rd-surface);border:1px solid var(--rd-border);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:4px}.rd-min-notice-main{font-size:14px;color:var(--rd-text)}.rd-min-notice-main b{color:var(--rd-accent);font-weight:750}.rd-min-notice-sub{font-size:12px;color:var(--rd-text-muted)}.rd-min-notice-pending{display:block;font-size:13px;line-height:1.5;color:var(--rd-text);background:color-mix(in srgb,var(--rd-warning) 12%,transparent);border:1px solid color-mix(in srgb,var(--rd-warning) 40%,transparent);border-radius:10px;padding:10px 12px;margin-top:2px}.rd-min-notice-pending:before{content:"\\25cf";color:var(--rd-warning);font-size:9px;margin-right:7px;vertical-align:1px}.rd-min-notice-pending b{font-weight:750;color:var(--rd-warning);font-variant-numeric:tabular-nums}.rd-min-notice-warning{display:flex;align-items:flex-start;gap:.5rem;font-size:13px;line-height:1.5;color:var(--rd-text);background:color-mix(in srgb,var(--rd-warning) 12%,transparent);border:1px solid color-mix(in srgb,var(--rd-warning) 40%,transparent);border-radius:10px;padding:10px 12px;margin-top:2px}.rd-min-notice-warning b{font-weight:750}
|
|
24
|
+
`);import{Fragment as Iu,jsx as ke,jsxs as at}from"react/jsx-runtime";var Bw=56;function zw(e){return{client:e.client,apiBaseUrl:e.apiBaseUrl,recipient:e.recipient,target:e.target,enabled:e.targets===void 0,wallet:e.wallet,trustedFactories:e.trustedFactories,onUnauthorized:e.onUnauthorized,onError:e.onError}}var Ow="These funds may be processing normally -- only recover if they're stuck.",ya="USDT",Nu="primary";function Fw(e){return`${e} more recoverable under other delivery tokens -- switch the delivery token above to recover ${e===1?"it":"them"}.`}function Zo(e){if(!e)return 0n;try{return BigInt(e)}catch{return 0n}}function ln(e,t){try{return et(e,t)}catch{return e.toString()}}function Tu(e){return e.length>14?`${e.slice(0,8)}...${e.slice(-4)}`:e}function Uw(e){let t=Zo(e.bridgeMinWei),r=[];for(let i of e.tokens??[]){let a=Zo(i.balance);if(!(a<=0n)){if(i.suggestedAction==="execute"){r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,action:{kind:"execute"}});continue}if(i.recoverable){r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,action:{kind:"sweep",tokenAddress:i.address}});continue}r.push({key:i.address,symbol:i.symbol,decimals:i.decimals,balance:a,...t>a?{shortfall:t-a,minimum:t}:{}})}}let n=Zo(e.balance),o=r.some(i=>i.action?.kind==="execute");return n>0n&&e.suggestedAction==="execute"&&!o?r.unshift({key:Nu,symbol:ya,decimals:e.decimals,balance:n,action:{kind:"execute"}}):r.length===0&&n>0n&&e.suggestedAction!=="none"&&r.push({key:Nu,symbol:ya,decimals:e.decimals,balance:n,action:{kind:"sweep"}}),r}function jw({deposit:e,decimals:t}){let r=e.originChainId??Bw,n=e.originTxHash||e.txHash,o=n?wa(r,n):void 0;return at("div",{className:"rd-history-step","data-testid":"recovery-deposit-row",children:[ke("span",{className:"rd-history-step-dot rd-history-step-dot-done"}),ke("span",{className:"rd-history-step-chain",children:Ko(r)}),ke("span",{className:"rd-history-step-amount",children:ln(Zo(e.amount),t)}),ke("span",{className:"rd-history-step-tx",children:o?ke("a",{href:o.url,target:"_blank",rel:"noreferrer",title:n,children:Tu(n)}):n?ke("span",{title:n,children:Tu(n)}):null})]})}function Ww({group:e,showTargetLabel:t,busy:r,state:n,onRecover:o,actingRowKey:i,rowKeyOf:a}){let{info:s}=e,l=Uw(s),c=Zo(s.balance),u=l.length===1?`${ln(l[0].balance,l[0].decimals)}`:`${l.length} assets`,h=e.deposits.length>0&&e.depositsTotal>=c,g=c>e.depositsTotal?c-e.depositsTotal:0n,d=n.step==="switching"||n.step==="deploying"||n.step==="recovering";function w(){return n.step==="switching"?"Switching network\u2026":n.step==="deploying"?"Confirm in wallet\u2026 (1/2 \u2014 preparing your address)":n.deployTxHash?"Confirm in wallet\u2026 (2/2 \u2014 recovering)":"Confirm in wallet\u2026 (recovering)"}return at("div",{className:"rd-recover-group","data-testid":"forwarder-section",children:[t&&at("p",{className:"rd-recover-group-label",children:["Held for ",ke("b",{children:e.targets.join(", ")})]}),at("div",{className:"rd-recover-sum",children:[ke("span",{className:"rd-recover-sum-label",children:"Waiting at your deposit address"}),at("span",{className:"rd-recover-sum-value",children:[u,l.length===1&&at(Iu,{children:[" ",ke("span",{className:"rd-recover-sum-unit",children:l[0].symbol})]})]})]}),e.deposits.length>0&&at("div",{className:"rd-recover-made-of",children:[ke("div",{className:"rd-recover-made-of-label",children:"Made up of"}),e.deposits.map(f=>ke(jw,{deposit:f,decimals:s.decimals},`${f.txHash}-${f.blockNumber}`)),!h&&at("p",{className:"rd-token-row-status","data-testid":"deposits-incomplete-note",children:["Listed deposits account for ",ln(e.depositsTotal,s.decimals)," of the"," ",ln(c,s.decimals)," ",ya," above; the remaining"," ",ln(g,s.decimals)," ",ya," arrived outside these transfers (or is left over from an earlier one). Recovering moves the full balance either way."]})]}),ke("div",{className:"rd-token-list",children:l.map(f=>{let m=a(f),b=d&&i===m;return at("div",{className:"rd-token-row",children:[ke(Kr,{symbol:f.symbol,size:26}),at("div",{className:"rd-token-row-info",children:[at("span",{className:"rd-token-row-amount",children:[ln(f.balance,f.decimals)," ",ke("span",{className:"rd-token-row-symbol",children:f.symbol})]}),b?ke("span",{className:"rd-token-row-step",children:w()}):f.shortfall!==void 0&&f.minimum!==void 0?at("span",{className:"rd-token-row-warn",children:["Below the ",ln(f.minimum,f.decimals)," ",f.symbol," minimum \u2014 deposit"," ",at("b",{children:[ln(f.shortfall,f.decimals)," ",f.symbol]})," ","more via ",ke("b",{children:"Deposit to CROSS"})," and it sweeps in together."]}):f.action?ke("span",{className:"rd-token-row-status",children:"Ready to recover to your wallet"}):ke("span",{className:"rd-token-row-status",children:"Waiting to be delivered."})]}),b?ke("span",{className:"rd-spinner rd-token-row-spinner"}):f.action&&ke("button",{type:"button",className:"rd-button-primary rd-token-row-action",onClick:()=>o(f),disabled:r,children:"Recover"})]},f.key)})}),!s.isDeployed&&n.step==="idle"&&at("div",{className:"rd-callout rd-callout-warning","data-testid":"two-tx-notice",children:["Recovering from this address the first time takes ",ke("b",{children:"two transactions"}),": one to prepare the address, then one to move the funds \u2014 your wallet will prompt twice. After that, it's a single transaction."]}),s.inFlight&&ke("p",{className:"rd-muted rd-token-row-status",children:s.inFlightReason||Ow}),n.step==="done"&&ke("div",{className:"rd-callout rd-callout-success",children:"Recovered \u2014 funds are on the way to your wallet."}),n.step==="error"&&n.error&&ke("div",{className:"rd-callout rd-callout-danger",children:n.error})]})}function xa(e){let{info:t,loading:r,error:n,refresh:o}=wu(zw(e)),i=_s({recipient:e.recipient,wallet:e.wallet,trustedFactories:e.trustedFactories,onError:e.onError,onChanged:e.targets!==void 0?e.onRecovered:o}),[a,s]=Cu(),l=e.targets!==void 0?[...e.targets]:t?[{symbol:e.target??"",isDefault:!0,info:t}]:[],c=xu(fo(l,e.orders??[])),u=c.length>0,h=e.wallet?.walletAddress,g=e.wallet?.getBalance,[d,w]=Cu();return Pw(()=>{if(!u||!g||!h){w(void 0);return}let f=!1;return g({chainId:56,address:h}).then(m=>{f||w({value:m.value,decimals:m.decimals})}).catch(()=>{f||w(void 0)}),()=>{f=!0}},[u,g,h]),at("section",{className:"rd-card",children:[(e.showTitle??!0)&&ke("div",{className:"rd-card-header",children:ke("h2",{className:"rd-card-title",children:"Recover stuck funds"})}),typeof e.otherTargetsRecoverable=="number"&&e.otherTargetsRecoverable>0&&ke("div",{className:"rd-callout rd-callout-muted","data-testid":"other-targets-recoverable-note",children:Fw(e.otherTargetsRecoverable)}),r&&at("p",{className:"rd-muted",children:[ke("span",{className:"rd-spinner"})," Checking for stuck funds\u2026"]}),n&&at("div",{className:"rd-callout rd-callout-danger",children:["Couldn't check recovery status: ",n.message]}),!r&&!n&&l.length>0&&!u&&at("div",{className:"rd-recover-sum",children:[ke("span",{className:"rd-recover-sum-label",children:"Waiting at your deposit address"}),ke("span",{className:"rd-recover-sum-value rd-recover-sum-empty",children:"Nothing to recover"})]}),!r&&!n&&c.map(f=>ke(Ww,{group:f,showTargetLabel:c.length>1||f.targets.length>1,busy:i.busy,state:i.stateFor(f.forwarder),actingRowKey:a,rowKeyOf:m=>`${f.forwarder.toLowerCase()}:${m.key}`,onRecover:m=>{m.action&&(s(`${f.forwarder.toLowerCase()}:${m.key}`),i.recover(f.info,m.action.kind,m.action.tokenAddress))}},f.forwarder.toLowerCase())),!r&&!n&&u&&at("div",{className:"rd-callout rd-callout-muted","data-testid":"rd-recover-gas-note",children:["Recovering runs on BSC and needs ",ke("b",{children:"BNB for gas"})," in your connected wallet",d&&at(Iu,{children:[" ","\u2014 it currently holds ",at("b",{children:[ln(d.value,d.decimals)," BNB"]})]}),". A first-time recovery is two transactions, so keep a little extra."]}),ke("p",{className:"rd-recover-foot",children:"Funds always return to your own wallet \u2014 recovery can't send anywhere else."})]})}import*as Zr from"react";import*as or from"@radix-ui/react-dialog";import{Drawer as ho}from"vaul";ie(`.rd-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))}.rd-dialog-content{-webkit-font-smoothing:antialiased;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:100001;width:var(--rd-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;font-family:inherit}.rd-drawer-content{-webkit-font-smoothing:antialiased;position:fixed;bottom:0;left:0;right:0;z-index:100001;width:100%;max-width:var(--rd-drawer-max-width, none);min-width:var(--rd-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}.rd-drawer-content[data-vaul-drawer-direction=right]{inset:0 0 0 auto;max-height:100vh;width:var(--rd-drawer-max-width, 400px);max-width:100vw;border-radius:16px 0 0 16px}.rd-drawer-content[data-vaul-drawer-direction=left]{inset:0 auto 0 0;max-height:100vh;width:var(--rd-drawer-max-width, 400px);max-width:100vw;border-radius:0 16px 16px 0}.rd-drawer-content[data-vaul-drawer-direction=top]{inset:0 0 auto;border-radius:0 0 16px 16px}.rd-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}.rd-drawer-content[data-vaul-drawer-direction=left] .rd-drawer-handle,.rd-drawer-content[data-vaul-drawer-direction=right] .rd-drawer-handle{display:none}.rd-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}
|
|
25
|
+
`);import{jsx as Rr,jsxs as va}from"react/jsx-runtime";function _w(e){let t=`(max-width: ${e}px)`,[r,n]=Zr.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(t).matches);return Zr.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let o=window.matchMedia(t);n(o.matches);let i=a=>n(a.matches);return o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[t]),r}function bo({theme:e="dark",mobileBreakpoint:t=768,drawerDirection:r="bottom",dialogWidth:n,drawerMaxWidth:o,drawerMinWidth:i,style:a,open:s,onOpenChange:l,children:c}){let u=_w(t),[h,g]=Zr.useState(!1),d=s!==void 0,w=d?s:h,f=Zr.useCallback(p=>{d||g(p),l?.(p)},[d,l]),m=Zr.useMemo(()=>{let p={};return n&&(p["--rd-dialog-width"]=n),o&&(p["--rd-drawer-max-width"]=o),i&&(p["--rd-drawer-min-width"]=i),{...p,...a}},[n,o,i,a]),b=Zr.useMemo(()=>({open:w,setOpen:f,isMobile:u,theme:e,portalStyle:m}),[w,f,u,e,m]),y=Rr("div",{"data-theme":e,style:m,children:c});return u?Rr(fa.Provider,{value:b,children:Rr(ho.Root,{direction:r,open:w,onOpenChange:f,noBodyStyles:!0,children:y},"drawer")}):Rr(fa.Provider,{value:b,children:Rr(or.Root,{open:w,onOpenChange:f,children:y})})}function wo({asChild:e,children:t,dataAttributes:r}){let{isMobile:n}=zr(),o=n?ho.Trigger:or.Trigger;return Rr(o,{asChild:e,...r,children:t})}function yo({className:e,ariaTitle:t,children:r}){let{isMobile:n,theme:o,portalStyle:i}=zr();return n?va(ho.Portal,{children:[Rr(ho.Overlay,{className:"rd-overlay"}),va(ho.Content,{className:xe("rd-drawer-content",e),"data-theme":o,"data-rd-shell":"drawer",style:i,children:[Rr(ho.Title,{className:"rd-sr-only",children:t}),Rr("div",{className:"rd-drawer-handle"}),r]})]}):va(or.Portal,{children:[Rr(or.Overlay,{className:"rd-overlay"}),va(or.Content,{className:xe("rd-dialog-content",e),"data-theme":o,"data-rd-shell":"dialog",style:i,children:[Rr(or.Title,{className:"rd-sr-only",children:t}),Rr(or.Description,{className:"rd-sr-only",children:t}),r]})]})}import{useState as Gw}from"react";import{QRCodeSVG as Hw}from"qrcode.react";import{Fragment as Xo,jsx as vt,jsxs as At}from"react/jsx-runtime";function Qw(e){let{depositAddress:t,originChainId:r,originCurrency:n,amountWei:o,isNative:i}=e;if(i)return o!==void 0?`ethereum:${t}@${r}?value=${o.toString()}`:`ethereum:${t}@${r}`;let a=new URLSearchParams({address:t});return o!==void 0&&a.set("uint256",o.toString()),`ethereum:${n}@${r}/transfer?${a.toString()}`}function Vw(e){let{depositAddress:t,splMint:r,humanAmount:n}=e,o=new URLSearchParams;return n&&o.set("amount",n),o.set("spl-token",r),`solana:${t}?${o.toString()}`}function Mu({depositAddress:e,originChainId:t,originChainName:r,originCurrency:n,amount:o,tokenSymbol:i,tokenDecimals:a,kind:s="evm",minAmount:l,hideTokenWarning:c=!1,depositState:u,onDeposit:h,canDeposit:g,oneClickEnabled:d=!0}){let[w,f]=Gw(!1),m=n.toLowerCase()===Vo,b=s==="svm";async function y(){try{await navigator.clipboard.writeText(e),f(!0),setTimeout(()=>f(!1),1500)}catch{}}let p;if(o)try{let D=BigInt(o);D>0n&&(p=D)}catch{}let x=p!==void 0,v;if(x)try{v=et(p,a)}catch{v=o}let R=b?Vw({depositAddress:e,splMint:n,humanAmount:v??""}):Qw({depositAddress:e,originChainId:t,originCurrency:n,amountWei:p,isNative:m}),T;if(l)try{T=`${et(BigInt(l),a)} ${i}`}catch{}let{isSubmitting:N,isConfirming:S,isConfirmed:M,needsSwitch:P,txHash:j,reverted:L,error:K}=u;return At("section",{className:"rd-stack",children:[!b&&g&&At(Xo,{children:[vt("button",{type:"button",className:"rd-button-primary rd-button-block",onClick:h,disabled:N||S||M&&!L,children:M&&!L?"Deposit sent":S?"Confirming...":N?P?"Switching network...":"Confirm in wallet...":`One-click deposit ${i}${P?` (switch to ${r})`:""}`}),K&&vt("div",{className:"rd-callout rd-callout-danger",children:K}),j&&At("p",{className:"rd-card-hint",children:["Tx: ",vt("span",{style:{fontFamily:"monospace"},children:j})]}),M&&L&&vt("div",{className:"rd-callout rd-callout-danger",children:"The deposit transaction reverted on-chain. Please check your wallet and try again."}),M&&!L&&vt("div",{className:"rd-callout rd-callout-success",children:"Deposit confirmed on-chain. Waiting for it to be swept..."}),vt("div",{className:"rd-deposit-divider",children:"or deposit manually"})]}),b&&At("div",{className:"rd-callout rd-callout-muted",children:["Pay from a Solana wallet (e.g. Phantom). Scan the QR or copy the address below and send"," ",x?At(Xo,{children:["exactly"," ",At("strong",{children:[v," ",i]})]}):At(Xo,{children:["any amount of ",vt("strong",{children:i})]}),"."]}),At("div",{className:"rd-deposit-qr",children:[vt(Hw,{value:R,size:144,level:"H"}),vt("span",{className:"rd-deposit-qr-badge","aria-hidden":"true",children:vt(go,{chainId:t,chainName:r,size:28})})]}),At("div",{className:"rd-deposit-address",children:[vt("span",{className:"rd-address-full",title:e,children:e}),vt("button",{type:"button",className:"rd-address-copy",onClick:y,"aria-label":`Copy deposit address ${e}`,children:w?"Copied":"Copy"})]}),At("p",{className:"rd-card-hint",children:[x?At(Xo,{children:["Send exactly"," ",At("strong",{children:[v," ",i]})," ","on ",r," to this address."]}):At(Xo,{children:["Reusable address -- send any amount of ",vt("strong",{children:i})," on ",r,", as many times as you like."]}),!b&&!g&&d&&!x&&" Enter an amount to deposit in one click."]}),!c&&At("div",{className:"rd-callout rd-callout-warning rd-address-warning",children:[vt("span",{"aria-hidden":"true",children:"\u26A0"}),At("span",{children:["Only send ",vt("strong",{children:i})," on ",vt("strong",{children:r})," to this address."]})]}),At("details",{className:"rd-address-details",children:[vt("summary",{children:"More about this address"}),vt("p",{children:"This is a reusable, open deposit address -- a wrong token or wrong chain will not be processed automatically, and recovering it has weaker guarantees than a one-time order address (it may require a manual request)."})]}),T&&At("p",{className:"rd-card-hint",children:["Deposits below ",T," may not be swept."]})]})}import{jsx as ka,jsxs as Gn}from"react/jsx-runtime";function Ra({minNotice:e,onlySend:t}){return Gn("div",{className:"rd-min-notice","data-rd-min-notice":"",children:[Gn("div",{className:"rd-min-notice-main",children:["Send at least"," ",Gn("b",{children:[e.remaining??e.min," ",e.symbol]})]}),e.remaining!==void 0?Gn("div",{className:"rd-min-notice-pending","data-rd-min-notice-pending":"",children:[Gn("b",{children:[e.pending,e.pendingSymbol?` ${e.pendingSymbol}`:""]})," ","from an earlier deposit is already waiting at your address \u2014 it counts toward the ",e.min," ",e.symbol," minimum."]}):ka("div",{className:"rd-min-notice-sub",children:"Smaller deposits may not be processed."}),t&&Gn("div",{className:"rd-min-notice-warning","data-rd-min-notice-warning":"",children:[ka("span",{"aria-hidden":"true",children:"\u26A0"}),Gn("span",{children:["Only send ",ka("b",{children:t.symbol})," on ",ka("b",{children:t.chainName})," to this address."]})]})]})}import{Fragment as Eu,jsx as ge,jsxs as st}from"react/jsx-runtime";function Hs(e){return e.length>12?`${e.slice(0,6)}\u2026${e.slice(-4)}`:e}function Yw({origin:e,delivered:t,recipient:r}){return st("div",{className:"rd-flow","data-testid":"rd-flow-summary",children:[st("span",{className:"rd-flow-pair",children:[st("span",{className:"rd-flow-badge",children:[ge(Kr,{symbol:e.token.symbol,size:22}),ge("span",{className:"rd-flow-badge-sub",children:ge(go,{chainId:e.chainId,chainName:e.chainName,size:12})})]}),st("span",{className:"rd-flow-name",children:[ge("b",{children:e.token.symbol})," ",st("small",{children:["on ",e.chainName]})]})]}),ge("span",{className:"rd-flow-arrow","aria-hidden":"true",children:"\u2192"}),st("span",{className:"rd-flow-pair",children:[t&&ge(Kr,{symbol:t.symbol,size:22}),st("span",{className:"rd-flow-name",children:[ge("b",{children:t?.symbol??"\u2026"})," ",ge("small",{children:"on CROSS"})]})]}),r&&st("span",{className:"rd-flow-to",children:["Delivered to ",ge("code",{children:Hs(r)})," \u2014 your CROSS wallet"]})]})}function qw(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function Kw(e,t=6){let r=e.indexOf(".");if(r<0)return e;let n=e.slice(0,r+1+t).replace(/0+$/,"").replace(/\.$/,"");return n===""?"0":n}function Zw({order:e,delivered:t,onClose:r,recipient:n}){let o=qw(e.status),i=e.status==="COMPLETED",a=(()=>{if(!t||o)return;let s=e.amountOut||e.expectedOut;if(s)try{let l=Kw(et(BigInt(s),t.decimals));return`${e.amountOut?"+":"~"}${l} ${t.symbol}`}catch{return}})();return st("div",{className:"rd-card rd-complete","data-testid":"rd-deposit-detected","data-variant":o?"danger":i?"success":"progress",children:[ge("div",{className:`rd-complete-icon${o?" rd-complete-icon-fail":i?"":" rd-complete-icon-wait"}`,children:o?ge("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:ge("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}):i?ge("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:ge("path",{d:"M4 12.5l5.2 5L20 7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}):ge("span",{className:"rd-spinner rd-complete-spinner"})}),ge("h3",{className:"rd-complete-title",children:o?"Deposit didn't complete":i?"Deposit complete":"Deposit received!"}),a&&ge("div",{className:"rd-complete-amount",children:a}),ge("p",{className:"rd-complete-sub",children:o?`The transfer ended with status ${e.status}. Check the transfer history for details \u2014 deposited funds can be recovered.`:i?`Funds have been delivered to your wallet${n?` (${Hs(n)})`:""}.`:`Your funds are being delivered to your wallet${n?` (${Hs(n)})`:""}. You can close this window \u2014 delivery continues on its own.`}),r&&(i||o)&&ge("div",{className:"rd-complete-actions",children:ge("button",{type:"button",className:"rd-button-primary",onClick:r,"data-track":"close",children:"Done"})})]})}function Au({depositAddress:e,origin:t,amountSmallestUnits:r,depositState:n,onDeposit:o,canDeposit:i,oneClickEnabled:a=!0,quote:s,humanAmount:l,destination:c,detectedDeposit:u,minNotice:h,onClose:g,delivered:d,recipient:w}){let{phase:f,isSubmitting:m,isConfirming:b,isConfirmed:y,needsSwitch:p,reverted:x,error:v}=n,R=!!(s&&l?.trim()&&c),T=ge(Yw,{origin:t,delivered:d??c,recipient:w});return u?st(Eu,{children:[T,ge(Zw,{order:u,delivered:d??c,onClose:g,recipient:w})]}):st(Eu,{children:[T,R&&s&&c&&st("div",{className:"rd-quote-summary","data-rd-quote-recap":"",children:[st("span",{children:["You send ",ge("strong",{children:l})," ",t.token.symbol]}),ge("span",{className:"rd-quote-summary-arrow",children:"\u2192"}),st("span",{children:["receive ~",ge("strong",{children:(()=>{try{return et(BigInt(s.expectedCrossd),c.decimals)}catch{return"--"}})()})," ",c.symbol]})]}),h&&ge(Ra,{minNotice:h,onlySend:{symbol:t.token.symbol,chainName:t.chainName}}),ge(Mu,{depositAddress:e,originChainId:t.chainId,originChainName:t.chainName,originCurrency:t.token.address,amount:r,tokenSymbol:t.token.symbol,tokenDecimals:t.token.decimals,minAmount:h?void 0:t.minAmount,hideTokenWarning:!!h,depositState:n,onDeposit:o,canDeposit:i,oneClickEnabled:a}),f!=="idle"&&!i&&st("div",{className:"rd-card",children:[m&&st("p",{className:"rd-muted",children:[ge("span",{className:"rd-spinner"})," ",p?"Switching network...":"Confirm in wallet..."]}),b&&st("p",{className:"rd-muted",children:[ge("span",{className:"rd-spinner"})," Confirming..."]}),n.txHash&&st("p",{className:"rd-card-hint",children:["Tx: ",ge("span",{style:{fontFamily:"monospace"},children:n.txHash})]}),y&&x&&ge("div",{className:"rd-callout rd-callout-danger",children:"The deposit transaction reverted on-chain. Please check your wallet and try again."}),y&&!x&&ge("div",{className:"rd-callout rd-callout-success",children:"Deposit confirmed on-chain. Waiting for it to be swept..."}),v&&ge("div",{className:"rd-callout rd-callout-danger",children:v})]}),st("div",{className:"rd-live","data-testid":"rd-deposit-watch",children:[st("div",{className:"rd-live-head",children:[ge("span",{className:"rd-live-pulse","aria-hidden":"true"}),"Waiting for your deposit"]}),st("p",{className:"rd-live-sub",children:["We're watching this address. Send ",ge("b",{children:t.token.symbol})," on ",ge("b",{children:t.chainName})," and the progress shows up here automatically \u2014 delivery continues even if you close this window."]})]})]})}import{useEffect as Lu,useId as Xw,useRef as Qs,useState as Du}from"react";import{jsx as Jo,jsxs as $o}from"react/jsx-runtime";function ei({value:e,options:t,onChange:r,disabled:n,ariaLabel:o,id:i}){let a=Xw(),s=i??a,l=`${s}-listbox`,[c,u]=Du(!1),h=t.findIndex(S=>S.value===e),[g,d]=Du(h>=0?h:0),w=Qs(null),f=Qs(null),m=Qs([]),b=!!n||t.length===0,y=h>=0?t[h]:void 0;Lu(()=>{if(!c)return;function S(M){w.current&&!w.current.contains(M.target)&&u(!1)}return document.addEventListener("pointerdown",S),()=>document.removeEventListener("pointerdown",S)},[c]),Lu(()=>{c&&m.current[g]?.scrollIntoView?.({block:"nearest"})},[c,g]);function p(){b||(d(h>=0?h:0),u(!0))}function x(S){u(!1),S&&f.current?.focus()}function v(S){let M=t[S];M&&(r(M.value),x(!0))}function R(){b||(c?x(!1):p())}function T(S){if(!b)switch(S.key){case"ArrowDown":S.preventDefault(),c?d(M=>Math.min(M+1,t.length-1)):p();break;case"ArrowUp":S.preventDefault(),c?d(M=>Math.max(M-1,0)):p();break;case"Enter":case" ":S.preventDefault(),c?v(g):p();break;case"Escape":c&&(S.preventDefault(),x(!0));break;case"Tab":c&&u(!1);break;default:break}}let N=c&&t[g]?`${s}-option-${g}`:void 0;return $o("div",{className:"rd-dropdown",ref:w,children:[$o("button",{type:"button",id:s,ref:f,className:"rd-dropdown-trigger","aria-haspopup":"listbox","aria-expanded":c,"aria-controls":l,"aria-activedescendant":N,"aria-label":o,disabled:b,onClick:R,onKeyDown:T,children:[$o("span",{className:"rd-dropdown-trigger-content",children:[y?.icon,$o("span",{className:"rd-dropdown-trigger-label",children:[y?.label??"",y?.subLabel&&Jo("small",{className:"rd-dropdown-trigger-sub",children:y.subLabel})]})]}),Jo("span",{className:"rd-dropdown-chevron","aria-hidden":"true",children:"\u25BE"})]}),c&&Jo("ul",{className:"rd-dropdown-listbox",role:"listbox",id:l,"aria-label":o,tabIndex:-1,"data-vaul-no-drag":!0,children:t.map((S,M)=>{let P=S.value===e,j=M===g;return $o("li",{id:`${s}-option-${M}`,role:"option","aria-selected":P,ref:L=>{m.current[M]=L},className:["rd-dropdown-option",j?"rd-dropdown-option-active":"",P?"rd-dropdown-option-selected":""].filter(Boolean).join(" "),onPointerEnter:()=>d(M),onClick:L=>{L.preventDefault(),v(M)},children:[S.icon,Jo("span",{className:"rd-dropdown-option-label",children:S.label}),P&&Jo("span",{className:"rd-dropdown-option-check","aria-hidden":"true",children:"\u2713"})]},S.value)})})]})}import{Fragment as Vs,jsx as Sn,jsxs as Sr}from"react/jsx-runtime";function Jw(e,t){if(!e)return"--";try{return et(BigInt(e),t)}catch{return"--"}}function Pu({quote:e,isLoading:t,error:r,humanAmount:n,originSymbol:o,destination:i}){return Sr("div",{className:"rd-stack","data-rd-quote-preview":"",children:[t&&Sr("div",{className:"rd-quote-strip","data-testid":"rd-quote-skeleton",children:[Sn("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"30%"},"aria-hidden":"true"}),Sn("span",{className:"rd-quote-strip-arrow","aria-hidden":"true",children:"\u2192"}),Sn("span",{className:"rd-skeleton rd-skeleton-line",style:{width:"30%"},"aria-hidden":"true"})]}),!t&&r&&Sr("div",{className:"rd-callout rd-callout-danger",children:["Couldn't fetch a quote: ",r.message]}),!t&&!r&&e&&o&&Sr(Vs,{children:[Sr("div",{className:"rd-quote-strip",children:[Sr("span",{className:"rd-quote-strip-side",children:[Sr("b",{children:[n," ",o]}),Sn("small",{children:"You send"})]}),Sn("span",{className:"rd-quote-strip-arrow","aria-hidden":"true",children:"\u2192"}),Sr("span",{className:"rd-quote-strip-side rd-quote-strip-end",children:[Sr("b",{children:["~",Jw(e.expectedCrossd,i.decimals)," ",i.symbol]}),Sn("small",{children:"You receive"})]})]}),e.belowMin&&Sn("div",{className:"rd-callout rd-callout-warning",children:"This amount is below the minimum the bridge will accept. Increase the amount to continue."}),(e.assumesParity||e.feeUsd)&&Sr("p",{className:"rd-quote-strip-hint",children:[e.feeUsd&&Sr(Vs,{children:["Bridge fee: $",e.feeUsd,", already deducted from the amount above. You also pay your own network fee to send the deposit."," "]}),e.assumesParity&&Sr(Vs,{children:["Assumes 1:1 parity between bridged USDT and ",i.symbol,"; the final amount may differ slightly."]})]})]}),!t&&!r&&!e&&Sn("p",{className:"rd-muted",children:"Enter an amount to see a quote."})]})}import{useMemo as Bu}from"react";import{jsx as mt,jsxs as Xr}from"react/jsx-runtime";function $w(e){let t=new Map;for(let r of e.origins)t.has(r.chainId)||t.set(r.chainId,r.chainName);return Array.from(t,([r,n])=>({chainId:r,chainName:n}))}function zu(e,t){return t===void 0?[]:e.origins.filter(r=>r.chainId===t)}function ey(e,t){let r=et(e,t),n=r.indexOf(".");return n===-1?r:`${r.slice(0,n)}.${r.slice(n+1,n+1+4)}`.replace(/\.?0+$/,"")||r.slice(0,n)}function Ou({catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i=!0,recipient:a,onChangeRecipient:s,showRecipientInput:l=!0,recipientValid:c=!0,balance:u,balanceLoading:h,insufficientBalance:g,onMax:d,disabled:w}){let f=Bu(()=>$w(e),[e]),m=Bu(()=>zu(e,t?.chainId),[e,t?.chainId]);function b(T){let N=Number(T),S=zu(e,N)[0];S&&r(S)}function y(T){let N=m.find(S=>S.token.address.toLowerCase()===T.toLowerCase());N&&r(N)}let p=t?`${et(BigInt(t.minAmount),t.token.decimals)} ${t.token.symbol} min`:void 0,x=u?`${ey(u.value,u.decimals)} ${u.symbol}`:void 0,v=g?`Amount exceeds your balance${x?` (${x})`:""}`:void 0,R=c?void 0:"Not a valid address";return Xr("section",{className:"rd-stack","data-rd-source-form":"",children:[Xr("div",{className:"rd-field",children:[Xr("div",{className:"rd-field-label-row",children:[mt("span",{className:"rd-field-label",children:"From"}),t&&(()=>{let T=ku(t.chainId,t.token.address);return T?Xr("a",{className:"rd-token-explorer-link",href:T.url,target:"_blank",rel:"noopener noreferrer",title:`View ${t.token.symbol} on ${T.name}`,children:[T.name," \u2197"]}):null})()]}),Xr("div",{className:"rd-field-row",children:[mt(ei,{ariaLabel:"Origin chain",value:t?String(t.chainId):"",onChange:b,disabled:w,options:f.map(T=>({value:String(T.chainId),label:T.chainName,subLabel:"Network",icon:mt(go,{chainId:T.chainId,chainName:T.chainName,size:22})}))}),mt(ei,{ariaLabel:"Token",value:t?.token.address??"",onChange:y,disabled:w||m.length===0,options:m.map(T=>({value:T.token.address,label:T.token.symbol,subLabel:`${T.token.decimals} decimals`,icon:mt(Kr,{symbol:T.token.symbol,logoUrl:T.token.logoUrl,size:22})}))})]})]}),i&&Xr("label",{className:"rd-field",children:[mt("span",{className:"rd-field-label",children:"Amount (optional)"}),Xr("div",{className:"rd-amount-input","data-rd-invalid":v?"":void 0,children:[mt("input",{type:"text",inputMode:"decimal",placeholder:"0.0",value:n,onChange:T=>{let N=T.target.value;if(N===""){o(N);return}N.startsWith(".")&&(N=`0${N}`),/^\d*\.?\d{0,4}$/.test(N)&&(N=N.replace(/^0+(?=\d)/,""),!((N.split(".")[0]??"").length>12)&&o(N))},disabled:w||!t,"data-vaul-no-drag":!0}),t&&mt("span",{className:"rd-amount-input-suffix",children:t.token.symbol}),d&&!w&&mt("button",{type:"button",className:"rd-amount-input-max",onClick:d,disabled:w||!t,children:"Max"})]}),(x||h||p)&&Xr("span",{className:"rd-amount-meta",children:[mt("span",{children:p??""}),mt("span",{children:h?"Balance: \u2026":x?`Balance: ${x}`:""})]}),v&&mt("span",{className:"rd-callout rd-callout-danger",children:v})]}),l&&Xr("label",{className:"rd-field",children:[mt("span",{className:"rd-field-label",children:"ONEchain recipient address"}),mt("input",{type:"text",placeholder:"0x...",value:a,onChange:T=>s(T.target.value),disabled:w,"data-vaul-no-drag":!0}),mt("span",{className:"rd-card-hint",children:"Defaults to your connected wallet. This is where your delivery token is received on ONEchain -- it can differ from the address you deposit from, and is also used as the refund address if anything goes wrong."}),R&&mt("span",{className:"rd-callout rd-callout-danger",children:R})]}),!l&&a.trim().length>0&&Xr("div",{className:"rd-field",children:[mt("span",{className:"rd-field-label",children:"ONEchain recipient address"}),mt("div",{className:"rd-static-target",children:mt("span",{className:"rd-token-address-addr",children:a})}),mt("span",{className:"rd-card-hint",children:"Set by the host -- this is where your delivery token is received on ONEchain."})]})]})}import{Fragment as ty,jsx as pr,jsxs as Hn}from"react/jsx-runtime";function Fu({catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i,minNotice:a,onMax:s,recipient:l,onChangeRecipient:c,showRecipientInput:u,recipientValid:h,balance:g,balanceLoading:d,insufficientBalance:w,targetOptions:f,selectedTarget:m,onChangeTarget:b,showTargetSelector:y,quote:p,quoteLoading:x,quoteError:v,depositAddressLoading:R,depositAddressError:T,canContinue:N,continueBlockedHint:S,onContinue:M}){let P=f.length>1&&y;return Hn(ty,{children:[pr(Ou,{catalog:e,origin:t,onChangeOrigin:r,amount:n,onChangeAmount:o,showAmountInput:i,recipient:l,onChangeRecipient:c,showRecipientInput:u,recipientValid:h,balance:g,balanceLoading:d,insufficientBalance:w,onMax:s}),P&&Hn("div",{className:"rd-field",children:[pr("span",{className:"rd-field-label",children:"Deliver as"}),pr(ei,{ariaLabel:"Delivery token",value:m?.symbol??"",onChange:b,options:f.map(j=>({value:j.symbol,label:j.symbol,subLabel:"on ONEchain",icon:pr(Kr,{symbol:j.symbol,size:22})}))})]}),!P&&m&&Hn("div",{className:"rd-field",children:[pr("span",{className:"rd-field-label",children:"Deliver as"}),Hn("div",{className:"rd-static-target",children:[pr(Kr,{symbol:m.symbol,size:22}),pr("span",{children:m.symbol})]})]}),m?.external&&Hn("div",{className:"rd-callout rd-callout-muted",children:["Delivered as ",m.symbol," via an external adapter."]}),R&&Hn("p",{className:"rd-muted",children:[pr("span",{className:"rd-spinner"})," Fetching your deposit address..."]}),T&&Hn("div",{className:"rd-callout rd-callout-danger",children:["Couldn't fetch a deposit address: ",T.message]}),a&&pr(Ra,{minNotice:a}),S&&pr("div",{className:"rd-callout rd-callout-warning",children:S}),n.trim()&&pr(Pu,{quote:p,isLoading:x,error:v,humanAmount:n,originSymbol:t.token.symbol,destination:e.destination}),pr("div",{className:"rd-step-nav",children:pr("button",{type:"button",className:"rd-button-primary rd-button-block","data-track":"continue",disabled:!N,onClick:M,children:"Continue"})})]})}import{Fragment as oy,jsx as Ee,jsxs as Or}from"react/jsx-runtime";function ry(){return Ee("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:Ee("path",{d:"M19.14 12.94c.04-.31.06-.62.06-.94 0-.32-.02-.63-.06-.94l2.03-1.58a.5.5 0 0 0 .12-.64l-1.92-3.32a.5.5 0 0 0-.6-.22l-2.39.96a7.03 7.03 0 0 0-1.62-.94l-.36-2.54a.5.5 0 0 0-.5-.42h-3.84a.5.5 0 0 0-.5.42l-.36 2.54c-.59.24-1.13.56-1.62.94l-2.39-.96a.5.5 0 0 0-.6.22L2.71 8.84a.5.5 0 0 0 .12.64l2.03 1.58c-.04.31-.06.63-.06.94 0 .32.02.63.06.94l-2.03 1.58a.5.5 0 0 0-.12.64l1.92 3.32c.14.24.42.32.6.22l2.39-.96c.49.38 1.03.7 1.62.94l.36 2.54c.05.24.26.42.5.42h3.84c.24 0 .45-.18.5-.42l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.24.1.5 0 .6-.22l1.92-3.32a.5.5 0 0 0-.12-.64zM12 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7",fill:"currentColor"})})}function ju({className:e}){let t=Qo();return Ee(pe,{feature:"relay",children:Ee(yo,{ariaTitle:"Deposit",className:e??t.className,children:Ee(ny,{})})})}function ny(){let e=Qo(),{theme:t,isMobile:r,setOpen:n}=zr(),o=pu(),i=Uu.useCallback(Ge=>{if(!r)return;let Fe=Ge.target;Fe instanceof HTMLElement&&(Fe.tagName!=="INPUT"&&Fe.tagName!=="TEXTAREA"||window.setTimeout(()=>{Fe.scrollIntoView({block:"center",behavior:"smooth"})},250))},[r]);if(!o)return null;let{step:a,goToSource:s,goToExecute:l,recoveryOpen:c,setRecoveryOpen:u,resolvedApiBaseUrl:h,wallet:g,catalog:d,catalogLoading:w,catalogError:f,origin:m,setOrigin:b,amount:y,setAmount:p,recipient:x,setRecipient:v,recipientValid:R,balance:T,balanceLoading:N,insufficientBalance:S,depositAddress:M,depositAddressLoading:P,depositAddressError:j,quote:L,quoteLoading:K,quoteError:D,canDeposit:O,deposit:oe,depositState:G,detectedDeposit:W,targetOptions:le,selectedTarget:Z,setSelectedTarget:V,showAmountInput:U,minNotice:te,showRecipientInput:J,showTargetSelector:fe,showOneClick:ce,showConnectPrompt:$,showRecipientHint:be,canRecover:Ae,recoverableCount:de,recoveryTargets:Te,recoveryOrders:ae,refreshRecovery:We,trustedFactories:Ze,canContinue:Le,continueBlockedHint:De,amountSmallestUnits:Se,onMax:tt}=o;return Or("div",{className:"rd-root rd-wizard","data-theme":t,"data-rd-step":a,onFocusCapture:i,children:[Or("div",{className:"rd-wizard-header",children:[a==="execute"&&Ee("button",{type:"button",className:"rd-back-arrow","aria-label":"Back","data-track":"back",disabled:G.isSubmitting||G.isConfirming,onClick:s,children:Ee("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:Ee("path",{d:"M15 18l-6-6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),Or("div",{className:"rd-wizard-actions",children:[Ae&&Or("button",{type:"button",className:"rd-icon-button","aria-label":"Recovery settings","aria-expanded":c,"data-track":"recovery_toggle",onClick:()=>u(Ge=>!Ge),children:[Ee(ry,{}),de>0&&Ee("span",{className:"rd-recovery-badge","data-testid":"recovery-badge",children:de})]}),!r&&Ee("button",{type:"button",className:"rd-icon-button","aria-label":"Close","data-track":"close",onClick:()=>n(!1),children:Ee("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:Ee("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),Ae&&c&&Ee(xa,{client:e.client,apiBaseUrl:h,recipient:x,target:Z?.symbol,wallet:g,trustedFactories:Ze,targets:Te.length>0?Te:void 0,orders:ae,onRecovered:We,onError:e.onError}),w&&Or("div",{className:"rd-skeleton-form","data-testid":"rd-source-skeleton","aria-hidden":"true",children:[Ee("span",{className:"rd-skeleton rd-skeleton-line"}),Ee("span",{className:"rd-skeleton rd-skeleton-field"}),Ee("span",{className:"rd-skeleton rd-skeleton-line"}),Ee("span",{className:"rd-skeleton rd-skeleton-field"}),Ee("span",{className:"rd-skeleton rd-skeleton-notice"}),Ee("span",{className:"rd-skeleton rd-skeleton-cta"})]}),f&&Or("div",{className:"rd-callout rd-callout-danger",children:["Failed to load configuration: ",f.message]}),$&&Or("section",{className:"rd-card","data-rd-connect-prompt":"",children:[Ee("p",{className:"rd-card-hint",children:J?"Connect a wallet or provide a recipient address to get a deposit address.":"Connect a wallet to get your deposit address."}),e.onRequestConnect&&Ee("button",{type:"button",className:"rd-button-primary rd-button-block","data-track":"connect",onClick:e.onRequestConnect,children:"Connect Wallet"})]}),be&&Ee("div",{className:"rd-callout rd-callout-muted",children:J?"Connect a wallet or provide a recipient address to fetch your deposit address.":"Connect a wallet to fetch your deposit address."}),d&&m&&a==="source"&&Ee(Fu,{catalog:d,origin:m,onChangeOrigin:b,amount:y,onChangeAmount:p,showAmountInput:U,minNotice:U?void 0:te,onMax:tt,recipient:x,onChangeRecipient:v,showRecipientInput:J,recipientValid:R,balance:T,balanceLoading:N,insufficientBalance:S,targetOptions:le,selectedTarget:Z,onChangeTarget:V,showTargetSelector:fe,quote:L,quoteLoading:K,quoteError:D,depositAddressLoading:P,depositAddressError:j,canContinue:Le,continueBlockedHint:De,onContinue:l}),d&&m&&a==="execute"&&M&&Ee(Au,{depositAddress:M,origin:m,minNotice:U?void 0:te,amountSmallestUnits:Se,depositState:G,onDeposit:()=>{oe()},canDeposit:O&&ce,oneClickEnabled:ce,quote:L,humanAmount:y,destination:d?.destination,detectedDeposit:W,onClose:()=>n(!1),recipient:R?x:void 0,delivered:Z?{symbol:Z.symbol,decimals:Z.decimals}:d?{symbol:d.destination.symbol,decimals:d.destination.decimals}:void 0}),a==="execute"&&!M&&Or(oy,{children:[P&&Or("div",{className:"rd-skeleton-address","data-testid":"rd-address-skeleton","aria-hidden":"true",children:[Ee("span",{className:"rd-skeleton rd-skeleton-qr"}),Ee("span",{className:"rd-skeleton rd-skeleton-chip"}),Ee("span",{className:"rd-skeleton rd-skeleton-line"})]}),j&&Or("div",{className:"rd-callout rd-callout-danger",children:["Couldn't fetch a deposit address: ",j.message]}),Ee("div",{className:"rd-step-nav",children:Ee("button",{type:"button",className:"rd-button-secondary rd-button-block","data-track":"back",onClick:s,children:"Back"})})]}),Or("p",{className:"rd-footer-note",children:["Final asset is always ",Z?.symbol??d?.destination.symbol??"ONEUSD"," on ONEchain. This is a reusable deposit address -- it accepts any number of deposits over time",U?", with or without an amount entered here":"","."]})]})}import{jsx as Ys}from"react/jsx-runtime";function Wu({asChild:e,children:t}){return Ys(pe,{feature:"relay",children:Ys(wo,{asChild:e??t!=null,children:t??Ys("button",{type:"button","data-track":"open",children:"Deposit"})})})}import*as he from"react";import{useCallback as ti,useEffect as Cn,useMemo as qs,useRef as Ks,useState as Ve}from"react";import{useEffect as iy,useState as ay}from"react";function _u(e,t){let[r,n]=ay(e);return iy(()=>{let o=setTimeout(()=>n(e),t);return()=>clearTimeout(o)},[e,t]),r}var sy=500,Hu=56,Gu={chainId:Hu,token:"0x55d398326f99059fF775485246999027B3197955"},Qu=3e4,ly=5e3;function cy(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?Qu:Math.max(ly,e*1e3)}var dy=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];function Zs(e,t){let r=e.trim();if(!r)return null;try{let n=ma(r,t);return n>0n?n:null}catch{return null}}function Vu(e={}){let t=Ks(e);t.current=e;let r=qs(()=>{if(e.client)return e.client;if(!e.apiBaseUrl)throw new Error("useDepositAddress: either `client` or `apiBaseUrl` must be provided");return nr({baseUrl:e.apiBaseUrl})},[e.client,e.apiBaseUrl]),n=e.wallet,o=n?.walletAddress,i=!!o,a=n?.walletChainId,[s,l]=Ve(),[c,u]=Ve(!0),[h,g]=Ve();Cn(()=>{let A=!1;return u(!0),r.getConfig().then(E=>{A||(l(E),g(void 0))}).catch(E=>{A||g(E instanceof Error?E:new Error(String(E)))}).finally(()=>{A||u(!1)}),()=>{A=!0}},[r]);let d=e.chains,w=qs(()=>{if(!s)return[];if(!d||d.length===0)return s.origins;let A=new Set(d);return s.origins.filter(E=>A.has(E.chainId))},[s,d]),f=qs(()=>s?{...s,origins:w}:void 0,[s,w]),[m,b]=Ve();Cn(()=>{if(m||w.length===0)return;let A=t.current.defaultToken,E=A?w.find(B=>B.chainId===A.chainId&&B.token.address.toLowerCase()===A.address.toLowerCase()):void 0;b(E??w[0])},[w,m]);let[y,p]=Ve(),x=ti(()=>{He(void 0),qe(!1),Pt(!1),z(!1),Lt(void 0)},[]),v=ti(A=>{b(A),p(void 0),x()},[x]),R=m?.kind==="svm",[T,N]=Ve(""),S=e.amount!==void 0?e.amount:T,M=ti(A=>{N(A),p(void 0),x()},[x]),P=_u(S,sy),j=m?Zs(P,m.token.decimals):null,L=m?Zs(S,m.token.decimals):null,[K,D]=Ve(""),[O,oe]=Ve(!1),G=e.recipient!==void 0?e.recipient:K,W=ti(A=>{D(A),oe(!0),p(void 0),x()},[x]);Cn(()=>{e.recipient===void 0&&o&&!O&&D(o)},[o,O,e.recipient]);let le=G.length===0||xt(G),Z=G.length>0&&xt(G)?G:void 0,[V,U]=Ve(),[te,J]=Ve(!1),[fe,ce]=Ve(0),$=n?.getBalance;Cn(()=>{if(!$||!o||!m||R){U(void 0),J(!1);return}let A=!1;J(!0);let E=m.token.address.toLowerCase()===Vo?void 0:m.token.address;return $({chainId:m.chainId,address:o,token:E}).then(B=>{A||U({...B,formatted:et(B.value,B.decimals)})}).catch(()=>{A||U(void 0)}).finally(()=>{A||J(!1)}),()=>{A=!0}},[$,o,m,R,fe]);let be=V?.value??null,Ae=!R&&L!==null&&be!==null&&L>be,[de,Te]=Ve(),[ae,We]=Ve(!1),[Ze,Le]=Ve(),De=m?.chainId,Se=m?.token.address,tt=e.target;Cn(()=>{if(!Z||!De||!Se){Te(void 0),Le(void 0),We(!1);return}let A=!1;return Te(void 0),Le(void 0),We(!0),(tt?r.getDepositAddress({user:Z,originChainId:De,originCurrency:Se},tt):r.getDepositAddress({user:Z,originChainId:De,originCurrency:Se})).then(B=>{A||(Te(B),Le(void 0),t.current.onDepositAddress?.(B))}).catch(B=>{if(A)return;Te(void 0);let se=B instanceof Error?B:new Error(String(B));Le(se),t.current.onError?.(se)}).finally(()=>{A||We(!1)}),()=>{A=!0}},[r,Z,De,Se,tt]);let Ge=[De??"",(Se??"").toLowerCase(),(Z??"").toLowerCase(),tt??"",S.trim()].join("|"),Fe=Ks(Ge);Cn(()=>{Fe.current!==Ge&&(Fe.current=Ge,p(void 0),x())},[Ge,x]);let[wt,lt]=Ve(),[kt,Pe]=Ve(!1),[Rt,ct]=Ve(),dt=j?.toString();Cn(()=>{if(!De||!Se||!dt){lt(void 0),ct(void 0),Pe(!1);return}let A=!1,E,B=!0;async function se(){B&&Pe(!0);let Ie=Qu;try{let ut=await r.getQuote({originChainId:De,originCurrency:Se,amount:dt});if(A)return;lt(ut),ct(void 0),Ie=cy(ut.ttl)}catch(ut){if(A)return;lt(void 0),ct(ut instanceof Error?ut:new Error(String(ut)))}finally{A||Pe(!1),B=!1}A||(E=setTimeout(se,Ie))}return se(),()=>{A=!0,E&&clearTimeout(E)}},[r,De,Se,dt]);let[Ht,St]=Ve(!1),[Be,Xe]=Ve(!1),[Oe,He]=Ve(),[Ye,Lt]=Ve(),[Dt,qe]=Ve(!1),[Ct,Pt]=Ve(!1),[Qt,z]=Ve(!1),ne=n?.waitForReceipt,Ue=Ks(void 0);Cn(()=>{if(!Oe||!m||!ne)return;let A=!1;return qe(!0),Pt(!1),z(!1),ne({chainId:m.chainId,hash:Oe}).then(E=>{A||(Pt(!0),z(E.status==="reverted"),ce(B=>B+1),E.status!=="reverted"&&Oe!==Ue.current&&(Ue.current=Oe,t.current.onDeposited?.(Oe)))}).catch(E=>{A||Lt(E instanceof Error?E.message:String(E))}).finally(()=>{A||qe(!1)}),()=>{A=!0}},[Oe,ne]);let pt=a!==void 0&&m!==void 0&&a!==m.chainId,Je=Ht||Be,Bt=y??Ye,zt="idle";Bt?zt="error":Ct?zt="confirmed":Dt?zt="confirming":Je&&(zt=Ht?"switching":"pending");let jr={phase:zt,isSubmitting:Je,isConfirming:Dt,isConfirmed:Ct,needsSwitch:pt,txHash:Oe,reverted:Ct&&Qt,error:Bt},cn=!!(m&&de&&de.originChainId===m.chainId&&de.originCurrency.toLowerCase()===m.token.address.toLowerCase()),ir=!!(n?.sendTransaction&&n?.writeContract&&n?.readContract&&n?.waitForReceipt),dn=!!(i&&ir&&m&&!R&&de&&cn&&L&&L>0n&&!Ae&&!Je&&!Dt),Tn=ti(async()=>{if(R||!m||!de||!n?.sendTransaction||!n?.writeContract)return;p(void 0);let A=Zs(S,m.token.decimals);if(!A||A<=0n){p("enter an amount to use the one-click deposit");return}let E=m.token.address.toLowerCase()===Vo,B=de.depositAddress,se=await mu(n?.readContract,Hu,{forwarder:de.forwarder,recipient:Z,version:de.version,trusted:t.current.trustedFactories});if(!se.ok){p(`address verification failed: ${se.reason}`);return}if(m.chainId===Gu.chainId&&m.token.address.toLowerCase()===Gu.token.toLowerCase()&&!gu(B,de.forwarder)){p("address verification failed: deposit address does not match the verified forwarder (expected them to be identical on this route; check the backend's direct_same_token setting)");return}try{if(pt){if(!n?.switchChain)throw new Error("wallet cannot switch chains");St(!0);try{await n.switchChain(m.chainId)}finally{St(!1)}}x(),Xe(!0);try{let ut=E?await n.sendTransaction({chainId:m.chainId,to:B,value:A}):await n.writeContract({chainId:m.chainId,address:m.token.address,abi:dy,functionName:"transfer",args:[B,A]});He(ut)}finally{Xe(!1)}}catch(ut){p(ut.message)}},[R,m,de,S,pt,n,Z,x]);return{address:o,isConnected:i,catalog:f,catalogLoading:c,catalogError:h,origin:m,setOrigin:v,recipient:G,setRecipient:W,recipientValid:le,amount:S,setAmount:M,balance:V,balanceLoading:te,insufficientBalance:Ae,isSvmOrigin:R,depositAddress:de?.depositAddress,depositAddressResult:de,depositAddressLoading:ae,depositAddressError:Ze,quote:wt,quoteLoading:kt,quoteError:Rt,canDeposit:dn,deposit:Tn,depositState:jr}}import{useEffect as py,useRef as uy,useState as Sa}from"react";var fy=3e4,my=300;function Qn(e){let t=uy(e);t.current=e;let{client:r,enabled:n=!0}=e,o=e.recipient&&xt(e.recipient)?e.recipient:void 0,[i,a]=Sa([]),[s,l]=Sa(!1),[c,u]=Sa(),[h,g]=Sa(!1);return py(()=>{if(!o){a([]),u(void 0),l(!1),g(!1);return}if(!n){a([]),u(void 0),l(!1),g(!1);return}let d=!1,w=!0,f,m=0;async function b(){let v=++m;w&&l(!0);try{let R=await r.listOrders(o);if(d)return;v===m&&(a(R),u(void 0))}catch(R){if(d)return;let T=R instanceof Error?R:new Error(String(R));v===m&&(u(T),t.current.onError?.(T))}finally{d||(l(!1),g(!0)),w=!1}}function y(){f&&clearTimeout(f),f=setTimeout(()=>{f=void 0,d||b()},my)}b();let p;typeof EventSource<"u"&&(p=new EventSource(r.ordersStreamUrl(o)),p.addEventListener("orders-changed",y),p.onopen=()=>{y()});let x=setInterval(()=>{b()},fy);return()=>{d=!0,f&&clearTimeout(f),clearInterval(x),p?.close()}},[r,o,n]),{orders:i,ordersLoading:s,ordersError:c,ordersInitialized:h}}import{useMemo as gy,useState as hy}from"react";function Yu(e,t){if(t){let r=e.find(n=>n.symbol===t);if(r)return r}return e.find(r=>r.isDefault)??e[0]}function qu({catalogTargets:e,filter:t,defaultTarget:r}){let n=gy(()=>{if(!t||t.length===0)return e;let l=new Set(t);return e.filter(c=>l.has(c.symbol))},[e,t]),[o,i]=hy(()=>Yu(n,r)?.symbol),a=(o!==void 0?n.find(l=>l.symbol===o):void 0)??Yu(n,r);function s(l){n.some(c=>c.symbol===l)&&i(l)}return{options:n,selected:a,setSelected:s}}var by={dev:"https://dev-relay-protocol-api.onechain.nexus",stage:"https://dev-relay-protocol-api.onechain.nexus",production:"https://relay-protocol-api.onechain.nexus"};function Nn(e){return e.apiBaseUrl?e.apiBaseUrl:by[Qe(e.environment)]}import{jsx as xy,jsxs as vy}from"react/jsx-runtime";function wy(e,t,r,n,o){return{client:e.client,apiBaseUrl:n,wallet:r,chains:e.chains,recipient:e.recipient,amount:e.amount,defaultToken:e.defaultToken,target:t,trustedFactories:o,onDepositAddress:e.onDepositAddress,onDeposited:e.onDeposited,onError:e.onError}}function Ca(e,t){let r=e.trim();if(!r)return 0n;try{let n=ma(r,t);return n>0n?n:0n}catch{return 0n}}function Ku({open:e,children:t}){let[r]=he.useState(du);return vy(Fs.Provider,{value:r,children:[e&&xy(yy,{store:r}),t]})}function yy({store:e}){let t=Qo(),{showTargetSelector:r=!0}=t,[n,o]=he.useState("source"),[i,a]=he.useState(!1);he.useEffect(()=>{Ce("relay","opened")},[]);let[s,l]=he.useState(void 0),c=he.useMemo(()=>Nn({apiBaseUrl:t.apiBaseUrl,environment:t.environment}),[t.apiBaseUrl,t.environment]),u=he.useMemo(()=>({walletAddress:t.walletAddress,walletChainId:t.walletChainId,sendTransaction:t.sendTransaction,writeContract:t.writeContract,readContract:t.readContract,switchChain:t.switchChain,waitForReceipt:t.waitForReceipt,getBalance:t.getBalance}),[t.walletAddress,t.walletChainId,t.sendTransaction,t.writeContract,t.readContract,t.switchChain,t.waitForReceipt,t.getBalance]),h=Qe(t.environment),g=Er("apps.json",h,E=>({min:ar(E?.relay?.minDepositAmount,h),max:ar(E?.relay?.maxDepositAmount,h),trustedFactories:ar(E?.relay?.trustedFactories,h)})),d=he.useMemo(()=>t.trustedFactories??ha(g?.trustedFactories),[t.trustedFactories,g?.trustedFactories]),{isConnected:w,catalog:f,catalogLoading:m,catalogError:b,origin:y,setOrigin:p,amount:x,setAmount:v,recipient:R,setRecipient:T,recipientValid:N,balance:S,balanceLoading:M,insufficientBalance:P,depositAddress:j,depositAddressResult:L,depositAddressLoading:K,depositAddressError:D,quote:O,quoteLoading:oe,quoteError:G,canDeposit:W,deposit:le,depositState:Z}=Vu(wy(t,s,u,c,d)),{options:V,selected:U,setSelected:te}=qu({catalogTargets:f?.targets??[],filter:t.targetTokens,defaultTarget:t.defaultTarget});he.useEffect(()=>{l(U?.symbol)},[U?.symbol]);let J=t.amount===void 0&&!t.hideAmount,fe=(t.showRecipientInput??!0)&&t.recipient===void 0,ce=N&&R.trim().length>0&&xt(R),$=t.recipient!==void 0&&t.recipient.trim().length>0,be=!w&&!$&&!ce,Ae=!!f&&!ce&&!be,de=(t.showRecovery??!1)&&w&&!!(u.writeContract&&u.readContract&&u.waitForReceipt),Te=he.useMemo(()=>t.client?t.client:nr({baseUrl:c}),[t.client,c]),[ae,We]=he.useState({}),[Ze,Le]=he.useState(0),De=he.useCallback(()=>Le(E=>E+1),[]),Se=Z.isConfirmed,{orders:tt}=Qn({client:Te,recipient:i&&ce?R:void 0,enabled:i&&ce}),Ge=n==="execute"&&ce,{orders:Fe,ordersLoading:wt,ordersError:lt,ordersInitialized:kt}=Qn({client:Te,recipient:Ge?R:void 0,enabled:Ge}),Pe=he.useRef(null),Rt=he.useRef(new Set),[ct,dt]=he.useState();he.useEffect(()=>{Ge||(Pe.current=null,Rt.current=new Set,dt(void 0))},[Ge]);let Ht=he.useRef(t.onDepositDetected);Ht.current=t.onDepositDetected,he.useEffect(()=>{if(!(!Ge||!kt||wt||lt)){if(Pe.current===null){Pe.current=new Set(Fe.map(E=>E.orderId));return}for(let E of Fe)if(!(Pe.current.has(E.orderId)||Rt.current.has(E.orderId))){Rt.current.add(E.orderId),dt(E.orderId),Ht.current?.(E);break}}},[Ge,Fe,wt,lt,kt]);let St=ct?Fe.find(E=>E.orderId===ct):void 0;he.useEffect(()=>{let E=f?.targets??[];if(!de||!ce||E.length===0){We({});return}let B=!1;return Promise.all(E.map(se=>Te.getRecovery({user:R,target:se.symbol}).catch(()=>{}))).then(se=>{if(B)return;let Ie={};E.forEach((ut,Ir)=>{let xo=se[Ir];xo&&(Ie[ut.symbol]=xo)}),We(Ie)}),()=>{B=!0}},[Te,de,ce,R,f,Se,Ze]);let Be=he.useMemo(()=>(f?.targets??[]).map(E=>({symbol:E.symbol,isDefault:E.isDefault,info:ae[E.symbol]})).filter(E=>E.info!==void 0),[f,ae]),Xe=he.useMemo(()=>ba(fo(Be)),[Be]),[Oe,He]=he.useState(void 0),Ye=!!f&&(f?.targets.length??0)>0&&!s;he.useEffect(()=>{if(!ce||!y||Ye){He(void 0);return}let E=!1;return Te.getRecovery({user:R,target:s||void 0}).then(B=>{if(E)return;if(!B||B.suggestedAction!=="sweep"){He(void 0);return}let se;try{se=BigInt(B.balance)}catch{He(void 0);return}let Ie=Number(B.decimals);if(se<=0n||!Number.isInteger(Ie)||Ie<0){He(void 0);return}let ut=B.tokens?.find(Ir=>Ir.address?.toLowerCase()===B.token?.toLowerCase()&&Ir.symbol)?.symbol;He({balance:se,decimals:Ie,symbol:ut})}).catch(()=>{E||He(void 0)}),()=>{E=!0}},[Te,ce,R,s,Ye,y,Se]);let Lt=he.useCallback(()=>{!y||!S||v(et(S.value,y.token.decimals))},[y,S,v]),Dt=he.useCallback(()=>{o("execute"),Ce("relay","deposit_address_shown")},[]),qe=he.useCallback(()=>{o("source"),Ce("relay","source_reopened")},[]),Ct=Z.txHash;he.useEffect(()=>{Ct&&Ce("relay","deposit_submitted")},[Ct]);let Pt=(()=>{let E=Number(g?.min);return Number.isFinite(E)&&E>=0?String(g?.min):"6"})(),Qt=(()=>{let E=Number(g?.max);return Number.isFinite(E)&&E>0?String(g?.max):void 0})(),z=(()=>{if(!y)return 0n;let E=Ca(Pt,y.token.decimals),B=BigInt(y.minAmount);return E>B?E:B})(),ne=y?et(z,y.token.decimals):Pt,Ue=(()=>{if(!y||!Oe||z<=0n)return;let E=y.token.decimals,B=Oe.decimals,se=E>=B?Oe.balance*10n**BigInt(E-B):Oe.balance/10n**BigInt(B-E);if(se>=z)return;let Ie=z-se;return{pending:et(Oe.balance,B),pendingSymbol:Oe.symbol,remaining:et(Ie,E)}})(),pt=y&&Qt?Ca(Qt,y.token.decimals):void 0,Je=y&&x.trim()?Ca(x,y.token.decimals):0n,Bt=!!(y&&Je>0n&&Je<z),zt=!!(y&&pt!==void 0&&Je>0n&&Je>pt),jr=(()=>{if(y){if(Bt)return`Amount is below the ${ne} ${y.token.symbol} minimum.`;if(zt)return`Amount is above the ${Qt} ${y.token.symbol} maximum.`}})(),cn=t.showOneClickDeposit??!1,ir=!!x.trim()&&(oe||!!G||!O),dn=!!L&&!K&&N&&!Bt&&!zt&&!ir,Tn=y&&x.trim()?Ca(x,y.token.decimals).toString():void 0,A={step:n,goToSource:qe,goToExecute:Dt,recoveryOpen:i,setRecoveryOpen:a,resolvedApiBaseUrl:c,wallet:u,catalog:f,catalogLoading:m,catalogError:b,origin:y,setOrigin:p,amount:x,setAmount:v,recipient:R,setRecipient:T,recipientValid:N,balance:S,balanceLoading:M,insufficientBalance:P,depositAddress:j,depositAddressLoading:K,depositAddressError:D,quote:O,quoteLoading:oe,quoteError:G,canDeposit:W,deposit:le,depositState:Z,detectedDeposit:St,targetOptions:V,selectedTarget:U,setSelectedTarget:te,showAmountInput:J,minNotice:y?{min:ne,symbol:y.token.symbol,...Ue}:void 0,showRecipientInput:fe,showTargetSelector:r,showOneClick:cn,showConnectPrompt:be,showRecipientHint:Ae,canRecover:de,recoverableCount:Xe,recoveryTargets:Be,recoveryOrders:tt,refreshRecovery:De,trustedFactories:d,canContinue:dn,continueBlockedHint:jr,amountSmallestUnits:Tn,onMax:J&&S&&S.value>0n?Lt:void 0};return he.useLayoutEffect(()=>{e.publish(A)}),he.useLayoutEffect(()=>()=>e.publish(null),[e]),null}import{jsx as Xs}from"react/jsx-runtime";function ky(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:c,children:u}=e,[h,g]=Na.useState(!1),d=l!==void 0,w=d?l:h,f=Na.useCallback(m=>{d||g(m),c?.(m)},[d,c]);return Xs(Os.Provider,{value:e,children:Xs(Ku,{open:w,children:Xs(bo,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:w,onOpenChange:f,children:u})})})}var Zu=Object.assign(ky,{Trigger:Wu,Content:ju});import{createContext as Ry,useContext as Sy}from"react";var Js=Ry(null);function $s(){let e=Sy(Js);if(!e)throw new Error("RelayHistory compound components must be used within <RelayHistory>");return e}import*as ur from"react";import{useState as Cy}from"react";import{Fragment as Ju,jsx as je,jsxs as _t}from"react/jsx-runtime";var ri=56;function Ny(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function Ty(e){return e==="COMPLETED"?"rd-status-pill rd-status-pill-success":Ny(e)?"rd-status-pill rd-status-pill-failure":"rd-status-pill"}function Ta(e,t){if(e){if(t===void 0)return e;try{return et(BigInt(e),t)}catch{return e}}}function Ia(e,t=6){let r=e.indexOf(".");if(r<0)return e;let n=e.slice(0,r+1+t).replace(/0+$/,"").replace(/\.$/,"");return n===""?"0":n}function Iy(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Xu(e){return e.length>14?`${e.slice(0,8)}...${e.slice(-4)}`:e}function My(e){let t=(e.deposits??[]).filter(n=>n.originChainId),r=new Set(t.map(n=>`${n.originChainId}:${(n.originCurrency??"").toLowerCase()}`));if(t.length>0){let n=t[0];return{chainId:n.originChainId,currency:n.originCurrency??"",routes:r.size}}return{chainId:e.originChainId,currency:e.originCurrency,routes:1}}function Ey(e,t){if(!e)return;let r,n;try{r=BigInt(e),n=t.map(s=>BigInt(s.amount))}catch{return}let o=n.reduce((s,l)=>s+l,0n);if(o<=0n)return;let i=n.map(s=>r*s/o),a=i.reduce((s,l)=>s+l,0n);return i[i.length-1]+=r-a,i}function Ma({label:e,chainId:t,txHash:r,amount:n,shared:o}){let i=r?wa(t,r):void 0;return _t("div",{className:"rd-history-step",children:[je("span",{className:`rd-history-step-dot${r?" rd-history-step-dot-done":""}`}),je("span",{className:"rd-history-step-label",children:e}),je("span",{className:"rd-history-step-chain",children:Ko(t)}),n&&je("span",{className:"rd-history-step-amount",children:n}),_t("span",{className:"rd-history-step-tx",children:[i?je("a",{href:i.url,target:"_blank",rel:"noreferrer",title:r,children:Xu(r)}):r?je("span",{title:r,children:Xu(r)}):je("span",{className:"rd-muted",children:"pending"}),o&&r&&je("span",{className:"rd-history-step-shared",children:"shared"})]})]})}function Ay(e){let t=e.deposits??[],r=e.amountOut||e.expectedOut||void 0;if(t.length>=2){let a=Ey(r,t);if(a)return t.map((s,l)=>({key:`${e.orderId}:${s.txHash}:${s.blockNumber}`,order:e,chainId:s.originChainId??ri,currency:s.originCurrency??"",routes:1,sentRaw:s.amount,receivedRaw:a[l].toString(),receivedIsEstimate:!0,deposit:s,sharedLegs:!0}))}let{chainId:n,currency:o,routes:i}=My(e);return[{key:e.orderId,order:e,chainId:n,currency:o,routes:i,sentRaw:e.amountIn,receivedRaw:r,receivedIsEstimate:!e.amountOut&&!!e.expectedOut,sharedLegs:!1}]}function $u({orders:e,isLoading:t,error:r,catalog:n,showTitle:o=!0}){let[i,a]=Cy({}),s=l=>a(c=>({...c,[l]:!c[l]}));return _t("section",{className:"rd-card",children:[o&&je("div",{className:"rd-card-header",children:je("h2",{className:"rd-card-title",children:"Transfer history"})}),t&&e.length===0&&_t("p",{className:"rd-muted",children:[je("span",{className:"rd-spinner"})," Loading orders..."]}),r&&_t("div",{className:"rd-callout rd-callout-danger",children:["Couldn't load your orders: ",r.message]}),!t&&!r&&e.length===0&&je("p",{className:"rd-muted",children:"No deposits yet. Once you send funds to the address above, an order will appear here automatically."}),e.length>0&&je("div",{className:"rd-history-table","data-vaul-no-drag":!0,children:e.flatMap(Ay).map(l=>{let{order:c}=l,u=n?.origins.find(x=>x.chainId===l.chainId&&x.token.address.toLowerCase()===l.currency.toLowerCase()),h=(c.target?n?.targets.find(x=>x.symbol.toLowerCase()===c.target.toLowerCase()):void 0)??n?.targets.find(x=>x.isDefault),g=h?.symbol??n?.destination.symbol??"",d=h?.decimals??n?.destination.decimals,w=n?.origins.find(x=>x.chainId===ri),f=Ta(l.sentRaw,w?.token.decimals),m=Ta(l.receivedRaw,d),b=c.deposits??[],y=!!i[l.key],p=Iy(c.completedAt??c.createdAt);return _t("div",{className:"rd-history-group",children:[_t("button",{type:"button",className:"rd-history-row-button",onClick:()=>s(l.key),"aria-expanded":y,"aria-label":`Toggle details for the transfer received on ${p}`,children:[_t("span",{className:"rd-history-card-top",children:[je("span",{className:"rd-history-asset",children:l.routes>1?_t(Ju,{children:["Multiple ",_t("span",{className:"rd-muted",children:["\xB7 ",l.routes," chains"]})]}):_t(Ju,{children:[u?.token.symbol??g," ",_t("span",{className:"rd-muted",children:["\xB7 ",Ko(l.chainId)]})]})}),je("span",{className:Ty(c.status),children:c.status})]}),_t("span",{className:"rd-history-card-amounts",children:[je("span",{className:"rd-history-num",title:f,children:f?Ia(f):"-"}),je("span",{className:"rd-history-card-arrow","aria-hidden":"true",children:"\u2192"}),je("span",{className:`rd-history-num rd-history-received${l.receivedIsEstimate?" rd-history-received-estimate":""}`,title:m,children:m?`${l.receivedIsEstimate?"~":"+"}${Ia(m)} ${g}`.trimEnd():"-"})]}),_t("span",{className:"rd-history-card-foot",children:[je("span",{className:"rd-history-date",children:p}),je("span",{className:"rd-history-chevron","aria-hidden":"true",children:y?"\u2303":"\u2304"})]})]}),y&&_t("div",{className:"rd-history-detail",children:[l.deposit?je(Ma,{label:"Deposit",chainId:l.deposit.originChainId??ri,txHash:l.deposit.originTxHash||l.deposit.txHash,amount:(()=>{let x=Ta(l.deposit.amount,w?.token.decimals);return x?Ia(x):void 0})()}):b.length>0?b.map(x=>je(Ma,{label:"Deposit",chainId:x.originChainId??ri,txHash:x.originTxHash||x.txHash,amount:(()=>{let v=Ta(x.amount,w?.token.decimals);return v?Ia(v):void 0})()},`${x.txHash}-${x.blockNumber}`)):_t("div",{className:"rd-history-step",children:[je("span",{className:"rd-history-step-dot"}),je("span",{className:"rd-history-step-label",children:"Deposit"}),je("span",{className:"rd-muted",children:"details not recorded for this transfer"})]}),je(Ma,{label:"Bridge",chainId:ri,txHash:c.bscBridgeTx,shared:l.sharedLegs}),je(Ma,{label:"Deliver",chainId:n?.destination.chainId??612055,txHash:c.deliveryTxHash,shared:l.sharedLegs})]})]},l.key)})})]})}import{jsx as Fr,jsxs as ef}from"react/jsx-runtime";function tf({className:e}){let t=$s(),{open:r}=zr();return ur.useEffect(()=>{r&&Ce("relay","history_opened")},[r]),Fr(pe,{feature:"relay",children:Fr(yo,{ariaTitle:"Transfer history",className:e??t.className,children:Fr(Ly,{})})})}function Ly(){let e=$s(),{theme:t,isMobile:r,setOpen:n}=zr(),o=ur.useMemo(()=>{if(e.client)return e.client;let y=Nn({apiBaseUrl:e.apiBaseUrl,environment:e.environment});return nr({baseUrl:y})},[e.client,e.apiBaseUrl,e.environment]),i=e.recipient??e.walletAddress,a=!!(i&&xt(i)),[s,l]=ur.useState(),[c,u]=ur.useState(!1),[h,g]=ur.useState(),d=ur.useRef(e.onError);d.current=e.onError,ur.useEffect(()=>{if(!a){l(void 0),u(!1),g(void 0);return}let y=!1;return l(void 0),u(!0),g(void 0),o.getConfig().then(p=>{y||l(p)}).catch(p=>{if(y)return;let x=p instanceof Error?p:new Error(String(p));g(x),d.current?.(x)}).finally(()=>{y||u(!1)}),()=>{y=!0}},[o,a]);let{orders:w,ordersLoading:f,ordersError:m}=Qn({client:o,recipient:a?i:void 0,enabled:!!s,onError:e.onError}),b=ur.useCallback(y=>{if(!e.onOutlink)return;let x=y.target.closest?.('a[target="_blank"]');x?.href&&e.onOutlink(x.href)},[e.onOutlink]);return ef("div",{className:"rd-root rd-wizard","data-theme":t,children:[ef("div",{className:"rd-wizard-header",children:[Fr("h2",{className:"rd-wizard-heading",children:"Transfer history"}),Fr("div",{className:"rd-wizard-actions",children:!r&&Fr("button",{type:"button",className:"rd-icon-button","aria-label":"Close","data-track":"close",onClick:()=>n(!1),children:Fr("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:Fr("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})})]}),a?Fr("div",{onClick:b,children:Fr($u,{orders:w,isLoading:c||f,error:h??m,catalog:s,showTitle:!1})}):Fr("p",{className:"rd-card rd-muted","data-testid":"rd-history-empty-state",children:"Connect a wallet or provide an address to see transfer history."})]})}import{jsx as el}from"react/jsx-runtime";function rf({asChild:e,children:t}){return el(pe,{feature:"relay",children:el(wo,{asChild:e??t!=null,children:t??el("button",{type:"button","data-track":"open",children:"History"})})})}import{jsx as nf}from"react/jsx-runtime";function Dy(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o="min(640px, calc(100vw - 32px))",drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:c,children:u}=e;return nf(Js.Provider,{value:e,children:nf(bo,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:c,children:u})})}var of=Object.assign(Dy,{Trigger:rf,Content:tf});import*as Cr from"react";import*as Ea from"react";function af({client:e,recipient:t,refreshKey:r=0}){let[n,o]=Ea.useState(0),i=t&&xt(t)?t:void 0;return Ea.useEffect(()=>{if(!i){o(0);return}let a=!1;return(async()=>{try{let l=(await e.getConfig()).targets,c=l.length===0?[e.getRecovery({user:i})]:l.map(g=>e.getRecovery({user:i,target:g.symbol})),u=await Promise.all(c.map(g=>g.catch(()=>{})));if(a)return;let h=l.length===0?u[0]?[{symbol:"",isDefault:!0,info:u[0]}]:[]:l.flatMap((g,d)=>u[d]?[{symbol:g.symbol,isDefault:g.isDefault,info:u[d]}]:[]);o(ba(fo(h)))}catch{a||o(0)}})(),()=>{a=!0}},[e,i,r]),n}import{createContext as Py,useContext as By}from"react";var tl=Py(null);function sf(){let e=By(tl);if(!e)throw new Error("RelayRecovery compound components must be used within <RelayRecovery>");return e}function rl(){return sf().props}function lf(){return sf().recoverableCount}import*as Gt from"react";import{jsx as Ur,jsxs as cf}from"react/jsx-runtime";var Aa=[];function df({className:e}){let t=rl(),{open:r}=zr();return Gt.useEffect(()=>{r&&Ce("relay","recovery_opened")},[r]),Ur(pe,{feature:"relay",children:Ur(yo,{ariaTitle:"Recover stuck funds",className:e??t.className,children:Ur(zy,{})})})}function zy(){let e=rl(),{theme:t,isMobile:r,setOpen:n}=zr(),o=Gt.useMemo(()=>Nn({apiBaseUrl:e.apiBaseUrl,environment:e.environment}),[e.apiBaseUrl,e.environment]),i=Gt.useMemo(()=>e.client?e.client:nr({baseUrl:o}),[e.client,o]),a=Gt.useMemo(()=>({walletAddress:e.walletAddress,walletChainId:e.walletChainId,sendTransaction:e.sendTransaction,writeContract:e.writeContract,readContract:e.readContract,switchChain:e.switchChain,waitForReceipt:e.waitForReceipt,getBalance:e.getBalance}),[e.walletAddress,e.walletChainId,e.sendTransaction,e.writeContract,e.readContract,e.switchChain,e.waitForReceipt,e.getBalance]),s=e.recipient??e.walletAddress,l=!!(s&&xt(s)),c=Qe(e.environment),u=Er("apps.json",c,S=>ar(S?.relay?.trustedFactories,c)),h=Gt.useMemo(()=>e.trustedFactories??ha(u),[e.trustedFactories,u]),g=!!(e.writeContract&&e.readContract&&e.waitForReceipt),d=l&&g,[w,f]=Gt.useState(Aa),m=e.onError;Gt.useEffect(()=>{if(!d){f(Aa);return}let S=!1;return i.getConfig().then(M=>{S||f(M.targets.length>0?M.targets:Aa)}).catch(M=>{S||(f(Aa),m?.(M instanceof Error?M:new Error(String(M))))}),()=>{S=!0}},[i,d,m]);let[b,y]=Gt.useState({}),[p,x]=Gt.useState(0),v=Gt.useCallback(()=>x(S=>S+1),[]),R=l?s:void 0;Gt.useEffect(()=>{if(!d||!R||w.length===0){y({});return}let S=!1;return Promise.all(w.map(M=>i.getRecovery({user:R,target:M.symbol}).catch(()=>{}))).then(M=>{if(S)return;let P={};w.forEach((j,L)=>{let K=M[L];K&&(P[j.symbol]=K)}),y(P)}),()=>{S=!0}},[i,d,R,w,p]);let T=Gt.useMemo(()=>w.map(S=>({symbol:S.symbol,isDefault:S.isDefault,info:b[S.symbol]})).filter(S=>S.info!==void 0),[w,b]),{orders:N}=Qn({client:i,recipient:d?R:void 0,enabled:d});return cf("div",{className:"rd-root rd-wizard","data-theme":t,children:[cf("div",{className:"rd-wizard-header",children:[Ur("h2",{className:"rd-wizard-heading",children:"Recover stuck funds"}),Ur("div",{className:"rd-wizard-actions",children:!r&&Ur("button",{type:"button",className:"rd-icon-button","aria-label":"Close","data-track":"close",onClick:()=>n(!1),children:Ur("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:Ur("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})})]}),!l&&Ur("p",{className:"rd-muted","data-testid":"rd-recovery-connect-note",children:"Connect a wallet to check recoverable funds."}),l&&!g&&Ur("p",{className:"rd-muted","data-testid":"rd-recovery-unsupported-note",children:"This wallet can't sign recovery transactions."}),d&&Ur(xa,{client:e.client,apiBaseUrl:o,recipient:s,wallet:a,trustedFactories:h,targets:T.length>0?T:void 0,orders:N,onRecovered:v,showTitle:!1,onError:e.onError})]})}import{jsx as nl}from"react/jsx-runtime";function pf({asChild:e,children:t}){let r=lf();return nl(pe,{feature:"relay",children:nl(wo,{asChild:e??t!=null,dataAttributes:{"data-rd-recovery-count":r},children:t??nl("button",{type:"button","data-track":"open",children:"Recover"})})})}import{jsx as uf}from"react/jsx-runtime";function Oy(e){let{theme:t="dark",mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:l,onOpenChange:c,children:u}=e,[h,g]=Cr.useState(!1),d=l!==void 0,w=d?l:h,f=Cr.useCallback(R=>{d||g(R),c?.(R)},[d,c]),m=Cr.useMemo(()=>{if(e.client)return e.client;let R=Nn({apiBaseUrl:e.apiBaseUrl,environment:e.environment});return nr({baseUrl:R})},[e.client,e.apiBaseUrl,e.environment]),[b,y]=Cr.useState(0),p=Cr.useRef(w);Cr.useEffect(()=>{p.current&&!w&&y(R=>R+1),p.current=w},[w]);let x=af({client:m,recipient:e.recipient??e.walletAddress,refreshKey:b}),v=Cr.useMemo(()=>({props:e,recoverableCount:x}),[e,x]);return uf(tl.Provider,{value:v,children:uf(bo,{theme:t,mobileBreakpoint:r,drawerDirection:n,dialogWidth:o,drawerMaxWidth:i,drawerMinWidth:a,style:s,open:w,onOpenChange:f,children:u})})}var ff=Object.assign(Oy,{Trigger:pf,Content:df});import{Fragment as _y,jsx as Nr,jsxs as Tr}from"react/jsx-runtime";var Fy={bscBridge:"https://bscscan.com/tx/",crossFinalize:"https://scan.crosstoken.io/tx/",crossExecute:"https://scan.crosstoken.io/tx/"},Uy={bscBridge:"Bridge tx (BSC)",crossFinalize:"Finalize tx (CROSS)",crossExecute:"Execute tx (CROSS)"};function jy(e){return e==="done"?"\u2713":e==="active"?"\u25CF":""}function mf(e){return e==="FAILED"||e==="REFUNDED"||e==="RELAY_REFUNDED"||e==="EXPIRED"}function Wy(e){return e==="done"?"rd-stepper-item rd-stepper-item-done":e==="active"?"rd-stepper-item rd-stepper-item-active":"rd-stepper-item rd-stepper-item-pending"}function gf({orderId:e,order:t,error:r}){let n=!t&&!r;return Tr("section",{className:"rd-card",children:[Tr("div",{className:"rd-card-header",children:[Nr("h2",{className:"rd-card-title",children:"4. Status"}),t&&Nr("span",{className:`rd-status-pill${t.status==="COMPLETED"?" rd-status-pill-success":mf(t.status)?" rd-status-pill-failure":""}`,children:t.status})]}),Tr("p",{className:"rd-card-hint",children:["Order ",e]}),n&&Tr("p",{className:"rd-muted",children:[Nr("span",{className:"rd-spinner"})," Loading status..."]}),r&&Tr("div",{className:"rd-callout rd-callout-danger",children:["Couldn't load order status: ",r.message]}),t&&Tr(_y,{children:[Nr("ol",{className:"rd-stepper",children:t.steps.map((o,i)=>Tr("li",{className:Wy(o.status),children:[Tr("div",{className:"rd-stepper-rail",children:[Nr("span",{className:"rd-stepper-dot",children:jy(o.status)}),i<t.steps.length-1&&Nr("span",{className:"rd-stepper-line"})]}),Tr("div",{className:"rd-stepper-body",children:[Nr("div",{className:"rd-stepper-label",children:o.label}),o.key==="bridge"&&t.txs.bscBridge&&Nr("div",{className:"rd-stepper-meta",children:Nr(ol,{orderTxs:t.txs,txKey:"bscBridge"})}),o.key==="deliver"&&(t.txs.crossFinalize||t.txs.crossExecute)&&Tr("div",{className:"rd-stepper-meta",children:[t.txs.crossFinalize&&Nr(ol,{orderTxs:t.txs,txKey:"crossFinalize"}),t.txs.crossExecute&&Nr(ol,{orderTxs:t.txs,txKey:"crossExecute"})]})]})]},o.key))}),mf(t.status)&&Tr("div",{className:"rd-callout rd-callout-danger",children:["This order did not complete successfully (status: ",t.status,"). If funds were deposited, refer to the refund address on the order for recovery."]}),t.status==="COMPLETED"&&Nr("div",{className:"rd-callout rd-callout-success",children:"crossd delivered. This order is complete."})]})]})}function ol({orderTxs:e,txKey:t}){let r=e[t];return r?Tr("a",{href:`${Fy[t]}${r}`,target:"_blank",rel:"noreferrer",children:[Uy[t],": ",r.slice(0,10),"..."]}):null}ja({mode:"dapp-ui"});export{ua as APPLE_ICON,El as AppLauncher,_l as AppLauncherContent,Bl as AppLauncherTrigger,da as BINANCE_ICON,$i as BridgeFlow,li as CHAINS_CONFIG_FILE,bi as CONNECTOR_REGISTRY,la as CROSSX_ICON,au as ConnectButton,qa as ConnectorId,lu as DEFAULT_SKILLS_HREF,_n as DEFAULT_TRUSTED_FACTORIES,ui as DappUiErrorBoundary,pa as GOOGLE_ICON,ca as METAMASK_ICON,Yi as PORTFOLIO_SECTIONS,sn as RelayApiError,Zu as RelayDeposit,of as RelayHistory,ff as RelayRecovery,zs as SOCIAL_REGISTRY,Li as SendFlow,cu as SkillsButton,gf as StatusTracker,as as TOKEN_STATS_QUERY_KEY,is as USER_BALANCE_QUERY_KEY,Ps as WALLET_REGISTRY,nu as WalletConnectModal,po as WalletInfo,Zd as WalletPortfolio,ao as WalletPortfolioBody,ja as announceAppLauncherUsage,pi as captureDappUiException,nr as createRelayClient,Wf as getChainDisplay,di as getDappUiSentryScope,No as initDappUiSentry,sr as normalizeFailureReason,Qe as resolveEnvironment,qn as setDappUiAnalyticsUser,fi as trackDappUiEvent,Ce as trackDappUiFunnel,So as useChainDisplay,_f as useChainsConfig,gi as useGlobalMenu,gn as useTokenBalance,hn as useTokenStats,ia as useWalletDetect};
|
|
24
26
|
//# sourceMappingURL=index.js.map
|