import{Box as ne,Button as Ki,Flex as Me,Select as Zi,Text as W,useDisclosure as $n,useToast as $i}from"@chakra-ui/react";import{useCallback as ue,useEffect as pt,useRef as Yi,useState as w}from"react";import{useConnection as Xi}from"@solana/wallet-adapter-react";import H from"axios";import{createContext as go,useMemo as ss}from"react";import{jsx as ps}from"react/jsx-runtime";var ls=go(void 0),X="production";var D=X==="development"?"https://qa-api-v2.bandit.network/sdk":"https://api-v2.bandit.network/sdk";var Pe=async(t,n,o)=>{try{return(await H.get(`${D}/collection/unstoppable/searchDomain?query=${n}&wallet_address=${o}`,{headers:{"X-API-KEY":t}})).data}catch(a){throw new Error(a)}},St=async(t,n)=>{try{return(await H.post(`${D}/collection/unstoppable/claim`,n,{headers:{"X-API-KEY":t}})).data}catch(o){throw o}},bt=async(t,n)=>{try{return(await H.post(`${D}/collection/unstoppable/lockDomain`,n,{headers:{"X-API-KEY":t}})).data}catch(o){throw o}},At=async(t,n,o,a)=>{try{return(await H.get(`${D}/collection/unstoppable/updatedPrice?domain=${n}&currency=${o}&wallet_address=${a}`,{headers:{"X-API-KEY":t}})).data}catch(i){throw i}},We=async(t,n)=>{try{return(await H.get(`${D}/collection/sns/searchDomain?=&query=${n}`,{headers:{"X-API-KEY":t}})).data}catch(o){throw new Error(o)}},Nt=async(t,n,o,a,i,s)=>{try{return(await H.post(`${D}/collection/sns/registerDomain`,{name:n,claimWallet:o,price:a,payUsing:i,space:s},{headers:{"X-API-KEY":t}})).data}catch(l){throw new Error(l)}},gt=async(t,n,o)=>{try{return(await H.post(`${D}/collection/sns/claimDomain`,{name:n,transactionHash:o},{headers:{"X-API-KEY":t}})).data}catch(a){throw new Error(a)}},Ue=async(t,n)=>{try{return(await H.get(`${D}/collection/ens/searchDomains?query=${n}.eth`,{headers:{"X-API-KEY":t}})).data}catch(o){throw new Error(o)}},It=async(t,n)=>{try{return(await H.post(`${D}/collection/ens/claimDomain`,n,{headers:{"X-API-KEY":t}})).data}catch(o){throw o}};var re=(t,n)=>t?t.length>n?t.substr(0,n-1)+"..."+t.substr(t.length-(n-1),t.length-1):t:"";var Ct=(t,n)=>{let o;return function(...a){o&&clearTimeout(o),o=setTimeout(()=>{t.apply(this,a)},n)}};import"react";import{Box as Io,Button as Co,Text as xo}from"@chakra-ui/react";import{jsx as xt,jsxs as Mo}from"react/jsx-runtime";var wo=({validators:t,fullWidth:n=!1,...o})=>{let a=t.find(m=>!m.should),i={...o,...a?.fallbackProps},{children:s,onClick:l,disabled:h,helperText:y,isLoading:S=!1}=i;return Mo(Io,{style:{textAlign:"center"},children:[xt(Co,{w:n?"full":"",variant:"primary",onClick:l,isDisabled:h,isLoading:S,loadingText:s,children:s}),y&&xt(xo,{color:"foreground",fontSize:"12px",textAlign:"center",mb:"10px",lineHeight:1,mt:2,children:y})]})},wt=wo;import"react";import{Box as Mt,Button as _o,Flex as He,Text as Se}from"@chakra-ui/react";import Oo from"@emotion/styled";import{jsx as ze,jsxs as z}from"react/jsx-runtime";var Ro=Oo(Se)`
  position: relative;
  width: fit-content;
  margin: 0 auto;

  &:after {
    content: '';
    border-top: 1px solid #2d3748;
    width: 100%;
    height: 1px;
    position: absolute;
    top: 50%;
    left: 0;
  }
`,vo=({selected:t,onSelect:n,onUnSelect:o,domain:a,currency:i})=>{let{name:s,availability:l,rate:h,discountedRate:y,discount:S}=a,{price:m,status:d}=l,{subTotal:{usdCents:u}}=m,f=c=>{c.stopPropagation(),o()},p=()=>{if(d==="NOT_AVAILABLE")return"Sold";if(t)return"Selected";if(!t)return"Select"},M=()=>{t?o():t||n()};return ze(Mt,{position:"relative",paddingY:2,mb:3,zIndex:"1",border:"1px solid #cccccc",borderRadius:10,flexDir:"row",children:z(He,{paddingX:3,align:"center",justify:"space-between",flexDir:"row",children:[ze(Se,{fontSize:14,children:s}),z(He,{align:"center",children:[d==="AVAILABLE"&&z(Mt,{mr:4,children:[z(Se,{textAlign:"center",fontSize:12,fontWeight:600,children:[y[i]??u/100," ",i," ",z("span",{style:{fontWeight:600},children:["($",y.USDT,")"]})]}),S>0&&z(He,{children:[z(Ro,{textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,children:[h[i]??u/100," ",i," ",z("span",{style:{fontWeight:400},children:["($",u/100,")"]})]}),z(Se,{ml:1,textAlign:"center",fontSize:10,fontWeight:500,lineHeight:1,color:"green",children:["(",S,"% off)"]})]})]}),ze(_o,{size:"sm",variant:"outline",bg:t?"input":"initial",minWidth:"20",onClick:M,isDisabled:d==="NOT_AVAILABLE",children:p()})]})]})})},_t=vo;import"react";import{Flex as ko,Text as Lo}from"@chakra-ui/react";import{Search2Icon as Bo}from"@chakra-ui/icons";import{jsx as Ot,jsxs as Po}from"react/jsx-runtime";var Do=()=>Po(ko,{marginY:8,direction:"column",align:"center",children:[Ot(Bo,{mb:3}),Ot(Lo,{fontSize:"md",fontWeight:500,width:"80%",textAlign:"center",margin:"0 auto",children:"Find your perfect domain by typing into the search field above."})]}),Rt=Do;import qi from"@emotion/styled";import{LAMPORTS_PER_SOL as Yn}from"@solana/web3.js";import{useWeb3React as ji}from"@web3-react/core";import te from"bignumber.js";import{useDispatch as Ji}from"react-redux";import{createSlice as Wo}from"@reduxjs/toolkit";var Uo={selectedCollectionId:null,showMint:!1,collectionViewOpen:!1,selectedSpaceId:!1},vt=Wo({name:"collection",initialState:Uo,reducers:{updateSelectedCollectionId(t,{payload:{id:n}}){t.selectedCollectionId=n},updateShowMint(t,{payload:{showMint:n}}){t.showMint=n},updateCollectionViewOpen(t,{payload:{collectionViewOpen:n}}){t.collectionViewOpen=n},updateSelectedSpaceId(t,{payload:{id:n}}){t.selectedSpaceId=n}}}),{updateSelectedCollectionId:kt,updateShowMint:Ws,updateCollectionViewOpen:Us,updateSelectedSpaceId:Hs}=vt.actions,zs=vt.reducer;var e={MAINNET:1,GOERLI:5,SHARDEUM20:8081,SHARDEUM_SPHINX:8082,BINANCE:56,BINANCE_TESTNET:97,SOLANA:9090,SOLANA_DEVNET:9091,POLYGON_MAINNET:137,POLYGON_MUMBAI:80001,STACKS_TESTNET:6061,STACKS_MAINNET:6060,BASE_MAINNET:8453,BASE_TESTNET:84531,CORE_MAINNET:1116,CORE_TESTNET:1115,TELOS_MAINNET:40,TELOS_TESTNET:41,OPTIMISM_MAINNET:10,OPTIMISM_GOERLI:420,ARBITRUM:42161,ARBITRUM_GOERLI:421613,AVALANCHE:43114,AVALANCHE_TESTNET:43113,ZORA_MAINNET:7777777,ZORA_GOERLI:999,MANTA:169,MANTA_TESTNET:3441005,ZETA:7e3,ZETA_TESTNET:7001,OMNI_TESTNET:165},Fs={[e.MAINNET]:"mainnet",[e.GOERLI]:"goerli",[e.BINANCE]:"binance smart chain",[e.BINANCE_TESTNET]:"binance smart chain - testnet",[e.SHARDEUM20]:"Shardeum Liberty 2.0",[e.SHARDEUM_SPHINX]:"Shardeum Sphinx",[e.BASE_MAINNET]:"base mainnet",[e.BASE_TESTNET]:"base goerli",[e.CORE_MAINNET]:"core mainnet",[e.CORE_TESTNET]:"core testnet",[e.TELOS_MAINNET]:"telos mainnet",[e.TELOS_TESTNET]:"telos testnet",[e.OPTIMISM_MAINNET]:"optimism mainnet",[e.OPTIMISM_GOERLI]:"optimism goerli",[e.ARBITRUM]:"arbitrum",[e.ARBITRUM_GOERLI]:"arbitrum goerli",[e.AVALANCHE]:"avalanche",[e.AVALANCHE_TESTNET]:"avalanche testnet",[e.ZORA_MAINNET]:"zora mainnet",[e.ZORA_GOERLI]:"zora goerli",[e.MANTA]:"manta",[e.MANTA_TESTNET]:"manta testnet",[e.ZETA]:"zeta",[e.ZETA_TESTNET]:"zeta testnet",[e.OMNI_TESTNET]:"omni testnet"},Vs={[e.MAINNET]:"eth",[e.GOERLI]:"goerli",[e.BINANCE]:"bsc",[e.BINANCE_TESTNET]:"bsc-testnet",[e.SOLANA]:"solana",[e.SOLANA_DEVNET]:"solana-devnet",[e.SHARDEUM20]:"Shardeum-Liberty-2.0",[e.POLYGON_MAINNET]:"polygon-mainnet",[e.POLYGON_MUMBAI]:"polygon-mumbai",[e.BASE_MAINNET]:"base-mainnet",[e.BASE_TESTNET]:"base-goerli",[e.CORE_MAINNET]:"core",[e.CORE_TESTNET]:"core-testnet",[e.TELOS_MAINNET]:"telos-mainnet",[e.TELOS_TESTNET]:"telos-testnet",[e.OPTIMISM_MAINNET]:"optimism-mainnet",[e.OPTIMISM_GOERLI]:"optimism-goerli",[e.ARBITRUM]:"arbitrum",[e.ARBITRUM_GOERLI]:"arbitrum-goerli",[e.AVALANCHE]:"avalanche",[e.AVALANCHE_TESTNET]:"avalanche-testnet",[e.ZORA_MAINNET]:"zora-mainnet",[e.ZORA_GOERLI]:"zora-goerli",[e.MANTA]:"manta",[e.MANTA_TESTNET]:"manta-testnet",[e.ZETA]:"zeta",[e.ZETA_TESTNET]:"zeta-testnet",[e.OMNI_TESTNET]:"omni-testnet"},T={[e.MAINNET]:"https://etherscan.io/",[e.GOERLI]:"https://goerli.etherscan.io/",[e.BINANCE]:"https://bscscan.com/",[e.BINANCE_TESTNET]:"https://testnet.bscscan.com/",[e.SOLANA]:"https://solscan.io/",[e.SOLANA_DEVNET]:"https://solscan.io/",[e.SHARDEUM20]:"https://explorer-dapps.shardeum.org/",[e.SHARDEUM_SPHINX]:"https://explorer-sphinx.shardeum.org/",[e.POLYGON_MAINNET]:"https://polygonscan.com/",[e.POLYGON_MUMBAI]:"https://mumbai.polygonscan.com/",[e.STACKS_TESTNET]:"https://explorer.stacks.co/",[e.STACKS_MAINNET]:"https://explorer.stacks.co/",[e.BASE_MAINNET]:"https://basescan.org/",[e.BASE_TESTNET]:"https://goerli.basescan.org/",[e.CORE_MAINNET]:"https://scan.coredao.org/",[e.CORE_TESTNET]:"https://scan.test.btcs.network/",[e.TELOS_MAINNET]:"https://teloscan.io/",[e.TELOS_TESTNET]:"https://testnet.teloscan.io/",[e.OPTIMISM_MAINNET]:"https://optimistic.etherscan.io/",[e.OPTIMISM_GOERLI]:"https://optimism-goerli.blockscout.com/",[e.ARBITRUM]:"https://arbiscan.io/",[e.ARBITRUM_GOERLI]:"https://goerli-rollup-explorer.arbitrum.io/",[e.AVALANCHE]:"https://snowtrace.io/",[e.AVALANCHE_TESTNET]:"https://testnet.snowtrace.io/",[e.ZORA_MAINNET]:"https://explorer.zora.energy/",[e.ZORA_GOERLI]:"https://testnet.explorer.zora.energy/",[e.MANTA]:"https://pacific-explorer.manta.network/",[e.MANTA_TESTNET]:"https://pacific-explorer.testnet.manta.network/",[e.ZETA]:"https://explorer.mainnet.zetachain.com/",[e.ZETA_TESTNET]:"https://athens3.explorer.zetachain.com/",[e.OMNI_TESTNET]:"https://testnet.explorer.omni.network/"},Lt={[e.MAINNET]:{explorer:T[e.MAINNET],label:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18}},[e.GOERLI]:{explorer:T[e.GOERLI],label:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"gETH",decimals:18}},[e.BINANCE]:{explorer:T[e.BINANCE],label:"BNB Smart Chain",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18}},[e.BINANCE_TESTNET]:{explorer:T[e.BINANCE_TESTNET],label:"BNB Smart Chain Testnet",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18}},[e.SHARDEUM20]:{explorer:T[e.SHARDEUM20],label:"Shardeum Sphinx DApp",nativeCurrency:{name:"SHM",symbol:"SHM",decimals:18}},[e.SHARDEUM_SPHINX]:{explorer:T[e.SHARDEUM_SPHINX],label:"Shardeum Sphinx",nativeCurrency:{name:"SHM",symbol:"SHM",decimals:18}},[e.POLYGON_MUMBAI]:{explorer:T[e.POLYGON_MUMBAI],label:"Mumbai",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18}},[e.POLYGON_MAINNET]:{explorer:T[e.POLYGON_MAINNET],label:"Polygon",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18}},[e.SOLANA_DEVNET]:{explorer:T[e.SOLANA_DEVNET],label:"Solana Devnet",nativeCurrency:{name:"SOL",symbol:"SOL",decimals:9}},[e.SOLANA]:{explorer:T[e.SOLANA],label:"Solana",nativeCurrency:{name:"SOL",symbol:"SOL",decimals:9}},[e.BASE_MAINNET]:{explorer:T[e.BASE_MAINNET],label:"Base",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.BASE_TESTNET]:{explorer:T[e.BASE_TESTNET],label:"Base Testnet",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.CORE_MAINNET]:{explorer:T[e.CORE_MAINNET],label:"Core",nativeCurrency:{name:"CORE",symbol:"CORE",decimals:18}},[e.CORE_TESTNET]:{explorer:T[e.CORE_TESTNET],label:"Core Testnet",nativeCurrency:{name:"CORE",symbol:"CORE",decimals:18}},[e.STACKS_MAINNET]:{explorer:T[e.STACKS_MAINNET],label:"Stacks",nativeCurrency:{name:"STACKS",symbol:"STACKS",decimals:18}},[e.STACKS_TESTNET]:{explorer:T[e.STACKS_MAINNET],label:"Stacks Testnet",nativeCurrency:{name:"STACKS",symbol:"STACKS",decimals:18}},[e.TELOS_MAINNET]:{explorer:T[e.TELOS_MAINNET],label:"Telos",nativeCurrency:{name:"TLOS",symbol:"TLOS",decimals:18}},[e.TELOS_TESTNET]:{explorer:T[e.TELOS_TESTNET],label:"Telos Testnet",nativeCurrency:{name:"TLOS",symbol:"TLOS",decimals:18}},[e.OPTIMISM_MAINNET]:{explorer:T[e.OPTIMISM_MAINNET],label:"Optimism",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.OPTIMISM_GOERLI]:{explorer:T[e.OPTIMISM_GOERLI],label:"Optimism Goerli",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.ARBITRUM]:{explorer:T[e.ARBITRUM],label:"Arbitrum",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.ARBITRUM_GOERLI]:{explorer:T[e.ARBITRUM_GOERLI],label:"Arbitrum Goerli",nativeCurrency:{name:"AGOR",symbol:"AGOR",decimals:18}},[e.AVALANCHE]:{explorer:T[e.AVALANCHE],label:"Avalanche",nativeCurrency:{name:"AVAX",symbol:"AVAX",decimals:18}},[e.AVALANCHE_TESTNET]:{explorer:T[e.AVALANCHE_TESTNET],label:"Avalanche Testnet",nativeCurrency:{name:"AVAX",symbol:"AVAX",decimals:18}},[e.ZORA_MAINNET]:{explorer:T[e.ZORA_MAINNET],label:"Zora",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.ZORA_GOERLI]:{explorer:T[e.ZORA_GOERLI],label:"Zora Testnet",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.MANTA]:{explorer:T[e.MANTA],label:"Manta",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.MANTA_TESTNET]:{explorer:T[e.MANTA_TESTNET],label:"Manta Testnet",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}},[e.ZETA]:{explorer:T[e.ZETA],label:"Zeta",nativeCurrency:{name:"ZETA",symbol:"ZETA",decimals:18}},[e.ZETA_TESTNET]:{explorer:T[e.ZETA_TESTNET],label:"Zeta Testnet",nativeCurrency:{name:"ZETA",symbol:"ZETA",decimals:18}},[e.OMNI_TESTNET]:{explorer:T[e.OMNI_TESTNET],label:"Omni Testnet",nativeCurrency:{name:"OMNI",symbol:"OMNI",decimals:18}}},Ks=Object.values(e).filter(t=>typeof t=="number"),Ho=[1,5,56,4,97,8081,8082,137,80001,8453,84531,1116,1115,40,41,10,420,42161,421613,43114,43113,7777777,999,3441005,7001,169,7e3,165],Bt=Ho;import{initializeConnector as Ge}from"@web3-react/core";import{MetaMask as zo}from"@web3-react/metamask";import{Network as Go}from"@web3-react/network";import{WalletConnect as Fo}from"@web3-react/walletconnect-v2";var Ys={[e.MAINNET]:"Ethereum",[e.GOERLI]:"Goerli",[e.BINANCE]:"BNB Smart Chain",[e.BINANCE_TESTNET]:"BNB Smart Chain Testnet",[e.SOLANA]:"Solana Mainnet",[e.SOLANA_DEVNET]:"Solana Devnet",[e.SHARDEUM20]:"Shardeum Sphinx DApp 1.X",[e.SHARDEUM_SPHINX]:"Shardeum Sphinx",[e.POLYGON_MUMBAI]:"Polygon Mumbai",[e.POLYGON_MAINNET]:"Polygon",[e.BASE_MAINNET]:"Base Mainnet",[e.BASE_TESTNET]:"Base Goerli",[e.CORE_MAINNET]:"Core Mainnet",[e.CORE_TESTNET]:"Core Testnet",[e.TELOS_MAINNET]:"Telos",[e.TELOS_TESTNET]:"Telos Testnet",[e.OPTIMISM_MAINNET]:"Optimism",[e.OPTIMISM_GOERLI]:"Optimism Goerli",[e.ARBITRUM]:"Arbitrum",[e.ARBITRUM_GOERLI]:"Arbitrum Goerli",[e.AVALANCHE]:"Avalanche",[e.AVALANCHE_TESTNET]:"Avalanche Testnet",[e.ZORA_MAINNET]:"Zora Mainnet",[e.ZORA_GOERLI]:"Zora Goerli",[e.MANTA]:"Manta",[e.MANTA_TESTNET]:"Manta Testnet",[e.ZETA]:"Zeta",[e.ZETA_TESTNET]:"ZetaChain Testnet",[e.OMNI_TESTNET]:"Omni Testnet"},Xs={[e.MAINNET]:{name:"Ethereum mainnet",api:"https://api.etherscan.io/api",key:"7GJC7W52P7BJ3ESQCBGG2YP3M597M69ZEC",explorer:"https://etherscan.io"},[e.GOERLI]:{name:"Goerli",api:"https://api-goerli.etherscan.io/api",key:"7GJC7W52P7BJ3ESQCBGG2YP3M597M69ZEC",explorer:"https://goerli.etherscan.io"},[e.BINANCE]:{name:"Binance smart chain mainnet",api:"https://api.bscscan.com/api",key:"3THBPRKH4RNSF4KF52JFAJZX92SHX2FUIV",explorer:"https://bscscan.com"},[e.BINANCE_TESTNET]:{name:"Binance smart chain testnet",api:"https://api-testnet.bscscan.com/api",key:"3THBPRKH4RNSF4KF52JFAJZX92SHX2FUIV",explorer:"https://testnet.bscscan.com"},[e.SHARDEUM20]:{name:"Shadreum liberty 2.0",api:"",key:"",explorer:"https://explorer-liberty20.shardeum.org/"},[e.SOLANA]:{name:"Solana",api:"",key:""},[e.SOLANA_DEVNET]:{name:"Solana devnet",api:"",key:""},[e.BASE_MAINNET]:{name:"Base mainnet",api:"",key:"",explorer:"https://basescan.org"},[e.BASE_TESTNET]:{name:"Base testnet",api:"",key:"",explorer:"https://goerli.basescan.org"},[e.CORE_MAINNET]:{name:"Core mainnet",api:"",key:"",explorer:"https://scan.coredao.org/"},[e.CORE_TESTNET]:{name:"Core testnet",api:"",key:"",explorer:"https://scan.test.btcs.network/"},[e.MANTA]:{name:"Manta",api:"",key:"",explorer:"https://pacific-explorer.manta.network"},[e.MANTA_TESTNET]:{name:"Manta testnet",api:"",key:"",explorer:"https://pacific-explorer.testnet.manta.network"},[e.ZETA]:{name:"ZetaChain mainnet",api:"",key:"",explorer:"https://explorer.mainnet.zetachain.com"},[e.MANTA_TESTNET]:{name:"ZetaChain testnet",api:"",key:"",explorer:"https://athens3.explorer.zetachain.com"}},ie={[e.MAINNET]:"https://attentive-dark-slug.quiknode.pro/3b2478b2d351ebcec1f782076ece31b2a6c94ce8",[e.GOERLI]:"https://goerli.infura.io/v3/82e1f883cd2d45608ba6022fa9432ff0",[e.SHARDEUM20]:"https://dapps.shardeum.org/",[e.SHARDEUM_SPHINX]:"https://sphinx.shardeum.org/",[e.BINANCE]:"https://cold-green-snowflake.bsc.quiknode.pro/df79c99750fe774f3e16a8baddd8788dd627597a",[e.BINANCE_TESTNET]:"https://data-seed-prebsc-1-s1.binance.org:8545",[e.POLYGON_MUMBAI]:"https://polygon-mumbai.infura.io/v3/3e34307cdece46d9a15cce3d2a7525a2",[e.POLYGON_MAINNET]:"https://hardworking-sleek-shadow.matic.quiknode.pro/36b5bd8dec912863be0fe401fad61fce7634fdb8",[e.BASE_MAINNET]:"https://mainnet.base.org",[e.BASE_TESTNET]:"https://goerli.base.org",[e.CORE_MAINNET]:"https://rpc.coredao.org/",[e.CORE_TESTNET]:"https://rpc.test.btcs.network/",[e.TELOS_MAINNET]:"https://mainnet.telos.net/evm",[e.TELOS_TESTNET]:"https://testnet.telos.net/evm",[e.OPTIMISM_GOERLI]:"https://goerli.optimism.io",[e.OPTIMISM_MAINNET]:"https://optimism.meowrpc.com",[e.ARBITRUM]:"https://arb1.arbitrum.io/rpc",[e.ARBITRUM_GOERLI]:"https://endpoints.omniatech.io/v1/arbitrum/goerli/public",[e.AVALANCHE]:"https://api.avax.network/ext/bc/C/rpc",[e.AVALANCHE_TESTNET]:"https://api.avax-test.network/ext/bc/C/rpc",[e.ZORA_MAINNET]:"https://rpc.zora.energy",[e.ZORA_GOERLI]:"https://testnet.rpc.zora.energy",[e.MANTA]:"https://pacific-rpc.manta.network/http",[e.MANTA_TESTNET]:"https://manta-testnet.calderachain.xyz/http",[e.ZETA]:"https://api.mainnet.zetachain.com/evm",[e.ZETA_TESTNET]:"https://zetachain-athens-evm.blockpi.network/v1/rpc/public",[e.OMNI_TESTNET]:"https://testnet.omni.network"},Dt={[e.MAINNET]:"https://mainnet.infura.io/v3/3e34307cdece46d9a15cce3d2a7525a2",[e.GOERLI]:"https://goerli.infura.io/v3/82e1f883cd2d45608ba6022fa9432ff0",[e.BINANCE]:"https://bsc-dataseed.binance.org",[e.SHARDEUM_SPHINX]:"https://sphinx.shardeum.org/",[e.SHARDEUM20]:"https://dapps.shardeum.org/",[e.BINANCE_TESTNET]:"https://data-seed-prebsc-1-s1.binance.org:8545",[e.POLYGON_MUMBAI]:"https://endpoints.omniatech.io/v1/matic/mumbai/public",[e.POLYGON_MAINNET]:"https://polygon.llamarpc.com",[e.BASE_MAINNET]:"https://mainnet.base.org",[e.BASE_TESTNET]:"https://goerli.base.org",[e.TELOS_MAINNET]:"https://mainnet.telos.net/evm",[e.TELOS_TESTNET]:"https://testnet.telos.net/evm",[e.OPTIMISM_GOERLI]:"https://goerli.optimism.io",[e.OPTIMISM_MAINNET]:"https://optimism.meowrpc.com",[e.ARBITRUM]:"https://arb1.arbitrum.io/rpc",[e.ARBITRUM_GOERLI]:"https://endpoints.omniatech.io/v1/arbitrum/goerli/public",[e.AVALANCHE]:"https://api.avax.network/ext/bc/C/rpc",[e.AVALANCHE_TESTNET]:"https://api.avax-test.network/ext/bc/C/rpc",[e.ZORA_MAINNET]:"https://rpc.zora.energy",[e.ZORA_GOERLI]:"https://testnet.rpc.zora.energy",[e.MANTA]:"https://pacific-rpc.manta.network/http",[e.MANTA_TESTNET]:"https://manta-testnet.calderachain.xyz/http",[e.ZETA]:"https://api.mainnet.zetachain.com/evm",[e.ZETA_TESTNET]:"https://zetachain-athens-evm.blockpi.network/v1/rpc/public",[e.OMNI_TESTNET]:"https://testnet.omni.network"},Pt={[e.MAINNET]:["https://api.mycryptoapi.com/eth","https://cloudflare-eth.com","https://rpc.ankr.com/eth","https://eth-mainnet.public.blastapi.io"],[e.GOERLI]:["https://rpc.goerli.mudit.blog/","https://rpc.ankr.com/eth_goerli"]},qs={[e.MAINNET]:encodeURIComponent("ethereum"),[e.GOERLI]:encodeURIComponent("goerli"),[e.BINANCE]:encodeURIComponent("binance"),[e.BINANCE_TESTNET]:encodeURIComponent("binance testnet"),[e.SOLANA]:encodeURIComponent("solana"),[e.SOLANA_DEVNET]:encodeURIComponent("solana_devnet"),[e.SHARDEUM20]:encodeURIComponent("shardeum 2.0"),[e.POLYGON_MAINNET]:encodeURIComponent("polygon"),[e.POLYGON_MUMBAI]:encodeURIComponent("polygon-mumbai"),[e.STACKS_MAINNET]:encodeURIComponent("stacks"),[e.STACKS_TESTNET]:encodeURIComponent("stacks testnet"),[e.BASE_MAINNET]:encodeURIComponent("base mainnet"),[e.BASE_TESTNET]:encodeURIComponent("base testnet"),[e.CORE_MAINNET]:encodeURIComponent("core mainnet"),[e.CORE_TESTNET]:encodeURIComponent("core testnet"),[e.MANTA]:encodeURIComponent("manta"),[e.MANTA_TESTNET]:encodeURIComponent("manta testnet"),[e.ZETA]:encodeURIComponent("zeta"),[e.ZETA_TESTNET]:encodeURIComponent("zeta testnet")},js={[e.MAINNET]:"ETHEREUM",[e.GOERLI]:"GOERLI",[e.BINANCE]:"BSC",[e.BINANCE_TESTNET]:"BSC_TESTNET",[e.SOLANA]:"SOLANA",[e.SOLANA_DEVNET]:"SOLANA_DEVNET",[e.SHARDEUM20]:"SHARDEUM",[e.SHARDEUM_SPHINX]:"SHARDEUM_SPHINX_1.X",[e.POLYGON_MAINNET]:"POLYGON",[e.POLYGON_MUMBAI]:"POLYGON_MUMBAI",[e.STACKS_MAINNET]:"STACKS",[e.STACKS_TESTNET]:"STACKS_TESTNET",[e.BASE_MAINNET]:"BASE_MAINNET",[e.BASE_TESTNET]:"BASE_GOERLI",[e.CORE_MAINNET]:"CORE",[e.CORE_TESTNET]:"CORE_TESTNET",[e.TELOS_MAINNET]:"TELOS_MAINNET",[e.TELOS_TESTNET]:"TELOS_TESTNET",[e.OPTIMISM_MAINNET]:"OPTIMISM",[e.OPTIMISM_GOERLI]:"OPTIMISM_GOERLI",[e.ARBITRUM]:"ARBITRUM",[e.ARBITRUM_GOERLI]:"ARBITRUM_GOERLI",[e.AVALANCHE]:"AVALANCHE",[e.AVALANCHE_TESTNET]:"AVALANCHE_TESTNET",[e.ZORA_GOERLI]:"ZORA_GOERLI",[e.ZORA_MAINNET]:"ZORA",[e.MANTA]:"MANTA",[e.MANTA_TESTNET]:"MANTA_TESTNET",[e.ZETA]:"ZETA",[e.ZETA_TESTNET]:"ZETA_TESTNET",[e.OMNI_TESTNET]:"OMNI_TESTNET"};var Fe={INJECTED:"INJECTED",WALLET_CONNECT:"WALLET_CONNECT",NETWORK:"NETWORK"};function Wt(t){console.debug(`web3-react error: ${t}`)}function Vo(t){Wt(t)}var[Ko,Zo]=Ge(t=>new Go({actions:t,urlMap:ie,defaultChainId:1})),Ut={connector:Ko,hooks:Zo,type:Fe.NETWORK},[$o,Yo]=Ge(t=>new zo({actions:t,onError:Vo})),al={connector:$o,hooks:Yo,type:Fe.INJECTED},[Xo,qo]=Ge(t=>{let n=Object.entries(ie).reduce((o,[a,i])=>({...o,[a]:i[0]}),{});return new Fo({actions:t,options:{projectId:"600da6aac724cb2c05d52087cb405879",chains:[1],optionalChains:[5,137,80001,56,97,8081],showQrModal:!0,qrModalOptions:{themeVariables:{"--wcm-z-index":"2147483647"}}},onError:Wt})}),Ht={connector:Xo,hooks:qo,type:Fe.WALLET_CONNECT};function jo(t){switch(t){case e.MAINNET:case e.GOERLI:case e.BINANCE:case e.BINANCE_TESTNET:case e.SHARDEUM_SPHINX:case e.SHARDEUM20:case e.POLYGON_MAINNET:case e.POLYGON_MUMBAI:case e.BASE_MAINNET:case e.BASE_TESTNET:case e.CORE_MAINNET:case e.CORE_TESTNET:case e.TELOS_MAINNET:case e.TELOS_TESTNET:case e.OPTIMISM_MAINNET:case e.OPTIMISM_GOERLI:case e.ARBITRUM:case e.ARBITRUM_GOERLI:case e.AVALANCHE:case e.AVALANCHE_TESTNET:case e.ZORA_MAINNET:case e.ZORA_GOERLI:case e.MANTA:case e.MANTA_TESTNET:case e.ZETA:case e.ZETA_TESTNET:case e.OMNI_TESTNET:return Dt[t];default:return Pt[t][0]}}function Jo(t){return!!t&&Bt.includes(t)}var zt=async(t,n)=>{if(Jo(n))if(t===Ht.connector||t===Ut.connector)await t.activate(n);else{let o=Lt[n],a={chainId:n,chainName:o.label,rpcUrls:[jo(n)],nativeCurrency:o.nativeCurrency,blockExplorerUrls:[o.explorer]};await t.activate(a)}else throw new Error(`Chain ${n} not supported for connector (${typeof t})`)};import be from"@emotion/styled";import{Box as Qo,Button as ea}from"@chakra-ui/react";import{CloseIcon as ta}from"@chakra-ui/icons";var ul=be(Qo)`
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: var(--bad-colors-background);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
`,Tl=be.a`
  // color: ${({theme:t})=>t.colors.primary} !important;
  // border-bottom: 1px solid ${({theme:t})=>t.colors.primary} !important;
  margin-top: 10px;
  font-size: 14px;
`,Gt=be(ta)`
  position: absolute;
  right: 5%;
  top: 20px;
  width: 16px;
  height: 16px;
  cursor: pointer;
`,fl=be(ea)`
  &:hover {
    background-color: ${({theme:t})=>t.colors.foreground} !important;
    color: ${({theme:t})=>t.colors.background};
  }
`;var Ft=[{label:"BONK (Solana)",value:"BONK",ticker:"BONK",address:"ERkzwkBkPeF1Q2LJr9Jqr2dcy4zZSV1pX6VGFxDmniM2",chain:9091,decimals:6,id:9},{label:"SOL (Solana)",value:"SOL",ticker:"SOL",address:"",chain:9091,decimals:9,id:6},{label:"USDT (Solana)",value:"SOL_USDT",ticker:"USDT",address:"26TJZb2cciYM95dioxB5u7Yo2A3seLXEkbrLAaiCNwSr",chain:9091,decimals:6,id:12}],Vt=[{label:"BONK (Solana)",value:"BONK",ticker:"BONK",address:"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",chain:9091,decimals:5,id:9},{label:"SOL (Solana)",value:"SOL",ticker:"SOL",address:"",chain:9091,decimals:9,id:6},{label:"USDT (Solana)",value:"SOL_USDT",ticker:"USDT",address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",chain:9091,decimals:6,id:12}],Kt=[{label:"USDT (Goerli)",value:"ETH_USDT",ticker:"USDT",address:"0x72904413f681e3ad1e054eb5473e65e57aa6856e",chain:5},{label:"ETH (Goerli)",value:"ETH",ticker:"ETH",chain:5},{label:"MATIC (Mumbai)",value:"MATIC",ticker:"MATIC",chain:80001},{label:"USDT (Mumbai)",value:"MATIC_USDT",ticker:"USDT",address:"0xf35524a13b9f49885a7c6848f5b164603db92bc0",chain:80001}],Zt=[{label:"ETH (Ethereum)",value:"ETH",ticker:"ETH",chain:1},{label:"USDT (Ethereum)",value:"ETH_USDT",ticker:"USDT",address:"0xdac17f958d2ee523a2206206994597c13d831ec7",chain:1},{label:"MATIC (Polygon)",value:"MATIC",ticker:"MATIC",chain:137},{label:"USDT (Polygon)",value:"MATIC_USDT",ticker:"USDT",address:"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",chain:137}];import{useEffect as Xe,useState as Wa}from"react";import{useWeb3React as sa}from"@web3-react/core";import{useMemo as la}from"react";import{isAddress as na}from"@ethersproject/address";import{AddressZero as oa}from"@ethersproject/constants";import{Contract as aa}from"@ethersproject/contracts";function ra(t,n){return t.getSigner(n).connectUnchecked()}function ia(t,n){return n?ra(t,n):t}function $t(t,n,o,a){if(!na(t)||t===oa)throw Error(`Invalid 'address' parameter '${t}'.`);return new aa(t,n,ia(o,a))}function q(t,n,o=!0){let{provider:a,account:i,chainId:s}=sa();return la(()=>{if(!t||!n||!a||!s)return null;let l;if(typeof t=="string"?l=t:l=t[s],!l)return null;try{return $t(l,n,a,o&&i?i:void 0)}catch(h){return console.error("Failed to get contract",h),null}},[t,n,a,s,o,i])}import{isAddress as Ua}from"@ethersproject/address";var Ae=[{inputs:[{internalType:"uint256",name:"initialSupply",type:"uint256"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];import{useWeb3React as Ha}from"@web3-react/core";import{useConnection as za,useWallet as Ga}from"@solana/wallet-adapter-react";import{LAMPORTS_PER_SOL as Fa,PublicKey as qe}from"@solana/web3.js";import je from"bignumber.js";import{useEffect as ca,useRef as pa}from"react";var ma=t=>{let n=pa();return ca(()=>{n.current=t},[t]),n.current},Ve=ma;import da from"bignumber.js";var ua=new da(10),Yt=ua.pow(18);import{useContext as Da}from"react";import{createContext as Ba,useCallback as Mc,useEffect as _c,useMemo as Oc,useState as Rc}from"react";import{useWallet as kc}from"@solana/wallet-adapter-react";import{useWeb3React as Bc}from"@web3-react/core";import{useEffect as kl,useState as Ll}from"react";import{AppConfig as Dl,UserSession as Pl}from"@stacks/connect";var R=t=>t?t?.chains?.includes("SOL"):!1,Ke=t=>t?t?.chains?.includes("EVM"):!1;import{createSlice as Ta}from"@reduxjs/toolkit";var fa={selectedWallet:void 0,selectedSolanaWallet:void 0,accessKey:null,details:{}},Xt=Ta({name:"user",initialState:fa,reducers:{updateSelectedWallet(t,{payload:{wallet:n}}){t.selectedWallet=n},updateSolanaSelectedWallet(t,{payload:{wallet:n}}){t.selectedSolanaWallet=n},updateAccessKey(t,{payload:{accessKey:n}}){t.accessKey=n},updateUserDetails(t,{payload:{details:n}}){t.details=n}}}),{updateSelectedWallet:Ea,updateSolanaSelectedWallet:zl,updateAccessKey:Gl,updateUserDetails:Fl}=Xt.actions,Vl=Xt.reducer;import{useDispatch as Hc}from"react-redux";import{useMemo as yc}from"react";import{initializeConnector as Ne}from"@web3-react/core";import{MetaMask as Sa}from"@web3-react/metamask";import{WalletConnect as en}from"@web3-react/walletconnect-v2";import{Network as ba}from"@web3-react/network";var ya=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,ha=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,qt=t=>typeof window>"u"||typeof navigator>"u"?!1:ya.test(navigator.userAgent)||ha.test(navigator.userAgent.substring(0,4))||Jt(t)||jt(),jt=()=>typeof window>"u"||typeof navigator>"u"?!1:/iPhone/.test(navigator.userAgent),Jt=t=>{if(typeof window>"u"||typeof navigator>"u")return!1;let n=t||navigator.maxTouchPoints;return/iPad/.test(navigator.userAgent)||/Mac/.test(navigator.userAgent)&&n===5},Ze=t=>typeof window>"u"||typeof navigator>"u"?!1:jt()||Jt(t),Qt=()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.userAgent.includes("SamsungBrowser");var se={METAMASK:"Metamask",BRAVE:"braveEvm",WALLET_CONNECT:"WalletConnect",HAHA_WALLET:"Haha",NETWORK:"Network"},Aa=t=>{window?.ReactNativeWebView?.postMessage(JSON.stringify(t))},[tn,nn]=Ne(t=>new Sa({actions:t})),on={connector:tn,hooks:nn,name:se.METAMASK,isInstalled:()=>window?.ethereum?.isMetaMask,handleMobile:(t,n)=>{Ze()?window.open(`${n.native}?uri=${encodeURIComponent(t??"")}`,"_self","noreferrer noopener"):window.open(`${n.universal}?uri=${encodeURIComponent(t??"")}`,"_self","noreferrer noopener")}},Ql={connector:tn,hooks:nn,name:se.BRAVE,isInstalled:()=>window?.ethereum?.isBraveWallet,handleMobile:(t,n)=>{Ze()?window.open(`${n.native}?uri=${encodeURIComponent(t??"")}`,"_self","noreferrer noopener"):window.open(`${n.universal}?uri=${encodeURIComponent(t??"")}`,"_self","noreferrer noopener")}},[Na,ga]=Ne(t=>new en({actions:t,options:{projectId:"600da6aac724cb2c05d52087cb405879",chains:[1],optionalChains:[5,137,80001,56,97,8081],showQrModal:!1,qrModalOptions:{themeVariables:{"--wcm-z-index":"2147483647"}}},onError:n=>{console.log(n)}})),[Ia,ec]=Ne(t=>new en({actions:t,options:{projectId:"600da6aac724cb2c05d52087cb405879",chains:[1],optionalChains:[5,137,80001,56,97,8081],showQrModal:!0,qrModalOptions:{themeVariables:{"--wcm-z-index":"2147483647"}}},onError:n=>{console.log(n)}})),$e={connector:Na,mobileConnector:Ia,hooks:ga,name:se.WALLET_CONNECT,isInstalled:()=>!1},an={...$e,name:se.HAHA_WALLET,handleMobile(t){if(window.sendWalletConnectQR!==void 0)Aa({type:"walletconnect_haha",uri:t});else{let n=encodeURIComponent(window.location.toString()),o=encodeURIComponent(window.location.origin);window.location.assign(`haha://opensea?link=${n}`)}}},[Ca,xa]=Ne(t=>new ba({actions:t,urlMap:ie})),rn={connector:Ca,hooks:xa,name:se.NETWORK,isInstalled:()=>!1};var le=t=>t?t.replace(/\W/g,"").toLowerCase():"";import{AppConfig as wa,showConnect as Ma,UserSession as _a}from"@stacks/connect";var Oa=new wa(["store_write","publish_data"]),Ye=class{constructor(){this.id="stacks",this.name="Stacks",this.supportedChain="STACKS",this.userSession=new _a({appConfig:Oa})}activate(n,o){Ma({appDetails:{name:"Bandit",icon:window.location.origin+"/logo512.png"},redirectTo:"/",onFinish:n,onCancel:o,userSession:this.userSession})}setUserSession(n){this.userSession=n}getUserSession(){return this.userSession}},sn={connector:new Ye,hooks:null,name:"Stacks",isInstalled:()=>!0,handleMobile(){}};import{PhantomWalletAdapter as Ra}from"@solana/wallet-adapter-phantom";var ln={connector:new Ra,hooks:null,name:"Phantom",isInstalled:()=>window?.solana?.isPhantom,handleMobile(){let t=encodeURIComponent(window.location.toString()),n=encodeURIComponent(window.location.origin);qt()&&(Qt()?window.location.assign(`phantom://browse/${t}?ref=${n}`):window.location.assign(`https://phantom.app/ul/browse/${t}?ref=${n}`))}};var va=()=>[on,$e,an,rn],ka=()=>[ln],La=()=>[sn],cn=()=>[...va().filter(t=>le(t.name)!==le("network")),...ka(),...La()];var Ac=cn();import{jsx as Vc}from"react/jsx-runtime";var pn=Ba(void 0);var Pa=()=>{let t=Da(pn);if(!t)throw Error("Component is not wrapper under wallet context provider");return t},ge=Pa;var Je={ETH:0,MATIC:0,ETH_USDT:0,MATIC_USDT:0,BONK:0,SOL:0,SOL_USDT:0,SHM:0,TLOS:0,AGOR:0,AVAX:0,ZETA:0,OMNI:0};function mn({currency:t,address:n,tokenDecimals:o=1,refresh:a=!1}){let[i,s]=Wa(Je),{account:l,provider:h}=Ha(),y=q(Ua(n)?n:null,Ae),{connection:S}=za(),{publicKey:m}=Ga(),{selectedWallet:d}=ge(),u=Ve(m?.toBase58()),f=Ve(l),p=async(c,b)=>{try{if(!S)return;let E=new qe(c),O=new qe(b),{value:N}=await S.getTokenAccountsByOwner(O,{mint:E});if(N.length===0)return 0;let V=N[0].pubkey,{value:{uiAmount:v}}=await S.getTokenAccountBalance(V);return s(Y=>({...Y,[t]:v})),v}catch(E){console.log(E)}},M=async c=>{try{if(!S)return;let b=await S.getBalance(new qe(c));return s(E=>({...E,[t]:new je(b).dividedBy(Fa).toNumber()})),b}catch(b){console.log(b)}};return Xe(()=>{d?.chains.includes("SOL")?u&&u!==m?.toBase58()&&s(Je):f&&f!==l&&s(Je)},[d,u,f,m,l,a]),Xe(()=>{d?.chains.includes("SOL")&&m&&(t==="SOL"?M(m.toBase58()):(t==="SOL_USDT"||t==="BONK")&&p(n,m.toBase58()))},[d,m,t,a]),Xe(()=>{if(d?.chains.includes("EVM")&&h&&l){let c=async()=>{try{let E=await h.getBalance(l);s(O=>({...O,[t]:new je(E.toString()).dividedBy(Yt).toNumber()}))}catch(E){console.log(E)}},b=async()=>{try{let E=await y.balanceOf(l);s(O=>({...O,[t]:new je(E.toString()).dividedBy(10**o).toNumber()}))}catch(E){console.log(E)}};["ETH","MATIC","BNB","SHM","TLOS","AGOR","AVAX"].includes(t)?c():y&&b()}},[d,h,l,t,n,y,o,a]),{balances:i}}import{useWeb3React as Va}from"@web3-react/core";import un from"bignumber.js";import{useCallback as Ka}from"react";var dn=[{inputs:[{internalType:"contract BaseRegistrar",name:"_base",type:"address"},{internalType:"contract PriceOracle",name:"_prices",type:"address"},{internalType:"uint256",name:"_minCommitmentAge",type:"uint256"},{internalType:"uint256",name:"_maxCommitmentAge",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"cost",type:"uint256"},{indexed:!1,internalType:"uint256",name:"expires",type:"uint256"}],name:"NameRegistered",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"cost",type:"uint256"},{indexed:!1,internalType:"uint256",name:"expires",type:"uint256"}],name:"NameRenewed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oracle",type:"address"}],name:"NewPriceOracle",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{constant:!0,inputs:[],name:"MIN_REGISTRATION_DURATION",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"string",name:"name",type:"string"}],name:"available",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"commitment",type:"bytes32"}],name:"commit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"commitments",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"isOwner",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"address",name:"owner",type:"address"},{internalType:"bytes32",name:"secret",type:"bytes32"}],name:"makeCommitment",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"address",name:"owner",type:"address"},{internalType:"bytes32",name:"secret",type:"bytes32"},{internalType:"address",name:"resolver",type:"address"},{internalType:"address",name:"addr",type:"address"}],name:"makeCommitmentWithConfig",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"maxCommitmentAge",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"minCommitmentAge",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"duration",type:"uint256"},{internalType:"bytes32",name:"secret",type:"bytes32"}],name:"register",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!1,inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"duration",type:"uint256"},{internalType:"bytes32",name:"secret",type:"bytes32"},{internalType:"address",name:"resolver",type:"address"},{internalType:"address",name:"addr",type:"address"}],name:"registerWithConfig",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!1,inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"duration",type:"uint256"}],name:"renew",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!1,inputs:[],name:"renounceOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"duration",type:"uint256"}],name:"rentPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"_minCommitmentAge",type:"uint256"},{internalType:"uint256",name:"_maxCommitmentAge",type:"uint256"}],name:"setCommitmentAges",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"contract PriceOracle",name:"_prices",type:"address"}],name:"setPriceOracle",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"string",name:"name",type:"string"}],name:"valid",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[],name:"withdraw",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}];var Za=()=>{let t=q("0x283af0b28c62c092c9727f1ee09c02ca627eb7f5",dn),{provider:n}=Va();return{registerEnsDomain:Ka(async(a,i,s,l,h,y,S,m,d,u)=>{try{let f=l*31536e3,p=un(h).multipliedBy(f).multipliedBy(1.1).toFixed(0);console.log("totalRentPrice",p.toString());let M=new Uint8Array(32);window.crypto.getRandomValues(M);let c="0x"+Array.from(M).map(v=>v.toString(16).padStart(2,"0")).join(""),b=await n.getGasPrice(),E=await t.makeCommitmentWithConfig(i,s,c,"0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",s),O=await t.commit(E);await new Promise(v=>setTimeout(()=>v(),6e4));let N=await t.registerWithConfig(i,s,f,c,"0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",s,{value:p.toString(),gasLimit:4e5,gasPrice:b}),V=N.hash;await N.wait(),console.log(V),u&&await It(a,{name:`${i}.eth`,transactionHash:V,transferWallet:y,claimWallet:S,price:p,discountedPrice:new un(m).times(DEFAULT_TOKEN_DECIMAL).toString(),currency:d})}catch(f){throw console.log(f),f}},[]),ensRegistarController:t}},Tn=Za;import{useConnection as $a,useWallet as Ya}from"@solana/wallet-adapter-react";import{Transaction as Xa}from"@solana/web3.js";import{useCallback as qa}from"react";var ja=()=>{let t=Ya(),{connection:n}=$a();return{registerSns:qa(async(a,i,s,l,h,y)=>{if(!(!t.connected||!t.publicKey||!n))try{let S=i,m=await Nt(a,l.name,h,S.toString(),s.value,y*1e3),d=await n.getLatestBlockhash(),u=Xa.from(Buffer.from(m));u.recentBlockhash=d.blockhash;let f=await t.sendTransaction(u,n);console.log(f),await gt(a,l.name,f)}catch(S){throw S}},[t,n])}},fn=ja;import{useCallback as bn}from"react";import{useToast as yr}from"@chakra-ui/react";import{useConnection as hr,useWallet as Sr}from"@solana/wallet-adapter-react";import{LAMPORTS_PER_SOL as br,SystemProgram as Ar,Transaction as Nr}from"@solana/web3.js";import{PublicKey as et,toBigNumber as gr}from"@metaplex-foundation/js";import{createAssociatedTokenAccountInstruction as Ir,createTransferCheckedInstruction as Cr,getAssociatedTokenAddressSync as An,TOKEN_PROGRAM_ID as xr}from"@solana/spl-token";import Nn from"bignumber.js";import{isAddress as wr}from"@ethersproject/address";import{useWeb3React as Mr}from"@web3-react/core";import"react";import{Box as cr,Text as pr,useToast as mr}from"@chakra-ui/react";import{isAddress as dr}from"@ethersproject/address";import ur from"@emotion/styled";import Ja from"react";import{createMultiStyleConfigHelpers as Qa,defineStyle as er,FormControl as tr,Input as nr,InputGroup as or,Text as Qe}from"@chakra-ui/react";import{inputAnatomy as ar}from"@chakra-ui/anatomy";import{jsx as Ie,jsxs as En}from"react/jsx-runtime";var j=Ja.forwardRef(({label:t,error:n,placeholder:o,helperText:a,isInvalid:i,as:s=nr,InputLeftAddon:l,InputRightAddon:h,...y},S)=>{let{disabled:m}=y;return En(tr,{isInvalid:i,opacity:m?.4:1,children:[t&&Ie(Qe,{color:i?"destructive":"foreground",fontWeight:"medium",fontSize:"sm",lineHeight:1,children:t}),En(or,{mt:"2",children:[l,Ie(s,{variant:"",placeholder:o,...y,ref:S}),h]}),a&&Ie(Qe,{fontSize:"xs",mt:2,color:"mutedForeground",children:a}),i&&n&&Ie(Qe,{fontSize:"xs",mt:2,color:"destructive",children:n})]})}),{definePartsStyle:yn,defineMultiStyleConfig:rr}=Qa(ar.keys),ir=yn({field:{color:"foreground",background:"background",boxShadow:"base",borderWidth:"1px",borderStyle:"solid",borderColor:"input",borderRadius:"lg",_focusVisible:{borderColor:"ring"},_hover:{},_disabled:{opacity:1},_placeholder:{color:"mutedForeground"}}}),sr=er({borderRadius:"md"}),lr={sm:yn({field:sr})},Ip=rr({baseStyle:ir,sizes:lr});import{jsx as hn,jsxs as Er}from"react/jsx-runtime";var Tr=ur(cr)`
  position: relative;
  &:after {
    content: '';
    position: absolute;
    top: -30px;
    width: 100%;
    height: 32px;
    background: rgb(255, 255, 255);
    background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
  }
`,fr=({address:t,setAddress:n})=>{let o=mr();return Er(Tr,{paddingY:4,children:[hn(j,{placeholder:"Enter ethereum wallet address",value:t,onChange:i=>{let s=i.target.value;dr(s)?n(s):(o({title:"Invalid ethereum address",description:"Please enter valid address",status:"error"}),n(""))}}),hn(pr,{fontSize:14,mt:2,children:"Note: Enter correct wallet address for domain mapping. We are not liable for any discrepancies caused by an incorrect address"})]})},Sn=fr;import{parseUnits as _r}from"@ethersproject/units";import{jsx as Rr}from"react/jsx-runtime";var Cn=X==="production",gn=Cn?"HGZmW9bWZZhVvfGbBBU1dvYHsXwi7BqPX5vG39v87iXW":"5bPVXMADTeJCbZ1dMfn6GRm8Zm1mSbwR84UsyRT4eVAT",In=Cn?"0x4D535c34DD050B0Bc0e7dC6A988a1443Dfb520ac":"0x663Bae08ad96BC7D0f5F895dAb6daA84F9F6De0C",Or=t=>{let n=yr(),{connection:o}=hr(),a=Sr(),i=q(wr(t.address)?t.address:null,Ae),{account:s,provider:l}=Mr(),h=bn(async(m,d)=>{try{let u=await o.getLatestBlockhash(),f=new Nr;if(d.value==="BONK"||d.value==="SOL_USDT"){let M=d.address,c=new et(gn),b=new et(M),E=An(b,a.publicKey),O=await o.getTokenAccountsByOwner(c,{mint:b,programId:xr}),N=An(b,c);O.value?.length||f.add(Ir(a.publicKey,N,c,b)),f.add(Cr(E,b,N,a.publicKey,gr(m*10**d.decimals),d.decimals))}else f.add(Ar.transfer({fromPubkey:a.publicKey,toPubkey:new et(gn),lamports:new Nn(m).multipliedBy(br).toNumber()}));return f.feePayer=a.publicKey,f.recentBlockhash=u.blockhash,await a.sendTransaction(f,o,{signers:[],preflightCommitment:"max"})}catch(u){throw u}},[a.connected]);return{registerUd:bn(async(m,d,u,f,p,M,c,b)=>{try{let E=null,{token:O,discountedValue:N,value:V}=await At(m,d.name,u.value,f);if(u.ticker!=="USDT"&&N!==d.discountedRate[u.value]){n({title:"Price changed",status:"warning",duration:2e3}),b();return}if(await bt(m,{name:d.name,claimWallet:p,raw:O,discountedPrice:N,price:V,currency:u.value}),c.current&&clearInterval(c.current),u.value==="BONK"||u.value==="SOL_USDT"||u.value==="SOL")E=await h(N,u);else if(u.value==="ETH_USDT"||u.value==="MATIC_USDT"){let v=new Nn(N).multipliedBy(BIG_TEN.pow(6).toNumber()).toString();E=(await(await i.transfer(In,v)).wait()).transactionHash}else(u.value==="ETH"||u.value==="MATIC")&&(E=(await(await l.getSigner().sendTransaction({from:s,to:In,value:_r(N,"ether").toHexString()})).wait()).transactionHash);console.log(E),await St(m,{name:d.name,transactionHash:E,transferWallet:M?.chains?.includes("SOL")?a.publicKey.toBase58():s,claimWallet:p})}catch(E){throw E}},[l,h]),renderAddressInput:({address:m,setAddress:d})=>Rr(Sn,{address:m,setAddress:d})}},xn=Or;import"react";import{Flex as _n}from"@chakra-ui/react";import"react";import vr from"@emotion/styled";import{Text as kr}from"@chakra-ui/react";import{jsx as tt,jsxs as Dr}from"react/jsx-runtime";var Lr=vr(kr)`
  .one {
    opacity: 0;
    -webkit-animation: dot 1.3s infinite;
    -webkit-animation-delay: 0s;
    animation: dot 1.3s infinite;
    animation-delay: 0s;
  }

  .two {
    opacity: 0;
    -webkit-animation: dot 1.3s infinite;
    -webkit-animation-delay: 0.2s;
    animation: dot 1.3s infinite;
    animation-delay: 0.2s;
  }

  .three {
    opacity: 0;
    -webkit-animation: dot 1.3s infinite;
    -webkit-animation-delay: 0.3s;
    animation: dot 1.3s infinite;
    animation-delay: 0.3s;
  }

  @-webkit-keyframes dot {
    0% {
      opacity: 0;
    }
    50% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  @keyframes dot {
    0% {
      opacity: 0;
    }
    50% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }
`,Br=({text:t="Loading",...n})=>Dr(Lr,{...n,children:[t,tt("span",{className:"one",children:"."}),tt("span",{className:"two",children:"."}),tt("span",{className:"three",children:"."})]}),wn=Br;import"react";import{Spinner as Pr}from"@chakra-ui/react";import{jsx as Ur}from"react/jsx-runtime";var Wr=({...t})=>Ur(Pr,{thickness:"4px",speed:"1.5s",emptyColor:"input",color:"black",size:"xl",...t}),Mn=Wr;import{jsx as On,jsxs as Rn}from"react/jsx-runtime";var Hr=({completed:t,message:n})=>t?null:Rn(_n,{flexDir:"column",w:"full",justifyContent:"center",alignItems:"center",children:[Rn(_n,{align:"center",mb:"4",children:[On(Mn,{size:"md",mr:"10px"}),On(wn,{text:"Minting In Progress",fontSize:22,fontWeight:600})]}),n()]}),vn=Hr;import"react";import{Flex as zr,Spinner as Gr}from"@chakra-ui/react";import{jsx as kn}from"react/jsx-runtime";var Fr=()=>kn(zr,{height:"350px",justify:"center",align:"center",children:kn(Gr,{thickness:"4px",size:"lg"})}),Ln=Fr;import{useState as $r}from"react";import{Box as Vr}from"@chakra-ui/react";import"react";import{jsx as Ce,jsxs as Zr}from"react/jsx-runtime";var Kr=t=>Ce(Vr,{as:"svg",width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ce("g",{id:"a4e07f86",children:Zr("g",{id:"fc8efcce",children:[Ce("path",{id:"725a9585",d:"M49.9999 8.33398L60.9443 16.3174L74.4909 16.2916L78.6526 29.1834L89.6272 37.125L85.4166 50.0006L89.6272 62.8763L78.6526 70.8179L74.4909 83.7096L60.9443 83.684L49.9999 91.6673L39.0555 83.684L25.5089 83.7096L21.3472 70.8179L10.3726 62.8763L14.5832 50.0006L10.3726 37.125L21.3472 29.1834L25.5089 16.2916L39.0555 16.3174L49.9999 8.33398Z",fill:"#51B592",stroke:"#52D5A7",strokeWidth:"8.33333",strokeLinecap:"round",strokeLinejoin:"round"}),Ce("path",{id:"26f77c74",d:"M35.4165 50.0007L45.8332 60.4173L66.6665 39.584",stroke:"white",strokeWidth:"8.33333",strokeLinecap:"round",strokeLinejoin:"round"})]})})}),Bn=Kr;import{Box as Dn,Button as Pn,Flex as xe,Image as Wn,Link as Yr,Text as J}from"@chakra-ui/react";import Xr from"@emotion/styled";import{AiOutlineFullscreen as qr}from"react-icons/ai";import{FaTwitter as jr}from"react-icons/fa";import{jsx as I,jsxs as Q}from"react/jsx-runtime";var Jr="",Qr="",ei="",ti=Xr(Dn)`
  //margin-left: 30px;
  //margin-right: 30px;
  border: 1px solid #cccc;
  border-radius: 14px;
  padding: 10px 20px;
  height: 65px;
  overflow: hidden;
  ${({offersOpen:t})=>t&&`
    position: absolute;
    top : 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: unset;
  `};
`,nt=({imageSrc:t,title:n,onClick:o})=>Q(xe,{align:"center",justify:"space-between",borderWidth:"1.5px",borderColor:"gray.400",borderRadius:"lg",p:1,mb:2,children:[Q(xe,{align:"center",children:[I(Wn,{src:t,w:8,h:8,borderRadius:"50%"}),I(J,{fontSize:"12px",fontWeight:600,mb:1,ml:3,children:n})]}),o&&I(Pn,{size:"xs",bg:"gray.800",color:"white",_hover:{bg:"gray.800"},onClick:o,children:"Claim here"})]}),ni=({address:t,showOffers:n,onClickCollection:o,website:a,twitterHandle:i,isEnsDomain:s})=>{let[l,h]=$r(!1),y=()=>{s?window.open("https://twitter.com/intent/tweet?text=Just%20secured%20my%20new%20@ensdomains%20on%20bandit.network!%20Ready%20to%20rock%20my%20online%20presence.%20&hashtags=DigitalUpgrade","_blank"):window.open(`https://twitter.com/intent/tweet?text=Ready%20to%20take%20my%20online%20identity%20to%20the%20next%20level%20with%20my%20${i()}%20on%20bandit.network.%20And%20the%20best%20part?%20I%20also%20got%20some%20amazing%20rewards%20from%20@OnBndit,%20@bonk_inu,%20@NFTevening.%20Join%20me%20and%20claim%20yours%20now!`,"_blank")};return I(Dn,{children:Q(xe,{flexDir:"column",align:"center",position:"relative",w:"full",userSelect:"none",p:8,children:[I(Wn,{src:Bn,w:"75",h:"75"}),I(J,{textAlign:"center",mt:"4",fontSize:"20",fontWeight:"semibold",children:"Domain purchased successfully \u{1F389}"}),Q(J,{textAlign:"center",marginY:"4",fontSize:14,children:["Note: Login to"," ",I(Yr,{href:a(),target:"_blank",children:a()})," ","using ",I("b",{children:re(t,6)})," address to view your domain. It might take upto 10 minutes to register your domain."]}),I(Pn,{mb:5,border:"1.5px solid",w:"fit-content",borderColor:"input",size:"sm",fontWeight:500,rightIcon:I(jr,{width:20,height:20,color:"#1DA1F2"}),onClick:y,children:"Celebrate"}),n&&Q(ti,{bg:"gray.200",offersOpen:l,children:[Q(xe,{justify:"space-between",align:"center",children:[I(J,{fontSize:"sm",fontWeight:600,mb:1,children:"Exclusive rewards for purchasing UD"}),I(qr,{cursor:"pointer",onClick:()=>h(!l)})]}),I(J,{fontSize:"xs",fontWeight:500,mb:3,children:"As a thank you, we're offering exclusive rewards to the first 2500 users by our partner platforms"}),I(nt,{imageSrc:ei,onClick:()=>o("64072"),title:"Claim 100 $BAD token wrapped Bandit NFTs by Bandit"}),I(nt,{imageSrc:Jr,title:"Eligible to receive 400K $BONK coins after the offer period by BONK"}),I(nt,{imageSrc:Qr,title:"Get 15% discount on all services by NFT Evening"}),I(J,{fontSize:"2xs",children:"These rewards are only available to the first 2500 users from our partner platforms, so don't miss out! Start exploring the exciting world of web3 domains and NFTs with these amazing offers."})]})]})})},Un=ni;import{Flex as ot,Modal as Ti,ModalBody as fi,ModalCloseButton as Ei,ModalContent as yi,ModalHeader as hi,ModalOverlay as Si,Spinner as bi,Text as ee}from"@chakra-ui/react";import{LAMPORTS_PER_SOL as Ai}from"@solana/web3.js";import{Box as oi,Flex as ce,Slider as ai,SliderFilledTrack as ri,SliderThumb as ii,SliderTrack as si,Spinner as li,Text as Z}from"@chakra-ui/react";import ci from"@emotion/styled";import{LAMPORTS_PER_SOL as pi}from"@solana/web3.js";import"react";import{jsx as G,jsxs as F}from"react/jsx-runtime";var mi="https://docs.bonfida.org/collection/naming-service/how-to-create-a-solana-domain-name/purchasing-a-domain-name/direct-registration",di=ci(ce)`
  position: relative;
`,ui=({size:t,setSize:n,loading:o,subTotalPrice:a})=>F(di,{paddingY:4,flexDir:"column",alignItems:"center",children:[F(ai,{defaultValue:0,min:1,max:10,step:1,w:"94%",onChange:s=>{n(s)},value:t,children:[F(si,{bg:"muted",children:[G(oi,{position:"relative",right:10}),G(ri,{bg:"mutedForeground"})]}),G(ii,{boxSize:4,borderColor:"mutedForeground",borderWidth:"1"})]}),F(ce,{justifyContent:"space-between",w:"full",mt:"1",children:[G(Z,{fontSize:"12",children:"1 Kb"}),G(Z,{fontSize:"12",children:"10 Kb"})]}),F(ce,{w:"full",justifyContent:"space-between",children:[F(Z,{fontSize:14,mt:4,fontWeight:"semibold",children:["Selected Size: ",`${t} Kb`]}),G(Z,{fontSize:14,mt:4,textDecoration:"underline",cursor:"pointer",onClick:()=>window.open(mi),textAlign:"right",children:"How much storage is right for you?"})]}),F(ce,{w:"full",justifyContent:"space-between",alignItems:"center",children:[G(Z,{fontSize:14,mt:4,fontWeight:"bold",children:"Storage cost"}),F(ce,{alignItems:"flex-end",justifyContent:"center",mt:4,children:[o?G(li,{size:"xs",mb:"1"}):F(Z,{fontSize:14,fontWeight:"bold",children:["+",`${(a/pi).toFixed(5)}`]}),G(Z,{ml:"1",fontSize:14,fontWeight:"bold",children:"SOL"})]})]})]}),Hn=ui;import{jsx as P,jsxs as $}from"react/jsx-runtime";var Ni=({size:t,setSize:n,onOpen:o,onClose:a,isOpen:i,loading:s,subTotalPrice:l})=>$(ot,{mt:"2",justifyContent:"space-between",children:[$(ot,{alignItems:"center",children:[P(ee,{fontSize:"12",mr:"1",children:"Storage Cost:"}),P(ee,{textDecoration:"underline",fontSize:"12",cursor:"pointer",onClick:o,children:"Edit"})]}),$(ot,{alignItems:"center",justifyContent:"center",children:[s?P(bi,{size:"xs"}):$(ee,{fontSize:"12",fontWeight:"bold",children:["+",`${(l/Ai).toFixed(5)}`]}),P(ee,{ml:"1",fontSize:"12",fontWeight:"bold",children:"SOL"}),P(ee,{fontSize:"12",mx:"1",children:`(${t} KB)`})]}),$(Ti,{blockScrollOnMount:!1,isOpen:i,onClose:a,isCentered:!0,children:[P(Si,{}),$(yi,{children:[P(hi,{children:"Edit storage size"}),P(Ei,{}),$(fi,{children:[P(ee,{fontSize:"12",py:"2",px:"4",borderColor:"mutedForeground",borderWidth:"1px",borderStyle:"solid",borderRadius:"8",children:"Storage size cannot be changed after initial registration."}),P(Hn,{size:t,setSize:n,loading:s,subTotalPrice:l})]})]})]})]}),zn=Ni;import{Flex as Kn,Modal as Pi,ModalBody as Wi,ModalCloseButton as Ui,ModalContent as Hi,ModalHeader as zi,ModalOverlay as Gi,Text as we,useToast as Fi}from"@chakra-ui/react";import{Flex as ct,Spinner as ki,Text as st}from"@chakra-ui/react";import Li from"@emotion/styled";import"react";import{useEffect as at,useState as gi}from"react";import it from"@emotion/styled";import{AddIcon as Ii,MinusIcon as Ci}from"@chakra-ui/icons";import{Box as xi,Button as wi,Flex as Mi,Text as _i}from"@chakra-ui/react";import{jsx as pe,jsxs as rt}from"react/jsx-runtime";var Oi=it(xi)`
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  height: 40px;
  border-radius: 12px;
`,Gn=it(wi)`
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  height: 32px;
  width: 32px;
  //border-radius: 12px;
  //border: none;
  //border: 1px solid ${t=>t.theme.colors.border};
  pointer-events: ${t=>t.disabled?"none":"unset"};
  opacity: ${t=>t.disabled?"0.5":"1"};

  &:active {
    border: 1px solid ${t=>t.theme.colors.foreground};
  }

  svg {
    path {
      fill: ${t=>t.theme.colors.foreground};
    }
  }
`,Ri=it(j)`
  justify-content: center;
  font-size: 18px;
  min-width: 60px;
  user-select: none;
  border: none;
  box-shadow: none;
  max-width: 80px;
  text-align: center;
`,vi=({initialState:t=1,maxState:n,onChange:o,value:a,onError:i})=>{let[s,l]=gi(t);return at(()=>{o(s)},[s]),at(()=>{l(t)},[t]),at(()=>{n>0&&a>n||s<1?i(!0):i(!1)},[n,a,s]),rt(Mi,{flexDirection:"column",alignItems:"flex-end",children:[rt(Oi,{children:[pe(Gn,{variant:"outline",onClick:()=>{a>t&&l(m=>a-1)},disabled:a===1,children:pe(Ci,{})}),pe(Ri,{value:a,onChange:m=>{let d=Number(m.target.value);l(d)}}),pe(Gn,{variant:"outline",onClick:()=>{n?a<n&&l(m=>a+1):l(m=>a+1)},disabled:n===a||!n,children:pe(Ii,{})})]}),(n>0&&a>n||s<1)&&rt(_i,{fontSize:12,mt:10,color:"#E11900",children:["Enter quantity between 1 to ",n]})]})},Fn=vi;import{jsx as me,jsxs as lt}from"react/jsx-runtime";var Bi=Li(ct)`
  position: relative;
`,Di=({duration:t,setDuration:n,loading:o,subTotalPrice:a,payUsing:i})=>lt(Bi,{paddingY:4,flexDir:"column",alignItems:"center",children:[me(Fn,{initialState:1,maxState:1e4,onChange:n,onError:()=>{},value:t}),lt(ct,{w:"full",justifyContent:"space-between",alignItems:"center",children:[me(st,{fontSize:14,mt:4,fontWeight:"bold",children:`${t} year registration`}),lt(ct,{alignItems:"flex-end",justifyContent:"center",mt:4,children:[o?me(ki,{size:"xs",mb:"1.5"}):me(st,{fontSize:14,fontWeight:"bold",children:`${a?.toFixed(5)}`}),me(st,{ml:"1",fontSize:14,fontWeight:"bold",children:i?.ticker})]})]})]}),Vn=Di;import{jsx as K,jsxs as de}from"react/jsx-runtime";var Vi=({selectedDomain:t,duration:n,selectDuration:o,onOpen:a,onClose:i,isOpen:s,loading:l,subTotalPrice:h,payUsing:y})=>{let S=Fi();return de(Kn,{justifyContent:"space-between",children:[de(Kn,{alignItems:"center",children:[K(we,{fontSize:"12",mr:"1",children:"Duration:"}),K(we,{textDecoration:"underline",fontSize:"12",cursor:"pointer",onClick:()=>{if(!t)return S({title:"Select Domain",status:"warning"});a()},children:"Edit"})]}),K(we,{fontSize:"12",mr:"1",children:`${n} Year`}),de(Pi,{blockScrollOnMount:!1,isOpen:s,onClose:i,isCentered:!0,children:[K(Gi,{}),de(Hi,{children:[K(zi,{children:"Registration duration"}),K(Ui,{}),de(Wi,{children:[K(we,{fontSize:"12",py:"2",px:"4",borderColor:"mutedForeground",borderWidth:"1px",borderStyle:"solid",borderRadius:"8",children:"Extending for multiple years will save money on network costs by avoiding yearly transactions."}),K(Vn,{duration:n,setDuration:o,loading:l,subTotalPrice:h,payUsing:y})]})]})]})]})},Zn=Vi;import{Fragment as ts,jsx as A,jsxs as k}from"react/jsx-runtime";var Qi=qi(ne)`
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
`,mt=X==="production";var Xn=mt?Vt:Ft,_e=mt?Zt:Kt,es=({accessKey:t,onClickClose:n,collectionState:o,disconnectWallet:a})=>{let[i,s]=w(""),[l,h]=w(1),[y,S]=w(!1),[m,d]=w(""),[u,f]=w([]),[p,M]=w({label:null,value:null,chain:null}),[c,b]=w(""),[E,O]=w(!1),[N,V]=w(!1),[v,Y]=w(!1),[Oe,Te]=w(!1),[dt,Re]=w(0),[qn,fe]=w(!1),[ut,Tt]=w(0),{isOpen:jn,onOpen:Jn,onClose:Qn}=$n(),{isOpen:eo,onOpen:to,onClose:no}=$n(),[Ee,oo]=w(1),{primaryAddress:ye,selectedWallet:_,setShowWallets:ao,setFilterChains:ro}=ge(),C=o?.contract?.contractAddress==="bonfida-sns",L=o?.contract?.contractAddress==="unstoppable-domain",x=!C&&!L,{connection:ve}=Xi(),io=Ji(),{chainId:so,account:ke}=ji(),U=ye,{balances:oe}=mn({currency:p.value,address:p.address,tokenDecimals:p.decimals}),{registerUd:lo,renderAddressInput:co}=L&&xn(p),{registerEnsDomain:po,ensRegistarController:ft}=x&&Tn(),{registerSns:mo}=C&&fn(),uo=$i(),B=Yi();pt(()=>(R(_)?M(Xn[0]):(M(_e[0]),s(ye)),()=>{B.current&&clearInterval(B.current)}),[_,ye]),pt(()=>{U&&ae()},[U]);let he=ue(async()=>{try{Y(!0);let r;if(L?r=await Pe(t,m,U):C?r=await We(t,m):x&&(r=await Ue(t,m)),c){let g=r.find(De=>De.name===c.name);g?b(g):c("")}f(r)}catch{}finally{Y(!1)}},[t,m,U]),ae=ue(Ct(async()=>{try{if(!m?.length)return;B.current&&clearInterval(B.current),f([]),S(!0),b("");let r=m.trim().replace(/\s+/g,"-");if(L){let g=await Pe(t,encodeURIComponent(r),U);g?.length&&(f(g),B.current=setInterval(he,3e4))}else if(C){let g=await We(t,r);g?.length&&(f(g),B.current=setInterval(he,3e4))}else if(x){let g=await Ue(t,r);g?.length&&(f(g),B.current=setInterval(he,3e4))}}catch(r){console.log(r)}finally{S(!1)}},400),[m,t,he,U]),To=r=>{d(C||x?r.target.value.split(".")[0]:r.target.value)},Et=()=>R(_)?Xn:x?[_e[0],_e[1]]:_e,Le=ue((r=0)=>(c&&(p.ticker==="USDT"?Re(c.discountedRate.USDT):(p.value!=="SOL"&&R(_)&&(r=0),Re(Number(c.discountedRate[p.value])+r))),0),[c,p]),fo=()=>so===p.chain,Be=ue((r=0)=>{if(!c)return!0;C?p.ticker==="SOL"?Te(new te(oe[p.value]).gte(new te(c?.discountedRate[p.ticker]).plus(r/Yn).toNumber())):Te(new te(oe[p.value]).gte(Number(c?.discountedRate[p.ticker]))):Te(new te(oe[p.value]).gte(Number(c?.discountedRate[p.ticker]+r)))},[c,oe,p]),yt=ue(async()=>{if(ve&&C&&c)try{fe(!0);let r=await ve.getMinimumBalanceForRentExemption(l*1e3);Tt(r),Be(r),Le(r/Yn)}catch(r){console.log(r)}finally{fe(!1)}else if(c&&x&&ft)try{fe(!0);let r=te(Number(c?.discountedRate[p.ticker])).multipliedBy(Ee);Tt(r.toNumber()),Te(new te(oe[p.value]).gte(r.toNumber())),Re(r.toNumber())}catch(r){console.log(r)}finally{fe(!1)}},[ve,l,p,x,c,ft,Ee]);pt(()=>{Le(),Be(),yt()},[Le,Be,yt]);let Eo=async()=>{try{await zt(_.connector,p.chain)}catch(r){console.log(r)}},yo=r=>{let De=Et().filter(No=>No.value===r.target.value);M(De[0])},ht=r=>{b(r)},ho=r=>{var g=r.keyCode||r.which;g===13&&m?.length>0&&ae()},So=r=>{io(kt({id:r}))},bo=async()=>{try{O(!0),B.current&&clearInterval(B.current),L?await lo(t,c,p,U,i,_,B,ae):C?await mo(t,dt,p,c,U,l):x&&await po(t,c.name.split(".")[0],ke,Ee,c?.availability?.price?.weiPerSecond,ke,i,c?.discountedRate[p.value],p.value,mt),V(!0)}catch(r){b(""),ae(),uo({title:"Failed to mint",description:r?.response?.data?.data||r.reason||r.message,status:"error",duration:1e3}),console.log(r)}finally{O(!1)}},Ao=r=>{oo(r)},ns=()=>{if(C)return!!R(_);if(L)return!0;if(x)return!R(_)},os=()=>{if(C&&!R(_))return"Connect Wallet";if(x&&Ke(_))return"Connect to EVM Wallet"};return k(ne,{children:[(E||N)&&k(Qi,{children:[N&&A(Gt,{onClick:n,zIndex:1}),A(vn,{completed:N,message:()=>k(ts,{children:[k(W,{fontSize:14,fontWeight:500,children:[`Minting ${c.name} to ${R(_)?re(U,5):re(ke,5)}`,"."]}),A(W,{fontSize:14,fontWeight:500,children:"Please do not refresh the page."}),x&&k(Me,{flexDir:"column",alignItems:"center",mt:"2",children:[A(W,{fontSize:14,fontWeight:600,mt:"2",children:"Registering your domain takes three steps"}),A(W,{fontSize:14,fontWeight:500,mt:"2",children:"1. Complete the claim transaction to begin the process."}),A(W,{fontSize:14,fontWeight:500,mt:"2",children:"2. Waits 60 seconds for the claim transaction to complete."}),A(W,{fontSize:14,fontWeight:500,mt:"2",children:"3. Complete the register transaction to secure your name."})]})]})}),N&&A(Un,{address:i,onClickCollection:So,showOffers:!1,website:()=>{if(L)return"https://unstoppabledomains.com";if(x)return"https://ens.domains";if(C)return"https://sns.id/"},twitterHandle:()=>{if(L)return"@unstoppableweb";if(x)return"@ensdomains";if(C)return"@bonfida"},isEnsDomain:x})]}),k(Me,{mt:4,children:[A(j,{id:"ud-search",placeholder:"Search for your new domain",onChange:To,onKeyPress:ho,size:"md",autoComplete:"off"}),A(Ki,{size:"md",variant:"primary",cursor:"pointer",onClick:ae,ml:3,mt:2,children:"Search"})]}),!u?.length&&!y&&A(Rt,{}),y&&A(Ln,{}),!!u?.length&&k(ne,{children:[k(Me,{justifyContent:"space-between",mt:4,alignItems:"center",children:[A(W,{color:"foreground",fontWeight:400,fontSize:14,children:"Pay using"}),A(Me,{justifyContent:"center",align:"center",mb:2,children:A(Zi,{value:p?.value,size:"sm",onChange:yo,borderColor:"muted",borderWidth:"1.5px",borderRadius:"lg",boxShadow:"base",_hover:{},children:Et().map(({label:r,value:g})=>A("option",{value:g,children:r}))})})]}),A(ne,{h:c&&R(_)&&!C?"100px":"250px",overflowY:"auto",pt:2,position:"relative",children:u.map((r,g)=>A(_t,{domain:{...r,name:C?r?.name+".sol":r?.name},selected:r.name===c?.name,onSelect:()=>ht(r),onUnSelect:()=>ht(""),currency:p?.ticker},g))}),C&&A(zn,{size:l,setSize:h,onOpen:Jn,onClose:Qn,isOpen:jn,loading:qn,subTotalPrice:ut}),x&&A(Zn,{selectedDomain:c,duration:Ee,selectDuration:Ao,onOpen:to,onClose:no,isOpen:eo,loading:y,subTotalPrice:ut,payUsing:p}),c&&R(_)&&L&&co({address:i,setAddress:s}),A(ne,{mt:"15px",children:k(wt,{validators:[{should:!!ye,fallbackProps:{onClick:()=>{ro(L?["EVM","SOL"]:x?["EVM"]:["SOL"]),ao(!0)},children:"Connect Wallet"}},{should:R(_)?!0:fo(),fallbackProps:{onClick:Eo,children:"Switch Network"}},{should:!!c,fallbackProps:{onClick:()=>{},children:"Select Domain",disabled:!0}},{should:C||!!i,fallbackProps:{onClick:()=>{},children:"Enter Ethereum address..",disabled:!0}},{should:Oe,fallbackProps:{onClick:()=>{},children:"Insufficient balance",disabled:!0}},{should:!v,fallbackProps:{onClick:()=>{},children:"Fetching best price..",disabled:!0}}],onClick:bo,children:[k(ne,{mr:"20px",children:[k(W,{color:"background",fontSize:12,children:[dt," ",p.ticker]}),A(W,{color:"background",textAlign:"left",fontSize:"8px",mt:"2px",children:"Total amount"})]}),A(W,{color:"background",children:"Mint"})]})})]})]})},Kd=es;export{Qi as LoadingScreen,Kd as default};
